mermaid/dist/mermaid.slim.min.js

3 lines
95 KiB
JavaScript
Raw Normal View History

2014-11-26 18:50:12 +01:00
!function r(e,t,s){function a(i,o){if(!t[i]){if(!e[i]){var c="function"==typeof require&&require;if(!o&&c)return c(i,!0);if(n)return n(i,!0);throw new Error("Cannot find module '"+i+"'")}var u=t[i]={exports:{}};e[i][0].call(u.exports,function(r){var t=e[i][1][r];return a(t?t:r)},u,u.exports,r,e,t,s)}return t[i].exports}for(var n="function"==typeof require&&require,i=0;i<s.length;i++)a(s[i]);return a}({1:[function(){},{}],2:[function(r,e,t){(function(r){function e(r,e){for(var t=0,s=r.length-1;s>=0;s--){var a=r[s];"."===a?r.splice(s,1):".."===a?(r.splice(s,1),t++):t&&(r.splice(s,1),t--)}if(e)for(;t--;t)r.unshift("..");return r}function s(r,e){if(r.filter)return r.filter(e);for(var t=[],s=0;s<r.length;s++)e(r[s],s,r)&&t.push(r[s]);return t}var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function(r){return a.exec(r).slice(1)};t.resolve=function(){for(var t="",a=!1,n=arguments.length-1;n>=-1&&!a;n--){var i=n>=0?arguments[n]:r.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(t=i+"/"+t,a="/"===i.charAt(0))}return t=e(s(t.split("/"),function(r){return!!r}),!a).join("/"),(a?"/":"")+t||"."},t.normalize=function(r){var a=t.isAbsolute(r),n="/"===i(r,-1);return r=e(s(r.split("/"),function(r){return!!r}),!a).join("/"),r||a||(r="."),r&&n&&(r+="/"),(a?"/":"")+r},t.isAbsolute=function(r){return"/"===r.charAt(0)},t.join=function(){var r=Array.prototype.slice.call(arguments,0);return t.normalize(s(r,function(r){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},t.relative=function(r,e){function s(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=t.resolve(r).substr(1),e=t.resolve(e).substr(1);for(var a=s(r.split("/")),n=s(e.split("/")),i=Math.min(a.length,n.length),o=i,c=0;i>c;c++)if(a[c]!==n[c]){o=c;break}for(var u=[],c=o;c<a.length;c++)u.push("..");return u=u.concat(n.slice(o)),u.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(r){var e=n(r),t=e[0],s=e[1];return t||s?(s&&(s=s.substr(0,s.length-1)),t+s):"."},t.basename=function(r,e){var t=n(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t},t.extname=function(r){return n(r)[3]};var i="b"==="ab".substr(-1)?function(r,e,t){return r.substr(e,t)}:function(r,e,t){return 0>e&&(e=r.length+e),r.substr(e,t)}}).call(this,r("1YiZ5S"))},{"1YiZ5S":3}],3:[function(r,e){function t(){}var s=e.exports={};s.nextTick=function(){var r="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(r)return function(r){return window.setImmediate(r)};if(e){var t=[];return window.addEventListener("message",function(r){var e=r.source;if((e===window||null===e)&&"process-tick"===r.data&&(r.stopPropagation(),t.length>0)){var s=t.shift();s()}},!0),function(r){t.push(r),window.postMessage("process-tick","*")}}return function(r){setTimeout(r,0)}}(),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.on=t,s.addListener=t,s.once=t,s.off=t,s.removeListener=t,s.removeAllListeners=t,s.emit=t,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(r,e,t){(function(r){!function(s){var a="object"==typeof t&&t,n="object"==typeof e&&e&&e.exports==a&&e,i="object"==typeof r&&r;(i.global===i||i.window===i)&&(s=i);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[\x01-\x7F]/g,u=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4
2014-11-26 20:47:22 +01:00
},k=function(r,e){for(var t=-1,s=r.length;++t<s;)if(r[t]==e)return!0;return!1},q=function(r,e){if(!r)return e;var t,s={};for(t in e)s[t]=x(r,t)?r[t]:e[t];return s},S=function(r,e){var t="";return r>=55296&&57343>=r||r>1114111?(e&&C("character reference outside the permissible Unicode range"),"<22>"):x(v,r)?(e&&C("disallowed character reference"),v[r]):(e&&k(w,r)&&C("disallowed character reference"),r>65535&&(r-=65536,t+=D(r>>>10&1023|55296),r=56320|1023&r),t+=D(r))},L=function(r){return"&#x"+r.charCodeAt(0).toString(16).toUpperCase()+";"},C=function(r){throw Error("Parse error: "+r)},_=function(r,e){e=q(e,_.options);var t=e.strict;t&&g.test(r)&&C("forbidden code point");var s=e.encodeEverything,a=e.useNamedReferences,n=e.allowUnsafeSymbols;return s?(r=r.replace(c,function(r){return a&&x(p,r)?"&"+p[r]+";":L(r)}),a&&(r=r.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),a&&(r=r.replace(l,function(r){return"&"+p[r]+";"}))):a?(n||(r=r.replace(h,function(r){return"&"+p[r]+";"})),r=r.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;"),r=r.replace(l,function(r){return"&"+p[r]+";"})):n||(r=r.replace(h,L)),r.replace(o,function(r){var e=r.charCodeAt(0),t=r.charCodeAt(1),s=1024*(e-55296)+t-56320+65536;return"&#x"+s.toString(16).toUpperCase()+";"}).replace(u,L)};_.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var T=function(r,e){e=q(e,T.options);var t=e.strict;return t&&f.test(r)&&C("malformed character reference"),r.replace(m,function(r,s,a,n,i,o,c,u){var l,p,h,d,f;return s?(l=s,p=a,t&&!p&&C("character reference was not terminated by a semicolon"),S(l,t)):n?(h=n,p=i,t&&!p&&C("character reference was not terminated by a semicolon"),l=parseInt(h,16),S(l,t)):o?(d=o,x(y,d)?y[d]:(t&&C("named character reference was not terminated by a semicolon"),r)):(d=c,f=u,f&&e.isAttributeValue?(t&&"="==f&&C("`&` did not start a character reference"),r):(t&&C("named character reference was not terminated by a semicolon"),b[d]+(f||"")))})};T.options={isAttributeValue:!1,strict:!1};var F=function(r){return r.replace(h,function(r){return d[r]})},B={version:"0.5.0",encode:_,decode:T,escape:F,unescape:T};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return B});else if(a&&!a.nodeType)if(n)n.exports=B;else for(var N in B)x(B,N)&&(a[N]=B[N]);else s.he=B}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(r,e,t){(function(e){var s=r("./graphDb"),a=r("./parser/flow"),n=r("./utils"),o=r("./sequenceRenderer"),c=r("he"),u=function(r,e){var t=Object.keys(r),a=function(r,e){var t;for(t=0;t<e.length;t++)"undefined"!=typeof e[t]&&(r=r+e[t]+";");return r};t.forEach(function(t){var n,i,o=r[t],c="",u=s.getClasses();if(o.classes.length>0)for(i=0;i<o.classes.length;i++)c=a(c,u[o.classes[i]].styles);else c=a(c,u.default.styles);c=a(c,o.styles),n=void 0===o.text?o.id:o.text;var l=0,p="";switch(o.type){case"round":l=5,p="rect";break;case"square":p="rect";break;case"diamond":p="question";break;case"odd":p="question"}e.setNode(o.id,{labelType:"html",shape:p,label:n,rx:l,ry:l,style:c,id:o.id})})},l=function(r,e){var t=0;r.forEach(function(r){t++,aHead="arrow_open"===r.type?"none":"vee";var s="";"undefined"!=typeof r.style&&r.style.forEach(function(r){s=s+r+";"}),"undefined"==typeof r.text?"undefined"==typeof r.style?e.setEdge(r.start,r.end,{style:"stroke: #333; stroke-width: 1.5px;fill:none",arrowheadStyle:"fill: #333",arrowhead:aHead},t):e.setEdge(r.start,r.end,{style:s,arrowheadStyle:"fill: #333",arrowhead:aHead},t):"undefined"==typeof r.style?e.setEdge(r.start,r.end,{labelType:"html",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:'<span style="background:#e8e8e8">'+r.text+"</span>",arrowheadStyle:"fill: #333",arrowhead:aHead},t):e.setEdge(r.start,r.end,{labelType:"html",style:s,arrowheadStyle:"fill: #333",label:r.text,arrowhead:aHead},t)})},p=function(r,e){s.clear(),a.parser.yy=s,a.parser.parse(r);var t;t=s.getDirection(),"undefined"==typeof t&&(t="TD");var n=n
},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),e=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+e+"^"},test_match:function(r,e){var t,s,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),s=r[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],t=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t)return t;if(this._backtrack){for(var n in a)this[n]=a[n];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,e,t,s;this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),n=0;n<a.length;n++)if(t=this._input.match(this.rules[a[n]]),t&&(!e||t[0].length>e[0].length)){if(e=t,s=n,this.options.backtrack_lexer){if(r=this.test_match(t,a[n]),r!==!1)return r;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(r=this.test_match(e,a[s]),r!==!1?r:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r?r:this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(r,e,t,s){switch(t){case 0:return 28;case 1:return 7;case 2:return 9;case 3:return 32;case 4:return 14;case 5:return"MINUS";case 6:return"PLUS";case 7:return 18;case 8:return 31;case 9:return"SLASH";case 10:return"PS";case 11:return"PE";case 12:return 21;case 13:return 22;case 14:return 16;case 15:return 8;case 16:return 6}},rules:[/^(?:\n)/,/^(?:sequence\b)/,/^(?:TB\b)/,/^(?:[0-9]+)/,/^(?::)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ()]+)/,/^(?:\/)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\.)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],inclusive:!0}}};return r}();return h.lexer=d,r.prototype=h,h.Parser=r,new r}();"undefined"!=typeof r&&"undefined"!=typeof t&&(t.parser=a,t.Parser=a.Parser,t.parse=function(){return a.parse.apply(a,arguments)},t.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var a=r("fs").readFileSync(r("path").normalize(e[1]),"utf8");return t.parser.parse(a)},"undefined"!=typeof e&&r.main===e&&t.main