-
Notifications
You must be signed in to change notification settings - Fork 2
/
graphlib-dot.min.js
2 lines (2 loc) · 42.3 KB
/
graphlib-dot.min.js
1
2
(function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var j=typeof require=="function"&&require;if(!h&&j)return j(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}var f=typeof require=="function"&&require;for(var g=0;g<d.length;g++)e(d[g]);return e})({1:[function(a,b,c){var d=typeof self!="undefined"?self:typeof window!="undefined"?window:{};d.graphlibDot=a("./index")},{"./index":2}],2:[function(a,b,c){var d=a("./lib/parse"),e=a("./lib/write"),f=a("./lib/version");b.exports={DotGraph:a("./lib/DotGraph"),DotDigraph:a("./lib/DotDigraph"),parse:d,decode:d,parseMany:d.parseMany,write:e,encode:e,version:f,type:"dot",buffer:!1}},{"./lib/DotDigraph":3,"./lib/DotGraph":4,"./lib/parse":8,"./lib/version":9,"./lib/write":10}],3:[function(a,b,c){var d=a("graphlib").CDigraph,e=a("./dotify"),f=e(d);b.exports=f,f.fromDigraph=function(a){var b=new f,c=a.graph();return c!==undefined&&b.graph(c),a.eachNode(function(a,c){c===undefined?b.addNode(a):b.addNode(a,c)}),a.eachEdge(function(a,c,d,e){e===undefined?b.addEdge(null,c,d):b.addEdge(null,c,d,e)}),b}},{"./dotify":7,graphlib:11}],4:[function(a,b,c){var d=a("graphlib").CGraph,e=a("./dotify"),f=e(d);b.exports=f,f.fromGraph=function(a){var b=new f,c=a.graph();return c!==undefined&&b.graph(c),a.eachNode(function(a,c){c===undefined?b.addNode(a):b.addNode(a,c)}),a.eachEdge(function(a,c,d,e){e===undefined?b.addEdge(null,c,d):b.addEdge(null,c,d,e)}),b}},{"./dotify":7,graphlib:11}],5:[function(a,b,c){function e(){this._indent="",this._content="",this._shouldIndent=!0}b.exports=e;var d=" ";e.prototype.indent=function(){this._indent+=d},e.prototype.unindent=function(){this._indent=this._indent.slice(d.length)},e.prototype.writeLine=function(a){this.write((a||"")+"\n"),this._shouldIndent=!0},e.prototype.write=function(a){this._shouldIndent&&(this._shouldIndent=!1,this._content+=this._indent),this._content+=a},e.prototype.toString=function(){return this._content}},{}],6:[function(a,b,c){b.exports=function(){function a(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var b={parse:function(b,c){function i(a,b,c){var d=a,e=c-a.length;for(var f=0;f<e;f++)d=b+d;return d}function j(a){var b=a.charCodeAt(0),c,d;return b<=255?(c="x",d=2):(c="u",d=4),"\\"+c+i(b.toString(16).toUpperCase(),"0",d)}function k(a){if(e<g)return;e>g&&(g=e,h=[]),h.push(a)}function l(){var a,b;b=m();if(b!==null){a=[];while(b!==null)a.push(b),b=m()}else a=null;return a}function m(){var a,c,d,g,h,i,j,l,m,o,p,q,r,s,t,u;s=e,t=e,a=[],c=N();while(c!==null)a.push(c),c=N();if(a!==null){u=e,c=J(),c!==null?(d=N(),d!==null?c=[c,d]:(c=null,e=u)):(c=null,e=u),c=c!==null?c:"";if(c!==null){d=K();if(d!==null){g=[],h=N();while(h!==null)g.push(h),h=N();if(g!==null){h=D(),h=h!==null?h:"";if(h!==null){i=[],j=N();while(j!==null)i.push(j),j=N();if(i!==null){b.charCodeAt(e)===123?(j="{",e++):(j=null,f===0&&k('"{"'));if(j!==null){l=[],m=N();while(m!==null)l.push(m),m=N();if(l!==null){m=n(),m=m!==null?m:"";if(m!==null){o=[],p=N();while(p!==null)o.push(p),p=N();if(o!==null){b.charCodeAt(e)===125?(p="}",e++):(p=null,f===0&&k('"}"'));if(p!==null){q=[],r=N();while(r!==null)q.push(r),r=N();q!==null?a=[a,c,d,g,h,i,j,l,m,o,p,q]:(a=null,e=t)}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t}else a=null,e=t;return a!==null&&(a=function(a,b,c,d){return{type:b,id:c,stmts:d}}(s,a[2],a[4],a[8])),a===null&&(e=s),a}function n(){var a,c,d,g,h,i,j,l,m,n,p;m=e,n=e,a=o();if(a!==null){c=[],d=N();while(d!==null)c.push(d),d=N();if(c!==null){b.charCodeAt(e)===59?(d=";",e++):(d=null,f===0&&k('";"')),d=d!==null?d:"";if(d!==null){g=[],p=e,h=[],i=N();while(i!==null)h.push(i),i=N();if(h!==null){i=o();if(i!==null){j=[],l=N();while(l!==null)j.push(l),l=N();j!==null?(b.charCodeAt(e)===59?(l=";",e++):(l=null,f===0&&k('";"')),l=l!==null?l:"",l!==null?h=[h,i,j,l]:(h=null,e=p)):(h=null,e=p)}else h=null,e=p}else h=null,e=p;while(h!==null){g.push(h),p=e,h=[],i=N();while(i!==null)h.push(i),i=N();if(h!==null){i=o();if(i!==null){j=[],l=N();while(l!==null)j.push(l),l=N();j!==null?(b.charCodeAt(e)===59?(l=";",e++):(l=null,f===0&&k('";"')),l=l!==null?l:"",l!==null?h=[h,i,j,l]:(h=null,e=p)):(h=null,e=p)}else h=null,e=p}else h=null,e=p}g!==null?a=[a,c,d,g]:(a=null,e=n)}else a=null,e=n}else a=null,e=n}else a=null,e=n;return a!==null&&(a=function(a,b,c){var d=[b];for(var e=0;e<c.length;++e)d.push(c[e][1]);return d}(m,a[0],a[3])),a===null&&(e=m),a}function o(){var a;return a=p(),a===null&&(a=s(),a===null&&(a=t(),a===null&&(a=q(),a===null&&(a=r())))),a}function p(){var a,b,c,d,f;d=e,f=e,a=G(),a===null&&(a=E(),a===null&&(a=F()));if(a!==null){b=[],c=N();while(c!==null)b.push(c),c=N();b!==null?(c=u(),c!==null?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)}else a=null,e=f;return a!==null&&(a=function(a,b,c){return{type:"attr",attrType:b,attrs:c||{}}}(d,a[0],a[2])),a===null&&(e=d),a}function q(){var a,c,d,g,h,i,j;i=e,j=e,a=D();if(a!==null){c=[],d=N();while(d!==null)c.push(d),d=N();if(c!==null){b.charCodeAt(e)===61?(d="=",e++):(d=null,f===0&&k('"="'));if(d!==null){g=[],h=N();while(h!==null)g.push(h),h=N();g!==null?(h=D(),h!==null?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j}else a=null,e=j}else a=null,e=j;return a!==null&&(a=function(a,b,c){var d={};return d[b]=c,{type:"inlineAttr",attrs:d}}(i,a[0],a[4])),a===null&&(e=i),a}function r(){var a,b,c,d,f;d=e,f=e,a=A();if(a!==null){b=[],c=N();while(c!==null)b.push(c),c=N();b!==null?(c=u(),c=c!==null?c:"",c!==null?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)}else a=null,e=f;return a!==null&&(a=function(a,b,c){return{type:"node",id:b,attrs:c||{}}}(d,a[0],a[2])),a===null&&(e=d),a}function s(){var a,b,c,d,f,g,h;g=e,h=e,a=z();if(a!==null){b=[],c=N();while(c!==null)b.push(c),c=N();if(b!==null){c=x();if(c!==null){d=[],f=N();while(f!==null)d.push(f),f=N();d!==null?(f=u(),f=f!==null?f:"",f!==null?a=[a,b,c,d,f]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h}else a=null,e=h}else a=null,e=h;return a!==null&&(a=function(a,b,c,d){var e=[b];for(var f=0;f<c.length;++f)e.push(c[f]);return{type:"edge",elems:e,attrs:d||{}}}(g,a[0],a[2],a[4])),a===null&&(e=g),a}function t(){var a,c,d,g,h,i,j,l,m,o;j=e,l=e,m=e,a=I();if(a!==null){c=[],d=N();while(d!==null)c.push(d),d=N();if(c!==null){o=e,d=D();if(d!==null){g=[],h=N();while(h!==null)g.push(h),h=N();g!==null?d=[d,g]:(d=null,e=o)}else d=null,e=o;d=d!==null?d:"",d!==null?a=[a,c,d]:(a=null,e=m)}else a=null,e=m}else a=null,e=m;a=a!==null?a:"";if(a!==null){b.charCodeAt(e)===123?(c="{",e++):(c=null,f===0&&k('"{"'));if(c!==null){d=[],g=N();while(g!==null)d.push(g),g=N();if(d!==null){g=n(),g=g!==null?g:"";if(g!==null){h=[],i=N();while(i!==null)h.push(i),i=N();h!==null?(b.charCodeAt(e)===125?(i="}",e++):(i=null,f===0&&k('"}"')),i!==null?a=[a,c,d,g,h,i]:(a=null,e=l)):(a=null,e=l)}else a=null,e=l}else a=null,e=l}else a=null,e=l}else a=null,e=l;return a!==null&&(a=function(a,b,c){return b=b[2]||[],{type:"subgraph",id:b[0],stmts:c}}(j,a[0],a[3])),a===null&&(e=j),a}function u(){var a,b,c,d,f,g,h;f=e,g=e,a=v();if(a!==null){b=[],h=e,c=[],d=N();while(d!==null)c.push(d),d=N();c!==null?(d=v(),d!==null?c=[c,d]:(c=null,e=h)):(c=null,e=h);while(c!==null){b.push(c),h=e,c=[],d=N();while(d!==null)c.push(d),d=N();c!==null?(d=v(),d!==null?c=[c,d]:(c=null,e=h)):(c=null,e=h)}b!==null?a=[a,b]:(a=null,e=g)}else a=null,e=g;return a!==null&&(a=function(a,b,c){var d=b;for(var e=0;e<c.length;++e)d=R(d,c[e][1]);return d}(f,a[0],a[1])),a===null&&(e=f),a}function v(){var a,c,d,g,h,i,j;i=e,j=e,b.charCodeAt(e)===91?(a="[",e++):(a=null,f===0&&k('"["'));if(a!==null){c=[],d=N();while(d!==null)c.push(d),d=N();if(c!==null){d=w(),d=d!==null?d:"";if(d!==null){g=[],h=N();while(h!==null)g.push(h),h=N();g!==null?(b.charCodeAt(e)===93?(h="]",e++):(h=null,f===0&&k('"]"')),h!==null?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j}else a=null,e=j}else a=null,e=j;return a!==null&&(a=function(a,b){return b}(i,a[2])),a===null&&(e=i),a}function w(){var a,c,d,g,h,i,j,l,m;j=e,l=e,a=y();if(a!==null){c=[],m=e,d=[],g=N();while(g!==null)d.push(g),g=N();if(d!==null){b.charCodeAt(e)===44?(g=",",e++):(g=null,f===0&&k('","')),g=g!==null?g:"";if(g!==null){h=[],i=N();while(i!==null)h.push(i),i=N();h!==null?(i=y(),i!==null?d=[d,g,h,i]:(d=null,e=m)):(d=null,e=m)}else d=null,e=m}else d=null,e=m;while(d!==null){c.push(d),m=e,d=[],g=N();while(g!==null)d.push(g),g=N();if(d!==null){b.charCodeAt(e)===44?(g=",",e++):(g=null,f===0&&k('","')),g=g!==null?g:"";if(g!==null){h=[],i=N();while(i!==null)h.push(i),i=N();h!==null?(i=y(),i!==null?d=[d,g,h,i]:(d=null,e=m)):(d=null,e=m)}else d=null,e=m}else d=null,e=m}c!==null?a=[a,c]:(a=null,e=l)}else a=null,e=l;return a!==null&&(a=function(a,b,c){var d=b;for(var e=0;e<c.length;++e)d=R(d,c[e][3]);return d}(j,a[0],a[1])),a===null&&(e=j),a}function x(){var a,c,d,g,h,i,j,l;i=e,j=e,l=e,b.substr(e,2)==="--"?(a="--",e+=2):(a=null,f===0&&k('"--"')),a!==null?(c=function(a){return Q}(e)?null:"",c!==null?a=[a,c]:(a=null,e=l)):(a=null,e=l),a===null&&(l=e,b.substr(e,2)==="->"?(a="->",e+=2):(a=null,f===0&&k('"->"')),a!==null?(c=function(a){return Q}(e)?"":null,c!==null?a=[a,c]:(a=null,e=l)):(a=null,e=l));if(a!==null){c=[],d=N();while(d!==null)c.push(d),d=N();if(c!==null){d=z();if(d!==null){g=[],h=N();while(h!==null)g.push(h),h=N();g!==null?(h=x(),h=h!==null?h:"",h!==null?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j}else a=null,e=j}else a=null,e=j;return a!==null&&(a=function(a,b,c){var d=[b];for(var e=0;e<c.length;++e)d.push(c[e]);return d}(i,a[2],a[4])),a===null&&(e=i),a}function y(){var a,c,d,g,h,i,j,l;i=e,j=e,a=D();if(a!==null){l=e,c=[],d=N();while(d!==null)c.push(d),d=N();if(c!==null){b.charCodeAt(e)===61?(d="=",e++):(d=null,f===0&&k('"="'));if(d!==null){g=[],h=N();while(h!==null)g.push(h),h=N();g!==null?(h=D(),h!==null?c=[c,d,g,h]:(c=null,e=l)):(c=null,e=l)}else c=null,e=l}else c=null,e=l;c=c!==null?c:"",c!==null?a=[a,c]:(a=null,e=j)}else a=null,e=j;return a!==null&&(a=function(a,b,c){var d={};return d[b]=c[3],d}(i,a[0],a[1])),a===null&&(e=i),a}function z(){var a,b;return a=t(),a===null&&(b=e,a=A(),a!==null&&(a=function(a,b){return{type:"node",id:b,attrs:{}}}(b,a)),a===null&&(e=b)),a}function A(){var a,b,c,d,f;d=e,f=e,a=D();if(a!==null){b=[],c=N();while(c!==null)b.push(c),c=N();b!==null?(c=B(),c=c!==null?c:"",c!==null?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)}else a=null,e=f;return a!==null&&(a=function(a,b){return b}(d,a[0])),a===null&&(e=d),a}function B(){var a,c,d,g,h,i,j,l,m;l=e,b.charCodeAt(e)===58?(a=":",e++):(a=null,f===0&&k('":"'));if(a!==null){c=[],d=N();while(d!==null)c.push(d),d=N();if(c!==null){d=D();if(d!==null){g=[],h=N();while(h!==null)g.push(h),h=N();if(g!==null){m=e,b.charCodeAt(e)===58?(h=":",e++):(h=null,f===0&&k('":"'));if(h!==null){i=[],j=N();while(j!==null)i.push(j),j=N();i!==null?(j=C(),j!==null?h=[h,i,j]:(h=null,e=m)):(h=null,e=m)}else h=null,e=m;h=h!==null?h:"",h!==null?a=[a,c,d,g,h]:(a=null,e=l)}else a=null,e=l}else a=null,e=l}else a=null,e=l}else a=null,e=l;return a}function C(){var a;return b.substr(e,2)==="ne"?(a="ne",e+=2):(a=null,f===0&&k('"ne"')),a===null&&(b.substr(e,2)==="se"?(a="se",e+=2):(a=null,f===0&&k('"se"')),a===null&&(b.substr(e,2)==="sw"?(a="sw",e+=2):(a=null,f===0&&k('"sw"')),a===null&&(b.substr(e,2)==="nw"?(a="nw",e+=2):(a=null,f===0&&k('"nw"')),a===null&&(b.charCodeAt(e)===110?(a="n",e++):(a=null,f===0&&k('"n"')),a===null&&(b.charCodeAt(e)===101?(a="e",e++):(a=null,f===0&&k('"e"')),a===null&&(b.charCodeAt(e)===115?(a="s",e++):(a=null,f===0&&k('"s"')),a===null&&(b.charCodeAt(e)===119?(a="w",e++):(a=null,f===0&&k('"w"')),a===null&&(b.charCodeAt(e)===99?(a="c",e++):(a=null,f===0&&k('"c"')),a===null&&(b.charCodeAt(e)===95?(a="_",e++):(a=null,f===0&&k('"_"'))))))))))),a}function D(){var a,c,d,g,h,i,j,l,m;f++,i=e,j=e,/^[a-zA-Z\u0200-\u0377_]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[a-zA-Z\\u0200-\\u0377_]"));if(a!==null){c=[],/^[a-zA-Z\u0200-\u0377_0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[a-zA-Z\\u0200-\\u0377_0-9]"));while(d!==null)c.push(d),/^[a-zA-Z\u0200-\u0377_0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[a-zA-Z\\u0200-\\u0377_0-9]"));c!==null?a=[a,c]:(a=null,e=j)}else a=null,e=j;a!==null&&(a=function(a,b,c){return b+c.join("")}(i,a[0],a[1])),a===null&&(e=i);if(a===null){i=e,j=e,b.charCodeAt(e)===45?(a="-",e++):(a=null,f===0&&k('"-"')),a=a!==null?a:"";if(a!==null){b.charCodeAt(e)===46?(c=".",e++):(c=null,f===0&&k('"."'));if(c!==null){/^[0-9]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k("[0-9]"));if(g!==null){d=[];while(g!==null)d.push(g),/^[0-9]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k("[0-9]"))}else d=null;d!==null?a=[a,c,d]:(a=null,e=j)}else a=null,e=j}else a=null,e=j;a!==null&&(a=function(a,b,c,d){return b+c+d.join("")}(i,a[0],a[1],a[2])),a===null&&(e=i);if(a===null){i=e,j=e,b.charCodeAt(e)===45?(a="-",e++):(a=null,f===0&&k('"-"')),a=a!==null?a:"";if(a!==null){/^[0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[0-9]"));if(d!==null){c=[];while(d!==null)c.push(d),/^[0-9]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[0-9]"))}else c=null;if(c!==null){l=e,b.charCodeAt(e)===46?(d=".",e++):(d=null,f===0&&k('"."'));if(d!==null){g=[],/^[0-9]/.test(b.charAt(e))?(h=b.charAt(e),e++):(h=null,f===0&&k("[0-9]"));while(h!==null)g.push(h),/^[0-9]/.test(b.charAt(e))?(h=b.charAt(e),e++):(h=null,f===0&&k("[0-9]"));g!==null?d=[d,g]:(d=null,e=l)}else d=null,e=l;d=d!==null?d:"",d!==null?a=[a,c,d]:(a=null,e=j)}else a=null,e=j}else a=null,e=j;a!==null&&(a=function(a,b,c,d){return b+c.join("")+(d[0]||"")+(d[1]||[]).join("")}(i,a[0],a[1],a[2])),a===null&&(e=i);if(a===null){i=e,j=e,b.charCodeAt(e)===34?(a='"',e++):(a=null,f===0&&k('"\\""'));if(a!==null){c=[],l=e,b.substr(e,2)==='\\"'?(d='\\"',e+=2):(d=null,f===0&&k('"\\\\\\""')),d!==null&&(d=function(a){return'"'}(l)),d===null&&(e=l),d===null&&(l=e,m=e,b.charCodeAt(e)===92?(d="\\",e++):(d=null,f===0&&k('"\\\\"')),d!==null?(/^[^"]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k('[^"]')),g!==null?d=[d,g]:(d=null,e=m)):(d=null,e=m),d!==null&&(d=function(a,b){return"\\"+b}(l,d[1])),d===null&&(e=l),d===null&&(/^[^"]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k('[^"]'))));while(d!==null)c.push(d),l=e,b.substr(e,2)==='\\"'?(d='\\"',e+=2):(d=null,f===0&&k('"\\\\\\""')),d!==null&&(d=function(a){return'"'}(l)),d===null&&(e=l),d===null&&(l=e,m=e,b.charCodeAt(e)===92?(d="\\",e++):(d=null,f===0&&k('"\\\\"')),d!==null?(/^[^"]/.test(b.charAt(e))?(g=b.charAt(e),e++):(g=null,f===0&&k('[^"]')),g!==null?d=[d,g]:(d=null,e=m)):(d=null,e=m),d!==null&&(d=function(a,b){return"\\"+b}(l,d[1])),d===null&&(e=l),d===null&&(/^[^"]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k('[^"]'))));c!==null?(b.charCodeAt(e)===34?(d='"',e++):(d=null,f===0&&k('"\\""')),d!==null?a=[a,c,d]:(a=null,e=j)):(a=null,e=j)}else a=null,e=j;a!==null&&(a=function(a,b){return b.join("")}(i,a[1])),a===null&&(e=i)}}}return f--,f===0&&a===null&&k("identifier"),a}function E(){var a,c;return c=e,b.substr(e,4).toLowerCase()==="node"?(a=b.substr(e,4),e+=4):(a=null,f===0&&k('"node"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function F(){var a,c;return c=e,b.substr(e,4).toLowerCase()==="edge"?(a=b.substr(e,4),e+=4):(a=null,f===0&&k('"edge"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function G(){var a,c;return c=e,b.substr(e,5).toLowerCase()==="graph"?(a=b.substr(e,5),e+=5):(a=null,f===0&&k('"graph"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function H(){var a,c;return c=e,b.substr(e,7).toLowerCase()==="digraph"?(a=b.substr(e,7),e+=7):(a=null,f===0&&k('"digraph"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function I(){var a,c;return c=e,b.substr(e,8).toLowerCase()==="subgraph"?(a=b.substr(e,8),e+=8):(a=null,f===0&&k('"subgraph"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function J(){var a,c;return c=e,b.substr(e,6).toLowerCase()==="strict"?(a=b.substr(e,6),e+=6):(a=null,f===0&&k('"strict"')),a!==null&&(a=function(a,b){return b.toLowerCase()}(c,a)),a===null&&(e=c),a}function K(){var a,b;return a=G(),a===null&&(b=e,a=H(),a!==null&&(a=function(a,b){return Q=b==="digraph",b}(b,a)),a===null&&(e=b)),a}function L(){var a,c;f++,/^[ \t\r\n]/.test(b.charAt(e))?(c=b.charAt(e),e++):(c=null,f===0&&k("[ \\t\\r\\n]"));if(c!==null){a=[];while(c!==null)a.push(c),/^[ \t\r\n]/.test(b.charAt(e))?(c=b.charAt(e),e++):(c=null,f===0&&k("[ \\t\\r\\n]"))}else a=null;return f--,f===0&&a===null&&k("whitespace"),a}function M(){var a,c,d,g,h,i,j;f++,h=e,b.substr(e,2)==="//"?(a="//",e+=2):(a=null,f===0&&k('"//"'));if(a!==null){c=[],/^[^\n]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[^\\n]"));while(d!==null)c.push(d),/^[^\n]/.test(b.charAt(e))?(d=b.charAt(e),e++):(d=null,f===0&&k("[^\\n]"));c!==null?a=[a,c]:(a=null,e=h)}else a=null,e=h;if(a===null){h=e,b.substr(e,2)==="/*"?(a="/*",e+=2):(a=null,f===0&&k('"/*"'));if(a!==null){c=[],i=e,j=e,f++,b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);while(d!==null)c.push(d),i=e,j=e,f++,b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);c!==null?(b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h}return f--,f===0&&a===null&&k("comment"),a}function N(){var a;return a=L(),a===null&&(a=M()),a}function O(a){a.sort();var b=null,c=[];for(var d=0;d<a.length;d++)a[d]!==b&&(c.push(a[d]),b=a[d]);return c}function P(){var a=1,c=1,d=!1;for(var f=0;f<Math.max(e,g);f++){var h=b.charAt(f);h==="\n"?(d||a++,c=1,d=!1):h==="\r"||h==="\u2028"||h==="\u2029"?(a++,c=1,d=!0):(c++,d=!1)}return{line:a,column:c}}function R(a,b){var c={};for(var d in a)c[d]=a[d];for(var d in b)c[d]=b[d];return c}var d={start:l,graphStmt:m,stmtList:n,stmt:o,attrStmt:p,inlineAttrStmt:q,nodeStmt:r,edgeStmt:s,subgraphStmt:t,attrList:u,attrListBlock:v,aList:w,edgeRHS:x,idDef:y,nodeIdOrSubgraph:z,nodeId:A,port:B,compassPt:C,id:D,node:E,edge:F,graph:G,digraph:H,subgraph:I,strict:J,graphType:K,whitespace:L,comment:M,_:N};if(c!==undefined){if(d[c]===undefined)throw new Error("Invalid rule name: "+a(c)+".")}else c="start";var e=0,f=0,g=0,h=[],Q,S=d[c]();if(S===null||e!==b.length){var T=Math.max(e,g),U=T<b.length?b.charAt(T):null,V=P();throw new this.SyntaxError(O(h),U,T,V.line,V.column)}return S},toSource:function(){return this._source}};return b.SyntaxError=function(b,c,d,e,f){function g(b,c){var d,e;switch(b.length){case 0:d="end of input";break;case 1:d=b[0];break;default:d=b.slice(0,b.length-1).join(", ")+" or "+b[b.length-1]}return e=c?a(c):"end of input","Expected "+d+" but "+e+" found."}this.name="SyntaxError",this.expected=b,this.found=c,this.message=g(b,c),this.offset=d,this.line=e,this.column=f},b.SyntaxError.prototype=Error.prototype,b}()},{}],7:[function(a,b,c){function d(a){function b(){a.call(this),this.graph({})}return b.prototype=new a,b.prototype.constructor=b,b.prototype.graph=function(b){return arguments.length<1?a.prototype.graph.call(this):(this._checkValueType(b),a.prototype.graph.call(this,b))},b.prototype.node=function(b,c){return arguments.length<2?a.prototype.node.call(this,b):(this._checkValueType(c),a.prototype.node.call(this,b,c))},b.prototype.addNode=function(b,c){return arguments.length<2&&(c={}),this._checkValueType(c),a.prototype.addNode.call(this,b,c)},b.prototype.edge=function(b,c){return arguments.length<2?a.prototype.edge.call(this,b):(this._checkValueType(c),a.prototype.edge.call(this,b,c))},b.prototype.addEdge=function(b,c,d,e){return arguments.length<4&&(e={}),this._checkValueType(e),a.prototype.addEdge.call(this,b,c,d,e)},b.prototype._checkValueType=function(a){if(a===null||typeof a!="object")throw new Error("Value must be non-null and of type 'object'")},b}b.exports=d},{}],8:[function(a,b,c){function g(a){var b=f.parse(a,"graphStmt");return i(b)}function h(a){var b=f.parse(a);return b.map(function(a){return i(a)})}function i(a){function c(a,c,d){b.hasNode(a)||(b.addNode(a,h.get("node",{})),b.node(a).label===undefined&&(b.node(a).label=a),d!==null&&b.parent(a,d)),c&&j(c,b.node(a))}function f(a,c,d){var e={};j(h.get("edge",d),e);var f=d.id?d.id:null;b.addEdge(f,a,c,e)}function g(a){function e(a){c.push(a)}var b={},c=[],d;e(a);while(c.length!==0){d=c.pop();switch(d.type){case"node":b[d.id]=!0;break;case"edge":d.elems.forEach(e);break;case"subgraph":d.stmts.forEach(e)}}return Object.keys(b)}function i(a,d){var e=a.attrs;switch(a.type){case"node":c(a.id,e,d);break;case"edge":var k,l;a.elems.forEach(function(a){i(a,d);switch(a.type){case"node":l=[a.id];break;case"subgraph":l=g(a);break;default:throw new Error("Unsupported type incident on edge: "+a.type)}k&&k.forEach(function(a){l.forEach(function(b){f(a,b,e)})}),k=l});break;case"subgraph":h.enterSubDigraph(),a.id=b.addNode(a.id),d!==null&&b.parent(a.id,d),a.stmts&&a.stmts.forEach(function(b){i(b,a.id)}),b.children(a.id).length===0&&b.delNode(a.id),h.exitSubDigraph();break;case"attr":h.set(a.attrType,e);break;case"inlineAttr":a.attrs&&j(e,d===null?b.graph():b.node(d));break;default:throw new Error("Unsupported statement type: "+a.type)}}var b=a.type==="graph"?new e:new d,h={_default:{},get:function(b,c){if(typeof this._default[b]!="undefined"){var d={};return j(this._default[b],d),j(c,d),d}return c},set:function(b,c){this._default[b]=this.get(b,c)},enterSubDigraph:function(){function a(){}a.prototype=this._default;var b=new a;this._default=b},exitSubDigraph:function(){this._default=Object.getPrototypeOf(this._default)}};return a.stmts&&a.stmts.forEach(function(a){i(a,null)}),b}function j(a,b){Object.keys(a).forEach(function(c){b[c]=a[c]})}var d=a("./DotDigraph"),e=a("./DotGraph"),f=a("./dot-grammar");b.exports=g,b.exports.parseMany=h},{"./DotDigraph":3,"./DotGraph":4,"./dot-grammar":6}],9:[function(a,b,c){b.exports="0.4.10"},{}],10:[function(a,b,c){function f(a){var b=a.isDirected()?"->":"--",c=new d;c.writeLine((a.isDirected()?"digraph":"graph")+" {"),c.indent();var e=a.graph();return e&&Object.keys(e).map(function(a){c.writeLine(h(a)+"="+h(e[a])+";")}),g(a,null,c),a.edges().forEach(function(d){j(a,d,b,c)}),c.unindent(),c.writeLine("}"),c.toString()}function g(a,b,c){var d=a.children?a.children(b):b===null?a.nodes():[];d.forEach(function(b){if(!a.children||a.children(b).length===0)i(a,b,c);else{c.writeLine("subgraph "+h(b)+" {"),c.indent();var d=a.node(b);Object.keys(d).map(function(a){c.writeLine(h(a)+"="+h(d[a])+";")}),g(a,b,c),c.unindent(),c.writeLine("}")}})}function h(a){return typeof a=="number"||a.toString().match(e)?a:'"'+a.toString().replace(/"/g,'\\"')+'"'}function i(a,b,c){var d=a.node(b);c.write(h(b));if(d){var e=Object.keys(d).map(function(a){return h(a)+"="+h(d[a])});e.length&&c.write(" ["+e.join(",")+"]")}c.writeLine()}function j(a,b,c,d){var e=a.edge(b),f=a.incidentNodes(b),g=f[0],i=f[1];d.write(h(g)+" "+c+" "+h(i));if(e){var j=Object.keys(e).map(function(a){return h(a)+"="+h(e[a])});j.length&&d.write(" ["+j.join(",")+"]")}d.writeLine()}var d=a("./Writer");b.exports=f;var e=/^[a-zA-Z\200-\377_][a-zA-Z\200-\377_0-9]*$/},{"./Writer":5}],11:[function(a,b,c){c.Graph=a("./lib/Graph"),c.Digraph=a("./lib/Digraph"),c.CGraph=a("./lib/CGraph"),c.CDigraph=a("./lib/CDigraph"),a("./lib/graph-converters"),c.alg={isAcyclic:a("./lib/alg/isAcyclic"),components:a("./lib/alg/components"),dijkstra:a("./lib/alg/dijkstra"),dijkstraAll:a("./lib/alg/dijkstraAll"),findCycles:a("./lib/alg/findCycles"),floydWarshall:a("./lib/alg/floydWarshall"),postorder:a("./lib/alg/postorder"),preorder:a("./lib/alg/preorder"),prim:a("./lib/alg/prim"),tarjan:a("./lib/alg/tarjan"),topsort:a("./lib/alg/topsort")},c.converter={json:a("./lib/converter/json.js")};var d=a("./lib/filter");c.filter={all:d.all,nodesFromList:d.nodesFromList},c.version=a("./lib/version")},{"./lib/CDigraph":13,"./lib/CGraph":14,"./lib/Digraph":15,"./lib/Graph":16,"./lib/alg/components":17,"./lib/alg/dijkstra":18,"./lib/alg/dijkstraAll":19,"./lib/alg/findCycles":20,"./lib/alg/floydWarshall":21,"./lib/alg/isAcyclic":22,"./lib/alg/postorder":23,"./lib/alg/preorder":24,"./lib/alg/prim":25,"./lib/alg/tarjan":26,"./lib/alg/topsort":27,"./lib/converter/json.js":29,"./lib/filter":30,"./lib/graph-converters":31,"./lib/version":33}],12:[function(a,b,c){function e(){this._value=undefined,this._nodes={},this._edges={},this._nextId=0}function f(a,b,c){(a[b]||(a[b]=new d)).add(c)}function g(a,b,c){var d=a[b];d.remove(c),d.size()===0&&delete a[b]}var d=a("cp-data").Set;b.exports=e,e.prototype.order=function(){return Object.keys(this._nodes).length},e.prototype.size=function(){return Object.keys(this._edges).length},e.prototype.graph=function(a){if(arguments.length===0)return this._value;this._value=a},e.prototype.hasNode=function(a){return a in this._nodes},e.prototype.node=function(a,b){var c=this._strictGetNode(a);if(arguments.length===1)return c.value;c.value=b},e.prototype.nodes=function(){var a=[];return this.eachNode(function(b){a.push(b)}),a},e.prototype.eachNode=function(a){for(var b in this._nodes){var c=this._nodes[b];a(c.id,c.value)}},e.prototype.hasEdge=function(a){return a in this._edges},e.prototype.edge=function(a,b){var c=this._strictGetEdge(a);if(arguments.length===1)return c.value;c.value=b},e.prototype.edges=function(){var a=[];return this.eachEdge(function(b){a.push(b)}),a},e.prototype.eachEdge=function(a){for(var b in this._edges){var c=this._edges[b];a(c.id,c.u,c.v,c.value)}},e.prototype.incidentNodes=function(a){var b=this._strictGetEdge(a);return[b.u,b.v]},e.prototype.addNode=function(a,b){if(a===undefined||a===null){do a="_"+ ++this._nextId;while(this.hasNode(a))}else if(this.hasNode(a))throw new Error("Graph already has node '"+a+"'");return this._nodes[a]={id:a,value:b},a},e.prototype.delNode=function(a){this._strictGetNode(a),this.incidentEdges(a).forEach(function(a){this.delEdge(a)},this),delete this._nodes[a]},e.prototype._addEdge=function(a,b,c,d,e,g){this._strictGetNode(b),this._strictGetNode(c);if(a===undefined||a===null){do a="_"+ ++this._nextId;while(this.hasEdge(a))}else if(this.hasEdge(a))throw new Error("Graph already has edge '"+a+"'");return this._edges[a]={id:a,u:b,v:c,value:d},f(e[c],b,a),f(g[b],c,a),a},e.prototype._delEdge=function(a,b,c){var d=this._strictGetEdge(a);g(b[d.v],d.u,a),g(c[d.u],d.v,a),delete this._edges[a]},e.prototype.copy=function(){var a=new this.constructor;return a.graph(this.graph()),this.eachNode(function(b,c){a.addNode(b,c)}),this.eachEdge(function(b,c,d,e){a.addEdge(b,c,d,e)}),a._nextId=this._nextId,a},e.prototype.filterNodes=function(a){var b=new this.constructor;return b.graph(this.graph()),this.eachNode(function(c,d){a(c)&&b.addNode(c,d)}),this.eachEdge(function(a,c,d,e){b.hasNode(c)&&b.hasNode(d)&&b.addEdge(a,c,d,e)}),b},e.prototype._strictGetNode=function(a){var b=this._nodes[a];if(b===undefined)throw new Error("Node '"+a+"' is not in graph");return b},e.prototype._strictGetEdge=function(a){var b=this._edges[a];if(b===undefined)throw new Error("Edge '"+a+"' is not in graph");return b}},{"cp-data":34}],13:[function(a,b,c){var d=a("./Digraph"),e=a("./compoundify"),f=e(d);b.exports=f,f.fromDigraph=function(a){var b=new f,c=a.graph();return c!==undefined&&b.graph(c),a.eachNode(function(a,c){c===undefined?b.addNode(a):b.addNode(a,c)}),a.eachEdge(function(a,c,d,e){e===undefined?b.addEdge(null,c,d):b.addEdge(null,c,d,e)}),b},f.prototype.toString=function(){return"CDigraph "+JSON.stringify(this,null,2)}},{"./Digraph":15,"./compoundify":28}],14:[function(a,b,c){var d=a("./Graph"),e=a("./compoundify"),f=e(d);b.exports=f,f.fromGraph=function(a){var b=new f,c=a.graph();return c!==undefined&&b.graph(c),a.eachNode(function(a,c){c===undefined?b.addNode(a):b.addNode(a,c)}),a.eachEdge(function(a,c,d,e){e===undefined?b.addEdge(null,c,d):b.addEdge(null,c,d,e)}),b},f.prototype.toString=function(){return"CGraph "+JSON.stringify(this,null,2)}},{"./Graph":16,"./compoundify":28}],15:[function(a,b,c){function g(){e.call(this),this._inEdges={},this._outEdges={}}var d=a("./util"),e=a("./BaseGraph"),f=a("cp-data").Set;b.exports=g,g.prototype=new e,g.prototype.constructor=g,g.prototype.isDirected=function(){return!0},g.prototype.successors=function(a){return this._strictGetNode(a),Object.keys(this._outEdges[a]).map(function(a){return this._nodes[a].id},this)},g.prototype.predecessors=function(a){return this._strictGetNode(a),Object.keys(this._inEdges[a]).map(function(a){return this._nodes[a].id},this)},g.prototype.neighbors=function(a){return f.union([this.successors(a),this.predecessors(a)]).keys()},g.prototype.sources=function(){var a=this;return this._filterNodes(function(b){return a.inEdges(b).length===0})},g.prototype.sinks=function(){var a=this;return this._filterNodes(function(b){return a.outEdges(b).length===0})},g.prototype.source=function(a){return this._strictGetEdge(a).u},g.prototype.target=function(a){return this._strictGetEdge(a).v},g.prototype.inEdges=function(a,b){this._strictGetNode(a);var c=f.union(d.values(this._inEdges[a])).keys();return arguments.length>1&&(this._strictGetNode(b),c=c.filter(function(a){return this.source(a)===b},this)),c},g.prototype.outEdges=function(a,b){this._strictGetNode(a);var c=f.union(d.values(this._outEdges[a])).keys();return arguments.length>1&&(this._strictGetNode(b),c=c.filter(function(a){return this.target(a)===b},this)),c},g.prototype.incidentEdges=function(a,b){return arguments.length>1?f.union([this.outEdges(a,b),this.outEdges(b,a)]).keys():f.union([this.inEdges(a),this.outEdges(a)]).keys()},g.prototype.toString=function(){return"Digraph "+JSON.stringify(this,null,2)},g.prototype.addNode=function(a,b){return a=e.prototype.addNode.call(this,a,b),this._inEdges[a]={},this._outEdges[a]={},a},g.prototype.delNode=function(a){e.prototype.delNode.call(this,a),delete this._inEdges[a],delete this._outEdges[a]},g.prototype.addEdge=function(a,b,c,d){return e.prototype._addEdge.call(this,a,b,c,d,this._inEdges,this._outEdges)},g.prototype.delEdge=function(a){e.prototype._delEdge.call(this,a,this._inEdges,this._outEdges)},g.prototype._filterNodes=function(a){var b=[];return this.eachNode(function(c){a(c)&&b.push(c)}),b}},{"./BaseGraph":12,"./util":32,"cp-data":34}],16:[function(a,b,c){function g(){e.call(this),this._incidentEdges={}}var d=a("./util"),e=a("./BaseGraph"),f=a("cp-data").Set;b.exports=g,g.prototype=new e,g.prototype.constructor=g,g.prototype.isDirected=function(){return!1},g.prototype.neighbors=function(a){return this._strictGetNode(a),Object.keys(this._incidentEdges[a]).map(function(a){return this._nodes[a].id},this)},g.prototype.incidentEdges=function(a,b){return this._strictGetNode(a),arguments.length>1?(this._strictGetNode(b),b in this._incidentEdges[a]?this._incidentEdges[a][b].keys():[]):f.union(d.values(this._incidentEdges[a])).keys()},g.prototype.toString=function(){return"Graph "+JSON.stringify(this,null,2)},g.prototype.addNode=function(a,b){return a=e.prototype.addNode.call(this,a,b),this._incidentEdges[a]={},a},g.prototype.delNode=function(a){e.prototype.delNode.call(this,a),delete this._incidentEdges[a]},g.prototype.addEdge=function(a,b,c,d){return e.prototype._addEdge.call(this,a,b,c,d,this._incidentEdges,this._incidentEdges)},g.prototype.delEdge=function(a){e.prototype._delEdge.call(this,a,this._incidentEdges,this._incidentEdges)}},{"./BaseGraph":12,"./util":32,"cp-data":34}],17:[function(a,b,c){function e(a){function e(b,d){c.has(b)||(c.add(b),d.push(b),a.neighbors(b).forEach(function(a){e(a,d)}))}var b=[],c=new d;return a.nodes().forEach(function(a){var c=[];e(a,c),c.length>0&&b.push(c)}),b}var d=a("cp-data").Set;b.exports=e},{"cp-data":34}],18:[function(a,b,c){function e(a,b,c,e){function h(b){var d=a.incidentNodes(b),e=d[0]!==i?d[0]:d[1],h=f[e],k=c(b),l=j.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+b+" Weight: "+k);l<h.distance&&(h.distance=l,h.predecessor=i,g.decrease(e,l))}var f={},g=new d;c=c||function(){return 1},e=e||(a.isDirected()?function(b){return a.outEdges(b)}:function(b){return a.incidentEdges(b)}),a.eachNode(function(a){var c=a===b?0:Number.POSITIVE_INFINITY;f[a]={distance:c},g.add(a,c)});var i,j;while(g.size
()>0){i=g.removeMin(),j=f[i];if(j.distance===Number.POSITIVE_INFINITY)break;e(i).forEach(h)}return f}var d=a("cp-data").PriorityQueue;b.exports=e},{"cp-data":34}],19:[function(a,b,c){function e(a,b,c){var e={};return a.eachNode(function(f){e[f]=d(a,f,b,c)}),e}var d=a("./dijkstra");b.exports=e},{"./dijkstra":18}],20:[function(a,b,c){function e(a){return d(a).filter(function(a){return a.length>1})}var d=a("./tarjan");b.exports=e},{"./tarjan":26}],21:[function(a,b,c){function d(a,b,c){var d={},e=a.nodes();return b=b||function(){return 1},c=c||(a.isDirected()?function(b){return a.outEdges(b)}:function(b){return a.incidentEdges(b)}),e.forEach(function(f){d[f]={},d[f][f]={distance:0},e.forEach(function(a){f!==a&&(d[f][a]={distance:Number.POSITIVE_INFINITY})}),c(f).forEach(function(c){var e=a.incidentNodes(c),h=e[0]!==f?e[0]:e[1],i=b(c);i<d[f][h].distance&&(d[f][h]={distance:i,predecessor:f})})}),e.forEach(function(a){var b=d[a];e.forEach(function(c){var f=d[c];e.forEach(function(c){var d=f[a],e=b[c],g=f[c],h=d.distance+e.distance;h<g.distance&&(g.distance=h,g.predecessor=e.predecessor)})})}),d}b.exports=d},{}],22:[function(a,b,c){function e(a){try{d(a)}catch(b){if(b instanceof d.CycleException)return!1;throw b}return!0}var d=a("./topsort");b.exports=e},{"./topsort":27}],23:[function(a,b,c){function e(a,b,c){function f(b,d){if(e.has(b))throw new Error("The input graph is not a tree: "+a);e.add(b),a.neighbors(b).forEach(function(a){a!==d&&f(a,b)}),c(b)}var e=new d;if(a.isDirected())throw new Error("This function only works for undirected graphs");f(b)}var d=a("cp-data").Set;b.exports=e},{"cp-data":34}],24:[function(a,b,c){function e(a,b,c){function f(b,d){if(e.has(b))throw new Error("The input graph is not a tree: "+a);e.add(b),c(b),a.neighbors(b).forEach(function(a){a!==d&&f(a,b)})}var e=new d;if(a.isDirected())throw new Error("This function only works for undirected graphs");f(b)}var d=a("cp-data").Set;b.exports=e},{"cp-data":34}],25:[function(a,b,c){function f(a,b){function i(c){var d=a.incidentNodes(c),e=d[0]!==h?d[0]:d[1],i=g.priority(e);if(i!==undefined){var j=b(c);j<i&&(f[e]=h,g.decrease(e,j))}}var c=new d,f={},g=new e,h;if(a.order()===0)return c;a.eachNode(function(a){g.add(a,Number.POSITIVE_INFINITY),c.addNode(a)}),g.decrease(a.nodes()[0],0);var j=!1;while(g.size()>0){h=g.removeMin();if(h in f)c.addEdge(null,h,f[h]);else{if(j)throw new Error("Input graph is not connected: "+a);j=!0}a.incidentEdges(h).forEach(i)}return c}var d=a("../Graph"),e=a("cp-data").PriorityQueue;b.exports=f},{"../Graph":16,"cp-data":34}],26:[function(a,b,c){function d(a){function f(h){var i=d[h]={onStack:!0,lowlink:b,index:b++};c.push(h),a.successors(h).forEach(function(a){a in d?d[a].onStack&&(i.lowlink=Math.min(i.lowlink,d[a].index)):(f(a),i.lowlink=Math.min(i.lowlink,d[a].lowlink))});if(i.lowlink===i.index){var j=[],k;do k=c.pop(),d[k].onStack=!1,j.push(k);while(h!==k);e.push(j)}}if(!a.isDirected())throw new Error("tarjan can only be applied to a directed graph. Bad input: "+a);var b=0,c=[],d={},e=[];return a.nodes().forEach(function(a){a in d||f(a)}),e}b.exports=d},{}],27:[function(a,b,c){function d(a){function f(g){if(g in c)throw new e;g in b||(c[g]=!0,b[g]=!0,a.predecessors(g).forEach(function(a){f(a)}),delete c[g],d.push(g))}if(!a.isDirected())throw new Error("topsort can only be applied to a directed graph. Bad input: "+a);var b={},c={},d=[],g=a.sinks();if(a.order()!==0&&g.length===0)throw new e;return a.sinks().forEach(function(a){f(a)}),d}function e(){}b.exports=d,d.CycleException=e,e.prototype.toString=function(){return"Graph has at least one cycle"}},{}],28:[function(a,b,c){function e(a){function b(){a.call(this),this._parents={},this._children={},this._children[null]=new d}return b.prototype=new a,b.prototype.constructor=b,b.prototype.parent=function(a,b){this._strictGetNode(a);if(arguments.length<2)return this._parents[a];if(a===b)throw new Error("Cannot make "+a+" a parent of itself");b!==null&&this._strictGetNode(b),this._children[this._parents[a]].remove(a),this._parents[a]=b,this._children[b].add(a)},b.prototype.children=function(a){return a!==null&&this._strictGetNode(a),this._children[a].keys()},b.prototype.addNode=function(b,c){return b=a.prototype.addNode.call(this,b,c),this._parents[b]=null,this._children[b]=new d,this._children[null].add(b),b},b.prototype.delNode=function(b){var c=this.parent(b);return this._children[b].keys().forEach(function(a){this.parent(a,c)},this),this._children[c].remove(b),delete this._parents[b],delete this._children[b],a.prototype.delNode.call(this,b)},b.prototype.copy=function(){var b=a.prototype.copy.call(this);return this.nodes().forEach(function(a){b.parent(a,this.parent(a))},this),b},b.prototype.filterNodes=function(b){function f(a){var b=c.parent(a);return b===null||d.hasNode(b)?(e[a]=b,b):b in e?e[b]:f(b)}var c=this,d=a.prototype.filterNodes.call(this,b),e={};return d.eachNode(function(a){d.parent(a,f(a))}),d},b}var d=a("cp-data").Set;b.exports=e},{"cp-data":34}],29:[function(a,b,c){function h(a){return Object.prototype.toString.call(a).slice(8,-1)}var d=a("../Graph"),e=a("../Digraph"),f=a("../CGraph"),g=a("../CDigraph");c.decode=function(a,b,c){c=c||e;if(h(a)!=="Array")throw new Error("nodes is not an Array");if(h(b)!=="Array")throw new Error("edges is not an Array");if(typeof c=="string")switch(c){case"graph":c=d;break;case"digraph":c=e;break;case"cgraph":c=f;break;case"cdigraph":c=g;break;default:throw new Error("Unrecognized graph type: "+c)}var i=new c;return a.forEach(function(a){i.addNode(a.id,a.value)}),i.parent&&a.forEach(function(a){a.children&&a.children.forEach(function(b){i.parent(b,a.id)})}),b.forEach(function(a){i.addEdge(a.id,a.u,a.v,a.value)}),i},c.encode=function(a){var b=[],c=[];a.eachNode(function(c,d){var e={id:c,value:d};if(a.children){var f=a.children(c);f.length&&(e.children=f)}b.push(e)}),a.eachEdge(function(a,b,d,e){c.push({id:a,u:b,v:d,value:e})});var h;if(a instanceof g)h="cdigraph";else if(a instanceof f)h="cgraph";else if(a instanceof e)h="digraph";else if(a instanceof d)h="graph";else throw new Error("Couldn't determine type of graph: "+a);return{nodes:b,edges:c,type:h}}},{"../CDigraph":13,"../CGraph":14,"../Digraph":15,"../Graph":16}],30:[function(a,b,c){var d=a("cp-data").Set;c.all=function(){return function(){return!0}},c.nodesFromList=function(a){var b=new d(a);return function(a){return b.has(a)}}},{"cp-data":34}],31:[function(a,b,c){var d=a("./Graph"),e=a("./Digraph");d.prototype.toDigraph=d.prototype.asDirected=function(){var a=new e;return this.eachNode(function(b,c){a.addNode(b,c)}),this.eachEdge(function(b,c,d,e){a.addEdge(null,c,d,e),a.addEdge(null,d,c,e)}),a},e.prototype.toGraph=e.prototype.asUndirected=function(){var a=new d;return this.eachNode(function(b,c){a.addNode(b,c)}),this.eachEdge(function(b,c,d,e){a.addEdge(b,c,d,e)}),a}},{"./Digraph":15,"./Graph":16}],32:[function(a,b,c){c.values=function(a){var b=Object.keys(a),c=b.length,d=new Array(c),e;for(e=0;e<c;++e)d[e]=a[b[e]];return d}},{}],33:[function(a,b,c){b.exports="0.7.4"},{}],34:[function(a,b,c){c.Set=a("./lib/Set"),c.PriorityQueue=a("./lib/PriorityQueue"),c.version=a("./lib/version")},{"./lib/PriorityQueue":35,"./lib/Set":36,"./lib/version":38}],35:[function(a,b,c){function d(){this._arr=[],this._keyIndices={}}b.exports=d,d.prototype.size=function(){return this._arr.length},d.prototype.keys=function(){return this._arr.map(function(a){return a.key})},d.prototype.has=function(a){return a in this._keyIndices},d.prototype.priority=function(a){var b=this._keyIndices[a];if(b!==undefined)return this._arr[b].priority},d.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},d.prototype.add=function(a,b){var c=this._keyIndices;if(a in c)return!1;var d=this._arr,e=d.length;return c[a]=e,d.push({key:a,priority:b}),this._decrease(e),!0},d.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var a=this._arr.pop();return delete this._keyIndices[a.key],this._heapify(0),a.key},d.prototype.decrease=function(a,b){var c=this._keyIndices[a];if(b>this._arr[c].priority)throw new Error("New priority is greater than current priority. Key: "+a+" Old: "+this._arr[c].priority+" New: "+b);this._arr[c].priority=b,this._decrease(c)},d.prototype._heapify=function(a){var b=this._arr,c=2*a,d=c+1,e=a;c<b.length&&(e=b[c].priority<b[e].priority?c:e,d<b.length&&(e=b[d].priority<b[e].priority?d:e),e!==a&&(this._swap(a,e),this._heapify(e)))},d.prototype._decrease=function(a){var b=this._arr,c=b[a].priority,d;while(a!==0){d=a>>1;if(b[d].priority<c)break;this._swap(a,d),a=d}},d.prototype._swap=function(a,b){var c=this._arr,d=this._keyIndices,e=c[a],f=c[b];c[a]=f,c[b]=e,d[f.key]=a,d[e.key]=b}},{}],36:[function(a,b,c){function e(a){this._size=0,this._keys={};if(a)for(var b=0,c=a.length;b<c;++b)this.add(a[b])}function f(a){var b=Object.keys(a),c=b.length,d=new Array(c),e;for(e=0;e<c;++e)d[e]=a[b[e]];return d}var d=a("./util");b.exports=e,e.intersect=function(a){if(a.length===0)return new e;var b=new e(d.isArray(a[0])?a[0]:a[0].keys());for(var c=1,f=a.length;c<f;++c){var g=b.keys(),h=d.isArray(a[c])?new e(a[c]):a[c];for(var i=0,j=g.length;i<j;++i){var k=g[i];h.has(k)||b.remove(k)}}return b},e.union=function(a){var b=d.reduce(a,function(a,b){return a+(b.size?b.size():b.length)},0),c=new Array(b),f=0;for(var g=0,h=a.length;g<h;++g){var i=a[g],j=d.isArray(i)?i:i.keys();for(var k=0,l=j.length;k<l;++k)c[f++]=j[k]}return new e(c)},e.prototype.size=function(){return this._size},e.prototype.keys=function(){return f(this._keys)},e.prototype.has=function(a){return a in this._keys},e.prototype.add=function(a){return a in this._keys?!1:(this._keys[a]=a,++this._size,!0)},e.prototype.remove=function(a){return a in this._keys?(delete this._keys[a],--this._size,!0):!1}},{"./util":37}],37:[function(a,b,c){Array.isArray?c.isArray=Array.isArray:c.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"},"function"!=typeof Array.prototype.reduce?c.reduce=function(a,b,c){"use strict";if(null===a||"undefined"==typeof a)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof b)throw new TypeError(b+" is not a function");var d,e,f=a.length>>>0,g=!1;1<arguments.length&&(e=c,g=!0);for(d=0;f>d;++d)a.hasOwnProperty(d)&&(g?e=b(e,a[d],d,a):(e=a[d],g=!0));if(!g)throw new TypeError("Reduce of empty array with no initial value");return e}:c.reduce=function(a,b,c){return a.reduce(b,c)}},{}],38:[function(a,b,c){b.exports="1.1.3"},{}]},{},[1]);