Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fusioncharts/core

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fusioncharts/core - npm Package Compare versions

Comparing version 1.9.3 to 1.9.4-beta.1

src/lib/index.spec.js

6

package.json
{
"name": "@fusioncharts/core",
"version": "1.9.3",
"version": "1.9.4-beta.1",
"description": "JavaScript Data Visualisation Library",

@@ -26,3 +26,3 @@ "author": "FusionCharts, Inc. <support@fusioncharts.com>",

"@babel/runtime": "^7.9.2",
"@fusioncharts/utils": "^1.9.3",
"@fusioncharts/utils": "^1.9.4-beta.1",
"core-js": "^3.0.1",

@@ -47,3 +47,3 @@ "ramda": "^0.29.0"

],
"gitHead": "e73fb17eb5b39762daf6a334f9f7286cb6c8da13"
"gitHead": "af419333aa925a91c6b3483355ddfffb1d0e2b04"
}

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=_default;var _domEvent=_interopRequireDefault(require("../../dom-event"));var _lib=require("../../lib");var _fusionEventWrapper=_interopRequireDefault(require("../../fusion-events-wrapper/fusion-event-wrapper"));function _default(R){var UNDEF,win=window,doc=win.document,isIE=/msie/i.test(win.navigator.userAgent)&&!win.opera,isVML=R.type==="VML",NONE="none",ABSOLUTE="absolute",BLANK="",PX="px",proto,styleAttrMap={cursor:"cursor"},styleAttrNumericMap={x:"left",y:"top",strokeWidth:"borderThickness","stroke-width":"borderThickness",width:"width",height:"height"},styleAttrColorMap={fill:"backgroundColor",stroke:"borderColor",color:"color"},defaultElementStyle={left:0,top:0,padding:0,border:NONE,margin:0,outline:NONE,"-webkit-apperance":NONE,position:ABSOLUTE,zIndex:20},fusionEventWrapper=new _fusionEventWrapper.default,hashify=function hashify(color){return color&&color.replace(/^#?([a-f0-9]+)/gi,"#$1")||NONE},garbageBin,createElement=function createElement(tagName,attributes,css,parentElement){var elem=doc.createElement(tagName),x;for(x in attributes){if(styleAttrNumericMap[x]){elem.style[x]=attributes[x]}else{elem.setAttribute(x,attributes[x])}}for(x in css){elem.style[x]=css[x]}parentElement&&parentElement.appendChild&&parentElement.appendChild(elem);return elem},discardElement=function discardElement(element){if(!garbageBin){garbageBin=createElement("div")}if(element){garbageBin.appendChild(element)}garbageBin.innerHTML=""},_attr=function attr(elem,prop,value){var key,ret;if(typeof prop==="string"){if(value!==UNDEF&&value!==null){elem.setAttribute(prop,value)}else if(elem&&elem.getAttribute){ret=elem.getAttribute(prop)}}else if(prop!==UNDEF&&prop!==null&&typeof prop==="object"){for(key in prop){elem.setAttribute(key,prop[key])}}return ret},_HTMLElement;_HTMLElement=function HTMLElement(node,_group,attrs){var wrapper=this,group=_group;if(group&&group instanceof _HTMLElement){group=group.element}wrapper.element=createElement(node,attrs,defaultElementStyle,group);wrapper.nodeName=node.toLowerCase();wrapper.added=Boolean(group);wrapper.attrs={}};proto=_HTMLElement.prototype={attr:function attr(hash){var wrapper=this,element=wrapper.element,restore={},key,val,value,skipAttr,state,optionArr,optionString,i,len,ele;if(typeof hash!=="object"){return wrapper[hash]!==UNDEF?wrapper[hash]:_attr(element,hash)}for(key in hash){value=hash[key];if(styleAttrMap[key]){switch(key){case"cursor":if(value==="pointer"&&isVML){value="hand"}break}element.style[styleAttrMap[key]]=value;skipAttr=true}else if(styleAttrNumericMap[key]){element.style[styleAttrNumericMap[key]]=value+PX;skipAttr=true}else if(styleAttrColorMap[key]){element.style[styleAttrColorMap[key]]=hashify(value);skipAttr=true}else if(/^visibility$/i.test(key)){state=value==="hidden";element.style.display=state?"none":"";wrapper.hidden=state;skipAttr=true}else if(/^opacity$/i.test(key)){element.style.opacity=value;if(isIE){val=Number(value)*100;element.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity="+val+")"}skipAttr=true}else if(/^innerhtml$/i.test(key)){if(isVML&&element.nodeName.toLowerCase()==="select"){optionArr=value.match(/<option\s?[\s\S]*?(\/>|><\/option>|>[\s\S]*?<\/option>)/gi);while(element.firstChild){element.removeChild(element.firstChild)}for(i=0,len=optionArr.length;i<len;i+=1){optionString=optionArr[i];ele=doc.createElement("option");if(/<option\s([\s\S]*[\'\"])\s*?(\/>|>[\s\S]*<\/option>)/gi.test(optionString)){ele.value=optionString.replace(/<option\s([\s\S]*[\'\"])\s*?(\/>|>[\s\S]*<\/option>)/gi,"$1").replace(/[\s\S]*value\s*\=\s*[\'\"]([\s\S]*)[\'\"]/,"$1")}ele.text=optionString.replace(/<option\s*[\s\S]*[\'\"]?\s*?[\/>|\>]([\s\S]*)<\/option>/gi,"$1 ");element.options.add(ele)}}else{element.nodeName.toLowerCase()!=="input"&&value!==UNDEF&&(element.innerHTML=value||BLANK)}skipAttr=true}else if(/^text$/i.test(key)){if(element.nodeName.toLowerCase()!=="input"){element.innerHTML="";value!==UNDEF&&element.appendChild(doc.createTextNode(value))}skipAttr=true}else if(/^type$/i.test(key)&&isIE&&wrapper.added){skipAttr=true}if(skipAttr){restore[key]=value;delete hash[key];skipAttr=false}}for(key in hash){element.setAttribute(key,hash[key])}for(key in restore){wrapper[key]=wrapper.attrs[key]=hash[key]=restore[key];delete restore[key]}return this},val:function val(set){var wrapper=this,element=wrapper.element,getter=set===UNDEF;if(wrapper.nodeName==="input"&&element.getAttribute("type")==="checkbox"){return getter?wrapper.checked()?1:0:wrapper.checked(set)}else if(wrapper.nodeName==="select"){var childNodes=element.childNodes,selectedIndex=element.selectedIndex,len=childNodes.length;if(set===""){return}if(!getter){for(var i=0;i<len;i++){if(childNodes[i].value===set){element.selectedIndex=i;return childNodes[i].value}}}_lib.isIE9&&(selectedIndex=0);return getter?childNodes[selectedIndex].value:(childNodes[len-1].value=set,element.selectedIndex=len-1,wrapper)}return getter?element.value:(element.value=set,wrapper)},checked:function checked(set){var wrapper=this,element=wrapper.element;return set===UNDEF?element.checked:(set?element.setAttribute("checked","checked"):element.removeAttribute("checked"),wrapper)},css:function css(hash,val){var wrapper=this,element=wrapper.element,styleObj=element.style,key;if(typeof hash==="object"){for(key in hash){styleObj[key]=hash[key]}}else if(key){if(val!==UNDEF){styleObj[key]=val}}return wrapper},translate:function translate(x,y){var wrapper=this,element=wrapper.element;if(x!==UNDEF){element.style.left=x+PX}if(y!==UNDEF){element.style.top=y+PX}return wrapper},add:function add(group,prepend){var wrapper=this,element=this.element,parent=group.element;if(prepend){parent.insertBefore(element,parent.firstChild)}else{parent.appendChild(element)}wrapper.added=true;return wrapper},hide:function hide(){this.element.style.display="none";return this},show:function show(){this.element.style.display="";return this},isVisible:function isVisible(){return this.element.style.display!=="none"},focus:function focus(){if(typeof this.element.focus==="function"){this.element.focus()}else{_domEvent.default.fire(this.element,"focus")}},destroy:function destroy(){var wrapper=this,element=wrapper.element||{},key,fnStr="function";element.onclick=element.onmouseout=element.onmouseover=element.onmousemove=element.onblur=element.onfocus=null;element=discardElement(element);delete wrapper.element;for(key in wrapper){wrapper[key]=typeof wrapper[key]===fnStr?R._removedFactory(key):null}wrapper.removed=true;return null},on:function on(eventType,handler){var fn=handler,wrapper=this;fusionEventWrapper.on(this.element,eventType,fn);return wrapper},off:function off(eventType,handler){fusionEventWrapper.off(this.element,eventType,handler)},bind:function bind(event,handler,data){_domEvent.default.listen(this.element,event,handler,data);return this},unbind:function unbind(event,handler){_domEvent.default.unlisten(this.element,event,handler);return this},trigger:function trigger(event,eventObj){_domEvent.default.fire(this.element,event,eventObj);return this}};proto.remove=proto.destroy;proto.constructor=_HTMLElement;R.fn.html=function(node,attrs,css,group){var rootAttr={},wrapper,prop;if(attrs&&"type"in attrs){rootAttr.type=attrs.type;delete attrs.type}wrapper=new _HTMLElement(node,group,rootAttr).css(css).attr(attrs);for(prop in rootAttr){attrs[prop]=rootAttr[prop]}wrapper.ca=function(){return false};wrapper.appendTo=function(_container){var container=_container;this.parent=container;if(container&&container instanceof _HTMLElement){container=container.element}container.appendChild(this.element)};wrapper.animateWith=R.el.animateWith;return wrapper}}
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=_default;var _domEvent=_interopRequireDefault(require("../../dom-event"));var _lib=require("../../lib");var _fusionEventWrapper=_interopRequireDefault(require("../../fusion-events-wrapper/fusion-event-wrapper"));var _trustedPolicy=_interopRequireDefault(require("../../../../fc-features/src/utils/trusted-policy"));function _default(R){var UNDEF,win=window,doc=win.document,isIE=/msie/i.test(win.navigator.userAgent)&&!win.opera,isVML=R.type==="VML",NONE="none",ABSOLUTE="absolute",BLANK="",PX="px",proto,styleAttrMap={cursor:"cursor"},styleAttrNumericMap={x:"left",y:"top",strokeWidth:"borderThickness","stroke-width":"borderThickness",width:"width",height:"height"},styleAttrColorMap={fill:"backgroundColor",stroke:"borderColor",color:"color"},defaultElementStyle={left:0,top:0,padding:0,border:NONE,margin:0,outline:NONE,"-webkit-apperance":NONE,position:ABSOLUTE,zIndex:20},fusionEventWrapper=new _fusionEventWrapper.default,hashify=function hashify(color){return color&&color.replace(/^#?([a-f0-9]+)/gi,"#$1")||NONE},garbageBin,createElement=function createElement(tagName,attributes,css,parentElement){var elem=doc.createElement(tagName),x;for(x in attributes){if(styleAttrNumericMap[x]){elem.style[x]=attributes[x]}else{elem.setAttribute(x,attributes[x])}}for(x in css){elem.style[x]=css[x]}parentElement&&parentElement.appendChild&&parentElement.appendChild(elem);return elem},discardElement=function discardElement(element){if(!garbageBin){garbageBin=createElement("div")}if(element){garbageBin.appendChild(element)}garbageBin.innerHTML=_trustedPolicy.default.createHTML("")},_attr=function attr(elem,prop,value){var key,ret;if(typeof prop==="string"){if(value!==UNDEF&&value!==null){elem.setAttribute(prop,value)}else if(elem&&elem.getAttribute){ret=elem.getAttribute(prop)}}else if(prop!==UNDEF&&prop!==null&&typeof prop==="object"){for(key in prop){elem.setAttribute(key,prop[key])}}return ret},_HTMLElement;_HTMLElement=function HTMLElement(node,_group,attrs){var wrapper=this,group=_group;if(group&&group instanceof _HTMLElement){group=group.element}wrapper.element=createElement(node,attrs,defaultElementStyle,group);wrapper.nodeName=node.toLowerCase();wrapper.added=Boolean(group);wrapper.attrs={}};proto=_HTMLElement.prototype={attr:function attr(hash){var wrapper=this,element=wrapper.element,restore={},key,val,value,skipAttr,state,optionArr,optionString,i,len,ele;if(typeof hash!=="object"){return wrapper[hash]!==UNDEF?wrapper[hash]:_attr(element,hash)}for(key in hash){value=hash[key];if(styleAttrMap[key]){switch(key){case"cursor":if(value==="pointer"&&isVML){value="hand"}break}element.style[styleAttrMap[key]]=value;skipAttr=true}else if(styleAttrNumericMap[key]){element.style[styleAttrNumericMap[key]]=value+PX;skipAttr=true}else if(styleAttrColorMap[key]){element.style[styleAttrColorMap[key]]=hashify(value);skipAttr=true}else if(/^visibility$/i.test(key)){state=value==="hidden";element.style.display=state?"none":"";wrapper.hidden=state;skipAttr=true}else if(/^opacity$/i.test(key)){element.style.opacity=value;if(isIE){val=Number(value)*100;element.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity="+val+")"}skipAttr=true}else if(/^innerhtml$/i.test(key)){if(isVML&&element.nodeName.toLowerCase()==="select"){optionArr=value.match(/<option\s?[\s\S]*?(\/>|><\/option>|>[\s\S]*?<\/option>)/gi);while(element.firstChild){element.removeChild(element.firstChild)}for(i=0,len=optionArr.length;i<len;i+=1){optionString=optionArr[i];ele=doc.createElement("option");if(/<option\s([\s\S]*[\'\"])\s*?(\/>|>[\s\S]*<\/option>)/gi.test(optionString)){ele.value=optionString.replace(/<option\s([\s\S]*[\'\"])\s*?(\/>|>[\s\S]*<\/option>)/gi,"$1").replace(/[\s\S]*value\s*\=\s*[\'\"]([\s\S]*)[\'\"]/,"$1")}ele.text=optionString.replace(/<option\s*[\s\S]*[\'\"]?\s*?[\/>|\>]([\s\S]*)<\/option>/gi,"$1 ");element.options.add(ele)}}else{element.nodeName.toLowerCase()!=="input"&&value!==UNDEF&&(element.innerHTML=value||BLANK)}skipAttr=true}else if(/^text$/i.test(key)){if(element.nodeName.toLowerCase()!=="input"){element.innerHTML=_trustedPolicy.default.createHTML("");value!==UNDEF&&element.appendChild(doc.createTextNode(value))}skipAttr=true}else if(/^type$/i.test(key)&&isIE&&wrapper.added){skipAttr=true}if(skipAttr){restore[key]=value;delete hash[key];skipAttr=false}}for(key in hash){element.setAttribute(key,hash[key])}for(key in restore){wrapper[key]=wrapper.attrs[key]=hash[key]=restore[key];delete restore[key]}return this},val:function val(set){var wrapper=this,element=wrapper.element,getter=set===UNDEF;if(wrapper.nodeName==="input"&&element.getAttribute("type")==="checkbox"){return getter?wrapper.checked()?1:0:wrapper.checked(set)}else if(wrapper.nodeName==="select"){var childNodes=element.childNodes,selectedIndex=element.selectedIndex,len=childNodes.length;if(set===""){return}if(!getter){for(var i=0;i<len;i++){if(childNodes[i].value===set){element.selectedIndex=i;return childNodes[i].value}}}_lib.isIE9&&(selectedIndex=0);return getter?childNodes[selectedIndex].value:(childNodes[len-1].value=set,element.selectedIndex=len-1,wrapper)}return getter?element.value:(element.value=set,wrapper)},checked:function checked(set){var wrapper=this,element=wrapper.element;return set===UNDEF?element.checked:(set?element.setAttribute("checked","checked"):element.removeAttribute("checked"),wrapper)},css:function css(hash,val){var wrapper=this,element=wrapper.element,styleObj=element.style,key;if(typeof hash==="object"){for(key in hash){styleObj[key]=hash[key]}}else if(key){if(val!==UNDEF){styleObj[key]=val}}return wrapper},translate:function translate(x,y){var wrapper=this,element=wrapper.element;if(x!==UNDEF){element.style.left=x+PX}if(y!==UNDEF){element.style.top=y+PX}return wrapper},add:function add(group,prepend){var wrapper=this,element=this.element,parent=group.element;if(prepend){parent.insertBefore(element,parent.firstChild)}else{parent.appendChild(element)}wrapper.added=true;return wrapper},hide:function hide(){this.element.style.display="none";return this},show:function show(){this.element.style.display="";return this},isVisible:function isVisible(){return this.element.style.display!=="none"},focus:function focus(){if(typeof this.element.focus==="function"){this.element.focus()}else{_domEvent.default.fire(this.element,"focus")}},destroy:function destroy(){var wrapper=this,element=wrapper.element||{},key,fnStr="function";element.onclick=element.onmouseout=element.onmouseover=element.onmousemove=element.onblur=element.onfocus=null;element=discardElement(element);delete wrapper.element;for(key in wrapper){wrapper[key]=typeof wrapper[key]===fnStr?R._removedFactory(key):null}wrapper.removed=true;return null},on:function on(eventType,handler){var fn=handler,wrapper=this;fusionEventWrapper.on(this.element,eventType,fn);return wrapper},off:function off(eventType,handler){fusionEventWrapper.off(this.element,eventType,handler)},bind:function bind(event,handler,data){_domEvent.default.listen(this.element,event,handler,data);return this},unbind:function unbind(event,handler){_domEvent.default.unlisten(this.element,event,handler);return this},trigger:function trigger(event,eventObj){_domEvent.default.fire(this.element,event,eventObj);return this}};proto.remove=proto.destroy;proto.constructor=_HTMLElement;R.fn.html=function(node,attrs,css,group){var rootAttr={},wrapper,prop;if(attrs&&"type"in attrs){rootAttr.type=attrs.type;delete attrs.type}wrapper=new _HTMLElement(node,group,rootAttr).css(css).attr(attrs);for(prop in rootAttr){attrs[prop]=rootAttr[prop]}wrapper.ca=function(){return false};wrapper.appendTo=function(_container){var container=_container;this.parent=container;if(container&&container instanceof _HTMLElement){container=container.element}container.appendChild(this.element)};wrapper.animateWith=R.el.animateWith;return wrapper}}

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _lib=_interopRequireDefault(require("./lib"));var slLib=_lib.default.init(window),doc=slLib.win.document,documentSupport=slLib.getDocumentSupport(),SVG_BBOX_CORRECTION=documentSupport.isWebKit?0:4.5;function ContainerManager(parentContainer,isBrowserLess,maxContainers){var svg;maxContainers=maxContainers>5?maxContainers:5;maxContainers=maxContainers<20?maxContainers:20;this.maxContainers=maxContainers;this.first=null;this.last=null;this.containers={};this.length=0;this.rootNode=parentContainer;if(isBrowserLess){svg=doc.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttributeNS("http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink");svg.setAttributeNS("http://www.w3.org/2000/svg","height","0");svg.setAttributeNS("http://www.w3.org/2000/svg","width","0");this.svgRoot=svg;this.rootNode.appendChild(svg)}}ContainerManager.prototype.get=function(style){var diff,key,containerObj,containers=this.containers,len=this.length,max=this.maxContainers,keyStr="";for(key in slLib.supportedStyle){if(style[key]!==undefined){keyStr+=slLib.supportedStyle[key]+":"+style[key]+";"}}if(!keyStr){return false}if(containerObj=containers[keyStr]){if(this.first!==containerObj){if(containerObj.prev){containerObj.prev.next=containerObj.next}if(containerObj.next){containerObj.next.prev=containerObj.prev}containerObj.next=this.first;containerObj.next.prev=containerObj;if(this.last===containerObj){this.last=containerObj.prev}containerObj.prev=null;this.first=containerObj}}else{if(len>=max){diff=len-max+1;while(diff--){this.removeContainer(this.last)}}containerObj=this.addContainer(keyStr)}return containerObj};ContainerManager.prototype._makeDivNode=function(container){var node,keyStr=container.keyStr;if(!container.node){container.node=doc.createElement("div");container.node.className="fusioncharts-div";this.rootNode.appendChild(container.node)}node=container.node;if(documentSupport.isIE&&!documentSupport.hasSVG){node.style.setAttribute("cssText",keyStr)}else{node.setAttribute("style",keyStr)}node.setAttribute("aria-hidden","true");node.setAttribute("role","presentation");node.style.display="inline-block";node.innerHTML=slLib.testStrAvg;container.lineHeight=node.offsetHeight;container.avgCharWidth=node.offsetWidth/3;if(documentSupport.isBrowserLess){if(!container.svgText){container.svgText=doc.createElementNS("http://www.w3.org/2000/svg","text");this.svgRoot.appendChild(node)}node=container.svgText;node.setAttribute("style",keyStr);node.textContent=slLib.testStrAvg;container.lineHeight=node.getBBox().height;container.avgCharWidth=(node.getBBox().width-SVG_BBOX_CORRECTION)/3;node.textContent="...";container.ellipsesWidth=node.getBBox().width-SVG_BBOX_CORRECTION;node.textContent=".";container.dotWidth=node.getBBox().width-SVG_BBOX_CORRECTION}else{node.innerHTML="...";container.ellipsesWidth=node.offsetWidth;node.innerHTML=".";container.dotWidth=node.offsetWidth;node.innerHTML=""}};ContainerManager.prototype.addContainer=function(keyStr){var container;this.containers[keyStr]=container={next:null,prev:null,node:null,ellipsesWidth:0,lineHeight:0,dotWidth:0,avgCharWidth:4,keyStr:keyStr,charCache:{}};container.next=this.first;if(container.next){container.next.prev=container}this.first=container;if(!this.last){this.last=container}this.length+=1;return container};ContainerManager.prototype.removeContainer=function(cObj){var keyStr=cObj.keyStr;if(!keyStr||!this.length||!cObj){return}this.length-=1;if(cObj.prev){cObj.prev.next=cObj.next}if(cObj.next){cObj.next.prev=cObj.prev}if(this.first===cObj){this.first=cObj.next}if(this.last===cObj){this.last=cObj.prev}if(cObj.node){cObj.node.parentNode.removeChild(cObj.node)}delete this.containers[keyStr]};ContainerManager.prototype.dispose=function(){var key,containers=this.containers;this.maxContainers=null;for(key in containers){this.removeContainer(containers[key])}this.rootNode.parentNode.removeChild(this.rootNode);this.rootNode=null;this.first=null;this.last=null};var _default=ContainerManager;exports.default=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _lib=_interopRequireDefault(require("./lib"));var _trustedPolicy=_interopRequireDefault(require("../../../../../../fc-features/src/utils/trusted-policy"));var slLib=_lib.default.init(window),doc=slLib.win.document,documentSupport=slLib.getDocumentSupport(),SVG_BBOX_CORRECTION=documentSupport.isWebKit?0:4.5;function ContainerManager(parentContainer,isBrowserLess,maxContainers){var svg;maxContainers=maxContainers>5?maxContainers:5;maxContainers=maxContainers<20?maxContainers:20;this.maxContainers=maxContainers;this.first=null;this.last=null;this.containers={};this.length=0;this.rootNode=parentContainer;if(isBrowserLess){svg=doc.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttributeNS("http://www.w3.org/2000/svg","xlink","http://www.w3.org/1999/xlink");svg.setAttributeNS("http://www.w3.org/2000/svg","height","0");svg.setAttributeNS("http://www.w3.org/2000/svg","width","0");this.svgRoot=svg;this.rootNode.appendChild(svg)}}ContainerManager.prototype.get=function(style){var diff,key,containerObj,containers=this.containers,len=this.length,max=this.maxContainers,keyStr="";for(key in slLib.supportedStyle){if(style[key]!==undefined){keyStr+=slLib.supportedStyle[key]+":"+style[key]+";"}}if(!keyStr){return false}if(containerObj=containers[keyStr]){if(this.first!==containerObj){if(containerObj.prev){containerObj.prev.next=containerObj.next}if(containerObj.next){containerObj.next.prev=containerObj.prev}containerObj.next=this.first;containerObj.next.prev=containerObj;if(this.last===containerObj){this.last=containerObj.prev}containerObj.prev=null;this.first=containerObj}}else{if(len>=max){diff=len-max+1;while(diff--){this.removeContainer(this.last)}}containerObj=this.addContainer(keyStr)}return containerObj};ContainerManager.prototype._makeDivNode=function(container){var node,keyStr=container.keyStr;if(!container.node){container.node=doc.createElement("div");container.node.className="fusioncharts-div";this.rootNode.appendChild(container.node)}node=container.node;if(documentSupport.isIE&&!documentSupport.hasSVG){node.style.setAttribute("cssText",keyStr)}else{node.style=keyStr}node.setAttribute("aria-hidden","true");node.setAttribute("role","presentation");node.style.display="inline-block";node.innerHTML=_trustedPolicy.default.createHTML(slLib.testStrAvg);container.lineHeight=node.offsetHeight;container.avgCharWidth=node.offsetWidth/3;if(documentSupport.isBrowserLess){if(!container.svgText){container.svgText=doc.createElementNS("http://www.w3.org/2000/svg","text");this.svgRoot.appendChild(node)}node=container.svgText;node.style=keyStr;node.textContent=slLib.testStrAvg;container.lineHeight=node.getBBox().height;container.avgCharWidth=(node.getBBox().width-SVG_BBOX_CORRECTION)/3;node.textContent="...";container.ellipsesWidth=node.getBBox().width-SVG_BBOX_CORRECTION;node.textContent=".";container.dotWidth=node.getBBox().width-SVG_BBOX_CORRECTION}else{node.innerHTML=_trustedPolicy.default.createHTML("...");container.ellipsesWidth=node.offsetWidth;node.innerHTML=_trustedPolicy.default.createHTML(".");container.dotWidth=node.offsetWidth;node.innerHTML=_trustedPolicy.default.createHTML("")}};ContainerManager.prototype.addContainer=function(keyStr){var container;this.containers[keyStr]=container={next:null,prev:null,node:null,ellipsesWidth:0,lineHeight:0,dotWidth:0,avgCharWidth:4,keyStr:keyStr,charCache:{}};container.next=this.first;if(container.next){container.next.prev=container}this.first=container;if(!this.last){this.last=container}this.length+=1;return container};ContainerManager.prototype.removeContainer=function(cObj){var keyStr=cObj.keyStr;if(!keyStr||!this.length||!cObj){return}this.length-=1;if(cObj.prev){cObj.prev.next=cObj.next}if(cObj.next){cObj.next.prev=cObj.prev}if(this.first===cObj){this.first=cObj.next}if(this.last===cObj){this.last=cObj.prev}if(cObj.node){cObj.node.parentNode.removeChild(cObj.node)}delete this.containers[keyStr]};ContainerManager.prototype.dispose=function(){var key,containers=this.containers;this.maxContainers=null;for(key in containers){this.removeContainer(containers[key])}this.rootNode.parentNode.removeChild(this.rootNode);this.rootNode=null;this.first=null;this.last=null};var _default=ContainerManager;exports.default=_default;

@@ -1,1 +0,1 @@

"use strict";exports.__esModule=true;exports.default=void 0;var lib={init:function init(win){var doc=win.document,nav=win.navigator,userAgent=nav.userAgent,DIV="DIV",ceil=Math.ceil,floor=Math.floor,clsNameSpace="fusioncharts-smartlabel-",containerClass=clsNameSpace+"container",classNameWithTag=clsNameSpace+"tag",classNameWithTagBR=clsNameSpace+"br";lib={win:win,containerClass:containerClass,classNameWithTag:classNameWithTag,classNameWithTagBR:classNameWithTagBR,maxDefaultCacheLimit:1e3,classNameReg:/\bfusioncharts-smartlabel-tag\b/,classNameBrReg:/\bfusioncharts-smartlabel-br\b/,spanAdditionRegx:/(<[^<\>]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/gi,spanAdditionReplacer:'$1<span class="'+classNameWithTag+'">$2</span>',spanRemovalRegx:new RegExp("\\<span[^\\>]+?"+classNameWithTag+"[^\\>]{0,}\\>(.*?)\\<\\/span\\>","ig"),xmlTagRegEx:new RegExp("<[^>][^<]*[^>]+>","i"),brRegex:new RegExp("({br[ ]*})|(<br[ ]*>)|(<br[ ]*/>)|(<BR[ ]*/>)|(<br\\>)","g"),ltgtquotRegex:/&lt;|&gt;|&quot;|&#034;|&#039;/g,nbspRegex:/&nbsp;|&#160;|&#xA0;/g,htmlSpecialEntityRegex:/&amp;|&quot;|&lt;|&gt;/g,brReplaceRegex:/<br\/>/gi,testStrAvg:"WgI",parentContainerStyle:{position:"absolute",top:"-9999em",whiteSpace:"nowrap",padding:"0px",width:"1px",height:"1px",overflow:"hidden"},supportedStyle:{font:"font",fontFamily:"font-family","font-family":"font-family",fontWeight:"font-weight","font-weight":"font-weight",fontSize:"font-size","font-size":"font-size",lineHeight:"line-height","line-height":"line-height",fontStyle:"font-style","font-style":"font-style"},getDocumentSupport:function getDocumentSupport(){var childRetriverFn,childRetriverString,noClassTesting;if(doc.getElementsByClassName){childRetriverFn="getElementsByClassName";childRetriverString=classNameWithTag;noClassTesting=true}else{childRetriverFn="getElementsByTagName";childRetriverString="span";noClassTesting=false}return{isIE:/msie/i.test(userAgent)&&!win.opera,hasSVG:Boolean(win.SVGAngle||doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")),isHeadLess:new RegExp(" HtmlUnit").test(userAgent),isWebKit:new RegExp(" AppleWebKit/").test(userAgent),childRetriverFn:childRetriverFn,childRetriverString:childRetriverString,noClassTesting:noClassTesting}},createContainer:function createContainer(containerParent){var body,container;if(containerParent&&(containerParent.offsetWidth||containerParent.offsetHeight)){if(containerParent.appendChild){containerParent.appendChild(container=doc.createElement(DIV));container.className=containerClass;container.setAttribute("aria-hidden","true");container.setAttribute("role","presentation");return container}}else{body=doc.getElementsByTagName("body")[0];if(body&&body.appendChild){container=doc.createElement(DIV);container.className=containerClass;container.setAttribute("aria-hidden","true");container.setAttribute("role","presentation");body.appendChild(container);return container}}},getNearestBreakIndex:function getNearestBreakIndex(text,maxWidth,sl){if(!text||!text.length){return 0}var difference,getWidth=sl._getWidthFn(),charLen=0,increment=0,oriWidth=getWidth(text),avgWidth=oriWidth/text.length;difference=maxWidth;charLen=ceil(maxWidth/avgWidth);if(oriWidth<maxWidth){return text.length-1}if(charLen>text.length){difference=maxWidth-oriWidth;charLen=text.length}while(difference>0){difference=maxWidth-getWidth(text.substr(0,charLen));increment=floor(difference/avgWidth);if(increment){charLen+=increment}else{return charLen}}while(difference<0){difference=maxWidth-getWidth(text.substr(0,charLen));increment=floor(difference/avgWidth);if(increment){charLen+=increment}else{return charLen}}return charLen},parseStyle:function parseStyle(style){if(style===void 0){style={}}var parsedStyle={};parsedStyle.fontSize=(style.fontSize||style["font-size"]||"12px")+"";parsedStyle.fontVariant=style.fontVariant||style["font-variant"]||"normal";parsedStyle.fontWeight=style.fontWeight||style["font-weight"]||"normal";parsedStyle.fontStyle=style.fontStyle||style["font-style"]||"normal";parsedStyle.fontFamily=style.fontFamily||style["font-family"]||"Verdana,sans";parsedStyle.fontSize+=parsedStyle.fontSize.indexOf("px")===-1?"px":"";return parsedStyle},setLineHeight:function setLineHeight(styleObj){var fSize=styleObj.fontSize;styleObj.lineHeight=styleObj.lineHeight||styleObj["line-height"]||parseInt(fSize,10)*1.2+"px";return styleObj},_getCleanHeight:function _getCleanHeight(height){height=height.replace(/px/g,"");return Number(height)},_getDimentionUsingDiv:function _getDimentionUsingDiv(text,sl){if(text===void 0){text=""}var container=sl._container;if(text instanceof Array){text=text.join("")}container.innerHTML=text;return{width:container.offsetWidth,height:container.offsetHeight}},_getDimentionUsingCanvas:function _getDimentionUsingCanvas(text,sl){if(text===void 0){text=""}var ctx=sl.ctx,style=sl.style,height=lib._getCleanHeight(style.lineHeight);if(!(text instanceof Array)){text=text.replace(/<br \/>/g,"")}else{text=text.join("");text=text.replace(/<br \/>/g,"")}return{width:ctx.measureText(text).width,height:height}},_hasOnlyBRTag:function _hasOnlyBRTag(input){if(input===void 0){input=""}return!lib.xmlTagRegEx.test(input)&&lib.brRegex.test(input)},_getDimentionOfMultiLineText:function _getDimentionOfMultiLineText(rawText,sl){if(rawText===void 0){rawText=""}var i,len,text=rawText.replace(lib.brRegex,"<br />"),textAr=lib._getTextArray(text),width=0,maxWidth=0,getWidth=sl._getWidthFn(),height=lib._getCleanHeight(sl.style.lineHeight),textHeight=height,textWidth,indiSizeStore={};for(i=0,len=textAr.length;i<len;i++){if(textAr[i]==="<br />"){maxWidth=Math.max(maxWidth,width);width=0;textHeight+=height}else{textWidth=getWidth(textAr[i]);width+=textWidth;indiSizeStore[textAr[i]]=textWidth}}maxWidth=Math.max(maxWidth,width);return{height:textHeight,width:maxWidth,detailObj:indiSizeStore}},_getTextArray:function _getTextArray(text){if(text===void 0){text=""}var i,j,len,tempLen,brText,tempText,finaltextAr=[];brText=text.split("<br />");len=brText.length;for(i=0;i<len;i++){tempText=brText[i].split("");tempLen=tempText.length;for(j=0;j<tempLen;j++){finaltextAr.push(tempText[j])}if(i!==len-1){finaltextAr.push("<br />")}}return finaltextAr},_findLastIndex:function _findLastIndex(array,item){if(array===void 0){array=[]}var i,len=array.length;for(i=len-1;i>=0;i--){if(array[i]===item){return i}}return-1}};return lib}};var _default=lib;exports.default=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _trustedPolicy=_interopRequireDefault(require("../../../../../../fc-features/src/utils/trusted-policy"));var lib={init:function init(win){var doc=win.document,nav=win.navigator,userAgent=nav.userAgent,DIV="DIV",ceil=Math.ceil,floor=Math.floor,clsNameSpace="fusioncharts-smartlabel-",containerClass=clsNameSpace+"container",classNameWithTag=clsNameSpace+"tag",classNameWithTagBR=clsNameSpace+"br";lib={win:win,containerClass:containerClass,classNameWithTag:classNameWithTag,classNameWithTagBR:classNameWithTagBR,maxDefaultCacheLimit:1e3,classNameReg:/\bfusioncharts-smartlabel-tag\b/,classNameBrReg:/\bfusioncharts-smartlabel-br\b/,spanAdditionRegx:/(<[^<\>]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/gi,spanAdditionReplacer:'$1<span class="'+classNameWithTag+'">$2</span>',spanRemovalRegx:new RegExp("\\<span[^\\>]+?"+classNameWithTag+"[^\\>]{0,}\\>(.*?)\\<\\/span\\>","ig"),xmlTagRegEx:new RegExp("<[^>][^<]*[^>]+>","i"),brRegex:new RegExp("({br[ ]*})|(<br[ ]*>)|(<br[ ]*/>)|(<BR[ ]*/>)|(<br\\>)","g"),ltgtquotRegex:/&lt;|&gt;|&quot;|&#034;|&#039;/g,nbspRegex:/&nbsp;|&#160;|&#xA0;/g,htmlSpecialEntityRegex:/&amp;|&quot;|&lt;|&gt;/g,brReplaceRegex:/<br\/>/gi,testStrAvg:"WgI",parentContainerStyle:{position:"absolute",top:"-9999em",whiteSpace:"nowrap",padding:"0px",width:"1px",height:"1px",overflow:"hidden"},supportedStyle:{font:"font",fontFamily:"font-family","font-family":"font-family",fontWeight:"font-weight","font-weight":"font-weight",fontSize:"font-size","font-size":"font-size",lineHeight:"line-height","line-height":"line-height",fontStyle:"font-style","font-style":"font-style"},getDocumentSupport:function getDocumentSupport(){var childRetriverFn,childRetriverString,noClassTesting;if(doc.getElementsByClassName){childRetriverFn="getElementsByClassName";childRetriverString=classNameWithTag;noClassTesting=true}else{childRetriverFn="getElementsByTagName";childRetriverString="span";noClassTesting=false}return{isIE:/msie/i.test(userAgent)&&!win.opera,hasSVG:Boolean(win.SVGAngle||doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")),isHeadLess:new RegExp(" HtmlUnit").test(userAgent),isWebKit:new RegExp(" AppleWebKit/").test(userAgent),childRetriverFn:childRetriverFn,childRetriverString:childRetriverString,noClassTesting:noClassTesting}},createContainer:function createContainer(containerParent){var body,container;if(containerParent&&(containerParent.offsetWidth||containerParent.offsetHeight)){if(containerParent.appendChild){containerParent.appendChild(container=doc.createElement(DIV));container.className=containerClass;container.setAttribute("aria-hidden","true");container.setAttribute("role","presentation");return container}}else{body=doc.getElementsByTagName("body")[0];if(body&&body.appendChild){container=doc.createElement(DIV);container.className=containerClass;container.setAttribute("aria-hidden","true");container.setAttribute("role","presentation");body.appendChild(container);return container}}},getNearestBreakIndex:function getNearestBreakIndex(text,maxWidth,sl){if(!text||!text.length){return 0}var difference,getWidth=sl._getWidthFn(),charLen=0,increment=0,oriWidth=getWidth(text),avgWidth=oriWidth/text.length;difference=maxWidth;charLen=ceil(maxWidth/avgWidth);if(oriWidth<maxWidth){return text.length-1}if(charLen>text.length){difference=maxWidth-oriWidth;charLen=text.length}while(difference>0){difference=maxWidth-getWidth(text.substr(0,charLen));increment=floor(difference/avgWidth);if(increment){charLen+=increment}else{return charLen}}while(difference<0){difference=maxWidth-getWidth(text.substr(0,charLen));increment=floor(difference/avgWidth);if(increment){charLen+=increment}else{return charLen}}return charLen},parseStyle:function parseStyle(style){if(style===void 0){style={}}var parsedStyle={};parsedStyle.fontSize=(style.fontSize||style["font-size"]||"12px")+"";parsedStyle.fontVariant=style.fontVariant||style["font-variant"]||"normal";parsedStyle.fontWeight=style.fontWeight||style["font-weight"]||"normal";parsedStyle.fontStyle=style.fontStyle||style["font-style"]||"normal";parsedStyle.fontFamily=style.fontFamily||style["font-family"]||"Verdana,sans";parsedStyle.fontSize+=parsedStyle.fontSize.indexOf("px")===-1?"px":"";return parsedStyle},setLineHeight:function setLineHeight(styleObj){var fSize=styleObj.fontSize;styleObj.lineHeight=styleObj.lineHeight||styleObj["line-height"]||parseInt(fSize,10)*1.2+"px";return styleObj},_getCleanHeight:function _getCleanHeight(height){height=height.replace(/px/g,"");return Number(height)},_getDimentionUsingDiv:function _getDimentionUsingDiv(text,sl){if(text===void 0){text=""}var container=sl._container;if(text instanceof Array){text=text.join("")}container.innerHTML=_trustedPolicy.default.createHTML(text);return{width:container.offsetWidth,height:container.offsetHeight}},_getDimentionUsingCanvas:function _getDimentionUsingCanvas(text,sl){if(text===void 0){text=""}var ctx=sl.ctx,style=sl.style,height=lib._getCleanHeight(style.lineHeight);if(!(text instanceof Array)){text=text.replace(/<br \/>/g,"")}else{text=text.join("");text=text.replace(/<br \/>/g,"")}return{width:ctx.measureText(text).width,height:height}},_hasOnlyBRTag:function _hasOnlyBRTag(input){if(input===void 0){input=""}return!lib.xmlTagRegEx.test(input)&&lib.brRegex.test(input)},_getDimentionOfMultiLineText:function _getDimentionOfMultiLineText(rawText,sl){if(rawText===void 0){rawText=""}var i,len,text=rawText.replace(lib.brRegex,"<br />"),textAr=lib._getTextArray(text),width=0,maxWidth=0,getWidth=sl._getWidthFn(),height=lib._getCleanHeight(sl.style.lineHeight),textHeight=height,textWidth,indiSizeStore={};for(i=0,len=textAr.length;i<len;i++){if(textAr[i]==="<br />"){maxWidth=Math.max(maxWidth,width);width=0;textHeight+=height}else{textWidth=getWidth(textAr[i]);width+=textWidth;indiSizeStore[textAr[i]]=textWidth}}maxWidth=Math.max(maxWidth,width);return{height:textHeight,width:maxWidth,detailObj:indiSizeStore}},_getTextArray:function _getTextArray(text){if(text===void 0){text=""}var i,j,len,tempLen,brText,tempText,finaltextAr=[];brText=text.split("<br />");len=brText.length;for(i=0;i<len;i++){tempText=brText[i].split("");tempLen=tempText.length;for(j=0;j<tempLen;j++){finaltextAr.push(tempText[j])}if(i!==len-1){finaltextAr.push("<br />")}}return finaltextAr},_findLastIndex:function _findLastIndex(array,item){if(array===void 0){array=[]}var i,len=array.length;for(i=len-1;i>=0;i--){if(array[i]===item){return i}}return-1}};return lib}};var _default=lib;exports.default=_default;

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _lib=_interopRequireDefault(require("./lib"));var _containerManager=_interopRequireDefault(require("./container-manager"));function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach((function(key){(0,_defineProperty2.default)(target,key,source[key])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}}return target}var slLib=_lib.default.init(window),doc=slLib.win.document,M=slLib.win.Math,max=M.max,round=M.round,htmlSplCharSpace={" ":"&nbsp;"},documentSupport=slLib.getDocumentSupport(),SVG_BBOX_CORRECTION=documentSupport.isWebKit?0:4.5;function SmartLabelManager(container,useEllipses,options){var wrapper,prop,max,isBrowserLess=false,canvas=window.document.createElement("canvas");options=options||{};options.maxCacheLimit=isFinite(max=options.maxCacheLimit)?max:slLib.maxDefaultCacheLimit;if(typeof container==="string"){container=doc.getElementById(container)}wrapper=slLib.createContainer(container);wrapper.innerHTML=slLib.testStrAvg;if(documentSupport.isHeadLess||!documentSupport.isIE&&!wrapper.offsetHeight&&!wrapper.offsetWidth){isBrowserLess=true}wrapper.innerHTML="";for(prop in slLib.parentContainerStyle){wrapper.style[prop]=slLib.parentContainerStyle[prop]}this.parentContainer=wrapper;this.ctx=canvas&&canvas.getContext&&canvas.getContext("2d");this._containerManager=new _containerManager.default(wrapper,isBrowserLess,10);this._showNoEllipses=!useEllipses;this._init=true;this.style={};this.oldStyle={};this.options=options;this.setStyle()}function getAbbrTagIndices(abbrRegex,abbrEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,endtagindices=[];while(result=abbrRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</abbr>";dummyNode.innerHTML=testAbbr;tagindices.push({tagName:result[0],index:result.index,title:dummyNode.childNodes[0].title?dummyNode.childNodes[0].title:"",endTagName:endtagText})}while(result=abbrEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}}function getStyles(el){var output={};if(!el||!el.style||!el.style.cssText){return output}var camelize=function camelize(str){return str.replace(/(?:^|[-])(\w)/g,(function(a,c){c=a.substr(0,1)==="-"?c.toUpperCase():c;return c?c:""}))};var style=el.style.cssText.split(";");for(var i=0;i<style.length;++i){var rule=style[i].trim();if(rule){var ruleParts=rule.split(":");var key=camelize(ruleParts[0].trim());output[key]=ruleParts[1].trim()}}return output}function getSpanTagIndices(spanRegex,spanEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,styleObj,endtagindices=[];while(result=spanRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</span>";dummyNode.innerHTML=testAbbr;styleObj=getStyles(dummyNode.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:"",endTagName:endtagText})}while(result=spanEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}}function getAnchorTagIndices(anchorRegex,anchorEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,endtagindices=[];while(result=anchorRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"</a>";dummyNode.innerHTML=testAbbr;tagindices.push({tagName:result[0],index:result.index,href:dummyNode.childNodes[0].href?dummyNode.childNodes[0].href:"",target:dummyNode.childNodes[0].target?dummyNode.childNodes[0].target:"",hreflang:dummyNode.childNodes[0].hreflang?dummyNode.childNodes[0].hreflang:"",referrerpolicy:dummyNode.childNodes[0].referrerpolicy?dummyNode.childNodes[0].referrerpolicy:"",rel:dummyNode.childNodes[0].rel?dummyNode.childNodes[0].rel:"",endTagName:endtagText})}while(result=anchorEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}}function getTagIndices(tagRegex,endTagRegex,text,tagText,endtagText){var tagindices=[],result,endtagindices=[];if(tagRegex){while(result=tagRegex.exec(text)){tagindices.push({tagName:tagText,index:result.index,endTagName:endtagText})}}if(endTagRegex){while(result=endTagRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}}return{tag:tagindices,endtag:endtagindices}}function sortTags(u,b,em,strike,sub,sup,abbr,a,sp,str,it,del,s,br){var i,j,tagArr=[u,b,em,strike,sub,sup,abbr,a,sp,str,it,del,s,br],res=[];for(j=0;j<tagArr.length;j++){for(var key in tagArr[j]){if(tagArr[j][key].length){for(i=0;i<tagArr[j][key].length;i++){res.push(tagArr[j][key][i])}}}}res=res.sort((function(a,b){return a.index-b.index}));return res}function getSortedBRTagIndices(text){var brRegex=/<br\s*\/?>/g,brTagIndices=getTagIndices(brRegex,undefined,text,"<br />",""),sortedIndices=sortTags({},{},{},{},{},{},{},{},{},{},{},{},{},brTagIndices);return sortedIndices}function getSortedTagIndices(text){var underlineRegex=/<u>/g,underlineEndRegex=/<\/u>/g,boldRegex=/<b>/g,boldEndRegex=/<\/b>/g,strongRegex=/<strong>/g,strongEndRegex=/<\/strong>/g,emphasisRegex=/<em>/g,emphasisEndRegex=/<\/em>/g,italicRegex=/<i>/g,italicEndRegex=/<\/i>/g,delRegex=/<del>/g,delEndRegex=/<\/del>/g,sRegex=/<s>/g,sEndRegex=/<\/s>/g,strikeRegex=/<strike>/g,strikeEndRegex=/<\/strike>/g,subscriptRegex=/<sub>/g,subscriptEndRegex=/<\/sub>/g,superscriptRegex=/<sup>/g,superscriptEndRegex=/<\/sup>/g,abbrRegex=/<abbr[\s]+([^>]+)>/g,abbrEndRegex=/<\/abbr>/g,spanRegex=/<span[\s]+([^>]+)>/g,spanEndRegex=/<\/span>/g,anchorRegex=/<a[\s]+([^>]+)>/g,anchorEndRegex=/<\/a>/g,brRegex=/<br\s*\/?>/g,underlinetagIndices=getTagIndices(underlineRegex,underlineEndRegex,text,"<u>","</u>"),boldtagIndices=getTagIndices(boldRegex,boldEndRegex,text,"<b>","</b>"),emtagIndices=getTagIndices(emphasisRegex,emphasisEndRegex,text,"<em>","</em>"),strikeTagIndices=getTagIndices(strikeRegex,strikeEndRegex,text,"<strike>","</strike>"),subscriptTagIndices=getTagIndices(subscriptRegex,subscriptEndRegex,text,"<sub>","</sub>"),superscriptTagIndices=getTagIndices(superscriptRegex,superscriptEndRegex,text,"<sup>","</sup>"),abbrTagIndices=getAbbrTagIndices(abbrRegex,abbrEndRegex,text,"<abbr>","</abbr>"),anchorTagIndices=getAnchorTagIndices(anchorRegex,anchorEndRegex,text,"<a>","</a>"),spanTagIndices=getSpanTagIndices(spanRegex,spanEndRegex,text,"<span>","</span>"),strongTagIndices=getTagIndices(strongRegex,strongEndRegex,text,"<strong>","</strong>"),italicTagIndices=getTagIndices(italicRegex,italicEndRegex,text,"<i>","</i>"),delTagIndices=getTagIndices(delRegex,delEndRegex,text,"<del>","</del>"),sTagIndices=getTagIndices(sRegex,sEndRegex,text,"<s>","</s>"),brTagIndices=getTagIndices(brRegex,undefined,text,"<br />",""),sortedIndices=sortTags(underlinetagIndices,boldtagIndices,emtagIndices,strikeTagIndices,subscriptTagIndices,superscriptTagIndices,abbrTagIndices,anchorTagIndices,spanTagIndices,strongTagIndices,italicTagIndices,delTagIndices,sTagIndices,brTagIndices);return sortedIndices}function spliceSlice(str,index,count,add){if(index<0){index=str.length+index;if(index<0){index=0}}return str.slice(0,index)+(add||"")+str.slice(index+count)}function getResolvedTags(text,tagIndices,brTagIndex,charOffset){var i,startPtr,endPtr,resultText=text,newBrIndex=brTagIndex.index,beforeTagindex=brTagIndex.index,afterTagindex=brTagIndex.index+6;if(!tagIndices.length){return{text:text,charOffset:charOffset}}startPtr=0;endPtr=tagIndices.length-1;if(tagIndices[startPtr].endTagName){afterTagindex=beforeTagindex+tagIndices[startPtr].endTagName.length+6}while(startPtr<=endPtr){if(tagIndices[startPtr].endTagName){if(startPtr===endPtr){resultText=spliceSlice(resultText,beforeTagindex,0,tagIndices[startPtr].endTagName);resultText=spliceSlice(resultText,afterTagindex,0,tagIndices[startPtr].tagName);newBrIndex=newBrIndex+tagIndices[startPtr].endTagName.length;beforeTagindex=newBrIndex-tagIndices[startPtr].endTagName.length;afterTagindex=newBrIndex+tagIndices[startPtr].endTagName.length+6+tagIndices[startPtr].tagName.length;charOffset+=tagIndices[startPtr].endTagName.length;charOffset+=tagIndices[startPtr].tagName.length;startPtr++;endPtr--}else if(tagIndices[startPtr].endTagName!==tagIndices[endPtr].tagName){for(i=startPtr;i<=endPtr;i++){if(tagIndices[i+1]){if(tagIndices[startPtr].endTagName===tagIndices[i+1].tagName){startPtr=i+2;break}}}if(i>endPtr){resultText=spliceSlice(resultText,beforeTagindex,0,tagIndices[startPtr].endTagName);resultText=spliceSlice(resultText,beforeTagindex+tagIndices[startPtr].endTagName.length+6,0,tagIndices[startPtr].tagName);newBrIndex=newBrIndex+tagIndices[startPtr].endTagName.length;beforeTagindex=beforeTagindex+tagIndices[startPtr].endTagName.length;afterTagindex=newBrIndex+tagIndices[startPtr].endTagName.length+6+tagIndices[startPtr].tagName.length;charOffset+=tagIndices[startPtr].endTagName.length;charOffset+=tagIndices[startPtr].tagName.length;startPtr++}}else{startPtr++;endPtr--}}else{startPtr++;endPtr--}}return{text:resultText,charOffset:charOffset,newBrIndex:newBrIndex}}function resolveTags(text){var brTagIndices=getSortedBRTagIndices(text),i,charOffset=0,resultObj={},tagIndex,textSnippet,startIndex=0,tagIndices;if(!text){return""}if(!brTagIndices.length){return text}tagIndex=brTagIndices[0].index;for(i=0;i<brTagIndices.length;i++){if(resultObj.charOffset&&resultObj.charOffset>0){tagIndex=brTagIndices[i].index+resultObj.charOffset;brTagIndices[i].index=tagIndex}else{tagIndex=brTagIndices[i].index}textSnippet=text.substring(startIndex,tagIndex);tagIndices=getSortedTagIndices(textSnippet);charOffset=resultObj.charOffset?resultObj.charOffset:charOffset;resultObj=getResolvedTags(text,tagIndices,brTagIndices[i],charOffset);if(resultObj.newBrIndex){startIndex=resultObj.newBrIndex+6}text=resultObj.text}return text}function resolveSingleLineText(text,tagIndices){var i,startPtr=0,resultText=text,endPtr=tagIndices.length-1,strEnd=text.length;if(!tagIndices.length){return text}while(startPtr<=endPtr){if(tagIndices[startPtr].endTagName){if(startPtr===endPtr){resultText=spliceSlice(resultText,strEnd,0,tagIndices[startPtr].endTagName);startPtr++;endPtr--}else if(tagIndices[startPtr].endTagName!==tagIndices[endPtr].tagName){for(i=startPtr;i<=endPtr;i++){if(tagIndices[i+1]){if(tagIndices[startPtr].endTagName===tagIndices[i+1].tagName){startPtr=i+2;break}}}if(i>endPtr){resultText=spliceSlice(resultText,strEnd,0,tagIndices[startPtr].endTagName);startPtr++}}else{startPtr++;endPtr--}}else{startPtr++;endPtr--}}return resultText}function mergeTags(_oriText,_tempText){var oriText=_oriText,tempText=_tempText,resultText="",tagIndices,dummyText="",i=0,oriPtr,tempPtr;if(oriText===tempText){return oriText}else if(oriText===""&&tempText!==""){return tempText}else if(tempText===""&&oriText!==""){return oriText}oriPtr=0;tempPtr=0;while(oriPtr<oriText.length){if(oriText[oriPtr]&&!tempText[tempPtr]){resultText+=oriText.substring(oriPtr,oriText.length);break}else if(tempText[tempPtr]&&!oriText[oriPtr]){resultText+=tempText.substring(tempPtr,tempText.length);break}else{if(oriText[oriPtr]===tempText[tempPtr]){if(oriText[oriPtr]==="<"){dummyText=oriText[oriPtr];i=oriPtr+1;while(i<oriText.length){if(oriText[i]===">"){dummyText+=oriText[i];break}dummyText+=oriText[i];i++}if(i>=oriText.length){resultText+=oriText[oriPtr];oriPtr++;tempPtr++}else{tagIndices=getSortedTagIndices(dummyText);if(tagIndices&&tagIndices.length){resultText+=dummyText;oriPtr+=dummyText.length}else{resultText+=dummyText;oriPtr+=dummyText.length;tempPtr+=dummyText.length}}}else{resultText+=oriText[oriPtr];oriPtr++;tempPtr++}}else{if(oriText[oriPtr]==="<"){dummyText=oriText[oriPtr];i=oriPtr+1;while(i<oriText.length){if(oriText[i]===">"){dummyText+=oriText[i];break}dummyText+=oriText[i];i++}if(i>=oriText.length){resultText+=oriText[oriPtr];oriPtr++;tempPtr++}else{tagIndices=getSortedTagIndices(dummyText);if(tagIndices&&tagIndices.length){resultText+=dummyText;oriPtr+=dummyText.length}else{resultText+=dummyText;oriPtr+=dummyText.length;tempPtr+=dummyText.length}}}else if(tempText[tempPtr]==="<"){dummyText=tempText[tempPtr];i=tempPtr+1;while(i<tempText.length){if(tempText[i]===">"){dummyText+=tempText[i];break}dummyText+=tempText[i];i++}if(i>=tempText.length){resultText+=tempText[tempPtr];oriPtr++;tempPtr++}else{tagIndices=getSortedTagIndices(dummyText);if(tagIndices&&tagIndices.length){resultText+=dummyText;tempPtr+=dummyText.length}else{resultText+=dummyText;oriPtr+=dummyText.length;tempPtr+=dummyText.length}}}else if(oriText[oriPtr]===" "){oriPtr++}else if(tempText[tempPtr]===" "){tempPtr++}}}}return resultText}function doMergeTextWithTags(oriText,tempText){var resultText=oriText,tagIndices=getSortedTagIndices(oriText),brTagIndices=getSortedBRTagIndices(tempText),oribrTagIndices=getSortedBRTagIndices(oriText),j,keyIndex,dummyText=tempText,i,count=0;if(oriText===tempText){return oriText}if(oribrTagIndices.length){for(i=0;i<oribrTagIndices.length;i++){count=0;j=oribrTagIndices[i].index;while(oriText[j]!==">"){count++;j++}oriText=spliceSlice(oriText,oribrTagIndices[i].index,count+1,"");if(oribrTagIndices[i+1]){keyIndex=i+1;oribrTagIndices[i+1].index-=keyIndex*(count+1)}}if(brTagIndices.length){for(i=0;i<brTagIndices.length;i++){count=0;j=brTagIndices[i].index;while(dummyText[j]!==">"){count++;j++}dummyText=spliceSlice(dummyText,brTagIndices[i].index,count+1,"<br />");if(brTagIndices[i+1]){keyIndex=i+1;brTagIndices[i+1].index-=keyIndex*(count+1);brTagIndices[i+1].index+=keyIndex*6}}}tempText=dummyText;resultText=oriText;tagIndices=getSortedTagIndices(oriText);brTagIndices=getSortedBRTagIndices(tempText)}if(!tagIndices.length){return tempText}else if(!brTagIndices.length){return resolveSingleLineText(oriText,tagIndices)}else{resultText=mergeTags(oriText,tempText);resultText=resolveTags(resultText)}return resultText}SmartLabelManager.textToLines=function(smartlabel){smartlabel=smartlabel||{};if(!smartlabel.text){smartlabel.text=""}else if(typeof smartlabel.text!=="string"){smartlabel.text=smartlabel.text.toString()}smartlabel.lines=smartlabel.text.split(/\n|<br\s*?\/?>/gi);return smartlabel};SmartLabelManager.prototype._calCharDimWithCache=function(text,calculateDifference,length){if(text===void 0){text=""}if(!this._init){return false}var size,tw,twi,cachedStyle,asymmetricDifference,maxAdvancedCacheLimit=this.options.maxCacheLimit,style=this.style||{},cache,advancedCacheKey,cacheName,cacheInitName;cache=this._advancedCache=this._advancedCache||(this._advancedCache={});advancedCacheKey=this._advancedCacheKey||(this._advancedCacheKey=[]);cacheName=text+style.fontSize+style.fontFamily+style.fontWeight+style.fontStyle;cacheInitName=text+"init"+style.fontSize+style.fontFamily+style.fontWeight+style.fontStyle;if(!this.ctx&&htmlSplCharSpace[text]){text=htmlSplCharSpace[text]}if(!calculateDifference){asymmetricDifference=0}else{if((asymmetricDifference=cache[cacheInitName])===undefined){tw=this._getDimention(text.repeat?text.repeat(length):Array(length+1).join(text)).width;twi=this._getDimention(text).width;asymmetricDifference=cache[cacheInitName]=(tw-length*twi)/(length+1);advancedCacheKey.push(cacheInitName);if(advancedCacheKey.length>maxAdvancedCacheLimit){delete cache[advancedCacheKey.shift()]}}}if(cachedStyle=cache[cacheName]){return{width:cachedStyle.width,height:cachedStyle.height}}size=this._getDimention(text);size.width+=asymmetricDifference;cache[cacheName]={width:size.width,height:size.height};advancedCacheKey.push(cacheName);if(advancedCacheKey.length>maxAdvancedCacheLimit){delete cache[advancedCacheKey.shift()]}return size};SmartLabelManager.prototype._getDimention=function(text){if(this.requireDiv||!this.ctx){return slLib._getDimentionUsingDiv(text,this)}else{return slLib._getDimentionUsingCanvas(text,this)}};SmartLabelManager.prototype._getWidthFn=function(){var sl=this,contObj=sl._containerObj,svgText=contObj.svgText;if(svgText){return function(str){var bbox,width;svgText.textContent=str;bbox=svgText.getBBox();width=bbox.width-SVG_BBOX_CORRECTION;if(width<1){width=bbox.width}return width}}else{return function(str){if(sl.requireDiv||!sl.ctx){return slLib._getDimentionUsingDiv(str,sl).width}else{return slLib._getDimentionUsingCanvas(str,sl).width}}}};SmartLabelManager.prototype._isSameStyle=function(){var sl=this,oldStyle=sl.oldStyle||{},style=sl.style;if(style.fontSize!==oldStyle.fontSize||style.fontFamily!==oldStyle.fontFamily||style.fontStyle!==oldStyle.fontStyle||style.fontWeight!==oldStyle.fontWeight||style.fontVariant!==oldStyle.fontVariant){return false}return true};SmartLabelManager.prototype._setStyleOfCanvas=function(){if(this._isSameStyle()){return}var sl=this,style=sl.style,hashString,sCont,fontStyle=style.fontStyle,fontVariant=style.fontVariant,fontWeight=style.fontWeight,fontSize=style.fontSize,fontFamily=style.fontFamily;fontSize+=fontSize.indexOf("px")===-1?"px":"";hashString=fontStyle+" "+fontVariant+" "+fontWeight+" "+fontSize+" "+fontFamily;sl.ctx.font=hashString;sCont=this._containerObj=this._containerManager.get(style);if(this._containerObj){this._container=sCont.node;this._context=sCont.context;this._cache=sCont.charCache;this._lineHeight=sCont.lineHeight;this._styleNotSet=false}else{this._styleNotSet=true}sCont.ellipsesWidth=sl._calCharDimWithCache("...",false).width;sCont.dotWidth=sl._calCharDimWithCache(".",false).width;sCont.lineHeight=this._lineHeight=sCont.lineHeight||slLib._getCleanHeight(style.lineHeight);this.oldStyle=style};SmartLabelManager.prototype._setStyleOfDiv=function(){var sCont,style=this.style;this._containerObj=sCont=this._containerManager.get(style);if(!sCont.node){this._containerManager._makeDivNode(this._containerObj)}if(this._containerObj){this._container=sCont.node;this._context=sCont.context;this._cache=sCont.charCache;this._lineHeight=sCont.lineHeight;this._styleNotSet=false}else{this._styleNotSet=true}};SmartLabelManager.prototype._updateStyle=function(){return this.requireDiv||!this.ctx?this._setStyleOfDiv():this._setStyleOfCanvas()};SmartLabelManager.prototype.setStyle=function(style){this.style=slLib.parseStyle(style);slLib.setLineHeight(this.style);return this};SmartLabelManager.prototype.useEllipsesOnOverflow=function(useEllipses){if(!this._init){return this}this._showNoEllipses=!useEllipses;return this};SmartLabelManager.prototype.getSmartText=function(text,maxWidth,maxHeight,noWrap){if(!this._init){return false}if(text===undefined||text===null){text=""}else if(typeof text!=="string"){text=text.toString()}var len,trimStr,tempArr,tmpText,maxWidthWithEll,toolText,oriWidth,oriHeight,newCharIndex,nearestChar,tempChar,getWidth,initialLeft,initialTop,getOriSizeImproveObj,spanArr,x,y,minWidth,elem,chr,elemRightMostPoint,elemLowestPoint,lastBR,removeFromIndex,removeFromIndexForEllipses,hasHTMLTag=false,maxStrWidth=0,lastDash=-1,lastSpace=-1,lastIndexBroken=-1,strWidth=0,strHeight=0,oriTextArr=[],resolvedText="",i=0,originalText,ellipsesStr=this._showNoEllipses?"":"...",lineHeight,context,container,sCont,ellipsesWidth,dotWidth,canvas=this.ctx,characterArr=[],dashIndex=-1,spaceIndex=-1,lastLineBreak=-1,hasOnlyBrTag,dimentionObj,fastTrim=function fastTrim(str){str=str.replace(/^\s\s*/,"");var ws=/\s/,i=str.length;while(ws.test(str.charAt(i-=1))){}return str.slice(0,i+1)},smartLabel={text:text,maxWidth:maxWidth,maxHeight:maxHeight,width:null,height:null,oriTextWidth:null,oriTextHeight:null,oriText:text,isTruncated:false};hasHTMLTag=slLib.xmlTagRegEx.test(text)||slLib.nbspRegex.test(text);hasOnlyBrTag=slLib._hasOnlyBRTag(text);this.requireDiv=hasHTMLTag&&!hasOnlyBrTag;this._updateStyle();lineHeight=this._lineHeight;context=this._context;container=this._container;sCont=this._containerObj;ellipsesWidth=sCont.ellipsesWidth;dotWidth=sCont.dotWidth;toolText=text.replace(slLib.spanAdditionRegx,"$2");getWidth=this._getWidthFn();if(lineHeight-maxHeight<=1&&lineHeight-maxHeight>=0){maxHeight*=1.2}if(canvas||container){if(!documentSupport.isBrowserLess){tmpText=text=text.replace(slLib.ltgtquotRegex,(function(match){switch(match){case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&#034;":return'"';case"&#039;":return"'"}}));originalText=text;tmpText=text=tmpText.replace(/<u>/g,"").replace(/<\/u>/g,"").replace(/<b>/g,"").replace(/<\/b>/g,"").replace(/<strong>/g,"").replace(/<\/strong>/g,"").replace(/<em>/g,"").replace(/<\/em>/g,"").replace(/<i>/g,"").replace(/<\/i>/g,"").replace(/<strike>/g,"").replace(/<\/strike>/g,"").replace(/<s>/g,"").replace(/<\/s>/g,"").replace(/<del>/g,"").replace(/<\/del>/g,"").replace(/<sub>/g,"").replace(/<\/sub>/g,"").replace(/<sup>/g,"").replace(/<\/sup>/g,"").replace(/<a[\s]+([^>]+)>/g,"").replace(/<\/a>/g,"").replace(/<abbr[\s]+([^>]+)>/g,"").replace(/<\/abbr>/g,"").replace(/<span[\s]+([^>]+)>/g,"").replace(/<\/span>/g,"");if(!hasHTMLTag){tmpText=text=text.replace(slLib.ltgtquotRegex,(function(match){switch(match){case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&#034;":return'"';case"&#039;":return"'"}}));tmpText=text=tmpText.replace(/<u>/g,"").replace(/<\/u>/g,"").replace(/<b>/g,"").replace(/<\/b>/g,"").replace(/<strong>/g,"").replace(/<\/strong>/g,"").replace(/<em>/g,"").replace(/<\/em>/g,"").replace(/<i>/g,"").replace(/<\/i>/g,"").replace(/<strike>/g,"").replace(/<\/strike>/g,"").replace(/<s>/g,"").replace(/<\/s>/g,"").replace(/<del>/g,"").replace(/<\/del>/g,"").replace(/<sub>/g,"").replace(/<\/sub>/g,"").replace(/<sup>/g,"").replace(/<\/sup>/g,"").replace(/<a[\s]+([^>]+)>/g,"").replace(/<\/a>/g,"").replace(/<abbr[\s]+([^>]+)>/g,"").replace(/<\/abbr>/g,"").replace(/<span[\s]+([^>]+)>/g,"").replace(/<\/span>/g,"");getOriSizeImproveObj=this.getSize(tmpText,true,{hasHTMLTag:hasHTMLTag,hasOnlyBrTag:hasOnlyBrTag,cleanText:true});smartLabel.oriTextWidth=oriWidth=getOriSizeImproveObj.width;smartLabel.oriTextHeight=oriHeight=getOriSizeImproveObj.height}else if(hasOnlyBrTag){text=text.replace(slLib.brRegex,"<br />");dimentionObj=slLib._getDimentionOfMultiLineText(text,this);smartLabel.oriTextWidth=oriWidth=dimentionObj.width;smartLabel.oriTextHeight=oriHeight=dimentionObj.height}else{container.innerHTML=text;smartLabel.oriTextWidth=oriWidth=container.offsetWidth;smartLabel.oriTextHeight=oriHeight=container.offsetHeight}if(oriHeight<=maxHeight&&oriWidth<=maxWidth){resolvedText=doMergeTextWithTags(originalText,text);smartLabel.text=resolvedText;smartLabel.width=smartLabel.oriTextWidth=oriWidth;smartLabel.height=smartLabel.oriTextHeight=oriHeight;return smartLabel}if(lineHeight>maxHeight){smartLabel.text="";smartLabel.width=smartLabel.oriTextWidth=0;smartLabel.height=smartLabel.oriTextHeight=0;return smartLabel}}text=fastTrim(text).replace(/(\s+)/g," ");maxWidthWithEll=this._showNoEllipses?maxWidth:maxWidth-ellipsesWidth;if(!hasHTMLTag||hasOnlyBrTag){oriTextArr=slLib._getTextArray(text);len=oriTextArr.length;trimStr="";tempArr=[];tempChar=oriTextArr[0];if(this._cache[tempChar]){minWidth=this._cache[tempChar].width}else{minWidth=getWidth(tempChar);this._cache[tempChar]={width:minWidth}}if(maxWidthWithEll>minWidth&&!hasOnlyBrTag){tempArr=text.substr(0,slLib.getNearestBreakIndex(text,maxWidthWithEll,this)).split("")}else if(minWidth>maxWidth){smartLabel.text="";smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0;return smartLabel}else if(ellipsesStr){maxWidthWithEll=maxWidth-2*dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr=".."}else{maxWidthWithEll=maxWidth-dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr="."}else{maxWidthWithEll=0;ellipsesStr=""}}}i=tempArr.length;strWidth=getWidth(tempArr.join(""));strHeight=this._lineHeight;if(noWrap){for(;i<len;i+=1){tempChar=tempArr[i]=oriTextArr[i];if(tempArr[i]==="<br />"){strHeight+=this._lineHeight;lastIndexBroken=i;maxStrWidth=max(maxStrWidth,strWidth);strWidth=0;trimStr=null;continue}if(this._cache[tempChar]){minWidth=this._cache[tempChar].width}else{if(!getOriSizeImproveObj||!(minWidth=getOriSizeImproveObj.detailObj[tempChar])){minWidth=getWidth(tempChar)}this._cache[tempChar]={width:minWidth}}strWidth+=minWidth;if(strWidth>maxWidthWithEll){if(!trimStr){trimStr=tempArr.slice(0,-1).join("")}if(strWidth>maxWidth){smartLabel.text=fastTrim(trimStr)+ellipsesStr;smartLabel.tooltext=smartLabel.oriText;smartLabel.width=max(maxStrWidth,strWidth);smartLabel.height=strHeight;smartLabel.isTruncated=true;return smartLabel}}}smartLabel.text=tempArr.join("");smartLabel.width=max(maxStrWidth,strWidth);smartLabel.height=strHeight;return smartLabel}else{for(;i<len;i+=1){tempChar=tempArr[i]=oriTextArr[i];if(tempChar===" "&&!context){tempChar=this.ctx?" ":"&nbsp;"}if(tempArr[i]==="<br />"){maxStrWidth=max(maxStrWidth,strWidth);strHeight+=this._lineHeight;if(strHeight<=maxHeight){lastIndexBroken=i;strWidth=0;trimStr=null;continue}else if(strHeight>maxHeight){trimStr=tempArr.slice(0,-1).join("");smartLabel.text=fastTrim(trimStr)+ellipsesStr;smartLabel.tooltext=toolText;smartLabel.width=maxStrWidth;smartLabel.height=strHeight-this._lineHeight;smartLabel.isTruncated=true;return smartLabel}}if(this._cache[tempChar]){minWidth=this._cache[tempChar].width}else{if(!getOriSizeImproveObj||!(minWidth=getOriSizeImproveObj.detailObj[tempChar])){minWidth=getWidth(tempChar)}this._cache[tempChar]={width:minWidth}}strWidth+=minWidth;if(strWidth>maxWidthWithEll){if(!trimStr){trimStr=tempArr.slice(0,-1).join("")}if(strWidth>maxWidth){if(oriTextArr[i+1]==="<br />"){continue}lastSpace=slLib._findLastIndex(oriTextArr.slice(0,tempArr.length)," ");lastDash=slLib._findLastIndex(oriTextArr.slice(0,tempArr.length),"-");if(lastSpace>lastIndexBroken){strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join(""));tempArr.splice(lastSpace,1,"<br />");lastIndexBroken=lastSpace;newCharIndex=lastSpace+1}else if(lastDash>lastIndexBroken){if(lastDash===tempArr.length-1){strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join(""));tempArr.splice(lastDash,1,"<br />-")}else{strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join(""));tempArr.splice(lastDash,1,"-<br />")}lastIndexBroken=lastDash;newCharIndex=lastDash+1}else{tempArr.splice(tempArr.length-1,1,"<br />"+oriTextArr[i]);lastLineBreak=tempArr.length-2;strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastLineBreak+1).join(""));lastIndexBroken=lastLineBreak;newCharIndex=i}strHeight+=this._lineHeight;if(strHeight>maxHeight){smartLabel.text=fastTrim(trimStr)+ellipsesStr;smartLabel.tooltext=smartLabel.oriText;smartLabel.width=maxWidth;smartLabel.height=strHeight-this._lineHeight;smartLabel.isTruncated=true;return smartLabel}else{maxStrWidth=max(maxStrWidth,strWidth);trimStr=null;if(!hasOnlyBrTag){nearestChar=slLib.getNearestBreakIndex(text.substr(newCharIndex),maxWidthWithEll,this);strWidth=getWidth(text.substr(newCharIndex,nearestChar||1));if(tempArr.length<newCharIndex+nearestChar){tempArr=tempArr.concat(text.substr(tempArr.length,newCharIndex+nearestChar-tempArr.length).split(""));i=tempArr.length-1}}else{strWidth=slLib._getDimentionOfMultiLineText(tempArr.slice(lastIndexBroken+1).join(""),this).width}}}}}maxStrWidth=max(maxStrWidth,strWidth);resolvedText=doMergeTextWithTags(originalText,tempArr.join(""));smartLabel.text=resolvedText;smartLabel.width=maxStrWidth;smartLabel.height=strHeight;return smartLabel}}else{toolText=text.replace(slLib.spanAdditionRegx,"$2");text=text.replace(slLib.spanAdditionRegx,slLib.spanAdditionReplacer);text=text.replace(/(<br\s*\/*\>)/g,'<span class="'+[slLib.classNameWithTag," ",slLib.classNameWithTagBR].join("")+'">$1</span>');container.innerHTML=text;spanArr=container[documentSupport.childRetriverFn](documentSupport.childRetriverString);for(x=0,y=spanArr.length;x<y;x+=1){elem=spanArr[x];if(documentSupport.noClassTesting||slLib.classNameReg.test(elem.className)){chr=elem.innerHTML;if(chr!==""){if(chr===" "){spaceIndex=characterArr.length}else if(chr==="-"){dashIndex=characterArr.length}characterArr.push({spaceIdx:spaceIndex,dashIdx:dashIndex,elem:elem});oriTextArr.push(chr)}}}i=0;len=characterArr.length;minWidth=len&&characterArr[0].elem.offsetWidth;if(minWidth>maxWidth||!len){smartLabel.text="";smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0;return smartLabel}else if(minWidth>maxWidthWithEll&&!this._showNoEllipses){maxWidthWithEll=maxWidth-2*dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr=".."}else{maxWidthWithEll=maxWidth-dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr="."}else{maxWidthWithEll=0;ellipsesStr=""}}}initialLeft=characterArr[0].elem.offsetLeft;initialTop=characterArr[0].elem.offsetTop;if(noWrap){for(;i<len;i+=1){elem=characterArr[i].elem;elemRightMostPoint=elem.offsetLeft-initialLeft+elem.offsetWidth;if(elemRightMostPoint>maxWidthWithEll){if(!removeFromIndexForEllipses){removeFromIndexForEllipses=i}if(container.offsetWidth>maxWidth){removeFromIndex=i;i=len}}}}else{for(;i<len;i+=1){elem=characterArr[i].elem;elemLowestPoint=elem.offsetHeight+(elem.offsetTop-initialTop);elemRightMostPoint=elem.offsetLeft-initialLeft+elem.offsetWidth;lastBR=null;if(elemRightMostPoint>maxWidthWithEll){if(!removeFromIndexForEllipses){removeFromIndexForEllipses=i}if(elemRightMostPoint>maxWidth){lastSpace=characterArr[i].spaceIdx;lastDash=characterArr[i].dashIdx;if(lastSpace>lastIndexBroken){characterArr[lastSpace].elem.innerHTML="<br/>";lastIndexBroken=lastSpace}else if(lastDash>lastIndexBroken){if(lastDash===i){characterArr[lastDash].elem.innerHTML="<br/>-"}else{characterArr[lastDash].elem.innerHTML="-<br/>"}lastIndexBroken=lastDash}else{elem.parentNode.insertBefore(lastBR=doc.createElement("br"),elem)}if(elem.offsetHeight+elem.offsetTop>maxHeight){if(lastBR){lastBR.parentNode.removeChild(lastBR)}else if(lastIndexBroken===lastDash){characterArr[lastDash].elem.innerHTML="-"}else{characterArr[lastSpace].elem.innerHTML=" "}removeFromIndex=i;i=len}else{removeFromIndexForEllipses=null}}}else{if(elemLowestPoint>maxHeight){removeFromIndex=i;i=len}}}}if(removeFromIndex<len){smartLabel.isTruncated=true;removeFromIndexForEllipses=removeFromIndexForEllipses?removeFromIndexForEllipses:removeFromIndex;for(i=len-1;i>=removeFromIndexForEllipses;i-=1){elem=characterArr[i].elem;elem.parentNode.removeChild(elem)}for(;i>=0;i-=1){elem=characterArr[i].elem;if(slLib.classNameBrReg.test(elem.className)){elem.parentNode.removeChild(elem)}else{i=0}}}smartLabel.text=container.innerHTML.replace(slLib.spanRemovalRegx,"$1").replace(/\&amp\;/g,"&");if(smartLabel.isTruncated){smartLabel.text+=ellipsesStr;smartLabel.tooltext=toolText}}smartLabel.height=container.offsetHeight;smartLabel.width=container.offsetWidth;return smartLabel}else{smartLabel.error=new Error("Body Tag Missing!");return smartLabel}};SmartLabelManager.prototype.getSize=function(text,detailedCalculationFlag,config){if(text===void 0){text=""}if(detailedCalculationFlag===void 0){detailedCalculationFlag=true}if(config===void 0){config={}}if(!this._init){return false}if(text===undefined||text===null){text=""}else if(typeof text!=="string"){text=text.toString()}var textArr,letter,lSize,i,l,cumulativeSize=0,height=0,container,indiSizeStore={},hasHTMLTag=config.hasHTMLTag,hasOnlyBrTag=config.hasOnlyBrTag;if(typeof hasHTMLTag==="undefined"){hasHTMLTag=slLib.xmlTagRegEx.test(text)||slLib.nbspRegex.test(text)}if(typeof hasOnlyBrTag==="undefined"){hasOnlyBrTag=slLib._hasOnlyBRTag(text)}this.requireDiv=hasHTMLTag&&!hasOnlyBrTag;if(!config.cleanText){text=text.replace(slLib.ltgtquotRegex,(function(match){switch(match){case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&#034;":return'"';case"&#039;":return"'"}}));text=text.replace(/<u>/g,"").replace(/<\/u>/g,"").replace(/<b>/g,"").replace(/<\/b>/g,"").replace(/<strong>/g,"").replace(/<\/strong>/g,"").replace(/<em>/g,"").replace(/<\/em>/g,"").replace(/<i>/g,"").replace(/<\/i>/g,"").replace(/<strike>/g,"").replace(/<\/strike>/g,"").replace(/<s>/g,"").replace(/<\/s>/g,"").replace(/<del>/g,"").replace(/<\/del>/g,"").replace(/<sub>/g,"").replace(/<\/sub>/g,"").replace(/<sup>/g,"").replace(/<\/sup>/g,"").replace(/<a[\s]+([^>]+)>/g,"").replace(/<\/a>/g,"").replace(/<abbr[\s]+([^>]+)>/g,"").replace(/<\/abbr>/g,"").replace(/<span[\s]+([^>]+)>/g,"").replace(/<\/span>/g,"")}this._updateStyle();container=this._container;if(!detailedCalculationFlag){return this._calCharDimWithCache(text)}else{textArr=text.split("");for(i=0,l=textArr.length;i<l;i++){letter=textArr[i];lSize=this._calCharDimWithCache(letter,false,textArr.length);height=max(height,lSize.height);cumulativeSize+=lSize.width;indiSizeStore[letter]=lSize.width}}if(hasOnlyBrTag){return _objectSpread(_objectSpread({},slLib._getDimentionOfMultiLineText(text,this)),{},{detailObj:indiSizeStore})}if(hasHTMLTag){container.innerHTML=text;return{width:container.offsetWidth,height:container.offsetHeight,detailObj:indiSizeStore}}return{width:round(cumulativeSize),height:height,detailObj:indiSizeStore}};SmartLabelManager.prototype.getOriSize=function(text,detailedCalculationFlag,config){if(text===void 0){text=""}if(detailedCalculationFlag===void 0){detailedCalculationFlag=true}if(config===void 0){config={}}return this.getSize(text,detailedCalculationFlag,config)};SmartLabelManager.prototype.dispose=function(){if(!this._init){return this}if(this._containerManager&&this._containerManager.dispose){this._containerManager.dispose()}delete this._container;delete this._context;delete this._cache;delete this._containerManager;delete this._containerObj;delete this.id;delete this.style;delete this.parentContainer;delete this._showNoEllipses;return this};var _default=SmartLabelManager;exports.default=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _lib=_interopRequireDefault(require("./lib"));var _containerManager=_interopRequireDefault(require("./container-manager"));var _trustedPolicy=_interopRequireDefault(require("../../../../../../fc-features/src/utils/trusted-policy"));function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))}keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach((function(key){(0,_defineProperty2.default)(target,key,source[key])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach((function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}))}}return target}var slLib=_lib.default.init(window),doc=slLib.win.document,M=slLib.win.Math,max=M.max,round=M.round,htmlSplCharSpace={" ":"&nbsp;"},documentSupport=slLib.getDocumentSupport(),SVG_BBOX_CORRECTION=documentSupport.isWebKit?0:4.5;function SmartLabelManager(container,useEllipses,options){var wrapper,prop,max,isBrowserLess=false,canvas=window.document.createElement("canvas");options=options||{};options.maxCacheLimit=isFinite(max=options.maxCacheLimit)?max:slLib.maxDefaultCacheLimit;if(typeof container==="string"){container=doc.getElementById(container)}wrapper=slLib.createContainer(container);wrapper.innerHTML=_trustedPolicy.default.createHTML(slLib.testStrAvg);if(documentSupport.isHeadLess||!documentSupport.isIE&&!wrapper.offsetHeight&&!wrapper.offsetWidth){isBrowserLess=true}wrapper.innerHTML=_trustedPolicy.default.createHTML("");for(prop in slLib.parentContainerStyle){wrapper.style[prop]=slLib.parentContainerStyle[prop]}this.parentContainer=wrapper;this.ctx=canvas&&canvas.getContext&&canvas.getContext("2d");this._containerManager=new _containerManager.default(wrapper,isBrowserLess,10);this._showNoEllipses=!useEllipses;this._init=true;this.style={};this.oldStyle={};this.options=options;this.setStyle()}function getAbbrTagIndices(abbrRegex,abbrEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,endtagindices=[];while(result=abbrRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</abbr>";dummyNode.innerHTML=_trustedPolicy.default.createHTML(testAbbr);tagindices.push({tagName:result[0],index:result.index,title:dummyNode.childNodes[0].title?dummyNode.childNodes[0].title:"",endTagName:endtagText})}while(result=abbrEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}}function getStyles(el){var output={};if(!el||!el.style||!el.style.cssText){return output}var camelize=function camelize(str){return str.replace(/(?:^|[-])(\w)/g,(function(a,c){c=a.substr(0,1)==="-"?c.toUpperCase():c;return c?c:""}))};var style=el.style.cssText.split(";");for(var i=0;i<style.length;++i){var rule=style[i].trim();if(rule){var ruleParts=rule.split(":");var key=camelize(ruleParts[0].trim());output[key]=ruleParts[1].trim()}}return output}function getSpanTagIndices(spanRegex,spanEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,styleObj,endtagindices=[];while(result=spanRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</span>";dummyNode.innerHTML=_trustedPolicy.default.createHTML(testAbbr);styleObj=getStyles(dummyNode.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:"",endTagName:endtagText})}while(result=spanEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}}function getAnchorTagIndices(anchorRegex,anchorEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,endtagindices=[];while(result=anchorRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"</a>";dummyNode.innerHTML=_trustedPolicy.default.createHTML(testAbbr);tagindices.push({tagName:result[0],index:result.index,href:dummyNode.childNodes[0].href?dummyNode.childNodes[0].href:"",target:dummyNode.childNodes[0].target?dummyNode.childNodes[0].target:"",hreflang:dummyNode.childNodes[0].hreflang?dummyNode.childNodes[0].hreflang:"",referrerpolicy:dummyNode.childNodes[0].referrerpolicy?dummyNode.childNodes[0].referrerpolicy:"",rel:dummyNode.childNodes[0].rel?dummyNode.childNodes[0].rel:"",endTagName:endtagText})}while(result=anchorEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}}function getTagIndices(tagRegex,endTagRegex,text,tagText,endtagText){var tagindices=[],result,endtagindices=[];if(tagRegex){while(result=tagRegex.exec(text)){tagindices.push({tagName:tagText,index:result.index,endTagName:endtagText})}}if(endTagRegex){while(result=endTagRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}}return{tag:tagindices,endtag:endtagindices}}function sortTags(u,b,em,strike,sub,sup,abbr,a,sp,str,it,del,s,br){var i,j,tagArr=[u,b,em,strike,sub,sup,abbr,a,sp,str,it,del,s,br],res=[];for(j=0;j<tagArr.length;j++){for(var key in tagArr[j]){if(tagArr[j][key].length){for(i=0;i<tagArr[j][key].length;i++){res.push(tagArr[j][key][i])}}}}res=res.sort((function(a,b){return a.index-b.index}));return res}function getSortedBRTagIndices(text){var brRegex=/<br\s*\/?>/g,brTagIndices=getTagIndices(brRegex,undefined,text,"<br />",""),sortedIndices=sortTags({},{},{},{},{},{},{},{},{},{},{},{},{},brTagIndices);return sortedIndices}function getSortedTagIndices(text){var underlineRegex=/<u>/g,underlineEndRegex=/<\/u>/g,boldRegex=/<b>/g,boldEndRegex=/<\/b>/g,strongRegex=/<strong>/g,strongEndRegex=/<\/strong>/g,emphasisRegex=/<em>/g,emphasisEndRegex=/<\/em>/g,italicRegex=/<i>/g,italicEndRegex=/<\/i>/g,delRegex=/<del>/g,delEndRegex=/<\/del>/g,sRegex=/<s>/g,sEndRegex=/<\/s>/g,strikeRegex=/<strike>/g,strikeEndRegex=/<\/strike>/g,subscriptRegex=/<sub>/g,subscriptEndRegex=/<\/sub>/g,superscriptRegex=/<sup>/g,superscriptEndRegex=/<\/sup>/g,abbrRegex=/<abbr[\s]+([^>]+)>/g,abbrEndRegex=/<\/abbr>/g,spanRegex=/<span[\s]+([^>]+)>/g,spanEndRegex=/<\/span>/g,anchorRegex=/<a[\s]+([^>]+)>/g,anchorEndRegex=/<\/a>/g,brRegex=/<br\s*\/?>/g,underlinetagIndices=getTagIndices(underlineRegex,underlineEndRegex,text,"<u>","</u>"),boldtagIndices=getTagIndices(boldRegex,boldEndRegex,text,"<b>","</b>"),emtagIndices=getTagIndices(emphasisRegex,emphasisEndRegex,text,"<em>","</em>"),strikeTagIndices=getTagIndices(strikeRegex,strikeEndRegex,text,"<strike>","</strike>"),subscriptTagIndices=getTagIndices(subscriptRegex,subscriptEndRegex,text,"<sub>","</sub>"),superscriptTagIndices=getTagIndices(superscriptRegex,superscriptEndRegex,text,"<sup>","</sup>"),abbrTagIndices=getAbbrTagIndices(abbrRegex,abbrEndRegex,text,"<abbr>","</abbr>"),anchorTagIndices=getAnchorTagIndices(anchorRegex,anchorEndRegex,text,"<a>","</a>"),spanTagIndices=getSpanTagIndices(spanRegex,spanEndRegex,text,"<span>","</span>"),strongTagIndices=getTagIndices(strongRegex,strongEndRegex,text,"<strong>","</strong>"),italicTagIndices=getTagIndices(italicRegex,italicEndRegex,text,"<i>","</i>"),delTagIndices=getTagIndices(delRegex,delEndRegex,text,"<del>","</del>"),sTagIndices=getTagIndices(sRegex,sEndRegex,text,"<s>","</s>"),brTagIndices=getTagIndices(brRegex,undefined,text,"<br />",""),sortedIndices=sortTags(underlinetagIndices,boldtagIndices,emtagIndices,strikeTagIndices,subscriptTagIndices,superscriptTagIndices,abbrTagIndices,anchorTagIndices,spanTagIndices,strongTagIndices,italicTagIndices,delTagIndices,sTagIndices,brTagIndices);return sortedIndices}function spliceSlice(str,index,count,add){if(index<0){index=str.length+index;if(index<0){index=0}}return str.slice(0,index)+(add||"")+str.slice(index+count)}function getResolvedTags(text,tagIndices,brTagIndex,charOffset){var i,startPtr,endPtr,resultText=text,newBrIndex=brTagIndex.index,beforeTagindex=brTagIndex.index,afterTagindex=brTagIndex.index+6;if(!tagIndices.length){return{text:text,charOffset:charOffset}}startPtr=0;endPtr=tagIndices.length-1;if(tagIndices[startPtr].endTagName){afterTagindex=beforeTagindex+tagIndices[startPtr].endTagName.length+6}while(startPtr<=endPtr){if(tagIndices[startPtr].endTagName){if(startPtr===endPtr){resultText=spliceSlice(resultText,beforeTagindex,0,tagIndices[startPtr].endTagName);resultText=spliceSlice(resultText,afterTagindex,0,tagIndices[startPtr].tagName);newBrIndex=newBrIndex+tagIndices[startPtr].endTagName.length;beforeTagindex=newBrIndex-tagIndices[startPtr].endTagName.length;afterTagindex=newBrIndex+tagIndices[startPtr].endTagName.length+6+tagIndices[startPtr].tagName.length;charOffset+=tagIndices[startPtr].endTagName.length;charOffset+=tagIndices[startPtr].tagName.length;startPtr++;endPtr--}else if(tagIndices[startPtr].endTagName!==tagIndices[endPtr].tagName){for(i=startPtr;i<=endPtr;i++){if(tagIndices[i+1]){if(tagIndices[startPtr].endTagName===tagIndices[i+1].tagName){startPtr=i+2;break}}}if(i>endPtr){resultText=spliceSlice(resultText,beforeTagindex,0,tagIndices[startPtr].endTagName);resultText=spliceSlice(resultText,beforeTagindex+tagIndices[startPtr].endTagName.length+6,0,tagIndices[startPtr].tagName);newBrIndex=newBrIndex+tagIndices[startPtr].endTagName.length;beforeTagindex=beforeTagindex+tagIndices[startPtr].endTagName.length;afterTagindex=newBrIndex+tagIndices[startPtr].endTagName.length+6+tagIndices[startPtr].tagName.length;charOffset+=tagIndices[startPtr].endTagName.length;charOffset+=tagIndices[startPtr].tagName.length;startPtr++}}else{startPtr++;endPtr--}}else{startPtr++;endPtr--}}return{text:resultText,charOffset:charOffset,newBrIndex:newBrIndex}}function resolveTags(text){var brTagIndices=getSortedBRTagIndices(text),i,charOffset=0,resultObj={},tagIndex,textSnippet,startIndex=0,tagIndices;if(!text){return""}if(!brTagIndices.length){return text}tagIndex=brTagIndices[0].index;for(i=0;i<brTagIndices.length;i++){if(resultObj.charOffset&&resultObj.charOffset>0){tagIndex=brTagIndices[i].index+resultObj.charOffset;brTagIndices[i].index=tagIndex}else{tagIndex=brTagIndices[i].index}textSnippet=text.substring(startIndex,tagIndex);tagIndices=getSortedTagIndices(textSnippet);charOffset=resultObj.charOffset?resultObj.charOffset:charOffset;resultObj=getResolvedTags(text,tagIndices,brTagIndices[i],charOffset);if(resultObj.newBrIndex){startIndex=resultObj.newBrIndex+6}text=resultObj.text}return text}function resolveSingleLineText(text,tagIndices){var i,startPtr=0,resultText=text,endPtr=tagIndices.length-1,strEnd=text.length;if(!tagIndices.length){return text}while(startPtr<=endPtr){if(tagIndices[startPtr].endTagName){if(startPtr===endPtr){resultText=spliceSlice(resultText,strEnd,0,tagIndices[startPtr].endTagName);startPtr++;endPtr--}else if(tagIndices[startPtr].endTagName!==tagIndices[endPtr].tagName){for(i=startPtr;i<=endPtr;i++){if(tagIndices[i+1]){if(tagIndices[startPtr].endTagName===tagIndices[i+1].tagName){startPtr=i+2;break}}}if(i>endPtr){resultText=spliceSlice(resultText,strEnd,0,tagIndices[startPtr].endTagName);startPtr++}}else{startPtr++;endPtr--}}else{startPtr++;endPtr--}}return resultText}function mergeTags(_oriText,_tempText){var oriText=_oriText,tempText=_tempText,resultText="",tagIndices,dummyText="",i=0,oriPtr,tempPtr;if(oriText===tempText){return oriText}else if(oriText===""&&tempText!==""){return tempText}else if(tempText===""&&oriText!==""){return oriText}oriPtr=0;tempPtr=0;while(oriPtr<oriText.length){if(oriText[oriPtr]&&!tempText[tempPtr]){resultText+=oriText.substring(oriPtr,oriText.length);break}else if(tempText[tempPtr]&&!oriText[oriPtr]){resultText+=tempText.substring(tempPtr,tempText.length);break}else{if(oriText[oriPtr]===tempText[tempPtr]){if(oriText[oriPtr]==="<"){dummyText=oriText[oriPtr];i=oriPtr+1;while(i<oriText.length){if(oriText[i]===">"){dummyText+=oriText[i];break}dummyText+=oriText[i];i++}if(i>=oriText.length){resultText+=oriText[oriPtr];oriPtr++;tempPtr++}else{tagIndices=getSortedTagIndices(dummyText);if(tagIndices&&tagIndices.length){resultText+=dummyText;oriPtr+=dummyText.length}else{resultText+=dummyText;oriPtr+=dummyText.length;tempPtr+=dummyText.length}}}else{resultText+=oriText[oriPtr];oriPtr++;tempPtr++}}else{if(oriText[oriPtr]==="<"){dummyText=oriText[oriPtr];i=oriPtr+1;while(i<oriText.length){if(oriText[i]===">"){dummyText+=oriText[i];break}dummyText+=oriText[i];i++}if(i>=oriText.length){resultText+=oriText[oriPtr];oriPtr++;tempPtr++}else{tagIndices=getSortedTagIndices(dummyText);if(tagIndices&&tagIndices.length){resultText+=dummyText;oriPtr+=dummyText.length}else{resultText+=dummyText;oriPtr+=dummyText.length;tempPtr+=dummyText.length}}}else if(tempText[tempPtr]==="<"){dummyText=tempText[tempPtr];i=tempPtr+1;while(i<tempText.length){if(tempText[i]===">"){dummyText+=tempText[i];break}dummyText+=tempText[i];i++}if(i>=tempText.length){resultText+=tempText[tempPtr];oriPtr++;tempPtr++}else{tagIndices=getSortedTagIndices(dummyText);if(tagIndices&&tagIndices.length){resultText+=dummyText;tempPtr+=dummyText.length}else{resultText+=dummyText;oriPtr+=dummyText.length;tempPtr+=dummyText.length}}}else if(oriText[oriPtr]===" "){oriPtr++}else if(tempText[tempPtr]===" "){tempPtr++}}}}return resultText}function doMergeTextWithTags(oriText,tempText){var resultText=oriText,tagIndices=getSortedTagIndices(oriText),brTagIndices=getSortedBRTagIndices(tempText),oribrTagIndices=getSortedBRTagIndices(oriText),j,keyIndex,dummyText=tempText,i,count=0;if(oriText===tempText){return oriText}if(oribrTagIndices.length){for(i=0;i<oribrTagIndices.length;i++){count=0;j=oribrTagIndices[i].index;while(oriText[j]!==">"){count++;j++}oriText=spliceSlice(oriText,oribrTagIndices[i].index,count+1,"");if(oribrTagIndices[i+1]){keyIndex=i+1;oribrTagIndices[i+1].index-=keyIndex*(count+1)}}if(brTagIndices.length){for(i=0;i<brTagIndices.length;i++){count=0;j=brTagIndices[i].index;while(dummyText[j]!==">"){count++;j++}dummyText=spliceSlice(dummyText,brTagIndices[i].index,count+1,"<br />");if(brTagIndices[i+1]){keyIndex=i+1;brTagIndices[i+1].index-=keyIndex*(count+1);brTagIndices[i+1].index+=keyIndex*6}}}tempText=dummyText;resultText=oriText;tagIndices=getSortedTagIndices(oriText);brTagIndices=getSortedBRTagIndices(tempText)}if(!tagIndices.length){return tempText}else if(!brTagIndices.length){return resolveSingleLineText(oriText,tagIndices)}else{resultText=mergeTags(oriText,tempText);resultText=resolveTags(resultText)}return resultText}SmartLabelManager.textToLines=function(smartlabel){smartlabel=smartlabel||{};if(!smartlabel.text){smartlabel.text=""}else if(typeof smartlabel.text!=="string"){smartlabel.text=smartlabel.text.toString()}smartlabel.lines=smartlabel.text.split(/\n|<br\s*?\/?>/gi);return smartlabel};SmartLabelManager.prototype._calCharDimWithCache=function(text,calculateDifference,length){if(text===void 0){text=""}if(!this._init){return false}var size,tw,twi,cachedStyle,asymmetricDifference,maxAdvancedCacheLimit=this.options.maxCacheLimit,style=this.style||{},cache,advancedCacheKey,cacheName,cacheInitName;cache=this._advancedCache=this._advancedCache||(this._advancedCache={});advancedCacheKey=this._advancedCacheKey||(this._advancedCacheKey=[]);cacheName=text+style.fontSize+style.fontFamily+style.fontWeight+style.fontStyle;cacheInitName=text+"init"+style.fontSize+style.fontFamily+style.fontWeight+style.fontStyle;if(!this.ctx&&htmlSplCharSpace[text]){text=htmlSplCharSpace[text]}if(!calculateDifference){asymmetricDifference=0}else{if((asymmetricDifference=cache[cacheInitName])===undefined){tw=this._getDimention(text.repeat?text.repeat(length):Array(length+1).join(text)).width;twi=this._getDimention(text).width;asymmetricDifference=cache[cacheInitName]=(tw-length*twi)/(length+1);advancedCacheKey.push(cacheInitName);if(advancedCacheKey.length>maxAdvancedCacheLimit){delete cache[advancedCacheKey.shift()]}}}if(cachedStyle=cache[cacheName]){return{width:cachedStyle.width,height:cachedStyle.height}}size=this._getDimention(text);size.width+=asymmetricDifference;cache[cacheName]={width:size.width,height:size.height};advancedCacheKey.push(cacheName);if(advancedCacheKey.length>maxAdvancedCacheLimit){delete cache[advancedCacheKey.shift()]}return size};SmartLabelManager.prototype._getDimention=function(text){if(this.requireDiv||!this.ctx){return slLib._getDimentionUsingDiv(text,this)}else{return slLib._getDimentionUsingCanvas(text,this)}};SmartLabelManager.prototype._getWidthFn=function(){var sl=this,contObj=sl._containerObj,svgText=contObj.svgText;if(svgText){return function(str){var bbox,width;svgText.textContent=str;bbox=svgText.getBBox();width=bbox.width-SVG_BBOX_CORRECTION;if(width<1){width=bbox.width}return width}}else{return function(str){if(sl.requireDiv||!sl.ctx){return slLib._getDimentionUsingDiv(str,sl).width}else{return slLib._getDimentionUsingCanvas(str,sl).width}}}};SmartLabelManager.prototype._isSameStyle=function(){var sl=this,oldStyle=sl.oldStyle||{},style=sl.style;if(style.fontSize!==oldStyle.fontSize||style.fontFamily!==oldStyle.fontFamily||style.fontStyle!==oldStyle.fontStyle||style.fontWeight!==oldStyle.fontWeight||style.fontVariant!==oldStyle.fontVariant){return false}return true};SmartLabelManager.prototype._setStyleOfCanvas=function(){if(this._isSameStyle()){return}var sl=this,style=sl.style,hashString,sCont,fontStyle=style.fontStyle,fontVariant=style.fontVariant,fontWeight=style.fontWeight,fontSize=style.fontSize,fontFamily=style.fontFamily;fontSize+=fontSize.indexOf("px")===-1?"px":"";hashString=fontStyle+" "+fontVariant+" "+fontWeight+" "+fontSize+" "+fontFamily;sl.ctx.font=hashString;sCont=this._containerObj=this._containerManager.get(style);if(this._containerObj){this._container=sCont.node;this._context=sCont.context;this._cache=sCont.charCache;this._lineHeight=sCont.lineHeight;this._styleNotSet=false}else{this._styleNotSet=true}sCont.ellipsesWidth=sl._calCharDimWithCache("...",false).width;sCont.dotWidth=sl._calCharDimWithCache(".",false).width;sCont.lineHeight=this._lineHeight=sCont.lineHeight||slLib._getCleanHeight(style.lineHeight);this.oldStyle=style};SmartLabelManager.prototype._setStyleOfDiv=function(){var sCont,style=this.style;this._containerObj=sCont=this._containerManager.get(style);if(!sCont.node){this._containerManager._makeDivNode(this._containerObj)}if(this._containerObj){this._container=sCont.node;this._context=sCont.context;this._cache=sCont.charCache;this._lineHeight=sCont.lineHeight;this._styleNotSet=false}else{this._styleNotSet=true}};SmartLabelManager.prototype._updateStyle=function(){return this.requireDiv||!this.ctx?this._setStyleOfDiv():this._setStyleOfCanvas()};SmartLabelManager.prototype.setStyle=function(style){this.style=slLib.parseStyle(style);slLib.setLineHeight(this.style);return this};SmartLabelManager.prototype.useEllipsesOnOverflow=function(useEllipses){if(!this._init){return this}this._showNoEllipses=!useEllipses;return this};SmartLabelManager.prototype.getSmartText=function(text,maxWidth,maxHeight,noWrap){if(!this._init){return false}if(text===undefined||text===null){text=""}else if(typeof text!=="string"){text=text.toString()}var len,trimStr,tempArr,tmpText,maxWidthWithEll,toolText,oriWidth,oriHeight,newCharIndex,nearestChar,tempChar,getWidth,initialLeft,initialTop,getOriSizeImproveObj,spanArr,x,y,minWidth,elem,chr,elemRightMostPoint,elemLowestPoint,lastBR,removeFromIndex,removeFromIndexForEllipses,hasHTMLTag=false,maxStrWidth=0,lastDash=-1,lastSpace=-1,lastIndexBroken=-1,strWidth=0,strHeight=0,oriTextArr=[],resolvedText="",i=0,originalText,ellipsesStr=this._showNoEllipses?"":"...",lineHeight,context,container,sCont,ellipsesWidth,dotWidth,canvas=this.ctx,characterArr=[],dashIndex=-1,spaceIndex=-1,lastLineBreak=-1,hasOnlyBrTag,dimentionObj,fastTrim=function fastTrim(str){str=str.replace(/^\s\s*/,"");var ws=/\s/,i=str.length;while(ws.test(str.charAt(i-=1))){}return str.slice(0,i+1)},smartLabel={text:text,maxWidth:maxWidth,maxHeight:maxHeight,width:null,height:null,oriTextWidth:null,oriTextHeight:null,oriText:text,isTruncated:false};hasHTMLTag=slLib.xmlTagRegEx.test(text)||slLib.nbspRegex.test(text);hasOnlyBrTag=slLib._hasOnlyBRTag(text);this.requireDiv=hasHTMLTag&&!hasOnlyBrTag;this._updateStyle();lineHeight=this._lineHeight;context=this._context;container=this._container;sCont=this._containerObj;ellipsesWidth=sCont.ellipsesWidth;dotWidth=sCont.dotWidth;toolText=text.replace(slLib.spanAdditionRegx,"$2");getWidth=this._getWidthFn();if(lineHeight-maxHeight<=1&&lineHeight-maxHeight>=0){maxHeight*=1.2}if(canvas||container){if(!documentSupport.isBrowserLess){tmpText=text=text.replace(slLib.ltgtquotRegex,(function(match){switch(match){case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&#034;":return'"';case"&#039;":return"'"}}));originalText=text;tmpText=text=tmpText.replace(/<u>/g,"").replace(/<\/u>/g,"").replace(/<b>/g,"").replace(/<\/b>/g,"").replace(/<strong>/g,"").replace(/<\/strong>/g,"").replace(/<em>/g,"").replace(/<\/em>/g,"").replace(/<i>/g,"").replace(/<\/i>/g,"").replace(/<strike>/g,"").replace(/<\/strike>/g,"").replace(/<s>/g,"").replace(/<\/s>/g,"").replace(/<del>/g,"").replace(/<\/del>/g,"").replace(/<sub>/g,"").replace(/<\/sub>/g,"").replace(/<sup>/g,"").replace(/<\/sup>/g,"").replace(/<a[\s]+([^>]+)>/g,"").replace(/<\/a>/g,"").replace(/<abbr[\s]+([^>]+)>/g,"").replace(/<\/abbr>/g,"").replace(/<span[\s]+([^>]+)>/g,"").replace(/<\/span>/g,"");if(!hasHTMLTag){tmpText=text=text.replace(slLib.ltgtquotRegex,(function(match){switch(match){case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&#034;":return'"';case"&#039;":return"'"}}));tmpText=text=tmpText.replace(/<u>/g,"").replace(/<\/u>/g,"").replace(/<b>/g,"").replace(/<\/b>/g,"").replace(/<strong>/g,"").replace(/<\/strong>/g,"").replace(/<em>/g,"").replace(/<\/em>/g,"").replace(/<i>/g,"").replace(/<\/i>/g,"").replace(/<strike>/g,"").replace(/<\/strike>/g,"").replace(/<s>/g,"").replace(/<\/s>/g,"").replace(/<del>/g,"").replace(/<\/del>/g,"").replace(/<sub>/g,"").replace(/<\/sub>/g,"").replace(/<sup>/g,"").replace(/<\/sup>/g,"").replace(/<a[\s]+([^>]+)>/g,"").replace(/<\/a>/g,"").replace(/<abbr[\s]+([^>]+)>/g,"").replace(/<\/abbr>/g,"").replace(/<span[\s]+([^>]+)>/g,"").replace(/<\/span>/g,"");getOriSizeImproveObj=this.getSize(tmpText,true,{hasHTMLTag:hasHTMLTag,hasOnlyBrTag:hasOnlyBrTag,cleanText:true});smartLabel.oriTextWidth=oriWidth=getOriSizeImproveObj.width;smartLabel.oriTextHeight=oriHeight=getOriSizeImproveObj.height}else if(hasOnlyBrTag){text=text.replace(slLib.brRegex,"<br />");dimentionObj=slLib._getDimentionOfMultiLineText(text,this);smartLabel.oriTextWidth=oriWidth=dimentionObj.width;smartLabel.oriTextHeight=oriHeight=dimentionObj.height}else{container.innerHTML=_trustedPolicy.default.createHTML(text);smartLabel.oriTextWidth=oriWidth=container.offsetWidth;smartLabel.oriTextHeight=oriHeight=container.offsetHeight}if(oriHeight<=maxHeight&&oriWidth<=maxWidth){resolvedText=doMergeTextWithTags(originalText,text);smartLabel.text=resolvedText;smartLabel.width=smartLabel.oriTextWidth=oriWidth;smartLabel.height=smartLabel.oriTextHeight=oriHeight;return smartLabel}if(lineHeight>maxHeight){smartLabel.text="";smartLabel.width=smartLabel.oriTextWidth=0;smartLabel.height=smartLabel.oriTextHeight=0;return smartLabel}}text=fastTrim(text).replace(/(\s+)/g," ");maxWidthWithEll=this._showNoEllipses?maxWidth:maxWidth-ellipsesWidth;if(!hasHTMLTag||hasOnlyBrTag){oriTextArr=slLib._getTextArray(text);len=oriTextArr.length;trimStr="";tempArr=[];tempChar=oriTextArr[0];if(this._cache[tempChar]){minWidth=this._cache[tempChar].width}else{minWidth=getWidth(tempChar);this._cache[tempChar]={width:minWidth}}if(maxWidthWithEll>minWidth&&!hasOnlyBrTag){tempArr=text.substr(0,slLib.getNearestBreakIndex(text,maxWidthWithEll,this)).split("")}else if(minWidth>maxWidth){smartLabel.text="";smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0;return smartLabel}else if(ellipsesStr){maxWidthWithEll=maxWidth-2*dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr=".."}else{maxWidthWithEll=maxWidth-dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr="."}else{maxWidthWithEll=0;ellipsesStr=""}}}i=tempArr.length;strWidth=getWidth(tempArr.join(""));strHeight=this._lineHeight;if(noWrap){for(;i<len;i+=1){tempChar=tempArr[i]=oriTextArr[i];if(tempArr[i]==="<br />"){strHeight+=this._lineHeight;lastIndexBroken=i;maxStrWidth=max(maxStrWidth,strWidth);strWidth=0;trimStr=null;continue}if(this._cache[tempChar]){minWidth=this._cache[tempChar].width}else{if(!getOriSizeImproveObj||!(minWidth=getOriSizeImproveObj.detailObj[tempChar])){minWidth=getWidth(tempChar)}this._cache[tempChar]={width:minWidth}}strWidth+=minWidth;if(strWidth>maxWidthWithEll){if(!trimStr){trimStr=tempArr.slice(0,-1).join("")}if(strWidth>maxWidth){smartLabel.text=fastTrim(trimStr)+ellipsesStr;smartLabel.tooltext=smartLabel.oriText;smartLabel.width=max(maxStrWidth,strWidth);smartLabel.height=strHeight;smartLabel.isTruncated=true;return smartLabel}}}smartLabel.text=tempArr.join("");smartLabel.width=max(maxStrWidth,strWidth);smartLabel.height=strHeight;return smartLabel}else{for(;i<len;i+=1){tempChar=tempArr[i]=oriTextArr[i];if(tempChar===" "&&!context){tempChar=this.ctx?" ":"&nbsp;"}if(tempArr[i]==="<br />"){maxStrWidth=max(maxStrWidth,strWidth);strHeight+=this._lineHeight;if(strHeight<=maxHeight){lastIndexBroken=i;strWidth=0;trimStr=null;continue}else if(strHeight>maxHeight){trimStr=tempArr.slice(0,-1).join("");smartLabel.text=fastTrim(trimStr)+ellipsesStr;smartLabel.tooltext=toolText;smartLabel.width=maxStrWidth;smartLabel.height=strHeight-this._lineHeight;smartLabel.isTruncated=true;return smartLabel}}if(this._cache[tempChar]){minWidth=this._cache[tempChar].width}else{if(!getOriSizeImproveObj||!(minWidth=getOriSizeImproveObj.detailObj[tempChar])){minWidth=getWidth(tempChar)}this._cache[tempChar]={width:minWidth}}strWidth+=minWidth;if(strWidth>maxWidthWithEll){if(!trimStr){trimStr=tempArr.slice(0,-1).join("")}if(strWidth>maxWidth){if(oriTextArr[i+1]==="<br />"){continue}lastSpace=slLib._findLastIndex(oriTextArr.slice(0,tempArr.length)," ");lastDash=slLib._findLastIndex(oriTextArr.slice(0,tempArr.length),"-");if(lastSpace>lastIndexBroken){strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join(""));tempArr.splice(lastSpace,1,"<br />");lastIndexBroken=lastSpace;newCharIndex=lastSpace+1}else if(lastDash>lastIndexBroken){if(lastDash===tempArr.length-1){strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join(""));tempArr.splice(lastDash,1,"<br />-")}else{strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastSpace).join(""));tempArr.splice(lastDash,1,"-<br />")}lastIndexBroken=lastDash;newCharIndex=lastDash+1}else{tempArr.splice(tempArr.length-1,1,"<br />"+oriTextArr[i]);lastLineBreak=tempArr.length-2;strWidth=getWidth(tempArr.slice(lastIndexBroken+1,lastLineBreak+1).join(""));lastIndexBroken=lastLineBreak;newCharIndex=i}strHeight+=this._lineHeight;if(strHeight>maxHeight){smartLabel.text=fastTrim(trimStr)+ellipsesStr;smartLabel.tooltext=smartLabel.oriText;smartLabel.width=maxWidth;smartLabel.height=strHeight-this._lineHeight;smartLabel.isTruncated=true;return smartLabel}else{maxStrWidth=max(maxStrWidth,strWidth);trimStr=null;if(!hasOnlyBrTag){nearestChar=slLib.getNearestBreakIndex(text.substr(newCharIndex),maxWidthWithEll,this);strWidth=getWidth(text.substr(newCharIndex,nearestChar||1));if(tempArr.length<newCharIndex+nearestChar){tempArr=tempArr.concat(text.substr(tempArr.length,newCharIndex+nearestChar-tempArr.length).split(""));i=tempArr.length-1}}else{strWidth=slLib._getDimentionOfMultiLineText(tempArr.slice(lastIndexBroken+1).join(""),this).width}}}}}maxStrWidth=max(maxStrWidth,strWidth);resolvedText=doMergeTextWithTags(originalText,tempArr.join(""));smartLabel.text=resolvedText;smartLabel.width=maxStrWidth;smartLabel.height=strHeight;return smartLabel}}else{toolText=text.replace(slLib.spanAdditionRegx,"$2");text=text.replace(slLib.spanAdditionRegx,slLib.spanAdditionReplacer);text=text.replace(/(<br\s*\/*\>)/g,'<span class="'+[slLib.classNameWithTag," ",slLib.classNameWithTagBR].join("")+'">$1</span>');container.innerHTML=_trustedPolicy.default.createHTML(text);spanArr=container[documentSupport.childRetriverFn](documentSupport.childRetriverString);for(x=0,y=spanArr.length;x<y;x+=1){elem=spanArr[x];if(documentSupport.noClassTesting||slLib.classNameReg.test(elem.className)){chr=elem.innerHTML;if(chr!==""){if(chr===" "){spaceIndex=characterArr.length}else if(chr==="-"){dashIndex=characterArr.length}characterArr.push({spaceIdx:spaceIndex,dashIdx:dashIndex,elem:elem});oriTextArr.push(chr)}}}i=0;len=characterArr.length;minWidth=len&&characterArr[0].elem.offsetWidth;if(minWidth>maxWidth||!len){smartLabel.text="";smartLabel.width=smartLabel.oriTextWidth=smartLabel.height=smartLabel.oriTextHeight=0;return smartLabel}else if(minWidth>maxWidthWithEll&&!this._showNoEllipses){maxWidthWithEll=maxWidth-2*dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr=".."}else{maxWidthWithEll=maxWidth-dotWidth;if(maxWidthWithEll>minWidth){ellipsesStr="."}else{maxWidthWithEll=0;ellipsesStr=""}}}initialLeft=characterArr[0].elem.offsetLeft;initialTop=characterArr[0].elem.offsetTop;if(noWrap){for(;i<len;i+=1){elem=characterArr[i].elem;elemRightMostPoint=elem.offsetLeft-initialLeft+elem.offsetWidth;if(elemRightMostPoint>maxWidthWithEll){if(!removeFromIndexForEllipses){removeFromIndexForEllipses=i}if(container.offsetWidth>maxWidth){removeFromIndex=i;i=len}}}}else{for(;i<len;i+=1){elem=characterArr[i].elem;elemLowestPoint=elem.offsetHeight+(elem.offsetTop-initialTop);elemRightMostPoint=elem.offsetLeft-initialLeft+elem.offsetWidth;lastBR=null;if(elemRightMostPoint>maxWidthWithEll){if(!removeFromIndexForEllipses){removeFromIndexForEllipses=i}if(elemRightMostPoint>maxWidth){lastSpace=characterArr[i].spaceIdx;lastDash=characterArr[i].dashIdx;if(lastSpace>lastIndexBroken){characterArr[lastSpace].elem.innerHTML=_trustedPolicy.default.createHTML("<br/>");lastIndexBroken=lastSpace}else if(lastDash>lastIndexBroken){if(lastDash===i){characterArr[lastDash].elem.innerHTML=_trustedPolicy.default.createHTML("<br/>-")}else{characterArr[lastDash].elem.innerHTML=_trustedPolicy.default.createHTML("-<br/>")}lastIndexBroken=lastDash}else{elem.parentNode.insertBefore(lastBR=doc.createElement("br"),elem)}if(elem.offsetHeight+elem.offsetTop>maxHeight){if(lastBR){lastBR.parentNode.removeChild(lastBR)}else if(lastIndexBroken===lastDash){characterArr[lastDash].elem.innerHTML=_trustedPolicy.default.createHTML("-")}else{characterArr[lastSpace].elem.innerHTML=_trustedPolicy.default.createHTML(" ")}removeFromIndex=i;i=len}else{removeFromIndexForEllipses=null}}}else{if(elemLowestPoint>maxHeight){removeFromIndex=i;i=len}}}}if(removeFromIndex<len){smartLabel.isTruncated=true;removeFromIndexForEllipses=removeFromIndexForEllipses?removeFromIndexForEllipses:removeFromIndex;for(i=len-1;i>=removeFromIndexForEllipses;i-=1){elem=characterArr[i].elem;elem.parentNode.removeChild(elem)}for(;i>=0;i-=1){elem=characterArr[i].elem;if(slLib.classNameBrReg.test(elem.className)){elem.parentNode.removeChild(elem)}else{i=0}}}smartLabel.text=container.innerHTML.replace(slLib.spanRemovalRegx,"$1").replace(/\&amp\;/g,"&");if(smartLabel.isTruncated){smartLabel.text+=ellipsesStr;smartLabel.tooltext=toolText}}smartLabel.height=container.offsetHeight;smartLabel.width=container.offsetWidth;return smartLabel}else{smartLabel.error=new Error("Body Tag Missing!");return smartLabel}};SmartLabelManager.prototype.getSize=function(text,detailedCalculationFlag,config){if(text===void 0){text=""}if(detailedCalculationFlag===void 0){detailedCalculationFlag=true}if(config===void 0){config={}}if(!this._init){return false}if(text===undefined||text===null){text=""}else if(typeof text!=="string"){text=text.toString()}var textArr,letter,lSize,i,l,cumulativeSize=0,height=0,container,indiSizeStore={},hasHTMLTag=config.hasHTMLTag,hasOnlyBrTag=config.hasOnlyBrTag;if(typeof hasHTMLTag==="undefined"){hasHTMLTag=slLib.xmlTagRegEx.test(text)||slLib.nbspRegex.test(text)}if(typeof hasOnlyBrTag==="undefined"){hasOnlyBrTag=slLib._hasOnlyBRTag(text)}this.requireDiv=hasHTMLTag&&!hasOnlyBrTag;if(!config.cleanText){text=text.replace(slLib.ltgtquotRegex,(function(match){switch(match){case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&#034;":return'"';case"&#039;":return"'"}}));text=text.replace(/<u>/g,"").replace(/<\/u>/g,"").replace(/<b>/g,"").replace(/<\/b>/g,"").replace(/<strong>/g,"").replace(/<\/strong>/g,"").replace(/<em>/g,"").replace(/<\/em>/g,"").replace(/<i>/g,"").replace(/<\/i>/g,"").replace(/<strike>/g,"").replace(/<\/strike>/g,"").replace(/<s>/g,"").replace(/<\/s>/g,"").replace(/<del>/g,"").replace(/<\/del>/g,"").replace(/<sub>/g,"").replace(/<\/sub>/g,"").replace(/<sup>/g,"").replace(/<\/sup>/g,"").replace(/<a[\s]+([^>]+)>/g,"").replace(/<\/a>/g,"").replace(/<abbr[\s]+([^>]+)>/g,"").replace(/<\/abbr>/g,"").replace(/<span[\s]+([^>]+)>/g,"").replace(/<\/span>/g,"")}this._updateStyle();container=this._container;if(!detailedCalculationFlag){return this._calCharDimWithCache(text)}else{textArr=text.split("");for(i=0,l=textArr.length;i<l;i++){letter=textArr[i];lSize=this._calCharDimWithCache(letter,false,textArr.length);height=max(height,lSize.height);cumulativeSize+=lSize.width;indiSizeStore[letter]=lSize.width}}if(hasOnlyBrTag){return _objectSpread(_objectSpread({},slLib._getDimentionOfMultiLineText(text,this)),{},{detailObj:indiSizeStore})}if(hasHTMLTag){container.innerHTML=_trustedPolicy.default.createHTML(text);return{width:container.offsetWidth,height:container.offsetHeight,detailObj:indiSizeStore}}return{width:round(cumulativeSize),height:height,detailObj:indiSizeStore}};SmartLabelManager.prototype.getOriSize=function(text,detailedCalculationFlag,config){if(text===void 0){text=""}if(detailedCalculationFlag===void 0){detailedCalculationFlag=true}if(config===void 0){config={}}return this.getSize(text,detailedCalculationFlag,config)};SmartLabelManager.prototype.dispose=function(){if(!this._init){return this}if(this._containerManager&&this._containerManager.dispose){this._containerManager.dispose()}delete this._container;delete this._context;delete this._cache;delete this._containerManager;delete this._containerObj;delete this.id;delete this.style;delete this.parentContainer;delete this._showNoEllipses;return this};var _default=SmartLabelManager;exports.default=_default;

@@ -1,1 +0,1 @@

"use strict";exports.__esModule=true;exports.default=_default;var _raphael=require("./raphael.lib");function _default(R){if(R.svg){var has="hasOwnProperty",tSpanStr="tspan",vAlignStr="vertical-align",lineHeightStr="line-height",fontSizeStr="font-size",imageStr="image",noneStr="none",notToTuneStr="_do-not-tune",textStr="text",textPathStr="textpath",rtlStr="rtl",hasSup=false,hasSub=false,arrayStr="array",middleStr="middle",bottomStr="bottom",topStr="top",pxStr="px",initialStr="initial",fnStr="function",brStr="<br>",hiddenStr="hidden",visibleStr="visible",objectStr="object",fillStr="fill",transformStr="transform",visibilityStr="visibility",IESplTspanAttr={visibility:hiddenStr,"font-size":"0px"},Str=String,VERTICAL="vertical",HORIZONTAL="horizontal",PRESERVESTRING="pre",BLANKSTRING="",toFloat=parseFloat,toInt=parseInt,vAlignMultiplier={top:0,bottom:-1,middle:-.5},win=R._g.win,navigator=win.navigator,isIE=false||!!document.documentMode,math=Math,UNDEF,mmax=math.max,abs=math.abs,pow=math.pow,sqrt=math.sqrt,xlinkRegx=/^xlink:/,separator=/[, ]+/,textBreakRegx=/\n|<br\s*?\/?>/i,ltgtbrRegex=/&lt|&gt|&quot|&#039|&#034|<br/i,nbspRegex=/&nbsp;|&#160;|&#xA0;/g,arrayShift=Array.prototype.shift,zeroStrokeFix=!!(/AppleWebKit/.test(navigator.userAgent)&&(!/Chrome/.test(navigator.userAgent)||navigator.appVersion.match(/Chrome\/(\d+)\./)[1]<29)),eve=R.eve,E="",S=" ",xlink="http://www.w3.org/1999/xlink",svgNSStr="http://www.w3.org/2000/svg",isIpad=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),typeStringSTR="string",markers={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},shapeRenderingAttrs={speed:"optimizeSpeed",crisp:"crispEdges",precision:"geometricPrecision"},nav=navigator.userAgent.toLowerCase(),isIE9=function(){var verIE=nav.indexOf("msie")!=-1?parseInt(nav.split("msie")[1]):false;if(verIE&&verIE===9){return true}else{return false}}(),supportsPointer=R.supportsPointer,supportsTouch=R.supportsTouch,markerCounter={},preLoad=function preLoad(elem,ig,isURL,paper){R._preload(isURL[1],(function(){var w=this.offsetWidth,h=this.offsetHeight;$(elem,{width:w,height:h});$(ig,{width:w,height:h});paper.safari()}))},quickExtend=function quickExtend(obj1,obj2){if(obj2){for(var key in obj2){obj1[key]=obj2[key]}}},lastHoveredInfo={elementInfo:[]},doc=R._g.doc,win=R._g.win,safeMouseEventMapping={mouseover:"touchstart",mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove",mouseout:"touchend"},createValidTextNode=function createValidTextNode(text,abbrArr){var underlineRegex=/<under>/g,underlineEndRegex=/<\/under>/g,boldRegex=/<bold>/g,boldEndRegex=/<\/bold>/g,emphasisRegex=/<em>/g,emphasisEndRegex=/<\/em>/g,strikeRegex=/<strike>/g,strikeEndRegex=/<\/strike>/g,subscriptRegex=/<sub[\s]+([^>]+)>|<sub>/g,subscriptEndRegex=/<\/sub>/g,superscriptRegex=/<sup[\s]+([^>]+)>|<sup>/g,superscriptEndRegex=/<\/sup>/g,abbrRegex=/<abbr[\s]+([^>]+)>/g,abbrEndRegex=/<\/abbr>/g,spanRegex=/<span[\s]+([^>]+)>|<span>/g,spanEndRegex=/<\/span>/g,anchorRegex=/<a[\s]+([^>]+)>/g,anchorEndRegex=/<\/a>/g,lastAttrList=[],index,subtext,tspanArray=[],startIndex=0,sortedIndices,underlinetagIndices=getTagIndices(underlineRegex,underlineEndRegex,text,"<under>","</under>"),boldtagIndices=getTagIndices(boldRegex,boldEndRegex,text,"<bold>","</bold>"),emtagIndices=getTagIndices(emphasisRegex,emphasisEndRegex,text,"<em>","</em>"),strikeTagIndices=getTagIndices(strikeRegex,strikeEndRegex,text,"<strike>","</strike>"),subscriptTagIndices=getSubSupTagIndices(subscriptRegex,subscriptEndRegex,text,"<sub>","</sub>"),superscriptTagIndices=getSubSupTagIndices(superscriptRegex,superscriptEndRegex,text,"<sup>","</sup>"),abbrTagIndices=getAbbrTagIndices(abbrRegex,abbrEndRegex,text,"<abbr>","</abbr>"),anchorTagIndices=getAnchorTagIndices(anchorRegex,anchorEndRegex,text,"<a>","</a>"),spanTagIndices=getSpanTagIndices(spanRegex,spanEndRegex,text,"<span>","</span>"),sortedIndices=sortTags(underlinetagIndices,boldtagIndices,emtagIndices,strikeTagIndices,subscriptTagIndices,superscriptTagIndices,abbrTagIndices,anchorTagIndices,spanTagIndices);if(sortedIndices.length){if(sortedIndices[0].index>startIndex){subtext=text.substring(startIndex,sortedIndices[0].index);tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,abbrArr,sortedIndices);startIndex=sortedIndices[0].index+sortedIndices[0].tagName.length}for(index=0;index<sortedIndices.length;index++){if(sortedIndices[index+1]!==UNDEF){lastAttrList=createAttrList(lastAttrList,sortedIndices[index]);if(startIndex===0&&sortedIndices[index].index===0){subtext=text.substring(startIndex+sortedIndices[index].tagName.length,sortedIndices[index+1].index)}else{subtext=text.substring(startIndex,sortedIndices[index+1].index)}tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,sortedIndices[index],abbrArr,sortedIndices);startIndex=sortedIndices[index+1].index+sortedIndices[index+1].tagName.length}}if(startIndex<text.length){subtext=text.substring(startIndex,text.length);tspanArray=createtspanArray(tspanArray,subtext,[],abbrArr,sortedIndices)}}return tspanArray},tagHash={"<bold>":{action:"add",tagAttr:"font-weight",tagAttrVal:"bold"},"</bold>":{action:"remove",actionTag:"<bold>"},"<under>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</under>":{action:"remove",actionTag:"<under>"},"<em>":{action:"add",tagAttr:"font-style",tagAttrVal:"italic"},"</em>":{action:"remove",actionTag:"<em>"},"<strike>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"line-through"},"</strike>":{action:"remove",actionTag:"<strike>"},"<sub>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"sub"},"</sub>":{action:"remove",actionTag:"<sub>"},"<sup>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"super"},"</sup>":{action:"remove",actionTag:"<sup>"},"<abbr>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</abbr>":{action:"remove",actionTag:"<abbr>"},"<a>":{action:"add"},"</a>":{action:"remove",actionTag:"<a>"},"<span>":{action:"add"},"</span>":{action:"remove",actionTag:"<span>"}},createAttrList=function createAttrList(attrArr,sortedIndex){var i,abbrReg=/<abbr[\s]+([^>]+)>/g,anchorReg=/<a[\s]+([^>]+)>/g,spanReg=/<span[\s]+([^>]+)>/g,subReg=/<sub[\s]+([^>]+)>/g,supReg=/<sup[\s]+([^>]+)>/g,obj;if(sortedIndex.tagName.match(abbrReg)){obj=MergeRecursive({tag:"<abbr>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(anchorReg)){obj=MergeRecursive({tag:"<a>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(spanReg)){obj=MergeRecursive({tag:"<span>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(subReg)){obj=MergeRecursive({tag:"<sub>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(supReg)){obj=MergeRecursive({tag:"<sup>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="add"){obj=MergeRecursive({tag:sortedIndex.tagName,sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="remove"){for(i=attrArr.length-1;i>=0;i--){if(attrArr[i].tag===tagHash[sortedIndex.tagName].actionTag){attrArr.splice(i,1);break}}}return attrArr},createtspanArray=function createtspanArray(tspanArray,str,lastAttr,indicesObj,abbrArr,sortedIndices){var textNode=R._g.doc.createTextNode(str),obj={},hasAnchor=false,hasAbbr=false,hasSpan=false,title="",style,anchor,tspan,i,j;if(isIE||_raphael.isFirefox){if(hasSub){obj["dy"]=-6;hasSub=false}if(hasSup){obj["dy"]=6;hasSup=false}}if(!lastAttr.length){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}else{for(i=0;i<lastAttr.length;i++){if(lastAttr[i].tag==="<abbr>"){hasAbbr=true;title=lastAttr[i].sortedIndex.title}else if(lastAttr[i].tag==="<a>"){hasAnchor=true;if(lastAttr[i].href!==""){obj["href"]=lastAttr[i].sortedIndex.href}if(indicesObj.target!==""){obj["target"]=lastAttr[i].sortedIndex.target}if(indicesObj.hreflang!==""){obj["hreflang"]=lastAttr[i].sortedIndex.hreflang}if(indicesObj.referrerpolicy!==""){obj["referrerpolicy"]=lastAttr[i].sortedIndex.referrerpolicy}if(indicesObj.rel!==""){obj["rel"]=lastAttr[i].sortedIndex.rel}anchor=$("a",obj)}else if(lastAttr[i].tag==="<span>"){hasSpan=true;style=lastAttr[i].sortedIndex.style}else if(lastAttr[i].tag==="<sub>"){hasSub=true;style=lastAttr[i].sortedIndex.style}else if(lastAttr[i].tag==="<sup>"){hasSup=true;style=lastAttr[i].sortedIndex.style}if(tagHash[lastAttr[i].tag].tagAttr&&tagHash[lastAttr[i].tag].tagAttrVal){if(isIE||_raphael.isFirefox){if(lastAttr[i].tag==="<sup>"){obj["dy"]=-6;hasSup=true}else if(lastAttr[i].tag==="<sub>"){obj["dy"]=6;hasSub=true}}obj[tagHash[lastAttr[i].tag].tagAttr]=tagHash[lastAttr[i].tag].tagAttrVal}}if(hasAnchor){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);anchor.appendChild(tspan);tspanArray.push(anchor);hasAnchor=false}}else if(hasAbbr){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);abbrArr.push({tspan:tspan,title:title});tspanArray.push(tspan)}}else if(hasSpan){if(str!==""){obj=MergeRecursive(obj,style);tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}else if(hasSub||hasSup){if(str!==""){obj=MergeRecursive(obj,style);tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}else{if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}}return tspanArray},MergeRecursive=function MergeRecursive(obj1,obj2){for(var p in obj2){try{if(obj2[p].constructor==Object){obj1[p]=MergeRecursive(obj1[p],obj2[p])}else{obj1[p]=obj2[p]}}catch(e){obj1[p]=obj2[p]}}return obj1},sortTags=function sortTags(u,b,em,strike,sub,sup,abbr,a,sp){var i,j,tagArr=[u,b,em,strike,sub,sup,abbr,a,sp],res=[];for(j=0;j<tagArr.length;j++){for(var key in tagArr[j]){if(tagArr[j][key].length){for(i=0;i<tagArr[j][key].length;i++){res.push(tagArr[j][key][i])}}}}res=res.sort((function(a,b){return a.index-b.index}));return res},getAbbrTagIndices=function getAbbrTagIndices(abbrRegex,abbrEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,title,endtagindices=[];while(result=abbrRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</abbr>";dummyNode.innerHTML=testAbbr;title=dummyNode.childNodes[0]?dummyNode.childNodes[0].title:"";tagindices.push({tagName:result[0],index:result.index,title:title?title:""})}while(result=abbrEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getStyles=function getStyles(el){var output={};if(!el||!el.style||!el.style.cssText){return output}var camelize=function camelize(str){return str.replace(/(?:^|[-])(\w)/g,(function(a,c){c=a.substr(0,1)==="-"?c.toUpperCase():c;return c?c:""}))};var style=el.style.cssText.split(";");for(var i=0;i<style.length;++i){var rule=style[i].trim();if(rule){var ruleParts=rule.split(":");var key=ruleParts[0].trim();output[key]=ruleParts[1].trim()}}return output},getSpanTagIndices=function getSpanTagIndices(spanRegex,spanEndRegex,text,tagText,endtagText){var tagindices=[],result,dummySpan,testSpan,styleObj,endtagindices=[];while(result=spanRegex.exec(text)){dummySpan=document.createElement("p");testSpan=result[0]+"Dummy</span>";dummySpan.innerHTML=testSpan;styleObj=getStyles(dummySpan.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:""})}while(result=spanEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getSubSupTagIndices=function getSubSupTagIndices(subSupRegex,subSupEndRegex,text,tagText,endtagText){var tagindices=[],result,dummySpan,testSpan,styleObj,endtagindices=[];while(result=subSupRegex.exec(text)){dummySpan=document.createElement("p");testSpan=result[0]+"Dummy"+endtagText;dummySpan.innerHTML=testSpan;styleObj=getStyles(dummySpan.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:""})}while(result=subSupEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},isUrlValid=function isUrlValid(userInput){var res=userInput.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&=]*)/g);if(!res)return false;else return true},getAnchorTagIndices=function getAnchorTagIndices(anchorRegex,anchorEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyAnchor,testAnchor,isValidHref,endtagindices=[];while(result=anchorRegex.exec(text)){dummyAnchor=document.createElement("p");testAnchor=result[0]+"</a>";dummyAnchor.innerHTML=testAnchor;isValidHref=isUrlValid(encodeURIComponent(dummyAnchor.childNodes[0].href));tagindices.push({tagName:result[0],index:result.index,href:isValidHref?dummyAnchor.childNodes[0].href:"",target:dummyAnchor.childNodes[0].target?dummyAnchor.childNodes[0].target:"",hreflang:dummyAnchor.childNodes[0].hreflang?dummyAnchor.childNodes[0].hreflang:"",referrerpolicy:dummyAnchor.childNodes[0].referrerpolicy?dummyAnchor.childNodes[0].referrerpolicy:"",rel:dummyAnchor.childNodes[0].rel?dummyAnchor.childNodes[0].rel:""})}while(result=anchorEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getTagIndices=function getTagIndices(tagRegex,endTagRegex,text,tagText,endtagText){var tagindices=[],result,endtagindices=[];while(result=tagRegex.exec(text)){tagindices.push({tagName:tagText,index:result.index})}while(result=endTagRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},allPossibleAttrs={"accent-height":true,accumulate:true,additive:true,"alignment-baseline":true,alphabetic:true,amplitude:true,"arabic-form":true,ascent:true,azimuth:true,"baseline-shift":true,bbox:true,begin:true,bias:true,by:true,"cap-height":true,class:true,clip:true,"clip-path":true,"clip-rule":true,color:true,"color-interpolation":true,"color-interpolation-filters":true,"color-profile":true,"color-rendering":true,cursor:true,cx:true,cy:true,d:true,decelerate:true,descent:true,direction:true,display:true,divisor:true,"dominant-baseline":true,dur:true,dx:true,dy:true,elevation:true,"enable-background":true,end:true,exponent:true,fill:true,"fill-opacity":true,"fill-rule":true,filter:true,"flood-color":true,"flood-opacity":true,"font-family":true,"font-size":true,"font-size-adjust":true,"font-stretch":true,"font-style":true,"font-variant":true,"font-weight":true,format:true,fr:true,from:true,fx:true,fy:true,g1:true,g2:true,"glyph-name":true,"glyph-orientation-horizontal":true,"glyph-orientation-vertical":true,hanging:true,height:true,"horiz-adv-x":true,"horiz-origin-x":true,href:true,hreflang:true,id:true,ideographic:true,"image-rendering":true,in2:true,in:true,intercept:true,k1:true,k2:true,k3:true,k4:true,k:true,kerning:true,lang:true,"letter-spacing":true,"lighting-color":true,local:true,"marker-end":true,"marker-mid":true,"marker-start":true,mask:true,mathematical:true,max:true,media:true,method:true,min:true,mode:true,name:true,offset:true,opacity:true,operator:true,order:true,orient:true,orientation:true,origin:true,overflow:true,"overline-position":true,"overline-thickness":true,"paint-order":true,"panose-1":true,path:true,ping:true,"pointer-events":true,points:true,r:true,radius:true,rel:true,"rendering-intent":true,restart:true,result:true,rotate:true,rx:true,ry:true,scale:true,seed:true,"shape-rendering":true,slope:true,spacing:true,speed:true,stemh:true,stemv:true,"stop-color":true,"stop-opacity":true,"strikethrough-position":true,"strikethrough-thickness":true,string:true,stroke:true,"stroke-dasharray":true,"stroke-dashoffset":true,"stroke-linecap":true,"stroke-linejoin":true,"stroke-miterlimit":true,"stroke-opacity":true,"stroke-width":true,style:true,tabindex:true,target:true,"text-anchor":true,"text-decoration":true,"text-rendering":true,to:true,transform:true,type:true,u1:true,u2:true,"underline-position":true,"underline-thickness":true,unicode:true,"unicode-bidi":true,"unicode-range":true,"units-per-em":true,"v-alphabetic":true,"v-hanging":true,"v-ideographic":true,"v-mathematical":true,values:true,"vector-effect":true,version:true,"vert-adv-y":true,"vert-origin-x":true,"vert-origin-y":true,visibility:true,width:true,widths:true,"word-spacing":true,"writing-mode":true,x1:true,x2:true,x:true,"x-height":true,"xlink:actuate":true,"xlink:arcrole":true,"xlink:href":true,"xlink:role":true,"xlink:show":true,"xlink:title":true,"xlink:type":true,"xml:base":true,"xml:lang":true,"xml:space":true,y1:true,y2:true,y:true,z:true};if(supportsTouch){doc.addEventListener(supportsPointer?"pointerover":"touchstart",(function(e){if(lastHoveredInfo.srcElement&&lastHoveredInfo.srcElement!==(e.srcElement||e.target)){var elementInfo=lastHoveredInfo.elementInfo,ii=elementInfo.length,elementInfo,elems,i;for(i=0;i<ii;i++){elems=elementInfo[i];elems.callback.call(elems.el,e)}}lastHoveredInfo={elementInfo:[]}}),true)}R.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};R._url=E;var updateGradientReference=function updateGradientReference(element,newGradient,attr){if(attr===void 0){attr="fill"}var gradient=attr==="fill"?element.gradient:element["stroke-gradient"];if(gradient){if(gradient===newGradient){return}gradient.refCount--;if(!gradient.refCount){gradient.parentNode.removeChild(gradient)}attr==="fill"?delete element.gradient:delete element["stroke-gradient"]}if(newGradient){attr==="fill"?element.gradient=newGradient:element["stroke-gradient"]=newGradient;newGradient.refCount++}};var $=R._createNode=function(el,attr){if(typeof el===typeStringSTR){el=R._g.doc.createElementNS(svgNSStr,el)}if(attr){var key,value;for(key in attr){value=isIE9?Str(attr[key]):attr[key];if(xlinkRegx.test(key)){el.setAttributeNS(xlink,key.replace(xlinkRegx,E),value)}else{el.setAttribute(key,value)}}}return el},gradientUnitNames={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},gradientSpreadNames={pad:"pad",redlect:"reflect",repeat:"repeat"},addGradient=function addGradient(element,gradient,attr){var _$;if(attr===void 0){attr="fill"}if(!element.paper||!element.paper.defs){return 0}var type="linear",SVG=element.paper,id=R.getElementID((SVG.id+"-"+gradient).replace(/[()\s%:,\xb0#]/g,"_")),fx=.5,fy=.5,r,cx,cy,units,spread,o=element.node,s=o.style,el=R._g.doc.getElementById(id),vector;if(!el){gradient=Str(gradient).replace(R._radial_gradient,(function(all,opts){type="radial";opts=opts?opts.split(","):[];units=opts[5];spread=opts[6];var _fx=opts[0],_fy=opts[1],_r=opts[2],_cx=opts[3],_cy=opts[4],shifted=_fx&&_fy,dir,sqx;if(_r){r=/%/.test(_r)?_r:toFloat(_r)}if(units===gradientUnitNames.userSpaceOnUse){if(shifted){fx=_fx;fy=_fy}if(_cx&&_cy){cx=_cx;cy=_cy;if(!shifted){fx=cx;fy=cy}}return E}if(shifted){fx=toFloat(_fx);fy=toFloat(_fy);dir=(fy>.5)*2-1;(sqx=pow(fx-.5,2))+pow(fy-.5,2)>.25&&sqx<.25&&(fy=sqrt(.25-sqx)*dir+.5)&&fy!==.5&&(fy=fy.toFixed(5)-1e-5*dir)}if(_cx&&_cy){cx=toFloat(_cx);cy=toFloat(_cy);dir=(cy>.5)*2-1;(sqx=pow(cx-.5,2))+pow(cy-.5,2)>.25&&sqx<.25&&(cy=sqrt(.25-sqx)*dir+.5)&&cy!==.5&&(cy=cy.toFixed(5)-1e-5*dir);if(!shifted){fx=cx;fy=cy}}return E}));gradient=gradient.split(/\s*-\s*/);if(type==="linear"){var angle=gradient.shift(),specs=angle.match(/\((.*)\)/),max;specs=specs&&specs[1]&&specs[1].split(/\s*,\s*/);angle=-toFloat(angle);if(isNaN(angle)){return null}if(specs&&specs.length){if(specs[0]in gradientUnitNames){units=specs.shift();specs[0]in gradientSpreadNames&&(spread=specs.shift())}else{specs[4]&&(units=specs[4]);specs[5]&&(spread=specs[5])}vector=[specs[0]||"0%",specs[1]||"0%",specs[2]||"100%",specs[3]||"0%"]}else{vector=[0,0,math.cos(R.rad(angle)),math.sin(R.rad(angle))];max=1/(mmax(abs(vector[2]),abs(vector[3]))||1);vector[2]*=max;vector[3]*=max;if(vector[2]<0){vector[0]=-vector[2];vector[2]=0}if(vector[3]<0){vector[1]=-vector[3];vector[3]=0}}}var dots=R._parseDots(gradient);if(!dots){return null}el=$(type+"Gradient",{id:id});el.refCount=0;units in gradientUnitNames&&el.setAttribute("gradientUnits",Str(units));spread in gradientSpreadNames&&el.setAttribute("spreadMethod",Str(spread));if(type==="radial"){r!==undefined&&el.setAttribute("r",Str(r));if(cx!==undefined&&cy!==undefined){el.setAttribute("cx",Str(cx));el.setAttribute("cy",Str(cy))}el.setAttribute("fx",Str(fx));el.setAttribute("fy",Str(fy))}else{$(el,{x1:vector[0],y1:vector[1],x2:vector[2],y2:vector[3]})}for(var i=0,ii=dots.length;i<ii;i++){el.appendChild($("stop",{offset:dots[i].offset?dots[i].offset:i?"100%":"0%","stop-color":dots[i].color||"#fff","stop-opacity":dots[i].opacity===undefined?1:dots[i].opacity}))}SVG.defs.appendChild(el)}updateGradientReference(element,el,attr);$(o,(_$={},_$[attr]="url('"+R._url+"#"+id+"')",_$[attr+"-opacity"]=1,_$));s.fill=E;return 1},updatePosition=function updatePosition(o){var bbox=o.getBBox(1);$(o.pattern,{patternTransform:o.matrix.invert()+" translate("+bbox.x+","+bbox.y+")"})},addArrow=function addArrow(o,value,isEnd){if(o.type=="path"){var values=Str(value).toLowerCase().split("-"),p=o.paper,se=isEnd?"end":"start",node=o.node,attrs=o.attrs,stroke=attrs["stroke-width"],i=values.length,type="classic",from,to,dx,refX,attr,w=3,h=3,t=5;while(i--){switch(values[i]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":type=values[i];break;case"wide":h=5;break;case"narrow":h=2;break;case"long":w=5;break;case"short":w=2;break}}if(type=="open"){w+=2;h+=2;t+=2;dx=1;refX=isEnd?4:1;attr={fill:"none",stroke:attrs.stroke}}else{refX=dx=w/2;attr={fill:attrs.stroke,stroke:"none"}}if(o._.arrows){if(isEnd){o._.arrows.endPath&&markerCounter[o._.arrows.endPath]--;o._.arrows.endMarker&&markerCounter[o._.arrows.endMarker]--}else{o._.arrows.startPath&&markerCounter[o._.arrows.startPath]--;o._.arrows.startMarker&&markerCounter[o._.arrows.startMarker]--}}else{o._.arrows={}}if(type!="none"){var pathId="raphael-marker-"+type,markerId="raphael-marker-"+se+type+w+h+"-obj"+o.id;if(!R._g.doc.getElementById(pathId)){p.defs.appendChild($($("path"),{"stroke-linecap":"round",d:markers[type],id:pathId}));markerCounter[pathId]=1}else{markerCounter[pathId]++}var marker=R._g.doc.getElementById(markerId),use;if(!marker){marker=$($("marker"),{id:markerId,markerHeight:h,markerWidth:w,orient:"auto",refX:refX,refY:h/2});use=$($("use"),{"xlink:href":"#"+pathId,transform:(isEnd?"rotate(180 "+w/2+" "+h/2+") ":E)+"scale("+w/t+","+h/t+")","stroke-width":(1/((w/t+h/t)/2)).toFixed(4)});marker.appendChild(use);p.defs.appendChild(marker);markerCounter[markerId]=1}else{markerCounter[markerId]++;use=marker.getElementsByTagName("use")[0]}$(use,attr);var delta=dx*(type!="diamond"&&type!="oval");if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-delta*stroke}else{from=delta*stroke;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}attr={};attr["marker-"+se]="url('"+R._url+"#"+markerId+"')";if(to||from){attr.d=R.getSubpath(attrs.path,from,to)}$(node,attr);o._.arrows[se+"Path"]=pathId;o._.arrows[se+"Marker"]=markerId;o._.arrows[se+"dx"]=delta;o._.arrows[se+"Type"]=type;o._.arrows[se+"String"]=value}else{if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-from}else{from=0;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}o._.arrows[se+"Path"]&&$(node,{d:R.getSubpath(attrs.path,from,to)});delete o._.arrows[se+"Path"];delete o._.arrows[se+"Marker"];delete o._.arrows[se+"dx"];delete o._.arrows[se+"Type"];delete o._.arrows[se+"String"]}for(attr in markerCounter){if(markerCounter[has](attr)&&!markerCounter[attr]){var item=R._g.doc.getElementById(attr);item&&item.parentNode.removeChild(item)}}}},dasharray={"":[noneStr],none:[noneStr],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},addDashes=function addDashes(o,value,params){if(value!==undefined){var predefValue=dasharray[value.toLowerCase&&value.toLowerCase()],calculatedValues,width,butt,i,widthFactor;value=predefValue||[].concat(value);if(R.is(value,arrayStr)){width=params["stroke-width"]||o.attrs["stroke-width"]||1;butt={round:width,square:width,butt:0}[params["stroke-linecap"]||o.attrs["stroke-linecap"]]||0;i=value.length;widthFactor=predefValue?width:1;if(value[0]===noneStr){calculatedValues=value}else{calculatedValues=[];while(i--){calculatedValues[i]=value[i]*widthFactor+(i%2?1:-1)*butt;calculatedValues[i]<=0&&(calculatedValues[i]=.01+(width<=1?butt:0));if(isNaN(calculatedValues[i])){calculatedValues[i]=0}}}return{"stroke-dasharray":calculatedValues.join(",")}}}},setFillAndStroke=R._setFillAndStroke=function(o,params){if(!o.paper.canvas){return}var node=o.node,attrs=o.attrs,paper=o.paper,el,att,finalAttr={},finalS={},ignoreAttrs={"clip-rect":true},value,pathClip,urlArr,rect;if(o.type===imageStr){(0,_raphael.loadRefImage)(o,params)}for(att in params){if(att in R._availableAttrs){value=params[att];if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}else if(value===null&&!ignoreAttrs[att]){if(att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}}else{attrs[att]=value;switch(att){case"blur":o.blur(value);break;case"href":case"title":case"target":var pn=node.parentNode;if(pn.tagName.toLowerCase()!=="a"){if(value===E){break}var hl=$("a");hl.raphael=true;hl.raphaelid=node.raphaelid;pn.insertBefore(hl,node);hl.appendChild(node);pn=hl}if(att==="target"){pn.setAttributeNS(xlink,"show",value==="blank"?"new":value)}else{pn.setAttributeNS(xlink,att,value)}node.titleNode=pn;break;case"cursor":finalS.cursor=value;break;case"transform":o.transform(value);break;case"rotation":if(R.is(value,arrayStr)){o.rotate.apply(o,value)}else{o.rotate(value)}break;case"arrow-start":addArrow(o,value);break;case"arrow-end":addArrow(o,value,1);break;case"clip-path":pathClip=true;case"clip-rect":rect=!pathClip&&Str(value).split(separator);o._.clipispath=!!pathClip;if(pathClip||rect.length===4){o.clip&&o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);var rc=$(pathClip?"path":"rect");el=$("clipPath");el.id=R.getElementID(R.createUUID());$(rc,pathClip?{d:value?attrs["clip-path"]=R._pathToAbsolute(value):R._availableAttrs.path,fill:noneStr}:{x:rect[0],y:rect[1],width:rect[2],height:rect[3],transform:o.matrix.invert()});el.appendChild(rc);paper.defs.appendChild(el);finalAttr["clip-path"]="url('"+R._url+"#"+el.id+"')";o.clip=rc}if(!value){var path=node.getAttribute("clip-path");if(path){var clip=R._g.doc.getElementById(path.replace(/(^url\(#|\)$)/g,E));clip&&clip.parentNode.removeChild(clip);finalAttr["clip-path"]=E;document.documentMode===11&&node.removeAttribute("clip-path");delete o.clip}}break;case"path":if(o.type==="path"){finalAttr.d=value?attrs.path=R._stopabsolutePath?R.sanitizePath(value):R._pathToAbsolute(value):R._availableAttrs.path;o._.dirty=1;if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"width":finalAttr[att]=value;o._.dirty=1;if(attrs.fx){att="x";value=attrs.x}else{break}case"x":if(attrs.fx){value=-attrs.x-(attrs.width||0)}case"rx":if(att==="rx"&&o.type==="rect"){break}case"cx":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"height":finalAttr[att]=value;o._.dirty=1;if(attrs.fy){att="y";value=attrs.y}else{break}case"y":if(o.type===textStr&&!o.attrs["text-bound"]){break}if(attrs.fy){value=-attrs.y-(attrs.height||0)}case"ry":if(att==="ry"&&o.type==="rect"){break}case"cy":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"r":if(o.type==="rect"){finalAttr.rx=finalAttr.ry=value}else{finalAttr[att]=value}o._.dirty=1;break;case"src":if(o.type===imageStr){node.setAttributeNS(xlink,"href",value)}break;case"stroke-width":if(o._.sx!==1||o._.sy!==1){value/=mmax(abs(o._.sx),abs(o._.sy))||1}if(paper._vbSize){value*=paper._vbSize}if(zeroStrokeFix&&value===0){value=1e-6}finalAttr[att]=value;if(!params["stroke-dasharray"]&&attrs["stroke-dasharray"]&&params["stroke-dasharray"]!==""){quickExtend(finalAttr,addDashes(o,attrs["stroke-dasharray"],params))}if(o._.arrows){"startString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.endString,1)}break;case"stroke-dasharray":quickExtend(finalAttr,addDashes(o,value,params));break;case"fill":var isURL=R._ISURL.test(value);if(isURL){urlArr=value.split(R._ISURL);el=$("pattern");var ig=$(imageStr);el.id=R.getElementID(R.createUUID());$(el,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});$(ig,{x:0,y:0,"xlink:href":urlArr[1]});el.appendChild(ig);preLoad(el,ig,urlArr,paper);paper.defs.appendChild(el);finalAttr.fill="url('"+R._url+urlArr[1]+"')";o.pattern=el;o.pattern&&updatePosition(o);break}var clr=R.getRGB(value);if(!clr.error){delete params.gradient;delete attrs.gradient;!R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")&&(finalAttr["fill-opacity"]=attrs["fill-opacity"]);o.gradient&&updateGradientReference(o)}else if((o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value)){attrs.gradient=value;break}if(clr[has]("opacity")){finalAttr["fill-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.fillOpacityDirty=true}else if(o._.fillOpacityDirty&&R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")){node.removeAttribute("fill-opacity");delete o._.fillOpacityDirty}case"stroke":clr=R.getRGB(value);if(clr.error){if(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r"){addGradient(o,value,"stroke")}}else{finalAttr[att]=clr.hex;updateGradientReference(o,UNDEF,att)}if(att==="stroke"){if(clr[has]("opacity")){finalAttr["stroke-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.strokeOpacityDirty=true}else if(o._.strokeOpacityDirty&&R.is(attrs["stroke-opacity"],"undefined")&&R.is(params["stroke-opacity"],"undefined")){node.removeAttribute("stroke-opacity");delete o._.strokeOpacityDirty}if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"gradient":(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value);break;case"visibility":value===hiddenStr?o.hide():o.show();break;case"opacity":value=value>1?value/100:value;finalAttr.opacity=value;break;case"fill-opacity":value=value>1?value/100:value;finalAttr["fill-opacity"]=value;break;case"shape-rendering":o.attrs[att]=value=shapeRenderingAttrs[value]||value||"auto";finalAttr[att]=value;node.style.shapeRendering=value;break;case"line-height":case"vertical-align":break;default:att===fontSizeStr&&(value=toInt(value,10)+"px");o._.dirty=1;finalAttr[att]=value;if(_raphael.dashedAttr2CSSMap[att]){finalS[_raphael.dashedAttr2CSSMap[att]]=value}break}}}else if(att in allPossibleAttrs){if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att)}else{attrs[att]=value;finalS[att]=value}}}for(att in finalS){node.style[att]=finalS[att]}for(att in finalAttr){node.setAttribute(att,finalAttr[att])}o.type===textStr&&!params[notToTuneStr]&&tuneText(o,params)},updateFollowers=R._updateFollowers=function(){var i,ii,followerElem,args=(0,_raphael.getArrayCopy)(arguments),o=arrayShift.call(args),fnName=arrayShift.call(args);for(i=0,ii=o.followers.length;i<ii;i++){followerElem=o.followers[i].el;followerElem[fnName].apply(followerElem,args)}},leading=1.2,tuneText=function tuneText(el,params){if(el.type!==textStr||!(params[has](textStr)||params[has]("font")||params[has](fontSizeStr)||params[has]("x")||params[has]("y")||params[has](lineHeightStr)||params[has](vAlignStr)||params[has](textPathStr))){return}var a=el.attrs,defs=el.paper.defs,group=el.parent,node=el.node,fontSize,oldAttr=el._oldAttr=el._oldAttr||{baseLineDiff:8,valign:-.5},lineHeight=toFloat(params[lineHeightStr]||a[lineHeightStr]),direction=params.direction||a.direction||group&&group.attrs&&group.attrs.direction||oldAttr.direction||initialStr,valign,updateNode=false,tspanAttr,updateTspan=false,i,spanArr=[],abbrindx,dummyEl,tspanArr=[],abbrArr=[],hasTags=false,l,ii,j=!isIE&&direction===rtlStr?2:1,texts,tempIESpan,tspan,updateAlignment=false,tspans,text,textChanged=false,removeAllChild,hasnbsp=function hasnbsp(text){return text&&nbspRegex.test(text)},spacify=function spacify(text){return text.replace(/\s+/g," ").trim().replace(nbspRegex," ")};if(params[has](textPathStr)){var rUUID=R.getElementID(R.createUUID()),textPathParams=params[textPathStr];var textPath,tSpan,txtNode,dy=0,textPathProps={};for(var key in textPathParams){if(textPathParams.hasOwnProperty(key)){if(key==="path"&&!("href"in textPathParams)){if(oldAttr.textPathStr!==textPathParams[key]){if(el.textPathDef){el.textPathDef.setAttribute("d",textPathParams[key]||E);textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}else{el.textPathDef=defs.appendChild($("path",{id:rUUID,d:textPathParams[key]||E}));textPathProps.href="#"+rUUID;textPathProps["xlink:href"]="#"+rUUID}oldAttr.textPathStr=textPathParams[key]}else{textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}}else{textPathProps[key]=textPathParams[key]}}}if(params[has](textStr)){txtNode=R._g.doc.createTextNode(params[textStr]||E);oldAttr.pathText=a.text=params[textStr]||E}else{txtNode=R._g.doc.createTextNode(oldAttr.pathText||oldAttr.text||E);oldAttr.pathText=oldAttr.pathText||oldAttr.text||E;delete oldAttr.text}if(params[has](vAlignStr)){if(params[vAlignStr]===middleStr){dy=.3;oldAttr.valign=-.5}else if(params[vAlignStr]===bottomStr){dy=.7;oldAttr.valign=-1}else if(params[vAlignStr]===topStr){oldAttr.valign=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}else{if(oldAttr.tSpan&&(oldAttr.tSpan.textContent===params[textStr]||typeof params[textStr]!==typeStringSTR)){tSpan=oldAttr.tSpan}else{if(oldAttr.valign===-.5){dy=.3}else if(oldAttr.valign===-1){dy=.7}else{dy=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}}if(params[textStr]!==UNDEF){delete oldAttr.x;delete oldAttr.y;node.removeAttribute("x");node.removeAttribute("y");textPath=$("textPath",textPathProps);textPath.appendChild(tSpan||txtNode);while(node.firstChild){node.removeChild(node.firstChild)}node.appendChild(textPath)}}else{oldAttr.direction=direction;if(el.textPathDef&&defs){el.textPathDef.parentNode.removeChild(el.textPathDef);delete el.textPathDef}delete oldAttr.txtNode;delete oldAttr.tSpan;delete oldAttr.textPathStr;if(!lineHeight){fontSize=params.fontSize||params[fontSizeStr]||a[fontSizeStr]||group&&group.attrs&&group.attrs.fontSize;fontSize=fontSize?fontSize.toString().replace(pxStr,E):10;lineHeight=fontSize*leading}if(params[has](textStr)||oldAttr.pathText){if(R.is(params.text,arrayStr)){text=params.text.join(brStr)}else if(params.text==null){text=oldAttr.pathText}else{text=params.text}delete oldAttr.pathText;text=text.toString();if(text!==oldAttr.text){textChanged=true;if(text&&ltgtbrRegex.test(text)){text=text.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;|&#034;/g,'"').replace(/&#039;/g,"'").replace(/&<br\/>lt;|&l<br\/>t;|&lt<br\/>;/g,"<<br/>").replace(/&<br\/>gt;|&g<br\/>t;|&gt<br\/>;/g,"><br/>")}text=text.replace(/<u>/g,"<under>").replace(/<\/u>/g,"</under>").replace(/<b>/g,"<bold>").replace(/<\/b>/g,"</bold>").replace(/<strong>/g,"<bold>").replace(/<\/strong>/g,"</bold>").replace(/<em>/g,"<em>").replace(/<\/em>/g,"</em>").replace(/<i>/g,"<em>").replace(/<\/i>/g,"</em>").replace(/<strike>/g,"<strike>").replace(/<\/strike>/g,"</strike>").replace(/<s>/g,"<strike>").replace(/<\/s>/g,"</strike>").replace(/<del>/g,"<strike>").replace(/<\/del>/g,"</strike>").replace(/<sub>/g,"<sub>").replace(/<\/sub>/g,"</sub>").replace(/<sup>/g,"<sup>").replace(/<\/sup>/g,"</sup>");oldAttr.text=a.text=text;if(textBreakRegx.test(text)){if(oldAttr.noTSpan){oldAttr.noTSpan=!(removeAllChild=true)}texts=Str(text).split(textBreakRegx);l=texts.length}else{removeAllChild=true;oldAttr.noTSpan=true;l=1}if(oldAttr.lineCount!==l){oldAttr.lineCount=l;updateAlignment=true}}}if(lineHeight!==oldAttr.lineHeight){oldAttr.lineHeight=lineHeight;oldAttr.baseLineDiff=lineHeight*.75;updateAlignment=true}if(removeAllChild){while(node.firstChild){node.removeChild(node.firstChild)}}if(oldAttr.lineCount>1){if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanAttr={};if(!oldAttr.tspanAttr){oldAttr.tspanAttr={};oldAttr.tspan0Attr={}}if(oldAttr.tspanAttr.dy!==oldAttr.lineHeight){oldAttr.tspanAttr.dy=tspanAttr.dy=oldAttr.lineHeight;updateTspan=true}if(params[has]("x")&&oldAttr.tspanAttr.x!==params.x){oldAttr.tspan0Attr.x=oldAttr.tspanAttr.x=tspanAttr.x=a.x;updateTspan=true}if(textChanged){tspans=node.childNodes;for(i=0;i<l;i++){tspan=tspans[i*j];spanArr=createValidTextNode(texts[i],abbrArr);if(tspan){tspan.innerHTML=E;if(isIE){while(tspan.firstChild){tspan.removeChild(tspan.firstChild)}}if(updateTspan){$(tspan,i?tspanAttr:oldAttr.tspan0Attr)}}else{tspan=$(tSpanStr,i?oldAttr.tspanAttr:oldAttr.tspan0Attr);node.appendChild(tspan);if(!isIE&&direction===rtlStr){tempIESpan=$(tSpanStr,IESplTspanAttr);tempIESpan.appendChild(R._g.doc.createTextNode("i"));node.appendChild(tempIESpan)}}if(!texts[i]){tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");texts[i]=S}if(hasnbsp(texts[i])){texts[i]=spacify(texts[i]);tspan.style.whiteSpace=PRESERVESTRING}else if(tspan.style.whiteSpace===PRESERVESTRING){tspan.style.whiteSpace=BLANKSTRING}if(spanArr.length){for(var indx=0;indx<spanArr.length;indx++){tspan.appendChild(spanArr[indx])}}else{tspan.appendChild(R._g.doc.createTextNode(texts[i]))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}}else if(updateTspan){tspans=node.childNodes;ii=tspans.length;for(i=0;i<ii;i+=j){$(tspans[i],i?tspanAttr:oldAttr.tspan0Attr)}}ii=l*j;if(node.childNodes.length>ii){for(i=node.childNodes.length-1;i>=ii;i-=1){node.removeChild(node.childNodes[i])}}}else if(textChanged){if(hasnbsp(text)){text=spacify(text);node.style.whiteSpace=PRESERVESTRING}else if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanArr=createValidTextNode(text,abbrArr);if(tspanArr.length){for(var index=0;index<tspanArr.length;index++){node.appendChild(tspanArr[index])}}else{node.appendChild(R._g.doc.createTextNode(text))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}if(params[vAlignStr]){valign=vAlignMultiplier[a[vAlignStr]]||0;if(valign!==oldAttr.valign){oldAttr.valign=valign;updateAlignment=true}}if(updateAlignment){oldAttr.shift=oldAttr.baseLineDiff+oldAttr.lineCount*oldAttr.lineHeight*oldAttr.valign;updateNode=true}if((params.y||params.y===0)&&oldAttr.y!==params.y){oldAttr.y=a.y;updateNode=true}if(updateNode&&(oldAttr.y||oldAttr.y===0)&&(oldAttr.shift||oldAttr.shift===0)){$(node,{y:Math.round(oldAttr.y+oldAttr.shift)})}}},Element=function Element(node,svg,group){var o=this,parent=group||svg;parent.canvas&&parent.canvas.appendChild(node);o.node=o[0]=node;node.raphael=true;node.raphaelid=o.id=R._oid++;o.matrix=R.matrix();o.realPath=null;o.attrs=o.attrs||{};o.followers=o.followers||[];o.paper=svg;o.ca=o.customAttributes=o.customAttributes||new svg._CustomAttributes;o._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1};o.parent=parent;!parent.bottom&&(parent.bottom=o);o.prev=parent.top;parent.top&&(parent.top.next=o);parent.top=o;o.next=null},getTouchDistance=function getTouchDistance(touch1,touch2,isY){var select=isY?"pageY":"pageX";return Math.abs(touch2[select]-touch1[select])},storeHandlers=R.storeHandlers=function(elem,handler,fn){elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);elem._actualListners.push(handler);elem._derivedListeners.push(fn)},removeHandlers=function removeHandlers(elem,handler){var index=elem._actualListners.indexOf(handler),derivedHandler;if(index!==-1){derivedHandler=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}return derivedHandler},elproto=R.el;Element.prototype=elproto;elproto.constructor=Element;R._engine.getNode=function(el){var node=el.node||el[0].node;return node.titleNode||node};R._engine.getLastNode=function(el){var node=el.node||el[el.length-1].node;return node.titleNode||node};elproto.rotate=function(deg,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"rotate",deg,cx,cy);deg=Str(deg).split(separator);if(deg.length-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1);cx=bbox.x+bbox.width/2;cy=bbox.y+bbox.height/2}o.transform(o._.transform.concat([["r",deg,cx,cy]]));return o};elproto.scale=function(sx,sy,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"scale",sx,sy,cx,cy);sx=Str(sx).split(separator);if(sx.length-1){sy=toFloat(sx[1]);cx=toFloat(sx[2]);cy=toFloat(sx[3])}sx=toFloat(sx[0]);sy==null&&(sy=sx);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1)}cx=cx==null?bbox.x+bbox.width/2:cx;cy=cy==null?bbox.y+bbox.height/2:cy;o.transform(o._.transform.concat([["s",sx,sy,cx,cy]]));return o};elproto.translate=function(dx,dy){var o=this;if(o.removed){return o}updateFollowers(o,"translate",dx,dy);dx=Str(dx).split(separator);if(dx.length-1){dy=toFloat(dx[1])}dx=toFloat(dx[0])||0;dy=+dy||0;o.transform(o._.transform.concat([["t",dx,dy]]));return o};elproto.transform=function(tstr){var o=this,_=o._,sw;if(tstr==null){return _.transform}R._extractTransform(o,tstr);o.clip&&!_.clipispath&&$(o.clip,{transform:o.matrix.invert()});o.pattern&&updatePosition(o);o.node&&$(o.node,{transform:o.matrix});if(_.sx!==1||_.sy!==1){sw=o.attrs["stroke-width"];sw&&o.attr({"stroke-width":sw})}return o};elproto.hide=function(){var o=this;updateFollowers(o,"hide");!o.removed&&o.paper.safari(o.node.style.display=noneStr);return o};elproto.show=function(){var o=this;updateFollowers(o,"show");!o.removed&&o.paper.safari(o.node.style.display=E);return o};elproto.remove=function(){if(this.removed||!this.parent.canvas){return}var o=this,node=R._engine.getNode(o),paper=o.paper,defs=paper.defs,i;paper.__set__&&paper.__set__.exclude(o);eve.unbind("raphael.*.*."+o.id);if(o.gradient&&defs){updateGradientReference(o)}if(o["stroke-gradient"]&&defs){updateGradientReference(o,UNDEF,"stroke")}if(o.textPathDef&&defs){o.textPathDef.parentNode.removeChild(o.textPathDef);delete o.textPathDef}while(i=o.followers.pop()){i.el.remove()}while(i=o.bottom){i.remove()}if(o._drag){o.undrag()}if(o.events){while(i=o.events.pop()){i.unbind()}}o.parent.canvas.contains(node)&&o.parent.canvas.removeChild(node);o.removeData();delete paper._elementsById[o.id];R._tear(o,o.parent);for(i in o){o[i]=typeof o[i]===fnStr?R._removedFactory(i):null}o.removed=true};elproto._getBBox=function(){var fn,o=this,node=o.node,bbox={},a=o.attrs,align,hide,isText=o.type===textStr;if(isIE&&isText){fn=(0,_raphael.showRecursively)(o)}else{if(node.style.display===noneStr){o.show();hide=true}}try{bbox=node.getBBox();if(isText){if(bbox.x===undefined){bbox.isCalculated=true;align=a["text-anchor"];bbox.x=(a.x||0)-bbox.width*(align==="start"?0:align===middleStr?.5:1)}if(bbox.y===undefined){bbox.isCalculated=true;align=a[vAlignStr];bbox.y=(a.y||0)-bbox.height*(align===bottomStr?1:align===middleStr?.5:0)}}}catch(e){}finally{bbox=bbox||{}}isIE&&isText?fn&&fn():hide&&o.hide();return bbox};elproto.attr=function(name,value){if(this.removed){return this}var elem=this,attrs=this.attrs,key,finalParam={},i,ii,params,subkey,par,follower,invokedCa=elem._invokedCa||(elem._invokedCa={}),ca,caObj=this.ca;if(name==null){var res={};for(key in attrs){if(attrs[has](key)){res[key]=attrs[key]}}res.gradient&&res.fill===noneStr&&(res.fill=res.gradient)&&delete res.gradient;res.transform=this._.transform;res.visibility=this.node.style.display===noneStr?hiddenStr:visibleStr;return res}else{if(value==null){if(R.is(name,objectStr)){params=name}else if(R.is(name,typeStringSTR)){if(name===fillStr&&attrs.fill===noneStr&&attrs.gradient){return attrs.gradient}if(name===transformStr){return this._.transform}if(name===visibilityStr){return this.node.style.display===noneStr?hiddenStr:visibleStr}if(name in attrs){return attrs[name]}else if(R.is(caObj[name],fnStr)){return caObj[name].def}return R._availableAttrs[name]}}else{params={};params[name]=value}if(!R.stopPartialEventPropagation){for(key in params){eve("raphael.attr."+key+"."+this.id,this,params[key],key)}}for(key in params){ca=caObj[key];if(ca&&!invokedCa[key]&&R.is(ca,fnStr)){invokedCa[key]=true;par=ca.apply(this,[].concat(params[key]));invokedCa[key]=false;for(subkey in par){finalParam[subkey]=par[subkey]}attrs[key]=params[key]}else{finalParam[key]=params[key]}}setFillAndStroke(this,finalParam);for(i=0,ii=this.followers.length;i<ii;i++){follower=this.followers[i];follower.cb&&!follower.cb.call(follower.el,finalParam,this)||follower.el.attr(finalParam)}return this}};elproto.pinchstart=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];elem._blockDrag=true;e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}else{elem._blockDrag=false}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchstart",fn)};elproto.unpinchstart=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem.__blockDrag=false;elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchstart",derivedHandler)};elproto.pinchmove=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];e&&e.preventDefault();elem._pinchDragStarted=true;R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchmove",fn)};elproto.unpinchmove=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("touchmove",derivedHandler)};elproto.pinchend=function(handler,context){var elem=this,fn=function fn(e){if(elem._pinchDragStarted){elem._pinchDragStarted=false;handler.call(context||elem,e)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchend",fn)};elproto.unpinchend=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchend",derivedHandler)};elproto.pinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.pinchstart.call(this,pinchstarthandler);elproto.pinchin.call(this,pinchinhandler);elproto.pinchend.call(this,pinchendhandler)};elproto.unpinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.unpinchstart.call(this,pinchstarthandler);elproto.unpinchin.call(this,pinchinhandler);elproto.unpinchend.call(this,pinchendhandler)};elproto.fcwheel=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);handler.call(context||elem,dummyEve)};storeHandlers(elem,handler,fn);elem.node.addEventListener("wheel",fn)};elproto.fcunwheel=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("wheel",derivedHandler)};elproto.on=function(eventType,handler,context){if(!handler||!eventType){return}var elem=this,node,actualEventType,isSafe=eventType.match(/fc-/),fn=handler;if(this.removed){return this}elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);switch(eventType){case"fc-dragstart":elem.drag(null,handler);return elem;case"fc-dragmove":elem.drag(handler);return elem;case"fc-dragend":elem.drag(null,null,handler);return elem;case"fc-dbclick":elem.dbclick(handler,context);return elem;case"fc-pinchstart":elem.pinchstart(handler,context);return elem;case"fc-pinchmove":elem.pinchmove(handler,context);return elem;case"fc-pinchend":elem.pinchend(handler,context);return elem;case"fc-click":elem.fcclick(handler,context);return elem;case"fc-wheel":elem.fcwheel(handler,context);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){fn=function fn(e){if(!(supportsPointer&&supportsTouch&&!e.isPrimary)){lastHoveredInfo.elementInfo.push({el:context||elem,callback:handler});lastHoveredInfo.srcElement=e.srcElement||e.target}};eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg&&(eventType==="load"||eventType==="error")){node=this._.RefImg;fn=function fn(e){!elem.removed&&handler.call(elem,e)}}else{node=this.node}if(fn===handler){fn=function fn(e){!(supportsPointer&&supportsTouch&&!e.isPrimary)&&handler.call(context||elem,e)}}elem._actualListners.push(handler);elem._derivedListeners.push(fn);if(node.addEventListener){node.addEventListener(eventType,fn)}else{node["on"+eventType]=fn}return this};elproto.off=function(eventType,handler){var elem=this,fn=handler,actualEventType,index,isSafe=eventType.match(/fc-/),node;if(this.removed||!elem._actualListners||!eventType||!handler){return this}switch(eventType){case"fc-dragstart":elem.undragstart(handler);return elem;case"fc-dragmove":elem.undragmove(handler);return elem;case"fc-dragend":elem.undragend(handler);return elem;case"fc-dbclick":elem.undbclick(handler);return elem;case"fc-pinchstart":elem.unpinchstart(handler);return elem;case"fc-pinchmove":elem.unpinchmove(handler);return elem;case"fc-pinchend":elem.unpinchend(handler);return elem;case"fc-click":elem.fcunclick(handler);return elem;case"fc-wheel":elem.fcunwheel(handler);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));fn=handler;if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg){node=this._.RefImg}else{node=this.node}index=elem._actualListners.indexOf(fn);if(index!==-1){fn=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}if(node.removeEventListener){node.removeEventListener(eventType,fn)}else{node["on"+eventType]=null}return this};R._engine.path=function(svg,attrs,group){var el=$("path"),res=new Element(el,svg,group);res.type="path";attrs&&res.attr(attrs);return res};R._engine.group=function(svg,id,group,overrideId){var el=$("g"),res=new Element(el,svg,group);res.type="group";res.canvas=res.node;res.top=res.bottom=null;res._id=id||E;if(id){if(overrideId){el.setAttribute("class","raphael-group-"+id)}else{el.setAttribute("class","raphael-group-"+res.id+"-"+id)}}return res};R._engine.circle=function(svg,attrs,group){var el=$("circle"),res=new Element(el,svg,group);res.type="circle";attrs&&res.attr(attrs);return res};R._engine.rect=function(svg,attrs,group){var el=$("rect"),res=new Element(el,svg,group);res.type="rect";attrs.rx=attrs.ry=attrs.r;attrs&&res.attr(attrs);return res};R._engine.ellipse=function(svg,attrs,group){var el=$("ellipse"),res=new Element(el,svg,group);res.type="ellipse";attrs&&res.attr(attrs);return res};R._engine.image=function(svg,attrs,group){var el=$(imageStr),res=new Element(el,svg,group,true);res._.group=group||svg;res.type=imageStr;el.setAttribute("preserveAspectRatio",noneStr);attrs&&res.attr(attrs);return res};R._engine.text=function(svg,attrs,group,css){var el=$(textStr),res=new Element(el,svg,group);res.type=textStr;css&&res.css&&res.css(css,undefined,true);attrs&&res.attr(attrs);return res};R._engine.setSize=function(width,height){this.width=width||this.width;this.height=height||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);if(this._viewBox){this.setViewBox.apply(this,this._viewBox)}return this};R._engine.create=function(){var con=R._getContainer.apply(0,arguments),container=con&&con.container,x=con.x,y=con.y,width=con.width,height=con.height,paper;if(!container){throw new Error("SVG container not found.")}var cnvs=$("svg"),css="overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);"+"-webkit-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;"+"-ms-user-select:none;user-select:none;-o-user-select:none;cursor:default;"+"vertical-align:middle;",isFloating;if(supportsTouch){if(R.isIE10){css+="-ms-touch-action:pan-y;"}else{css+="touch-action:pan-y;"}}x=x||0;y=y||0;width=width||512;height=height||342;$(cnvs,{height:height,version:1.1,width:width,xmlns:svgNSStr});if(container===1){cnvs.style.cssText=css+"position:absolute;left:"+x+"px;top:"+y+pxStr;container=R._g.doc.body;container.appendChild(cnvs);isFloating=1}else{cnvs.style.cssText=css+"position:relative";if(container.firstChild){container.insertBefore(cnvs,container.firstChild)}else{container.appendChild(cnvs)}}paper=new R._Paper;paper.width=width;paper.height=height;paper.canvas=cnvs;paper.container=container;$(cnvs,{id:"raphael-paper-"+paper.id});paper.clear();paper._left=paper._top=0;isFloating&&(paper.renderfix=function(){});paper.renderfix();return paper};R._engine.setViewBox=function(x,y,w,h,fit){eve("raphael.setViewBox",this,this._viewBox,[x,y,w,h,fit]);var size=mmax(w/this.width,h/this.height),top=this.top,aspectRatio=fit?"meet":"xMinYMin",vb,sw;if(x==null){if(this._vbSize){size=1}delete this._vbSize;vb="0 0 "+this.width+S+this.height}else{this._vbSize=size;vb=x+S+y+S+w+S+h}$(this.canvas,{viewBox:vb,preserveAspectRatio:aspectRatio});if(size){while(top){sw="stroke-width"in top.attrs?top.attrs["stroke-width"]:1;top.attr({"stroke-width":sw});top._.dirty=1;top._.dirtyT=1;top=top.prev}}this._viewBox=[x,y,w,h,!!fit];return this};R.prototype.detachPaper=function(){if(this._detached!==false){this.container.removeChild(this.canvas);this._detached=true}};R.prototype.attachPaper=function(){if(this._detached){this.container.appendChild(this.canvas);this._detached=false}};R.prototype.renderfix=function(){var cnvs=this.canvas,s=cnvs.style,pos;try{pos=cnvs.getScreenCTM()||cnvs.createSVGMatrix()}catch(e){pos=cnvs.createSVGMatrix()}var left=-pos.e%1,top=-pos.f%1;if(left||top){if(left){this._left=(this._left+left)%1;s.left=this._left+pxStr}if(top){this._top=(this._top+top)%1;s.top=this._top+pxStr}}};R.prototype._desc=function(txt){var desc=this.desc;if(!desc){this.desc=desc=$("desc");this.canvas.appendChild(desc)}else{while(desc.firstChild){desc.removeChild(desc.firstChild)}}desc.appendChild(R._g.doc.createTextNode(R.is(txt,typeStringSTR)?txt:"Created with Red Raphaël "+R.version))};R.prototype.clear=function(){var c;eve("raphael.clear",this);while(c=this.bottom){c.remove()}c=this.canvas;while(c.firstChild){c.removeChild(c.firstChild)}this.bottom=this.top=null;c.appendChild(this.desc=$("desc"));c.appendChild(this.defs=$("defs"))};R.prototype.remove=function(){var i;eve("raphael.remove",this);while(i=this.bottom){i.remove()}this.defs&&this.defs.parentNode.removeChild(this.defs);this.desc&&this.desc.parentNode.removeChild(this.desc);this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(i in this){this[i]=typeof this[i]===fnStr?R._removedFactory(i):null}this.removed=true};R.prototype.setHTMLClassName=function(){}}}
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=_default;var _raphael=require("./raphael.lib");var _trustedPolicy=_interopRequireDefault(require("../../../../../../fc-features/src/utils/trusted-policy"));function _default(R){if(R.svg){var has="hasOwnProperty",tSpanStr="tspan",vAlignStr="vertical-align",lineHeightStr="line-height",fontSizeStr="font-size",imageStr="image",noneStr="none",notToTuneStr="_do-not-tune",textStr="text",textPathStr="textpath",rtlStr="rtl",hasSup=false,hasSub=false,arrayStr="array",middleStr="middle",bottomStr="bottom",topStr="top",pxStr="px",initialStr="initial",fnStr="function",brStr="<br>",hiddenStr="hidden",visibleStr="visible",objectStr="object",fillStr="fill",transformStr="transform",visibilityStr="visibility",IESplTspanAttr={visibility:hiddenStr,"font-size":"0px"},Str=String,VERTICAL="vertical",HORIZONTAL="horizontal",PRESERVESTRING="pre",BLANKSTRING="",toFloat=parseFloat,toInt=parseInt,vAlignMultiplier={top:0,bottom:-1,middle:-.5},win=R._g.win,navigator=win.navigator,isIE=false||!!document.documentMode,math=Math,UNDEF,mmax=math.max,abs=math.abs,pow=math.pow,sqrt=math.sqrt,xlinkRegx=/^xlink:/,separator=/[, ]+/,textBreakRegx=/\n|<br\s*?\/?>/i,ltgtbrRegex=/&lt|&gt|&quot|&#039|&#034|<br/i,nbspRegex=/&nbsp;|&#160;|&#xA0;/g,arrayShift=Array.prototype.shift,zeroStrokeFix=!!(/AppleWebKit/.test(navigator.userAgent)&&(!/Chrome/.test(navigator.userAgent)||navigator.appVersion.match(/Chrome\/(\d+)\./)[1]<29)),eve=R.eve,E="",S=" ",xlink="http://www.w3.org/1999/xlink",svgNSStr="http://www.w3.org/2000/svg",isIpad=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),typeStringSTR="string",markers={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},shapeRenderingAttrs={speed:"optimizeSpeed",crisp:"crispEdges",precision:"geometricPrecision"},nav=navigator.userAgent.toLowerCase(),isIE9=function(){var verIE=nav.indexOf("msie")!=-1?parseInt(nav.split("msie")[1]):false;if(verIE&&verIE===9){return true}else{return false}}(),supportsPointer=R.supportsPointer,supportsTouch=R.supportsTouch,markerCounter={},preLoad=function preLoad(elem,ig,isURL,paper){R._preload(isURL[1],(function(){var w=this.offsetWidth,h=this.offsetHeight;$(elem,{width:w,height:h});$(ig,{width:w,height:h});paper.safari()}))},quickExtend=function quickExtend(obj1,obj2){if(obj2){for(var key in obj2){obj1[key]=obj2[key]}}},lastHoveredInfo={elementInfo:[]},doc=R._g.doc,win=R._g.win,safeMouseEventMapping={mouseover:"touchstart",mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove",mouseout:"touchend"},createValidTextNode=function createValidTextNode(text,abbrArr){var underlineRegex=/<under>/g,underlineEndRegex=/<\/under>/g,boldRegex=/<bold>/g,boldEndRegex=/<\/bold>/g,emphasisRegex=/<em>/g,emphasisEndRegex=/<\/em>/g,strikeRegex=/<strike>/g,strikeEndRegex=/<\/strike>/g,subscriptRegex=/<sub[\s]+([^>]+)>|<sub>/g,subscriptEndRegex=/<\/sub>/g,superscriptRegex=/<sup[\s]+([^>]+)>|<sup>/g,superscriptEndRegex=/<\/sup>/g,abbrRegex=/<abbr[\s]+([^>]+)>/g,abbrEndRegex=/<\/abbr>/g,spanRegex=/<span[\s]+([^>]+)>|<span>/g,spanEndRegex=/<\/span>/g,anchorRegex=/<a[\s]+([^>]+)>/g,anchorEndRegex=/<\/a>/g,lastAttrList=[],index,subtext,tspanArray=[],startIndex=0,sortedIndices,underlinetagIndices=getTagIndices(underlineRegex,underlineEndRegex,text,"<under>","</under>"),boldtagIndices=getTagIndices(boldRegex,boldEndRegex,text,"<bold>","</bold>"),emtagIndices=getTagIndices(emphasisRegex,emphasisEndRegex,text,"<em>","</em>"),strikeTagIndices=getTagIndices(strikeRegex,strikeEndRegex,text,"<strike>","</strike>"),subscriptTagIndices=getSubSupTagIndices(subscriptRegex,subscriptEndRegex,text,"<sub>","</sub>"),superscriptTagIndices=getSubSupTagIndices(superscriptRegex,superscriptEndRegex,text,"<sup>","</sup>"),abbrTagIndices=getAbbrTagIndices(abbrRegex,abbrEndRegex,text,"<abbr>","</abbr>"),anchorTagIndices=getAnchorTagIndices(anchorRegex,anchorEndRegex,text,"<a>","</a>"),spanTagIndices=getSpanTagIndices(spanRegex,spanEndRegex,text,"<span>","</span>"),sortedIndices=sortTags(underlinetagIndices,boldtagIndices,emtagIndices,strikeTagIndices,subscriptTagIndices,superscriptTagIndices,abbrTagIndices,anchorTagIndices,spanTagIndices);if(sortedIndices.length){if(sortedIndices[0].index>startIndex){subtext=text.substring(startIndex,sortedIndices[0].index);tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,abbrArr,sortedIndices);startIndex=sortedIndices[0].index+sortedIndices[0].tagName.length}for(index=0;index<sortedIndices.length;index++){if(sortedIndices[index+1]!==UNDEF){lastAttrList=createAttrList(lastAttrList,sortedIndices[index]);if(startIndex===0&&sortedIndices[index].index===0){subtext=text.substring(startIndex+sortedIndices[index].tagName.length,sortedIndices[index+1].index)}else{subtext=text.substring(startIndex,sortedIndices[index+1].index)}tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,sortedIndices[index],abbrArr,sortedIndices);startIndex=sortedIndices[index+1].index+sortedIndices[index+1].tagName.length}}if(startIndex<text.length){subtext=text.substring(startIndex,text.length);tspanArray=createtspanArray(tspanArray,subtext,[],abbrArr,sortedIndices)}}return tspanArray},tagHash={"<bold>":{action:"add",tagAttr:"font-weight",tagAttrVal:"bold"},"</bold>":{action:"remove",actionTag:"<bold>"},"<under>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</under>":{action:"remove",actionTag:"<under>"},"<em>":{action:"add",tagAttr:"font-style",tagAttrVal:"italic"},"</em>":{action:"remove",actionTag:"<em>"},"<strike>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"line-through"},"</strike>":{action:"remove",actionTag:"<strike>"},"<sub>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"sub"},"</sub>":{action:"remove",actionTag:"<sub>"},"<sup>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"super"},"</sup>":{action:"remove",actionTag:"<sup>"},"<abbr>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</abbr>":{action:"remove",actionTag:"<abbr>"},"<a>":{action:"add"},"</a>":{action:"remove",actionTag:"<a>"},"<span>":{action:"add"},"</span>":{action:"remove",actionTag:"<span>"}},createAttrList=function createAttrList(attrArr,sortedIndex){var i,abbrReg=/<abbr[\s]+([^>]+)>/g,anchorReg=/<a[\s]+([^>]+)>/g,spanReg=/<span[\s]+([^>]+)>/g,subReg=/<sub[\s]+([^>]+)>/g,supReg=/<sup[\s]+([^>]+)>/g,obj;if(sortedIndex.tagName.match(abbrReg)){obj=MergeRecursive({tag:"<abbr>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(anchorReg)){obj=MergeRecursive({tag:"<a>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(spanReg)){obj=MergeRecursive({tag:"<span>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(subReg)){obj=MergeRecursive({tag:"<sub>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(supReg)){obj=MergeRecursive({tag:"<sup>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="add"){obj=MergeRecursive({tag:sortedIndex.tagName,sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="remove"){for(i=attrArr.length-1;i>=0;i--){if(attrArr[i].tag===tagHash[sortedIndex.tagName].actionTag){attrArr.splice(i,1);break}}}return attrArr},createtspanArray=function createtspanArray(tspanArray,str,lastAttr,indicesObj,abbrArr,sortedIndices){var textNode=R._g.doc.createTextNode(str),obj={},hasAnchor=false,hasAbbr=false,hasSpan=false,title="",style,anchor,tspan,i,j;if(isIE||_raphael.isFirefox){if(hasSub){obj["dy"]=-6;hasSub=false}if(hasSup){obj["dy"]=6;hasSup=false}}if(!lastAttr.length){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}else{for(i=0;i<lastAttr.length;i++){if(lastAttr[i].tag==="<abbr>"){hasAbbr=true;title=lastAttr[i].sortedIndex.title}else if(lastAttr[i].tag==="<a>"){hasAnchor=true;if(lastAttr[i].href!==""){obj["href"]=lastAttr[i].sortedIndex.href}if(indicesObj.target!==""){obj["target"]=lastAttr[i].sortedIndex.target}if(indicesObj.hreflang!==""){obj["hreflang"]=lastAttr[i].sortedIndex.hreflang}if(indicesObj.referrerpolicy!==""){obj["referrerpolicy"]=lastAttr[i].sortedIndex.referrerpolicy}if(indicesObj.rel!==""){obj["rel"]=lastAttr[i].sortedIndex.rel}anchor=$("a",obj)}else if(lastAttr[i].tag==="<span>"){hasSpan=true;style=lastAttr[i].sortedIndex.style}else if(lastAttr[i].tag==="<sub>"){hasSub=true;style=lastAttr[i].sortedIndex.style}else if(lastAttr[i].tag==="<sup>"){hasSup=true;style=lastAttr[i].sortedIndex.style}if(tagHash[lastAttr[i].tag].tagAttr&&tagHash[lastAttr[i].tag].tagAttrVal){if(isIE||_raphael.isFirefox){if(lastAttr[i].tag==="<sup>"){obj["dy"]=-6;hasSup=true}else if(lastAttr[i].tag==="<sub>"){obj["dy"]=6;hasSub=true}}obj[tagHash[lastAttr[i].tag].tagAttr]=tagHash[lastAttr[i].tag].tagAttrVal}}if(hasAnchor){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);anchor.appendChild(tspan);tspanArray.push(anchor);hasAnchor=false}}else if(hasAbbr){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);abbrArr.push({tspan:tspan,title:title});tspanArray.push(tspan)}}else if(hasSpan){if(str!==""){obj=MergeRecursive(obj,style);tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}else if(hasSub||hasSup){if(str!==""){obj=MergeRecursive(obj,style);tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}else{if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}}return tspanArray},MergeRecursive=function MergeRecursive(obj1,obj2){for(var p in obj2){try{if(obj2[p].constructor==Object){obj1[p]=MergeRecursive(obj1[p],obj2[p])}else{obj1[p]=obj2[p]}}catch(e){obj1[p]=obj2[p]}}return obj1},sortTags=function sortTags(u,b,em,strike,sub,sup,abbr,a,sp){var i,j,tagArr=[u,b,em,strike,sub,sup,abbr,a,sp],res=[];for(j=0;j<tagArr.length;j++){for(var key in tagArr[j]){if(tagArr[j][key].length){for(i=0;i<tagArr[j][key].length;i++){res.push(tagArr[j][key][i])}}}}res=res.sort((function(a,b){return a.index-b.index}));return res},getAbbrTagIndices=function getAbbrTagIndices(abbrRegex,abbrEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,title,endtagindices=[];while(result=abbrRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</abbr>";dummyNode.innerHTML=_trustedPolicy.default.createHTML(testAbbr);title=dummyNode.childNodes[0]?dummyNode.childNodes[0].title:"";tagindices.push({tagName:result[0],index:result.index,title:title?title:""})}while(result=abbrEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getStyles=function getStyles(el){var output={};if(!el||!el.style||!el.style.cssText){return output}var camelize=function camelize(str){return str.replace(/(?:^|[-])(\w)/g,(function(a,c){c=a.substr(0,1)==="-"?c.toUpperCase():c;return c?c:""}))};var style=el.style.cssText.split(";");for(var i=0;i<style.length;++i){var rule=style[i].trim();if(rule){var ruleParts=rule.split(":");var key=ruleParts[0].trim();output[key]=ruleParts[1].trim()}}return output},getSpanTagIndices=function getSpanTagIndices(spanRegex,spanEndRegex,text,tagText,endtagText){var tagindices=[],result,dummySpan,testSpan,styleObj,endtagindices=[];while(result=spanRegex.exec(text)){dummySpan=document.createElement("p");testSpan=result[0]+"Dummy</span>";dummySpan.innerHTML=_trustedPolicy.default.createHTML(testSpan);styleObj=getStyles(dummySpan.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:""})}while(result=spanEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getSubSupTagIndices=function getSubSupTagIndices(subSupRegex,subSupEndRegex,text,tagText,endtagText){var tagindices=[],result,dummySpan,testSpan,styleObj,endtagindices=[];while(result=subSupRegex.exec(text)){dummySpan=document.createElement("p");testSpan=result[0]+"Dummy"+endtagText;dummySpan.innerHTML=_trustedPolicy.default.createHTML(testSpan);styleObj=getStyles(dummySpan.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:""})}while(result=subSupEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},isUrlValid=function isUrlValid(userInput){var res=userInput.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&=]*)/g);if(!res)return false;else return true},getAnchorTagIndices=function getAnchorTagIndices(anchorRegex,anchorEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyAnchor,testAnchor,isValidHref,endtagindices=[];while(result=anchorRegex.exec(text)){dummyAnchor=document.createElement("p");testAnchor=result[0]+"</a>";dummyAnchor.innerHTML=_trustedPolicy.default.createHTML(testAnchor);isValidHref=isUrlValid(encodeURIComponent(dummyAnchor.childNodes[0].href));tagindices.push({tagName:result[0],index:result.index,href:isValidHref?dummyAnchor.childNodes[0].href:"",target:dummyAnchor.childNodes[0].target?dummyAnchor.childNodes[0].target:"",hreflang:dummyAnchor.childNodes[0].hreflang?dummyAnchor.childNodes[0].hreflang:"",referrerpolicy:dummyAnchor.childNodes[0].referrerpolicy?dummyAnchor.childNodes[0].referrerpolicy:"",rel:dummyAnchor.childNodes[0].rel?dummyAnchor.childNodes[0].rel:""})}while(result=anchorEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getTagIndices=function getTagIndices(tagRegex,endTagRegex,text,tagText,endtagText){var tagindices=[],result,endtagindices=[];while(result=tagRegex.exec(text)){tagindices.push({tagName:tagText,index:result.index})}while(result=endTagRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},allPossibleAttrs={"accent-height":true,accumulate:true,additive:true,"alignment-baseline":true,alphabetic:true,amplitude:true,"arabic-form":true,ascent:true,azimuth:true,"baseline-shift":true,bbox:true,begin:true,bias:true,by:true,"cap-height":true,class:true,clip:true,"clip-path":true,"clip-rule":true,color:true,"color-interpolation":true,"color-interpolation-filters":true,"color-profile":true,"color-rendering":true,cursor:true,cx:true,cy:true,d:true,decelerate:true,descent:true,direction:true,display:true,divisor:true,"dominant-baseline":true,dur:true,dx:true,dy:true,elevation:true,"enable-background":true,end:true,exponent:true,fill:true,"fill-opacity":true,"fill-rule":true,filter:true,"flood-color":true,"flood-opacity":true,"font-family":true,"font-size":true,"font-size-adjust":true,"font-stretch":true,"font-style":true,"font-variant":true,"font-weight":true,format:true,fr:true,from:true,fx:true,fy:true,g1:true,g2:true,"glyph-name":true,"glyph-orientation-horizontal":true,"glyph-orientation-vertical":true,hanging:true,height:true,"horiz-adv-x":true,"horiz-origin-x":true,href:true,hreflang:true,id:true,ideographic:true,"image-rendering":true,in2:true,in:true,intercept:true,k1:true,k2:true,k3:true,k4:true,k:true,kerning:true,lang:true,"letter-spacing":true,"lighting-color":true,local:true,"marker-end":true,"marker-mid":true,"marker-start":true,mask:true,mathematical:true,max:true,media:true,method:true,min:true,mode:true,name:true,offset:true,opacity:true,operator:true,order:true,orient:true,orientation:true,origin:true,overflow:true,"overline-position":true,"overline-thickness":true,"paint-order":true,"panose-1":true,path:true,ping:true,"pointer-events":true,points:true,r:true,radius:true,rel:true,"rendering-intent":true,restart:true,result:true,rotate:true,rx:true,ry:true,scale:true,seed:true,"shape-rendering":true,slope:true,spacing:true,speed:true,stemh:true,stemv:true,"stop-color":true,"stop-opacity":true,"strikethrough-position":true,"strikethrough-thickness":true,string:true,stroke:true,"stroke-dasharray":true,"stroke-dashoffset":true,"stroke-linecap":true,"stroke-linejoin":true,"stroke-miterlimit":true,"stroke-opacity":true,"stroke-width":true,style:true,tabindex:true,target:true,"text-anchor":true,"text-decoration":true,"text-rendering":true,to:true,transform:true,type:true,u1:true,u2:true,"underline-position":true,"underline-thickness":true,unicode:true,"unicode-bidi":true,"unicode-range":true,"units-per-em":true,"v-alphabetic":true,"v-hanging":true,"v-ideographic":true,"v-mathematical":true,values:true,"vector-effect":true,version:true,"vert-adv-y":true,"vert-origin-x":true,"vert-origin-y":true,visibility:true,width:true,widths:true,"word-spacing":true,"writing-mode":true,x1:true,x2:true,x:true,"x-height":true,"xlink:actuate":true,"xlink:arcrole":true,"xlink:href":true,"xlink:role":true,"xlink:show":true,"xlink:title":true,"xlink:type":true,"xml:base":true,"xml:lang":true,"xml:space":true,y1:true,y2:true,y:true,z:true};if(supportsTouch){doc.addEventListener(supportsPointer?"pointerover":"touchstart",(function(e){if(lastHoveredInfo.srcElement&&lastHoveredInfo.srcElement!==(e.srcElement||e.target)){var elementInfo=lastHoveredInfo.elementInfo,ii=elementInfo.length,elementInfo,elems,i;for(i=0;i<ii;i++){elems=elementInfo[i];elems.callback.call(elems.el,e)}}lastHoveredInfo={elementInfo:[]}}),true)}R.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};R._url=E;var updateGradientReference=function updateGradientReference(element,newGradient,attr){if(attr===void 0){attr="fill"}var gradient=attr==="fill"?element.gradient:element["stroke-gradient"];if(gradient){if(gradient===newGradient){return}gradient.refCount--;if(!gradient.refCount){gradient.parentNode.removeChild(gradient)}attr==="fill"?delete element.gradient:delete element["stroke-gradient"]}if(newGradient){attr==="fill"?element.gradient=newGradient:element["stroke-gradient"]=newGradient;newGradient.refCount++}};var $=R._createNode=function(el,attr){if(typeof el===typeStringSTR){el=R._g.doc.createElementNS(svgNSStr,el)}if(attr){var key,value;for(key in attr){value=isIE9?Str(attr[key]):attr[key];if(xlinkRegx.test(key)){el.setAttributeNS(xlink,key.replace(xlinkRegx,E),value)}else{el.setAttribute(key,value)}}}return el},gradientUnitNames={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},gradientSpreadNames={pad:"pad",redlect:"reflect",repeat:"repeat"},addGradient=function addGradient(element,gradient,attr){var _$;if(attr===void 0){attr="fill"}if(!element.paper||!element.paper.defs){return 0}var type="linear",SVG=element.paper,id=R.getElementID((SVG.id+"-"+gradient).replace(/[()\s%:,\xb0#]/g,"_")),fx=.5,fy=.5,r,cx,cy,units,spread,o=element.node,s=o.style,el=R._g.doc.getElementById(id),vector;if(!el){gradient=Str(gradient).replace(R._radial_gradient,(function(all,opts){type="radial";opts=opts?opts.split(","):[];units=opts[5];spread=opts[6];var _fx=opts[0],_fy=opts[1],_r=opts[2],_cx=opts[3],_cy=opts[4],shifted=_fx&&_fy,dir,sqx;if(_r){r=/%/.test(_r)?_r:toFloat(_r)}if(units===gradientUnitNames.userSpaceOnUse){if(shifted){fx=_fx;fy=_fy}if(_cx&&_cy){cx=_cx;cy=_cy;if(!shifted){fx=cx;fy=cy}}return E}if(shifted){fx=toFloat(_fx);fy=toFloat(_fy);dir=(fy>.5)*2-1;(sqx=pow(fx-.5,2))+pow(fy-.5,2)>.25&&sqx<.25&&(fy=sqrt(.25-sqx)*dir+.5)&&fy!==.5&&(fy=fy.toFixed(5)-1e-5*dir)}if(_cx&&_cy){cx=toFloat(_cx);cy=toFloat(_cy);dir=(cy>.5)*2-1;(sqx=pow(cx-.5,2))+pow(cy-.5,2)>.25&&sqx<.25&&(cy=sqrt(.25-sqx)*dir+.5)&&cy!==.5&&(cy=cy.toFixed(5)-1e-5*dir);if(!shifted){fx=cx;fy=cy}}return E}));gradient=gradient.split(/\s*-\s*/);if(type==="linear"){var angle=gradient.shift(),specs=angle.match(/\((.*)\)/),max;specs=specs&&specs[1]&&specs[1].split(/\s*,\s*/);angle=-toFloat(angle);if(isNaN(angle)){return null}if(specs&&specs.length){if(specs[0]in gradientUnitNames){units=specs.shift();specs[0]in gradientSpreadNames&&(spread=specs.shift())}else{specs[4]&&(units=specs[4]);specs[5]&&(spread=specs[5])}vector=[specs[0]||"0%",specs[1]||"0%",specs[2]||"100%",specs[3]||"0%"]}else{vector=[0,0,math.cos(R.rad(angle)),math.sin(R.rad(angle))];max=1/(mmax(abs(vector[2]),abs(vector[3]))||1);vector[2]*=max;vector[3]*=max;if(vector[2]<0){vector[0]=-vector[2];vector[2]=0}if(vector[3]<0){vector[1]=-vector[3];vector[3]=0}}}var dots=R._parseDots(gradient);if(!dots){return null}el=$(type+"Gradient",{id:id});el.refCount=0;units in gradientUnitNames&&el.setAttribute("gradientUnits",Str(units));spread in gradientSpreadNames&&el.setAttribute("spreadMethod",Str(spread));if(type==="radial"){r!==undefined&&el.setAttribute("r",Str(r));if(cx!==undefined&&cy!==undefined){el.setAttribute("cx",Str(cx));el.setAttribute("cy",Str(cy))}el.setAttribute("fx",Str(fx));el.setAttribute("fy",Str(fy))}else{$(el,{x1:vector[0],y1:vector[1],x2:vector[2],y2:vector[3]})}for(var i=0,ii=dots.length;i<ii;i++){el.appendChild($("stop",{offset:dots[i].offset?dots[i].offset:i?"100%":"0%","stop-color":dots[i].color||"#fff","stop-opacity":dots[i].opacity===undefined?1:dots[i].opacity}))}SVG.defs.appendChild(el)}updateGradientReference(element,el,attr);$(o,(_$={},_$[attr]="url('"+R._url+"#"+id+"')",_$[attr+"-opacity"]=1,_$));s.fill=E;return 1},updatePosition=function updatePosition(o){var bbox=o.getBBox(1);$(o.pattern,{patternTransform:o.matrix.invert()+" translate("+bbox.x+","+bbox.y+")"})},addArrow=function addArrow(o,value,isEnd){if(o.type=="path"){var values=Str(value).toLowerCase().split("-"),p=o.paper,se=isEnd?"end":"start",node=o.node,attrs=o.attrs,stroke=attrs["stroke-width"],i=values.length,type="classic",from,to,dx,refX,attr,w=3,h=3,t=5;while(i--){switch(values[i]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":type=values[i];break;case"wide":h=5;break;case"narrow":h=2;break;case"long":w=5;break;case"short":w=2;break}}if(type=="open"){w+=2;h+=2;t+=2;dx=1;refX=isEnd?4:1;attr={fill:"none",stroke:attrs.stroke}}else{refX=dx=w/2;attr={fill:attrs.stroke,stroke:"none"}}if(o._.arrows){if(isEnd){o._.arrows.endPath&&markerCounter[o._.arrows.endPath]--;o._.arrows.endMarker&&markerCounter[o._.arrows.endMarker]--}else{o._.arrows.startPath&&markerCounter[o._.arrows.startPath]--;o._.arrows.startMarker&&markerCounter[o._.arrows.startMarker]--}}else{o._.arrows={}}if(type!="none"){var pathId="raphael-marker-"+type,markerId="raphael-marker-"+se+type+w+h+"-obj"+o.id;if(!R._g.doc.getElementById(pathId)){p.defs.appendChild($($("path"),{"stroke-linecap":"round",d:markers[type],id:pathId}));markerCounter[pathId]=1}else{markerCounter[pathId]++}var marker=R._g.doc.getElementById(markerId),use;if(!marker){marker=$($("marker"),{id:markerId,markerHeight:h,markerWidth:w,orient:"auto",refX:refX,refY:h/2});use=$($("use"),{"xlink:href":"#"+pathId,transform:(isEnd?"rotate(180 "+w/2+" "+h/2+") ":E)+"scale("+w/t+","+h/t+")","stroke-width":(1/((w/t+h/t)/2)).toFixed(4)});marker.appendChild(use);p.defs.appendChild(marker);markerCounter[markerId]=1}else{markerCounter[markerId]++;use=marker.getElementsByTagName("use")[0]}$(use,attr);var delta=dx*(type!="diamond"&&type!="oval");if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-delta*stroke}else{from=delta*stroke;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}attr={};attr["marker-"+se]="url('"+R._url+"#"+markerId+"')";if(to||from){attr.d=R.getSubpath(attrs.path,from,to)}$(node,attr);o._.arrows[se+"Path"]=pathId;o._.arrows[se+"Marker"]=markerId;o._.arrows[se+"dx"]=delta;o._.arrows[se+"Type"]=type;o._.arrows[se+"String"]=value}else{if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-from}else{from=0;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}o._.arrows[se+"Path"]&&$(node,{d:R.getSubpath(attrs.path,from,to)});delete o._.arrows[se+"Path"];delete o._.arrows[se+"Marker"];delete o._.arrows[se+"dx"];delete o._.arrows[se+"Type"];delete o._.arrows[se+"String"]}for(attr in markerCounter){if(markerCounter[has](attr)&&!markerCounter[attr]){var item=R._g.doc.getElementById(attr);item&&item.parentNode.removeChild(item)}}}},dasharray={"":[noneStr],none:[noneStr],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},addDashes=function addDashes(o,value,params){if(value!==undefined){var predefValue=dasharray[value.toLowerCase&&value.toLowerCase()],calculatedValues,width,butt,i,widthFactor;value=predefValue||[].concat(value);if(R.is(value,arrayStr)){width=params["stroke-width"]||o.attrs["stroke-width"]||1;butt={round:width,square:width,butt:0}[params["stroke-linecap"]||o.attrs["stroke-linecap"]]||0;i=value.length;widthFactor=predefValue?width:1;if(value[0]===noneStr){calculatedValues=value}else{calculatedValues=[];while(i--){calculatedValues[i]=value[i]*widthFactor+(i%2?1:-1)*butt;calculatedValues[i]<=0&&(calculatedValues[i]=.01+(width<=1?butt:0));if(isNaN(calculatedValues[i])){calculatedValues[i]=0}}}return{"stroke-dasharray":calculatedValues.join(",")}}}},setFillAndStroke=R._setFillAndStroke=function(o,params){if(!o.paper.canvas){return}var node=o.node,attrs=o.attrs,paper=o.paper,el,att,finalAttr={},finalS={},ignoreAttrs={"clip-rect":true},value,pathClip,urlArr,rect;if(o.type===imageStr){(0,_raphael.loadRefImage)(o,params)}for(att in params){if(att in R._availableAttrs){value=params[att];if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}else if(value===null&&!ignoreAttrs[att]){if(att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}}else{attrs[att]=value;switch(att){case"blur":o.blur(value);break;case"href":case"title":case"target":var pn=node.parentNode;if(pn.tagName.toLowerCase()!=="a"){if(value===E){break}var hl=$("a");hl.raphael=true;hl.raphaelid=node.raphaelid;pn.insertBefore(hl,node);hl.appendChild(node);pn=hl}if(att==="target"){pn.setAttributeNS(xlink,"show",value==="blank"?"new":value)}else{pn.setAttributeNS(xlink,att,value)}node.titleNode=pn;break;case"cursor":finalS.cursor=value;break;case"transform":o.transform(value);break;case"rotation":if(R.is(value,arrayStr)){o.rotate.apply(o,value)}else{o.rotate(value)}break;case"arrow-start":addArrow(o,value);break;case"arrow-end":addArrow(o,value,1);break;case"clip-path":pathClip=true;case"clip-rect":rect=!pathClip&&Str(value).split(separator);o._.clipispath=!!pathClip;if(pathClip||rect.length===4){o.clip&&o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);var rc=$(pathClip?"path":"rect");el=$("clipPath");el.id=R.getElementID(R.createUUID());$(rc,pathClip?{d:value?attrs["clip-path"]=R._pathToAbsolute(value):R._availableAttrs.path,fill:noneStr}:{x:rect[0],y:rect[1],width:rect[2],height:rect[3],transform:o.matrix.invert()});el.appendChild(rc);paper.defs.appendChild(el);finalAttr["clip-path"]="url('"+R._url+"#"+el.id+"')";o.clip=rc}if(!value){var path=node.getAttribute("clip-path");if(path){var clip=R._g.doc.getElementById(path.replace(/(^url\(#|\)$)/g,E));clip&&clip.parentNode.removeChild(clip);finalAttr["clip-path"]=E;document.documentMode===11&&node.removeAttribute("clip-path");delete o.clip}}break;case"path":if(o.type==="path"){finalAttr.d=value?attrs.path=R._stopabsolutePath?R.sanitizePath(value):R._pathToAbsolute(value):R._availableAttrs.path;o._.dirty=1;if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"width":finalAttr[att]=value;o._.dirty=1;if(attrs.fx){att="x";value=attrs.x}else{break}case"x":if(attrs.fx){value=-attrs.x-(attrs.width||0)}case"rx":if(att==="rx"&&o.type==="rect"){break}case"cx":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"height":finalAttr[att]=value;o._.dirty=1;if(attrs.fy){att="y";value=attrs.y}else{break}case"y":if(o.type===textStr&&!o.attrs["text-bound"]){break}if(attrs.fy){value=-attrs.y-(attrs.height||0)}case"ry":if(att==="ry"&&o.type==="rect"){break}case"cy":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"r":if(o.type==="rect"){finalAttr.rx=finalAttr.ry=value}else{finalAttr[att]=value}o._.dirty=1;break;case"src":if(o.type===imageStr){node.setAttributeNS(xlink,"href",value)}break;case"stroke-width":if(o._.sx!==1||o._.sy!==1){value/=mmax(abs(o._.sx),abs(o._.sy))||1}if(paper._vbSize){value*=paper._vbSize}if(zeroStrokeFix&&value===0){value=1e-6}finalAttr[att]=value;if(!params["stroke-dasharray"]&&attrs["stroke-dasharray"]&&params["stroke-dasharray"]!==""){quickExtend(finalAttr,addDashes(o,attrs["stroke-dasharray"],params))}if(o._.arrows){"startString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.endString,1)}break;case"stroke-dasharray":quickExtend(finalAttr,addDashes(o,value,params));break;case"fill":var isURL=R._ISURL.test(value);if(isURL){urlArr=value.split(R._ISURL);el=$("pattern");var ig=$(imageStr);el.id=R.getElementID(R.createUUID());$(el,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});$(ig,{x:0,y:0,"xlink:href":urlArr[1]});el.appendChild(ig);preLoad(el,ig,urlArr,paper);paper.defs.appendChild(el);finalAttr.fill="url('"+R._url+urlArr[1]+"')";o.pattern=el;o.pattern&&updatePosition(o);break}var clr=R.getRGB(value);if(!clr.error){delete params.gradient;delete attrs.gradient;!R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")&&(finalAttr["fill-opacity"]=attrs["fill-opacity"]);o.gradient&&updateGradientReference(o)}else if((o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value)){attrs.gradient=value;break}if(clr[has]("opacity")){finalAttr["fill-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.fillOpacityDirty=true}else if(o._.fillOpacityDirty&&R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")){node.removeAttribute("fill-opacity");delete o._.fillOpacityDirty}case"stroke":clr=R.getRGB(value);if(clr.error){if(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r"){addGradient(o,value,"stroke")}}else{finalAttr[att]=clr.hex;updateGradientReference(o,UNDEF,att)}if(att==="stroke"){if(clr[has]("opacity")){finalAttr["stroke-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.strokeOpacityDirty=true}else if(o._.strokeOpacityDirty&&R.is(attrs["stroke-opacity"],"undefined")&&R.is(params["stroke-opacity"],"undefined")){node.removeAttribute("stroke-opacity");delete o._.strokeOpacityDirty}if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"gradient":(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value);break;case"visibility":value===hiddenStr?o.hide():o.show();break;case"opacity":value=value>1?value/100:value;finalAttr.opacity=value;break;case"fill-opacity":value=value>1?value/100:value;finalAttr["fill-opacity"]=value;break;case"shape-rendering":o.attrs[att]=value=shapeRenderingAttrs[value]||value||"auto";finalAttr[att]=value;node.style.shapeRendering=value;break;case"line-height":case"vertical-align":break;default:att===fontSizeStr&&(value=toInt(value,10)+"px");o._.dirty=1;finalAttr[att]=value;if(_raphael.dashedAttr2CSSMap[att]){finalS[_raphael.dashedAttr2CSSMap[att]]=value}break}}}else if(att in allPossibleAttrs){if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att)}else{attrs[att]=value;finalS[att]=value}}}for(att in finalS){node.style[att]=finalS[att]}for(att in finalAttr){node.setAttribute(att,finalAttr[att])}o.type===textStr&&!params[notToTuneStr]&&tuneText(o,params)},updateFollowers=R._updateFollowers=function(){var i,ii,followerElem,args=(0,_raphael.getArrayCopy)(arguments),o=arrayShift.call(args),fnName=arrayShift.call(args);for(i=0,ii=o.followers.length;i<ii;i++){followerElem=o.followers[i].el;followerElem[fnName].apply(followerElem,args)}},leading=1.2,tuneText=function tuneText(el,params){if(el.type!==textStr||!(params[has](textStr)||params[has]("font")||params[has](fontSizeStr)||params[has]("x")||params[has]("y")||params[has](lineHeightStr)||params[has](vAlignStr)||params[has](textPathStr))){return}var a=el.attrs,defs=el.paper.defs,group=el.parent,node=el.node,fontSize,oldAttr=el._oldAttr=el._oldAttr||{baseLineDiff:8,valign:-.5},lineHeight=toFloat(params[lineHeightStr]||a[lineHeightStr]),direction=params.direction||a.direction||group&&group.attrs&&group.attrs.direction||oldAttr.direction||initialStr,valign,updateNode=false,tspanAttr,updateTspan=false,i,spanArr=[],abbrindx,dummyEl,tspanArr=[],abbrArr=[],hasTags=false,l,ii,j=!isIE&&direction===rtlStr?2:1,texts,tempIESpan,tspan,updateAlignment=false,tspans,text,textChanged=false,removeAllChild,hasnbsp=function hasnbsp(text){return text&&nbspRegex.test(text)},spacify=function spacify(text){return text.replace(/\s+/g," ").trim().replace(nbspRegex," ")};if(params[has](textPathStr)){var rUUID=R.getElementID(R.createUUID()),textPathParams=params[textPathStr];var textPath,tSpan,txtNode,dy=0,textPathProps={};for(var key in textPathParams){if(textPathParams.hasOwnProperty(key)){if(key==="path"&&!("href"in textPathParams)){if(oldAttr.textPathStr!==textPathParams[key]){if(el.textPathDef){el.textPathDef.setAttribute("d",textPathParams[key]||E);textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}else{el.textPathDef=defs.appendChild($("path",{id:rUUID,d:textPathParams[key]||E}));textPathProps.href="#"+rUUID;textPathProps["xlink:href"]="#"+rUUID}oldAttr.textPathStr=textPathParams[key]}else{textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}}else{textPathProps[key]=textPathParams[key]}}}if(params[has](textStr)){txtNode=R._g.doc.createTextNode(params[textStr]||E);oldAttr.pathText=a.text=params[textStr]||E}else{txtNode=R._g.doc.createTextNode(oldAttr.pathText||oldAttr.text||E);oldAttr.pathText=oldAttr.pathText||oldAttr.text||E;delete oldAttr.text}if(params[has](vAlignStr)){if(params[vAlignStr]===middleStr){dy=.3;oldAttr.valign=-.5}else if(params[vAlignStr]===bottomStr){dy=.7;oldAttr.valign=-1}else if(params[vAlignStr]===topStr){oldAttr.valign=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}else{if(oldAttr.tSpan&&(oldAttr.tSpan.textContent===params[textStr]||typeof params[textStr]!==typeStringSTR)){tSpan=oldAttr.tSpan}else{if(oldAttr.valign===-.5){dy=.3}else if(oldAttr.valign===-1){dy=.7}else{dy=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}}if(params[textStr]!==UNDEF){delete oldAttr.x;delete oldAttr.y;node.removeAttribute("x");node.removeAttribute("y");textPath=$("textPath",textPathProps);textPath.appendChild(tSpan||txtNode);while(node.firstChild){node.removeChild(node.firstChild)}node.appendChild(textPath)}}else{oldAttr.direction=direction;if(el.textPathDef&&defs){el.textPathDef.parentNode.removeChild(el.textPathDef);delete el.textPathDef}delete oldAttr.txtNode;delete oldAttr.tSpan;delete oldAttr.textPathStr;if(!lineHeight){fontSize=params.fontSize||params[fontSizeStr]||a[fontSizeStr]||group&&group.attrs&&group.attrs.fontSize;fontSize=fontSize?fontSize.toString().replace(pxStr,E):10;lineHeight=fontSize*leading}if(params[has](textStr)||oldAttr.pathText){if(R.is(params.text,arrayStr)){text=params.text.join(brStr)}else if(params.text==null){text=oldAttr.pathText}else{text=params.text}delete oldAttr.pathText;text=text.toString();if(text!==oldAttr.text){textChanged=true;if(text&&ltgtbrRegex.test(text)){text=text.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;|&#034;/g,'"').replace(/&#039;/g,"'").replace(/&<br\/>lt;|&l<br\/>t;|&lt<br\/>;/g,"<<br/>").replace(/&<br\/>gt;|&g<br\/>t;|&gt<br\/>;/g,"><br/>")}text=text.replace(/<u>/g,"<under>").replace(/<\/u>/g,"</under>").replace(/<b>/g,"<bold>").replace(/<\/b>/g,"</bold>").replace(/<strong>/g,"<bold>").replace(/<\/strong>/g,"</bold>").replace(/<em>/g,"<em>").replace(/<\/em>/g,"</em>").replace(/<i>/g,"<em>").replace(/<\/i>/g,"</em>").replace(/<strike>/g,"<strike>").replace(/<\/strike>/g,"</strike>").replace(/<s>/g,"<strike>").replace(/<\/s>/g,"</strike>").replace(/<del>/g,"<strike>").replace(/<\/del>/g,"</strike>").replace(/<sub>/g,"<sub>").replace(/<\/sub>/g,"</sub>").replace(/<sup>/g,"<sup>").replace(/<\/sup>/g,"</sup>");oldAttr.text=a.text=text;if(textBreakRegx.test(text)){if(oldAttr.noTSpan){oldAttr.noTSpan=!(removeAllChild=true)}texts=Str(text).split(textBreakRegx);l=texts.length}else{removeAllChild=true;oldAttr.noTSpan=true;l=1}if(oldAttr.lineCount!==l){oldAttr.lineCount=l;updateAlignment=true}}}if(lineHeight!==oldAttr.lineHeight){oldAttr.lineHeight=lineHeight;oldAttr.baseLineDiff=lineHeight*.75;updateAlignment=true}if(removeAllChild){while(node.firstChild){node.removeChild(node.firstChild)}}if(oldAttr.lineCount>1){if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanAttr={};if(!oldAttr.tspanAttr){oldAttr.tspanAttr={};oldAttr.tspan0Attr={}}if(oldAttr.tspanAttr.dy!==oldAttr.lineHeight){oldAttr.tspanAttr.dy=tspanAttr.dy=oldAttr.lineHeight;updateTspan=true}if(params[has]("x")&&oldAttr.tspanAttr.x!==params.x){oldAttr.tspan0Attr.x=oldAttr.tspanAttr.x=tspanAttr.x=a.x;updateTspan=true}if(textChanged){tspans=node.childNodes;for(i=0;i<l;i++){tspan=tspans[i*j];spanArr=createValidTextNode(texts[i],abbrArr);if(tspan){tspan.innerHTML=_trustedPolicy.default.createHTML(E);if(isIE){while(tspan.firstChild){tspan.removeChild(tspan.firstChild)}}if(updateTspan){$(tspan,i?tspanAttr:oldAttr.tspan0Attr)}}else{tspan=$(tSpanStr,i?oldAttr.tspanAttr:oldAttr.tspan0Attr);node.appendChild(tspan);if(!isIE&&direction===rtlStr){tempIESpan=$(tSpanStr,IESplTspanAttr);tempIESpan.appendChild(R._g.doc.createTextNode("i"));node.appendChild(tempIESpan)}}if(!texts[i]){tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");texts[i]=S}if(hasnbsp(texts[i])){texts[i]=spacify(texts[i]);tspan.style.whiteSpace=PRESERVESTRING}else if(tspan.style.whiteSpace===PRESERVESTRING){tspan.style.whiteSpace=BLANKSTRING}if(spanArr.length){for(var indx=0;indx<spanArr.length;indx++){tspan.appendChild(spanArr[indx])}}else{tspan.appendChild(R._g.doc.createTextNode(texts[i]))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}}else if(updateTspan){tspans=node.childNodes;ii=tspans.length;for(i=0;i<ii;i+=j){$(tspans[i],i?tspanAttr:oldAttr.tspan0Attr)}}ii=l*j;if(node.childNodes.length>ii){for(i=node.childNodes.length-1;i>=ii;i-=1){node.removeChild(node.childNodes[i])}}}else if(textChanged){if(hasnbsp(text)){text=spacify(text);node.style.whiteSpace=PRESERVESTRING}else if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanArr=createValidTextNode(text,abbrArr);if(tspanArr.length){for(var index=0;index<tspanArr.length;index++){node.appendChild(tspanArr[index])}}else{node.appendChild(R._g.doc.createTextNode(text))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}if(params[vAlignStr]){valign=vAlignMultiplier[a[vAlignStr]]||0;if(valign!==oldAttr.valign){oldAttr.valign=valign;updateAlignment=true}}if(updateAlignment){oldAttr.shift=oldAttr.baseLineDiff+oldAttr.lineCount*oldAttr.lineHeight*oldAttr.valign;updateNode=true}if((params.y||params.y===0)&&oldAttr.y!==params.y){oldAttr.y=a.y;updateNode=true}if(updateNode&&(oldAttr.y||oldAttr.y===0)&&(oldAttr.shift||oldAttr.shift===0)){$(node,{y:Math.round(oldAttr.y+oldAttr.shift)})}}},Element=function Element(node,svg,group){var o=this,parent=group||svg;parent.canvas&&parent.canvas.appendChild(node);o.node=o[0]=node;node.raphael=true;node.raphaelid=o.id=R._oid++;o.matrix=R.matrix();o.realPath=null;o.attrs=o.attrs||{};o.followers=o.followers||[];o.paper=svg;o.ca=o.customAttributes=o.customAttributes||new svg._CustomAttributes;o._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1};o.parent=parent;!parent.bottom&&(parent.bottom=o);o.prev=parent.top;parent.top&&(parent.top.next=o);parent.top=o;o.next=null},getTouchDistance=function getTouchDistance(touch1,touch2,isY){var select=isY?"pageY":"pageX";return Math.abs(touch2[select]-touch1[select])},storeHandlers=R.storeHandlers=function(elem,handler,fn){elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);elem._actualListners.push(handler);elem._derivedListeners.push(fn)},removeHandlers=function removeHandlers(elem,handler){var index=elem._actualListners.indexOf(handler),derivedHandler;if(index!==-1){derivedHandler=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}return derivedHandler},elproto=R.el;Element.prototype=elproto;elproto.constructor=Element;R._engine.getNode=function(el){var node=el.node||el[0].node;return node.titleNode||node};R._engine.getLastNode=function(el){var node=el.node||el[el.length-1].node;return node.titleNode||node};elproto.rotate=function(deg,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"rotate",deg,cx,cy);deg=Str(deg).split(separator);if(deg.length-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1);cx=bbox.x+bbox.width/2;cy=bbox.y+bbox.height/2}o.transform(o._.transform.concat([["r",deg,cx,cy]]));return o};elproto.scale=function(sx,sy,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"scale",sx,sy,cx,cy);sx=Str(sx).split(separator);if(sx.length-1){sy=toFloat(sx[1]);cx=toFloat(sx[2]);cy=toFloat(sx[3])}sx=toFloat(sx[0]);sy==null&&(sy=sx);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1)}cx=cx==null?bbox.x+bbox.width/2:cx;cy=cy==null?bbox.y+bbox.height/2:cy;o.transform(o._.transform.concat([["s",sx,sy,cx,cy]]));return o};elproto.translate=function(dx,dy){var o=this;if(o.removed){return o}updateFollowers(o,"translate",dx,dy);dx=Str(dx).split(separator);if(dx.length-1){dy=toFloat(dx[1])}dx=toFloat(dx[0])||0;dy=+dy||0;o.transform(o._.transform.concat([["t",dx,dy]]));return o};elproto.transform=function(tstr){var o=this,_=o._,sw;if(tstr==null){return _.transform}R._extractTransform(o,tstr);o.clip&&!_.clipispath&&$(o.clip,{transform:o.matrix.invert()});o.pattern&&updatePosition(o);o.node&&$(o.node,{transform:o.matrix});if(_.sx!==1||_.sy!==1){sw=o.attrs["stroke-width"];sw&&o.attr({"stroke-width":sw})}return o};elproto.hide=function(){var o=this;updateFollowers(o,"hide");!o.removed&&o.paper.safari(o.node.style.display=noneStr);return o};elproto.show=function(){var o=this;updateFollowers(o,"show");!o.removed&&o.paper.safari(o.node.style.display=E);return o};elproto.remove=function(){if(this.removed||!this.parent.canvas){return}var o=this,node=R._engine.getNode(o),paper=o.paper,defs=paper.defs,i;paper.__set__&&paper.__set__.exclude(o);eve.unbind("raphael.*.*."+o.id);if(o.gradient&&defs){updateGradientReference(o)}if(o["stroke-gradient"]&&defs){updateGradientReference(o,UNDEF,"stroke")}if(o.textPathDef&&defs){o.textPathDef.parentNode.removeChild(o.textPathDef);delete o.textPathDef}while(i=o.followers.pop()){i.el.remove()}while(i=o.bottom){i.remove()}if(o._drag){o.undrag()}if(o.events){while(i=o.events.pop()){i.unbind()}}o.parent.canvas.contains(node)&&o.parent.canvas.removeChild(node);o.removeData();delete paper._elementsById[o.id];R._tear(o,o.parent);for(i in o){o[i]=typeof o[i]===fnStr?R._removedFactory(i):null}o.removed=true};elproto._getBBox=function(){var fn,o=this,node=o.node,bbox={},a=o.attrs,align,hide,isText=o.type===textStr;if(isIE&&isText){fn=(0,_raphael.showRecursively)(o)}else{if(node.style.display===noneStr){o.show();hide=true}}try{bbox=node.getBBox();if(isText){if(bbox.x===undefined){bbox.isCalculated=true;align=a["text-anchor"];bbox.x=(a.x||0)-bbox.width*(align==="start"?0:align===middleStr?.5:1)}if(bbox.y===undefined){bbox.isCalculated=true;align=a[vAlignStr];bbox.y=(a.y||0)-bbox.height*(align===bottomStr?1:align===middleStr?.5:0)}}}catch(e){}finally{bbox=bbox||{}}isIE&&isText?fn&&fn():hide&&o.hide();return bbox};elproto.attr=function(name,value){if(this.removed){return this}var elem=this,attrs=this.attrs,key,finalParam={},i,ii,params,subkey,par,follower,invokedCa=elem._invokedCa||(elem._invokedCa={}),ca,caObj=this.ca;if(name==null){var res={};for(key in attrs){if(attrs[has](key)){res[key]=attrs[key]}}res.gradient&&res.fill===noneStr&&(res.fill=res.gradient)&&delete res.gradient;res.transform=this._.transform;res.visibility=this.node.style.display===noneStr?hiddenStr:visibleStr;return res}else{if(value==null){if(R.is(name,objectStr)){params=name}else if(R.is(name,typeStringSTR)){if(name===fillStr&&attrs.fill===noneStr&&attrs.gradient){return attrs.gradient}if(name===transformStr){return this._.transform}if(name===visibilityStr){return this.node.style.display===noneStr?hiddenStr:visibleStr}if(name in attrs){return attrs[name]}else if(R.is(caObj[name],fnStr)){return caObj[name].def}return R._availableAttrs[name]}}else{params={};params[name]=value}if(!R.stopPartialEventPropagation){for(key in params){eve("raphael.attr."+key+"."+this.id,this,params[key],key)}}for(key in params){ca=caObj[key];if(ca&&!invokedCa[key]&&R.is(ca,fnStr)){invokedCa[key]=true;par=ca.apply(this,[].concat(params[key]));invokedCa[key]=false;for(subkey in par){finalParam[subkey]=par[subkey]}attrs[key]=params[key]}else{finalParam[key]=params[key]}}setFillAndStroke(this,finalParam);for(i=0,ii=this.followers.length;i<ii;i++){follower=this.followers[i];follower.cb&&!follower.cb.call(follower.el,finalParam,this)||follower.el.attr(finalParam)}return this}};elproto.pinchstart=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];elem._blockDrag=true;e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}else{elem._blockDrag=false}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchstart",fn)};elproto.unpinchstart=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem.__blockDrag=false;elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchstart",derivedHandler)};elproto.pinchmove=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];e&&e.preventDefault();elem._pinchDragStarted=true;R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchmove",fn)};elproto.unpinchmove=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("touchmove",derivedHandler)};elproto.pinchend=function(handler,context){var elem=this,fn=function fn(e){if(elem._pinchDragStarted){elem._pinchDragStarted=false;handler.call(context||elem,e)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchend",fn)};elproto.unpinchend=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchend",derivedHandler)};elproto.pinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.pinchstart.call(this,pinchstarthandler);elproto.pinchin.call(this,pinchinhandler);elproto.pinchend.call(this,pinchendhandler)};elproto.unpinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.unpinchstart.call(this,pinchstarthandler);elproto.unpinchin.call(this,pinchinhandler);elproto.unpinchend.call(this,pinchendhandler)};elproto.fcwheel=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);handler.call(context||elem,dummyEve)};storeHandlers(elem,handler,fn);elem.node.addEventListener("wheel",fn)};elproto.fcunwheel=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("wheel",derivedHandler)};elproto.on=function(eventType,handler,context){if(!handler||!eventType){return}var elem=this,node,actualEventType,isSafe=eventType.match(/fc-/),fn=handler;if(this.removed){return this}elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);switch(eventType){case"fc-dragstart":elem.drag(null,handler);return elem;case"fc-dragmove":elem.drag(handler);return elem;case"fc-dragend":elem.drag(null,null,handler);return elem;case"fc-dbclick":elem.dbclick(handler,context);return elem;case"fc-pinchstart":elem.pinchstart(handler,context);return elem;case"fc-pinchmove":elem.pinchmove(handler,context);return elem;case"fc-pinchend":elem.pinchend(handler,context);return elem;case"fc-click":elem.fcclick(handler,context);return elem;case"fc-wheel":elem.fcwheel(handler,context);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){fn=function fn(e){if(!(supportsPointer&&supportsTouch&&!e.isPrimary)){lastHoveredInfo.elementInfo.push({el:context||elem,callback:handler});lastHoveredInfo.srcElement=e.srcElement||e.target}};eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg&&(eventType==="load"||eventType==="error")){node=this._.RefImg;fn=function fn(e){!elem.removed&&handler.call(elem,e)}}else{node=this.node}if(fn===handler){fn=function fn(e){!(supportsPointer&&supportsTouch&&!e.isPrimary)&&handler.call(context||elem,e)}}elem._actualListners.push(handler);elem._derivedListeners.push(fn);if(node.addEventListener){node.addEventListener(eventType,fn)}else{node["on"+eventType]=fn}return this};elproto.off=function(eventType,handler){var elem=this,fn=handler,actualEventType,index,isSafe=eventType.match(/fc-/),node;if(this.removed||!elem._actualListners||!eventType||!handler){return this}switch(eventType){case"fc-dragstart":elem.undragstart(handler);return elem;case"fc-dragmove":elem.undragmove(handler);return elem;case"fc-dragend":elem.undragend(handler);return elem;case"fc-dbclick":elem.undbclick(handler);return elem;case"fc-pinchstart":elem.unpinchstart(handler);return elem;case"fc-pinchmove":elem.unpinchmove(handler);return elem;case"fc-pinchend":elem.unpinchend(handler);return elem;case"fc-click":elem.fcunclick(handler);return elem;case"fc-wheel":elem.fcunwheel(handler);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));fn=handler;if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg){node=this._.RefImg}else{node=this.node}index=elem._actualListners.indexOf(fn);if(index!==-1){fn=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}if(node.removeEventListener){node.removeEventListener(eventType,fn)}else{node["on"+eventType]=null}return this};R._engine.path=function(svg,attrs,group){var el=$("path"),res=new Element(el,svg,group);res.type="path";attrs&&res.attr(attrs);return res};R._engine.group=function(svg,id,group,overrideId){var el=$("g"),res=new Element(el,svg,group);res.type="group";res.canvas=res.node;res.top=res.bottom=null;res._id=id||E;if(id){if(overrideId){el.setAttribute("class","raphael-group-"+id)}else{el.setAttribute("class","raphael-group-"+res.id+"-"+id)}}return res};R._engine.circle=function(svg,attrs,group){var el=$("circle"),res=new Element(el,svg,group);res.type="circle";attrs&&res.attr(attrs);return res};R._engine.rect=function(svg,attrs,group){var el=$("rect"),res=new Element(el,svg,group);res.type="rect";attrs.rx=attrs.ry=attrs.r;attrs&&res.attr(attrs);return res};R._engine.ellipse=function(svg,attrs,group){var el=$("ellipse"),res=new Element(el,svg,group);res.type="ellipse";attrs&&res.attr(attrs);return res};R._engine.image=function(svg,attrs,group){var el=$(imageStr),res=new Element(el,svg,group,true);res._.group=group||svg;res.type=imageStr;el.setAttribute("preserveAspectRatio",noneStr);attrs&&res.attr(attrs);return res};R._engine.text=function(svg,attrs,group,css){var el=$(textStr),res=new Element(el,svg,group);res.type=textStr;css&&res.css&&res.css(css,undefined,true);attrs&&res.attr(attrs);return res};R._engine.setSize=function(width,height){this.width=width||this.width;this.height=height||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);if(this._viewBox){this.setViewBox.apply(this,this._viewBox)}return this};R._engine.create=function(){var con=R._getContainer.apply(0,arguments),container=con&&con.container,x=con.x,y=con.y,width=con.width,height=con.height,paper;if(!container){throw new Error("SVG container not found.")}var cnvs=$("svg"),css="overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);"+"-webkit-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;"+"-ms-user-select:none;user-select:none;-o-user-select:none;cursor:default;"+"vertical-align:middle;",isFloating;if(supportsTouch){if(R.isIE10){css+="-ms-touch-action:pan-y;"}else{css+="touch-action:pan-y;"}}x=x||0;y=y||0;width=width||512;height=height||342;$(cnvs,{height:height,version:1.1,width:width,xmlns:svgNSStr});if(container===1){cnvs.style.cssText=css+"position:absolute;left:"+x+"px;top:"+y+pxStr;container=R._g.doc.body;container.appendChild(cnvs);isFloating=1}else{cnvs.style.cssText=css+"position:relative";if(container.firstChild){container.insertBefore(cnvs,container.firstChild)}else{container.appendChild(cnvs)}}paper=new R._Paper;paper.width=width;paper.height=height;paper.canvas=cnvs;paper.container=container;$(cnvs,{id:"raphael-paper-"+paper.id});paper.clear();paper._left=paper._top=0;isFloating&&(paper.renderfix=function(){});paper.renderfix();return paper};R._engine.setViewBox=function(x,y,w,h,fit){eve("raphael.setViewBox",this,this._viewBox,[x,y,w,h,fit]);var size=mmax(w/this.width,h/this.height),top=this.top,aspectRatio=fit?"meet":"xMinYMin",vb,sw;if(x==null){if(this._vbSize){size=1}delete this._vbSize;vb="0 0 "+this.width+S+this.height}else{this._vbSize=size;vb=x+S+y+S+w+S+h}$(this.canvas,{viewBox:vb,preserveAspectRatio:aspectRatio});if(size){while(top){sw="stroke-width"in top.attrs?top.attrs["stroke-width"]:1;top.attr({"stroke-width":sw});top._.dirty=1;top._.dirtyT=1;top=top.prev}}this._viewBox=[x,y,w,h,!!fit];return this};R.prototype.detachPaper=function(){if(this._detached!==false){this.container.removeChild(this.canvas);this._detached=true}};R.prototype.attachPaper=function(){if(this._detached){this.container.appendChild(this.canvas);this._detached=false}};R.prototype.renderfix=function(){var cnvs=this.canvas,s=cnvs.style,pos;try{pos=cnvs.getScreenCTM()||cnvs.createSVGMatrix()}catch(e){pos=cnvs.createSVGMatrix()}var left=-pos.e%1,top=-pos.f%1;if(left||top){if(left){this._left=(this._left+left)%1;s.left=this._left+pxStr}if(top){this._top=(this._top+top)%1;s.top=this._top+pxStr}}};R.prototype._desc=function(txt){var desc=this.desc;if(!desc){this.desc=desc=$("desc");this.canvas.appendChild(desc)}else{while(desc.firstChild){desc.removeChild(desc.firstChild)}}desc.appendChild(R._g.doc.createTextNode(R.is(txt,typeStringSTR)?txt:"Created with Red Raphaël "+R.version))};R.prototype.clear=function(){var c;eve("raphael.clear",this);while(c=this.bottom){c.remove()}c=this.canvas;while(c.firstChild){c.removeChild(c.firstChild)}this.bottom=this.top=null;c.appendChild(this.desc=$("desc"));c.appendChild(this.defs=$("defs"))};R.prototype.remove=function(){var i;eve("raphael.remove",this);while(i=this.bottom){i.remove()}this.defs&&this.defs.parentNode.removeChild(this.defs);this.desc&&this.desc.parentNode.removeChild(this.desc);this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(i in this){this[i]=typeof this[i]===fnStr?R._removedFactory(i):null}this.removed=true};R.prototype.setHTMLClassName=function(){}}}

@@ -1,1 +0,1 @@

"use strict";exports.__esModule=true;exports.default=_default;var _raphael=require("./raphael.lib");function _default(R){if(R.vml){var LoadRefImage=function LoadRefImage(element,attrs){var src=attrs.src,parent=element._.group,node=element.node;if(!element._.RefImg){element._.RefImg=new Image}if(attrs.src===undefined){return}element._.RefImg.src=src};var has="hasOwnProperty",Str=String,toFloat=parseFloat,math=Math,round=math.round,mmax=math.max,mmin=math.min,sqrt=math.sqrt,abs=math.abs,fillString="fill",separator=/[, ]+/,eve=R.eve,ms=" progid:DXImageTransform.Microsoft",arrayShift=Array.prototype.shift,doc=R._g.doc,f=doc.createElement("div"),b,S=" ",E="",map={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},bites=/([clmz]),?([^clmz]*)/gi,blurregexp=/ progid:\S+Blur\([^\)]+\)/g,val=/-?[^,\s-]+/g,cssDot="position:absolute;left:0;top:0;width:1px;height:1px",zoom=21600,pathTypes={path:1,rect:1,image:1},ovalTypes={circle:1,ellipse:1},path2vml=function path2vml(path){var total=/[ahqstv]/gi,command=R._pathToAbsolute;Str(path).match(total)&&(command=R._path2curve);total=/[clmz]/g;if(command==R._pathToAbsolute&&!Str(path).match(total)){var res=Str(path).replace(bites,(function(all,command,args){var vals=[],isMove=command.toLowerCase()=="m",res=map[command];args.replace(val,(function(value){if(isMove&&vals.length==2){res+=vals+map[command=="m"?"l":"L"];vals=[]}vals.push(round(value*zoom))}));return res+vals}));return res||"m0,0"}var pa=command(path),p,r;res=[];for(var i=0,ii=pa.length;i<ii;i++){p=pa[i];r=pa[i][0].toLowerCase();r=="z"&&(r="x");for(var j=1,jj=p.length;j<jj;j++){r+=round(p[j]*zoom)+(j!=jj-1?",":E)}res.push(r)}return res.length?res.join(S):"m0,0"},compensation=function compensation(deg,dx,dy){var m=R.matrix();m.rotate(-deg,.5,.5);return{dx:m.x(dx,dy),dy:m.y(dx,dy)}},setCoords=function setCoords(p,sx,sy,dx,dy,deg){var _=p._,m=p.matrix,fillpos=_.fillpos,o=p.node,s=o.style,y=1,flip="",dxdy,kx=zoom/sx,ky=zoom/sy;s.visibility="hidden";if(!sx||!sy){return}o.coordsize=abs(kx)+S+abs(ky);s.rotation=deg*(sx*sy<0?-1:1);if(deg){var c=compensation(deg,dx,dy);dx=c.dx;dy=c.dy}sx<0&&(flip+="x");sy<0&&(flip+=" y")&&(y=-1);s.flip=flip;o.coordorigin=dx*-kx+S+dy*-ky;if(fillpos||_.fillsize){var fill=o.getElementsByTagName(fillString);fill=fill&&fill[0];if(fill){o.removeChild(fill);if(fillpos){c=compensation(deg,m.x(fillpos[0],fillpos[1]),m.y(fillpos[0],fillpos[1]));fill.position=c.dx*y+S+c.dy*y}if(_.fillsize){fill.size=_.fillsize[0]*abs(sx)+S+_.fillsize[1]*abs(sy)}o.appendChild(fill)}}s.visibility="visible"};f.innerHTML='<v:shape adj="1"/>';b=f.firstChild;b.style.behavior="url(#default#VML)";if(!(b&&typeof b.adj=="object")){R.type=E}f=null;R._url=E;R.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var addArrow=function addArrow(o,value,isEnd){var values=Str(value).toLowerCase().split("-"),se=isEnd?"end":"start",i=values.length,type="classic",w="medium",h="medium";while(i--){switch(values[i]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":type=values[i];break;case"wide":case"narrow":h=values[i];break;case"long":case"short":w=values[i];break}}var stroke=o.node.getElementsByTagName("stroke")[0];stroke[se+"arrow"]=type;stroke[se+"arrowlength"]=w;stroke[se+"arrowwidth"]=h},applyCustomAttributes=function applyCustomAttributes(o,attrs){for(var key in attrs){eve("raphael.attr."+key+"."+o.id,o,attrs[key],key);o.ca[key]&&o.attr(key,attrs[key])}},styles=["font","line-height","font-family","font-weight","font-style","font-size"],getComputedFontStyle=function getComputedFontStyle(o){var style={},_break,i,len=styles.length,attrs;while(o.paper&&o.paper.canvas){attrs=o.attrs;_break=true;for(i=0;i<len;i++){if(!style[styles[i]]){style[styles[i]]=attrs[styles[i]];_break=false}}if(_break)break;o=o.parent}return style},setFillAndStroke=R._setFillAndStroke=function(o,params){if(!o.paper.canvas)return;o.attrs=o.attrs||{};var node=o.node,a=o.attrs,s=node.style,xy,oriOp,newpath=pathTypes[o.type]&&(params.x!=a.x||params.y!=a.y||params.width!=a.width||params.height!=a.height||params.cx!=a.cx||params.cy!=a.cy||params.rx!=a.rx||params.ry!=a.ry||params.r!=a.r),isOval=ovalTypes[o.type]&&(a.cx!=params.cx||a.cy!=params.cy||a.r!=params.r||a.rx!=params.rx||a.ry!=params.ry),isGroup=o.type==="group",res=o;oriOp=res.oriOp||(res.oriOp={});for(var par in params){if(params[par]===""){node.removeAttribute(par);delete a[par];delete params[par];continue}else if(params[has](par)){a[par]=params[par]}}if(newpath){a.path=R._getPath[o.type](o);o._.dirty=1}params.href&&(node.href=params.href);params.title&&(node.title=params.title);params.target&&(node.target=params.target);params.cursor&&(s.cursor=params.cursor);"blur"in params&&o.blur(params.blur);if(params.path&&o.type=="path"||newpath){node.path=path2vml(~Str(a.path).toLowerCase().indexOf("r")?R._pathToAbsolute(a.path):a.path);if(o.type=="image"){o._.fillpos=[a.x,a.y];o._.fillsize=[a.width,a.height];setCoords(o,1,1,0,0,0)}}"transform"in params&&o.transform(params.transform);if("rotation"in params){var rotation=params.rotation;if(R.is(rotation,"array")){o.rotate.apply(o,rotation)}else{o.rotate(rotation)}}if("visibility"in params){params.visibility==="hidden"?o.hide():o.show()}if(isOval){var cx=+a.cx,cy=+a.cy,rx=+a.rx||+a.r||0,ry=+a.ry||+a.r||0;node.path=R.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",round((cx-rx)*zoom),round((cy-ry)*zoom),round((cx+rx)*zoom),round((cy+ry)*zoom),round(cx*zoom))}if("clip-rect"in params){var rect=Str(params["clip-rect"]).split(separator);if(rect.length==4){rect[0]=+rect[0];rect[1]=+rect[1];rect[2]=+rect[2]+rect[0];rect[3]=+rect[3]+rect[1];var div=isGroup?node:node.clipRect||R._g.doc.createElement("div"),offset,dstyle=div.style;if(isGroup){o.clip=rect.slice();offset=o.matrix.offset();offset=[toFloat(offset[0]),toFloat(offset[1])];rect[0]-=offset[0];rect[1]-=offset[1];rect[2]-=offset[0];rect[3]-=offset[1];dstyle.width="1px";dstyle.height="1px"}else if(!node.clipRect){dstyle.top="0";dstyle.left="0";dstyle.width=o.paper.width+"px";dstyle.height=o.paper.height+"px";node.parentNode.insertBefore(div,node);div.appendChild(node);div.raphael=true;div.raphaelid=node.raphaelid;node.clipRect=div}dstyle.position="absolute";dstyle.clip=R.format("rect({1}px {2}px {3}px {0}px)",rect)}if(!params["clip-rect"]){if(isGroup&&o.clip){node.style.clip="rect(0px 10800px 10800px 0px)";delete o.clip}else if(node.clipRect){node.clipRect.style.clip="rect(0px 10800px 10800px 0px)"}}}if("shape-rendering"in params){node.style.antialias=params["shape-rendering"]!=="crisp"}if(o.textpath||isGroup){var textpathStyle=isGroup?node.style:o.textpath.style;params.font&&(textpathStyle.font=params.font);params["font-family"]&&(textpathStyle.fontFamily='"'+params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,E)+'"');params["font-size"]&&(textpathStyle.fontSize=params["font-size"]);params["font-weight"]&&(textpathStyle.fontWeight=params["font-weight"]);params["font-style"]&&(textpathStyle.fontStyle=params["font-style"])}if("arrow-start"in params){R.addArrow&&R.addArrow(res,params["arrow-start"])}if("arrow-end"in params){R.addArrow&&R.addArrow(res,params["arrow-end"],1)}if(params.opacity!=null||params["stroke-width"]!=null||params.fill!=null||params.src!=null||params.stroke!=null||params["stroke-width"]!=null||params["stroke-opacity"]!=null||params["fill-opacity"]!=null||params["stroke-dasharray"]!=null||params["stroke-miterlimit"]!=null||params["stroke-linejoin"]!=null||params["stroke-linecap"]!=null){var fill=node.getElementsByTagName(fillString),newfill=false,fillOpacity=-1;fill=fill&&fill[0];!fill&&(newfill=fill=createNode(fillString));if(o.type=="image"&&params.src){LoadRefImage(o,params);fill.src=params.src}params.fill&&(fill.on=true);if(fill.on==null||params.fill=="none"||params.fill===null){fill.on=false}if(fill.on&&params.fill){var isURL=Str(params.fill).match(R._ISURL),urlArr;if(isURL){urlArr=params.fill.split(R._ISURL);fill.parentNode==node&&node.removeChild(fill);fill.rotate=true;fill.src=urlArr[1];fill.type="tile";var bbox=o.getBBox(1);fill.position=bbox.x+S+bbox.y;o._.fillpos=[bbox.x,bbox.y];R._preload(urlArr[1],(function(){o._.fillsize=[this.offsetWidth,this.offsetHeight]}))}else{var color=R.getRGB(params.fill);fill.color=color.hex;fill.src=E;fill.type="solid";if(color.error&&(res.type in{circle:1,ellipse:1}||Str(params.fill).charAt()!="r")&&addGradientFill(res,params.fill,fill)){a.fill="none";a.gradient=params.fill;fill.rotate=false}else if("opacity"in color&&!("fill-opacity"in params)){oriOp.nonGradOpacity=fillOpacity=color.opacity}}}if(fillOpacity!==-1||"fill-opacity"in params||"opacity"in params){var opacity=((+a["fill-opacity"]+1||2)-1)*((+a.opacity+1||2)-1);opacity=mmin(mmax(opacity,0),1);oriOp.opacity=opacity;if(oriOp.opacity1!==undefined){fill.opacity=oriOp.opacity1*opacity;fill["o:opacity2"]=oriOp.opacity2*opacity}else{fill.opacity=opacity*(oriOp.nonGradOpacity===undefined?1:oriOp.nonGradOpacity)}if(fill.src){fill.color="none"}}oriOp.opacity=undefined;node.appendChild(fill);var stroke=node.getElementsByTagName("stroke")&&node.getElementsByTagName("stroke")[0],newstroke=false;!stroke&&(newstroke=stroke=createNode("stroke"));if(params.stroke&&params.stroke!="none"||params["stroke-width"]||params["stroke-opacity"]!=null||params["stroke-dasharray"]||params["stroke-miterlimit"]||params["stroke-linejoin"]||params["stroke-linecap"]){stroke.on=true}(params.stroke=="none"||params.stroke===null||stroke.on==null||params.stroke==0||params["stroke-width"]==0)&&(stroke.on=false);var strokeColor=R.getRGB("stroke"in params?params.stroke:a.stroke);stroke.on&&params.stroke&&(stroke.color=strokeColor.hex);opacity=((+a["stroke-opacity"]+1||2)-1)*((+a.opacity+1||2)-1)*((+strokeColor.opacity+1||2)-1);var width=(toFloat(params["stroke-width"])||1)*.75;opacity=mmin(mmax(opacity,0),1);params["stroke-width"]==null&&(width=a["stroke-width"]);params["stroke-width"]&&(stroke.weight=width);width&&width<1&&(opacity*=width)&&(stroke.weight=1);stroke.opacity=a.stroke!=="none"?opacity:0;params["stroke-linejoin"]&&(stroke.joinstyle=params["stroke-linejoin"])||newstroke&&(newstroke.joinstyle="miter");stroke.miterlimit=params["stroke-miterlimit"]||8;params["stroke-linecap"]&&(stroke.endcap=params["stroke-linecap"]=="butt"?"flat":params["stroke-linecap"]=="square"?"square":"round");if(params["stroke-dasharray"]){var dasharray={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};stroke.dashstyle=dasharray[has](params["stroke-dasharray"])?dasharray[params["stroke-dasharray"]]:params["stroke-dasharray"].join&&params["stroke-dasharray"].join(" ")||E}newstroke&&node.appendChild(stroke)}if(res.type=="text"){res.paper.canvas.style.display=E;var span=res.paper.span,m=100,_style=getComputedFontStyle(res),fontSize=_style.font&&_style.font.match(/\d+(?:\.\d*)?(?=px)/),lineHeight=_style["line-height"]&&(_style["line-height"]+E).match(/\d+(?:\.\d*)?(?=px)/);s=span.style;_style.font&&(s.font=_style.font);_style["font-family"]&&(s.fontFamily=_style["font-family"]);_style["font-weight"]&&(s.fontWeight=_style["font-weight"]);_style["font-style"]&&(s.fontStyle=_style["font-style"]);fontSize=toFloat(_style["font-size"]||fontSize&&fontSize[0])||10;s.fontSize=fontSize*m+"px";lineHeight=toFloat(_style["line-height"]||lineHeight&&lineHeight[0]||fontSize*1.2)||12;s.lineHeight=lineHeight*m+"px";R.is(params.text,"array")&&(params.text=res.textpath.string=params.text.join("\n").replace(/<br\s*?\/?>/gi,"\n"));res.textpath.string&&(span.innerHTML=Str(res.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var brect=span.getBoundingClientRect();res.W=a.w=(brect.right-brect.left)/m;res.H=a.h=(brect.bottom-brect.top)/m;res.X=a.x;res.Y=a.y;var leading=lineHeight-fontSize;switch(a["vertical-align"]){case"top":res.bby=res.H/2;break;case"bottom":res.bby=-res.H/2;break;default:res.bby=0}("x"in params||"y"in params||res.bby!==undefined)&&(res.path.v=R.format("m{0},{1}l{2},{1}",round(a.x*zoom),round((a.y+(res.bby||0))*zoom),round(a.x*zoom)+1));var dirtyattrs=["x","y","text","font","font-family","font-weight","font-style","font-size","line-height"];for(var d=0,dd=dirtyattrs.length;d<dd;d++){if(dirtyattrs[d]in params){res._.dirty=1;break}}switch(a["text-anchor"]){case"start":res.textpath.style["v-text-align"]="left";res.bbx=res.W/2;break;case"end":res.textpath.style["v-text-align"]="right";res.bbx=-res.W/2;break;default:res.textpath.style["v-text-align"]="center";res.bbx=0;break}res.textpath.style["v-text-kern"]=true}},updateFollowers=R._updateFollowers=function(){var i,ii,followerElem,args=(0,_raphael.getArrayCopy)(arguments),o=arrayShift.call(args),fnName=arrayShift.call(args);for(i=0,ii=o.followers.length;i<ii;i++){followerElem=o.followers[i].el;followerElem[fnName].apply(followerElem,args)}},addGradientFill=function addGradientFill(o,gradient,fill){o.attrs=o.attrs||{};var attrs=o.attrs,pow=Math.pow,oriFOpacity,oriOp=o.oriOp,opacity,oindex,type="linear",fxfy=".5 .5";o.attrs.gradient=gradient;gradient=Str(gradient).replace(R._radial_gradient,(function(all,opts){type="radial";opts=opts&&opts.split(",")||[];var cx=opts[0],cy=opts[1],r=opts[2],fx=opts[3],fy=opts[4],units=opts[5];if(fx&&fy){fx=toFloat(fx);fy=toFloat(fy);pow(fx-.5,2)+pow(fy-.5,2)>.25&&(fy=sqrt(.25-pow(fx-.5,2))*((fy>.5)*2-1)+.5);fxfy=fx+S+fy}return E}));gradient=gradient.split(/\s*\-\s*/);if(type=="linear"){var angle=gradient.shift();angle=-toFloat(angle);if(isNaN(angle)){return null}}var dots=R._parseDots(gradient);if(!dots){return null}o=o.shape||o.node;if(dots.length){fill.parentNode==o&&o.removeChild(fill);fill.on=true;fill.method="none";fill.color=dots[0].color;fill.color2=dots[dots.length-1].color;var clrs=[],opacity1=1,opacity2=dots[0].opacity===undefined?1:dots[0].opacity;for(var i=0,ii=dots.length;i<ii;i++){dots[i].offset&&clrs.push(dots[i].offset+S+dots[i].color);if(dots[i].opacity!==undefined){opacity1=dots[i].opacity}}fill.colors=clrs.length?clrs.join():"0% "+fill.color;oriOp.opacity1=opacity1;oriOp.opacity2=opacity2;oriFOpacity=oriOp.opacity===undefined?1:oriOp.opacity;fill.opacity=opacity1*oriFOpacity;fill["o:opacity2"]=opacity2*oriFOpacity;if(type=="radial"){fill.type="gradientTitle";fill.focus="100%";fill.focussize="0 0";fill.focusposition=fxfy;fill.angle=0}else{fill.type="gradient";fill.angle=(270-angle)%360}o.appendChild(fill)}return 1},Element=function Element(node,vml,group){var o=this,parent=group||vml,skew;parent.canvas&&parent.canvas.appendChild(node);skew=createNode("skew");skew.on=true;node.appendChild(skew);o.skew=skew;o.node=o[0]=node;node.raphael=true;node.raphaelid=o.id=R._oid++;o.X=0;o.Y=0;o.attrs=o.attrs||{};o.followers=o.followers||[];o.paper=vml;o.ca=o.customAttributes=o.customAttributes||new vml._CustomAttributes;o.matrix=R.matrix();o._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1};o.parent=parent;!parent.bottom&&(parent.bottom=o);o.prev=parent.top;parent.top&&(parent.top.next=o);parent.top=o;o.next=null};var elproto=R.el;Element.prototype=elproto;elproto.constructor=Element;elproto.transform=function(tstr){if(tstr==null){return this._.transform}var vbs=this.paper._viewBoxShift,vbt=vbs?"s"+[vbs.scale,vbs.scale]+"-1-1t"+[vbs.dx,vbs.dy]:E,oldt;if(vbs){oldt=tstr=Str(tstr).replace(/\.{3}|\u2026/g,this._.transform||E)}R._extractTransform(this,vbt+tstr);var matrix=this.matrix.clone(),skew=this.skew,o=this.node,split,isGrad=~Str(this.attrs.fill).indexOf("-"),isPatt=!Str(this.attrs.fill).indexOf("url(");matrix.translate(-.5,-.5);if(isPatt||isGrad||this.type=="image"){skew.matrix="1 0 0 1";skew.offset="0 0";split=matrix.split();if(isGrad&&split.noRotation||!split.isSimple){o.style.filter=matrix.toFilter();var bb=this.getBBox(),bbt=this.getBBox(1),xget=bb.x2&&bbt.x2&&"x2"||"x",yget=bb.y2&&bbt.y2&&"y2"||"y",dx=bb[xget]-bbt[xget],dy=bb[yget]-bbt[yget];o.coordorigin=dx*-zoom+S+dy*-zoom;setCoords(this,1,1,dx,dy,0)}else{o.style.filter=E;setCoords(this,split.scalex,split.scaley,split.dx,split.dy,split.rotate)}}else{o.style.filter=E;skew.matrix=Str(matrix);skew.offset=matrix.offset()}oldt&&(this._.transform=oldt);return this};elproto.rotate=function(deg,cx,cy){var o=this;if(o.removed){return o}updateFollowers(o,"rotate",deg,cx,cy);if(deg==null){return}deg=Str(deg).split(separator);if(deg.length-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);cy==null&&(cx=cy);if(cx==null||cy==null){var bbox=o.getBBox(1);cx=bbox.x+bbox.width/2;cy=bbox.y+bbox.height/2}o._.dirtyT=1;o.transform(o._.transform.concat([["r",deg,cx,cy]]));return o};elproto.translate=function(dx,dy){var o=this;if(o.removed){return o}updateFollowers(o,"translate",dx,dy);dx=Str(dx).split(separator);if(dx.length-1){dy=toFloat(dx[1])}dx=toFloat(dx[0])||0;dy=+dy||0;if(o._.bbox){o._.bbox.x+=dx;o._.bbox.y+=dy}o.transform(o._.transform.concat([["t",dx,dy]]));return o};elproto.scale=function(sx,sy,cx,cy){var o=this;if(o.removed){return o}updateFollowers(o,"scale",sx,sy,cx,cy);sx=Str(sx).split(separator);if(sx.length-1){sy=toFloat(sx[1]);cx=toFloat(sx[2]);cy=toFloat(sx[3]);isNaN(cx)&&(cx=null);isNaN(cy)&&(cy=null)}sx=toFloat(sx[0]);sy==null&&(sy=sx);cy==null&&(cx=cy);if(cx==null||cy==null){var bbox=o.getBBox(1)}cx=cx==null?bbox.x+bbox.width/2:cx;cy=cy==null?bbox.y+bbox.height/2:cy;o.transform(o._.transform.concat([["s",sx,sy,cx,cy]]));o._.dirtyT=1;return o};elproto.hide=function(soft){var o=this;updateFollowers(o,"hide",soft);!o.removed&&(o.node.style.display="none");return o};elproto.show=function(soft){var o=this;updateFollowers(o,"show",soft);!o.removed&&(o.node.style.display=E);return o};elproto._getBBox=function(){var o=this;if(o.removed){return{}}return{x:o.X+(o.bbx||0)-o.W/2,y:o.Y+(o.bby||0)-o.H/2,width:o.W,height:o.H}};elproto.remove=function(){if(this.removed||!this.parent.canvas){return}var o=this,node=R._engine.getNode(o),paper=o.paper,shape=o.shape,i;paper.__set__&&paper.__set__.exclude(o);eve.unbind("raphael.*.*."+o.id);shape&&shape.parentNode.removeChild(shape);node.parentNode&&node.parentNode.removeChild(node);while(i=o.followers.pop()){i.el.remove()}while(i=o.bottom){i.remove()}if(o._drag){o.undrag()}if(o.events){while(i=o.events.pop()){i.unbind()}}o.removeData();delete paper._elementsById[o.id];R._tear(o,o.parent);for(var i in o){o[i]=typeof o[i]==="function"?R._removedFactory(i):null}o.removed=true};elproto.attr=function(name,value){if(this.removed){return this}if(name==null){var res={};for(var a in this.attrs){if(this.attrs[has](a)){res[a]=this.attrs[a]}}res.gradient&&res.fill=="none"&&(res.fill=res.gradient)&&delete res.gradient;res.transform=this._.transform;res.visibility=this.node.style.display==="none"?"hidden":"visible";return res}if(value==null&&R.is(name,"string")){if(name==fillString&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient}if(name=="visibility"){return this.node.style.display==="none"?"hidden":"visible"}var names=name.split(separator),out={};for(var i=0,ii=names.length;i<ii;i++){name=names[i];if(name in this.attrs){out[name]=this.attrs[name]}else if(R.is(this.ca[name],"function")){out[name]=this.ca[name].def}else{out[name]=R._availableAttrs[name]}}return ii-1?out:out[names[0]]}if(this.attrs&&value==null&&R.is(name,"array")){out={};for(i=0,ii=name.length;i<ii;i++){out[name[i]]=this.attr(name[i])}return out}var params;if(value!=null){params={};params[name]=value}value==null&&R.is(name,"object")&&(params=name);if(!R.stopPartialEventPropagation){for(var key in params){eve("raphael.attr."+key+"."+this.id,this,params[key],key)}}if(params){var todel={};for(key in this.ca){if(this.ca[key]&&params[has](key)&&R.is(this.ca[key],"function")&&!this.ca["_invoked"+key]){this.ca["_invoked"+key]=true;var par=this.ca[key].apply(this,[].concat(params[key]));delete this.ca["_invoked"+key];for(var subkey in par){if(par[has](subkey)){params[subkey]=par[subkey]}}this.attrs[key]=params[key];if(par===false){todel[key]=params[key];delete params[key]}}}if("text"in params&&this.type=="text"){R.is(params.text,"array")&&(params.text=params.text.join("\n"));this.textpath.string=params.text.replace(/<br\s*?\/?>/gi,"\n")}setFillAndStroke(this,params);var follower;for(i=0,ii=this.followers.length;i<ii;i++){follower=this.followers[i];follower.cb&&!follower.cb.call(follower.el,params,this)||follower.el.attr(params)}for(var subkey in todel){params[subkey]=todel[subkey]}}return this};elproto.on=function(eventType,handler,context){var elem=this,dummyEve,fn=handler;if(elem.removed){return elem}elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);switch(eventType){case"fc-dragstart":elem.drag(null,handler);return elem;case"fc-dragmove":elem.drag(handler);return elem;case"fc-dragend":elem.drag(null,null,handler);return elem;case"fc-dbclick":elem.dbclick(handler,context);return elem;case"fc-click":elem.fcclick(handler,context);return elem}eventType=eventType.replace(/fc-/,"");if(elem._&&elem._.RefImg&&(eventType==="load"||eventType==="error")){node=elem._.RefImg;fn=function(el,handler){return function(e){dummyEve={};R.makeSelectiveCopy(dummyEve,e);dummyEve.target=elem._.RefImg;!el.removed&&handler.call(el,dummyEve)}}(elem,handler)}else{node=elem.node}if(!node.attachEvent){fn=function fn(){var evt=R._g.win.event;evt.target=evt.srcElement;handler(evt)}}else if(fn===handler){fn=function fn(e){handler.call(context||elem,e)}}elem._actualListners.push(handler);elem._derivedListeners.push(fn);if(node.attachEvent){node.attachEvent("on"+eventType,fn)}else{node["on"+eventType]=fn}return elem};elproto.off=function(eventType,handler){var elem=this,index;if(elem.removed){return elem}switch(eventType){case"fc-dragstart":elem.undragstart(handler);return elem;case"fc-dragmove":elem.undragmove(handler);return elem;case"fc-dragend":elem.undragend(handler);return elem;case"fc-dbclick":elem.undbclick(handler);return elem;case"fc-click":elem.fcunclick(handler);return elem}eventType=eventType.replace(/fc-/,"");index=elem._actualListners.indexOf(handler);if(index!==-1){handler=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}if(elem.node.attachEvent){elem.node.detachEvent("on"+eventType,handler)}else{elem.node["on"+eventType]=null}return elem};R._engine.getNode=function(el){var node=el.node||el[0].node;return node.clipRect||node};R._engine.getLastNode=function(el){var node=el.node||el[el.length-1].node;return node.clipRect||node};R._engine.group=function(vml,id,group,overrideId){var el=R._g.doc.createElement("div"),className,universalClassName=vml._HTMLClassName,p=new Element(el,vml,group);el.style.cssText=cssDot;p._id=id||E;if(id){if(overrideId){className=el.className="raphael-group-"+id}else{className=el.className="raphael-group-"+p.id+"-"+id}}if(universalClassName){el.className=className?className+" "+universalClassName:universalClassName}(group||vml).canvas.appendChild(el);p.type="group";p.canvas=p.node;p.transform=R._engine.group.transform;p.top=null;p.bottom=null;return p};R._engine.group.transform=function(tstr){if(tstr==null){return this._.transform}var o=this,s=o.node.style,c=o.clip,vbs=o.paper._viewBoxShift,vbt=vbs?"s"+[vbs.scale,vbs.scale]+"-1-1t"+[vbs.dx,vbs.dy]:E,oldt,matrix,offset,tx,ty;if(vbs){oldt=tstr=Str(tstr).replace(/\.{3}|\u2026/g,o._.transform||E)}R._extractTransform(o,vbt+tstr);matrix=o.matrix;offset=matrix.offset();tx=toFloat(offset[0])||0;ty=toFloat(offset[1])||0;s.left=tx+"px";s.top=ty+"px";s.zoom=(o._.tzoom=matrix.get(0))+E;c&&(s.clip=R.format("rect({1}px {2}px {3}px {0}px)",[c[0]-tx,c[1]-ty,c[2]-tx,c[3]-ty]));return o};R._engine.path=function(vml,attrs,group){var el=createNode("shape");el.style.cssText=cssDot;el.coordsize=zoom+S+zoom;el.coordorigin=vml.coordorigin;var p=new Element(el,vml,group);p.type=attrs.type||"path";p.path=[];p.Path=E;attrs.type&&delete attrs.type;setFillAndStroke(p,attrs);applyCustomAttributes(p,attrs);return p};R._engine.rect=function(vml,attrs,group){var path=R._rectPath(attrs.x,attrs.y,attrs.w,attrs.h,attrs.r);attrs.path=path;attrs.type="rect";var res=vml.path(attrs,group),a=res.attrs;res.X=a.x;res.Y=a.y;res.W=a.width;res.H=a.height;a.path=path;return res};R._engine.ellipse=function(vml,attrs,group){attrs.type="ellipse";var res=vml.path(attrs,group),a=res.attrs;res.X=a.x-a.rx;res.Y=a.y-a.ry;res.W=a.rx*2;res.H=a.ry*2;return res};R._engine.circle=function(vml,attrs,group){attrs.type="circle";var res=vml.path(attrs,group),a=res.attrs;res.X=a.x-a.r;res.Y=a.y-a.r;res.W=res.H=a.r*2;return res};R._engine.image=function(vml,attrs,group){attrs.w||(attrs.w=attrs.width);attrs.h||(attrs.h=attrs.height);var path=R._rectPath(attrs.x,attrs.y,attrs.w,attrs.h);attrs.path=path;attrs.type="image";attrs.stroke="none";var res=vml.path(attrs,group),a=res.attrs,node=res.node,fill=node.getElementsByTagName(fillString)[0];!res._.RefImg&&(res._.RefImg=new Image);a.src=attrs.src;res.X=a.x=attrs.x;res.Y=a.y=attrs.y;res.W=a.width=attrs.w;res.H=a.height=attrs.h;fill.parentNode==node&&node.removeChild(fill);fill.rotate=true;fill.src=a.src;fill.type="tile";res._.fillpos=[a.x,a.y];res._.fillsize=[a.w,a.h];node.appendChild(fill);setCoords(res,1,1,0,0,0);return res};R._engine.text=function(vml,attrs,group,css){var el=createNode("shape"),path=createNode("path"),o=createNode("textpath");x=attrs.x||0;y=attrs.y||0;text=attrs.text;path.v=R.format("m{0},{1}l{2},{1}",round(attrs.x*zoom),round(attrs.y*zoom),round(attrs.x*zoom)+1);path.textpathok=true;o.string=Str(attrs.text).replace(/<br\s*?\/?>/gi,"\n");o.on=true;el.style.cssText=cssDot;el.coordsize=zoom+S+zoom;el.coordorigin="0 0";var p=new Element(el,vml,group);p.shape=el;p.path=path;p.textpath=o;p.type="text";p.attrs.text=Str(attrs.text||E);p.attrs.x=attrs.x;p.attrs.y=attrs.y;p.attrs.w=1;p.attrs.h=1;css&&p.css&&p.css(css,undefined,true);setFillAndStroke(p,attrs);applyCustomAttributes(p,attrs);el.appendChild(o);el.appendChild(path);return p};R._engine.setSize=function(width,height){var cs=this.canvas.style;this.width=width;this.height=height;width==+width&&(width+="px");height==+height&&(height+="px");width&&(cs.width=width);height&&(cs.height=height);cs.clip="rect(0 "+cs.width+" "+cs.height+" 0)";if(this._viewBox){R._engine.setViewBox.apply(this,this._viewBox)}return this};R._engine.setViewBox=function(x,y,w,h,fit){eve("raphael.setViewBox",this,this._viewBox,[x,y,w,h,fit]);var width=this.width,height=this.height,size=1/mmax(w/width,h/height),H,W;if(fit){H=height/h;W=width/w;if(w*H<width){x-=(width-w*H)/2/H}if(h*W<height){y-=(height-h*W)/2/W}}this._viewBox=[x,y,w,h,!!fit];this._viewBoxShift={dx:-x,dy:-y,scale:size};this.forEach((function(el){el.transform("...")}));return this};var createNode;R._engine.initWin=function(win){var doc=win.document;doc.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!doc.namespaces.rvml&&doc.namespaces.add("rvml","urn:schemas-microsoft-com:vml");createNode=R._createNode=function(tagName,attrs){var el=doc.createElement("<rvml:"+tagName+' class="rvml">'),prop;for(prop in attrs){el[prop]=Str(attrs[prop])}return el}}catch(e){createNode=R._createNode=function(tagName,attrs){var el=doc.createElement("<"+tagName+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">'),prop;for(prop in attrs){el[prop]=Str(attrs[prop])}return el}}};R._engine.initWin(R._g.win);R._engine.create=function(){var con=R._getContainer.apply(0,arguments),container=con.container,height=con.height,s,width=con.width,x=con.x,y=con.y;if(!container){throw new Error("VML container not found.")}var res=new R._Paper,c=res.canvas=R._g.doc.createElement("div"),cs=c.style;x=x||0;y=y||0;width=width||512;height=height||342;res.width=width;res.height=height;width==+width&&(width+="px");height==+height&&(height+="px");res.coordsize=zoom*1e3+S+zoom*1e3;res.coordorigin="0 0";c.id="raphael-paper-"+res.id;res.span=R._g.doc.createElement("span");res.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;";c.appendChild(res.span);cs.cssText=R.format("top:0;left:0;width:{0};height:{1};display:inline-block;cursor:default;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",width,height);if(container==1){R._g.doc.body.appendChild(c);cs.left=x+"px";cs.top=y+"px";cs.position="absolute"}else{if(container.firstChild){container.insertBefore(c,container.firstChild)}else{container.appendChild(c)}}res.renderfix=function(){};return res};R.prototype.clear=function(){var c;eve("raphael.clear",this);while(c=this.bottom){c.remove()}this.canvas.innerHTML=E;this.span=R._g.doc.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas.appendChild(this.span);this.bottom=this.top=null};R.prototype.remove=function(){var i;eve("raphael.remove",this);while(i=this.bottom){i.remove()}this.canvas.parentNode.removeChild(this.canvas);for(i in this){this[i]=typeof this[i]=="function"?R._removedFactory(i):null}return true};R.prototype.setHTMLClassName=function(className){this._HTMLClassName=className}}}
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=_default;var _raphael=require("./raphael.lib");var _trustedPolicy=_interopRequireDefault(require("../../../../../../fc-features/src/utils/trusted-policy"));function _default(R){if(R.vml){var LoadRefImage=function LoadRefImage(element,attrs){var src=attrs.src,parent=element._.group,node=element.node;if(!element._.RefImg){element._.RefImg=new Image}if(attrs.src===undefined){return}element._.RefImg.src=src};var has="hasOwnProperty",Str=String,toFloat=parseFloat,math=Math,round=math.round,mmax=math.max,mmin=math.min,sqrt=math.sqrt,abs=math.abs,fillString="fill",separator=/[, ]+/,eve=R.eve,ms=" progid:DXImageTransform.Microsoft",arrayShift=Array.prototype.shift,doc=R._g.doc,f=doc.createElement("div"),b,S=" ",E="",map={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},bites=/([clmz]),?([^clmz]*)/gi,blurregexp=/ progid:\S+Blur\([^\)]+\)/g,val=/-?[^,\s-]+/g,cssDot="position:absolute;left:0;top:0;width:1px;height:1px",zoom=21600,pathTypes={path:1,rect:1,image:1},ovalTypes={circle:1,ellipse:1},path2vml=function path2vml(path){var total=/[ahqstv]/gi,command=R._pathToAbsolute;Str(path).match(total)&&(command=R._path2curve);total=/[clmz]/g;if(command==R._pathToAbsolute&&!Str(path).match(total)){var res=Str(path).replace(bites,(function(all,command,args){var vals=[],isMove=command.toLowerCase()=="m",res=map[command];args.replace(val,(function(value){if(isMove&&vals.length==2){res+=vals+map[command=="m"?"l":"L"];vals=[]}vals.push(round(value*zoom))}));return res+vals}));return res||"m0,0"}var pa=command(path),p,r;res=[];for(var i=0,ii=pa.length;i<ii;i++){p=pa[i];r=pa[i][0].toLowerCase();r=="z"&&(r="x");for(var j=1,jj=p.length;j<jj;j++){r+=round(p[j]*zoom)+(j!=jj-1?",":E)}res.push(r)}return res.length?res.join(S):"m0,0"},compensation=function compensation(deg,dx,dy){var m=R.matrix();m.rotate(-deg,.5,.5);return{dx:m.x(dx,dy),dy:m.y(dx,dy)}},setCoords=function setCoords(p,sx,sy,dx,dy,deg){var _=p._,m=p.matrix,fillpos=_.fillpos,o=p.node,s=o.style,y=1,flip="",dxdy,kx=zoom/sx,ky=zoom/sy;s.visibility="hidden";if(!sx||!sy){return}o.coordsize=abs(kx)+S+abs(ky);s.rotation=deg*(sx*sy<0?-1:1);if(deg){var c=compensation(deg,dx,dy);dx=c.dx;dy=c.dy}sx<0&&(flip+="x");sy<0&&(flip+=" y")&&(y=-1);s.flip=flip;o.coordorigin=dx*-kx+S+dy*-ky;if(fillpos||_.fillsize){var fill=o.getElementsByTagName(fillString);fill=fill&&fill[0];if(fill){o.removeChild(fill);if(fillpos){c=compensation(deg,m.x(fillpos[0],fillpos[1]),m.y(fillpos[0],fillpos[1]));fill.position=c.dx*y+S+c.dy*y}if(_.fillsize){fill.size=_.fillsize[0]*abs(sx)+S+_.fillsize[1]*abs(sy)}o.appendChild(fill)}}s.visibility="visible"};f.innerHTML=_trustedPolicy.default.createHTML('<v:shape adj="1"/>');b=f.firstChild;b.style.behavior="url(#default#VML)";if(!(b&&typeof b.adj=="object")){R.type=E}f=null;R._url=E;R.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var addArrow=function addArrow(o,value,isEnd){var values=Str(value).toLowerCase().split("-"),se=isEnd?"end":"start",i=values.length,type="classic",w="medium",h="medium";while(i--){switch(values[i]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":type=values[i];break;case"wide":case"narrow":h=values[i];break;case"long":case"short":w=values[i];break}}var stroke=o.node.getElementsByTagName("stroke")[0];stroke[se+"arrow"]=type;stroke[se+"arrowlength"]=w;stroke[se+"arrowwidth"]=h},applyCustomAttributes=function applyCustomAttributes(o,attrs){for(var key in attrs){eve("raphael.attr."+key+"."+o.id,o,attrs[key],key);o.ca[key]&&o.attr(key,attrs[key])}},styles=["font","line-height","font-family","font-weight","font-style","font-size"],getComputedFontStyle=function getComputedFontStyle(o){var style={},_break,i,len=styles.length,attrs;while(o.paper&&o.paper.canvas){attrs=o.attrs;_break=true;for(i=0;i<len;i++){if(!style[styles[i]]){style[styles[i]]=attrs[styles[i]];_break=false}}if(_break)break;o=o.parent}return style},setFillAndStroke=R._setFillAndStroke=function(o,params){if(!o.paper.canvas)return;o.attrs=o.attrs||{};var node=o.node,a=o.attrs,s=node.style,xy,oriOp,newpath=pathTypes[o.type]&&(params.x!=a.x||params.y!=a.y||params.width!=a.width||params.height!=a.height||params.cx!=a.cx||params.cy!=a.cy||params.rx!=a.rx||params.ry!=a.ry||params.r!=a.r),isOval=ovalTypes[o.type]&&(a.cx!=params.cx||a.cy!=params.cy||a.r!=params.r||a.rx!=params.rx||a.ry!=params.ry),isGroup=o.type==="group",res=o;oriOp=res.oriOp||(res.oriOp={});for(var par in params){if(params[par]===""){node.removeAttribute(par);delete a[par];delete params[par];continue}else if(params[has](par)){a[par]=params[par]}}if(newpath){a.path=R._getPath[o.type](o);o._.dirty=1}params.href&&(node.href=params.href);params.title&&(node.title=params.title);params.target&&(node.target=params.target);params.cursor&&(s.cursor=params.cursor);"blur"in params&&o.blur(params.blur);if(params.path&&o.type=="path"||newpath){node.path=path2vml(~Str(a.path).toLowerCase().indexOf("r")?R._pathToAbsolute(a.path):a.path);if(o.type=="image"){o._.fillpos=[a.x,a.y];o._.fillsize=[a.width,a.height];setCoords(o,1,1,0,0,0)}}"transform"in params&&o.transform(params.transform);if("rotation"in params){var rotation=params.rotation;if(R.is(rotation,"array")){o.rotate.apply(o,rotation)}else{o.rotate(rotation)}}if("visibility"in params){params.visibility==="hidden"?o.hide():o.show()}if(isOval){var cx=+a.cx,cy=+a.cy,rx=+a.rx||+a.r||0,ry=+a.ry||+a.r||0;node.path=R.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",round((cx-rx)*zoom),round((cy-ry)*zoom),round((cx+rx)*zoom),round((cy+ry)*zoom),round(cx*zoom))}if("clip-rect"in params){var rect=Str(params["clip-rect"]).split(separator);if(rect.length==4){rect[0]=+rect[0];rect[1]=+rect[1];rect[2]=+rect[2]+rect[0];rect[3]=+rect[3]+rect[1];var div=isGroup?node:node.clipRect||R._g.doc.createElement("div"),offset,dstyle=div.style;if(isGroup){o.clip=rect.slice();offset=o.matrix.offset();offset=[toFloat(offset[0]),toFloat(offset[1])];rect[0]-=offset[0];rect[1]-=offset[1];rect[2]-=offset[0];rect[3]-=offset[1];dstyle.width="1px";dstyle.height="1px"}else if(!node.clipRect){dstyle.top="0";dstyle.left="0";dstyle.width=o.paper.width+"px";dstyle.height=o.paper.height+"px";node.parentNode.insertBefore(div,node);div.appendChild(node);div.raphael=true;div.raphaelid=node.raphaelid;node.clipRect=div}dstyle.position="absolute";dstyle.clip=R.format("rect({1}px {2}px {3}px {0}px)",rect)}if(!params["clip-rect"]){if(isGroup&&o.clip){node.style.clip="rect(0px 10800px 10800px 0px)";delete o.clip}else if(node.clipRect){node.clipRect.style.clip="rect(0px 10800px 10800px 0px)"}}}if("shape-rendering"in params){node.style.antialias=params["shape-rendering"]!=="crisp"}if(o.textpath||isGroup){var textpathStyle=isGroup?node.style:o.textpath.style;params.font&&(textpathStyle.font=params.font);params["font-family"]&&(textpathStyle.fontFamily='"'+params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,E)+'"');params["font-size"]&&(textpathStyle.fontSize=params["font-size"]);params["font-weight"]&&(textpathStyle.fontWeight=params["font-weight"]);params["font-style"]&&(textpathStyle.fontStyle=params["font-style"])}if("arrow-start"in params){R.addArrow&&R.addArrow(res,params["arrow-start"])}if("arrow-end"in params){R.addArrow&&R.addArrow(res,params["arrow-end"],1)}if(params.opacity!=null||params["stroke-width"]!=null||params.fill!=null||params.src!=null||params.stroke!=null||params["stroke-width"]!=null||params["stroke-opacity"]!=null||params["fill-opacity"]!=null||params["stroke-dasharray"]!=null||params["stroke-miterlimit"]!=null||params["stroke-linejoin"]!=null||params["stroke-linecap"]!=null){var fill=node.getElementsByTagName(fillString),newfill=false,fillOpacity=-1;fill=fill&&fill[0];!fill&&(newfill=fill=createNode(fillString));if(o.type=="image"&&params.src){LoadRefImage(o,params);fill.src=params.src}params.fill&&(fill.on=true);if(fill.on==null||params.fill=="none"||params.fill===null){fill.on=false}if(fill.on&&params.fill){var isURL=Str(params.fill).match(R._ISURL),urlArr;if(isURL){urlArr=params.fill.split(R._ISURL);fill.parentNode==node&&node.removeChild(fill);fill.rotate=true;fill.src=urlArr[1];fill.type="tile";var bbox=o.getBBox(1);fill.position=bbox.x+S+bbox.y;o._.fillpos=[bbox.x,bbox.y];R._preload(urlArr[1],(function(){o._.fillsize=[this.offsetWidth,this.offsetHeight]}))}else{var color=R.getRGB(params.fill);fill.color=color.hex;fill.src=E;fill.type="solid";if(color.error&&(res.type in{circle:1,ellipse:1}||Str(params.fill).charAt()!="r")&&addGradientFill(res,params.fill,fill)){a.fill="none";a.gradient=params.fill;fill.rotate=false}else if("opacity"in color&&!("fill-opacity"in params)){oriOp.nonGradOpacity=fillOpacity=color.opacity}}}if(fillOpacity!==-1||"fill-opacity"in params||"opacity"in params){var opacity=((+a["fill-opacity"]+1||2)-1)*((+a.opacity+1||2)-1);opacity=mmin(mmax(opacity,0),1);oriOp.opacity=opacity;if(oriOp.opacity1!==undefined){fill.opacity=oriOp.opacity1*opacity;fill["o:opacity2"]=oriOp.opacity2*opacity}else{fill.opacity=opacity*(oriOp.nonGradOpacity===undefined?1:oriOp.nonGradOpacity)}if(fill.src){fill.color="none"}}oriOp.opacity=undefined;node.appendChild(fill);var stroke=node.getElementsByTagName("stroke")&&node.getElementsByTagName("stroke")[0],newstroke=false;!stroke&&(newstroke=stroke=createNode("stroke"));if(params.stroke&&params.stroke!="none"||params["stroke-width"]||params["stroke-opacity"]!=null||params["stroke-dasharray"]||params["stroke-miterlimit"]||params["stroke-linejoin"]||params["stroke-linecap"]){stroke.on=true}(params.stroke=="none"||params.stroke===null||stroke.on==null||params.stroke==0||params["stroke-width"]==0)&&(stroke.on=false);var strokeColor=R.getRGB("stroke"in params?params.stroke:a.stroke);stroke.on&&params.stroke&&(stroke.color=strokeColor.hex);opacity=((+a["stroke-opacity"]+1||2)-1)*((+a.opacity+1||2)-1)*((+strokeColor.opacity+1||2)-1);var width=(toFloat(params["stroke-width"])||1)*.75;opacity=mmin(mmax(opacity,0),1);params["stroke-width"]==null&&(width=a["stroke-width"]);params["stroke-width"]&&(stroke.weight=width);width&&width<1&&(opacity*=width)&&(stroke.weight=1);stroke.opacity=a.stroke!=="none"?opacity:0;params["stroke-linejoin"]&&(stroke.joinstyle=params["stroke-linejoin"])||newstroke&&(newstroke.joinstyle="miter");stroke.miterlimit=params["stroke-miterlimit"]||8;params["stroke-linecap"]&&(stroke.endcap=params["stroke-linecap"]=="butt"?"flat":params["stroke-linecap"]=="square"?"square":"round");if(params["stroke-dasharray"]){var dasharray={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};stroke.dashstyle=dasharray[has](params["stroke-dasharray"])?dasharray[params["stroke-dasharray"]]:params["stroke-dasharray"].join&&params["stroke-dasharray"].join(" ")||E}newstroke&&node.appendChild(stroke)}if(res.type=="text"){res.paper.canvas.style.display=E;var span=res.paper.span,m=100,_style=getComputedFontStyle(res),fontSize=_style.font&&_style.font.match(/\d+(?:\.\d*)?(?=px)/),lineHeight=_style["line-height"]&&(_style["line-height"]+E).match(/\d+(?:\.\d*)?(?=px)/);s=span.style;_style.font&&(s.font=_style.font);_style["font-family"]&&(s.fontFamily=_style["font-family"]);_style["font-weight"]&&(s.fontWeight=_style["font-weight"]);_style["font-style"]&&(s.fontStyle=_style["font-style"]);fontSize=toFloat(_style["font-size"]||fontSize&&fontSize[0])||10;s.fontSize=fontSize*m+"px";lineHeight=toFloat(_style["line-height"]||lineHeight&&lineHeight[0]||fontSize*1.2)||12;s.lineHeight=lineHeight*m+"px";R.is(params.text,"array")&&(params.text=res.textpath.string=params.text.join("\n").replace(/<br\s*?\/?>/gi,"\n"));res.textpath.string&&(span.innerHTML=Str(res.textpath.string).replace(/</g,"&#60;").replace(/&/g,"&#38;").replace(/\n/g,"<br>"));var brect=span.getBoundingClientRect();res.W=a.w=(brect.right-brect.left)/m;res.H=a.h=(brect.bottom-brect.top)/m;res.X=a.x;res.Y=a.y;var leading=lineHeight-fontSize;switch(a["vertical-align"]){case"top":res.bby=res.H/2;break;case"bottom":res.bby=-res.H/2;break;default:res.bby=0}("x"in params||"y"in params||res.bby!==undefined)&&(res.path.v=R.format("m{0},{1}l{2},{1}",round(a.x*zoom),round((a.y+(res.bby||0))*zoom),round(a.x*zoom)+1));var dirtyattrs=["x","y","text","font","font-family","font-weight","font-style","font-size","line-height"];for(var d=0,dd=dirtyattrs.length;d<dd;d++){if(dirtyattrs[d]in params){res._.dirty=1;break}}switch(a["text-anchor"]){case"start":res.textpath.style["v-text-align"]="left";res.bbx=res.W/2;break;case"end":res.textpath.style["v-text-align"]="right";res.bbx=-res.W/2;break;default:res.textpath.style["v-text-align"]="center";res.bbx=0;break}res.textpath.style["v-text-kern"]=true}},updateFollowers=R._updateFollowers=function(){var i,ii,followerElem,args=(0,_raphael.getArrayCopy)(arguments),o=arrayShift.call(args),fnName=arrayShift.call(args);for(i=0,ii=o.followers.length;i<ii;i++){followerElem=o.followers[i].el;followerElem[fnName].apply(followerElem,args)}},addGradientFill=function addGradientFill(o,gradient,fill){o.attrs=o.attrs||{};var attrs=o.attrs,pow=Math.pow,oriFOpacity,oriOp=o.oriOp,opacity,oindex,type="linear",fxfy=".5 .5";o.attrs.gradient=gradient;gradient=Str(gradient).replace(R._radial_gradient,(function(all,opts){type="radial";opts=opts&&opts.split(",")||[];var cx=opts[0],cy=opts[1],r=opts[2],fx=opts[3],fy=opts[4],units=opts[5];if(fx&&fy){fx=toFloat(fx);fy=toFloat(fy);pow(fx-.5,2)+pow(fy-.5,2)>.25&&(fy=sqrt(.25-pow(fx-.5,2))*((fy>.5)*2-1)+.5);fxfy=fx+S+fy}return E}));gradient=gradient.split(/\s*\-\s*/);if(type=="linear"){var angle=gradient.shift();angle=-toFloat(angle);if(isNaN(angle)){return null}}var dots=R._parseDots(gradient);if(!dots){return null}o=o.shape||o.node;if(dots.length){fill.parentNode==o&&o.removeChild(fill);fill.on=true;fill.method="none";fill.color=dots[0].color;fill.color2=dots[dots.length-1].color;var clrs=[],opacity1=1,opacity2=dots[0].opacity===undefined?1:dots[0].opacity;for(var i=0,ii=dots.length;i<ii;i++){dots[i].offset&&clrs.push(dots[i].offset+S+dots[i].color);if(dots[i].opacity!==undefined){opacity1=dots[i].opacity}}fill.colors=clrs.length?clrs.join():"0% "+fill.color;oriOp.opacity1=opacity1;oriOp.opacity2=opacity2;oriFOpacity=oriOp.opacity===undefined?1:oriOp.opacity;fill.opacity=opacity1*oriFOpacity;fill["o:opacity2"]=opacity2*oriFOpacity;if(type=="radial"){fill.type="gradientTitle";fill.focus="100%";fill.focussize="0 0";fill.focusposition=fxfy;fill.angle=0}else{fill.type="gradient";fill.angle=(270-angle)%360}o.appendChild(fill)}return 1},Element=function Element(node,vml,group){var o=this,parent=group||vml,skew;parent.canvas&&parent.canvas.appendChild(node);skew=createNode("skew");skew.on=true;node.appendChild(skew);o.skew=skew;o.node=o[0]=node;node.raphael=true;node.raphaelid=o.id=R._oid++;o.X=0;o.Y=0;o.attrs=o.attrs||{};o.followers=o.followers||[];o.paper=vml;o.ca=o.customAttributes=o.customAttributes||new vml._CustomAttributes;o.matrix=R.matrix();o._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1};o.parent=parent;!parent.bottom&&(parent.bottom=o);o.prev=parent.top;parent.top&&(parent.top.next=o);parent.top=o;o.next=null};var elproto=R.el;Element.prototype=elproto;elproto.constructor=Element;elproto.transform=function(tstr){if(tstr==null){return this._.transform}var vbs=this.paper._viewBoxShift,vbt=vbs?"s"+[vbs.scale,vbs.scale]+"-1-1t"+[vbs.dx,vbs.dy]:E,oldt;if(vbs){oldt=tstr=Str(tstr).replace(/\.{3}|\u2026/g,this._.transform||E)}R._extractTransform(this,vbt+tstr);var matrix=this.matrix.clone(),skew=this.skew,o=this.node,split,isGrad=~Str(this.attrs.fill).indexOf("-"),isPatt=!Str(this.attrs.fill).indexOf("url(");matrix.translate(-.5,-.5);if(isPatt||isGrad||this.type=="image"){skew.matrix="1 0 0 1";skew.offset="0 0";split=matrix.split();if(isGrad&&split.noRotation||!split.isSimple){o.style.filter=matrix.toFilter();var bb=this.getBBox(),bbt=this.getBBox(1),xget=bb.x2&&bbt.x2&&"x2"||"x",yget=bb.y2&&bbt.y2&&"y2"||"y",dx=bb[xget]-bbt[xget],dy=bb[yget]-bbt[yget];o.coordorigin=dx*-zoom+S+dy*-zoom;setCoords(this,1,1,dx,dy,0)}else{o.style.filter=E;setCoords(this,split.scalex,split.scaley,split.dx,split.dy,split.rotate)}}else{o.style.filter=E;skew.matrix=Str(matrix);skew.offset=matrix.offset()}oldt&&(this._.transform=oldt);return this};elproto.rotate=function(deg,cx,cy){var o=this;if(o.removed){return o}updateFollowers(o,"rotate",deg,cx,cy);if(deg==null){return}deg=Str(deg).split(separator);if(deg.length-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);cy==null&&(cx=cy);if(cx==null||cy==null){var bbox=o.getBBox(1);cx=bbox.x+bbox.width/2;cy=bbox.y+bbox.height/2}o._.dirtyT=1;o.transform(o._.transform.concat([["r",deg,cx,cy]]));return o};elproto.translate=function(dx,dy){var o=this;if(o.removed){return o}updateFollowers(o,"translate",dx,dy);dx=Str(dx).split(separator);if(dx.length-1){dy=toFloat(dx[1])}dx=toFloat(dx[0])||0;dy=+dy||0;if(o._.bbox){o._.bbox.x+=dx;o._.bbox.y+=dy}o.transform(o._.transform.concat([["t",dx,dy]]));return o};elproto.scale=function(sx,sy,cx,cy){var o=this;if(o.removed){return o}updateFollowers(o,"scale",sx,sy,cx,cy);sx=Str(sx).split(separator);if(sx.length-1){sy=toFloat(sx[1]);cx=toFloat(sx[2]);cy=toFloat(sx[3]);isNaN(cx)&&(cx=null);isNaN(cy)&&(cy=null)}sx=toFloat(sx[0]);sy==null&&(sy=sx);cy==null&&(cx=cy);if(cx==null||cy==null){var bbox=o.getBBox(1)}cx=cx==null?bbox.x+bbox.width/2:cx;cy=cy==null?bbox.y+bbox.height/2:cy;o.transform(o._.transform.concat([["s",sx,sy,cx,cy]]));o._.dirtyT=1;return o};elproto.hide=function(soft){var o=this;updateFollowers(o,"hide",soft);!o.removed&&(o.node.style.display="none");return o};elproto.show=function(soft){var o=this;updateFollowers(o,"show",soft);!o.removed&&(o.node.style.display=E);return o};elproto._getBBox=function(){var o=this;if(o.removed){return{}}return{x:o.X+(o.bbx||0)-o.W/2,y:o.Y+(o.bby||0)-o.H/2,width:o.W,height:o.H}};elproto.remove=function(){if(this.removed||!this.parent.canvas){return}var o=this,node=R._engine.getNode(o),paper=o.paper,shape=o.shape,i;paper.__set__&&paper.__set__.exclude(o);eve.unbind("raphael.*.*."+o.id);shape&&shape.parentNode.removeChild(shape);node.parentNode&&node.parentNode.removeChild(node);while(i=o.followers.pop()){i.el.remove()}while(i=o.bottom){i.remove()}if(o._drag){o.undrag()}if(o.events){while(i=o.events.pop()){i.unbind()}}o.removeData();delete paper._elementsById[o.id];R._tear(o,o.parent);for(var i in o){o[i]=typeof o[i]==="function"?R._removedFactory(i):null}o.removed=true};elproto.attr=function(name,value){if(this.removed){return this}if(name==null){var res={};for(var a in this.attrs){if(this.attrs[has](a)){res[a]=this.attrs[a]}}res.gradient&&res.fill=="none"&&(res.fill=res.gradient)&&delete res.gradient;res.transform=this._.transform;res.visibility=this.node.style.display==="none"?"hidden":"visible";return res}if(value==null&&R.is(name,"string")){if(name==fillString&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient}if(name=="visibility"){return this.node.style.display==="none"?"hidden":"visible"}var names=name.split(separator),out={};for(var i=0,ii=names.length;i<ii;i++){name=names[i];if(name in this.attrs){out[name]=this.attrs[name]}else if(R.is(this.ca[name],"function")){out[name]=this.ca[name].def}else{out[name]=R._availableAttrs[name]}}return ii-1?out:out[names[0]]}if(this.attrs&&value==null&&R.is(name,"array")){out={};for(i=0,ii=name.length;i<ii;i++){out[name[i]]=this.attr(name[i])}return out}var params;if(value!=null){params={};params[name]=value}value==null&&R.is(name,"object")&&(params=name);if(!R.stopPartialEventPropagation){for(var key in params){eve("raphael.attr."+key+"."+this.id,this,params[key],key)}}if(params){var todel={};for(key in this.ca){if(this.ca[key]&&params[has](key)&&R.is(this.ca[key],"function")&&!this.ca["_invoked"+key]){this.ca["_invoked"+key]=true;var par=this.ca[key].apply(this,[].concat(params[key]));delete this.ca["_invoked"+key];for(var subkey in par){if(par[has](subkey)){params[subkey]=par[subkey]}}this.attrs[key]=params[key];if(par===false){todel[key]=params[key];delete params[key]}}}if("text"in params&&this.type=="text"){R.is(params.text,"array")&&(params.text=params.text.join("\n"));this.textpath.string=params.text.replace(/<br\s*?\/?>/gi,"\n")}setFillAndStroke(this,params);var follower;for(i=0,ii=this.followers.length;i<ii;i++){follower=this.followers[i];follower.cb&&!follower.cb.call(follower.el,params,this)||follower.el.attr(params)}for(var subkey in todel){params[subkey]=todel[subkey]}}return this};elproto.on=function(eventType,handler,context){var elem=this,dummyEve,fn=handler;if(elem.removed){return elem}elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);switch(eventType){case"fc-dragstart":elem.drag(null,handler);return elem;case"fc-dragmove":elem.drag(handler);return elem;case"fc-dragend":elem.drag(null,null,handler);return elem;case"fc-dbclick":elem.dbclick(handler,context);return elem;case"fc-click":elem.fcclick(handler,context);return elem}eventType=eventType.replace(/fc-/,"");if(elem._&&elem._.RefImg&&(eventType==="load"||eventType==="error")){node=elem._.RefImg;fn=function(el,handler){return function(e){dummyEve={};R.makeSelectiveCopy(dummyEve,e);dummyEve.target=elem._.RefImg;!el.removed&&handler.call(el,dummyEve)}}(elem,handler)}else{node=elem.node}if(!node.attachEvent){fn=function fn(){var evt=R._g.win.event;evt.target=evt.srcElement;handler(evt)}}else if(fn===handler){fn=function fn(e){handler.call(context||elem,e)}}elem._actualListners.push(handler);elem._derivedListeners.push(fn);if(node.attachEvent){node.attachEvent("on"+eventType,fn)}else{node["on"+eventType]=fn}return elem};elproto.off=function(eventType,handler){var elem=this,index;if(elem.removed){return elem}switch(eventType){case"fc-dragstart":elem.undragstart(handler);return elem;case"fc-dragmove":elem.undragmove(handler);return elem;case"fc-dragend":elem.undragend(handler);return elem;case"fc-dbclick":elem.undbclick(handler);return elem;case"fc-click":elem.fcunclick(handler);return elem}eventType=eventType.replace(/fc-/,"");index=elem._actualListners.indexOf(handler);if(index!==-1){handler=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}if(elem.node.attachEvent){elem.node.detachEvent("on"+eventType,handler)}else{elem.node["on"+eventType]=null}return elem};R._engine.getNode=function(el){var node=el.node||el[0].node;return node.clipRect||node};R._engine.getLastNode=function(el){var node=el.node||el[el.length-1].node;return node.clipRect||node};R._engine.group=function(vml,id,group,overrideId){var el=R._g.doc.createElement("div"),className,universalClassName=vml._HTMLClassName,p=new Element(el,vml,group);el.style.cssText=cssDot;p._id=id||E;if(id){if(overrideId){className=el.className="raphael-group-"+id}else{className=el.className="raphael-group-"+p.id+"-"+id}}if(universalClassName){el.className=className?className+" "+universalClassName:universalClassName}(group||vml).canvas.appendChild(el);p.type="group";p.canvas=p.node;p.transform=R._engine.group.transform;p.top=null;p.bottom=null;return p};R._engine.group.transform=function(tstr){if(tstr==null){return this._.transform}var o=this,s=o.node.style,c=o.clip,vbs=o.paper._viewBoxShift,vbt=vbs?"s"+[vbs.scale,vbs.scale]+"-1-1t"+[vbs.dx,vbs.dy]:E,oldt,matrix,offset,tx,ty;if(vbs){oldt=tstr=Str(tstr).replace(/\.{3}|\u2026/g,o._.transform||E)}R._extractTransform(o,vbt+tstr);matrix=o.matrix;offset=matrix.offset();tx=toFloat(offset[0])||0;ty=toFloat(offset[1])||0;s.left=tx+"px";s.top=ty+"px";s.zoom=(o._.tzoom=matrix.get(0))+E;c&&(s.clip=R.format("rect({1}px {2}px {3}px {0}px)",[c[0]-tx,c[1]-ty,c[2]-tx,c[3]-ty]));return o};R._engine.path=function(vml,attrs,group){var el=createNode("shape");el.style.cssText=cssDot;el.coordsize=zoom+S+zoom;el.coordorigin=vml.coordorigin;var p=new Element(el,vml,group);p.type=attrs.type||"path";p.path=[];p.Path=E;attrs.type&&delete attrs.type;setFillAndStroke(p,attrs);applyCustomAttributes(p,attrs);return p};R._engine.rect=function(vml,attrs,group){var path=R._rectPath(attrs.x,attrs.y,attrs.w,attrs.h,attrs.r);attrs.path=path;attrs.type="rect";var res=vml.path(attrs,group),a=res.attrs;res.X=a.x;res.Y=a.y;res.W=a.width;res.H=a.height;a.path=path;return res};R._engine.ellipse=function(vml,attrs,group){attrs.type="ellipse";var res=vml.path(attrs,group),a=res.attrs;res.X=a.x-a.rx;res.Y=a.y-a.ry;res.W=a.rx*2;res.H=a.ry*2;return res};R._engine.circle=function(vml,attrs,group){attrs.type="circle";var res=vml.path(attrs,group),a=res.attrs;res.X=a.x-a.r;res.Y=a.y-a.r;res.W=res.H=a.r*2;return res};R._engine.image=function(vml,attrs,group){attrs.w||(attrs.w=attrs.width);attrs.h||(attrs.h=attrs.height);var path=R._rectPath(attrs.x,attrs.y,attrs.w,attrs.h);attrs.path=path;attrs.type="image";attrs.stroke="none";var res=vml.path(attrs,group),a=res.attrs,node=res.node,fill=node.getElementsByTagName(fillString)[0];!res._.RefImg&&(res._.RefImg=new Image);a.src=attrs.src;res.X=a.x=attrs.x;res.Y=a.y=attrs.y;res.W=a.width=attrs.w;res.H=a.height=attrs.h;fill.parentNode==node&&node.removeChild(fill);fill.rotate=true;fill.src=a.src;fill.type="tile";res._.fillpos=[a.x,a.y];res._.fillsize=[a.w,a.h];node.appendChild(fill);setCoords(res,1,1,0,0,0);return res};R._engine.text=function(vml,attrs,group,css){var el=createNode("shape"),path=createNode("path"),o=createNode("textpath");x=attrs.x||0;y=attrs.y||0;text=attrs.text;path.v=R.format("m{0},{1}l{2},{1}",round(attrs.x*zoom),round(attrs.y*zoom),round(attrs.x*zoom)+1);path.textpathok=true;o.string=Str(attrs.text).replace(/<br\s*?\/?>/gi,"\n");o.on=true;el.style.cssText=cssDot;el.coordsize=zoom+S+zoom;el.coordorigin="0 0";var p=new Element(el,vml,group);p.shape=el;p.path=path;p.textpath=o;p.type="text";p.attrs.text=Str(attrs.text||E);p.attrs.x=attrs.x;p.attrs.y=attrs.y;p.attrs.w=1;p.attrs.h=1;css&&p.css&&p.css(css,undefined,true);setFillAndStroke(p,attrs);applyCustomAttributes(p,attrs);el.appendChild(o);el.appendChild(path);return p};R._engine.setSize=function(width,height){var cs=this.canvas.style;this.width=width;this.height=height;width==+width&&(width+="px");height==+height&&(height+="px");width&&(cs.width=width);height&&(cs.height=height);cs.clip="rect(0 "+cs.width+" "+cs.height+" 0)";if(this._viewBox){R._engine.setViewBox.apply(this,this._viewBox)}return this};R._engine.setViewBox=function(x,y,w,h,fit){eve("raphael.setViewBox",this,this._viewBox,[x,y,w,h,fit]);var width=this.width,height=this.height,size=1/mmax(w/width,h/height),H,W;if(fit){H=height/h;W=width/w;if(w*H<width){x-=(width-w*H)/2/H}if(h*W<height){y-=(height-h*W)/2/W}}this._viewBox=[x,y,w,h,!!fit];this._viewBoxShift={dx:-x,dy:-y,scale:size};this.forEach((function(el){el.transform("...")}));return this};var createNode;R._engine.initWin=function(win){var doc=win.document;doc.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!doc.namespaces.rvml&&doc.namespaces.add("rvml","urn:schemas-microsoft-com:vml");createNode=R._createNode=function(tagName,attrs){var el=doc.createElement("<rvml:"+tagName+' class="rvml">'),prop;for(prop in attrs){el[prop]=Str(attrs[prop])}return el}}catch(e){createNode=R._createNode=function(tagName,attrs){var el=doc.createElement("<"+tagName+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">'),prop;for(prop in attrs){el[prop]=Str(attrs[prop])}return el}}};R._engine.initWin(R._g.win);R._engine.create=function(){var con=R._getContainer.apply(0,arguments),container=con.container,height=con.height,s,width=con.width,x=con.x,y=con.y;if(!container){throw new Error("VML container not found.")}var res=new R._Paper,c=res.canvas=R._g.doc.createElement("div"),cs=c.style;x=x||0;y=y||0;width=width||512;height=height||342;res.width=width;res.height=height;width==+width&&(width+="px");height==+height&&(height+="px");res.coordsize=zoom*1e3+S+zoom*1e3;res.coordorigin="0 0";c.id="raphael-paper-"+res.id;res.span=R._g.doc.createElement("span");res.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;";c.appendChild(res.span);cs.cssText=R.format("top:0;left:0;width:{0};height:{1};display:inline-block;cursor:default;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",width,height);if(container==1){R._g.doc.body.appendChild(c);cs.left=x+"px";cs.top=y+"px";cs.position="absolute"}else{if(container.firstChild){container.insertBefore(c,container.firstChild)}else{container.appendChild(c)}}res.renderfix=function(){};return res};R.prototype.clear=function(){var c;eve("raphael.clear",this);while(c=this.bottom){c.remove()}this.canvas.innerHTML=_trustedPolicy.default.createHTML(E);this.span=R._g.doc.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas.appendChild(this.span);this.bottom=this.top=null};R.prototype.remove=function(){var i;eve("raphael.remove",this);while(i=this.bottom){i.remove()}this.canvas.parentNode.removeChild(this.canvas);for(i in this){this[i]=typeof this[i]=="function"?R._removedFactory(i):null}return true};R.prototype.setHTMLClassName=function(className){this._HTMLClassName=className}}}

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _lib=require("../../../lib");var _equal=_interopRequireDefault(require("@fusioncharts/utils/src/string/equal"));var _tool=_interopRequireDefault(require("../tool"));var _scrollTrack=_interopRequireDefault(require("./scroll-track"));var _scrollAnchor=_interopRequireDefault(require("./scroll-anchor"));var _scrollButton=_interopRequireDefault(require("./scroll-button"));var _helper=require("../helper");var UNDEF;var ScrollBar=function(_Tool){(0,_inheritsLoose2.default)(ScrollBar,_Tool);function ScrollBar(){return _Tool.apply(this,arguments)||this}var _proto=ScrollBar.prototype;_proto.__setDefaultConfig=function __setDefaultConfig(){_Tool.prototype.__setDefaultConfig.call(this);this.config.scale=1};_proto.configureAttributes=function configureAttributes(options){if(options===void 0){options={}}_Tool.prototype.configureAttributes.call(this,options);var selfConfig=this.config,chartAttrs=this.getFromEnv("chart-attrib");selfConfig.conf={};selfConfig.isOpposite=options&&!options.isHorizontal?(0,_equal.default)(chartAttrs.scrollposition,"right"):(0,_equal.default)(chartAttrs.scrollposition,"top");selfConfig.color=chartAttrs.scrollcolor&&(0,_lib.convertColor)(chartAttrs.scrollcolor);selfConfig.padding=(0,_lib.pluckNumber)(chartAttrs.scrollpadding,0);selfConfig.height=(0,_lib.pluckNumber)(chartAttrs.scrollheight,12);selfConfig.width=(0,_lib.pluckNumber)(chartAttrs.scrollwidth,12);selfConfig.displayFlat=(0,_lib.pluckNumber)(chartAttrs.flatscrollbars,0);selfConfig.scrollBar3DLighting=(0,_lib.pluckNumber)(chartAttrs.scrollbar3dlighting,1);selfConfig.startPercent=Math.min(1,Math.max(0,parseFloat(chartAttrs.scrolltoend)||0));selfConfig.showButtons=!!(0,_lib.pluckNumber)(chartAttrs.scrollshowbuttons,1);selfConfig.buttonPadding=(0,_lib.pluckNumber)(chartAttrs.scrollbtnpadding,0);selfConfig.style=options.style;selfConfig.drawStripes=options.drawStripes;selfConfig.restrictScrollAnchor=(0,_lib.pluckNumber)(options.restrictScrollAnchor,1);this.setConfiguaration(options);selfConfig.evt={tooltext:UNDEF,click:_lib.stubFN,hover:[_lib.stubFN,_lib.stubFN]};this.createScrollItems()};_proto.createScrollItems=function createScrollItems(){var scrollbar=this,selfConfig=this.config,style=selfConfig.style||{},scrollTrack=scrollbar.getChildren("scrollTrack")&&scrollbar.getChildren("scrollTrack")[0],scrollAnchor=scrollbar.getChildren("scrollAnchor")&&scrollbar.getChildren("scrollAnchor")[0],scrollButtonStart=scrollbar.getChildren("scrollButtons")&&scrollbar.getChildren("scrollButtons")[0],scrollButtonEnd=scrollbar.getChildren("scrollButtons")&&scrollbar.getChildren("scrollButtons")[0];if(!scrollTrack){scrollTrack=scrollbar.attachChild(_scrollTrack.default,"scrollTrack");scrollTrack.configure({style:{track:style.track},color:selfConfig.color,displayFlat:selfConfig.displayFlat,isHorizontal:selfConfig.isHorizontal});scrollTrack.attachEventHandlers()}if(!scrollAnchor){scrollAnchor=scrollbar.attachChild(_scrollAnchor.default,"scrollAnchor");scrollAnchor.configure({style:{scroller:style.scroller,grip:style.grip},drawStripes:selfConfig.drawStripes,color:selfConfig.color,displayFlat:selfConfig.displayFlat,isHorizontal:selfConfig.isHorizontal});scrollAnchor.attachEventHandlers()}if(!scrollButtonStart&&selfConfig.showButtons){scrollButtonStart=scrollbar.attachChild(_scrollButton.default,"scrollStartButton");scrollButtonStart.configure({type:"start",color:selfConfig.color,style:{button:style.button,arrow:style.arrow}});scrollButtonStart.attachEventHandlers()}if(!scrollButtonEnd&&selfConfig.showButtons){scrollButtonEnd=scrollbar.attachChild(_scrollButton.default,"scrollEndButton");scrollButtonEnd.configure({type:"end",color:selfConfig.color,style:{button:style.button,arrow:style.arrow}});scrollButtonEnd.attachEventHandlers()}};_proto.getName=function getName(){return"scrollbar"};_proto.getType=function getType(){return"scrollbar"};_proto.setConfiguaration=function setConfiguaration(conf){var selfConfig=this.config;if(!selfConfig.color){selfConfig.color="#"+this.getFromEnv("chart").getFromEnv("color-manager").getColor("altHGridColor")}(0,_helper.mergeConf)(conf,selfConfig)};_proto.getLogicalSpace=function getLogicalSpace(){var selfConfig=this.config,conf=selfConfig.conf,preperaedScrollbarSpecAttr={};(0,_helper.mergeConf)(selfConfig,preperaedScrollbarSpecAttr);(0,_helper.mergeConf)(preperaedScrollbarSpecAttr,conf);return _Tool.prototype.getLogicalSpace.call(this)};_proto.setDimension=function setDimension(dim){_Tool.prototype.setDimension.call(this,dim);var scrollbar=this,scrollbarParent=scrollbar.getLinkedParent(),parentPosition=scrollbarParent.getPosition&&scrollbarParent.getPosition()||{},scrolleTrackConfig=scrollbar.getChildren("scrollTrack")[0].config;scrolleTrackConfig.transLateX=parentPosition.x||0;scrolleTrackConfig.transLateY=parentPosition.y||0};_proto.draw=function draw(){var scrollbar=this,selfConfig=scrollbar.config,conf=selfConfig.conf,preperaedScrollbarSpecAttr={};if(conf.isHorizontal){delete preperaedScrollbarSpecAttr.width}else{delete preperaedScrollbarSpecAttr.height}(0,_helper.mergeConf)(preperaedScrollbarSpecAttr,selfConfig,true);scrollbar.addGraphicalElement({el:"group",attr:{name:"scrollContainer"},component:scrollbar,container:{id:"scrollbarContainer",label:"scrollbar",isParent:true},label:"scrollbarGroup",id:"scrollbarGroup"})};_proto.attachEventHandlers=function attachEventHandlers(eventMap){var scrollbar=this,selfConfig=this.config,evt=selfConfig.evt;if(eventMap){eventMap.scroll&&typeof eventMap.scroll==="function"&&(evt.scroll=eventMap.scroll);eventMap.scrollStart&&typeof eventMap.scrollStart==="function"&&(evt.scrollStart=eventMap.scrollStart);eventMap.scrollEnd&&typeof eventMap.scrollEnd==="function"&&(evt.scrollEnd=eventMap.scrollEnd)}return scrollbar};return ScrollBar}(_tool.default);ScrollBar.registerSymbol=UNDEF;ScrollBar._setConfiguaration=_lib.stubFN;var _default=ScrollBar;exports.default=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _lib=require("../../../lib");var _equal=_interopRequireDefault(require("@fusioncharts/utils/src/string/equal"));var _tool=_interopRequireDefault(require("../tool"));var _scrollTrack=_interopRequireDefault(require("./scroll-track"));var _scrollAnchor=_interopRequireDefault(require("./scroll-anchor"));var _scrollButton=_interopRequireDefault(require("./scroll-button"));var _helper=require("../helper");var UNDEF;var ScrollBar=function(_Tool){(0,_inheritsLoose2.default)(ScrollBar,_Tool);function ScrollBar(){return _Tool.apply(this,arguments)||this}var _proto=ScrollBar.prototype;_proto.__setDefaultConfig=function __setDefaultConfig(){_Tool.prototype.__setDefaultConfig.call(this);this.config.scale=1};_proto.configureAttributes=function configureAttributes(options){if(options===void 0){options={}}_Tool.prototype.configureAttributes.call(this,options);var selfConfig=this.config,chartAttrs=this.getFromEnv("chart-attrib");selfConfig.conf={};selfConfig.isOpposite=options&&!options.isHorizontal?(0,_equal.default)(chartAttrs.scrollposition,"right"):(0,_equal.default)(chartAttrs.scrollposition,"top");selfConfig.color=chartAttrs.scrollcolor&&(0,_lib.convertColor)(chartAttrs.scrollcolor);selfConfig.padding=(0,_lib.pluckNumber)(chartAttrs.scrollpadding,0);selfConfig.height=(0,_lib.pluckNumber)(chartAttrs.scrollheight,12);selfConfig.width=(0,_lib.pluckNumber)(chartAttrs.scrollwidth,12);selfConfig.displayFlat=(0,_lib.pluckNumber)(chartAttrs.flatscrollbars,0);selfConfig.scrollBar3DLighting=(0,_lib.pluckNumber)(chartAttrs.scrollbar3dlighting,1);selfConfig.startPercent=Math.min(1,Math.max(0,parseFloat(chartAttrs.scrolltoend)||0));selfConfig.showButtons=!!(0,_lib.pluckNumber)(chartAttrs.scrollshowbuttons,1);selfConfig.buttonPadding=(0,_lib.pluckNumber)(chartAttrs.scrollbtnpadding,0);selfConfig.style=options.style;selfConfig.drawStripes=options.drawStripes;selfConfig.restrictScrollAnchor=(0,_lib.pluckNumber)(options.restrictScrollAnchor,1);this.setConfiguaration(options);selfConfig.evt={tooltext:UNDEF,click:_lib.stubFN,hover:[_lib.stubFN,_lib.stubFN]};this.createScrollItems()};_proto.createScrollItems=function createScrollItems(){var _scrollbar$getChildre,_scrollbar$getChildre2,_scrollbar$getChildre3,_scrollbar$getChildre4;var scrollbar=this,selfConfig=this.config,style=selfConfig.style||{},scrollTrack=(_scrollbar$getChildre=scrollbar.getChildren("scrollTrack"))==null?void 0:_scrollbar$getChildre[0],scrollAnchor=(_scrollbar$getChildre2=scrollbar.getChildren("scrollAnchor"))==null?void 0:_scrollbar$getChildre2[0],scrollButtonStart=(_scrollbar$getChildre3=scrollbar.getChildren("scrollButtons"))==null?void 0:_scrollbar$getChildre3[0],scrollButtonEnd=(_scrollbar$getChildre4=scrollbar.getChildren("scrollButtons"))==null?void 0:_scrollbar$getChildre4[0],isLegendScrollButtonColor=!!selfConfig.legendScrollButtonArrowColor,scrollButtonStartColor=isLegendScrollButtonColor?selfConfig.legendScrollButtonArrowColor[0]:selfConfig.color,scrollButtonEndColor=isLegendScrollButtonColor?selfConfig.legendScrollButtonArrowColor.length===1?selfConfig.legendScrollButtonArrowColor[0]:selfConfig.legendScrollButtonArrowColor[1]:selfConfig.color;if(!scrollTrack){var _selfConfig$legendScr;scrollTrack=scrollbar.attachChild(_scrollTrack.default,"scrollTrack");scrollTrack.configure({style:{track:style.track},useLegendScrollGradient:selfConfig.useLegendScrollGradient,color:(_selfConfig$legendScr=selfConfig.legendScrollTrackColor)!=null?_selfConfig$legendScr:selfConfig.color,legendTrackStrokeBorderColor:selfConfig.legendTrackStrokeBorderColor,displayFlat:selfConfig.displayFlat,isHorizontal:selfConfig.isHorizontal});scrollTrack.attachEventHandlers()}if(!scrollAnchor){var _selfConfig$legendScr2;scrollAnchor=scrollbar.attachChild(_scrollAnchor.default,"scrollAnchor");scrollAnchor.configure({style:{scroller:style.scroller,grip:style.grip},drawStripes:selfConfig.drawStripes,useLegendScrollGradient:selfConfig.useLegendScrollGradient,color:(_selfConfig$legendScr2=selfConfig.legendScrollAnchorColor)!=null?_selfConfig$legendScr2:selfConfig.color,displayFlat:selfConfig.displayFlat,isHorizontal:selfConfig.isHorizontal});scrollAnchor.attachEventHandlers()}if(!scrollButtonStart&&selfConfig.showButtons){scrollButtonStart=scrollbar.attachChild(_scrollButton.default,"scrollStartButton");scrollButtonStart.configure({type:"start",color:scrollButtonStartColor,useLegendScrollGradient:selfConfig.useLegendScrollGradient,style:{button:style.button,arrow:style.arrow}});scrollButtonStart.attachEventHandlers()}if(!scrollButtonEnd&&selfConfig.showButtons){scrollButtonEnd=scrollbar.attachChild(_scrollButton.default,"scrollEndButton");scrollButtonEnd.configure({type:"end",color:scrollButtonEndColor,useLegendScrollGradient:selfConfig.useLegendScrollGradient,style:{button:style.button,arrow:style.arrow}});scrollButtonEnd.attachEventHandlers()}};_proto.getName=function getName(){return"scrollbar"};_proto.getType=function getType(){return"scrollbar"};_proto.setConfiguaration=function setConfiguaration(conf){var selfConfig=this.config;if(!selfConfig.color){selfConfig.color="#"+this.getFromEnv("chart").getFromEnv("color-manager").getColor("altHGridColor")}(0,_helper.mergeConf)(conf,selfConfig)};_proto.getLogicalSpace=function getLogicalSpace(){var selfConfig=this.config,conf=selfConfig.conf,preperaedScrollbarSpecAttr={};(0,_helper.mergeConf)(selfConfig,preperaedScrollbarSpecAttr);(0,_helper.mergeConf)(preperaedScrollbarSpecAttr,conf);return _Tool.prototype.getLogicalSpace.call(this)};_proto.setDimension=function setDimension(dim){_Tool.prototype.setDimension.call(this,dim);var scrollbar=this,scrollbarParent=scrollbar.getLinkedParent(),parentPosition=scrollbarParent.getPosition&&scrollbarParent.getPosition()||{},scrolleTrackConfig=scrollbar.getChildren("scrollTrack")[0].config;scrolleTrackConfig.transLateX=parentPosition.x||0;scrolleTrackConfig.transLateY=parentPosition.y||0};_proto.draw=function draw(){var scrollbar=this,selfConfig=scrollbar.config,conf=selfConfig.conf,preperaedScrollbarSpecAttr={};if(conf.isHorizontal){delete preperaedScrollbarSpecAttr.width}else{delete preperaedScrollbarSpecAttr.height}(0,_helper.mergeConf)(preperaedScrollbarSpecAttr,selfConfig,true);scrollbar.addGraphicalElement({el:"group",attr:{name:"scrollContainer"},component:scrollbar,container:{id:"scrollbarContainer",label:"scrollbar",isParent:true},label:"scrollbarGroup",id:"scrollbarGroup"})};_proto.attachEventHandlers=function attachEventHandlers(eventMap){var scrollbar=this,selfConfig=this.config,evt=selfConfig.evt;if(eventMap){eventMap.scroll&&typeof eventMap.scroll==="function"&&(evt.scroll=eventMap.scroll);eventMap.scrollStart&&typeof eventMap.scrollStart==="function"&&(evt.scrollStart=eventMap.scrollStart);eventMap.scrollEnd&&typeof eventMap.scrollEnd==="function"&&(evt.scrollEnd=eventMap.scrollEnd)}return scrollbar};return ScrollBar}(_tool.default);ScrollBar.registerSymbol=UNDEF;ScrollBar._setConfiguaration=_lib.stubFN;var _default=ScrollBar;exports.default=_default;

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _lib=require("../../../lib");var _dependencyManager=require("../../../dependency-manager");var R=(0,_dependencyManager.getDep)("redraphael","plugin"),M="M",m="m",v="v",COLOR_5F5F5F="#5F5F5F";var ScrollAnchor=function(_Tool){(0,_inheritsLoose2.default)(ScrollAnchor,_Tool);function ScrollAnchor(){var _this;_this=_Tool.call(this)||this;_this._evtHandlers={};return _this}var _proto=ScrollAnchor.prototype;_proto.configureAttributes=function configureAttributes(obj){if(obj===void 0){obj={}}var selfConfig=this.config;selfConfig.drawStripes=(0,_lib.pluckNumber)(obj.drawStripes,0);selfConfig._nodeDimensions={};selfConfig.style={scroller:Object.assign({},{fill:obj.displayFlat&&R.tintshade(obj.color,-.6).rgba||[270*obj.isHorizontal,R.tintshade(obj.color,.3).rgba+":40",R.tintshade(obj.color,-.7).rgba].join("-"),stroke:R.tintshade(obj.color,-.6).rgba},obj.style.scroller),grip:Object.assign({},{stroke:COLOR_5F5F5F,"stroke-linecap":"round","stroke-width":2},obj.style.grip)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollAnchor=this,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,_dragstart,_dragaxis,newScrollPos,isHorizontal=scrollbarConfig.isHorizontal;scrollAnchor.addEventListener("fc-dragmove",scrollAnchor._evtHandlers.dragmove||(scrollAnchor._evtHandlers.dragmove=function(event){newScrollPos=_dragstart+event.originalEvent.data[_dragaxis]/this.config.trackLength;if(newScrollPos>=1){newScrollPos=1}else if(newScrollPos<=0||isNaN(newScrollPos)){newScrollPos=0}scrollbarConfig.scrollPosition=newScrollPos;scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragstart",scrollAnchor._evtHandlers.dragstart||(scrollAnchor._evtHandlers.dragstart=function(){_dragaxis=isHorizontal?0:1;_dragstart=scrollbarConfig.scrollPosition;typeof scrollbarConfig.evt.scrollStart==="function"&&scrollbarConfig.evt.scrollStart(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragend",scrollAnchor._evtHandlers.dragend||(scrollAnchor._evtHandlers.dragend=function(){typeof scrollbarConfig.evt.scrollEnd==="function"&&scrollbarConfig.evt.scrollEnd(scrollbarConfig.scrollPosition)}))};_proto.draw=function draw(){var scrollAnchor=this,selfConfig=scrollAnchor.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,x=scrollbarConfig.x+.5,y=scrollbarConfig.y+scrollbarConfig.padding+.5,width=scrollbarConfig.width-1,height=scrollbarConfig.height-1<1?1:scrollbarConfig.height-1,ratio=scrollbarConfig.restrictScrollAnchor?Math.max(scrollbarConfig.scrollRatio,.01):scrollbarConfig.scrollRatio,isHorizontal=scrollbarConfig.isHorizontal,position=(0,_lib.pluckNumber)(scrollbarConfig.scrollPosition,scrollbarConfig.startPercent,0),trackLength,trackOffset,button=0,track=isHorizontal?width*ratio:height*ratio;if(position>=1){position=1}else if(position<=0||isNaN(position)){position=0}if(scrollbarConfig.showButtons){button=isHorizontal?Math.min(height,width*.5):Math.min(width,height*.5);track-=button*2*ratio}selfConfig.trackLength=trackLength=isHorizontal?width-2*button-track:height-2*button-track;selfConfig.trackOffset=trackOffset=isHorizontal?x+button+.5:y+button+.5;selfConfig._nodeDimensions={x:isHorizontal?trackOffset+trackLength*position:x,y:isHorizontal?y:trackOffset+trackLength*position,width:isHorizontal?track-1<1?1:track-1:width<1?1:width,height:isHorizontal?height<1?1:height:track-1<1?1:track-1};scrollAnchor.addGraphicalElement({el:"rect",attr:{x:selfConfig._nodeDimensions.x,y:selfConfig._nodeDimensions.y,width:selfConfig._nodeDimensions.width,height:selfConfig._nodeDimensions.height,r:scrollbarConfig.roundEdges&&2||0,opacity:selfConfig.style.scroller.opacity},css:selfConfig.style.scroller,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchor",id:"scrollbarAnchor"});if(selfConfig.drawStripes&&selfConfig._nodeDimensions.width>=8){scrollAnchor.addGraphicalElement({el:"path",attr:{path:[M,selfConfig._nodeDimensions.x+selfConfig._nodeDimensions.width/2-3,selfConfig._nodeDimensions.y+.2*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height],opacity:selfConfig.style.grip.opacity},css:selfConfig.style.grip,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchorStripe",id:"scrollbarAnchorStripe"})}};_proto.scrollTo=function scrollTo(position){var scrollbarConfig=this.getLinkedParent().config;if(position>=0&&position<=1){scrollbarConfig.scrollPosition=position;this.asyncDraw();if(typeof scrollbarConfig.evt.scroll==="function"){scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)}}};return ScrollAnchor}(_tool.default);var _default=ScrollAnchor;exports.default=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _lib=require("../../../lib");var _dependencyManager=require("../../../dependency-manager");var R=(0,_dependencyManager.getDep)("redraphael","plugin"),M="M",m="m",v="v",COLOR_5F5F5F="#5F5F5F";var ScrollAnchor=function(_Tool){(0,_inheritsLoose2.default)(ScrollAnchor,_Tool);function ScrollAnchor(){var _this;_this=_Tool.call(this)||this;_this.updateColor=function(){return R.tintshade.apply(R,arguments).rgba};_this._evtHandlers={};return _this}var _proto=ScrollAnchor.prototype;_proto.configureAttributes=function configureAttributes(obj){if(obj===void 0){obj={}}var selfConfig=this.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,useLegendScrollGradient=scrollbarConfig.useLegendScrollGradient,legendAnchorColor=scrollbarConfig.legendScrollAnchorColor,defaultGradientColor=[270*obj.isHorizontal,this.updateColor(obj.color,.3)+":40",this.updateColor(obj.color,-.6,-.7)],solidAnchorFill=legendAnchorColor!=null?legendAnchorColor:obj.displayFlat?this.updateColor(obj.color,-.6):defaultGradientColor.join("-"),gradientAnchorFill=useLegendScrollGradient?[legendAnchorColor.angle,legendAnchorColor.startcolor,legendAnchorColor.endcolor].join("-"):legendAnchorColor;selfConfig.drawStripes=(0,_lib.pluckNumber)(obj.drawStripes,0);selfConfig._nodeDimensions={};selfConfig.style={scroller:Object.assign({},{fill:useLegendScrollGradient?gradientAnchorFill:solidAnchorFill,stroke:scrollbarConfig.legendAnchorStrokeBorderColor?scrollbarConfig.legendAnchorStrokeBorderColor:R.tintshade(obj.color,-.6).rgba},obj.style.scroller),grip:Object.assign({},{stroke:COLOR_5F5F5F,"stroke-linecap":"round","stroke-width":2},obj.style.grip)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollAnchor=this,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,_dragstart,_dragaxis,newScrollPos,isHorizontal=scrollbarConfig.isHorizontal;scrollAnchor.addEventListener("fc-dragmove",scrollAnchor._evtHandlers.dragmove||(scrollAnchor._evtHandlers.dragmove=function(event){newScrollPos=_dragstart+event.originalEvent.data[_dragaxis]/this.config.trackLength;if(newScrollPos>=1){newScrollPos=1}else if(newScrollPos<=0||isNaN(newScrollPos)){newScrollPos=0}scrollbarConfig.scrollPosition=newScrollPos;scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragstart",scrollAnchor._evtHandlers.dragstart||(scrollAnchor._evtHandlers.dragstart=function(){_dragaxis=isHorizontal?0:1;_dragstart=scrollbarConfig.scrollPosition;typeof scrollbarConfig.evt.scrollStart==="function"&&scrollbarConfig.evt.scrollStart(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragend",scrollAnchor._evtHandlers.dragend||(scrollAnchor._evtHandlers.dragend=function(){typeof scrollbarConfig.evt.scrollEnd==="function"&&scrollbarConfig.evt.scrollEnd(scrollbarConfig.scrollPosition)}))};_proto.draw=function draw(){var scrollAnchor=this,selfConfig=scrollAnchor.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,x=scrollbarConfig.x+.5,y=scrollbarConfig.y+scrollbarConfig.padding+.5,width=scrollbarConfig.width-1,height=scrollbarConfig.height-1<1?1:scrollbarConfig.height-1,ratio=scrollbarConfig.restrictScrollAnchor?Math.max(scrollbarConfig.scrollRatio,.01):scrollbarConfig.scrollRatio,isHorizontal=scrollbarConfig.isHorizontal,position=(0,_lib.pluckNumber)(scrollbarConfig.scrollPosition,scrollbarConfig.startPercent,0),trackLength,trackOffset,button=0,track=isHorizontal?width*ratio:height*ratio;if(position>=1){position=1}else if(position<=0||isNaN(position)){position=0}if(scrollbarConfig.showButtons){button=isHorizontal?Math.min(height,width*.5):Math.min(width,height*.5);track-=button*2*ratio}selfConfig.trackLength=trackLength=isHorizontal?width-2*button-track:height-2*button-track;selfConfig.trackOffset=trackOffset=isHorizontal?x+button+.5:y+button+.5;selfConfig._nodeDimensions={x:isHorizontal?trackOffset+trackLength*position:x,y:isHorizontal?y:trackOffset+trackLength*position,width:isHorizontal?track-1<1?1:track-1:width<1?1:width,height:isHorizontal?height<1?1:height:track-1<1?1:track-1};scrollAnchor.addGraphicalElement({el:"rect",attr:{x:selfConfig._nodeDimensions.x,y:selfConfig._nodeDimensions.y,width:selfConfig._nodeDimensions.width,height:selfConfig._nodeDimensions.height,r:scrollbarConfig.roundEdges&&2||0,opacity:selfConfig.style.scroller.opacity},css:selfConfig.style.scroller,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchor",id:"scrollbarAnchor"});if(selfConfig.drawStripes&&selfConfig._nodeDimensions.width>=8){scrollAnchor.addGraphicalElement({el:"path",attr:{path:[M,selfConfig._nodeDimensions.x+selfConfig._nodeDimensions.width/2-3,selfConfig._nodeDimensions.y+.2*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height],opacity:selfConfig.style.grip.opacity},css:selfConfig.style.grip,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchorStripe",id:"scrollbarAnchorStripe"})}};_proto.scrollTo=function scrollTo(position){var scrollbarConfig=this.getLinkedParent().config;if(position>=0&&position<=1){scrollbarConfig.scrollPosition=position;this.asyncDraw();if(typeof scrollbarConfig.evt.scroll==="function"){scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)}}};return ScrollAnchor}(_tool.default);var _default=ScrollAnchor;exports.default=_default;

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _utitilies=require("../../../../../../dev-tests/viz/utitilies");var _index=_interopRequireDefault(require("../../../../../../packages/fusioncharts/core/index"));var _scrollline2d=_interopRequireDefault(require("../../../../../../packages/fusioncharts/viz/scrollline2d"));_index.default.addDep(_scrollline2d.default);describe("Support - 2316 - scrollTo method is resetting when setJSONData or setChartData is used & the scroll bar position is not updated",(function(){var chartObj,scrollPosition,dataSource={chart:{numvisibleplot:"2",animation:"0"},categories:[{category:[{label:"Jan"},{label:"Feb"},{label:"Mar"}]}],dataset:[{seriesname:"2006",data:[{value:"10"},{value:"20"},{value:"10"}]}]},chartData={type:"scrollline2d",renderAt:_utitilies.CONTAINER_ID,dataSource:dataSource,events:{scrollEnd:function scrollEnd(e){scrollPosition=e.data.scrollPosition;console.log(e.data)}}};beforeEach((function(){chartObj=(0,_utitilies.setup)(_index.default,chartData)}));afterEach((function(){chartObj&&!chartObj.disposed&&chartObj.dispose()}));it("scroll position should remains same after the setJSONData is invoked",(function(done){chartObj.addEventListener("renderComplete",(function(){var children=chartObj.apiInstance.getChildren(),scrollbar=children.scrollBar[0],scrollAnchor=scrollbar&&scrollbar.getChildren("scrollAnchor")[0];chartObj.scrollTo(.5);setTimeout((function(){chartObj.setJSONData(dataSource);chartObj.scrollTo(scrollPosition)}),300);setTimeout((function(){children=chartObj.apiInstance.getChildren();scrollbar=children.scrollBar[0];scrollAnchor=scrollbar&&scrollbar.getChildren("scrollAnchor")[0];expect(scrollAnchor.config.scrollPosition).toBe(scrollPosition);done()}),500)}));chartObj.render()}));it("test for scroll function",(function(done){chartObj.addEventListener("renderComplete",(function(){var children=chartObj.apiInstance.getChildren(),scrollbar=children.scrollBar[0],scrollAnchor=scrollbar&&scrollbar.getChildren("scrollAnchor")[0],position=.81;scrollAnchor.scrollTo(position);expect(scrollbar.config.scrollPosition).toBe(position);done()}))}))}));
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _utitilies=require("../../../../../../dev-tests/viz/utitilies");var _index=_interopRequireDefault(require("../../../../../../packages/fusioncharts/core/index"));var _scrollline2d=_interopRequireDefault(require("../../../../../../packages/fusioncharts/viz/scrollline2d"));_index.default.addDep(_scrollline2d.default);describe("Support - 2316 - scrollTo method is resetting when setJSONData or setChartData is used & the scroll bar position is not updated",(function(){var chartObj,scrollPosition,dataSource={chart:{numvisibleplot:"2",animation:"0"},categories:[{category:[{label:"Jan"},{label:"Feb"},{label:"Mar"}]}],dataset:[{seriesname:"2006",data:[{value:"10"},{value:"20"},{value:"10"}]}]},chartData={type:"scrollline2d",renderAt:_utitilies.CONTAINER_ID,dataSource:dataSource,events:{scrollEnd:function scrollEnd(e){scrollPosition=e.data.scrollPosition}}};beforeEach((function(){chartObj=(0,_utitilies.setup)(_index.default,chartData)}));afterEach((function(){chartObj&&!chartObj.disposed&&chartObj.dispose()}));it("scroll position should remains same after the setJSONData is invoked",(function(done){chartObj.addEventListener("renderComplete",(function(){var children=chartObj.apiInstance.getChildren(),scrollbar=children.scrollBar[0],scrollAnchor=scrollbar&&scrollbar.getChildren("scrollAnchor")[0];chartObj.scrollTo(.5);setTimeout((function(){chartObj.setJSONData(dataSource);chartObj.scrollTo(scrollPosition)}),300);setTimeout((function(){children=chartObj.apiInstance.getChildren();scrollbar=children.scrollBar[0];scrollAnchor=scrollbar&&scrollbar.getChildren("scrollAnchor")[0];expect(scrollAnchor.config.scrollPosition).toBe(scrollPosition);done()}),500)}));chartObj.render()}));it("test for scroll function",(function(done){chartObj.addEventListener("renderComplete",(function(){var children=chartObj.apiInstance.getChildren(),scrollbar=children.scrollBar[0],scrollAnchor=scrollbar&&scrollbar.getChildren("scrollAnchor")[0],position=.81;scrollAnchor.scrollTo(position);expect(scrollbar.config.scrollPosition).toBe(position);done()}));chartObj.render()}))}));

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _dependencyManager=require("../../../dependency-manager");var _lib=require("../../../lib");var _schedular=require("../../../schedular");var DRAG_ANCHOR_TIMEOUT=300;var R=(0,_dependencyManager.getDep)("redraphael","plugin"),START="start";var ScrollButton=function(_Tool){(0,_inheritsLoose2.default)(ScrollButton,_Tool);function ScrollButton(){var _this;_this=_Tool.call(this)||this;_this._evtHandlers={};return _this}var _proto=ScrollButton.prototype;_proto.configureAttributes=function configureAttributes(options){if(options===void 0){options={}}var selfConfig=this.config;selfConfig.type=options.type;selfConfig.style={button:Object.assign({},{fill:_lib.TRACKER_FILL,stroke:"none"},options.style.button),arrow:Object.assign({},{fill:R.tintshade(options.color,-.4).rgba,stroke:"none"},options.style.arrow)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollButton=this,selfConfig=scrollButton.config,dragAnchorTimer,dragStarted,scrollbar=scrollButton.getLinkedParent(),scrollbarConfig=scrollbar.config,scrollAnchor=scrollbar.getChildren("scrollAnchor")[0],boundaryCheckandDraw=function boundaryCheckandDraw(){if(scrollbarConfig.scrollPosition>=1){scrollbarConfig.scrollPosition=1}else if(scrollbarConfig.scrollPosition<=0||isNaN(scrollbarConfig.scrollPosition)){scrollbarConfig.scrollPosition=0}scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)},dragJob=function dragJob(){dragStarted=true;if(selfConfig.type===START){scrollbarConfig.scrollPosition-=.01}else{scrollbarConfig.scrollPosition+=.01}boundaryCheckandDraw();scrollButton.addJob("dragScrollAnchor",dragJob,_schedular.priorityList.draw)};scrollButton.addEventListener("fc-mousedown",scrollButton._evtHandlers.mousedown||(scrollButton._evtHandlers.mousedown=function(){dragAnchorTimer=setTimeout((function onDragAnchorTimeout(){scrollButton.addJob("dragScrollAnchor",dragJob,_schedular.priorityList.draw)}),DRAG_ANCHOR_TIMEOUT)}));scrollButton.addEventListener("fc-mouseup",scrollButton._evtHandlers.mouseup||(scrollButton._evtHandlers.mouseup=function(){clearTimeout(dragAnchorTimer);scrollButton.removeJob("dragScrollAnchor");if(!dragStarted){if(selfConfig.type===START){scrollbarConfig.scrollPosition-=.1}else{scrollbarConfig.scrollPosition+=.1}boundaryCheckandDraw()}dragStarted=false}));scrollButton.addEventListener("fc-mouseout",(function onScrollButtonMouseOut(){if(dragStarted){scrollButton._evtHandlers.mouseup()}}))};_proto.draw=function draw(){var scrollButton=this,selfConfig=scrollButton.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,containerDetails={id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},isHorizontal=scrollbarConfig.isHorizontal,x=scrollbarConfig.x+.5,y=scrollbarConfig.y+scrollbarConfig.padding+.5,width=scrollbarConfig.width-1<1?1:scrollbarConfig.width-1,height=scrollbarConfig.height-1<1?1:scrollbarConfig.height-1,button=isHorizontal?Math.min(height,width*.5):Math.min(width,height*.5),startArrowPath=isHorizontal?(0,_lib.polyPathToPath)([3,x+button*.5,y+height*.5,button*.25,180]):(0,_lib.polyPathToPath)([3,x+width*.5,y+button*.5,button*.25,90]),endArrowPath=isHorizontal?(0,_lib.polyPathToPath)([3,x+width-button*.5,y+button*.5,button*.25,0]):(0,_lib.polyPathToPath)([3,x+width*.5,y+height-button*.5,button*.25,-90]);scrollButton.addGraphicalElement({el:"rect",attr:{x:selfConfig.type==="start"?x:isHorizontal?x+width-button:x,y:selfConfig.type==="start"?y:isHorizontal?y:y+height-button,width:selfConfig.type==="start"?isHorizontal?button:width:isHorizontal?button:width,height:selfConfig.type==="start"?isHorizontal?height:button:isHorizontal?height:button,opacity:selfConfig.style.button.opacity},css:selfConfig.style.button,container:containerDetails,component:scrollButton,label:"scrollbar"+selfConfig.type+"ButtonRect",id:"scrollbar"+selfConfig.type+"ButtonRect"});scrollButton.addGraphicalElement({el:"path",attr:{path:selfConfig.type==="start"?startArrowPath:endArrowPath,opacity:selfConfig.style.arrow.opacity},css:selfConfig.style.arrow,container:containerDetails,component:scrollButton,label:"scrollbar"+selfConfig.type+"ButtonPath",id:"scrollbar"+selfConfig.type+"ButtonPath"})};return ScrollButton}(_tool.default);var _default=ScrollButton;exports.default=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _dependencyManager=require("../../../dependency-manager");var _lib=require("../../../lib");var _schedular=require("../../../schedular");var DRAG_ANCHOR_TIMEOUT=300;var R=(0,_dependencyManager.getDep)("redraphael","plugin"),START="start";var ScrollButton=function(_Tool){(0,_inheritsLoose2.default)(ScrollButton,_Tool);function ScrollButton(){var _this;_this=_Tool.call(this)||this;_this._evtHandlers={};return _this}var _proto=ScrollButton.prototype;_proto.configureAttributes=function configureAttributes(options){if(options===void 0){options={}}var selfConfig=this.config;selfConfig.type=options.type;selfConfig.style={button:Object.assign({},{fill:_lib.TRACKER_FILL,stroke:"none"},options.style.button),arrow:Object.assign({},{fill:options.useLegendScrollGradient?options.color:R.tintshade(options.color,-.4).rgba,stroke:"none"},options.style.arrow)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollButton=this,selfConfig=scrollButton.config,dragAnchorTimer,dragStarted,scrollbar=scrollButton.getLinkedParent(),scrollbarConfig=scrollbar.config,scrollAnchor=scrollbar.getChildren("scrollAnchor")[0],boundaryCheckandDraw=function boundaryCheckandDraw(){if(scrollbarConfig.scrollPosition>=1){scrollbarConfig.scrollPosition=1}else if(scrollbarConfig.scrollPosition<=0||isNaN(scrollbarConfig.scrollPosition)){scrollbarConfig.scrollPosition=0}scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)},dragJob=function dragJob(){dragStarted=true;if(selfConfig.type===START){scrollbarConfig.scrollPosition-=.01}else{scrollbarConfig.scrollPosition+=.01}boundaryCheckandDraw();scrollButton.addJob("dragScrollAnchor",dragJob,_schedular.priorityList.draw)};scrollButton.addEventListener("fc-mousedown",scrollButton._evtHandlers.mousedown||(scrollButton._evtHandlers.mousedown=function(){dragAnchorTimer=setTimeout((function onDragAnchorTimeout(){scrollButton.addJob("dragScrollAnchor",dragJob,_schedular.priorityList.draw)}),DRAG_ANCHOR_TIMEOUT)}));scrollButton.addEventListener("fc-mouseup",scrollButton._evtHandlers.mouseup||(scrollButton._evtHandlers.mouseup=function(){clearTimeout(dragAnchorTimer);scrollButton.removeJob("dragScrollAnchor");if(!dragStarted){if(selfConfig.type===START){scrollbarConfig.scrollPosition-=.1}else{scrollbarConfig.scrollPosition+=.1}boundaryCheckandDraw()}dragStarted=false}));scrollButton.addEventListener("fc-mouseout",(function onScrollButtonMouseOut(){if(dragStarted){scrollButton._evtHandlers.mouseup()}}))};_proto.draw=function draw(){var scrollButton=this,selfConfig=scrollButton.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,containerDetails={id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},isHorizontal=scrollbarConfig.isHorizontal,x=scrollbarConfig.x+.5,y=scrollbarConfig.y+scrollbarConfig.padding+.5,width=scrollbarConfig.width-1<1?1:scrollbarConfig.width-1,height=scrollbarConfig.height-1<1?1:scrollbarConfig.height-1,button=isHorizontal?Math.min(height,width*.5):Math.min(width,height*.5),startArrowPath=isHorizontal?(0,_lib.polyPathToPath)([3,x+button*.5,y+height*.5,button*.25,180]):(0,_lib.polyPathToPath)([3,x+width*.5,y+button*.5,button*.25,90]),endArrowPath=isHorizontal?(0,_lib.polyPathToPath)([3,x+width-button*.5,y+button*.5,button*.25,0]):(0,_lib.polyPathToPath)([3,x+width*.5,y+height-button*.5,button*.25,-90]);scrollButton.addGraphicalElement({el:"rect",attr:{x:selfConfig.type==="start"?x:isHorizontal?x+width-button:x,y:selfConfig.type==="start"?y:isHorizontal?y:y+height-button,width:selfConfig.type==="start"?isHorizontal?button:width:isHorizontal?button:width,height:selfConfig.type==="start"?isHorizontal?height:button:isHorizontal?height:button,opacity:selfConfig.style.button.opacity},css:selfConfig.style.button,container:containerDetails,component:scrollButton,label:"scrollbar"+selfConfig.type+"ButtonRect",id:"scrollbar"+selfConfig.type+"ButtonRect"});scrollButton.addGraphicalElement({el:"path",attr:{path:selfConfig.type==="start"?startArrowPath:endArrowPath,opacity:selfConfig.style.arrow.opacity},css:selfConfig.style.arrow,container:containerDetails,component:scrollButton,label:"scrollbar"+selfConfig.type+"ButtonPath",id:"scrollbar"+selfConfig.type+"ButtonPath"})};return ScrollButton}(_tool.default);var _default=ScrollButton;exports.default=_default;

@@ -1,1 +0,1 @@

"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _dependencyManager=require("../../../dependency-manager");var _schedular=require("../../../schedular");var _lib=require("../../../../src/lib");var R=(0,_dependencyManager.getDep)("redraphael","plugin"),mathMax=Math.max;var ScrollTrack=function(_Tool){(0,_inheritsLoose2.default)(ScrollTrack,_Tool);function ScrollTrack(){var _this;_this=_Tool.call(this)||this;_this._evtHandlers={};return _this}var _proto=ScrollTrack.prototype;_proto.configureAttributes=function configureAttributes(obj){if(obj===void 0){obj={}}var selfConfig=this.config;selfConfig.style={track:Object.assign({},{fill:obj.displayFlat&&obj.color||[90*obj.isHorizontal,R.tintshade(obj.color,.15).rgba,obj.color].join("-"),stroke:R.tintshade(obj.color,-.75).rgba},obj.style.track)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollTrack=this,selfConfig=scrollTrack.config,scrollbar=scrollTrack.getLinkedParent(),scrollbarConfig=scrollbar.config,diff,continueDrag,posDisplacement,scrollAnchor,scrollAnchorConfig,boundaryCheckandDraw=function boundaryCheckandDraw(){if(scrollbarConfig.scrollPosition>1){scrollbarConfig.scrollPosition=1;continueDrag=false}else if(scrollbarConfig.scrollPosition<0||isNaN(scrollbarConfig.scrollPosition)){scrollbarConfig.scrollPosition=0;continueDrag=false}scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)},dragRightJob=function dragRightJob(){scrollbarConfig.scrollPosition+=.01;if(posDisplacement>=scrollbarConfig.scrollPosition&&continueDrag){boundaryCheckandDraw();scrollTrack.addJob("dragScrollAnchorRight",dragRightJob,_schedular.priorityList.draw)}},dragLeftJob=function dragLeftJob(){scrollbarConfig.scrollPosition-=.01;if(posDisplacement<=scrollbarConfig.scrollPosition&&continueDrag){boundaryCheckandDraw();scrollTrack.addJob("dragScrollAnchorLeft",dragLeftJob,_schedular.priorityList.draw)}};scrollTrack.addEventListener("fc-mousedown",scrollTrack._evtHandlers.mousedown||(scrollTrack._evtHandlers.mousedown=function(event){scrollAnchor=scrollbar.getChildren("scrollAnchor")[0];scrollAnchorConfig=scrollAnchor.config;continueDrag=true;if(scrollbarConfig.isHorizontal){diff=event.originalEvent.layerX-(scrollAnchorConfig._nodeDimensions.x+selfConfig.transLateX+scrollAnchorConfig._nodeDimensions.width/2)}else{diff=event.originalEvent.layerY-(scrollAnchorConfig._nodeDimensions.y+selfConfig.transLateY+scrollAnchorConfig._nodeDimensions.height/2)}posDisplacement=diff/scrollAnchorConfig.trackLength+scrollbarConfig.scrollPosition;if(posDisplacement>=scrollbarConfig.scrollPosition){scrollTrack.addJob("dragScrollAnchorRight",dragRightJob,_schedular.priorityList.draw)}else{scrollTrack.addJob("dragScrollAnchorLeft",dragLeftJob,_schedular.priorityList.draw)}}));scrollTrack.addEventListener("fc-mouseup",scrollTrack._evtHandlers.mouseup||(scrollTrack._evtHandlers.mouseup=function(){scrollbarConfig.evt.scrollEnd();continueDrag=false}))};_proto.draw=function draw(){var scrollTrack=this,selfConfig=scrollTrack.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,newScroll=(0,_lib.crispBound)(scrollbarConfig.x+.5,scrollbarConfig.y+scrollbarConfig.padding+.5,scrollbarConfig.width-1,scrollbarConfig.height-1,scrollbarConfig.strokeWidth);scrollTrack.addGraphicalElement({el:"rect",attr:{x:newScroll.x,y:newScroll.y,width:mathMax(newScroll.width,0),height:mathMax(newScroll.height,0),r:scrollbarConfig.roundEdges&&2||0,opacity:selfConfig.style.track.opacity},css:selfConfig.style.track,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollTrack,label:"scrollbarTrack",id:"scrollbarTrack"})};return ScrollTrack}(_tool.default);var _default=ScrollTrack;exports.default=_default;
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _dependencyManager=require("../../../dependency-manager");var _schedular=require("../../../schedular");var _lib=require("../../../../src/lib");var R=(0,_dependencyManager.getDep)("redraphael","plugin"),mathMax=Math.max;var ScrollTrack=function(_Tool){(0,_inheritsLoose2.default)(ScrollTrack,_Tool);function ScrollTrack(){var _this;_this=_Tool.call(this)||this;_this.updateColor=function(){return R.tintshade.apply(R,arguments).rgba};_this._evtHandlers={};return _this}var _proto=ScrollTrack.prototype;_proto.configureAttributes=function configureAttributes(obj){if(obj===void 0){obj={}}var selfConfig=this.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,useLegendScrollGradient=scrollbarConfig.useLegendScrollGradient,legendTrackColor=scrollbarConfig.legendScrollTrackColor,defaultGradientColor=[90*obj.isHorizontal,R.tintshade(obj.color,.15).rgba,obj.color],solidTrackFill=legendTrackColor!=null?legendTrackColor:obj.displayFlat?obj.color:defaultGradientColor.join("-"),gradientTrackFill=useLegendScrollGradient?[legendTrackColor.angle,legendTrackColor.startcolor,legendTrackColor.endcolor].join("-"):legendTrackColor;selfConfig.style={track:Object.assign({},{fill:useLegendScrollGradient?gradientTrackFill:solidTrackFill,stroke:scrollbarConfig.legendTrackStrokeBorderColor?scrollbarConfig.legendTrackStrokeBorderColor:R.tintshade(obj.color,-.75).rgba},obj.style.track)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollTrack=this,selfConfig=scrollTrack.config,scrollbar=scrollTrack.getLinkedParent(),scrollbarConfig=scrollbar.config,diff,continueDrag,posDisplacement,scrollAnchor,scrollAnchorConfig,boundaryCheckandDraw=function boundaryCheckandDraw(){if(scrollbarConfig.scrollPosition>1){scrollbarConfig.scrollPosition=1;continueDrag=false}else if(scrollbarConfig.scrollPosition<0||isNaN(scrollbarConfig.scrollPosition)){scrollbarConfig.scrollPosition=0;continueDrag=false}scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)},dragRightJob=function dragRightJob(){scrollbarConfig.scrollPosition+=.01;if(posDisplacement>=scrollbarConfig.scrollPosition&&continueDrag){boundaryCheckandDraw();scrollTrack.addJob("dragScrollAnchorRight",dragRightJob,_schedular.priorityList.draw)}},dragLeftJob=function dragLeftJob(){scrollbarConfig.scrollPosition-=.01;if(posDisplacement<=scrollbarConfig.scrollPosition&&continueDrag){boundaryCheckandDraw();scrollTrack.addJob("dragScrollAnchorLeft",dragLeftJob,_schedular.priorityList.draw)}};scrollTrack.addEventListener("fc-mousedown",scrollTrack._evtHandlers.mousedown||(scrollTrack._evtHandlers.mousedown=function(event){scrollAnchor=scrollbar.getChildren("scrollAnchor")[0];scrollAnchorConfig=scrollAnchor.config;continueDrag=true;if(scrollbarConfig.isHorizontal){diff=event.originalEvent.layerX-(scrollAnchorConfig._nodeDimensions.x+selfConfig.transLateX+scrollAnchorConfig._nodeDimensions.width/2)}else{diff=event.originalEvent.layerY-(scrollAnchorConfig._nodeDimensions.y+selfConfig.transLateY+scrollAnchorConfig._nodeDimensions.height/2)}posDisplacement=diff/scrollAnchorConfig.trackLength+scrollbarConfig.scrollPosition;if(posDisplacement>=scrollbarConfig.scrollPosition){scrollTrack.addJob("dragScrollAnchorRight",dragRightJob,_schedular.priorityList.draw)}else{scrollTrack.addJob("dragScrollAnchorLeft",dragLeftJob,_schedular.priorityList.draw)}}));scrollTrack.addEventListener("fc-mouseup",scrollTrack._evtHandlers.mouseup||(scrollTrack._evtHandlers.mouseup=function(){scrollbarConfig.evt.scrollEnd();continueDrag=false}))};_proto.draw=function draw(){var scrollTrack=this,selfConfig=scrollTrack.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,newScroll=(0,_lib.crispBound)(scrollbarConfig.x+.5,scrollbarConfig.y+scrollbarConfig.padding+.5,scrollbarConfig.width-1,scrollbarConfig.height-1,scrollbarConfig.strokeWidth);scrollTrack.addGraphicalElement({el:"rect",attr:{x:newScroll.x,y:newScroll.y,width:mathMax(newScroll.width,0),height:mathMax(newScroll.height,0),r:scrollbarConfig.roundEdges&&2||0,opacity:selfConfig.style.track.opacity},css:selfConfig.style.track,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollTrack,label:"scrollbarTrack",id:"scrollbarTrack"})};return ScrollTrack}(_tool.default);var _default=ScrollTrack;exports.default=_default;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc