From f4f3d6cd0cbad4f2b09330c1e7a78e19764f4c93 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 10 Mar 2025 12:21:36 +0800 Subject: [PATCH] :recycle: --- app/stage/protyle/js/flowchart.js/flowchart.min.js | 1 - app/stage/protyle/js/html-to-image.min.js | 1 - app/stage/protyle/js/protyle-html.js | 1 - app/stage/protyle/js/vis/vis-network.min.js | 1 - 4 files changed, 4 deletions(-) diff --git a/app/stage/protyle/js/flowchart.js/flowchart.min.js b/app/stage/protyle/js/flowchart.js/flowchart.min.js index dc1df5826..6e07a2123 100644 --- a/app/stage/protyle/js/flowchart.js/flowchart.min.js +++ b/app/stage/protyle/js/flowchart.js/flowchart.min.js @@ -7,4 +7,3 @@ !function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i(require("Raphael"));else if("function"==typeof define&&define.amd)define(["Raphael"],i);else{var e=i("object"==typeof exports?require("Raphael"):t.Raphael);for(var s in e)("object"==typeof exports?exports:t)[s]=e[s]}}(this,function(t){return function(t){function i(s){if(e[s])return e[s].exports;var n=e[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}var e={};return i.m=t,i.c=e,i.p="",i(0)}([function(t,i,e){e(9);var s=e(4);e(17);var n={parse:s};"undefined"!=typeof window&&(window.flowchart=n),t.exports=n},function(t,i){function e(t,i){if(!t||"function"==typeof t)return i;var s={};for(var n in i)s[n]=i[n];for(n in t)t[n]&&("object"==typeof s[n]?s[n]=e(s[n],t[n]):s[n]=t[n]);return s}function s(t,i){if("function"==typeof Object.create)t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});else{t.super_=i;var e=function(){};e.prototype=i.prototype,t.prototype=new e,t.prototype.constructor=t}}t.exports={defaults:e,inherits:s}},function(t,i,e){function s(t,i,e){this.chart=t,this.group=this.chart.paper.set(),this.symbol=e,this.connectedTo=[],this.symbolType=i.symbolType,this.flowstate=i.flowstate||"future",this.lineStyle=i.lineStyle||{},this.key=i.key||"",this.leftLines=[],this.rightLines=[],this.topLines=[],this.bottomLines=[],this.params=i.params,this.next_direction=i.next&&i.direction_next?i.direction_next:void 0,this.text=this.chart.paper.text(0,0,i.text),i.key&&(this.text.node.id=i.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var s=this.getAttr("font"),n=this.getAttr("font-family"),h=this.getAttr("font-weight");s&&this.text.attr({font:s}),n&&this.text.attr({"font-family":n}),h&&this.text.attr({"font-weight":h}),i.link&&this.text.attr("href",i.link),i.function&&(this.text.attr({cursor:"pointer"}),this.text.node.addEventListener("click",function(t){window[i.function](t,i)},!1)),i.target&&this.text.attr("target",i.target);var r=this.getAttr("maxWidth");if(r){for(var o=i.text.split(" "),a="",l=0,p=o.length;lr?"\n"+x:" "+x}this.text.attr("text",a.substring(1))}if(this.group.push(this.text),e){var y=this.getAttr("text-margin");e.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*y,height:this.text.getBBox().height+2*y}),e.node.setAttribute("class",this.getAttr("class"));var g=this.getAttr("roundness");isNaN(g)||(e.node.setAttribute("ry",g),e.node.setAttribute("rx",g)),i.link&&e.attr("href",i.link),i.target&&e.attr("target",i.target),i.function&&(e.node.addEventListener("click",function(t){window[i.function](t,i)},!1),e.attr({cursor:"pointer"})),i.key&&(e.node.id=i.key),this.group.push(e),e.insertBefore(this.text),this.text.attr({y:e.getBBox().height/2}),this.initialize()}}var n=e(3),h=n.drawLine,r=n.checkLineIntersection;s.prototype.getAttr=function(t){if(this.chart){var i,e=this.chart.options?this.chart.options[t]:void 0,s=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][t]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(i=this.chart.options.flowstate[this.flowstate][t]),i||s||e}},s.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},s.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},s.prototype.getX=function(){return this.group.getBBox().x},s.prototype.getY=function(){return this.group.getBBox().y},s.prototype.shiftX=function(t){this.group.transform("t"+(this.getX()+t)+","+this.getY())},s.prototype.setX=function(t){this.group.transform("t"+t+","+this.getY())},s.prototype.shiftY=function(t){this.group.transform("t"+this.getX()+","+(this.getY()+t))},s.prototype.setY=function(t){this.group.transform("t"+this.getX()+","+t)},s.prototype.getTop=function(){var t=this.getY(),i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getBottom=function(){var t=this.getY()+this.height,i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX();return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width;return{x:i,y:t}},s.prototype.render=function(){if(this.next){var t=this,i=this.getAttr("line-length");if("right"===this.next_direction){var e=this.getRight();this.next.isPositioned||(this.next.setY(e.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+i),function e(){for(var s,n=!1,h=0,r=t.chart.symbols.length;ht.next.getCenter().y&&o<=t.next.width/2){n=!0;break}}if(n){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else if("left"===this.next_direction){var s=this.getLeft();this.next.isPositioned||(this.next.setY(s.y-this.next.height/2),this.next.shiftX(-(this.group.getBBox().x+this.width+i)),function e(){for(var s,n=!1,h=0,r=t.chart.symbols.length;ht.next.getCenter().y&&o<=t.next.width/2){n=!0;break}}if(n){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else{var n=this.getBottom();this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+i),this.next.setX(n.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},s.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,this.getAttr("arrow-text")||"",this.next_direction):this.drawLineTo(this.next,this.getAttr("arrow-text")||""))},s.prototype.drawLineTo=function(t,i,e){this.connectedTo.indexOf(t)<0&&this.connectedTo.push(t);var s,n,o=this.getCenter().x,a=this.getCenter().y,l=this.getRight(),p=this.getBottom(),x=this.getTop(),y=this.getLeft(),g=t.getCenter().x,f=t.getCenter().y,c=t.getTop(),d=t.getRight(),m=t.getLeft(),u=o===g,b=a===f,_=af||this===t,w=o>g,L=ok&&(k=c.x);else n=10*Math.max(t.topLines.length,this.bottomLines.length),s=this.leftEnd&&v?h(this.chart,p,[{x:p.x,y:p.y+B/2-n},{x:p.x+(p.x-c.x)/2,y:p.y+B/2-n},{x:p.x+(p.x-c.x)/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i):h(this.chart,p,[{x:p.x,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x+(p.x-c.x)/2;else n=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x+B/2,y:l.y-n},{x:l.x+B/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else n=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x+B/2,y:l.y-n},{x:l.x+B/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else 0===t.rightLines.length&&0===this.leftLines.length?s=h(this.chart,y,d,i):(n=10*Math.max(t.rightLines.length,this.leftLines.length),s=h(this.chart,l,[{x:l.x,y:l.y-n},{x:l.x,y:d.y-n},{x:d.x,y:d.y-n},{x:d.x,y:d.y}],i)),this.leftLines.push(s),t.rightLines.push(s),this.leftStart=!0,t.rightEnd=!0,k=d.x;else 0===t.leftLines.length&&0===this.rightLines.length?s=h(this.chart,l,m,i):(n=10*Math.max(t.leftLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x,y:l.y-n},{x:l.x,y:m.y-n},{x:m.x,y:m.y-n},{x:m.x,y:m.y}],i)),this.rightLines.push(s),t.leftLines.push(s),this.rightStart=!0,t.leftEnd=!0,k=m.x;else 0===t.topLines.length&&0===this.bottomLines.length?s=h(this.chart,p,c,i):(n=10*Math.max(t.topLines.length,this.bottomLines.length),s=h(this.chart,p,[{x:c.x,y:c.y-n},{x:c.x,y:c.y}],i)),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x;if(this.lineStyle[t.key]&&s&&s.attr(this.lineStyle[t.key]),s){for(var O=0,X=this.chart.lines.length;OW?(J=["L",q.x+2*M,I],C.splice(N+1,0,J),J=["C",q.x+2*M,I,q.x,I-4*M,q.x-2*M,I],C.splice(N+2,0,J),s.attr("path",C)):(J=["L",q.x-2*M,I],C.splice(N+1,0,J),J=["C",q.x-2*M,I,q.x,I-4*M,q.x+2*M,I],C.splice(N+2,0,J),s.attr("path",C)):I>Q?(J=["L",G,q.y+2*M],C.splice(N+1,0,J),J=["C",G,q.y+2*M,G+4*M,q.y,G,q.y-2*M],C.splice(N+2,0,J),s.attr("path",C)):(J=["L",G,q.y-2*M],C.splice(N+1,0,J),J=["C",G,q.y-2*M,G+4*M,q.y,G,q.y+2*M],C.splice(N+2,0,J),s.attr("path",C)),N+=2}}}this.chart.lines.push(s),(void 0===this.chart.minXFromSymbols||this.chart.minXFromSymbols>y.x)&&(this.chart.minXFromSymbols=y.x)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&k>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=k)},t.exports=s},function(t,i){function e(t,i,e){var s,n,h="M{0},{1}";for(s=2,n=2*e.length+2;sd.x?i.x-(i.x-d.x)/2:d.x-(d.x-i.x)/2,u=i.y>d.y?i.y-(i.y-d.y)/2:d.y-(d.y-i.y)/2,c?(m-=g.getBBox().width/2,u-=t.options["text-margin"]):(m+=t.options["text-margin"],u-=g.getBBox().height/2)):(m=i.x,u=i.y,c?(i.x>d.x?(m-=t.options["text-margin"]/2,f="end"):m+=t.options["text-margin"]/2,u-=t.options["text-margin"]):(m+=t.options["text-margin"]/2,u+=t.options["text-margin"],i.y>d.y&&(u-=2*t.options["text-margin"]))),g.attr({"text-anchor":f,"font-size":t.options["font-size"],fill:t.options["font-color"],x:m,y:u}),l&&g.attr({font:l}),p&&g.attr({"font-family":p}),x&&g.attr({"font-weight":x})}return a}function n(t,i,e,s,n,h,r,o){var a,l,p,x,y,g={x:null,y:null,onLine1:!1,onLine2:!1};return a=(o-h)*(e-t)-(r-n)*(s-i),0===a?g:(l=i-h,p=t-n,x=(r-n)*l-(o-h)*p,y=(e-t)*l-(s-i)*p,l=x/a,p=y/a,g.x=t+l*(e-t),g.y=i+l*(s-i),l>0&&l<1&&(g.onLine1=!0),p>0&&p<1&&(g.onLine2=!0),g)}t.exports={drawPath:e,drawLine:s,checkLineIntersection:n}},function(t,i,e){function s(t){function i(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):"{}"}function e(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):""}function s(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?d.symbols[t.substring(0,i-1)]:d.symbols[t]}function f(t){var i="next",e=t.indexOf("(")+1,s=t.indexOf(")");return e>=0&&s>=0&&(i=N.substring(e,s),i.indexOf(",")<0&&"yes"!==i&&"no"!==i&&(i="next, "+i)),i}function c(t){var i=t.indexOf("(")+1,e=t.indexOf(")"),s=t.substring(i,e);s.indexOf(",")>0&&(s=s.substring(0,s.indexOf(",")));var n=s.split("@");if(n.length>1)return i>=0&&e>=0?n[1]:""}t=t||"",t=t.trim();for(var d={symbols:{},start:null,drawSVG:function(t,i){function e(t){if(c[t.key])return c[t.key];switch(t.symbolType){case"start":c[t.key]=new h(f,t);break;case"end":c[t.key]=new r(f,t);break;case"operation":c[t.key]=new o(f,t);break;case"inputoutput":c[t.key]=new a(f,t);break;case"input":c[t.key]=new l(f,t);break;case"output":c[t.key]=new p(f,t);break;case"subroutine":c[t.key]=new x(f,t);break;case"condition":c[t.key]=new y(f,t);break;case"parallel":c[t.key]=new g(f,t);break;default:return new Error("Wrong symbol type!")}return c[t.key]}var s=this;this.diagram&&this.diagram.clean();var f=new n(t,i);this.diagram=f;var c={};!function t(i,n,h){var r=e(i);return s.start===i?f.startWith(r):n&&h&&!n.pathOk&&(n instanceof y?(h.yes===i&&n.yes(r),h.no===i&&n.no(r)):n instanceof g?(h.path1===i&&n.path1(r),h.path2===i&&n.path2(r),h.path3===i&&n.path3(r)):n.then(r)),r.pathOk?r:(r instanceof y?(i.yes&&t(i.yes,r,i),i.no&&t(i.no,r,i)):r instanceof g?(i.path1&&t(i.path1,r,i),i.path2&&t(i.path2,r,i),i.path3&&t(i.path3,r,i)):i.next&&t(i.next,r,i),r)}(this.start),f.render()},clean:function(){this.diagram.clean()},options:function(){return this.diagram.options}},m=[],u=0,b=1,_=t.length;b<_;b++)if("\n"===t[b]&&"\\"!==t[b-1]){var v=t.substring(u,b);u=b+1,m.push(v.replace(/\\\n/g,"\n"))}u")<0&&k.indexOf("=>")<0&&k.indexOf("@>")<0?(m[w-1]+="\n"+k,m.splice(w,1),L--):w++}for(;m.length>0;){var B=m.splice(0,1)[0].trim();if(B.indexOf("=>")>=0){var M=B.split("=>"),A={key:M[0].replace(/\(.*\)/,""),symbolType:M[1],text:null,link:null,target:null,flowstate:null,function:null,lineStyle:{},params:{}},O=M[0].match(/\((.*)\)/);if(O&&O.length>1)for(var X=O[1].split(","),T=0;T=0&&(C=A.symbolType.split(": "),A.symbolType=C.shift(),A.text=C.join(": ")),A.text&&A.text.indexOf(":$")>=0?(C=A.text.split(":$"),A.text=C.shift(),A.function=C.join(":$")):A.symbolType.indexOf(":$")>=0?(C=A.symbolType.split(":$"),A.symbolType=C.shift(),A.function=C.join(":$")):A.text&&A.text.indexOf(":>")>=0?(C=A.text.split(":>"),A.text=C.shift(),A.link=C.join(":>")):A.symbolType.indexOf(":>")>=0&&(C=A.symbolType.split(":>"),A.symbolType=C.shift(),A.link=C.join(":>")),A.symbolType.indexOf("\n")>=0&&(A.symbolType=A.symbolType.split("\n")[0]),A.link){var Y=A.link.indexOf("[")+1,P=A.link.indexOf("]");Y>=0&&P>=0&&(A.target=A.link.substring(Y,P),A.link=A.link.substring(0,Y-1))}if(A.text&&A.text.indexOf("|")>=0){var j=A.text.split("|");A.flowstate=j.pop().trim(),A.text=j.join("|")}d.symbols[A.key]=A}else if(B.indexOf("->")>=0){var E=c(B);E&&(B=B.replace("@"+E,""));for(var z=B.split("->"),R=0,F=z.length;R=0){var W=V.split(",");V=W[0],I=W[1].trim()}if(E&&("condition"===G.symbolType?"yes"===V||"true"===V?G.yes_annotation=E:G.no_annotation=E:"parallel"===G.symbolType&&("path1"===V?G.path1_annotation=E:"path2"===V?G.path2_annotation=E:"path3"===V&&(G.path3_annotation=E)),E=null),d.start||(d.start=G),R+1")>=0)for(var q=B.split("@>"),J=0,D=q.length;Jt.right_symbol.getCenter().y&&o<=t.right_symbol.width/2){n=!0;break}}if(n){if("end"===t.right_symbol.symbolType)return;t.right_symbol.setX(s.getX()+s.width+i),e()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render())}if(this.left_symbol){var n=this.getLeft();this.left_symbol.isPositioned||(this.left_symbol.setY(n.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+i)),function e(){for(var s,n=!1,h=0,r=t.chart.symbols.length;ht.left_symbol.getCenter().y&&o<=t.left_symbol.width/2){n=!0;break}}if(n){if("end"===t.left_symbol.symbolType)return;t.left_symbol.setX(s.getX()+s.width+i),e()}}(),this.left_symbol.isPositioned=!0,this.left_symbol.render())}},s.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.yes_annotation?this.yes_annotation:this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.no_annotation?this.no_annotation:this.getAttr("no-text"),this.no_direction)},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e),this.path1_annotation=i.path1_annotation||"",this.path2_annotation=i.path2_annotation||"",this.path3_annotation=i.path3_annotation||"",this.textMargin=this.getAttr("text-margin"),this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top",this.params=i.params,"path1"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path2"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path3"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),i.path1&&i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path1?(this.path2_direction="bottom",this.path1_direction="right",this.path3_direction="top"):"top"===i.direction_path1?(this.path2_direction="right",this.path1_direction="top",this.path3_direction="bottom"):"left"===i.direction_path1?(this.path2_direction="right",this.path1_direction="left",this.path3_direction="bottom"):(this.path2_direction="right",this.path1_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="left",this.path3_direction="right"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="top",this.path3_direction="right"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="left"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):(this.path1_direction=i.direction_path1,this.path2_direction=i.direction_path2,this.path3_direction=i.direction_path3),this.path1_direction=this.path1_direction||"bottom",this.path2_direction=this.path2_direction||"right",this.path3_direction=this.path3_direction||"top",this.initialize()}var n=e(2),h=e(1).inherits;h(s,n),s.prototype.render=function(){this.path1_direction&&(this[this.path1_direction+"_symbol"]=this.path1_symbol),this.path2_direction&&(this[this.path2_direction+"_symbol"]=this.path2_symbol),this.path3_direction&&(this[this.path3_direction+"_symbol"]=this.path3_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var i=this.getBottom();this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(i.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.top_symbol){var e=this.getTop();this.top_symbol.isPositioned||(this.top_symbol.shiftY(this.getY()-this.top_symbol.height-t),this.top_symbol.setX(e.x+this.top_symbol.width),this.top_symbol.isPositioned=!0,this.top_symbol.render())}var s=this;if(this.left_symbol){var n=this.getLeft();this.left_symbol.isPositioned||(this.left_symbol.setY(n.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+t)),function i(){for(var e,n=!1,h=0,r=s.chart.symbols.length;hs.left_symbol.getCenter().y&&o<=s.left_symbol.width/2){n=!0;break}}if(n){if("end"===s.left_symbol.symbolType)return;s.left_symbol.setX(e.getX()+e.width+t),i()}}(),this.left_symbol.isPositioned=!0,this.left_symbol.render())}if(this.right_symbol){var h=this.getRight();this.right_symbol.isPositioned||(this.right_symbol.setY(h.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t),function i(){for(var e,n=!1,h=0,r=s.chart.symbols.length;hs.right_symbol.getCenter().y&&o<=s.right_symbol.width/2){n=!0;break}}if(n){if("end"===s.right_symbol.symbolType)return;s.right_symbol.setX(e.getX()+e.width+t),i()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render())}},s.prototype.renderLines=function(){this.path1_symbol&&this.drawLineTo(this.path1_symbol,this.path1_annotation,this.path1_direction),this.path2_symbol&&this.drawLineTo(this.path2_symbol,this.path2_annotation,this.path2_direction),this.path3_symbol&&this.drawLineTo(this.path3_symbol,this.path3_annotation,this.path3_direction)},t.exports=s},function(t,i,e){function s(t,i){i=i||{},this.paper=new n(t),this.options=h(i,r),this.symbols=[],this.lines=[],this.start=null}var n=e(18),h=e(1).defaults,r=e(8),o=e(5),a=e(6);s.prototype.handle=function(t){this.symbols.indexOf(t)<=-1&&this.symbols.push(t);var i=this;return t instanceof o?(t.yes=function(e){return t.yes_symbol=e,t.no_symbol&&(t.pathOk=!0),i.handle(e)},t.no=function(e){return t.no_symbol=e,t.yes_symbol&&(t.pathOk=!0),i.handle(e)}):t instanceof a?(t.path1=function(e){return t.path1_symbol=e,t.path2_symbol&&(t.pathOk=!0),i.handle(e)},t.path2=function(e){return t.path2_symbol=e,t.path3_symbol&&(t.pathOk=!0),i.handle(e)},t.path3=function(e){return t.path3_symbol=e,t.path1_symbol&&(t.pathOk=!0),i.handle(e)}):t.then=function(e){return t.next=e,t.pathOk=!0,i.handle(e)},t},s.prototype.startWith=function(t){return this.start=t,this.handle(t)},s.prototype.render=function(){var t,i,e=0,s=0,n=0,h=0,r=0,o=0,a=0,l=0;for(n=0,h=this.symbols.length;ne&&(e=t.width),t.height>s&&(s=t.height);for(n=0,h=this.symbols.length;nr&&(r=p),x>o&&(o=x)}for(n=0,h=this.lines.length;nr&&(r=g),f>o&&(o=f)}var c=this.options.scale,d=this.options["line-width"];this.minXFromSymbols>>0;if(0===e)return-1;var s=0;if(arguments.length>0&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s)))),s>=e)return-1;for(var n=s>=0?s:Math.max(e-Math.abs(s),0);n>>0;if(0===e)return-1;var s=e;arguments.length>1&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s))));for(var n=s>=0?Math.min(s,e-1):e-Math.abs(s);n>=0;n--)if(n in i&&i[n]===t)return n;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"End",n.call(this,t,i,e)}var n=e(2),h=e(1).inherits;h(s,n),t.exports=s},function(t,i,e){function s(t,i){i=i||{},n.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,h=this.textMargin,r=s/2,a={x:h,y:r},l=[{x:h-this.textMargin+2*this.textMargin,y:s},{x:h-this.textMargin+e,y:s},{x:h-this.textMargin+e+2*this.textMargin,y:0},{x:h-this.textMargin,y:0},{x:h,y:r}],p=o(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.symbol=p,this.initialize()}var n=e(2),h=e(1).inherits,r=e(3),o=r.drawPath;h(s,n),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){i=i||{},n.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,h=this.textMargin,r=s/2,a={x:h,y:r},l=[{x:h-this.textMargin,y:s},{x:h-this.textMargin+e,y:s},{x:h-this.textMargin+e+2*this.textMargin,y:0},{x:h-this.textMargin+2*this.textMargin,y:0},{x:h,y:r}],p=o(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.symbol=p,this.initialize()}var n=e(2),h=e(1).inherits,r=e(3),o=r.drawPath;h(s,n),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e)}var n=e(2),h=e(1).inherits; h(s,n),t.exports=s},function(t,i,e){function s(t,i){i=i||{},n.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,h=this.textMargin,r=s/2,a={x:h,y:r},l=[{x:h-this.textMargin,y:s},{x:h-this.textMargin+e+2*this.textMargin,y:s},{x:h-this.textMargin+e,y:0},{x:h-this.textMargin+2*this.textMargin,y:0},{x:h,y:r}],p=o(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.symbol=p,this.initialize()}var n=e(2),h=e(1).inherits,r=e(3),o=r.drawPath;h(s,n),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"Start",n.call(this,t,i,e)}var n=e(2),h=e(1).inherits;h(s,n),t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e),e.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var s=t.paper.rect(0,0,0,0);s.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),i.key&&(s.node.id=i.key+"i");var h=this.getAttr("font"),r=this.getAttr("font-family"),o=this.getAttr("font-weight");h&&s.attr({font:h}),r&&s.attr({"font-family":r}),o&&s.attr({"font-weight":o}),i.link&&s.attr("href",i.link),i.target&&s.attr("target",i.target),this.group.push(s),s.insertBefore(this.text),this.initialize()}var n=e(2),h=e(1).inherits;h(s,n),t.exports=s},function(t,i,e){if("undefined"!=typeof jQuery){var s=e(4);!function(t){function i(t,i){return t==i||Array.isArray(i)&&(i.includes(t)||i.includes(Number(t)))}var e={init:function(i){return this.each(function(){var e=t(this);this.chart=s(e.text()),e.html(""),this.chart.drawSVG(this,i)})},setFlowStateByParam:function(t,e,s){return this.each(function(){var n=this.chart,h=["next","yes","no","path1","path2","path3"];for(var r in n.symbols)if(n.symbols.hasOwnProperty(r)){var o=n.symbols[r],a=o.params[t];if(i(a,e)){o.flowstate=s;for(var l=0;l0&&i[i.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]l||t.height>l)&&(t.width>l&&t.height>l?t.width>t.height?(t.height*=l/t.width,t.width=l):(t.width*=l/t.height,t.height=l):t.width>l?(t.height*=l/t.width,t.width=l):(t.width*=l/t.height,t.height=l))}(c),c.style.width="".concat(d),c.style.height="".concat(v),r.backgroundColor&&(a.fillStyle=r.backgroundColor,a.fillRect(0,0,c.width,c.height)),a.drawImage(u,0,0,c.width,c.height),[2,c]}}))}))}t.getFontEmbedCSS=function(t,r){return void 0===r&&(r={}),e(this,void 0,void 0,(function(){return n(this,(function(e){return[2,Y(t,r)]}))}))},t.toBlob=function(t,r){return void 0===r&&(r={}),e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,et(t,r)];case 1:return[4,f(e.sent())];case 2:return[2,e.sent()]}}))}))},t.toCanvas=et,t.toJpeg=function(t,r){return void 0===r&&(r={}),e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,et(t,r)];case 1:return[2,e.sent().toDataURL("image/jpeg",r.quality||1)]}}))}))},t.toPixelData=function(t,r){return void 0===r&&(r={}),e(this,void 0,void 0,(function(){var e,i,o,u;return n(this,(function(n){switch(n.label){case 0:return e=s(t,r),i=e.width,o=e.height,[4,et(t,r)];case 1:return u=n.sent(),[2,u.getContext("2d").getImageData(0,0,i,o).data]}}))}))},t.toPng=function(t,r){return void 0===r&&(r={}),e(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,et(t,r)];case 1:return[2,e.sent().toDataURL()]}}))}))},t.toSvg=tt})); -//# sourceMappingURL=html-to-image.js.map diff --git a/app/stage/protyle/js/protyle-html.js b/app/stage/protyle/js/protyle-html.js index 0469cc12b..13e67a3f5 100644 --- a/app/stage/protyle/js/protyle-html.js +++ b/app/stage/protyle/js/protyle-html.js @@ -1,6 +1,5 @@ /*! @license DOMPurify 3.1.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.1/LICENSE */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=b(Array.prototype.forEach),m=b(Array.prototype.pop),p=b(Array.prototype.push),f=b(String.prototype.toLowerCase),d=b(String.prototype.toString),h=b(String.prototype.match),g=b(String.prototype.replace),T=b(String.prototype.indexOf),_=b(String.prototype.trim),y=b(Object.prototype.hasOwnProperty),E=b(RegExp.prototype.test),A=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function R(e){for(let t=0;t/gm),B=a(/\${[\w\W]*}/gm),W=a(/^data-[\-\w.\u00B7-\uFFFF]/),G=a(/^aria-[\-\w]+$/),Y=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),j=a(/^(?:\w+script|data):/i),X=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q=a(/^html$/i),$=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var K=Object.freeze({__proto__:null,MUSTACHE_EXPR:H,ERB_EXPR:z,TMPLIT_EXPR:B,DATA_ATTR:W,ARIA_ATTR:G,IS_ALLOWED_URI:Y,IS_SCRIPT_OR_DATA:j,ATTR_WHITESPACE:X,DOCTYPE_NAME:q,CUSTOM_ELEMENT:$});const V=function(){return"undefined"==typeof window?null:window},Z=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};var J=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V();const o=e=>t(e);if(o.version="3.1.1",o.removed=[],!n||!n.document||9!==n.document.nodeType)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:b,Element:R,NodeFilter:H,NamedNodeMap:z=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:B,DOMParser:W,trustedTypes:G}=n,j=R.prototype,X=C(j,"cloneNode"),$=C(j,"nextSibling"),J=C(j,"childNodes"),Q=C(j,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let ee,te="";const{implementation:ne,createNodeIterator:oe,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:ae}=a;let le={};o.isSupported="function"==typeof e&&"function"==typeof Q&&ne&&void 0!==ne.createHTMLDocument;const{MUSTACHE_EXPR:ce,ERB_EXPR:se,TMPLIT_EXPR:ue,DATA_ATTR:me,ARIA_ATTR:pe,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:de,CUSTOM_ELEMENT:he}=K;let{IS_ALLOWED_URI:ge}=K,Te=null;const _e=S({},[...v,...L,...D,...x,...M]);let ye=null;const Ee=S({},[...I,...U,...P,...F]);let Ae=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ne=null,be=null,Se=!0,Re=!0,we=!1,Ce=!0,ve=!1,Le=!0,De=!1,Oe=!1,xe=!1,ke=!1,Me=!1,Ie=!1,Ue=!0,Pe=!1;const Fe="user-content-";let He=!0,ze=!1,Be={},We=null;const Ge=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const je=S({},["audio","video","img","source","image","track"]);let Xe=null;const qe=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml";let Ze=Ve,Je=!1,Qe=null;const et=S({},[$e,Ke,Ve],d);let tt=null;const nt=["application/xhtml+xml","text/html"],ot="text/html";let rt=null,it=null;const at=255,lt=r.createElement("form"),ct=function(e){return e instanceof RegExp||e instanceof Function},st=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!it||it!==e){if(e&&"object"==typeof e||(e={}),e=w(e),tt=-1===nt.indexOf(e.PARSER_MEDIA_TYPE)?ot:e.PARSER_MEDIA_TYPE,rt="application/xhtml+xml"===tt?d:f,Te=y(e,"ALLOWED_TAGS")?S({},e.ALLOWED_TAGS,rt):_e,ye=y(e,"ALLOWED_ATTR")?S({},e.ALLOWED_ATTR,rt):Ee,Qe=y(e,"ALLOWED_NAMESPACES")?S({},e.ALLOWED_NAMESPACES,d):et,Xe=y(e,"ADD_URI_SAFE_ATTR")?S(w(qe),e.ADD_URI_SAFE_ATTR,rt):qe,Ye=y(e,"ADD_DATA_URI_TAGS")?S(w(je),e.ADD_DATA_URI_TAGS,rt):je,We=y(e,"FORBID_CONTENTS")?S({},e.FORBID_CONTENTS,rt):Ge,Ne=y(e,"FORBID_TAGS")?S({},e.FORBID_TAGS,rt):{},be=y(e,"FORBID_ATTR")?S({},e.FORBID_ATTR,rt):{},Be=!!y(e,"USE_PROFILES")&&e.USE_PROFILES,Se=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,we=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ve=e.SAFE_FOR_TEMPLATES||!1,Le=!1!==e.SAFE_FOR_XML,De=e.WHOLE_DOCUMENT||!1,ke=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,xe=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,Pe=e.SANITIZE_NAMED_PROPS||!1,He=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,ge=e.ALLOWED_URI_REGEXP||Y,Ze=e.NAMESPACE||Ve,Ae=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ct(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ae.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ct(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ae.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ae.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ve&&(Re=!1),Me&&(ke=!0),Be&&(Te=S({},M),ye=[],!0===Be.html&&(S(Te,v),S(ye,I)),!0===Be.svg&&(S(Te,L),S(ye,U),S(ye,F)),!0===Be.svgFilters&&(S(Te,D),S(ye,U),S(ye,F)),!0===Be.mathMl&&(S(Te,x),S(ye,P),S(ye,F))),e.ADD_TAGS&&(Te===_e&&(Te=w(Te)),S(Te,e.ADD_TAGS,rt)),e.ADD_ATTR&&(ye===Ee&&(ye=w(ye)),S(ye,e.ADD_ATTR,rt)),e.ADD_URI_SAFE_ATTR&&S(Xe,e.ADD_URI_SAFE_ATTR,rt),e.FORBID_CONTENTS&&(We===Ge&&(We=w(We)),S(We,e.FORBID_CONTENTS,rt)),He&&(Te["#text"]=!0),De&&S(Te,["html","head","body"]),Te.table&&(S(Te,["tbody"]),delete Ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw A('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ee=e.TRUSTED_TYPES_POLICY,te=ee.createHTML("")}else void 0===ee&&(ee=Z(G,c)),null!==ee&&"string"==typeof te&&(te=ee.createHTML(""));i&&i(e),it=e}},ut=S({},["mi","mo","mn","ms","mtext"]),mt=S({},["foreignobject","desc","title","annotation-xml"]),pt=S({},["title","style","font","a","script"]),ft=S({},[...L,...D,...O]),dt=S({},[...x,...k]),ht=function(e){let t=Q(e);t&&t.tagName||(t={namespaceURI:Ze,tagName:"template"});const n=f(e.tagName),o=f(t.tagName);return!!Qe[e.namespaceURI]&&(e.namespaceURI===Ke?t.namespaceURI===Ve?"svg"===n:t.namespaceURI===$e?"svg"===n&&("annotation-xml"===o||ut[o]):Boolean(ft[n]):e.namespaceURI===$e?t.namespaceURI===Ve?"math"===n:t.namespaceURI===Ke?"math"===n&&mt[o]:Boolean(dt[n]):e.namespaceURI===Ve?!(t.namespaceURI===Ke&&!mt[o])&&(!(t.namespaceURI===$e&&!ut[o])&&(!dt[n]&&(pt[n]||!ft[n]))):!("application/xhtml+xml"!==tt||!Qe[e.namespaceURI]))},gt=function(e){p(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Tt=function(e,t){try{p(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ye[e])if(ke||Me)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(xe)e=""+e;else{const t=h(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===tt&&Ze===Ve&&(e=''+e+"");const o=ee?ee.createHTML(e):e;if(Ze===Ve)try{t=(new W).parseFromString(o,tt)}catch(e){}if(!t||!t.documentElement){t=ne.createDocument(Ze,"template",null);try{t.documentElement.innerHTML=Je?te:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Ze===Ve?ie.call(t,De?"html":"body")[0]:De?t.documentElement:i},yt=function(e){return oe.call(e.ownerDocument||e,e,H.SHOW_ELEMENT|H.SHOW_COMMENT|H.SHOW_TEXT|H.SHOW_PROCESSING_INSTRUCTION|H.SHOW_CDATA_SECTION,null)},Et=function(e){return e instanceof B&&(void 0!==e.__depth&&"number"!=typeof e.__depth||void 0!==e.__removalCount&&"number"!=typeof e.__removalCount||"string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},At=function(e){return"function"==typeof b&&e instanceof b},Nt=function(e,t,n){le[e]&&u(le[e],(e=>{e.call(o,t,n,it)}))},bt=function(e){let t=null;if(Nt("beforeSanitizeElements",e,null),Et(e))return gt(e),!0;const n=rt(e.nodeName);if(Nt("uponSanitizeElement",e,{tagName:n,allowedTags:Te}),e.hasChildNodes()&&!At(e.firstElementChild)&&E(/<[/\w]/g,e.innerHTML)&&E(/<[/\w]/g,e.textContent))return gt(e),!0;if(7===e.nodeType)return gt(e),!0;if(Le&&8===e.nodeType&&E(/<[/\w]/g,e.data))return gt(e),!0;if(!Te[n]||Ne[n]){if(!Ne[n]&&Rt(n)){if(Ae.tagNameCheck instanceof RegExp&&E(Ae.tagNameCheck,n))return!1;if(Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(n))return!1}if(He&&!We[n]){const t=Q(e)||e.parentNode,n=J(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=X(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,$(e))}}}return gt(e),!0}return e instanceof R&&!ht(e)?(gt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!E(/<\/no(script|embed|frames)/i,e.innerHTML)?(ve&&3===e.nodeType&&(t=e.textContent,u([ce,se,ue],(e=>{t=g(t,e," ")})),e.textContent!==t&&(p(o.removed,{element:e.cloneNode()}),e.textContent=t)),Nt("afterSanitizeElements",e,null),!1):(gt(e),!0)},St=function(e,t,n){if(Ue&&("id"===t||"name"===t)&&(n in r||n in lt))return!1;if(Re&&!be[t]&&E(me,t));else if(Se&&E(pe,t));else if(!ye[t]||be[t]){if(!(Rt(e)&&(Ae.tagNameCheck instanceof RegExp&&E(Ae.tagNameCheck,e)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(e))&&(Ae.attributeNameCheck instanceof RegExp&&E(Ae.attributeNameCheck,t)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(t))||"is"===t&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&E(Ae.tagNameCheck,n)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(n))))return!1}else if(Xe[t]);else if(E(ge,g(n,de,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==T(n,"data:")||!Ye[e]){if(we&&!E(fe,g(n,de,"")));else if(n)return!1}else;return!0},Rt=function(e){return"annotation-xml"!==e&&h(e,he)},wt=function(e){Nt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ye};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=rt(a);let p="value"===a?c:_(c);if(n.attrName=s,n.attrValue=p,n.keepAttr=!0,n.forceKeepAttr=void 0,Nt("uponSanitizeAttribute",e,n),p=n.attrValue,n.forceKeepAttr)continue;if(Tt(a,e),!n.keepAttr)continue;if(!Ce&&E(/\/>/i,p)){Tt(a,e);continue}ve&&u([ce,se,ue],(e=>{p=g(p,e," ")}));const f=rt(e.nodeName);if(St(f,s,p)){if(!Pe||"id"!==s&&"name"!==s||(Tt(a,e),p=Fe+p),ee&&"object"==typeof G&&"function"==typeof G.getAttributeType)if(l);else switch(G.getAttributeType(f,s)){case"TrustedHTML":p=ee.createHTML(p);break;case"TrustedScriptURL":p=ee.createScriptURL(p)}try{l?e.setAttributeNS(l,a,p):e.setAttribute(a,p),m(o.removed)}catch(e){}}}Nt("afterSanitizeAttributes",e,null)},Ct=function e(t){let n=null;const o=yt(t);for(Nt("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)Nt("uponSanitizeShadowNode",n,null),bt(n)||(1===n.nodeType&&(n.parentNode&&n.parentNode.__depth?n.__depth=(n.__removalCount||0)+n.parentNode.__depth+1:n.__depth=1),n.__depth>=at&>(n),n.content instanceof s&&(n.content.__depth=n.__depth,e(n.content)),wt(n));Nt("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(Je=!e,Je&&(e="\x3c!--\x3e"),"string"!=typeof e&&!At(e)){if("function"!=typeof e.toString)throw A("toString is not a function");if("string"!=typeof(e=e.toString()))throw A("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Oe||st(t),o.removed=[],"string"==typeof e&&(ze=!1),ze){if(e.nodeName){const t=rt(e.nodeName);if(!Te[t]||Ne[t])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof b)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!ke&&!ve&&!De&&-1===e.indexOf("<"))return ee&&Ie?ee.createHTML(e):e;if(n=_t(e),!n)return ke?null:Ie?te:""}n&&xe&>(n.firstChild);const c=yt(ze?e:n);for(;i=c.nextNode();)bt(i)||(1===i.nodeType&&(i.parentNode&&i.parentNode.__depth?i.__depth=(i.__removalCount||0)+i.parentNode.__depth+1:i.__depth=1),i.__depth>=at&>(i),i.content instanceof s&&(i.content.__depth=i.__depth,Ct(i.content)),wt(i));if(ze)return e;if(ke){if(Me)for(l=re.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(ye.shadowroot||ye.shadowrootmode)&&(l=ae.call(a,l,!0)),l}let m=De?n.outerHTML:n.innerHTML;return De&&Te["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&E(q,n.ownerDocument.doctype.name)&&(m="\n"+m),ve&&u([ce,se,ue],(e=>{m=g(m,e," ")})),ee&&Ie?ee.createHTML(m):m},o.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};st(e),Oe=!0},o.clearConfig=function(){it=null,Oe=!1},o.isValidAttribute=function(e,t,n){it||st({});const o=rt(e),r=rt(t);return St(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&(le[e]=le[e]||[],p(le[e],t))},o.removeHook=function(e){if(le[e])return m(le[e])},o.removeHooks=function(e){le[e]&&(le[e]=[])},o.removeAllHooks=function(){le={}},o}();return J})); -//# sourceMappingURL=purify.min.js.map class ProtyleHtml extends HTMLElement { constructor() { diff --git a/app/stage/protyle/js/vis/vis-network.min.js b/app/stage/protyle/js/vis/vis-network.min.js index ecbdaeba7..5956ef919 100644 --- a/app/stage/protyle/js/vis/vis-network.min.js +++ b/app/stage/protyle/js/vis/vis-network.min.js @@ -46,4 +46,3 @@ function Pc(){return Pc=Object.assign||function(g){for(var t=1;t=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function dO(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&void 0!==arguments[0]?arguments[0]:function(){};Us(this,g),IO.set(this,new lO),iO.set(this,new lO),oO.set(this,void 0),sO(this,oO,t,"f")}return Xs(g,[{key:"sizeNodes",get:function(){return rO(this,IO,"f").size}},{key:"sizeEdges",get:function(){return rO(this,iO,"f").size}},{key:"getNodes",value:function(){return rO(this,IO,"f").getSelection()}},{key:"getEdges",value:function(){return rO(this,iO,"f").getSelection()}},{key:"addNodes",value:function(){var g;(g=rO(this,IO,"f")).add.apply(g,arguments)}},{key:"addEdges",value:function(){var g;(g=rO(this,iO,"f")).add.apply(g,arguments)}},{key:"deleteNodes",value:function(g){rO(this,IO,"f").delete(g)}},{key:"deleteEdges",value:function(g){rO(this,iO,"f").delete(g)}},{key:"clear",value:function(){rO(this,IO,"f").clear(),rO(this,iO,"f").clear()}},{key:"commit",value:function(){for(var g,t,A={nodes:rO(this,IO,"f").commit(),edges:rO(this,iO,"f").commit()},e=arguments.length,C=new Array(e),I=0;I=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function pO(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A4&&void 0!==arguments[4]&&arguments[4],I=this._initBaseEvent(t,A);if(!0===C)I.nodes=[],I.edges=[];else{var i=this.getSelection();I.nodes=i.nodes,I.edges=i.edges}void 0!==e&&(I.previousSelection=e),"click"==g&&(I.items=this.getClickedItems(A)),void 0!==t.controlEdge&&(I.controlEdge=t.controlEdge),this.body.emitter.emit(g,I)}},{key:"selectObject",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.selectConnectedEdges;if(void 0!==g){if(g instanceof Qk){var A;if(!0===t)(A=this._selectionAccumulator).addEdges.apply(A,gd(g.edges));this._selectionAccumulator.addNodes(g)}else this._selectionAccumulator.addEdges(g);return!0}return!1}},{key:"deselectObject",value:function(g){!0===g.isSelected()&&(g.selected=!1,this._removeFromSelection(g))}},{key:"_getAllNodesOverlappingWith",value:function(g){for(var t=[],A=this.body.nodes,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this._pointerToPositionObject(g),e=this._getAllNodesOverlappingWith(A);return e.length>0?!0===t?this.body.nodes[e[e.length-1]]:e[e.length-1]:void 0}},{key:"_getEdgesOverlappingWith",value:function(g,t){for(var A=this.body.edges,e=0;e1&&void 0!==arguments[1])||arguments[1],A=this.canvas.DOMtoCanvas(g),e=10,C=null,I=this.body.edges,i=0;i0&&(this.generateClickEvent("deselectEdge",t,g,C),A=!0),e.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,g,C),A=!0),e.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,g),A=!0),e.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,g),A=!0),!0===A&&this.generateClickEvent("select",t,g)}},{key:"getSelection",value:function(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}},{key:"getSelectedNodes",value:function(){return this._selectionAccumulator.getNodes()}},{key:"getSelectedEdges",value:function(){return this._selectionAccumulator.getEdges()}},{key:"getSelectedNodeIds",value:function(){var g;return pd(g=this._selectionAccumulator.getNodes()).call(g,(function(g){return g.id}))}},{key:"getSelectedEdgeIds",value:function(){var g;return pd(g=this._selectionAccumulator.getEdges()).call(g,(function(g){return g.id}))}},{key:"setSelection",value:function(g){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!g||!g.nodes&&!g.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||void 0===t.unselectAll)&&this.unselectAll(),g.nodes){var A,e=uO(g.nodes);try{for(e.s();!(A=e.n()).done;){var C=A.value,I=this.body.nodes[C];if(!I)throw new RangeError('Node with id "'+C+'" not found');this.selectObject(I,t.highlightEdges)}}catch(g){e.e(g)}finally{e.f()}}if(g.edges){var i,o=uO(g.edges);try{for(o.s();!(i=o.n()).done;){var n=i.value,r=this.body.edges[n];if(!r)throw new RangeError('Edge with id "'+n+'" not found');this.selectObject(r)}}catch(g){o.e(g)}finally{o.f()}}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}},{key:"selectNodes",value:function(g){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({nodes:g},{highlightEdges:t})}},{key:"selectEdges",value:function(g){if(!g||void 0===g.length)throw"Selection must be an array with ids";this.setSelection({edges:g})}},{key:"updateSelection",value:function(){for(var g in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,g.id)||this._selectionAccumulator.deleteNodes(g);for(var t in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,t.id)||this._selectionAccumulator.deleteEdges(t)}},{key:"getClickedItems",value:function(g){for(var t=this.canvas.DOMtoCanvas(g),A=[],e=this.body.nodeIndices,C=this.body.nodes,I=e.length-1;I>=0;I--){var i=C[e[I]].getItemsOnPoint(t);A.push.apply(A,i)}for(var o=this.body.edgeIndices,n=this.body.edges,r=o.length-1;r>=0;r--){var s=n[o[r]].getItemsOnPoint(t);A.push.apply(A,s)}return A}}]),g}(),vO={};!function(g){!function(g){function t(g,t){if(!(g instanceof t))throw new TypeError("Cannot call a class as a function")}g.__esModule=!0,g.sort=c;var A=32,e=7,C=256,I=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9];function i(g){return g<1e5?g<100?g<10?0:1:g<1e4?g<1e3?2:3:4:g<1e7?g<1e6?5:6:g<1e9?g<1e8?7:8:9}function o(g,t){if(g===t)return 0;if(~~g===g&&~~t===t){if(0===g||0===t)return g=0)return-1;if(g>=0)return 1;g=-g,t=-t}var A=i(g),e=i(t),C=0;return Ae&&(t*=I[A-e-1],g/=10,C=1),g===t?C:g=A;)t|=1&g,g>>=1;return g+t}function r(g,t,A,e){var C=t+1;if(C===A)return 1;if(e(g[C++],g[t])<0){for(;C=0;)C++;return C-t}function s(g,t,A){for(A--;t>>1;C(I,g[n])<0?o=n:i=n+1}var r=e-i;switch(r){case 3:g[i+3]=g[i+2];case 2:g[i+2]=g[i+1];case 1:g[i+1]=g[i];break;default:for(;r>0;)g[i+r]=g[i+r-1],r--}g[i]=I}}function d(g,t,A,e,C,I){var i=0,o=0,n=1;if(I(g,t[A+C])>0){for(o=e-C;n0;)i=n,(n=1+(n<<1))<=0&&(n=o);n>o&&(n=o),i+=C,n+=C}else{for(o=C+1;no&&(n=o);var r=i;i=C-n,n=C-r}for(i++;i>>1);I(g,t[A+s])>0?i=s+1:n=s}return n}function h(g,t,A,e,C,I){var i=0,o=0,n=1;if(I(g,t[A+C])<0){for(o=C+1;no&&(n=o);var r=i;i=C-n,n=C-r}else{for(o=e-C;n=0;)i=n,(n=1+(n<<1))<=0&&(n=o);n>o&&(n=o),i+=C,n+=C}for(i++;i>>1);I(g,t[A+s])<0?n=s:i=s+1}return n}var l=function(){function g(A,I){t(this,g),this.array=null,this.compare=null,this.minGallop=e,this.length=0,this.tmpStorageLength=C,this.stackLength=0,this.runStart=null,this.runLength=null,this.stackSize=0,this.array=A,this.compare=I,this.length=A.length,this.length<2*C&&(this.tmpStorageLength=this.length>>>1),this.tmp=new Array(this.tmpStorageLength),this.stackLength=this.length<120?5:this.length<1542?10:this.length<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength)}return g.prototype.pushRun=function(g,t){this.runStart[this.stackSize]=g,this.runLength[this.stackSize]=t,this.stackSize+=1},g.prototype.mergeRuns=function(){for(;this.stackSize>1;){var g=this.stackSize-2;if(g>=1&&this.runLength[g-1]<=this.runLength[g]+this.runLength[g+1]||g>=2&&this.runLength[g-2]<=this.runLength[g]+this.runLength[g-1])this.runLength[g-1]this.runLength[g+1])break;this.mergeAt(g)}},g.prototype.forceMergeRuns=function(){for(;this.stackSize>1;){var g=this.stackSize-2;g>0&&this.runLength[g-1]=e||u>=e);if(p)break;l<0&&(l=0),l+=2}if(this.minGallop=l,l<1&&(this.minGallop=1),1===t){for(n=0;n=0;n--)i[c+n]=i[l+n];if(0===t){v=!0;break}}if(i[a--]=o[s--],1==--C){v=!0;break}if(0!=(f=C-d(i[r],o,0,C,C-1,I))){for(C-=f,c=1+(a-=f),l=1+(s-=f),n=0;n=e||f>=e);if(v)break;u<0&&(u=0),u+=2}if(this.minGallop=u,u<1&&(this.minGallop=1),1===C){for(c=1+(a-=t),l=1+(r-=t),n=t-1;n>=0;n--)i[c+n]=i[l+n];i[a]=o[s]}else{if(0===C)throw new Error("mergeHigh preconditions were not respected");for(l=a-(C-1),n=0;n=0;n--)i[c+n]=i[l+n];i[a]=o[s]}else for(l=a-(C-1),n=0;nd&&(h=d),a(g,e,e+h,e+i,t),i=h}s.pushRun(e,i),s.mergeRuns(),I-=i,e+=i}while(0!==I);s.forceMergeRuns()}}}}(g)}(vO);var yO=vO;function mO(g){var t=function(){if("undefined"==typeof Reflect||!om)return!1;if(om.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(om(Boolean,[],(function(){}))),!0}catch(g){return!1}}();return function(){var A,e=cm(g);if(t){var C=cm(this).constructor;A=om(e,arguments,C)}else A=e.apply(this,arguments);return hm(this,A)}}var bO=function(){function g(){Us(this,g)}return Xs(g,[{key:"abstract",value:function(){throw new Error("Can't instantiate abstract class!")}},{key:"fake_use",value:function(){}},{key:"curveType",value:function(){return this.abstract()}},{key:"getPosition",value:function(g){return this.fake_use(g),this.abstract()}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.fake_use(g,t,A),this.abstract()}},{key:"getTreeSize",value:function(g){return this.fake_use(g),this.abstract()}},{key:"sort",value:function(g){this.fake_use(g),this.abstract()}},{key:"fix",value:function(g,t){this.fake_use(g,t),this.abstract()}},{key:"shift",value:function(g,t){this.fake_use(g,t),this.abstract()}}]),g}(),wO=function(g){dm(A,g);var t=mO(A);function A(g){var e;return Us(this,A),(e=t.call(this)).layout=g,e}return Xs(A,[{key:"curveType",value:function(){return"horizontal"}},{key:"getPosition",value:function(g){return g.x}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.x=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_x,max:t.max_x}}},{key:"sort",value:function(g){yO.sort(g,(function(g,t){return g.x-t.x}))}},{key:"fix",value:function(g,t){g.y=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.y=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].x+=t}}]),A}(bO),kO=function(g){dm(A,g);var t=mO(A);function A(g){var e;return Us(this,A),(e=t.call(this)).layout=g,e}return Xs(A,[{key:"curveType",value:function(){return"vertical"}},{key:"getPosition",value:function(g){return g.y}},{key:"setPosition",value:function(g,t){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0!==A&&this.layout.hierarchical.addToOrdering(g,A),g.y=t}},{key:"getTreeSize",value:function(g){var t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,g);return{min:t.min_y,max:t.max_y}}},{key:"sort",value:function(g){yO.sort(g,(function(g,t){return g.y-t.y}))}},{key:"fix",value:function(g,t){g.x=this.layout.options.hierarchical.levelSeparation*t,g.options.fixed.x=!0}},{key:"shift",value:function(g,t){this.layout.body.nodes[g].y+=t}}]),A}(bO),xO=Yn.every;bA({target:"Array",proto:!0,forced:!Od("every")},{every:function(g){return xO(this,g,arguments.length>1?arguments[1]:void 0)}});var EO=Oe("Array").every,OO=$,TO=EO,DO=Array.prototype,NO=function(g){var t=g.every;return g===DO||OO(DO,g)&&t===DO.every?TO:t},RO=NO;function PO(g,t){var A=void 0!==td&&An(g)||g["@@iterator"];if(!A){if(sd(g)||(A=function(g,t){var A;if(!g)return;if("string"==typeof g)return MO(g,t);var e=nd(A=Object.prototype.toString.call(g)).call(A,8,-1);"Object"===e&&g.constructor&&(e=g.constructor.name);if("Map"===e||"Set"===e)return Fo(g);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MO(g,t)}(g))||t&&g&&"number"==typeof g.length){A&&(g=A);var e=0,C=function(){};return{s:C,n:function(){return e>=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function MO(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A=t[e])&&(t[e]=t[A]+1)})),t}function zO(g,t,A,e){var C,I,i=Vl(null),o=Bm(C=gd($b(e).call(e))).call(C,(function(g,t){return g+1+t.edges.length}),0),n=A+"Id",r="to"===A?1:-1,s=PO(e);try{var a=function(){var C=Xa(I.value,2),s=C[0],a=C[1];if(!e.has(s)||!g(a))return"continue";i[s]=0;for(var d=[a],h=0,l=void 0,c=function(){var g,C;if(!e.has(s))return"continue";var I=i[l.id]+r;if(Sd(g=Uh(C=l.edges).call(C,(function(g){return g.connected&&g.to!==g.from&&g[A]!==l&&e.has(g.toId)&&e.has(g.fromId)}))).call(g,(function(g){var e=g[n],C=i[e];(null==C||t(I,C))&&(i[e]=I,d.push(g[A]))})),h>o)return{v:{v:BO(e,i)}};++h};l=d.pop();){var u=c();if("continue"!==u&&"object"===$a(u))return u.v}};for(s.s();!(I=s.n()).done;){var d=a();if("continue"!==d&&"object"===$a(d))return d.v}}catch(g){s.e(g)}finally{s.f()}return i}var ZO=function(){function g(){Us(this,g),this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}return Xs(g,[{key:"addRelation",value:function(g,t){void 0===this.childrenReference[g]&&(this.childrenReference[g]=[]),this.childrenReference[g].push(t),void 0===this.parentReference[t]&&(this.parentReference[t]=[]),this.parentReference[t].push(g)}},{key:"checkIfTree",value:function(){for(var g in this.parentReference)if(this.parentReference[g].length>1)return void(this.isTree=!1);this.isTree=!0}},{key:"numTrees",value:function(){return this.treeIndex+1}},{key:"setTreeIndex",value:function(g,t){void 0!==t&&void 0===this.trees[g.id]&&(this.trees[g.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}},{key:"ensureLevel",value:function(g){void 0===this.levels[g]&&(this.levels[g]=0)}},{key:"getMaxLevel",value:function(g){var t=this,A={};return function g(e){if(void 0!==A[e])return A[e];var C=t.levels[e];if(t.childrenReference[e]){var I=t.childrenReference[e];if(I.length>0)for(var i=0;i0&&(A.levelSeparation*=-1):A.levelSeparation<0&&(A.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(!0===e)return this.body.emitter.emit("refresh"),Wp(t,this.optionsBackup)}return t}},{key:"_resetRNG",value:function(g){this.initialRandomSeed=g,this._rng=Tp(this.initialRandomSeed)}},{key:"adaptAllOptionsForHierarchicalLayout",value:function(g){if(!0===this.options.hierarchical.enabled){var t=this.optionsBackup.physics;void 0===g.physics||!0===g.physics?(g.physics={enabled:void 0===t.enabled||t.enabled,solver:"hierarchicalRepulsion"},t.enabled=void 0===t.enabled||t.enabled,t.solver=t.solver||"barnesHut"):"object"===$a(g.physics)?(t.enabled=void 0===g.physics.enabled||g.physics.enabled,t.solver=g.physics.solver||"barnesHut",g.physics.solver="hierarchicalRepulsion"):!1!==g.physics&&(t.solver="barnesHut",g.physics={solver:"hierarchicalRepulsion"});var A=this.direction.curveType();if(void 0===g.edges)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges={smooth:!1};else if(void 0===g.edges.smooth)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},g.edges.smooth=!1;else if("boolean"==typeof g.edges.smooth)this.optionsBackup.edges={smooth:g.edges.smooth},g.edges.smooth={enabled:g.edges.smooth,type:A};else{var e=g.edges.smooth;void 0!==e.type&&"dynamic"!==e.type&&(A=e.type),this.optionsBackup.edges={smooth:{enabled:void 0===e.enabled||e.enabled,type:void 0===e.type?"dynamic":e.type,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}},g.edges.smooth={enabled:void 0===e.enabled||e.enabled,type:A,roundness:void 0===e.roundness?.5:e.roundness,forceDirection:void 0!==e.forceDirection&&e.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",A)}return g}},{key:"positionInitially",value:function(g){if(!0!==this.options.hierarchical.enabled){this._resetRNG(this.initialRandomSeed);for(var t=g.length+50,A=0;AC){for(var i=g.length;g.length>C&&e<=10;){e+=1;var o=g.length;if(e%3==0?this.body.modules.clustering.clusterBridges(I):this.body.modules.clustering.clusterOutliers(I),o==g.length&&e%3!=0)return this._declusterAll(),this.body.emitter.emit("_layoutFailed"),void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.")}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*i)})}e>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(g,this.body.edgeIndices,!0),this._shiftToCenter();for(var n=0;n0){var g,t,A=!1,e=!1;for(t in this.lastNodeOnLevel={},this.hierarchical=new ZO,this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(void 0!==(g=this.body.nodes[t]).options.level?(A=!0,this.hierarchical.levels[t]=g.options.level):e=!0);if(!0===e&&!0===A)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");if(!0===e){var C=this.options.hierarchical.sortMethod;"hubsize"===C?this._determineLevelsByHubsize():"directed"===C?this._determineLevelsDirected():"custom"===C&&this._determineLevelsCustomCallback()}for(var I in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,I)&&this.hierarchical.ensureLevel(I);var i=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(i),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var g=this,t=!1,A={},e=function(t,A){var e=g.hierarchical.trees;for(var C in e)Object.prototype.hasOwnProperty.call(e,C)&&e[C]===t&&g.direction.shift(C,A)},C=function(){for(var t=[],A=0;A0)for(var I=0;I1&&void 0!==arguments[1]?arguments[1]:1e9,e=1e9,C=1e9,I=1e9,i=-1e9;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var n=g.body.nodes[o],r=g.hierarchical.levels[n.id],s=g.direction.getPosition(n),a=g._getSpaceAroundNode(n,t),d=Xa(a,2),h=d[0],l=d[1];e=Math.min(h,e),C=Math.min(l,C),r<=A&&(I=Math.min(s,I),i=Math.max(s,i))}return[I,i,e,C]},o=function(t,A){var e=g.hierarchical.getMaxLevel(t.id),C=g.hierarchical.getMaxLevel(A.id);return Math.min(e,C)},n=function(t,A,e){for(var C=g.hierarchical,I=0;I1)for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],n=g.direction.getPosition(A),r=g.direction.getPosition(e),s=Math.abs(r-n),a=g.options.hierarchical.nodeSpacing;if(s>a){var d={},h={};I(A,d),I(e,h);var l=o(A,e),c=i(d,l),u=i(h,l),p=c[1],f=u[0],v=u[2],y=Math.abs(p-f);if(y>a){var m=p-f+a;m<-v+a&&(m=-v+a),m<0&&(g._shiftBlock(e.id,m),t=!0,!0===C&&g._centerParent(e))}}},s=function(e,C){for(var o=C.id,n=C.edges,r=g.hierarchical.levels[C.id],s=g.options.hierarchical.levelSeparation*g.options.hierarchical.levelSeparation,a={},d=[],h=0;h0?h=Math.min(d,a-g.options.hierarchical.nodeSpacing):d<0&&(h=-Math.min(-d,s-g.options.hierarchical.nodeSpacing)),0!=h&&(g._shiftBlock(C.id,h),t=!0)}(v),function(A){var e=g.direction.getPosition(C),I=Xa(g._getSpaceAroundNode(C),2),i=I[0],o=I[1],n=A-e,r=e;n>0?r=Math.min(e+(o-g.options.hierarchical.nodeSpacing),A):n<0&&(r=Math.max(e-(i-g.options.hierarchical.nodeSpacing),A)),r!==e&&(g.direction.setPosition(C,r),t=!0)}(v=f(e,n))};!0===this.options.hierarchical.blockShifting&&(function(A){var e=g.hierarchical.getLevels();e=Ud(e).call(e);for(var C=0;C0&&Math.abs(a)0&&(n=this.direction.getPosition(e[I-1])+o),this.direction.setPosition(i,n,t),this._validatePositionAndContinue(i,t,n),C++}}}}},{key:"_placeBranchNodes",value:function(g,t){var A,e=this.hierarchical.childrenReference[g];if(void 0!==e){for(var C=[],I=0;It&&void 0===this.positionedNodes[o.id]))return;var r=this.options.hierarchical.nodeSpacing,s=void 0;s=0===i?this.direction.getPosition(this.body.nodes[g]):this.direction.getPosition(C[i-1])+r,this.direction.setPosition(o,s,n),this._validatePositionAndContinue(o,n,s)}var a=this._getCenterPosition(C);this.direction.setPosition(this.body.nodes[g],a,t)}}},{key:"_validatePositionAndContinue",value:function(g,t,A){if(this.hierarchical.isTree){if(void 0!==this.lastNodeOnLevel[t]){var e=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(A-eg}),"from",g)}(A),this.hierarchical.setMinLevelToZero(this.body.nodes)}},{key:"_generateMap",value:function(){var g=this;this._crawlNetwork((function(t,A){g.hierarchical.levels[A.id]>g.hierarchical.levels[t.id]&&g.hierarchical.addRelation(t.id,A.id)})),this.hierarchical.checkIfTree()}},{key:"_crawlNetwork",value:function(){var g=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},A=arguments.length>1?arguments[1]:void 0,e={},C=function A(C,I){if(void 0===e[C.id]){var i;g.hierarchical.setTreeIndex(C,I),e[C.id]=!0;for(var o=g._getActiveEdges(C),n=0;n=g.length?{done:!0}:{done:!1,value:g[e++]}},e:function(g){throw g},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var I,i=!0,o=!1;return{s:function(){A=A.call(g)},n:function(){var g=A.next();return i=g.done,g},e:function(g){o=!0,I=g},f:function(){try{i||null==A.return||A.return()}finally{if(o)throw I}}}}function GO(g,t){(null==t||t>g.length)&&(t=g.length);for(var A=0,e=new Array(t);A0&&!1!==this.options.deleteNode||0===A&&!1!==this.options.deleteEdge)&&(!0===i&&this._createSeperator(4),this._createDeleteButton(I)),this._bindElementEvents(this.closeDiv,Me(g=this.toggleEditMode).call(g,this)),this._temporaryBindEvent("select",Me(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}},{key:"addNodeMode",value:function(){var g;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addNode",!0===this.guiEnabled){var t,A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,Me(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",Me(g=this._performAddNode).call(g,this))}},{key:"editNode",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean();var t=this.selectionHandler.getSelectedNodes()[0];if(void 0!==t){if(this.inMode="editNode","function"!=typeof this.options.editNode)throw new Error("No function has been configured to handle the editing of nodes.");if(!0!==t.isCluster){var A=Wp({},t.options,!1);if(A.x=t.x,A.y=t.y,2!==this.options.editNode.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editNode(A,(function(t){null!=t&&"editNode"===g.inMode&&g.body.data.nodes.getDataSet().update(t),g.showManipulatorToolbar()}))}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError)}else this.showManipulatorToolbar()}},{key:"addEdgeMode",value:function(){var g,t,A,e,C;if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="addEdge",!0===this.guiEnabled){var I,i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,Me(I=this.toggleEditMode).call(I,this))}this._temporaryBindUI("onTouch",Me(g=this._handleConnect).call(g,this)),this._temporaryBindUI("onDragEnd",Me(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",Me(A=this._dragControlNode).call(A,this)),this._temporaryBindUI("onRelease",Me(e=this._finishConnect).call(e,this)),this._temporaryBindUI("onDragStart",Me(C=this._dragStartEdge).call(C,this)),this._temporaryBindUI("onHold",(function(){}))}},{key:"editEdgeMode",value:function(){if(!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="editEdge","object"!==$a(this.options.editEdge)||"function"!=typeof this.options.editEdge.editWithoutDrag||(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0===this.edgeBeingEditedId)){if(!0===this.guiEnabled){var g,t=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(t),this._createSeperator(),this._createDescription(t.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,Me(g=this.toggleEditMode).call(g,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],void 0!==this.edgeBeingEditedId){var A,e,C,I,i=this.body.edges[this.edgeBeingEditedId],o=this._getNewTargetNode(i.from.x,i.from.y),n=this._getNewTargetNode(i.to.x,i.to.y);this.temporaryIds.nodes.push(o.id),this.temporaryIds.nodes.push(n.id),this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id),this.body.nodes[n.id]=n,this.body.nodeIndices.push(n.id),this._temporaryBindUI("onTouch",Me(A=this._controlNodeTouch).call(A,this)),this._temporaryBindUI("onTap",(function(){})),this._temporaryBindUI("onHold",(function(){})),this._temporaryBindUI("onDragStart",Me(e=this._controlNodeDragStart).call(e,this)),this._temporaryBindUI("onDrag",Me(C=this._controlNodeDrag).call(C,this)),this._temporaryBindUI("onDragEnd",Me(I=this._controlNodeDragEnd).call(I,this)),this._temporaryBindUI("onMouseMove",(function(){})),this._temporaryBindEvent("beforeDrawing",(function(g){var t=i.edgeType.findBorderPositions(g);!1===o.selected&&(o.x=t.from.x,o.y=t.from.y),!1===n.selected&&(n.x=t.to.x,n.y=t.to.y)})),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}else{var r=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(r.from.id,r.to.id)}}},{key:"deleteSelected",value:function(){var g=this;!0!==this.editMode&&this.enableEditMode(),this._clean(),this.inMode="delete";var t=this.selectionHandler.getSelectedNodeIds(),A=this.selectionHandler.getSelectedEdgeIds(),e=void 0;if(t.length>0){for(var C=0;C0&&"function"==typeof this.options.deleteEdge&&(e=this.options.deleteEdge);if("function"==typeof e){var I={nodes:t,edges:A};if(2!==e.length)throw new Error("The function for delete does not support two arguments (data, callback)");e(I,(function(t){null!=t&&"delete"===g.inMode?(g.body.data.edges.getDataSet().remove(t.edges),g.body.data.nodes.getDataSet().remove(t.nodes),g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar()):(g.body.emitter.emit("startSimulation"),g.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().remove(A),this.body.data.nodes.getDataSet().remove(t),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}},{key:"_setup",value:function(){!0===this.options.enabled?(this.guiEnabled=!0,this._createWrappers(),!1===this.editMode?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}},{key:"_createWrappers",value:function(){var g,t;(void 0===this.manipulationDiv&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",!0===this.editMode?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),void 0===this.editModeDiv&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",!0===this.editMode?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),void 0===this.closeDiv)&&(this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",null!==(g=null===(t=this.options.locales[this.options.locale])||void 0===t?void 0:t.close)&&void 0!==g?g:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv))}},{key:"_getNewTargetNode",value:function(g,t){var A=Wp({},this.options.controlNodeStyle);A.id="targetNode"+cw(),A.hidden=!1,A.physics=!1,A.x=g,A.y=t;var e=this.body.functions.createNode(A);return e.shape.boundingBox={left:g,right:g,top:t,bottom:t},e}},{key:"_createEditButton",value:function(){var g;this._clean(),this.manipulationDOM={},Sp(this.editModeDiv);var t=this.options.locales[this.options.locale],A=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(A),this._bindElementEvents(A,Me(g=this.toggleEditMode).call(g,this))}},{key:"_clean",value:function(){this.inMode=!1,!0===this.guiEnabled&&(Sp(this.editModeDiv),Sp(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}},{key:"_cleanupDOMEventListeners",value:function(){var g,t,A=FO(hh(g=this._domEventListenerCleanupQueue).call(g,0));try{for(A.s();!(t=A.n()).done;){(0,t.value)()}}catch(g){A.e(g)}finally{A.f()}}},{key:"_removeManipulationDOM",value:function(){this._clean(),Sp(this.manipulationDiv),Sp(this.editModeDiv),Sp(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}},{key:"_createSeperator",value:function(){var g=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+g]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+g].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+g])}},{key:"_createAddNodeButton",value:function(g){var t,A=this._createButton("addNode","vis-add",g.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,Me(t=this.addNodeMode).call(t,this))}},{key:"_createAddEdgeButton",value:function(g){var t,A=this._createButton("addEdge","vis-connect",g.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,Me(t=this.addEdgeMode).call(t,this))}},{key:"_createEditNodeButton",value:function(g){var t,A=this._createButton("editNode","vis-edit",g.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,Me(t=this.editNode).call(t,this))}},{key:"_createEditEdgeButton",value:function(g){var t,A=this._createButton("editEdge","vis-edit",g.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,Me(t=this.editEdgeMode).call(t,this))}},{key:"_createDeleteButton",value:function(g){var t,A;A=this.options.rtl?"vis-delete-rtl":"vis-delete";var e=this._createButton("delete",A,g.del||this.options.locales.en.del);this.manipulationDiv.appendChild(e),this._bindElementEvents(e,Me(t=this.deleteSelected).call(t,this))}},{key:"_createBackButton",value:function(g){var t,A=this._createButton("back","vis-back",g.back||this.options.locales.en.back);this.manipulationDiv.appendChild(A),this._bindElementEvents(A,Me(t=this.showManipulatorToolbar).call(t,this))}},{key:"_createButton",value:function(g,t,A){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vis-label";return this.manipulationDOM[g+"Div"]=document.createElement("button"),this.manipulationDOM[g+"Div"].className="vis-button "+t,this.manipulationDOM[g+"Label"]=document.createElement("div"),this.manipulationDOM[g+"Label"].className=e,this.manipulationDOM[g+"Label"].innerText=A,this.manipulationDOM[g+"Div"].appendChild(this.manipulationDOM[g+"Label"]),this.manipulationDOM[g+"Div"]}},{key:"_createDescription",value:function(g){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=g,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}},{key:"_temporaryBindEvent",value:function(g,t){this.temporaryEventFunctions.push({event:g,boundFunction:t}),this.body.emitter.on(g,t)}},{key:"_temporaryBindUI",value:function(g,t){if(void 0===this.body.eventListeners[g])throw new Error("This UI function does not exist. Typo? You tried: "+g+" possible are: "+rc(yd(this.body.eventListeners)));this.temporaryUIFunctions[g]=this.body.eventListeners[g],this.body.eventListeners[g]=t}},{key:"_unbindTemporaryUIs",value:function(){for(var g in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,g)&&(this.body.eventListeners[g]=this.temporaryUIFunctions[g],delete this.temporaryUIFunctions[g]);this.temporaryUIFunctions={}}},{key:"_unbindTemporaryEvents",value:function(){for(var g=0;g=0;i--)if(C[i]!==this.selectedControlNode.id){I=this.body.nodes[C[i]];break}if(void 0!==I&&void 0!==this.selectedControlNode)if(!0===I.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var o=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===o.id?this._performEditEdge(I.id,e.to.id):this._performEditEdge(e.from.id,I.id)}else e.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}}},{key:"_handleConnect",value:function(g){if((new Date).valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(g.center),this.lastTouch.translation=ae({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;var t=this.lastTouch,A=this.selectionHandler.getNodeAt(t);if(void 0!==A)if(!0===A.isCluster)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{var e=this._getNewTargetNode(A.x,A.y);this.body.nodes[e.id]=e,this.body.nodeIndices.push(e.id);var C=this.body.functions.createEdge({id:"connectionEdge"+cw(),from:A.id,to:e.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[C.id]=C,this.body.edgeIndices.push(C.id),this.temporaryIds.nodes.push(e.id),this.temporaryIds.edges.push(C.id)}this.touchTime=(new Date).valueOf()}}},{key:"_dragControlNode",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===zl(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}if(g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",g,t),void 0!==this.temporaryIds.nodes[0]){var n=this.body.nodes[this.temporaryIds.nodes[0]];n.x=this.canvas._XconvertDOMtoCanvas(t.x),n.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(g)}},{key:"_finishConnect",value:function(g){var t=this.body.functions.getPointer(g.center),A=this.selectionHandler._pointerToPositionObject(t),e=void 0;void 0!==this.temporaryIds.edges[0]&&(e=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var C=this.selectionHandler._getAllNodesOverlappingWith(A),I=void 0,i=C.length-1;i>=0;i--){var o;if(-1===zl(o=this.temporaryIds.nodes).call(o,C[i])){I=this.body.nodes[C[i]];break}}this._cleanupTemporaryNodesAndEdges(),void 0!==I&&(!0===I.isCluster?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[e]&&void 0!==this.body.nodes[I.id]&&this._performAddEdge(e,I.id)),g.controlEdge={from:e,to:I?I.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",g,t),this.body.emitter.emit("_redraw")}},{key:"_dragStartEdge",value:function(g){var t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",g,t,void 0,!0)}},{key:"_performAddNode",value:function(g){var t=this,A={id:cw(),x:g.pointer.canvas.x,y:g.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(A,(function(g){null!=g&&"addNode"===t.inMode&&t.body.data.nodes.getDataSet().add(g),t.showManipulatorToolbar()}))}else this.body.data.nodes.getDataSet().add(A),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(g,t){var A=this,e={from:g,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(e,(function(g){null!=g&&"addEdge"===A.inMode&&(A.body.data.edges.getDataSet().add(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().add(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(g,t){var A=this,e={id:this.edgeBeingEditedId,from:g,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label},C=this.options.editEdge;if("object"===$a(C)&&(C=C.editWithoutDrag),"function"==typeof C){if(2!==C.length)throw new Error("The function for edit does not support two arguments (data, callback)");C(e,(function(g){null==g||"editEdge"!==A.inMode?(A.body.edges[e.id].updateEdgeType(),A.body.emitter.emit("_redraw"),A.showManipulatorToolbar()):(A.body.data.edges.getDataSet().update(g),A.selectionHandler.unselectAll(),A.showManipulatorToolbar())}))}else this.body.data.edges.getDataSet().update(e),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),g}(),jO="string",VO="boolean",YO="number",WO="array",QO="object",_O=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],UO={borderWidth:{number:YO},borderWidthSelected:{number:YO,undefined:"undefined"},brokenImage:{string:jO,undefined:"undefined"},chosen:{label:{boolean:VO,function:"function"},node:{boolean:VO,function:"function"},__type__:{object:QO,boolean:VO}},color:{border:{string:jO},background:{string:jO},highlight:{border:{string:jO},background:{string:jO},__type__:{object:QO,string:jO}},hover:{border:{string:jO},background:{string:jO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},opacity:{number:YO,undefined:"undefined"},fixed:{x:{boolean:VO},y:{boolean:VO},__type__:{object:QO,boolean:VO}},font:{align:{string:jO},color:{string:jO},size:{number:YO},face:{string:jO},background:{string:jO},strokeWidth:{number:YO},strokeColor:{string:jO},vadjust:{number:YO},multi:{boolean:VO,string:jO},bold:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},boldital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},ital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},mono:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},group:{string:jO,number:YO,undefined:"undefined"},heightConstraint:{minimum:{number:YO},valign:{string:jO},__type__:{object:QO,boolean:VO,number:YO}},hidden:{boolean:VO},icon:{face:{string:jO},code:{string:jO},size:{number:YO},color:{string:jO},weight:{string:jO,number:YO},__type__:{object:QO}},id:{string:jO,number:YO},image:{selected:{string:jO,undefined:"undefined"},unselected:{string:jO,undefined:"undefined"},__type__:{object:QO,string:jO}},imagePadding:{top:{number:YO},right:{number:YO},bottom:{number:YO},left:{number:YO},__type__:{object:QO,number:YO}},label:{string:jO,undefined:"undefined"},labelHighlightBold:{boolean:VO},level:{number:YO,undefined:"undefined"},margin:{top:{number:YO},right:{number:YO},bottom:{number:YO},left:{number:YO},__type__:{object:QO,number:YO}},mass:{number:YO},physics:{boolean:VO},scaling:{min:{number:YO},max:{number:YO},label:{enabled:{boolean:VO},min:{number:YO},max:{number:YO},maxVisible:{number:YO},drawThreshold:{number:YO},__type__:{object:QO,boolean:VO}},customScalingFunction:{function:"function"},__type__:{object:QO}},shadow:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},x:{number:YO},y:{number:YO},__type__:{object:QO,boolean:VO}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:VO,array:WO},borderRadius:{number:YO},interpolation:{boolean:VO},useImageSize:{boolean:VO},useBorderWithImage:{boolean:VO},coordinateOrigin:{string:["center","top-left"]},__type__:{object:QO}},size:{number:YO},title:{string:jO,dom:"dom",undefined:"undefined"},value:{number:YO,undefined:"undefined"},widthConstraint:{minimum:{number:YO},maximum:{number:YO},__type__:{object:QO,boolean:VO,number:YO}},x:{number:YO},y:{number:YO},__type__:{object:QO}},HO={configure:{enabled:{boolean:VO},filter:{boolean:VO,string:jO,array:WO,function:"function"},container:{dom:"dom"},showButton:{boolean:VO},__type__:{object:QO,boolean:VO,string:jO,array:WO,function:"function"}},edges:{arrows:{to:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:_O},imageHeight:{number:YO},imageWidth:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},middle:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:_O},imageWidth:{number:YO},imageHeight:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},from:{enabled:{boolean:VO},scaleFactor:{number:YO},type:{string:_O},imageWidth:{number:YO},imageHeight:{number:YO},src:{string:jO},__type__:{object:QO,boolean:VO}},__type__:{string:["from","to","middle"],object:QO}},endPointOffset:{from:{number:YO},to:{number:YO},__type__:{object:QO,number:YO}},arrowStrikethrough:{boolean:VO},background:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},dashes:{boolean:VO,array:WO},__type__:{object:QO,boolean:VO}},chosen:{label:{boolean:VO,function:"function"},edge:{boolean:VO,function:"function"},__type__:{object:QO,boolean:VO}},color:{color:{string:jO},highlight:{string:jO},hover:{string:jO},inherit:{string:["from","to","both"],boolean:VO},opacity:{number:YO},__type__:{object:QO,string:jO}},dashes:{boolean:VO,array:WO},font:{color:{string:jO},size:{number:YO},face:{string:jO},background:{string:jO},strokeWidth:{number:YO},strokeColor:{string:jO},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:YO},multi:{boolean:VO,string:jO},bold:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},boldital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},ital:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},mono:{color:{string:jO},size:{number:YO},face:{string:jO},mod:{string:jO},vadjust:{number:YO},__type__:{object:QO,string:jO}},__type__:{object:QO,string:jO}},hidden:{boolean:VO},hoverWidth:{function:"function",number:YO},label:{string:jO,undefined:"undefined"},labelHighlightBold:{boolean:VO},length:{number:YO,undefined:"undefined"},physics:{boolean:VO},scaling:{min:{number:YO},max:{number:YO},label:{enabled:{boolean:VO},min:{number:YO},max:{number:YO},maxVisible:{number:YO},drawThreshold:{number:YO},__type__:{object:QO,boolean:VO}},customScalingFunction:{function:"function"},__type__:{object:QO}},selectionWidth:{function:"function",number:YO},selfReferenceSize:{number:YO},selfReference:{size:{number:YO},angle:{number:YO},renderBehindTheNode:{boolean:VO},__type__:{object:QO}},shadow:{enabled:{boolean:VO},color:{string:jO},size:{number:YO},x:{number:YO},y:{number:YO},__type__:{object:QO,boolean:VO}},smooth:{enabled:{boolean:VO},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:YO},forceDirection:{string:["horizontal","vertical","none"],boolean:VO},__type__:{object:QO,boolean:VO}},title:{string:jO,undefined:"undefined"},width:{number:YO},widthConstraint:{maximum:{number:YO},__type__:{object:QO,boolean:VO,number:YO}},value:{number:YO,undefined:"undefined"},__type__:{object:QO}},groups:{useDefaultGroups:{boolean:VO},__any__:UO,__type__:{object:QO}},interaction:{dragNodes:{boolean:VO},dragView:{boolean:VO},hideEdgesOnDrag:{boolean:VO},hideEdgesOnZoom:{boolean:VO},hideNodesOnDrag:{boolean:VO},hover:{boolean:VO},keyboard:{enabled:{boolean:VO},speed:{x:{number:YO},y:{number:YO},zoom:{number:YO},__type__:{object:QO}},bindToWindow:{boolean:VO},autoFocus:{boolean:VO},__type__:{object:QO,boolean:VO}},multiselect:{boolean:VO},navigationButtons:{boolean:VO},selectable:{boolean:VO},selectConnectedEdges:{boolean:VO},hoverConnectedEdges:{boolean:VO},tooltipDelay:{number:YO},zoomView:{boolean:VO},zoomSpeed:{number:YO},__type__:{object:QO}},layout:{randomSeed:{undefined:"undefined",number:YO,string:jO},improvedLayout:{boolean:VO},clusterThreshold:{number:YO},hierarchical:{enabled:{boolean:VO},levelSeparation:{number:YO},nodeSpacing:{number:YO},treeSpacing:{number:YO},blockShifting:{boolean:VO},edgeMinimization:{boolean:VO},parentCentralization:{boolean:VO},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:QO,boolean:VO}},__type__:{object:QO}},manipulation:{enabled:{boolean:VO},initiallyActive:{boolean:VO},addNode:{boolean:VO,function:"function"},addEdge:{boolean:VO,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:QO,boolean:VO,function:"function"}},deleteNode:{boolean:VO,function:"function"},deleteEdge:{boolean:VO,function:"function"},controlNodeStyle:UO,__type__:{object:QO,boolean:VO}},nodes:UO,physics:{enabled:{boolean:VO},barnesHut:{theta:{number:YO},gravitationalConstant:{number:YO},centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},forceAtlas2Based:{theta:{number:YO},gravitationalConstant:{number:YO},centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},repulsion:{centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},nodeDistance:{number:YO},damping:{number:YO},__type__:{object:QO}},hierarchicalRepulsion:{centralGravity:{number:YO},springLength:{number:YO},springConstant:{number:YO},nodeDistance:{number:YO},damping:{number:YO},avoidOverlap:{number:YO},__type__:{object:QO}},maxVelocity:{number:YO},minVelocity:{number:YO},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:VO},iterations:{number:YO},updateInterval:{number:YO},onlyDynamicEdges:{boolean:VO},fit:{boolean:VO},__type__:{object:QO,boolean:VO}},timestep:{number:YO},adaptiveTimestep:{boolean:VO},wind:{x:{number:YO},y:{number:YO},__type__:{object:QO}},__type__:{object:QO,boolean:VO}},autoResize:{boolean:VO},clickToUse:{boolean:VO},locale:{string:jO},locales:{__any__:{any:"any"},__type__:{object:QO}},height:{string:jO},width:{string:jO},__type__:{object:QO}},KO={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},XO=function(g,t,A){var e;return!(!zh(g).call(g,"physics")||!zh(e=KO.physics.solver).call(e,t)||A.physics.solver===t||"wind"===t)},JO=Object.freeze({__proto__:null,configuratorHideOption:XO,allOptions:HO,configureOptions:KO}),qO=function(){function g(){Us(this,g)}return Xs(g,[{key:"getDistances",value:function(g,t,A){for(var e={},C=g.edges,I=0;I2&&void 0!==arguments[2]&&arguments[2],e=this.distanceSolver.getDistances(this.body,g,t);this._createL_matrix(e),this._createK_matrix(e),this._createE_matrix();for(var C=.01,I=1,i=0,o=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),n=5,r=1e9,s=0,a=0,d=0,h=0,l=0;r>C&&iI&&l