[
  {
    "path": ".eslintignore",
    "content": "**/node_modules/\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"extends\": \"defaults\",\n\n  \"env\": {\n    \"browser\": true,\n    \"node\": true\n  },\n\n  \"globals\": {\n    \"$\": true\n  },\n\n  \"rules\": {\n    \"no-console\": 0\n  }\n}\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: [adrai] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: # Replace with a single Patreon username\nopen_collective: # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\ncustom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".gitignore",
    "content": "$ cat .gitignore\n\n# Can ignore specific files\n.settings.xml\n.monitor\n.DS_Store\n.idea\n\n# Use wildcards as well\n*~\n#*.swp\n\n# Can also ignore all directories and files in a directory.\nnode_modules\nnode_modules/**/*\nbin\nreports\nreports/**/*\npackage-lock.json\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"site\"]\n\tpath = site\n\turl = git@github.com:adrai/flowchart.js.git\n"
  },
  {
    "path": ".npmignore",
    "content": "example\nimgs\nsite\nrelease\nbin\nreleasenotes.md\nwebpack.config.js\nindex.html\ndevserver.js\nbower.json\n.eslintignore\n.eslintrc\n.gitmodules"
  },
  {
    "path": "README.md",
    "content": "[![JS.ORG](https://img.shields.io/badge/js.org-flowchart-ffb400.svg?style=flat-square)](http://js.org)\n\n# [flowchart.js](http://flowchart.js.org)\n\nflowchart.js is a flowchart DSL and SVG render that runs in the browser and [terminal](https://github.com/francoislaberge/diagrams/#flowchart).\n\nNodes and connections are defined separately so that nodes can be reused and connections can be quickly changed.\nFine grain changes to node and connection style can also be made right in the DSL.\n\n## Example\n\n```flowchart\nst=>start: Start:>http://www.google.com[blank]\ne=>end:>http://www.google.com\ngetInfo=>input: Input Info\nop1=>operation: My Operation\nsub1=>subroutine: My Subroutine\ncond=>condition: Yes\nor No?:>http://www.google.com\nio=>inputoutput: catch something...\nprintInfo=>output: Print info\npara=>parallel: parallel tasks\n\nst->getInfo->op1->cond\ncond(yes)->io->printInfo->e\ncond(no)->para\npara(path1, bottom)->sub1(right)->op1\npara(path2, top)->op1\n```\n\n![Example Flowchart](/imgs/example.svg)\n\n## CLI\nSee [francoislaberge/diagrams](https://github.com/francoislaberge/diagrams/#flowchart) on how to flowchart.js in the terminal.\n\n## Browser Usage\n\nflowchart.js is on [CDNJS](https://cdnjs.com/libraries/flowchart), feel free to use it.\n\nYou will also need [Raphaël](http://www.raphaeljs.com/), which is also on [CDNJS](https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js).\n\nThe demo html page is at [example/index.html](example/index.html).\n\n## Node Syntax\n`nodeName=>nodeType: nodeText[|flowstate][:>urlLink]`\n\nItems in `[]` are optional.\n\n_nodeName_ defines the nodes variable name within the flowchart document.\n\n_nodeType_ defines what type the node is. See **Node Types** for more information.\n\n_nodeText_ is the text that will be inserted into the node. Newlines are allowed and will be reflected in the rendered node text.\n\n_flowstate_ is optional and uses the `|` operator that specifies extra styling for the node.\n\n_urlLink_ is optional and uses the `:>` operator to specify the url to link to.\n\n## Node Types\nDefines the shape that the node will take.\n\n### start\nUsed as the first node where flows start from.\nDefault text is `Start`.\n\n![start image](imgs/start.png \"start image\")\n\n```flowchart\nst=>start: start\n```\n\n### end\nUsed as the last node where a flow ends.\nDefault text is `End`.\n\n![end image](imgs/end.png \"end image\")\n\n```flowchart\ne=>end: end\n```\n\n### operation\nIndicates that an operation needs to happen in the flow.\n\n![operation image](imgs/operation.png \"operation image\")\n\n```flowchart\nop1=>operation: operation\n```\n\n### inputoutput\nIndicates that IO happens in a flow.\n\n![inputoutput image](imgs/inputoutput.png \"inputoutput image\")\n\n```flowchart\nio=>inputoutput: inputoutput\n```\n\n### input\nIndicates that Input happens in a flow.\n\n![input image](imgs/input.png \"input image\")\n\n```flowchart\ngetInfo=>input: Input info\n```\n\n### output\nIndicates that Output happens in a flow.\n\n![output image](imgs/output.png \"output image\")\n\n```flowchart\nprintInfo=>output: Print info\n```\n\n### subroutine\nIndicates that a subroutine happens in the flow and that there should be another flowchart that documents this subroutine.\n\n![subroutine image](imgs/subroutine.png \"subroutine image\")\n\n```flowchart\nsub1=>subroutine: subroutine\n```\n\n### condition\nAllows for a conditional or logical statement to direct the flow into one of two paths.\n\n![condition image](imgs/condition.png \"condition image\")\n\n```flowchart\ncond=>condition: condition\nYes or No?\n```\n\n### parallel\nAllows for multiple flows to happen simultaneously.\n\n![parallel image](imgs/parallel.png \"parallel image\")\n\n```flowchart\npara=>parallel: parallel\n```\n\n## Connections\nConnections are defined in their own section below the node definitions.\nThe `->` operator specifies a connection from one node to another like `nodeVar1->nodeVar2->nodeVar3`.\n\nNot all nodes need to be specified in one string and can be separaged like so\n\n```flowchart\nnodeVar1->nodeVar2\nnodeVar2->nodeVar3\n```\n\nConnection syntax is as follows:\n\n`<node variable name>[(<specification1>[, <specification2])]-><node variable name>[[(<specification1>[, <specification2])]-><node variable name>]`\n\nItems in `[]` are optional.\n\n### Directions\nThe following directions are available and define the direction the connection will leave the node from. If there are more than one specifiers, it is always the last. All nodes have a default direction making this an optional specification. `<direction>` will be used to indicate that one of the following should be used in its place.\n\n* left\n* right\n* top\n* bottom\n\n### Node Specific Specifiers by Type\nEach node variables has optional specifiers, like direction, and some have special specifiers depending on the node type that are defined below. Specifiers are added after the variable name in `()` and separated with `,` like `nodeVar(spec1, spec2)`.\n\n### start\nOptional direction\n\n`startVar(<direction>)->nextNode`\n\n### end\nNo specifications because connections only go to the end node and do not leave from it.\n\n`previousNode->endVar`\n\n### operation\nOptional direction\n\n`operationVar(<direction>)->nextNode`\n\n### inputoutput\nOptional direction\n\n`inputoutputVar(<direction>)->nextNode`\n\n### subroutine\nOptional direction\n\n`subroutineVar(<direction>)->nextNode`\n\n### condition\nRequired logical specification of `yes` or `no`\n\nOptional direction\n\n```flowchart\nconditionalVar(yes, <direction>)->nextNode1\nconditionalVar(no,  <direction>)->nextNode2\n```\n\n### parallel\nRequired path specification of `path1`, `path2`, or `path3`\n\nOptional direction\n\n```flowchart\nparallelVar(path1, <direction>)->nextNode1\nparallelVar(path2, <direction>)->nextNode2\nparallelVar(path3, <direction>)->nextNode3\n```\n\n## Links\nA external link can be added to a node with the `:>` operator.\n\nThe `st` node is linked to `http://www.google.com` and will open a new tab because `[blank]` is at the end of the URL.\n\nThe `e` node is linked to `http://www.yahoo.com` and will cause the page to navigate to that page instead of opening a new tab.\n\n```flowchart\nst=>start: Start:>http://www.google.com[blank]\ne=>end: End:>http://www.yahoo.com\n```\n\n## Advice\nSymbols that should possibly not be used in the text: `=>` and `->` and `:>` and `|` and `@>` and `:$`\n\nIf you want to emphasize a specific path in your flowchart, you can additionally define it like this:\n\n```\nst@>op1({\"stroke\":\"Red\"})@>cond({\"stroke\":\"Red\",\"stroke-width\":6,\"arrow-end\":\"classic-wide-long\"})@>c2({\"stroke\":\"Red\"})@>op2({\"stroke\":\"Red\"})@>e({\"stroke\":\"Red\"})\n```\n\n## Custom names for branches\n\n```\nst=>start: Start:>http://www.google.com[blank]\ne=>end:>http://www.google.com\nop1=>operation: My Operation\nsub1=>subroutine: My Subroutine\ncond=>condition: linear or polynomial :>http://www.google.com\nio=>inputoutput: catch something...\npara=>parallel: 3 possibilities\n\nst->op1->cond\ncond(true@linear)->io->e\ncond(false@polynomial)->sub1(right)\nsub1(right)->para\npara(path1@an1, top)->cond\npara(path2@an2, right)->op1\npara(path3@an3, bottom)->e\n```\n<details>\n  \n  <summary>Demonstration</summary>\n  \n ![img](https://user-images.githubusercontent.com/1086194/137810516-0d7d7307-fc55-466f-b06d-a6ca9f6b8785.png)\n \n</details>\n\n## Contributors\n\nvia [GitHub](https://github.com/adrai/flowchart.js/graphs/contributors)\n\n## Thanks\n\nMany thanks to [js-sequence-diagrams](http://bramp.github.io/js-sequence-diagrams/) which greatly inspired this project, and forms the basis for the syntax.\n"
  },
  {
    "path": "devserver.js",
    "content": "var path = require('path');\nvar express = require('express');\nvar webpack = require('webpack');\nvar config = require('./webpack.config');\n\nvar port = 8000;\nvar app = express();\nvar compiler = webpack(config);\n\napp.use(express.static(process.cwd()));\n\napp.use(require('webpack-dev-middleware')(compiler, {\n\tnoInfo: true,\n\tpublicPath: config.output.publicPath\n}));\n\napp.use(require('webpack-hot-middleware')(compiler));\n\napp.get('/', function (req, res) {\n\tres.sendFile(path.join(__dirname, 'index.html'));\n});\n\napp.listen(port, '0.0.0.0', function (err) {\n\tif (err) {\n\t\tconsole.log(err);\n\t\treturn;\n\t}\n\n\tconsole.log('Listening at http://0.0.0.0:%s', port);\n});\n"
  },
  {
    "path": "example/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\">\n        <title>flowchart.js · Playground</title>\n        <style type=\"text/css\">\n          .end-element { fill : #FFCCFF; }\n        </style>\n        <script src=\"http://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js\"></script>\n        <script src=\"http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js\"></script>\n        <script src=\"http://flowchart.js.org/flowchart-latest.js\"></script>\n        <!-- <script src=\"../release/flowchart.min.js\"></script> -->\n        <script>\n\n            window.onload = function () {\n                var btn = document.getElementById(\"run\"),\n                    cd = document.getElementById(\"code\"),\n                    chart;\n\n                (btn.onclick = function () {\n                    var code = cd.value;\n\n                    if (chart) {\n                      chart.clean();\n                    }\n\n                    chart = flowchart.parse(code);\n                    chart.drawSVG('canvas', {\n                      // 'x': 30,\n                      // 'y': 50,\n                      'line-width': 3,\n                      'maxWidth': 3,//ensures the flowcharts fits within a certian width\n                      'line-length': 50,\n                      'text-margin': 10,\n                      'font-size': 14,\n                      'font': 'normal',\n                      'font-family': 'Helvetica',\n                      'font-weight': 'normal',\n                      'font-color': 'black',\n                      'line-color': 'black',\n                      'element-color': 'black',\n                      'fill': 'white',\n                      'yes-text': 'yes',\n                      'no-text': 'no',\n                      'arrow-end': 'block',\n                      'scale': 1,\n                      'symbols': {\n                        'start': {\n                          'font-color': 'red',\n                          'element-color': 'green',\n                          'fill': 'yellow'\n                        },\n                        'end':{\n                          'class': 'end-element'\n                        }\n                      },\n                      'flowstate' : {\n                        'past' : { 'fill' : '#CCCCCC', 'font-size' : 12},\n                        'current' : {'fill' : 'yellow', 'font-color' : 'red', 'font-weight' : 'bold'},\n                        'future' : { 'fill' : '#FFFF99'},\n                        'request' : { 'fill' : 'blue'},\n                        'invalid': {'fill' : '#444444'},\n                        'approved' : { 'fill' : '#58C4A3', 'font-size' : 12, 'yes-text' : 'APPROVED', 'no-text' : 'n/a' },\n                        'rejected' : { 'fill' : '#C45879', 'font-size' : 12, 'yes-text' : 'n/a', 'no-text' : 'REJECTED' }\n                      }\n                    });\n\n                    $('[id^=sub1]').click(function(){\n                      alert('info here');\n                    });\n                })();\n\n            };\n\n            function myFunction(event, node) {\n              console.log(\"You just clicked this node:\", node);\n            }\n            \n        </script>\n    </head>\n    <body>\n        <div><textarea id=\"code\" style=\"width: 100%;\" rows=\"11\">\nst=>start: Start|past:>http://www.google.com[blank]\ne=>end: End:>http://www.google.com\nop1=>operation: My Operation|past:$myFunction\nop2=>operation: Stuff|current\nsub1=>subroutine: My Subroutine|invalid\ncond=>condition: Yes\nor No?|approved:>http://www.google.com\nc2=>condition: Good idea|rejected\nio=>inputoutput: catch something...|request\npara=>parallel: parallel tasks\n\nst->op1(right)->cond\ncond(yes, right)->c2\ncond(no)->para\nc2(true)->io->e\nc2(false)->e\n\npara(path1, bottom)->sub1(left)->op1\npara(path2, right)->op2->e\n\nst@>op1({\"stroke\":\"Red\"})@>cond({\"stroke\":\"Red\",\"stroke-width\":6,\"arrow-end\":\"classic-wide-long\"})@>c2({\"stroke\":\"Red\"})@>op2({\"stroke\":\"Red\"})@>e({\"stroke\":\"Red\"})</textarea></div>\n        <div><button id=\"run\" type=\"button\">Run</button></div>\n        <div id=\"canvas\"></div>\n    </body>\n</html>\n"
  },
  {
    "path": "example/loadFile.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>flowchart.js · Playground</title>\n    <style type=\"text/css\">\n        .end-element { background-color : #FFCCFF; }\n    </style>\n    <script src=\"http://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js\"></script>\n    <script src=\"http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js\"></script>\n    <script src=\"http://flowchart.js.org/flowchart-latest.js\"></script>\n    <!--<script src=\"../bin/flowchart-latest.js\"></script>-->\n    <!--<script src=\"../release/flowchart-1.4.1.min.js\"></script>-->\n    <script>\n        $(document).ready(function() {\n            $.ajax({\n                url : \"test.txt\",\n                dataType : \"text\",\n                success : function(data) {\n                    var chart = flowchart.parse(data);\n                    chart.drawSVG('canvas');\n                }\n            });\n        });\n    </script>\n</head>\n<body>\n<div id=\"canvas\"></div>\n</body>\n</html>\n"
  },
  {
    "path": "example/test.txt",
    "content": "st=>start: Start:>http://www.google.com[blank]\ne=>end:>http://www.google.com\nop1=>operation: My Ooooperation:$myFunction\nsub1=>subroutine: My Subroutine\ncond=>condition: Yes\nor No?:>http://www.google.com\nio=>inputoutput: catch something...\n\nst->op1->cond\ncond(yes)->io->e\ncond(no)->sub1(right)->op1"
  },
  {
    "path": "index.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <title>Demo page</title>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\">\n  </head>\n  <body>\n    <div id=\"chart\">\n      st=>start: Start|past:>http://www.google.com[blank]\n      e=>end: End:>http://www.google.com\n      op1=>operation: My Operation|past:$myFunction\n      op2=>operation: Stuff|current\n      sub1=>subroutine: My Subroutine|invalid\n      cond=>condition: Yes\n      or No?|approved:>http://www.google.com\n      c2=>condition: Good idea|rejected\n      io=>inputoutput: catch something...|request\n      para=>parallel: parallel tasks\n      in=>input: some in\n      out=>output: some out\n\n      st->op1(right)->cond\n      cond(yes, right)->c2\n      cond(no)->para\n      c2(true)->io->e\n      c2(false)->e\n\n      para(path1, left)->sub1(top)->op1\n      para(path2, right)->op2->e\n      para(path3, bottom)->in->out->e\n    </div>\n    <script>\n      function myFunction(event, node) {\n        console.log(\"You just clicked this node:\", node);\n      }\n    </script>\n\t\t<script src=\"/node_modules/jquery/dist/jquery.js\"></script>\n    <script src=\"/node_modules/raphael/raphael.js\"></script>\n    <script src=\"/release/flowchart.js\"></script>\n\t\t<script>\n\t\t$('#chart').flowChart();\n\t\t</script>\n  </body>\n</html>\n"
  },
  {
    "path": "index.js",
    "content": "require('./src/flowchart.shim');\nvar parse = require('./src/flowchart.parse');\nrequire('./src/jquery-plugin');\n\nvar FlowChart = {\n\tparse: parse\n};\n\nif (typeof window !== 'undefined') {\n\twindow.flowchart = FlowChart;\n}\n\nmodule.exports = FlowChart;\n"
  },
  {
    "path": "license",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2023 Adriano Raiano\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"author\": \"adrai\",\n  \"name\": \"flowchart.js\",\n  \"version\": \"1.18.0\",\n  \"main\": \"./index\",\n  \"private\": false,\n  \"engines\": {\n    \"node\": \">=4.0.0\"\n  },\n  \"dependencies\": {\n    \"raphael\": \"2.3.0\"\n  },\n  \"types\": \"types/index.d.ts\",\n  \"devDependencies\": {\n    \"eslint\": \"^4.18.2\",\n    \"eslint-config-defaults\": \"^8.0.2\",\n    \"express\": \">= 0.0.1\",\n    \"jquery\": \"^3.4.0\",\n    \"lodash\": \">=0.2.1\",\n    \"moment\": \"^2.11.1\",\n    \"webpack\": \"^1.12.11\",\n    \"webpack-dev-middleware\": \"^1.4.0\",\n    \"webpack-hot-middleware\": \"^2.6.0\"\n  },\n  \"scripts\": {\n    \"init\": \"git submodule init && git submodule update && git submodule status\",\n    \"start\": \"node devserver.js\",\n    \"lint\": \"eslint src\",\n    \"build:unminified\": \"NODE_ENV=production webpack -d --config webpack.config.js\",\n    \"build:minified\": \"NODE_ENV=production MINIFIED=1 webpack -d --config webpack.config.js\",\n    \"build\": \"npm run build:unminified && npm run build:minified && cp ./release/flowchart.js ./site/flowchart-latest.js\",\n    \"test\": \"npm run lint\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/adrai/flowchart.js.git\"\n  },\n  \"keywords\": [\n    \"flowchart\",\n    \"client\",\n    \"script\"\n  ],\n  \"homepage\": \"http://flowchart.js.org/\",\n  \"license\": \"MIT\"\n}\n"
  },
  {
    "path": "release/flowchart.js",
    "content": "// flowchart.js, v1.18.0\n// Copyright (c)2023 Adriano Raiano (adrai).\n// Distributed under MIT license\n// http://adrai.github.io/flowchart.js\n\n!function(root, factory) {\n    if (\"object\" == typeof exports && \"object\" == typeof module) module.exports = factory(require(\"Raphael\")); else if (\"function\" == typeof define && define.amd) define([ \"Raphael\" ], factory); else {\n        var a = factory(\"object\" == typeof exports ? require(\"Raphael\") : root.Raphael);\n        for (var i in a) (\"object\" == typeof exports ? exports : root)[i] = a[i];\n    }\n}(this, function(__WEBPACK_EXTERNAL_MODULE_18__) {\n    /******/\n    return function(modules) {\n        /******/\n        /******/\n        // The require function\n        /******/\n        function __webpack_require__(moduleId) {\n            /******/\n            /******/\n            // Check if module is in cache\n            /******/\n            if (installedModules[moduleId]) /******/\n            return installedModules[moduleId].exports;\n            /******/\n            /******/\n            // Create a new module (and put it into the cache)\n            /******/\n            var module = installedModules[moduleId] = {\n                /******/\n                exports: {},\n                /******/\n                id: moduleId,\n                /******/\n                loaded: !1\n            };\n            /******/\n            /******/\n            // Return the exports of the module\n            /******/\n            /******/\n            /******/\n            // Execute the module function\n            /******/\n            /******/\n            /******/\n            // Flag the module as loaded\n            /******/\n            return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), \n            module.loaded = !0, module.exports;\n        }\n        // webpackBootstrap\n        /******/\n        // The module cache\n        /******/\n        var installedModules = {};\n        /******/\n        /******/\n        // Load entry module and return exports\n        /******/\n        /******/\n        /******/\n        /******/\n        // expose the modules object (__webpack_modules__)\n        /******/\n        /******/\n        /******/\n        // expose the module cache\n        /******/\n        /******/\n        /******/\n        // __webpack_public_path__\n        /******/\n        return __webpack_require__.m = modules, __webpack_require__.c = installedModules, \n        __webpack_require__.p = \"\", __webpack_require__(0);\n    }([ /* 0 */\n    /*!******************!*\\\n  !*** ./index.js ***!\n  \\******************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        __webpack_require__(/*! ./src/flowchart.shim */ 9);\n        var parse = __webpack_require__(/*! ./src/flowchart.parse */ 4);\n        __webpack_require__(/*! ./src/jquery-plugin */ 17);\n        var FlowChart = {\n            parse: parse\n        };\n        \"undefined\" != typeof window && (window.flowchart = FlowChart), module.exports = FlowChart;\n    }, /* 1 */\n    /*!**********************************!*\\\n  !*** ./src/flowchart.helpers.js ***!\n  \\**********************************/\n    /***/\n    function(module, exports) {\n        function _defaults(options, defaultOptions) {\n            if (!options || \"function\" == typeof options) return defaultOptions;\n            var merged = {};\n            for (var attrname in defaultOptions) merged[attrname] = defaultOptions[attrname];\n            for (attrname in options) options[attrname] && (\"object\" == typeof merged[attrname] ? merged[attrname] = _defaults(merged[attrname], options[attrname]) : merged[attrname] = options[attrname]);\n            return merged;\n        }\n        function _inherits(ctor, superCtor) {\n            if (\"function\" == typeof Object.create) // implementation from standard node.js 'util' module\n            ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n                constructor: {\n                    value: ctor,\n                    enumerable: !1,\n                    writable: !0,\n                    configurable: !0\n                }\n            }); else {\n                // old school shim for old browsers\n                ctor.super_ = superCtor;\n                var TempCtor = function() {};\n                TempCtor.prototype = superCtor.prototype, ctor.prototype = new TempCtor(), ctor.prototype.constructor = ctor;\n            }\n        }\n        // move dependent functions to a container so that\n        // they can be overriden easier in no jquery environment (node.js)\n        module.exports = {\n            defaults: _defaults,\n            inherits: _inherits\n        };\n    }, /* 2 */\n    /*!*********************************!*\\\n  !*** ./src/flowchart.symbol.js ***!\n  \\*********************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Symbol(chart, options, symbol) {\n            this.chart = chart, this.group = this.chart.paper.set(), this.symbol = symbol, this.connectedTo = [], \n            this.symbolType = options.symbolType, this.flowstate = options.flowstate || \"future\", \n            this.lineStyle = options.lineStyle || {}, this.key = options.key || \"\", this.leftLines = [], \n            this.rightLines = [], this.topLines = [], this.bottomLines = [], this.params = options.params, \n            this.next_direction = options.next && options.direction_next ? options.direction_next : void 0, \n            this.text = this.chart.paper.text(0, 0, options.text), //Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t\n            options.key && (this.text.node.id = options.key + \"t\"), this.text.node.setAttribute(\"class\", this.getAttr(\"class\") + \"t\"), \n            this.text.attr({\n                \"text-anchor\": \"start\",\n                x: this.getAttr(\"text-margin\"),\n                fill: this.getAttr(\"font-color\"),\n                \"font-size\": this.getAttr(\"font-size\")\n            });\n            var font = this.getAttr(\"font\"), fontF = this.getAttr(\"font-family\"), fontW = this.getAttr(\"font-weight\");\n            font && this.text.attr({\n                font: font\n            }), fontF && this.text.attr({\n                \"font-family\": fontF\n            }), fontW && this.text.attr({\n                \"font-weight\": fontW\n            }), options.link && this.text.attr(\"href\", options.link), //ndrqu Add click function with event and options params\n            options.function && (this.text.attr({\n                cursor: \"pointer\"\n            }), this.text.node.addEventListener(\"click\", function(evt) {\n                window[options.function](evt, options);\n            }, !1)), options.target && this.text.attr(\"target\", options.target);\n            var maxWidth = this.getAttr(\"maxWidth\");\n            if (maxWidth) {\n                for (var words = options.text.split(\" \"), tempText = \"\", i = 0, ii = words.length; i < ii; i++) {\n                    var word = words[i];\n                    this.text.attr(\"text\", tempText + \" \" + word), tempText += this.text.getBBox().width > maxWidth ? \"\\n\" + word : \" \" + word;\n                }\n                this.text.attr(\"text\", tempText.substring(1));\n            }\n            if (this.group.push(this.text), symbol) {\n                var tmpMargin = this.getAttr(\"text-margin\");\n                symbol.attr({\n                    fill: this.getAttr(\"fill\"),\n                    stroke: this.getAttr(\"element-color\"),\n                    \"stroke-width\": this.getAttr(\"line-width\"),\n                    width: this.text.getBBox().width + 2 * tmpMargin,\n                    height: this.text.getBBox().height + 2 * tmpMargin\n                }), symbol.node.setAttribute(\"class\", this.getAttr(\"class\"));\n                var roundness = this.getAttr(\"roundness\");\n                isNaN(roundness) || (symbol.node.setAttribute(\"ry\", roundness), symbol.node.setAttribute(\"rx\", roundness)), \n                options.link && symbol.attr(\"href\", options.link), options.target && symbol.attr(\"target\", options.target), \n                //ndrqu Add click function with event and options params\n                options.function && (symbol.node.addEventListener(\"click\", function(evt) {\n                    window[options.function](evt, options);\n                }, !1), symbol.attr({\n                    cursor: \"pointer\"\n                })), options.key && (symbol.node.id = options.key), this.group.push(symbol), symbol.insertBefore(this.text), \n                this.text.attr({\n                    y: symbol.getBBox().height / 2\n                }), this.initialize();\n            }\n        }\n        var drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawLine = drawAPI.drawLine, checkLineIntersection = drawAPI.checkLineIntersection;\n        /* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */\n        Symbol.prototype.getAttr = function(attName) {\n            if (this.chart) {\n                var opt1, opt3 = this.chart.options ? this.chart.options[attName] : void 0, opt2 = this.chart.options.symbols ? this.chart.options.symbols[this.symbolType][attName] : void 0;\n                return this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate] && (opt1 = this.chart.options.flowstate[this.flowstate][attName]), \n                opt1 || opt2 || opt3;\n            }\n        }, Symbol.prototype.initialize = function() {\n            this.group.transform(\"t\" + this.getAttr(\"line-width\") + \",\" + this.getAttr(\"line-width\")), \n            this.width = this.group.getBBox().width, this.height = this.group.getBBox().height;\n        }, Symbol.prototype.getCenter = function() {\n            return {\n                x: this.getX() + this.width / 2,\n                y: this.getY() + this.height / 2\n            };\n        }, Symbol.prototype.getX = function() {\n            return this.group.getBBox().x;\n        }, Symbol.prototype.getY = function() {\n            return this.group.getBBox().y;\n        }, Symbol.prototype.shiftX = function(x) {\n            this.group.transform(\"t\" + (this.getX() + x) + \",\" + this.getY());\n        }, Symbol.prototype.setX = function(x) {\n            this.group.transform(\"t\" + x + \",\" + this.getY());\n        }, Symbol.prototype.shiftY = function(y) {\n            this.group.transform(\"t\" + this.getX() + \",\" + (this.getY() + y));\n        }, Symbol.prototype.setY = function(y) {\n            this.group.transform(\"t\" + this.getX() + \",\" + y);\n        }, Symbol.prototype.getTop = function() {\n            var y = this.getY(), x = this.getX() + this.width / 2;\n            return {\n                x: x,\n                y: y\n            };\n        }, Symbol.prototype.getBottom = function() {\n            var y = this.getY() + this.height, x = this.getX() + this.width / 2;\n            return {\n                x: x,\n                y: y\n            };\n        }, Symbol.prototype.getLeft = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX();\n            return {\n                x: x,\n                y: y\n            };\n        }, Symbol.prototype.getRight = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width;\n            return {\n                x: x,\n                y: y\n            };\n        }, Symbol.prototype.render = function() {\n            if (this.next) {\n                var self = this, lineLength = this.getAttr(\"line-length\");\n                if (\"right\" === this.next_direction) {\n                    var rightPoint = this.getRight();\n                    this.next.isPositioned || (this.next.setY(rightPoint.y - this.next.height / 2), \n                    this.next.shiftX(this.group.getBBox().x + this.width + lineLength), function shift() {\n                        for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) {\n                            symb = self.chart.symbols[i];\n                            var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n                            if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width / 2) {\n                                hasSymbolUnder = !0;\n                                break;\n                            }\n                        }\n                        if (hasSymbolUnder) {\n                            if (\"end\" === self.next.symbolType) return;\n                            self.next.setX(symb.getX() + symb.width + lineLength), shift();\n                        }\n                    }(), this.next.isPositioned = !0, this.next.render());\n                } else if (\"left\" === this.next_direction) {\n                    var leftPoint = this.getLeft();\n                    this.next.isPositioned || (this.next.setY(leftPoint.y - this.next.height / 2), this.next.shiftX(-(this.group.getBBox().x + this.width + lineLength)), \n                    function shift() {\n                        for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) {\n                            symb = self.chart.symbols[i];\n                            var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n                            if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width / 2) {\n                                hasSymbolUnder = !0;\n                                break;\n                            }\n                        }\n                        if (hasSymbolUnder) {\n                            if (\"end\" === self.next.symbolType) return;\n                            self.next.setX(symb.getX() + symb.width + lineLength), shift();\n                        }\n                    }(), this.next.isPositioned = !0, this.next.render());\n                } else {\n                    var bottomPoint = this.getBottom();\n                    this.next.isPositioned || (this.next.shiftY(this.getY() + this.height + lineLength), \n                    this.next.setX(bottomPoint.x - this.next.width / 2), this.next.isPositioned = !0, \n                    this.next.render());\n                }\n            }\n        }, Symbol.prototype.renderLines = function() {\n            this.next && (this.next_direction ? this.drawLineTo(this.next, this.getAttr(\"arrow-text\") || \"\", this.next_direction) : this.drawLineTo(this.next, this.getAttr(\"arrow-text\") || \"\"));\n        }, Symbol.prototype.drawLineTo = function(symbol, text, origin) {\n            this.connectedTo.indexOf(symbol) < 0 && this.connectedTo.push(symbol);\n            var line, yOffset, x = this.getCenter().x, y = this.getCenter().y, right = this.getRight(), bottom = this.getBottom(), top = this.getTop(), left = this.getLeft(), symbolX = symbol.getCenter().x, symbolY = symbol.getCenter().y, symbolTop = symbol.getTop(), symbolRight = symbol.getRight(), symbolLeft = symbol.getLeft(), isOnSameColumn = x === symbolX, isOnSameLine = y === symbolY, isUnder = y < symbolY, isUpper = y > symbolY || this === symbol, isLeft = x > symbolX, isRight = x < symbolX, maxX = 0, lineLength = this.getAttr(\"line-length\"), lineWith = this.getAttr(\"line-width\");\n            if (origin && \"bottom\" !== origin || !isOnSameColumn || !isUnder) if (origin && \"right\" !== origin || !isOnSameLine || !isRight) if (origin && \"left\" !== origin || !isOnSameLine || !isLeft) if (origin && \"right\" !== origin || !isOnSameColumn || !isUpper) if (origin && \"right\" !== origin || !isOnSameColumn || !isUnder) if (origin && \"bottom\" !== origin || !isLeft) if (origin && \"bottom\" !== origin || !isRight || !isUnder) if (origin && \"bottom\" !== origin || !isRight) if (origin && \"right\" === origin && isLeft) yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length), \n            line = drawLine(this.chart, right, [ {\n                x: right.x + lineLength / 2,\n                y: right.y\n            }, {\n                x: right.x + lineLength / 2,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0, \n            symbol.topEnd = !0, maxX = right.x + lineLength / 2; else if (origin && \"right\" === origin && isRight) yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length), \n            line = drawLine(this.chart, right, [ {\n                x: symbolTop.x,\n                y: right.y - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - yOffset\n            } ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0, \n            symbol.topEnd = !0, maxX = right.x + lineLength / 2; else if (origin && \"bottom\" === origin && isOnSameColumn && isUpper) yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length), \n            line = drawLine(this.chart, bottom, [ {\n                x: bottom.x,\n                y: bottom.y + lineLength / 2 - yOffset\n            }, {\n                x: right.x + lineLength / 2,\n                y: bottom.y + lineLength / 2 - yOffset\n            }, {\n                x: right.x + lineLength / 2,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0, \n            symbol.topEnd = !0, maxX = bottom.x + lineLength / 2; else if (\"left\" === origin && isOnSameColumn && isUpper) {\n                var diffX = left.x - lineLength / 2;\n                symbolLeft.x < left.x && (diffX = symbolLeft.x - lineLength / 2), yOffset = 10 * Math.max(symbol.topLines.length, this.leftLines.length), \n                line = drawLine(this.chart, left, [ {\n                    x: diffX,\n                    y: left.y - yOffset\n                }, {\n                    x: diffX,\n                    y: symbolTop.y - lineLength / 2 - yOffset\n                }, {\n                    x: symbolTop.x,\n                    y: symbolTop.y - lineLength / 2 - yOffset\n                }, {\n                    x: symbolTop.x,\n                    y: symbolTop.y\n                } ], text), this.leftLines.push(line), symbol.topLines.push(line), this.leftStart = !0, \n                symbol.topEnd = !0, maxX = left.x;\n            } else \"left\" === origin ? (yOffset = 10 * Math.max(symbol.topLines.length, this.leftLines.length), \n            line = drawLine(this.chart, left, [ {\n                x: symbolTop.x + (left.x - symbolTop.x) / 2,\n                y: left.y\n            }, {\n                x: symbolTop.x + (left.x - symbolTop.x) / 2,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.leftLines.push(line), symbol.topLines.push(line), this.leftStart = !0, \n            symbol.topEnd = !0, maxX = left.x) : \"top\" === origin && (yOffset = 10 * Math.max(symbol.topLines.length, this.topLines.length), \n            line = drawLine(this.chart, top, [ {\n                x: top.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.topLines.push(line), symbol.topLines.push(line), this.topStart = !0, \n            symbol.topEnd = !0, maxX = top.x); else yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length), \n            line = drawLine(this.chart, bottom, [ {\n                x: bottom.x,\n                y: bottom.y + lineLength / 2 - yOffset\n            }, {\n                x: bottom.x + (bottom.x - symbolTop.x) / 2,\n                y: bottom.y + lineLength / 2 - yOffset\n            }, {\n                x: bottom.x + (bottom.x - symbolTop.x) / 2,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0, \n            symbol.topEnd = !0, maxX = bottom.x + (bottom.x - symbolTop.x) / 2; else yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length), \n            line = drawLine(this.chart, bottom, [ {\n                x: bottom.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0, \n            symbol.topEnd = !0, maxX = bottom.x, symbolTop.x > maxX && (maxX = symbolTop.x); else yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length), \n            line = this.leftEnd && isUpper ? drawLine(this.chart, bottom, [ {\n                x: bottom.x,\n                y: bottom.y + lineLength / 2 - yOffset\n            }, {\n                x: bottom.x + (bottom.x - symbolTop.x) / 2,\n                y: bottom.y + lineLength / 2 - yOffset\n            }, {\n                x: bottom.x + (bottom.x - symbolTop.x) / 2,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text) : drawLine(this.chart, bottom, [ {\n                x: bottom.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0, \n            symbol.topEnd = !0, maxX = bottom.x + (bottom.x - symbolTop.x) / 2; else yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length), \n            line = drawLine(this.chart, right, [ {\n                x: right.x + lineLength / 2,\n                y: right.y - yOffset\n            }, {\n                x: right.x + lineLength / 2,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0, \n            symbol.topEnd = !0, maxX = right.x + lineLength / 2; else yOffset = 10 * Math.max(symbol.topLines.length, this.rightLines.length), \n            line = drawLine(this.chart, right, [ {\n                x: right.x + lineLength / 2,\n                y: right.y - yOffset\n            }, {\n                x: right.x + lineLength / 2,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y - lineLength / 2 - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text), this.rightLines.push(line), symbol.topLines.push(line), this.rightStart = !0, \n            symbol.topEnd = !0, maxX = right.x + lineLength / 2; else 0 === symbol.rightLines.length && 0 === this.leftLines.length ? line = drawLine(this.chart, left, symbolRight, text) : (yOffset = 10 * Math.max(symbol.rightLines.length, this.leftLines.length), \n            line = drawLine(this.chart, right, [ {\n                x: right.x,\n                y: right.y - yOffset\n            }, {\n                x: right.x,\n                y: symbolRight.y - yOffset\n            }, {\n                x: symbolRight.x,\n                y: symbolRight.y - yOffset\n            }, {\n                x: symbolRight.x,\n                y: symbolRight.y\n            } ], text)), this.leftLines.push(line), symbol.rightLines.push(line), this.leftStart = !0, \n            symbol.rightEnd = !0, maxX = symbolRight.x; else 0 === symbol.leftLines.length && 0 === this.rightLines.length ? line = drawLine(this.chart, right, symbolLeft, text) : (yOffset = 10 * Math.max(symbol.leftLines.length, this.rightLines.length), \n            line = drawLine(this.chart, right, [ {\n                x: right.x,\n                y: right.y - yOffset\n            }, {\n                x: right.x,\n                y: symbolLeft.y - yOffset\n            }, {\n                x: symbolLeft.x,\n                y: symbolLeft.y - yOffset\n            }, {\n                x: symbolLeft.x,\n                y: symbolLeft.y\n            } ], text)), this.rightLines.push(line), symbol.leftLines.push(line), this.rightStart = !0, \n            symbol.leftEnd = !0, maxX = symbolLeft.x; else 0 === symbol.topLines.length && 0 === this.bottomLines.length ? line = drawLine(this.chart, bottom, symbolTop, text) : (yOffset = 10 * Math.max(symbol.topLines.length, this.bottomLines.length), \n            line = drawLine(this.chart, bottom, [ {\n                x: symbolTop.x,\n                y: symbolTop.y - yOffset\n            }, {\n                x: symbolTop.x,\n                y: symbolTop.y\n            } ], text)), this.bottomLines.push(line), symbol.topLines.push(line), this.bottomStart = !0, \n            symbol.topEnd = !0, maxX = bottom.x;\n            if (//update line style\n            this.lineStyle[symbol.key] && line && line.attr(this.lineStyle[symbol.key]), line) {\n                for (var l = 0, llen = this.chart.lines.length; l < llen; l++) for (var otherLine = this.chart.lines[l], ePath = otherLine.attr(\"path\"), lPath = line.attr(\"path\"), iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {\n                    var newPath = [];\n                    newPath.push([ \"M\", ePath[iP][1], ePath[iP][2] ]), newPath.push([ \"L\", ePath[iP + 1][1], ePath[iP + 1][2] ]);\n                    for (var line1_from_x = newPath[0][1], line1_from_y = newPath[0][2], line1_to_x = newPath[1][1], line1_to_y = newPath[1][2], lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {\n                        var newLinePath = [];\n                        newLinePath.push([ \"M\", lPath[lP][1], lPath[lP][2] ]), newLinePath.push([ \"L\", lPath[lP + 1][1], lPath[lP + 1][2] ]);\n                        var line2_from_x = newLinePath[0][1], line2_from_y = newLinePath[0][2], line2_to_x = newLinePath[1][1], line2_to_y = newLinePath[1][2], res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);\n                        if (res.onLine1 && res.onLine2) {\n                            var newSegment;\n                            line2_from_y === line2_to_y ? line2_from_x > line2_to_x ? (newSegment = [ \"L\", res.x + 2 * lineWith, line2_from_y ], \n                            lPath.splice(lP + 1, 0, newSegment), newSegment = [ \"C\", res.x + 2 * lineWith, line2_from_y, res.x, line2_from_y - 4 * lineWith, res.x - 2 * lineWith, line2_from_y ], \n                            lPath.splice(lP + 2, 0, newSegment), line.attr(\"path\", lPath)) : (newSegment = [ \"L\", res.x - 2 * lineWith, line2_from_y ], \n                            lPath.splice(lP + 1, 0, newSegment), newSegment = [ \"C\", res.x - 2 * lineWith, line2_from_y, res.x, line2_from_y - 4 * lineWith, res.x + 2 * lineWith, line2_from_y ], \n                            lPath.splice(lP + 2, 0, newSegment), line.attr(\"path\", lPath)) : line2_from_y > line2_to_y ? (newSegment = [ \"L\", line2_from_x, res.y + 2 * lineWith ], \n                            lPath.splice(lP + 1, 0, newSegment), newSegment = [ \"C\", line2_from_x, res.y + 2 * lineWith, line2_from_x + 4 * lineWith, res.y, line2_from_x, res.y - 2 * lineWith ], \n                            lPath.splice(lP + 2, 0, newSegment), line.attr(\"path\", lPath)) : (newSegment = [ \"L\", line2_from_x, res.y - 2 * lineWith ], \n                            lPath.splice(lP + 1, 0, newSegment), newSegment = [ \"C\", line2_from_x, res.y - 2 * lineWith, line2_from_x + 4 * lineWith, res.y, line2_from_x, res.y + 2 * lineWith ], \n                            lPath.splice(lP + 2, 0, newSegment), line.attr(\"path\", lPath)), lP += 2;\n                        }\n                    }\n                }\n                this.chart.lines.push(line), (void 0 === this.chart.minXFromSymbols || this.chart.minXFromSymbols > left.x) && (this.chart.minXFromSymbols = left.x);\n            }\n            (!this.chart.maxXFromLine || this.chart.maxXFromLine && maxX > this.chart.maxXFromLine) && (this.chart.maxXFromLine = maxX);\n        }, module.exports = Symbol;\n    }, /* 3 */\n    /*!************************************!*\\\n  !*** ./src/flowchart.functions.js ***!\n  \\************************************/\n    /***/\n    function(module, exports) {\n        function drawPath(chart, location, points) {\n            var i, len, path = \"M{0},{1}\";\n            for (i = 2, len = 2 * points.length + 2; i < len; i += 2) path += \" L{\" + i + \"},{\" + (i + 1) + \"}\";\n            var pathValues = [ location.x, location.y ];\n            for (i = 0, len = points.length; i < len; i++) pathValues.push(points[i].x), pathValues.push(points[i].y);\n            var symbol = chart.paper.path(path, pathValues);\n            symbol.attr(\"stroke\", chart.options[\"element-color\"]), symbol.attr(\"stroke-width\", chart.options[\"line-width\"]);\n            var font = chart.options.font, fontF = chart.options[\"font-family\"], fontW = chart.options[\"font-weight\"];\n            return font && symbol.attr({\n                font: font\n            }), fontF && symbol.attr({\n                \"font-family\": fontF\n            }), fontW && symbol.attr({\n                \"font-weight\": fontW\n            }), symbol;\n        }\n        function drawLine(chart, from, to, text) {\n            var i, len;\n            \"[object Array]\" !== Object.prototype.toString.call(to) && (to = [ to ]);\n            var path = \"M{0},{1}\";\n            for (i = 2, len = 2 * to.length + 2; i < len; i += 2) path += \" L{\" + i + \"},{\" + (i + 1) + \"}\";\n            var pathValues = [ from.x, from.y ];\n            for (i = 0, len = to.length; i < len; i++) pathValues.push(to[i].x), pathValues.push(to[i].y);\n            var line = chart.paper.path(path, pathValues);\n            line.attr({\n                stroke: chart.options[\"line-color\"],\n                \"stroke-width\": chart.options[\"line-width\"],\n                \"arrow-end\": chart.options[\"arrow-end\"]\n            });\n            var font = chart.options.font, fontF = chart.options[\"font-family\"], fontW = chart.options[\"font-weight\"];\n            if (font && line.attr({\n                font: font\n            }), fontF && line.attr({\n                \"font-family\": fontF\n            }), fontW && line.attr({\n                \"font-weight\": fontW\n            }), text) {\n                var centerText = !1, textPath = chart.paper.text(0, 0, text), textAnchor = \"start\", isHorizontal = !1, firstTo = to[0];\n                from.y === firstTo.y && (isHorizontal = !0);\n                var x = 0, y = 0;\n                centerText ? (x = from.x > firstTo.x ? from.x - (from.x - firstTo.x) / 2 : firstTo.x - (firstTo.x - from.x) / 2, \n                y = from.y > firstTo.y ? from.y - (from.y - firstTo.y) / 2 : firstTo.y - (firstTo.y - from.y) / 2, \n                isHorizontal ? (x -= textPath.getBBox().width / 2, y -= chart.options[\"text-margin\"]) : (x += chart.options[\"text-margin\"], \n                y -= textPath.getBBox().height / 2)) : (x = from.x, y = from.y, isHorizontal ? (from.x > firstTo.x ? (x -= chart.options[\"text-margin\"] / 2, \n                textAnchor = \"end\") : x += chart.options[\"text-margin\"] / 2, y -= chart.options[\"text-margin\"]) : (x += chart.options[\"text-margin\"] / 2, \n                y += chart.options[\"text-margin\"], from.y > firstTo.y && (y -= 2 * chart.options[\"text-margin\"]))), \n                textPath.attr({\n                    \"text-anchor\": textAnchor,\n                    \"font-size\": chart.options[\"font-size\"],\n                    fill: chart.options[\"font-color\"],\n                    x: x,\n                    y: y\n                }), font && textPath.attr({\n                    font: font\n                }), fontF && textPath.attr({\n                    \"font-family\": fontF\n                }), fontW && textPath.attr({\n                    \"font-weight\": fontW\n                });\n            }\n            return line;\n        }\n        function checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n            // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n            var denominator, a, b, numerator1, numerator2, result = {\n                x: null,\n                y: null,\n                onLine1: !1,\n                onLine2: !1\n            };\n            // if we cast these lines infinitely in both directions, they intersect here:\n            /*\n\t  // it is worth noting that this should be the same as:\n\t  x = line2StartX + (b * (line2EndX - line2StartX));\n\t  y = line2StartX + (b * (line2EndY - line2StartY));\n\t  */\n            // if line1 is a segment and line2 is infinite, they intersect if:\n            // if line2 is a segment and line1 is infinite, they intersect if:\n            return denominator = (line2EndY - line2StartY) * (line1EndX - line1StartX) - (line2EndX - line2StartX) * (line1EndY - line1StartY), \n            0 === denominator ? result : (a = line1StartY - line2StartY, b = line1StartX - line2StartX, \n            numerator1 = (line2EndX - line2StartX) * a - (line2EndY - line2StartY) * b, numerator2 = (line1EndX - line1StartX) * a - (line1EndY - line1StartY) * b, \n            a = numerator1 / denominator, b = numerator2 / denominator, result.x = line1StartX + a * (line1EndX - line1StartX), \n            result.y = line1StartY + a * (line1EndY - line1StartY), a > 0 && a < 1 && (result.onLine1 = !0), \n            b > 0 && b < 1 && (result.onLine2 = !0), result);\n        }\n        module.exports = {\n            drawPath: drawPath,\n            drawLine: drawLine,\n            checkLineIntersection: checkLineIntersection\n        };\n    }, /* 4 */\n    /*!********************************!*\\\n  !*** ./src/flowchart.parse.js ***!\n  \\********************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function parse(input) {\n            function getStyle(s) {\n                var startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\");\n                return startIndex >= 0 && endIndex >= 0 ? s.substring(startIndex, endIndex) : \"{}\";\n            }\n            function getSymbValue(s) {\n                var startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\");\n                return startIndex >= 0 && endIndex >= 0 ? s.substring(startIndex, endIndex) : \"\";\n            }\n            function getSymbol(s) {\n                var startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\");\n                return startIndex >= 0 && endIndex >= 0 ? chart.symbols[s.substring(0, startIndex - 1)] : chart.symbols[s];\n            }\n            function getNextPath(s) {\n                var next = \"next\", startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\");\n                return startIndex >= 0 && endIndex >= 0 && (next = flowSymb.substring(startIndex, endIndex), \n                next.indexOf(\",\") < 0 && \"yes\" !== next && \"no\" !== next && (next = \"next, \" + next)), \n                next;\n            }\n            function getAnnotation(s) {\n                var startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\"), tmp = s.substring(startIndex, endIndex);\n                tmp.indexOf(\",\") > 0 && (tmp = tmp.substring(0, tmp.indexOf(\",\")));\n                var tmp_split = tmp.split(\"@\");\n                if (tmp_split.length > 1) return startIndex >= 0 && endIndex >= 0 ? tmp_split[1] : \"\";\n            }\n            input = input || \"\", input = input.trim();\n            for (var chart = {\n                symbols: {},\n                start: null,\n                drawSVG: function(container, options) {\n                    function getDisplaySymbol(s) {\n                        if (dispSymbols[s.key]) return dispSymbols[s.key];\n                        switch (s.symbolType) {\n                          case \"start\":\n                            dispSymbols[s.key] = new Start(diagram, s);\n                            break;\n\n                          case \"end\":\n                            dispSymbols[s.key] = new End(diagram, s);\n                            break;\n\n                          case \"operation\":\n                            dispSymbols[s.key] = new Operation(diagram, s);\n                            break;\n\n                          case \"inputoutput\":\n                            dispSymbols[s.key] = new InputOutput(diagram, s);\n                            break;\n\n                          case \"input\":\n                            dispSymbols[s.key] = new Input(diagram, s);\n                            //tds\n                            break;\n\n                          case \"output\":\n                            dispSymbols[s.key] = new Output(diagram, s);\n                            //tds\n                            break;\n\n                          case \"subroutine\":\n                            dispSymbols[s.key] = new Subroutine(diagram, s);\n                            break;\n\n                          case \"condition\":\n                            dispSymbols[s.key] = new Condition(diagram, s);\n                            break;\n\n                          case \"parallel\":\n                            dispSymbols[s.key] = new Parallel(diagram, s);\n                            break;\n\n                          default:\n                            return new Error(\"Wrong symbol type!\");\n                        }\n                        return dispSymbols[s.key];\n                    }\n                    var self = this;\n                    this.diagram && this.diagram.clean();\n                    var diagram = new FlowChart(container, options);\n                    this.diagram = diagram;\n                    var dispSymbols = {};\n                    !function constructChart(s, prevDisp, prev) {\n                        var dispSymb = getDisplaySymbol(s);\n                        return self.start === s ? diagram.startWith(dispSymb) : prevDisp && prev && !prevDisp.pathOk && (prevDisp instanceof Condition ? (prev.yes === s && prevDisp.yes(dispSymb), \n                        prev.no === s && prevDisp.no(dispSymb)) : prevDisp instanceof Parallel ? (prev.path1 === s && prevDisp.path1(dispSymb), \n                        prev.path2 === s && prevDisp.path2(dispSymb), prev.path3 === s && prevDisp.path3(dispSymb)) : prevDisp.then(dispSymb)), \n                        dispSymb.pathOk ? dispSymb : (dispSymb instanceof Condition ? (s.yes && constructChart(s.yes, dispSymb, s), \n                        s.no && constructChart(s.no, dispSymb, s)) : dispSymb instanceof Parallel ? (s.path1 && constructChart(s.path1, dispSymb, s), \n                        s.path2 && constructChart(s.path2, dispSymb, s), s.path3 && constructChart(s.path3, dispSymb, s)) : s.next && constructChart(s.next, dispSymb, s), \n                        dispSymb);\n                    }(this.start), diagram.render();\n                },\n                clean: function() {\n                    this.diagram.clean();\n                },\n                options: function() {\n                    return this.diagram.options;\n                }\n            }, lines = [], prevBreak = 0, i0 = 1, i0len = input.length; i0 < i0len; i0++) if (\"\\n\" === input[i0] && \"\\\\\" !== input[i0 - 1]) {\n                var line0 = input.substring(prevBreak, i0);\n                prevBreak = i0 + 1, lines.push(line0.replace(/\\\\\\n/g, \"\\n\"));\n            }\n            prevBreak < input.length && lines.push(input.substr(prevBreak));\n            for (var l = 1, len = lines.length; l < len; ) {\n                var currentLine = lines[l];\n                currentLine.indexOf(\"->\") < 0 && currentLine.indexOf(\"=>\") < 0 && currentLine.indexOf(\"@>\") < 0 ? (lines[l - 1] += \"\\n\" + currentLine, \n                lines.splice(l, 1), len--) : l++;\n            }\n            for (;lines.length > 0; ) {\n                var line = lines.splice(0, 1)[0].trim();\n                if (line.indexOf(\"=>\") >= 0) {\n                    // definition\n                    var parts = line.split(\"=>\"), symbol = {\n                        key: parts[0].replace(/\\(.*\\)/, \"\"),\n                        symbolType: parts[1],\n                        text: null,\n                        link: null,\n                        target: null,\n                        flowstate: null,\n                        function: null,\n                        lineStyle: {},\n                        params: {}\n                    }, params = parts[0].match(/\\((.*)\\)/);\n                    if (params && params.length > 1) for (var entries = params[1].split(\",\"), i = 0; i < entries.length; i++) {\n                        var entry = entries[i].split(\"=\");\n                        2 == entry.length && (symbol.params[entry[0]] = entry[1]);\n                    }\n                    var sub;\n                    /* adding support for links */\n                    if (symbol.symbolType.indexOf(\": \") >= 0 && (sub = symbol.symbolType.split(\": \"), \n                    symbol.symbolType = sub.shift(), symbol.text = sub.join(\": \")), symbol.text && symbol.text.indexOf(\":$\") >= 0 ? (sub = symbol.text.split(\":$\"), \n                    symbol.text = sub.shift(), symbol.function = sub.join(\":$\")) : symbol.symbolType.indexOf(\":$\") >= 0 ? (sub = symbol.symbolType.split(\":$\"), \n                    symbol.symbolType = sub.shift(), symbol.function = sub.join(\":$\")) : symbol.text && symbol.text.indexOf(\":>\") >= 0 ? (sub = symbol.text.split(\":>\"), \n                    symbol.text = sub.shift(), symbol.link = sub.join(\":>\")) : symbol.symbolType.indexOf(\":>\") >= 0 && (sub = symbol.symbolType.split(\":>\"), \n                    symbol.symbolType = sub.shift(), symbol.link = sub.join(\":>\")), symbol.symbolType.indexOf(\"\\n\") >= 0 && (symbol.symbolType = symbol.symbolType.split(\"\\n\")[0]), \n                    symbol.link) {\n                        var startIndex = symbol.link.indexOf(\"[\") + 1, endIndex = symbol.link.indexOf(\"]\");\n                        startIndex >= 0 && endIndex >= 0 && (symbol.target = symbol.link.substring(startIndex, endIndex), \n                        symbol.link = symbol.link.substring(0, startIndex - 1));\n                    }\n                    /* end of link support */\n                    /* adding support for flowstates */\n                    if (symbol.text && symbol.text.indexOf(\"|\") >= 0) {\n                        var txtAndState = symbol.text.split(\"|\");\n                        symbol.flowstate = txtAndState.pop().trim(), symbol.text = txtAndState.join(\"|\");\n                    }\n                    /* end of flowstate support */\n                    chart.symbols[symbol.key] = symbol;\n                } else if (line.indexOf(\"->\") >= 0) {\n                    var ann = getAnnotation(line);\n                    ann && (line = line.replace(\"@\" + ann, \"\"));\n                    for (var flowSymbols = line.split(\"->\"), iS = 0, lenS = flowSymbols.length; iS < lenS; iS++) {\n                        var flowSymb = flowSymbols[iS], symbVal = getSymbValue(flowSymb);\n                        \"true\" !== symbVal && \"false\" !== symbVal || (// map true or false to yes or no respectively\n                        flowSymb = flowSymb.replace(\"true\", \"yes\"), flowSymb = flowSymb.replace(\"false\", \"no\"));\n                        var next = getNextPath(flowSymb), realSymb = getSymbol(flowSymb), direction = null;\n                        if (next.indexOf(\",\") >= 0) {\n                            var condOpt = next.split(\",\");\n                            next = condOpt[0], direction = condOpt[1].trim();\n                        }\n                        if (ann && (\"condition\" === realSymb.symbolType ? \"yes\" === next || \"true\" === next ? realSymb.yes_annotation = ann : realSymb.no_annotation = ann : \"parallel\" === realSymb.symbolType && (\"path1\" === next ? realSymb.path1_annotation = ann : \"path2\" === next ? realSymb.path2_annotation = ann : \"path3\" === next && (realSymb.path3_annotation = ann)), \n                        ann = null), chart.start || (chart.start = realSymb), iS + 1 < lenS) {\n                            var nextSymb = flowSymbols[iS + 1];\n                            realSymb[next] = getSymbol(nextSymb), realSymb[\"direction_\" + next] = direction, \n                            direction = null;\n                        }\n                    }\n                } else if (line.indexOf(\"@>\") >= 0) for (var lineStyleSymbols = line.split(\"@>\"), iSS = 0, lenSS = lineStyleSymbols.length; iSS < lenSS; iSS++) if (iSS + 1 !== lenSS) {\n                    var curSymb = getSymbol(lineStyleSymbols[iSS]), nextSymbol = getSymbol(lineStyleSymbols[iSS + 1]);\n                    curSymb.lineStyle[nextSymbol.key] = JSON.parse(getStyle(lineStyleSymbols[iSS + 1]));\n                }\n            }\n            return chart;\n        }\n        var FlowChart = __webpack_require__(/*! ./flowchart.chart */ 7), Start = __webpack_require__(/*! ./flowchart.symbol.start */ 15), End = __webpack_require__(/*! ./flowchart.symbol.end */ 10), Operation = __webpack_require__(/*! ./flowchart.symbol.operation */ 13), InputOutput = __webpack_require__(/*! ./flowchart.symbol.inputoutput */ 12), Input = __webpack_require__(/*! ./flowchart.symbol.input */ 11), Output = __webpack_require__(/*! ./flowchart.symbol.output */ 14), Subroutine = __webpack_require__(/*! ./flowchart.symbol.subroutine */ 16), Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5), Parallel = __webpack_require__(/*! ./flowchart.symbol.parallel */ 6);\n        module.exports = parse;\n    }, /* 5 */\n    /*!*******************************************!*\\\n  !*** ./src/flowchart.symbol.condition.js ***!\n  \\*******************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Condition(chart, options) {\n            options = options || {}, Symbol.call(this, chart, options), this.yes_annotation = options.yes_annotation, \n            this.no_annotation = options.no_annotation, this.textMargin = this.getAttr(\"text-margin\"), \n            this.yes_direction = options.direction_yes, this.no_direction = options.direction_no, \n            this.no_direction || \"right\" !== this.yes_direction ? this.yes_direction || \"bottom\" !== this.no_direction || (this.yes_direction = \"right\") : this.no_direction = \"bottom\", \n            this.yes_direction = this.yes_direction || \"bottom\", this.no_direction = this.no_direction || \"right\", \n            this.text.attr({\n                x: 2 * this.textMargin\n            });\n            var width = this.text.getBBox().width + 3 * this.textMargin;\n            width += width / 2;\n            var height = this.text.getBBox().height + 2 * this.textMargin;\n            height += height / 2, height = Math.max(.5 * width, height);\n            var startX = width / 4, startY = height / 4;\n            this.text.attr({\n                x: startX + this.textMargin / 2\n            });\n            var start = {\n                x: startX,\n                y: startY\n            }, points = [ {\n                x: startX - width / 4,\n                y: startY + height / 4\n            }, {\n                x: startX - width / 4 + width / 2,\n                y: startY + height / 4 + height / 2\n            }, {\n                x: startX - width / 4 + width,\n                y: startY + height / 4\n            }, {\n                x: startX - width / 4 + width / 2,\n                y: startY + height / 4 - height / 2\n            }, {\n                x: startX - width / 4,\n                y: startY + height / 4\n            } ], symbol = drawPath(chart, start, points);\n            symbol.attr({\n                stroke: this.getAttr(\"element-color\"),\n                \"stroke-width\": this.getAttr(\"line-width\"),\n                fill: this.getAttr(\"fill\")\n            }), options.link && symbol.attr(\"href\", options.link), options.target && symbol.attr(\"target\", options.target), \n            options.key && (symbol.node.id = options.key), symbol.node.setAttribute(\"class\", this.getAttr(\"class\")), \n            this.text.attr({\n                y: symbol.getBBox().height / 2\n            }), this.group.push(symbol), symbol.insertBefore(this.text), this.symbol = symbol, \n            this.initialize();\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;\n        inherits(Condition, Symbol), Condition.prototype.render = function() {\n            var self = this;\n            this.yes_direction && (this[this.yes_direction + \"_symbol\"] = this.yes_symbol), \n            this.no_direction && (this[this.no_direction + \"_symbol\"] = this.no_symbol);\n            var lineLength = this.getAttr(\"line-length\");\n            if (this.bottom_symbol) {\n                var bottomPoint = this.getBottom();\n                this.bottom_symbol.isPositioned || (this.bottom_symbol.shiftY(this.getY() + this.height + lineLength), \n                this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2), this.bottom_symbol.isPositioned = !0, \n                this.bottom_symbol.render());\n            }\n            if (this.right_symbol) {\n                var rightPoint = this.getRight();\n                this.right_symbol.isPositioned || (this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2), \n                this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength), function shift() {\n                    for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i], \n                    !self.params[\"align-next\"] || \"no\" !== self.params[\"align-next\"]) {\n                        var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n                        if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {\n                            hasSymbolUnder = !0;\n                            break;\n                        }\n                    }\n                    if (hasSymbolUnder) {\n                        if (\"end\" === self.right_symbol.symbolType) return;\n                        self.right_symbol.setX(symb.getX() + symb.width + lineLength), shift();\n                    }\n                }(), this.right_symbol.isPositioned = !0, this.right_symbol.render());\n            }\n            if (this.left_symbol) {\n                var leftPoint = this.getLeft();\n                this.left_symbol.isPositioned || (this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2), \n                this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength)), function shift() {\n                    for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i], \n                    !self.params[\"align-next\"] || \"no\" !== self.params[\"align-next\"]) {\n                        var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n                        if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n                            hasSymbolUnder = !0;\n                            break;\n                        }\n                    }\n                    if (hasSymbolUnder) {\n                        if (\"end\" === self.left_symbol.symbolType) return;\n                        self.left_symbol.setX(symb.getX() + symb.width + lineLength), shift();\n                    }\n                }(), this.left_symbol.isPositioned = !0, this.left_symbol.render());\n            }\n        }, Condition.prototype.renderLines = function() {\n            this.yes_symbol && this.drawLineTo(this.yes_symbol, this.yes_annotation ? this.yes_annotation : this.getAttr(\"yes-text\"), this.yes_direction), \n            this.no_symbol && this.drawLineTo(this.no_symbol, this.no_annotation ? this.no_annotation : this.getAttr(\"no-text\"), this.no_direction);\n        }, module.exports = Condition;\n    }, /* 6 */\n    /*!******************************************!*\\\n  !*** ./src/flowchart.symbol.parallel.js ***!\n  \\******************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Parallel(chart, options) {\n            var symbol = chart.paper.rect(0, 0, 0, 0);\n            options = options || {}, Symbol.call(this, chart, options, symbol), this.path1_annotation = options.path1_annotation || \"\", \n            this.path2_annotation = options.path2_annotation || \"\", this.path3_annotation = options.path3_annotation || \"\", \n            this.textMargin = this.getAttr(\"text-margin\"), this.path1_direction = \"bottom\", \n            this.path2_direction = \"right\", this.path3_direction = \"top\", this.params = options.params, \n            \"path1\" === options.direction_next && !options[options.direction_next] && options.next && (options[options.direction_next] = options.next), \n            \"path2\" === options.direction_next && !options[options.direction_next] && options.next && (options[options.direction_next] = options.next), \n            \"path3\" === options.direction_next && !options[options.direction_next] && options.next && (options[options.direction_next] = options.next), \n            options.path1 && options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && !options.direction_path3 ? \"right\" === options.direction_path1 ? (this.path2_direction = \"bottom\", \n            this.path1_direction = \"right\", this.path3_direction = \"top\") : \"top\" === options.direction_path1 ? (this.path2_direction = \"right\", \n            this.path1_direction = \"top\", this.path3_direction = \"bottom\") : \"left\" === options.direction_path1 ? (this.path2_direction = \"right\", \n            this.path1_direction = \"left\", this.path3_direction = \"bottom\") : (this.path2_direction = \"right\", \n            this.path1_direction = \"bottom\", this.path3_direction = \"top\") : options.path1 && !options.direction_path1 && options.path2 && options.direction_path2 && options.path3 && !options.direction_path3 ? \"right\" === options.direction_path2 ? (this.path1_direction = \"bottom\", \n            this.path2_direction = \"right\", this.path3_direction = \"top\") : \"left\" === options.direction_path2 ? (this.path1_direction = \"bottom\", \n            this.path2_direction = \"left\", this.path3_direction = \"right\") : (this.path1_direction = \"right\", \n            this.path2_direction = \"bottom\", this.path3_direction = \"top\") : options.path1 && !options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && options.direction_path3 ? \"right\" === options.direction_path2 ? (this.path1_direction = \"bottom\", \n            this.path2_direction = \"top\", this.path3_direction = \"right\") : \"left\" === options.direction_path2 ? (this.path1_direction = \"bottom\", \n            this.path2_direction = \"right\", this.path3_direction = \"left\") : (this.path1_direction = \"right\", \n            this.path2_direction = \"bottom\", this.path3_direction = \"top\") : (this.path1_direction = options.direction_path1, \n            this.path2_direction = options.direction_path2, this.path3_direction = options.direction_path3), \n            this.path1_direction = this.path1_direction || \"bottom\", this.path2_direction = this.path2_direction || \"right\", \n            this.path3_direction = this.path3_direction || \"top\", this.initialize();\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n        inherits(Parallel, Symbol), Parallel.prototype.render = function() {\n            this.path1_direction && (this[this.path1_direction + \"_symbol\"] = this.path1_symbol), \n            this.path2_direction && (this[this.path2_direction + \"_symbol\"] = this.path2_symbol), \n            this.path3_direction && (this[this.path3_direction + \"_symbol\"] = this.path3_symbol);\n            var lineLength = this.getAttr(\"line-length\");\n            if (this.bottom_symbol) {\n                var bottomPoint = this.getBottom();\n                this.bottom_symbol.isPositioned || (this.bottom_symbol.shiftY(this.getY() + this.height + lineLength), \n                this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2), this.bottom_symbol.isPositioned = !0, \n                this.bottom_symbol.render());\n            }\n            if (this.top_symbol) {\n                var topPoint = this.getTop();\n                this.top_symbol.isPositioned || (this.top_symbol.shiftY(this.getY() - this.top_symbol.height - lineLength), \n                this.top_symbol.setX(topPoint.x + this.top_symbol.width), this.top_symbol.isPositioned = !0, \n                this.top_symbol.render());\n            }\n            var self = this;\n            if (this.left_symbol) {\n                var leftPoint = this.getLeft();\n                this.left_symbol.isPositioned || (this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2), \n                this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength)), function shift() {\n                    for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i], \n                    !self.params[\"align-next\"] || \"no\" !== self.params[\"align-next\"]) {\n                        var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n                        if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n                            hasSymbolUnder = !0;\n                            break;\n                        }\n                    }\n                    if (hasSymbolUnder) {\n                        if (\"end\" === self.left_symbol.symbolType) return;\n                        self.left_symbol.setX(symb.getX() + symb.width + lineLength), shift();\n                    }\n                }(), this.left_symbol.isPositioned = !0, this.left_symbol.render());\n            }\n            if (this.right_symbol) {\n                var rightPoint = this.getRight();\n                this.right_symbol.isPositioned || (this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2), \n                this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength), function shift() {\n                    for (var symb, hasSymbolUnder = !1, i = 0, len = self.chart.symbols.length; i < len; i++) if (symb = self.chart.symbols[i], \n                    !self.params[\"align-next\"] || \"no\" !== self.params[\"align-next\"]) {\n                        var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n                        if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {\n                            hasSymbolUnder = !0;\n                            break;\n                        }\n                    }\n                    if (hasSymbolUnder) {\n                        if (\"end\" === self.right_symbol.symbolType) return;\n                        self.right_symbol.setX(symb.getX() + symb.width + lineLength), shift();\n                    }\n                }(), this.right_symbol.isPositioned = !0, this.right_symbol.render());\n            }\n        }, Parallel.prototype.renderLines = function() {\n            this.path1_symbol && this.drawLineTo(this.path1_symbol, this.path1_annotation, this.path1_direction), \n            this.path2_symbol && this.drawLineTo(this.path2_symbol, this.path2_annotation, this.path2_direction), \n            this.path3_symbol && this.drawLineTo(this.path3_symbol, this.path3_annotation, this.path3_direction);\n        }, module.exports = Parallel;\n    }, /* 7 */\n    /*!********************************!*\\\n  !*** ./src/flowchart.chart.js ***!\n  \\********************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function FlowChart(container, options) {\n            options = options || {}, this.paper = new Raphael(container), this.options = defaults(options, defaultOptions), \n            this.symbols = [], this.lines = [], this.start = null;\n        }\n        var Raphael = __webpack_require__(/*! raphael */ 18), defaults = __webpack_require__(/*! ./flowchart.helpers */ 1).defaults, defaultOptions = __webpack_require__(/*! ./flowchart.defaults */ 8), Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5), Parallel = __webpack_require__(/*! ./flowchart.symbol.parallel */ 6);\n        FlowChart.prototype.handle = function(symbol) {\n            this.symbols.indexOf(symbol) <= -1 && this.symbols.push(symbol);\n            var flowChart = this;\n            return symbol instanceof Condition ? (symbol.yes = function(nextSymbol) {\n                return symbol.yes_symbol = nextSymbol, symbol.no_symbol && (symbol.pathOk = !0), \n                flowChart.handle(nextSymbol);\n            }, symbol.no = function(nextSymbol) {\n                return symbol.no_symbol = nextSymbol, symbol.yes_symbol && (symbol.pathOk = !0), \n                flowChart.handle(nextSymbol);\n            }) : symbol instanceof Parallel ? (symbol.path1 = function(nextSymbol) {\n                return symbol.path1_symbol = nextSymbol, symbol.path2_symbol && (symbol.pathOk = !0), \n                flowChart.handle(nextSymbol);\n            }, symbol.path2 = function(nextSymbol) {\n                return symbol.path2_symbol = nextSymbol, symbol.path3_symbol && (symbol.pathOk = !0), \n                flowChart.handle(nextSymbol);\n            }, symbol.path3 = function(nextSymbol) {\n                return symbol.path3_symbol = nextSymbol, symbol.path1_symbol && (symbol.pathOk = !0), \n                flowChart.handle(nextSymbol);\n            }) : symbol.then = function(nextSymbol) {\n                return symbol.next = nextSymbol, symbol.pathOk = !0, flowChart.handle(nextSymbol);\n            }, symbol;\n        }, FlowChart.prototype.startWith = function(symbol) {\n            return this.start = symbol, this.handle(symbol);\n        }, FlowChart.prototype.render = function() {\n            var symbol, line, maxWidth = 0, maxHeight = 0, i = 0, len = 0, maxX = 0, maxY = 0, minX = 0, minY = 0;\n            for (i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i], symbol.width > maxWidth && (maxWidth = symbol.width), \n            symbol.height > maxHeight && (maxHeight = symbol.height);\n            for (i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i], symbol.shiftX(this.options.x + (maxWidth - symbol.width) / 2 + this.options[\"line-width\"]), \n            symbol.shiftY(this.options.y + (maxHeight - symbol.height) / 2 + this.options[\"line-width\"]);\n            // for (i = 0, len = this.symbols.length; i < len; i++) {\n            //   symbol = this.symbols[i];\n            //   symbol.render();\n            // }\n            for (this.start.render(), i = 0, len = this.symbols.length; i < len; i++) symbol = this.symbols[i], \n            symbol.renderLines();\n            maxX = this.maxXFromLine;\n            var x, y;\n            for (i = 0, len = this.symbols.length; i < len; i++) {\n                symbol = this.symbols[i];\n                var leftX = symbol.getX();\n                x = leftX + symbol.width, y = symbol.getY() + symbol.height, leftX < minX && (minX = leftX), \n                x > maxX && (maxX = x), y > maxY && (maxY = y);\n            }\n            for (i = 0, len = this.lines.length; i < len; i++) {\n                line = this.lines[i].getBBox(), x = line.x, y = line.y;\n                var x2 = line.x2, y2 = line.y2;\n                x < minX && (minX = x), y < minY && (minY = y), x2 > maxX && (maxX = x2), y2 > maxY && (maxY = y2);\n            }\n            var scale = this.options.scale, lineWidth = this.options[\"line-width\"];\n            this.minXFromSymbols < minX && (minX = this.minXFromSymbols), minX < 0 && (minX -= lineWidth), \n            minY < 0 && (minY -= lineWidth);\n            var width = maxX + lineWidth - minX, height = maxY + lineWidth - minY;\n            this.paper.setSize(width * scale, height * scale), this.paper.setViewBox(minX, minY, width, height, !0);\n        }, FlowChart.prototype.clean = function() {\n            if (this.paper) {\n                var paperDom = this.paper.canvas;\n                paperDom.parentNode && paperDom.parentNode.removeChild(paperDom);\n            }\n        }, module.exports = FlowChart;\n    }, /* 8 */\n    /*!***********************************!*\\\n  !*** ./src/flowchart.defaults.js ***!\n  \\***********************************/\n    /***/\n    function(module, exports) {\n        // defaults\n        module.exports = {\n            x: 0,\n            y: 0,\n            // 'roundness': 0,\n            \"line-width\": 3,\n            \"line-length\": 50,\n            \"text-margin\": 10,\n            \"font-size\": 14,\n            \"font-color\": \"black\",\n            // 'font': 'normal',\n            // 'font-family': 'calibri',\n            // 'font-weight': 'normal',\n            \"line-color\": \"black\",\n            \"element-color\": \"black\",\n            fill: \"white\",\n            \"yes-text\": \"yes\",\n            \"no-text\": \"no\",\n            \"arrow-end\": \"block\",\n            class: \"flowchart\",\n            scale: 1,\n            symbols: {\n                start: {},\n                end: {},\n                condition: {},\n                inputoutput: {},\n                input: {},\n                //tds\n                output: {},\n                //tds    \n                operation: {},\n                subroutine: {},\n                parallel: {}\n            }\n        };\n    }, /* 9 */\n    /*!*******************************!*\\\n  !*** ./src/flowchart.shim.js ***!\n  \\*******************************/\n    /***/\n    function(module, exports) {\n        // add indexOf to non ECMA-262 standard compliant browsers\n        Array.prototype.indexOf || (Array.prototype.indexOf = function(searchElement) {\n            \"use strict\";\n            if (null === this) throw new TypeError();\n            var t = Object(this), len = t.length >>> 0;\n            if (0 === len) return -1;\n            var n = 0;\n            if (arguments.length > 0 && (n = Number(arguments[1]), n != n ? // shortcut for verifying if it's NaN\n            n = 0 : 0 !== n && n != 1 / 0 && n != -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n)))), \n            n >= len) return -1;\n            for (var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); k < len; k++) if (k in t && t[k] === searchElement) return k;\n            return -1;\n        }), // add lastIndexOf to non ECMA-262 standard compliant browsers\n        Array.prototype.lastIndexOf || (Array.prototype.lastIndexOf = function(searchElement) {\n            \"use strict\";\n            if (null === this) throw new TypeError();\n            var t = Object(this), len = t.length >>> 0;\n            if (0 === len) return -1;\n            var n = len;\n            arguments.length > 1 && (n = Number(arguments[1]), n != n ? n = 0 : 0 !== n && n != 1 / 0 && n != -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n))));\n            for (var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n); k >= 0; k--) if (k in t && t[k] === searchElement) return k;\n            return -1;\n        }), String.prototype.trim || (String.prototype.trim = function() {\n            return this.replace(/^\\s+|\\s+$/g, \"\");\n        });\n    }, /* 10 */\n    /*!*************************************!*\\\n  !*** ./src/flowchart.symbol.end.js ***!\n  \\*************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function End(chart, options) {\n            var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n            options = options || {}, options.text = options.text || \"End\", Symbol.call(this, chart, options, symbol);\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n        inherits(End, Symbol), module.exports = End;\n    }, /* 11 */\n    /*!***************************************!*\\\n  !*** ./src/flowchart.symbol.input.js ***!\n  \\***************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Input(chart, options) {\n            options = options || {}, Symbol.call(this, chart, options), this.textMargin = this.getAttr(\"text-margin\"), \n            this.text.attr({\n                x: 3 * this.textMargin\n            });\n            var width = this.text.getBBox().width + 4 * this.textMargin, height = this.text.getBBox().height + 2 * this.textMargin, startX = this.textMargin, startY = height / 2, start = {\n                x: startX,\n                y: startY\n            }, points = [ {\n                x: startX - this.textMargin + 2 * this.textMargin,\n                y: height\n            }, {\n                x: startX - this.textMargin + width,\n                y: height\n            }, {\n                x: startX - this.textMargin + width + 2 * this.textMargin,\n                y: 0\n            }, {\n                x: startX - this.textMargin,\n                y: 0\n            }, {\n                x: startX,\n                y: startY\n            } ], symbol = drawPath(chart, start, points);\n            symbol.attr({\n                stroke: this.getAttr(\"element-color\"),\n                \"stroke-width\": this.getAttr(\"line-width\"),\n                fill: this.getAttr(\"fill\")\n            }), options.link && symbol.attr(\"href\", options.link), options.target && symbol.attr(\"target\", options.target), \n            options.key && (symbol.node.id = options.key), symbol.node.setAttribute(\"class\", this.getAttr(\"class\")), \n            this.text.attr({\n                y: symbol.getBBox().height / 2\n            }), this.group.push(symbol), symbol.insertBefore(this.text), this.symbol = symbol, \n            this.initialize();\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;\n        inherits(Input, Symbol), Input.prototype.getLeft = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.textMargin;\n            return {\n                x: x,\n                y: y\n            };\n        }, Input.prototype.getRight = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width - this.textMargin;\n            return {\n                x: x,\n                y: y\n            };\n        }, module.exports = Input;\n    }, /* 12 */\n    /*!*********************************************!*\\\n  !*** ./src/flowchart.symbol.inputoutput.js ***!\n  \\*********************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function InputOutput(chart, options) {\n            options = options || {}, Symbol.call(this, chart, options), this.textMargin = this.getAttr(\"text-margin\"), \n            this.text.attr({\n                x: 3 * this.textMargin\n            });\n            var width = this.text.getBBox().width + 4 * this.textMargin, height = this.text.getBBox().height + 2 * this.textMargin, startX = this.textMargin, startY = height / 2, start = {\n                x: startX,\n                y: startY\n            }, points = [ {\n                x: startX - this.textMargin,\n                y: height\n            }, {\n                x: startX - this.textMargin + width,\n                y: height\n            }, {\n                x: startX - this.textMargin + width + 2 * this.textMargin,\n                y: 0\n            }, {\n                x: startX - this.textMargin + 2 * this.textMargin,\n                y: 0\n            }, {\n                x: startX,\n                y: startY\n            } ], symbol = drawPath(chart, start, points);\n            symbol.attr({\n                stroke: this.getAttr(\"element-color\"),\n                \"stroke-width\": this.getAttr(\"line-width\"),\n                fill: this.getAttr(\"fill\")\n            }), options.link && symbol.attr(\"href\", options.link), options.target && symbol.attr(\"target\", options.target), \n            options.key && (symbol.node.id = options.key), symbol.node.setAttribute(\"class\", this.getAttr(\"class\")), \n            this.text.attr({\n                y: symbol.getBBox().height / 2\n            }), this.group.push(symbol), symbol.insertBefore(this.text), this.symbol = symbol, \n            this.initialize();\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;\n        inherits(InputOutput, Symbol), InputOutput.prototype.getLeft = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.textMargin;\n            return {\n                x: x,\n                y: y\n            };\n        }, InputOutput.prototype.getRight = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width - this.textMargin;\n            return {\n                x: x,\n                y: y\n            };\n        }, module.exports = InputOutput;\n    }, /* 13 */\n    /*!*******************************************!*\\\n  !*** ./src/flowchart.symbol.operation.js ***!\n  \\*******************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Operation(chart, options) {\n            var symbol = chart.paper.rect(0, 0, 0, 0);\n            options = options || {}, Symbol.call(this, chart, options, symbol);\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n        inherits(Operation, Symbol), module.exports = Operation;\n    }, /* 14 */\n    /*!****************************************!*\\\n  !*** ./src/flowchart.symbol.output.js ***!\n  \\****************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Output(chart, options) {\n            options = options || {}, Symbol.call(this, chart, options), this.textMargin = this.getAttr(\"text-margin\"), \n            this.text.attr({\n                x: 3 * this.textMargin\n            });\n            var width = this.text.getBBox().width + 4 * this.textMargin, height = this.text.getBBox().height + 2 * this.textMargin, startX = this.textMargin, startY = height / 2, start = {\n                x: startX,\n                y: startY\n            }, points = [ {\n                x: startX - this.textMargin,\n                y: height\n            }, {\n                x: startX - this.textMargin + width + 2 * this.textMargin,\n                y: height\n            }, {\n                x: startX - this.textMargin + width,\n                y: 0\n            }, {\n                x: startX - this.textMargin + 2 * this.textMargin,\n                y: 0\n            }, {\n                x: startX,\n                y: startY\n            } ], symbol = drawPath(chart, start, points);\n            symbol.attr({\n                stroke: this.getAttr(\"element-color\"),\n                \"stroke-width\": this.getAttr(\"line-width\"),\n                fill: this.getAttr(\"fill\")\n            }), options.link && symbol.attr(\"href\", options.link), options.target && symbol.attr(\"target\", options.target), \n            options.key && (symbol.node.id = options.key), symbol.node.setAttribute(\"class\", this.getAttr(\"class\")), \n            this.text.attr({\n                y: symbol.getBBox().height / 2\n            }), this.group.push(symbol), symbol.insertBefore(this.text), this.symbol = symbol, \n            this.initialize();\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits, drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3), drawPath = drawAPI.drawPath;\n        inherits(Output, Symbol), Output.prototype.getLeft = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.textMargin;\n            return {\n                x: x,\n                y: y\n            };\n        }, Output.prototype.getRight = function() {\n            var y = this.getY() + this.group.getBBox().height / 2, x = this.getX() + this.group.getBBox().width - this.textMargin;\n            return {\n                x: x,\n                y: y\n            };\n        }, module.exports = Output;\n    }, /* 15 */\n    /*!***************************************!*\\\n  !*** ./src/flowchart.symbol.start.js ***!\n  \\***************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Start(chart, options) {\n            var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n            options = options || {}, options.text = options.text || \"Start\", Symbol.call(this, chart, options, symbol);\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n        inherits(Start, Symbol), module.exports = Start;\n    }, /* 16 */\n    /*!********************************************!*\\\n  !*** ./src/flowchart.symbol.subroutine.js ***!\n  \\********************************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        function Subroutine(chart, options) {\n            var symbol = chart.paper.rect(0, 0, 0, 0);\n            options = options || {}, Symbol.call(this, chart, options, symbol), symbol.attr({\n                width: this.text.getBBox().width + 4 * this.getAttr(\"text-margin\")\n            }), this.text.attr({\n                x: 2 * this.getAttr(\"text-margin\")\n            });\n            var innerWrap = chart.paper.rect(0, 0, 0, 0);\n            innerWrap.attr({\n                x: this.getAttr(\"text-margin\"),\n                stroke: this.getAttr(\"element-color\"),\n                \"stroke-width\": this.getAttr(\"line-width\"),\n                width: this.text.getBBox().width + 2 * this.getAttr(\"text-margin\"),\n                height: this.text.getBBox().height + 2 * this.getAttr(\"text-margin\"),\n                fill: this.getAttr(\"fill\")\n            }), options.key && (innerWrap.node.id = options.key + \"i\");\n            var font = this.getAttr(\"font\"), fontF = this.getAttr(\"font-family\"), fontW = this.getAttr(\"font-weight\");\n            font && innerWrap.attr({\n                font: font\n            }), fontF && innerWrap.attr({\n                \"font-family\": fontF\n            }), fontW && innerWrap.attr({\n                \"font-weight\": fontW\n            }), options.link && innerWrap.attr(\"href\", options.link), options.target && innerWrap.attr(\"target\", options.target), \n            this.group.push(innerWrap), innerWrap.insertBefore(this.text), this.initialize();\n        }\n        var Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2), inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n        inherits(Subroutine, Symbol), module.exports = Subroutine;\n    }, /* 17 */\n    /*!******************************!*\\\n  !*** ./src/jquery-plugin.js ***!\n  \\******************************/\n    /***/\n    function(module, exports, __webpack_require__) {\n        if (\"undefined\" != typeof jQuery) {\n            var parse = __webpack_require__(/*! ./flowchart.parse */ 4);\n            !function($) {\n                function paramFit(needle, haystack) {\n                    return needle == haystack || Array.isArray(haystack) && (haystack.includes(needle) || haystack.includes(Number(needle)));\n                }\n                var methods = {\n                    init: function(options) {\n                        return this.each(function() {\n                            var $this = $(this);\n                            this.chart = parse($this.text()), $this.html(\"\"), this.chart.drawSVG(this, options);\n                        });\n                    },\n                    setFlowStateByParam: function(param, paramValue, newFlowState) {\n                        return this.each(function() {\n                            var chart = this.chart, nextSymbolKeys = [ \"next\", \"yes\", \"no\", \"path1\", \"path2\", \"path3\" ];\n                            for (var property in chart.symbols) if (chart.symbols.hasOwnProperty(property)) {\n                                var symbol = chart.symbols[property], val = symbol.params[param];\n                                if (paramFit(val, paramValue)) {\n                                    symbol.flowstate = newFlowState;\n                                    for (var nski = 0; nski < nextSymbolKeys.length; nski++) {\n                                        var nextSymbolKey = nextSymbolKeys[nski];\n                                        symbol[nextSymbolKey] && symbol[nextSymbolKey].params && symbol[nextSymbolKey].params[param] && paramFit(symbol[nextSymbolKey].params[param], paramValue) && (symbol.lineStyle[symbol[nextSymbolKey].key] = {\n                                            stroke: chart.options().flowstate[newFlowState].fill\n                                        });\n                                    }\n                                }\n                            }\n                            chart.clean(), chart.drawSVG(this);\n                        });\n                    },\n                    clearFlowState: function() {\n                        return this.each(function() {\n                            var chart = this.chart;\n                            for (var property in chart.symbols) if (chart.symbols.hasOwnProperty(property)) {\n                                var node = chart.symbols[property];\n                                node.flowstate = \"\";\n                            }\n                            chart.clean(), chart.drawSVG(this);\n                        });\n                    }\n                };\n                $.fn.flowChart = function(methodOrOptions) {\n                    return methods[methodOrOptions] ? methods[methodOrOptions].apply(this, Array.prototype.slice.call(arguments, 1)) : \"object\" != typeof methodOrOptions && methodOrOptions ? void $.error(\"Method \" + methodOrOptions + \" does not exist on jQuery.flowChart\") : methods.init.apply(this, arguments);\n                };\n            }(jQuery);\n        }\n    }, /* 18 */\n    /*!**************************!*\\\n  !*** external \"Raphael\" ***!\n  \\**************************/\n    /***/\n    function(module, exports) {\n        module.exports = __WEBPACK_EXTERNAL_MODULE_18__;\n    } ]);\n});\n//# sourceMappingURL=flowchart.js.map"
  },
  {
    "path": "releasenotes.md",
    "content": "### v1.18.0\n\n- introduce input and output [#251](https://github.com/adrai/flowchart.js/pull/251)\n\n### v1.17.1\n\n- fix start and end roundness introduced in [#227](https://github.com/adrai/flowchart.js/pull/227)\n\n### v1.17.0\n\n- Styling to allow rounded corners [#227](https://github.com/adrai/flowchart.js/pull/227)\n\n### v1.16.0\n\n- Custom annotations for parallel [#225](https://github.com/adrai/flowchart.js/issues/225)\n\n### v1.15.0\n\n- Introduce types [#214](https://github.com/adrai/flowchart.js/pull/214) thanks to [Mister-Hope](https://github.com/Mister-Hope)\n\n### v1.14.3\n\n- Removed types introduced in [#212](https://github.com/adrai/flowchart.js/pull/212) again\n\n### v1.14.2\n\n- Basic types [#212](https://github.com/adrai/flowchart.js/pull/212) thanks to [DerMolly](https://github.com/DerMolly)\n\n### v1.14.1\n\n- Corrected condition behavior and fixed layout [#211](https://github.com/adrai/flowchart.js/pull/211) thanks to [AlexanderMisel](https://github.com/AlexanderMisel)\n\n### v1.14.0\n\n- Custom annotations [#209](https://github.com/adrai/flowchart.js/pull/209) thanks to [serpent-charmer](https://github.com/serpent-charmer)\n\n\n### v1.13.0\n\n- Provide low cost means of lines not colliding until they converge [#191](https://github.com/adrai/flowchart.js/pull/191) thanks to [robertleeplummerjr](https://github.com/robertleeplummerjr)\n- update raphael dependency\n\n\n### v1.12.3\n\n- Cleaning error fix, Linestyle parsing cycle fix, Dynamic flowState update [#188](https://github.com/adrai/flowchart.js/pull/188) thanks to [murich](https://github.com/murich)\n\n\n### v1.12.2\n\n- shrink npm package\n\n\n### v1.12.1\n\n- Fix params bug [#173](https://github.com/adrai/flowchart.js/pull/173) thanks to [leo108](https://github.com/leo108)\n\n\n### v1.12.0\n\n- onclick function binding to chart nodes [#172](https://github.com/adrai/flowchart.js/pull/172) thanks to [ndrqu](https://github.com/ndrqu)\n\n\n### v1.11.3\n\n- try to optimize horizontal rendering for end symbols [#155](https://github.com/adrai/flowchart.js/issues/155)\n\n### v1.11.2\n\n- try to optimize left handling [#152](https://github.com/adrai/flowchart.js/issues/152)\n\n### v1.11.1\n\n- fix direction issue for condition [#151](https://github.com/adrai/flowchart.js/issues/151)\n\n### v1.11.0\n\n- Add parallel component [#145](https://github.com/adrai/flowchart.js/pull/145) thanks to [sudhakar-sekar](https://github.com/sudhakar-sekar)\n\n### v1.9.0\n\n- Add arrow-text attribute to symbols [#141](https://github.com/adrai/flowchart.js/pull/141) thanks to [josephtocci](https://github.com/josephtocci)\n\n### v1.8.0\n\n- Allow Conditional to support 'true' or 'false' along with 'yes' and 'no' [#128](https://github.com/adrai/flowchart.js/pull/128) thanks to [bhedge](https://github.com/bhedge)\n\n### v1.7.0\n\n- add parameter to disable vertical alignment of condition symbol [#115](https://github.com/adrai/flowchart.js/pull/115) thanks to [bertrandmartel](https://github.com/bertrandmartel)\n- add line style flow support [#113](https://github.com/adrai/flowchart.js/pull/115) thanks to [bertrandmartel](https://github.com/bertrandmartel)\n\n### v1.6.6\n\n- Fix disruptive space char when parsing [#105](https://github.com/adrai/flowchart.js/pull/105)\n\n### v1.6.5\n\n- set proper engine version in package.json\n\n### v1.6.4\n\n- raphael now is an npm dependency (not the git reference anymore)\n\n### v1.6.3\n\n- Allow going to same symbol thanks to [nonylene](https://github.com/nonylene) [#83](https://github.com/adrai/flowchart.js/pull/83)\n\n### v1.6.2\n\n- Fixed not calculate viewBox and size properly thanks to [jackycute](https://github.com/jackycute) [#74](https://github.com/adrai/flowchart.js/issues/#74)\n\n### v1.6.1\n\n- Fixed lines are not included in the calculation of viewBox and size thanks to [jackycute](https://github.com/jackycute) [#72](https://github.com/adrai/flowchart.js/issues/#72) [#67](https://github.com/adrai/flowchart.js/issues/#67)\n\n### v1.6.0\n\n- changed build to use only webpack thanks to [sergeyt](https://github.com/sergeyt) [#70](https://github.com/adrai/flowchart.js/issues/70)\n\n### v1.4.2\n\n- optimized handling of special characters thanks to the advice of [Badhumvee](https://github.com/Badhumvee)\n\n### v1.4.0\n\n- Support scale option [#52](https://github.com/adrai/flowchart.js/pull/52) thanks to [hikarock](https://github.com/hikarock)\n\n### v1.3.4\n\n- make text better readable [#31](https://github.com/adrai/flowchart.js/issues/31)\n- sorry\n\n### v1.3.3\n\n- make text better readable [#31](https://github.com/adrai/flowchart.js/issues/31)\n\n### v1.3.2\n\n- optimized a bit for left support [#26](https://github.com/adrai/flowchart.js/issues/26)\n\n### v1.3.1\n\n- added support for css class [#24](https://github.com/adrai/flowchart.js/pull/24)\n\n### v1.3.0\n\n- added support for color coding (flowstate) [#23](https://github.com/adrai/flowchart.js/pull/23) thanks to [Stwissel](https://github.com/Stwissel)\n\n### v1.2.12\n\n- optimized start from right [#22](https://github.com/adrai/flowchart.js/issues/22)\n\n### v1.2.11\n\n- Added node id to objects [#18](https://github.com/adrai/flowchart.js/pull/18) thanks to [billcavalieri](https://github.com/billcavalieri)\n\n### v1.2.10\n\n- fix direction changes [#15](https://github.com/adrai/flowchart.js/issues/15)\n\n### v1.2.9\n\n- try to optimize handle directions on other symbols too [#15](https://github.com/adrai/flowchart.js/issues/15)\n- added more font options (font, font-family, font-weight)\n\n### v1.2.8\n\n- try to handle directions on other symbols too [#15](https://github.com/adrai/flowchart.js/issues/15)\n\n### v1.2.7\n\n- merge [#12](https://github.com/adrai/flowchart.js/pull/12)\n- fixed subroutine\n\n### v1.2.6\n\n- added a maxWidth option for the chart [#10](https://github.com/adrai/flowchart.js/pull/10)\n\n### v1.2.5\n\n- different styles for different symbol types [#9](https://github.com/adrai/flowchart.js/issues/9)\n\n### v1.2.4\n\n- fixed condition jump to an other symbol on same column\n\n### v1.2.3\n\n- added \"arrow-end\" option [#6](https://github.com/adrai/flowchart.js/pull/6)\n\n### v1.2.2\n\n- fix flowchart parsing\n\n### v1.2.1\n\n- fix condition direction\n\n### v1.2.0\n\n- ability to specify directionality of condition branches [#3](https://github.com/adrai/flowchart.js/issues/3)\n\n### v1.1.3\n\n- fix for old browsers\n\n### v1.1.2\n\n- let lines jump\n\n### v1.1.1\n\n- set yes or no text to source start instead of middle\n\n### v1.1.0\n\n- optional link for symbols\n\n\n### v1.0.0\n\n- first release\n"
  },
  {
    "path": "src/flowchart.chart.js",
    "content": "var Raphael = require('raphael');\nvar defaults = require('./flowchart.helpers').defaults;\nvar defaultOptions = require('./flowchart.defaults');\nvar Condition = require('./flowchart.symbol.condition');\nvar Parallel = require('./flowchart.symbol.parallel');\n\nfunction FlowChart(container, options) {\n  options = options || {};\n\n  this.paper = new Raphael(container);\n\n  this.options = defaults(options, defaultOptions);\n\n  this.symbols = [];\n  this.lines = [];\n  this.start = null;\n}\n\nFlowChart.prototype.handle = function(symbol) {\n  if (this.symbols.indexOf(symbol) <= -1) {\n    this.symbols.push(symbol);\n  }\n\n  var flowChart = this;\n\n  if (symbol instanceof(Condition)) {\n    symbol.yes = function(nextSymbol) {\n      symbol.yes_symbol = nextSymbol;\n      if(symbol.no_symbol) {\n        symbol.pathOk = true;\n      }\n      return flowChart.handle(nextSymbol);\n    };\n    symbol.no = function(nextSymbol) {\n      symbol.no_symbol = nextSymbol;\n      if (symbol.yes_symbol) {\n        symbol.pathOk = true;\n      }\n      return flowChart.handle(nextSymbol);\n    };\n  } else if (symbol instanceof(Parallel)) {\n    symbol.path1 = function(nextSymbol) {\n      symbol.path1_symbol = nextSymbol;\n      if (symbol.path2_symbol) {\n        symbol.pathOk = true;\n      }\n      return flowChart.handle(nextSymbol);\n    };\n    symbol.path2 = function(nextSymbol) {\n      symbol.path2_symbol = nextSymbol;\n      if (symbol.path3_symbol) {\n        symbol.pathOk = true;\n      }\n      return flowChart.handle(nextSymbol);\n    };\n    symbol.path3 = function(nextSymbol) {\n      symbol.path3_symbol = nextSymbol;\n      if (symbol.path1_symbol) {\n        symbol.pathOk = true;\n      }\n      return flowChart.handle(nextSymbol);\n    };\n  } else {\n    symbol.then = function(nextSymbol) {\n      symbol.next = nextSymbol;\n      symbol.pathOk = true;\n      return flowChart.handle(nextSymbol);\n    };\n  }\n\n  return symbol;\n};\n\nFlowChart.prototype.startWith = function(symbol) {\n  this.start = symbol;\n  return this.handle(symbol);\n};\n\nFlowChart.prototype.render = function() {\n  var maxWidth = 0,\n    maxHeight = 0,\n    i = 0,\n    len = 0,\n    maxX = 0,\n    maxY = 0,\n    minX = 0,\n    minY = 0,\n    symbol,\n    line;\n\n  for (i = 0, len = this.symbols.length; i < len; i++) {\n    symbol = this.symbols[i];\n    if (symbol.width > maxWidth) {\n      maxWidth = symbol.width;\n    }\n    if (symbol.height > maxHeight) {\n      maxHeight = symbol.height;\n    }\n  }\n\n  for (i = 0, len = this.symbols.length; i < len; i++) {\n    symbol = this.symbols[i];\n    symbol.shiftX(this.options.x + (maxWidth - symbol.width)/2 + this.options['line-width']);\n    symbol.shiftY(this.options.y + (maxHeight - symbol.height)/2 + this.options['line-width']);\n  }\n\n  this.start.render();\n  // for (i = 0, len = this.symbols.length; i < len; i++) {\n  //   symbol = this.symbols[i];\n  //   symbol.render();\n  // }\n\n  for (i = 0, len = this.symbols.length; i < len; i++) {\n    symbol = this.symbols[i];\n    symbol.renderLines();\n  }\n\n  maxX = this.maxXFromLine;\n\n  var x;\n  var y;\n\n  for (i = 0, len = this.symbols.length; i < len; i++) {\n    symbol = this.symbols[i];\n    var leftX = symbol.getX()\n    x = leftX + symbol.width;\n    y = symbol.getY() + symbol.height;\n    if (leftX < minX) {\n      minX = leftX;\n    }\n    if (x > maxX) {\n      maxX = x;\n    }\n    if (y > maxY) {\n      maxY = y;\n    }\n  }\n\n  for (i = 0, len = this.lines.length; i < len; i++) {\n    line = this.lines[i].getBBox();\n    x = line.x;\n    y = line.y;\n    var x2 = line.x2;\n    var y2 = line.y2;\n    if (x < minX) {\n      minX = x;\n    }\n    if (y < minY) {\n      minY = y;\n    }\n    if (x2 > maxX) {\n      maxX = x2;\n    }\n    if (y2 > maxY) {\n      maxY = y2;\n    }\n  }\n\n  var scale = this.options['scale'];\n  var lineWidth = this.options['line-width'];\n\n  if (this.minXFromSymbols < minX) minX = this.minXFromSymbols;\n\n  if (minX < 0) minX -= lineWidth;\n  if (minY < 0) minY -= lineWidth;\n\n  var width = maxX + lineWidth - minX;\n  var height = maxY + lineWidth - minY;\n\n  this.paper.setSize(width * scale, height * scale);\n  this.paper.setViewBox(minX, minY, width, height, true);\n};\n\nFlowChart.prototype.clean = function() {\n  if (this.paper) {\n    var paperDom = this.paper.canvas;\n    paperDom.parentNode && paperDom.parentNode.removeChild(paperDom);\n  }\n};\n\nmodule.exports = FlowChart;"
  },
  {
    "path": "src/flowchart.defaults.js",
    "content": "// defaults\nmodule.exports = {\n  'x': 0,\n  'y': 0,\n  // 'roundness': 0,\n  'line-width': 3,\n  'line-length': 50,\n  'text-margin': 10,\n  'font-size': 14,\n  'font-color': 'black',\n  // 'font': 'normal',\n  // 'font-family': 'calibri',\n  // 'font-weight': 'normal',\n  'line-color': 'black',\n  'element-color': 'black',\n  'fill': 'white',\n  'yes-text': 'yes',\n  'no-text': 'no',\n  'arrow-end': 'block',\n  'class': 'flowchart',\n  'scale': 1,\n  'symbols': {\n    'start': {},\n    'end': {},\n    'condition': {},\n    'inputoutput': {},\n    'input': {}, //tds\n    'output': {}, //tds    \n    'operation': {},\n    'subroutine': {},\n    'parallel': {}\n  } //,\n  // 'flowstate' : {\n  //   'past' : { 'fill': '#CCCCCC', 'font-size': 12},\n  //   'current' : {'fill': 'yellow', 'font-color': 'red', 'font-weight': 'bold'},\n  //   'future' : { 'fill': '#FFFF99'},\n  //   'invalid': {'fill': '#444444'}\n  // }\n};"
  },
  {
    "path": "src/flowchart.functions.js",
    "content": "function drawPath(chart, location, points) {\n  var i, len;\n  var path = 'M{0},{1}';\n  for (i = 2, len = 2 * points.length + 2; i < len; i+=2) {\n    path += ' L{' + i + '},{' + (i + 1) + '}';\n  }\n  var pathValues = [location.x, location.y];\n  for (i = 0, len = points.length; i < len; i++) {\n    pathValues.push(points[i].x);\n    pathValues.push(points[i].y);\n  }\n  var symbol = chart.paper.path(path, pathValues);\n  symbol.attr('stroke', chart.options['element-color']);\n  symbol.attr('stroke-width', chart.options['line-width']);\n\n  var font = chart.options.font;\n  var fontF = chart.options['font-family'];\n  var fontW = chart.options['font-weight'];\n\n  if (font) symbol.attr({ 'font': font });\n  if (fontF) symbol.attr({ 'font-family': fontF });\n  if (fontW) symbol.attr({ 'font-weight': fontW });\n\n  return symbol;\n}\n\nfunction drawLine(chart, from, to, text) {\n  var i, len;\n\n  if (Object.prototype.toString.call(to) !== '[object Array]') {\n    to = [to];\n  }\n\n  var path = 'M{0},{1}';\n  for (i = 2, len = 2 * to.length + 2; i < len; i+=2) {\n    path += ' L{' + i + '},{' + (i + 1) + '}';\n  }\n  var pathValues = [from.x, from.y];\n  for (i = 0, len = to.length; i < len; i++) {\n    pathValues.push(to[i].x);\n    pathValues.push(to[i].y);\n  }\n\n  var line = chart.paper.path(path, pathValues);\n  line.attr({\n    stroke: chart.options['line-color'],\n    'stroke-width': chart.options['line-width'],\n    'arrow-end': chart.options['arrow-end']\n  });\n\n  var font = chart.options.font;\n  var fontF = chart.options['font-family'];\n  var fontW = chart.options['font-weight'];\n\n  if (font) line.attr({ 'font': font });\n  if (fontF) line.attr({ 'font-family': fontF });\n  if (fontW) line.attr({ 'font-weight': fontW });\n\n  if (text) {\n\n    var centerText = false;\n\n    var textPath = chart.paper.text(0, 0, text);\n    var textAnchor = 'start';\n\n    var isHorizontal = false;\n    var firstTo = to[0];\n\n    if (from.y === firstTo.y) {\n      isHorizontal = true;\n    }\n\n    var x = 0,\n        y = 0;\n\n    if (centerText) {\n      if (from.x > firstTo.x) {\n        x = from.x - (from.x - firstTo.x)/2;\n      } else {\n        x = firstTo.x - (firstTo.x - from.x)/2;\n      }\n\n      if (from.y > firstTo.y) {\n        y = from.y - (from.y - firstTo.y)/2;\n      } else {\n        y = firstTo.y - (firstTo.y - from.y)/2;\n      }\n\n      if (isHorizontal) {\n        x -= textPath.getBBox().width/2;\n        y -= chart.options['text-margin'];\n      } else {\n        x += chart.options['text-margin'];\n        y -= textPath.getBBox().height/2;\n      }\n    } else {\n      x = from.x;\n      y = from.y;\n\n      if (isHorizontal) {\n        if (from.x > firstTo.x) {\n          x -= chart.options['text-margin']/2;\n          textAnchor = 'end';\n        } else {\n          x += chart.options['text-margin']/2;\n        }\n        y -= chart.options['text-margin'];\n      } else {\n        x += chart.options['text-margin']/2;\n        y += chart.options['text-margin'];\n        if (from.y > firstTo.y) {\n          y -= chart.options['text-margin']*2;\n        }\n      }\n    }\n\n    textPath.attr({\n      'text-anchor': textAnchor,\n      'font-size': chart.options['font-size'],\n      'fill': chart.options['font-color'],\n      x: x,\n      y: y\n    });\n\n    if (font) textPath.attr({ 'font': font });\n    if (fontF) textPath.attr({ 'font-family': fontF });\n    if (fontW) textPath.attr({ 'font-weight': fontW });\n  }\n\n  return line;\n}\n\nfunction checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n  // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n  var denominator, a, b, numerator1, numerator2, result = {\n    x: null,\n    y: null,\n    onLine1: false,\n    onLine2: false\n  };\n  denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n  if (denominator === 0) {\n    return result;\n  }\n  a = line1StartY - line2StartY;\n  b = line1StartX - line2StartX;\n  numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n  numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n  a = numerator1 / denominator;\n  b = numerator2 / denominator;\n\n  // if we cast these lines infinitely in both directions, they intersect here:\n  result.x = line1StartX + (a * (line1EndX - line1StartX));\n  result.y = line1StartY + (a * (line1EndY - line1StartY));\n  /*\n  // it is worth noting that this should be the same as:\n  x = line2StartX + (b * (line2EndX - line2StartX));\n  y = line2StartX + (b * (line2EndY - line2StartY));\n  */\n  // if line1 is a segment and line2 is infinite, they intersect if:\n  if (a > 0 && a < 1) {\n    result.onLine1 = true;\n  }\n  // if line2 is a segment and line1 is infinite, they intersect if:\n  if (b > 0 && b < 1) {\n    result.onLine2 = true;\n  }\n  // if line1 and line2 are segments, they intersect if both of the above are true\n  return result;\n}\n\nmodule.exports = {\n\tdrawPath: drawPath,\n\tdrawLine: drawLine,\n\tcheckLineIntersection: checkLineIntersection\n};\n"
  },
  {
    "path": "src/flowchart.helpers.js",
    "content": "function _defaults(options, defaultOptions) {\n  if (!options || typeof options === 'function') {\n    return defaultOptions;\n  }\n\n  var merged = {};\n  for (var attrname in defaultOptions) {\n    merged[attrname] = defaultOptions[attrname];\n  }\n\n  for (attrname in options) {\n    if (options[attrname]) {\n      if (typeof merged[attrname] === 'object') {\n        merged[attrname] = _defaults(merged[attrname], options[attrname]);\n      } else {\n        merged[attrname] = options[attrname];\n      }\n    }\n  }\n  return merged;\n}\n\nfunction _inherits(ctor, superCtor) {\n  if (typeof(Object.create) === 'function') {\n    // implementation from standard node.js 'util' module\n    ctor.super_ = superCtor;\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  } else {\n    // old school shim for old browsers\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n}\n\n// move dependent functions to a container so that\n// they can be overriden easier in no jquery environment (node.js)\nmodule.exports = {\n  defaults: _defaults,\n  inherits: _inherits\n};\n"
  },
  {
    "path": "src/flowchart.parse.js",
    "content": "var FlowChart = require('./flowchart.chart');\nvar Start = require('./flowchart.symbol.start');\nvar End = require('./flowchart.symbol.end');\nvar Operation = require('./flowchart.symbol.operation');\nvar InputOutput = require('./flowchart.symbol.inputoutput');\nvar Input = require('./flowchart.symbol.input'); //tds\nvar Output = require('./flowchart.symbol.output'); //tds\nvar Subroutine = require('./flowchart.symbol.subroutine');\nvar Condition = require('./flowchart.symbol.condition');\nvar Parallel = require('./flowchart.symbol.parallel');\n\n\nfunction parse(input) {\n  input = input || '';\n  input = input.trim();\n\n  var chart = {\n    symbols: {},\n    start: null,\n    drawSVG: function(container, options) {\n      var self = this;\n\n      if (this.diagram) {\n        this.diagram.clean();\n      }\n\n      var diagram = new FlowChart(container, options);\n      this.diagram = diagram;\n      var dispSymbols = {};\n\n      function getDisplaySymbol(s) {\n        if (dispSymbols[s.key]) {\n          return dispSymbols[s.key];\n        }\n\n        switch (s.symbolType) {\n          case 'start':\n            dispSymbols[s.key] = new Start(diagram, s);\n            break;\n          case 'end':\n            dispSymbols[s.key] = new End(diagram, s);\n            break;\n          case 'operation':\n            dispSymbols[s.key] = new Operation(diagram, s);\n            break;\n          case 'inputoutput':\n            dispSymbols[s.key] = new InputOutput(diagram, s);\n            break;\n          case 'input':\n            dispSymbols[s.key] = new Input(diagram, s); //tds\n            break;         \n          case 'output':\n            dispSymbols[s.key] = new Output(diagram, s); //tds\n            break;          \n          case 'subroutine':\n            dispSymbols[s.key] = new Subroutine(diagram, s);\n            break;\n          case 'condition':\n            dispSymbols[s.key] = new Condition(diagram, s);\n            break;\n          case 'parallel':\n            dispSymbols[s.key] = new Parallel(diagram, s);\n            break;\n          default:\n            return new Error('Wrong symbol type!');\n        }\n\n        return dispSymbols[s.key];\n      }\n\n      (function constructChart(s, prevDisp, prev) {\n        var dispSymb = getDisplaySymbol(s);\n\n        if (self.start === s) {\n          diagram.startWith(dispSymb);\n        } else if (prevDisp && prev && !prevDisp.pathOk) {\n          if (prevDisp instanceof(Condition)) {\n            if (prev.yes === s) {\n              prevDisp.yes(dispSymb);\n            }\n            if (prev.no === s) {\n              prevDisp.no(dispSymb);\n            }\n          } else if (prevDisp instanceof(Parallel)) {\n            if (prev.path1 === s) {\n              prevDisp.path1(dispSymb);\n            }\n            if (prev.path2 === s) {\n              prevDisp.path2(dispSymb);\n            }\n            if (prev.path3 === s) {\n              prevDisp.path3(dispSymb);\n            }\n          } else {\n            prevDisp.then(dispSymb);\n          }\n        }\n\n        if (dispSymb.pathOk) {\n          return dispSymb;\n        }\n\n        if (dispSymb instanceof(Condition)) {\n          if (s.yes) {\n            constructChart(s.yes, dispSymb, s);\n          }\n          if (s.no) {\n            constructChart(s.no, dispSymb, s);\n          }\n        } else if (dispSymb instanceof(Parallel)) {\n          if (s.path1) {\n            constructChart(s.path1, dispSymb, s);\n          }\n          if (s.path2) {\n            constructChart(s.path2, dispSymb, s);\n          }\n          if (s.path3) {\n            constructChart(s.path3, dispSymb, s);\n          }\n        } else if (s.next) {\n          constructChart(s.next, dispSymb, s);\n        }\n\n        return dispSymb;\n      })(this.start);\n\n      diagram.render();\n    },\n    clean: function() {\n      this.diagram.clean();\n    },\n    options: function() {\n      return this.diagram.options;\n    }\n  };\n\n  var lines = [];\n  var prevBreak = 0;\n  for (var i0 = 1, i0len = input.length; i0 < i0len; i0++) {\n    if(input[i0] === '\\n' && input[i0 - 1] !== '\\\\') {\n      var line0 = input.substring(prevBreak, i0);\n      prevBreak = i0 + 1;\n      lines.push(line0.replace(/\\\\\\n/g, '\\n'));\n    }\n  }\n\n  if (prevBreak < input.length) {\n    lines.push(input.substr(prevBreak));\n  }\n\n  for (var l = 1, len = lines.length; l < len;) {\n    var currentLine = lines[l];\n\n    if (currentLine.indexOf('->') < 0 && currentLine.indexOf('=>') < 0 && currentLine.indexOf('@>') < 0) {\n      lines[l - 1] += '\\n' + currentLine;\n      lines.splice(l, 1);\n      len--;\n    } else {\n      l++;\n    }\n  }\n\n  function getStyle(s){\n    var startIndex = s.indexOf('(') + 1;\n    var endIndex = s.indexOf(')');\n    if (startIndex >= 0 && endIndex >= 0) {\n      return s.substring(startIndex,endIndex);\n    }\n    return '{}';\n  }\n\n  function getSymbValue(s){\n    var startIndex = s.indexOf('(') + 1;\n    var endIndex = s.indexOf(')');\n    if (startIndex >= 0 && endIndex >= 0) {\n      return s.substring(startIndex,endIndex);\n    }\n    return '';\n  }\n\n  function getSymbol(s) {\n    var startIndex = s.indexOf('(') + 1;\n    var endIndex = s.indexOf(')');\n    if (startIndex >= 0 && endIndex >= 0) {\n      return chart.symbols[s.substring(0, startIndex - 1)];\n    }\n    return chart.symbols[s];\n  }\n\n  function getNextPath(s) {\n    var next = 'next';\n    var startIndex = s.indexOf('(') + 1;\n    var endIndex = s.indexOf(')');\n    if (startIndex >= 0 && endIndex >= 0) {\n      next = flowSymb.substring(startIndex, endIndex);\n      if (next.indexOf(',') < 0) {\n        if (next !== 'yes' && next !== 'no') {\n          next = 'next, ' + next;\n        }\n      }\n    }\n    return next;\n  }\n  \n  function getAnnotation(s) {\n\tvar startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\");\n\tvar tmp = s.substring(startIndex, endIndex);\n\tif(tmp.indexOf(\",\") > 0) { tmp = tmp.substring(0, tmp.indexOf(\",\")); }\n\tvar tmp_split = tmp.split(\"@\");\n\tif(tmp_split.length > 1)\n\t\treturn startIndex >= 0 && endIndex >= 0 ? tmp_split[1] : \"\";\n  }\n\n  while (lines.length > 0) {\n    var line = lines.splice(0, 1)[0].trim();\n\n    if (line.indexOf('=>') >= 0) {\n      // definition\n      var parts = line.split('=>');\n      var symbol = {\n        key: parts[0].replace(/\\(.*\\)/, ''),\n        symbolType: parts[1],\n        text: null,\n        link: null,\n        target: null,\n        flowstate: null,\n        function: null,\n        lineStyle: {},\n        params: {}\n      };\n\n      //parse parameters\n      var params = parts[0].match(/\\((.*)\\)/);\n      if (params && params.length > 1){\n        var entries = params[1].split(',');\n        for(var i = 0; i < entries.length; i++) {\n          var entry = entries[i].split('=');\n          if (entry.length == 2) {\n            symbol.params[entry[0]] = entry[1];\n          }\n        }\n      }\n\n      var sub;\n\n      if (symbol.symbolType.indexOf(': ') >= 0) {\n        sub = symbol.symbolType.split(': ');\n        symbol.symbolType = sub.shift();\n        symbol.text = sub.join(': ');\n      }\n\n      if (symbol.text && symbol.text.indexOf(':$') >= 0) {\n        sub = symbol.text.split(':$');\n        symbol.text = sub.shift();\n        symbol.function = sub.join(':$');\n      } else if (symbol.symbolType.indexOf(':$') >= 0) {\n        sub = symbol.symbolType.split(':$');\n        symbol.symbolType = sub.shift();\n        symbol.function = sub.join(':$');\n      } else if (symbol.text && symbol.text.indexOf(':>') >= 0) {\n        sub = symbol.text.split(':>');\n        symbol.text = sub.shift();\n        symbol.link = sub.join(':>');\n      } else if (symbol.symbolType.indexOf(':>') >= 0) {\n        sub = symbol.symbolType.split(':>');\n        symbol.symbolType = sub.shift();\n        symbol.link = sub.join(':>');\n      }\n\n      if (symbol.symbolType.indexOf('\\n') >= 0) {\n        symbol.symbolType = symbol.symbolType.split('\\n')[0];\n      }\n\n      /* adding support for links */\n      if (symbol.link) {\n        var startIndex = symbol.link.indexOf('[') + 1;\n        var endIndex = symbol.link.indexOf(']');\n        if (startIndex >= 0 && endIndex >= 0) {\n          symbol.target = symbol.link.substring(startIndex, endIndex);\n          symbol.link = symbol.link.substring(0, startIndex - 1);\n        }\n      }\n      /* end of link support */\n\n      /* adding support for flowstates */\n      if (symbol.text) {\n        if (symbol.text.indexOf('|') >= 0) {\n          var txtAndState = symbol.text.split('|');\n          symbol.flowstate = txtAndState.pop().trim();\n          symbol.text = txtAndState.join('|');\n        }\n      }\n      /* end of flowstate support */\n\n      chart.symbols[symbol.key] = symbol;\n\n    } else if (line.indexOf('->') >= 0) {\n      var ann = getAnnotation(line);\n      if (ann) {\n        line = line.replace('@' + ann, ''); \n      }\n      // flow\n      var flowSymbols = line.split('->');\n      for (var iS = 0, lenS = flowSymbols.length; iS < lenS; iS++) {\n        var flowSymb = flowSymbols[iS];\n        var symbVal = getSymbValue(flowSymb);\n\n        if (symbVal === 'true' || symbVal === 'false') {\n          // map true or false to yes or no respectively\n          flowSymb = flowSymb.replace('true', 'yes');\n          flowSymb = flowSymb.replace('false', 'no');\n        }\n        \n        var next = getNextPath(flowSymb);\n        var realSymb = getSymbol(flowSymb);\n\n        var direction = null;\n        if (next.indexOf(',') >= 0) {\n          var condOpt = next.split(',');\n          next = condOpt[0];\n          direction = condOpt[1].trim();\n        }\n\n        if (ann) {\n          if (realSymb.symbolType === 'condition') {\n            if (next === \"yes\" || next === \"true\") {\n              realSymb.yes_annotation = ann;\n            } else {\n              realSymb.no_annotation = ann;\n            }\n          } else if (realSymb.symbolType === 'parallel') {\n            if (next === 'path1') {\n              realSymb.path1_annotation = ann;\n            } else if (next === 'path2') {\n              realSymb.path2_annotation = ann;\n            } else if (next === 'path3') {\n              realSymb.path3_annotation = ann;\n            }\n          }\n          ann = null;\n        }\n\n        if (!chart.start) {\n          chart.start = realSymb;\n        }\n\n        if (iS + 1 < lenS) {\n          var nextSymb = flowSymbols[iS + 1];\n          realSymb[next] = getSymbol(nextSymb);\n          realSymb['direction_' + next] = direction;\n          direction = null;\n        }\n      }\n    } else if (line.indexOf('@>') >= 0) {\n\n      // line style\n      var lineStyleSymbols = line.split('@>');\n      for (var iSS = 0, lenSS = lineStyleSymbols.length; iSS < lenSS; iSS++) {\n        if ((iSS + 1) !== lenSS) {\n          var curSymb = getSymbol(lineStyleSymbols[iSS]);\n          var nextSymbol = getSymbol(lineStyleSymbols[iSS+1]);\n\n          curSymb['lineStyle'][nextSymbol.key] = JSON.parse(getStyle(lineStyleSymbols[iSS + 1]));\n        }\n      }\n    }\n\n  }\n  return chart;\n}\n\nmodule.exports = parse;\n"
  },
  {
    "path": "src/flowchart.shim.js",
    "content": "// add indexOf to non ECMA-262 standard compliant browsers\nif (!Array.prototype.indexOf) {\n  Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\n    \"use strict\";\n    if (this === null) {\n      throw new TypeError();\n    }\n    var t = Object(this);\n    var len = t.length >>> 0;\n    if (len === 0) {\n      return -1;\n    }\n    var n = 0;\n    if (arguments.length > 0) {\n      n = Number(arguments[1]);\n      if (n != n) { // shortcut for verifying if it's NaN\n        n = 0;\n      } else if (n !== 0 && n != Infinity && n != -Infinity) {\n        n = (n > 0 || -1) * Math.floor(Math.abs(n));\n      }\n    }\n    if (n >= len) {\n      return -1;\n    }\n    var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n    for (; k < len; k++) {\n      if (k in t && t[k] === searchElement) {\n        return k;\n      }\n    }\n    return -1;\n  };\n}\n\n// add lastIndexOf to non ECMA-262 standard compliant browsers\nif (!Array.prototype.lastIndexOf) {\n  Array.prototype.lastIndexOf = function(searchElement /*, fromIndex*/) {\n    \"use strict\";\n    if (this === null) {\n      throw new TypeError();\n    }\n    var t = Object(this);\n    var len = t.length >>> 0;\n    if (len === 0) {\n      return -1;\n    }\n    var n = len;\n    if (arguments.length > 1) {\n      n = Number(arguments[1]);\n      if (n != n) {\n        n = 0;\n      } else if (n !== 0 && n != (1 / 0) && n != -(1 / 0)) {\n        n = (n > 0 || -1) * Math.floor(Math.abs(n));\n      }\n    }\n    var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);\n    for (; k >= 0; k--) {\n      if (k in t && t[k] === searchElement) {\n        return k;\n      }\n    }\n    return -1;\n  };\n}\n\nif (!String.prototype.trim) {\n  String.prototype.trim = function() {\n    return this.replace(/^\\s+|\\s+$/g, '');\n  };\n}"
  },
  {
    "path": "src/flowchart.symbol.condition.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction Condition(chart, options) {\n  options = options || {};\n  Symbol.call(this, chart, options);\n  this.yes_annotation = options.yes_annotation;\n  this.no_annotation = options.no_annotation;\n  this.textMargin = this.getAttr('text-margin');\n  this.yes_direction = options.direction_yes;\n  this.no_direction = options.direction_no;\n  if (!this.no_direction && this.yes_direction === 'right') {\n    this.no_direction = 'bottom';\n  } else if (!this.yes_direction && this.no_direction === 'bottom') {\n    this.yes_direction = 'right'\n  }\n  this.yes_direction = this.yes_direction || 'bottom';\n  this.no_direction = this.no_direction || 'right';\n\n  this.text.attr({\n    x: this.textMargin * 2\n  });\n\n  var width = this.text.getBBox().width + 3 * this.textMargin;\n  width += width/2;\n  var height = this.text.getBBox().height + 2 * this.textMargin;\n  height += height/2;\n  height = Math.max(width * 0.5, height);\n  var startX = width/4;\n  var startY = height/4;\n\n  this.text.attr({\n    x: startX + this.textMargin/2\n  });\n\n  var start = {x: startX, y: startY};\n  var points = [\n    {x: startX - width/4, y: startY + height/4},\n    {x: startX - width/4 + width/2, y: startY + height/4 + height/2},\n    {x: startX - width/4 + width, y: startY + height/4},\n    {x: startX - width/4 + width/2, y: startY + height/4 - height/2},\n    {x: startX - width/4, y: startY + height/4}\n  ];\n\n  var symbol = drawPath(chart, start, points);\n\n  symbol.attr({\n    stroke: this.getAttr('element-color'),\n    'stroke-width': this.getAttr('line-width'),\n    fill: this.getAttr('fill')\n  });\n  if (options.link) { symbol.attr('href', options.link); }\n  if (options.target) { symbol.attr('target', options.target); }\n  if (options.key) { symbol.node.id = options.key; }\n  symbol.node.setAttribute('class', this.getAttr('class'));\n\n  this.text.attr({\n    y: symbol.getBBox().height/2\n  });\n\n  this.group.push(symbol);\n  symbol.insertBefore(this.text);\n  this.symbol = symbol\n\n  this.initialize();\n}\ninherits(Condition, Symbol);\n\nCondition.prototype.render = function() {\n  var self = this;\n  if (this.yes_direction) {\n    this[this.yes_direction + '_symbol'] = this.yes_symbol;\n  }\n\n  if (this.no_direction) {\n    this[this.no_direction + '_symbol'] = this.no_symbol;\n  }\n\n  var lineLength = this.getAttr('line-length');\n\n  if (this.bottom_symbol) {\n    var bottomPoint = this.getBottom();\n\n    if (!this.bottom_symbol.isPositioned) {\n      this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n      this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width/2);\n      this.bottom_symbol.isPositioned = true;\n\n      this.bottom_symbol.render();\n    }\n  }\n\n  if (this.right_symbol) {\n    var rightPoint = this.getRight();\n\n    if (!this.right_symbol.isPositioned) {\n\n      this.right_symbol.setY(rightPoint.y - this.right_symbol.height/2);\n      this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n\n      (function shift() {\n        var hasSymbolUnder = false;\n        var symb;\n        for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n          symb = self.chart.symbols[i];\n\n          if (!self.params['align-next'] || self.params['align-next'] !== 'no') { \n            var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n            if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width/2) {\n              hasSymbolUnder = true;\n              break;\n            }\n          }\n        }\n\n        if (hasSymbolUnder) {\n          if (self.right_symbol.symbolType === 'end') return;\n          self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n          shift();\n        }\n      })();\n\n      this.right_symbol.isPositioned = true;\n\n      this.right_symbol.render();\n    }\n  }\n  \n  if (this.left_symbol) {\n    var leftPoint = this.getLeft();\n  \n    if (!this.left_symbol.isPositioned) {\n      this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);\n      this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n\n      (function shift() {\n        var hasSymbolUnder = false;\n        var symb;\n        for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n          symb = self.chart.symbols[i];\n    \n          if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n            var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n            if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n              hasSymbolUnder = true;\n              break;\n            }\n          }\n        }\n    \n        if (hasSymbolUnder) {\n          if (self.left_symbol.symbolType === 'end') return;\n          self.left_symbol.setX(symb.getX() + symb.width + lineLength);\n          shift();\n        }\n      })();\n  \n      this.left_symbol.isPositioned = true;\n  \n      this.left_symbol.render();\n    }\n  }\n};\n\nCondition.prototype.renderLines = function() {\n  if (this.yes_symbol) {\n    this.drawLineTo(this.yes_symbol, this.yes_annotation ? this.yes_annotation : this.getAttr('yes-text'), this.yes_direction);\n  }\n\n  if (this.no_symbol) {\n    this.drawLineTo(this.no_symbol, this.no_annotation ? this.no_annotation : this.getAttr('no-text'), this.no_direction);\n  }\n};\n\nmodule.exports = Condition;\n"
  },
  {
    "path": "src/flowchart.symbol.end.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction End(chart, options) {\n  var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n  options = options || {};\n  options.text = options.text || 'End';\n  Symbol.call(this, chart, options, symbol);\n}\ninherits(End, Symbol);\n\nmodule.exports = End;\n"
  },
  {
    "path": "src/flowchart.symbol.input.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction Input(chart, options) {\n  options = options || {};\n  Symbol.call(this, chart, options);\n  this.textMargin = this.getAttr('text-margin');\n\n  this.text.attr({\n    x: this.textMargin * 3\n  });\n\n  var width = this.text.getBBox().width + 4 * this.textMargin;\n  var height = this.text.getBBox().height + 2 * this.textMargin;\n  var startX = this.textMargin;\n  var startY = height/2;\n\n  var start = {x: startX, y: startY};\n  var points = [\n    {x: startX - this.textMargin + 2 * this.textMargin, y: height},\n    {x: startX - this.textMargin + width, y: height},\n    {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n    {x: startX - this.textMargin, y: 0},\n    {x: startX, y: startY}\n  ];\n\n  var symbol = drawPath(chart, start, points);\n\n  symbol.attr({\n    stroke: this.getAttr('element-color'),\n    'stroke-width': this.getAttr('line-width'),\n    fill: this.getAttr('fill')\n  });\n  if (options.link) { symbol.attr('href', options.link); }\n  if (options.target) { symbol.attr('target', options.target); }\n  if (options.key) { symbol.node.id = options.key; }\n  symbol.node.setAttribute('class', this.getAttr('class'));\n\n  this.text.attr({\n    y: symbol.getBBox().height/2\n  });\n\n  this.group.push(symbol);\n  symbol.insertBefore(this.text);\n  this.symbol = symbol\n\n  this.initialize();\n}\ninherits(Input, Symbol);\n\nInput.prototype.getLeft = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX() + this.textMargin;\n  return {x: x, y: y};\n};\n\nInput.prototype.getRight = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX() + this.group.getBBox().width - this.textMargin;\n  return {x: x, y: y};\n};\n\nmodule.exports = Input;\n\n\n"
  },
  {
    "path": "src/flowchart.symbol.inputoutput.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction InputOutput(chart, options) {\n  options = options || {};\n  Symbol.call(this, chart, options);\n  this.textMargin = this.getAttr('text-margin');\n\n  this.text.attr({\n    x: this.textMargin * 3\n  });\n\n  var width = this.text.getBBox().width + 4 * this.textMargin;\n  var height = this.text.getBBox().height + 2 * this.textMargin;\n  var startX = this.textMargin;\n  var startY = height/2;\n\n  var start = {x: startX, y: startY};\n  var points = [\n    {x: startX - this.textMargin, y: height},\n    {x: startX - this.textMargin + width, y: height},\n    {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n    {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n    {x: startX, y: startY}\n  ];\n\n  var symbol = drawPath(chart, start, points);\n\n  symbol.attr({\n    stroke: this.getAttr('element-color'),\n    'stroke-width': this.getAttr('line-width'),\n    fill: this.getAttr('fill')\n  });\n  if (options.link) { symbol.attr('href', options.link); }\n  if (options.target) { symbol.attr('target', options.target); }\n  if (options.key) { symbol.node.id = options.key; }\n  symbol.node.setAttribute('class', this.getAttr('class'));\n\n  this.text.attr({\n    y: symbol.getBBox().height/2\n  });\n\n  this.group.push(symbol);\n  symbol.insertBefore(this.text);\n  this.symbol = symbol\n\n  this.initialize();\n}\ninherits(InputOutput, Symbol);\n\nInputOutput.prototype.getLeft = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX() + this.textMargin;\n  return {x: x, y: y};\n};\n\nInputOutput.prototype.getRight = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX() + this.group.getBBox().width - this.textMargin;\n  return {x: x, y: y};\n};\n\nmodule.exports = InputOutput;\n"
  },
  {
    "path": "src/flowchart.symbol.js",
    "content": "var drawAPI = require('./flowchart.functions');\nvar drawLine = drawAPI.drawLine;\nvar checkLineIntersection = drawAPI.checkLineIntersection;\n\nfunction Symbol(chart, options, symbol) {\n  this.chart = chart;\n  this.group = this.chart.paper.set();\n  this.symbol = symbol;\n  this.connectedTo = [];\n  this.symbolType = options.symbolType;\n  this.flowstate = (options.flowstate || 'future');\n  this.lineStyle = (options.lineStyle || {});\n  this.key = (options.key || '');\n  this.leftLines = [];\n  this.rightLines = [];\n  this.topLines = [];\n  this.bottomLines = [];\n  this.params = options.params;\n\n  this.next_direction = options.next && options['direction_next'] ? options['direction_next'] : undefined;\n\n  this.text = this.chart.paper.text(0, 0, options.text);\n  //Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t\n  if (options.key) { this.text.node.id = options.key + 't'; }\n  this.text.node.setAttribute('class', this.getAttr('class') + 't');\n\n  this.text.attr({\n    'text-anchor': 'start',\n    'x'          : this.getAttr('text-margin'),\n    'fill'       : this.getAttr('font-color'),\n    'font-size'  : this.getAttr('font-size')\n  });\n\n  var font  = this.getAttr('font');\n  var fontF = this.getAttr('font-family');\n  var fontW = this.getAttr('font-weight');\n\n  if (font) this.text.attr({ 'font': font });\n  if (fontF) this.text.attr({ 'font-family': fontF });\n  if (fontW) this.text.attr({ 'font-weight': fontW });\n\n  if (options.link) { this.text.attr('href', options.link); }\n  \n  //ndrqu Add click function with event and options params\n  if (options.function) { \n    this.text.attr({ 'cursor' : 'pointer' });\n\n    this.text.node.addEventListener(\"click\", function(evt) {\n        window[options.function](evt,options);\n    }, false);\n  }\n\n  if (options.target) { this.text.attr('target', options.target); }\n\n  var maxWidth = this.getAttr('maxWidth');\n  if (maxWidth) {\n    // using this approach: http://stackoverflow.com/a/3153457/22466\n    var words = options.text.split(' ');\n    var tempText = \"\";\n    for (var i=0, ii=words.length; i<ii; i++) {\n      var word = words[i];\n      this.text.attr(\"text\", tempText + \" \" + word);\n      if (this.text.getBBox().width > maxWidth) {\n        tempText += \"\\n\" + word;\n      } else {\n        tempText += \" \" + word;\n      }\n    }\n    this.text.attr(\"text\", tempText.substring(1));\n  }\n\n  this.group.push(this.text);\n\n  if (symbol) {\n    var tmpMargin = this.getAttr('text-margin');\n\n    symbol.attr({\n      'fill' : this.getAttr('fill'),\n      'stroke' : this.getAttr('element-color'),\n      'stroke-width' : this.getAttr('line-width'),\n      'width' : this.text.getBBox().width + 2 * tmpMargin,\n      'height' : this.text.getBBox().height + 2 * tmpMargin\n    });\n\n    symbol.node.setAttribute('class', this.getAttr('class'));\n    var roundness = this.getAttr('roundness');\n    if (!isNaN(roundness)) {\n      symbol.node.setAttribute('ry', roundness);\n      symbol.node.setAttribute('rx', roundness);\n    }\n\n    if (options.link) { symbol.attr('href', options.link); }\n    if (options.target) { symbol.attr('target', options.target); }\n\n    //ndrqu Add click function with event and options params\n    if (options.function) { \n        symbol.node.addEventListener(\"click\", function(evt) {\n          window[options.function](evt,options);\n        }, false);\n      symbol.attr({ 'cursor' : 'pointer' });\n    }\n    if (options.key) { symbol.node.id = options.key; }\n\n    this.group.push(symbol);\n    symbol.insertBefore(this.text);\n\n    this.text.attr({\n      'y': symbol.getBBox().height/2\n    });\n\n    this.initialize();\n  }\n\n}\n\n/* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */\nSymbol.prototype.getAttr = function(attName) {\n  if (!this.chart) {\n    return undefined;\n  }\n  var opt3 = (this.chart.options) ? this.chart.options[attName] : undefined;\n  var opt2 = (this.chart.options.symbols) ? this.chart.options.symbols[this.symbolType][attName] : undefined;\n  var opt1;\n  if (this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate]) {\n    opt1 = this.chart.options.flowstate[this.flowstate][attName];\n  }\n  return (opt1 || opt2 || opt3);\n};\n\nSymbol.prototype.initialize = function() {\n  this.group.transform('t' + this.getAttr('line-width') + ',' + this.getAttr('line-width'));\n\n  this.width = this.group.getBBox().width;\n  this.height = this.group.getBBox().height;\n};\n\nSymbol.prototype.getCenter = function() {\n  return {x: this.getX() + this.width/2,\n          y: this.getY() + this.height/2};\n};\n\nSymbol.prototype.getX = function() {\n  return this.group.getBBox().x;\n};\n\nSymbol.prototype.getY = function() {\n  return this.group.getBBox().y;\n};\n\nSymbol.prototype.shiftX = function(x) {\n  this.group.transform('t' + (this.getX() + x) + ',' + this.getY());\n};\n\nSymbol.prototype.setX = function(x) {\n  this.group.transform('t' + x + ',' + this.getY());\n};\n\nSymbol.prototype.shiftY = function(y) {\n  this.group.transform('t' + this.getX() + ',' + (this.getY() + y));\n};\n\nSymbol.prototype.setY = function(y) {\n  this.group.transform('t' + this.getX() + ',' + y);\n};\n\nSymbol.prototype.getTop = function() {\n  var y = this.getY();\n  var x = this.getX() + this.width/2;\n  return {x: x, y: y};\n};\n\nSymbol.prototype.getBottom = function() {\n  var y = this.getY() + this.height;\n  var x = this.getX() + this.width/2;\n  return {x: x, y: y};\n};\n\nSymbol.prototype.getLeft = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX();\n  return {x: x, y: y};\n};\n\nSymbol.prototype.getRight = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX() + this.group.getBBox().width;\n  return {x: x, y: y};\n};\n\nSymbol.prototype.render = function() {\n  if (this.next) {\n\n    var self = this;\n    var lineLength = this.getAttr('line-length');\n\n    if (this.next_direction === 'right') {\n\n      var rightPoint = this.getRight();\n\n      if (!this.next.isPositioned) {\n        this.next.setY(rightPoint.y - this.next.height/2);\n        this.next.shiftX(this.group.getBBox().x + this.width + lineLength);\n\n        (function shift() {\n          var hasSymbolUnder = false;\n          var symb;\n          for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n            symb = self.chart.symbols[i];\n\n            var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n            if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n              hasSymbolUnder = true;\n              break;\n            }\n          }\n\n          if (hasSymbolUnder) {\n            if (self.next.symbolType === 'end') return;\n            self.next.setX(symb.getX() + symb.width + lineLength);\n            shift();\n          }\n        })();\n\n        this.next.isPositioned = true;\n\n        this.next.render();\n      }\n    } else if (this.next_direction === 'left') {\n\n      var leftPoint = this.getLeft();\n\n      if (!this.next.isPositioned) {\n        this.next.setY(leftPoint.y - this.next.height/2);\n        this.next.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n\n        (function shift() {\n          var hasSymbolUnder = false;\n          var symb;\n          for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n            symb = self.chart.symbols[i];\n\n            var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n            if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n              hasSymbolUnder = true;\n              break;\n            }\n          }\n\n          if (hasSymbolUnder) {\n            if (self.next.symbolType === 'end') return;\n            self.next.setX(symb.getX() + symb.width + lineLength);\n            shift();\n          }\n        })();\n\n        this.next.isPositioned = true;\n\n        this.next.render();\n      }\n    } else {\n      var bottomPoint = this.getBottom();\n\n      if (!this.next.isPositioned) {\n        this.next.shiftY(this.getY() + this.height + lineLength);\n        this.next.setX(bottomPoint.x - this.next.width/2);\n        this.next.isPositioned = true;\n\n        this.next.render();\n      }\n    }\n  }\n};\n\nSymbol.prototype.renderLines = function() {\n  if (this.next) {\n    if (this.next_direction) {\n      this.drawLineTo(this.next, this.getAttr('arrow-text') || '', this.next_direction);\n    } else {\n      this.drawLineTo(this.next, this.getAttr('arrow-text') || '');\n    }\n  }\n};\n\nSymbol.prototype.drawLineTo = function(symbol, text, origin) {\n  if (this.connectedTo.indexOf(symbol) < 0) {\n    this.connectedTo.push(symbol);\n  }\n\n  var x = this.getCenter().x,\n      y = this.getCenter().y,\n      right = this.getRight(),\n      bottom = this.getBottom(),\n      top = this.getTop(),\n      left = this.getLeft();\n\n  var symbolX = symbol.getCenter().x,\n      symbolY = symbol.getCenter().y,\n      symbolTop = symbol.getTop(),\n      symbolRight = symbol.getRight(),\n      symbolLeft = symbol.getLeft();\n\n  var isOnSameColumn = x === symbolX,\n      isOnSameLine = y === symbolY,\n      isUnder = y < symbolY,\n      isUpper = y > symbolY || this === symbol,\n      isLeft = x > symbolX,\n      isRight = x < symbolX;\n\n  var maxX = 0,\n      line,\n      yOffset,\n      lineLength = this.getAttr('line-length'),\n      lineWith = this.getAttr('line-width');\n\n  if ((!origin || origin === 'bottom') && isOnSameColumn && isUnder) {\n    if (symbol.topLines.length === 0 && this.bottomLines.length === 0) {\n      line = drawLine(this.chart, bottom, symbolTop, text);\n    } else {\n      yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n      line = drawLine(this.chart, bottom, [\n        {x: symbolTop.x, y: symbolTop.y - yOffset},\n        {x: symbolTop.x, y: symbolTop.y}\n      ], text);\n    }\n    this.bottomLines.push(line);\n    symbol.topLines.push(line);\n    this.bottomStart = true;\n    symbol.topEnd = true;\n    maxX = bottom.x;\n  } else if ((!origin || origin === 'right') && isOnSameLine && isRight) {\n    if (symbol.leftLines.length === 0 && this.rightLines.length === 0) {\n      line = drawLine(this.chart, right, symbolLeft, text);\n    } else {\n      yOffset = Math.max(symbol.leftLines.length, this.rightLines.length) * 10;\n      line = drawLine(this.chart, right, [\n        {x: right.x, y: right.y - yOffset},\n        {x: right.x, y: symbolLeft.y - yOffset},\n        {x: symbolLeft.x, y: symbolLeft.y - yOffset},\n        {x: symbolLeft.x, y: symbolLeft.y}\n      ], text);\n    }\n    this.rightLines.push(line);\n    symbol.leftLines.push(line);\n    this.rightStart = true;\n    symbol.leftEnd = true;\n    maxX = symbolLeft.x;\n  } else if ((!origin || origin === 'left') && isOnSameLine && isLeft) {\n    if (symbol.rightLines.length === 0 && this.leftLines.length === 0) {\n      line = drawLine(this.chart, left, symbolRight, text);\n    } else {\n      yOffset = Math.max(symbol.rightLines.length, this.leftLines.length) * 10;\n      line = drawLine(this.chart, right, [\n        {x: right.x, y: right.y - yOffset},\n        {x: right.x, y: symbolRight.y - yOffset},\n        {x: symbolRight.x, y: symbolRight.y - yOffset},\n        {x: symbolRight.x, y: symbolRight.y}\n      ], text);\n    }\n    this.leftLines.push(line);\n    symbol.rightLines.push(line);\n    this.leftStart = true;\n    symbol.rightEnd = true;\n    maxX = symbolRight.x;\n  } else if ((!origin || origin === 'right') && isOnSameColumn && isUpper) {\n    yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n    line = drawLine(this.chart, right, [\n      {x: right.x + lineLength/2, y: right.y - yOffset},\n      {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.rightLines.push(line);\n    symbol.topLines.push(line);\n    this.rightStart = true;\n    symbol.topEnd = true;\n    maxX = right.x + lineLength/2;\n  } else if ((!origin || origin === 'right') && isOnSameColumn && isUnder) {\n    yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n    line = drawLine(this.chart, right, [\n      {x: right.x + lineLength/2, y: right.y - yOffset},\n      {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.rightLines.push(line);\n    symbol.topLines.push(line);\n    this.rightStart = true;\n    symbol.topEnd = true;\n    maxX = right.x + lineLength/2;\n  } else if ((!origin || origin === 'bottom') && isLeft) {\n    yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n    if (this.leftEnd && isUpper) {\n      line = drawLine(this.chart, bottom, [\n        {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n        {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},\n        {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n        {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n        {x: symbolTop.x, y: symbolTop.y}\n      ], text);\n    } else {\n      line = drawLine(this.chart, bottom, [\n        {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},\n        {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n        {x: symbolTop.x, y: symbolTop.y}\n      ], text);\n    }\n    this.bottomLines.push(line);\n    symbol.topLines.push(line);\n    this.bottomStart = true;\n    symbol.topEnd = true;\n    maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n  } else if ((!origin || origin === 'bottom') && isRight && isUnder) {\n    yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n    line = drawLine(this.chart, bottom, [\n      {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.bottomLines.push(line);\n    symbol.topLines.push(line);\n    this.bottomStart = true;\n    symbol.topEnd = true;\n    maxX = bottom.x;\n    if (symbolTop.x > maxX) maxX = symbolTop.x;\n  } else if ((!origin || origin === 'bottom') && isRight) {\n    yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n    line = drawLine(this.chart, bottom, [\n      {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n      {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},\n      {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.bottomLines.push(line);\n    symbol.topLines.push(line);\n    this.bottomStart = true;\n    symbol.topEnd = true;\n    maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n  } else if ((origin && origin === 'right') && isLeft) {\n    yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n    line = drawLine(this.chart, right, [\n      {x: right.x + lineLength/2, y: right.y},\n      {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.rightLines.push(line);\n    symbol.topLines.push(line);\n    this.rightStart = true;\n    symbol.topEnd = true;\n    maxX = right.x + lineLength/2;\n  } else if ((origin && origin === 'right') && isRight) {\n    yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n    line = drawLine(this.chart, right, [\n      {x: symbolTop.x, y: right.y - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - yOffset}\n    ], text);\n    this.rightLines.push(line);\n    symbol.topLines.push(line);\n    this.rightStart = true;\n    symbol.topEnd = true;\n    maxX = right.x + lineLength/2;\n  } else if ((origin && origin === 'bottom') && isOnSameColumn && isUpper) {\n    yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n    line = drawLine(this.chart, bottom, [\n      {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n      {x: right.x + lineLength/2, y: bottom.y + lineLength/2 - yOffset},\n      {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.bottomLines.push(line);\n    symbol.topLines.push(line);\n    this.bottomStart = true;\n    symbol.topEnd = true;\n    maxX = bottom.x + lineLength/2;\n  } else if ((origin === 'left') && isOnSameColumn && isUpper) {\n    var diffX = left.x - lineLength/2;\n    if (symbolLeft.x < left.x) {\n      diffX = symbolLeft.x - lineLength/2;\n    }\n    yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;\n    line = drawLine(this.chart, left, [\n      {x: diffX, y: left.y - yOffset},\n      {x: diffX, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.leftLines.push(line);\n    symbol.topLines.push(line);\n    this.leftStart = true;\n    symbol.topEnd = true;\n    maxX = left.x;\n  } else if ((origin === 'left')) {\n    yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;\n    line = drawLine(this.chart, left, [\n      {x: symbolTop.x + (left.x - symbolTop.x)/2, y: left.y},\n      {x: symbolTop.x + (left.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.leftLines.push(line);\n    symbol.topLines.push(line);\n    this.leftStart = true;\n    symbol.topEnd = true;\n    maxX = left.x;\n  } else if ((origin === 'top')) {\n    yOffset = Math.max(symbol.topLines.length, this.topLines.length) * 10;\n    line = drawLine(this.chart, top, [\n      {x: top.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n      {x: symbolTop.x, y: symbolTop.y}\n    ], text);\n    this.topLines.push(line);\n    symbol.topLines.push(line);\n    this.topStart = true;\n    symbol.topEnd = true;\n    maxX = top.x;\n  }\n\n  //update line style\n  if (this.lineStyle[symbol.key] && line){\n    line.attr(this.lineStyle[symbol.key]);\n  }\n\n  if (line) {\n    for (var l = 0, llen = this.chart.lines.length; l < llen; l++) {\n      var otherLine = this.chart.lines[l];\n\n      var ePath = otherLine.attr('path'),\n          lPath = line.attr('path');\n\n      for (var iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {\n        var newPath = [];\n        newPath.push(['M', ePath[iP][1], ePath[iP][2]]);\n        newPath.push(['L', ePath[iP + 1][1], ePath[iP + 1][2]]);\n\n        var line1_from_x = newPath[0][1];\n        var line1_from_y = newPath[0][2];\n        var line1_to_x = newPath[1][1];\n        var line1_to_y = newPath[1][2];\n\n        for (var lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {\n          var newLinePath = [];\n          newLinePath.push(['M', lPath[lP][1], lPath[lP][2]]);\n          newLinePath.push(['L', lPath[lP + 1][1], lPath[lP + 1][2]]);\n\n          var line2_from_x = newLinePath[0][1];\n          var line2_from_y = newLinePath[0][2];\n          var line2_to_x = newLinePath[1][1];\n          var line2_to_y = newLinePath[1][2];\n\n          var res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);\n          if (res.onLine1 && res.onLine2) {\n\n            var newSegment;\n            if (line2_from_y === line2_to_y) {\n              if (line2_from_x > line2_to_x) {\n                newSegment = ['L', res.x + lineWith * 2,  line2_from_y];\n                lPath.splice(lP + 1, 0, newSegment);\n                newSegment = ['C', res.x + lineWith * 2,  line2_from_y, res.x, line2_from_y - lineWith * 4, res.x - lineWith * 2, line2_from_y];\n                lPath.splice(lP + 2, 0, newSegment);\n                line.attr('path', lPath);\n              } else {\n                newSegment = ['L', res.x - lineWith * 2,  line2_from_y];\n                lPath.splice(lP + 1, 0, newSegment);\n                newSegment = ['C', res.x - lineWith * 2,  line2_from_y, res.x, line2_from_y - lineWith * 4, res.x + lineWith * 2, line2_from_y];\n                lPath.splice(lP + 2, 0, newSegment);\n                line.attr('path', lPath);\n              }\n            } else {\n              if (line2_from_y > line2_to_y) {\n                newSegment = ['L', line2_from_x, res.y + lineWith * 2];\n                lPath.splice(lP + 1, 0, newSegment);\n                newSegment = ['C', line2_from_x, res.y + lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y - lineWith * 2];\n                lPath.splice(lP + 2, 0, newSegment);\n                line.attr('path', lPath);\n              } else {\n                newSegment = ['L', line2_from_x, res.y - lineWith * 2];\n                lPath.splice(lP + 1, 0, newSegment);\n                newSegment = ['C', line2_from_x, res.y - lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y + lineWith * 2];\n                lPath.splice(lP + 2, 0, newSegment);\n                line.attr('path', lPath);\n              }\n            }\n\n            lP += 2;\n          }\n        }\n      }\n    }\n\n    this.chart.lines.push(line);\n    if (this.chart.minXFromSymbols === undefined || this.chart.minXFromSymbols > left.x) {\n      this.chart.minXFromSymbols = left.x;\n    }\n  }\n\n  if (!this.chart.maxXFromLine || (this.chart.maxXFromLine && maxX > this.chart.maxXFromLine)) {\n    this.chart.maxXFromLine = maxX;\n  }\n};\n\nmodule.exports = Symbol;\n"
  },
  {
    "path": "src/flowchart.symbol.operation.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Operation(chart, options) {\n  var symbol = chart.paper.rect(0, 0, 0, 0);\n  options = options || {};\n  Symbol.call(this, chart, options, symbol);\n}\ninherits(Operation, Symbol);\n\nmodule.exports = Operation;\n"
  },
  {
    "path": "src/flowchart.symbol.output.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction Output(chart, options) {\n  options = options || {};\n  Symbol.call(this, chart, options);\n  this.textMargin = this.getAttr('text-margin');\n\n  this.text.attr({\n    x: this.textMargin * 3\n  });\n\n  var width = this.text.getBBox().width + 4 * this.textMargin;\n  var height = this.text.getBBox().height + 2 * this.textMargin;\n  var startX = this.textMargin;\n  var startY = height/2;\n\n  var start = {x: startX, y: startY};\n  var points = [\n    {x: startX - this.textMargin, y: height},\n    {x: startX - this.textMargin + width + 2 * this.textMargin, y: height},\n    {x: startX - this.textMargin + width, y: 0},\n    {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n    {x: startX, y: startY}\n  ];\n\n  var symbol = drawPath(chart, start, points);\n\n  symbol.attr({\n    stroke: this.getAttr('element-color'),\n    'stroke-width': this.getAttr('line-width'),\n    fill: this.getAttr('fill')\n  });\n  if (options.link) { symbol.attr('href', options.link); }\n  if (options.target) { symbol.attr('target', options.target); }\n  if (options.key) { symbol.node.id = options.key; }\n  symbol.node.setAttribute('class', this.getAttr('class'));\n\n  this.text.attr({\n    y: symbol.getBBox().height/2\n  });\n\n  this.group.push(symbol);\n  symbol.insertBefore(this.text);\n  this.symbol = symbol\n\n  this.initialize();\n}\ninherits(Output, Symbol);\n\nOutput.prototype.getLeft = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX() + this.textMargin;\n  return {x: x, y: y};\n};\n\nOutput.prototype.getRight = function() {\n  var y = this.getY() + this.group.getBBox().height/2;\n  var x = this.getX() + this.group.getBBox().width - this.textMargin;\n  return {x: x, y: y};\n};\n\nmodule.exports = Output;\n\n\n\n/*\n//var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar InputOutput = require('./flowchart.symbol.inputoutput');\nvar drawPath = drawAPI.drawPath;\n\nfunction Output(chart, options) {\n  options = options || {};\n  InputOutput.call(this, chart, options);\n\n  var width = this.text.getBBox().width + 4 * this.textMargin;\n  var height = this.text.getBBox().height + 2 * this.textMargin;\n  var startX = this.textMargin;\n  var startY = height/2;\n\n  var start = {x: startX, y: startY};\n  var points = [\n    {x: startX - this.textMargin + 2 * this.textMargin, y: height},\n    {x: startX - this.textMargin + width, y: height},\n    {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n    {x: startX - this.textMargin, y: 0},\n    {x: startX, y: startY}\n  ];\n\n  var symbol = drawPath(chart, start, points);\n\n  symbol.attr({\n    stroke: this.getAttr('element-color'),\n    'stroke-width': this.getAttr('line-width'),\n    fill: this.getAttr('fill')\n  });\n  if (options.link) { symbol.attr('href', options.link); }\n  if (options.target) { symbol.attr('target', options.target); }\n  if (options.key) { symbol.node.id = options.key; }\n  symbol.node.setAttribute('class', this.getAttr('class'));\n\n  this.text.attr({\n    y: symbol.getBBox().height/2\n  });\n\n  this.group.push(symbol);\n  symbol.insertBefore(this.text);\n    \n  if (this.symbol){\n    this.group.remove(this.symbol); //tds\n    this.symbol.parentNode.removeChild(this.symbol); //tds\n  }\n  this.symbol = symbol\n\n  this.initialize();\n}\ninherits(Output, InputOutput);\n\nmodule.exports = Output;\n*/\n"
  },
  {
    "path": "src/flowchart.symbol.parallel.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Parallel(chart, options) {\n  var symbol = chart.paper.rect(0, 0, 0, 0);\n  options = options || {};\n  Symbol.call(this, chart, options, symbol);\n  this.path1_annotation = options.path1_annotation || '';\n  this.path2_annotation = options.path2_annotation || '';\n  this.path3_annotation = options.path3_annotation || '';\n  this.textMargin = this.getAttr('text-margin');\n  this.path1_direction = 'bottom';\n  this.path2_direction = 'right';\n  this.path3_direction = 'top';\n  this.params = options.params;\n  if (options.direction_next === 'path1' && !options[options.direction_next] && options.next) {\n    options[options.direction_next] = options.next;\n  }\n  if (options.direction_next === 'path2' && !options[options.direction_next] && options.next) {\n    options[options.direction_next] = options.next;\n  }\n  if (options.direction_next === 'path3' && !options[options.direction_next] && options.next) {\n    options[options.direction_next] = options.next;\n  }\n\n  if (options.path1 && options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && !options.direction_path3) {\n    if (options.direction_path1 === 'right') {\n      this.path2_direction = 'bottom';\n      this.path1_direction = 'right';\n      this.path3_direction = 'top';\n    } else if (options.direction_path1 === 'top') {\n      this.path2_direction = 'right';\n      this.path1_direction = 'top';\n      this.path3_direction = 'bottom';\n    } else if (options.direction_path1 === 'left') {\n      this.path2_direction = 'right';\n      this.path1_direction = 'left';\n      this.path3_direction = 'bottom';\n    } else {\n      this.path2_direction = 'right';\n      this.path1_direction = 'bottom';\n      this.path3_direction = 'top';\n    }\n  } else if (options.path1 && !options.direction_path1 && options.path2 && options.direction_path2 && options.path3 && !options.direction_path3) {\n    if (options.direction_path2 === 'right') {\n      this.path1_direction = 'bottom';\n      this.path2_direction = 'right';\n      this.path3_direction = 'top';\n    } else if (options.direction_path2 === 'left') {\n      this.path1_direction = 'bottom';\n      this.path2_direction = 'left';\n      this.path3_direction = 'right';\n    } else {\n      this.path1_direction = 'right';\n      this.path2_direction = 'bottom';\n      this.path3_direction = 'top';\n    }\n  } else if (options.path1 && !options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && options.direction_path3) {\n    if (options.direction_path2 === 'right') {\n      this.path1_direction = 'bottom';\n      this.path2_direction = 'top';\n      this.path3_direction = 'right';\n    } else if (options.direction_path2 === 'left') {\n      this.path1_direction = 'bottom';\n      this.path2_direction = 'right';\n      this.path3_direction = 'left';\n    } else {\n      this.path1_direction = 'right';\n      this.path2_direction = 'bottom';\n      this.path3_direction = 'top';\n    }\n  } else {\n    this.path1_direction = options.direction_path1;\n    this.path2_direction = options.direction_path2;\n    this.path3_direction = options.direction_path3;\n  }\n\n  this.path1_direction = this.path1_direction || 'bottom';\n  this.path2_direction = this.path2_direction || 'right';\n  this.path3_direction = this.path3_direction || 'top';\n\n  this.initialize();\n}\ninherits(Parallel, Symbol);\n\nParallel.prototype.render = function() {\n  if (this.path1_direction) {\n    this[this.path1_direction + '_symbol'] = this.path1_symbol;\n  }\n\n  if (this.path2_direction) {\n    this[this.path2_direction + '_symbol'] = this.path2_symbol;\n  }\n\n  if (this.path3_direction) {\n    this[this.path3_direction + '_symbol'] = this.path3_symbol;\n  }\n\n  var lineLength = this.getAttr('line-length');\n\n  if (this.bottom_symbol) {\n    var bottomPoint = this.getBottom();\n\n    if (!this.bottom_symbol.isPositioned) {\n      this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n      this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2);\n      this.bottom_symbol.isPositioned = true;\n\n      this.bottom_symbol.render();\n    }\n  }\n\n  if (this.top_symbol) {\n    var topPoint = this.getTop();\n\n    if (!this.top_symbol.isPositioned) {\n      this.top_symbol.shiftY(this.getY() - this.top_symbol.height - lineLength);\n      this.top_symbol.setX(topPoint.x + this.top_symbol.width);\n      this.top_symbol.isPositioned = true;\n\n      this.top_symbol.render();\n    }\n  }\n\n  var self = this;\n\n  if (this.left_symbol) {\n    var leftPoint = this.getLeft();\n\n    if (!this.left_symbol.isPositioned) {\n      this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);\n      this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n      (function shift() {\n        var hasSymbolUnder = false;\n        var symb;\n        for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n          symb = self.chart.symbols[i];\n\n          if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n            var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n            if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n              hasSymbolUnder = true;\n              break;\n            }\n          }\n        }\n\n        if (hasSymbolUnder) {\n          if (self.left_symbol.symbolType === 'end') return;\n          self.left_symbol.setX(symb.getX() + symb.width + lineLength);\n          shift();\n        }\n      })();\n\n      this.left_symbol.isPositioned = true;\n\n      this.left_symbol.render();\n    }\n  }\n\n  if (this.right_symbol) {\n    var rightPoint = this.getRight();\n\n    if (!this.right_symbol.isPositioned) {\n      this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2);\n      this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n      (function shift() {\n        var hasSymbolUnder = false;\n        var symb;\n        for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n          symb = self.chart.symbols[i];\n\n          if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n            var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n            if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {\n              hasSymbolUnder = true;\n              break;\n            }\n          }\n        }\n\n        if (hasSymbolUnder) {\n          if (self.right_symbol.symbolType === 'end') return;\n          self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n          shift();\n        }\n      })();\n\n      this.right_symbol.isPositioned = true;\n\n      this.right_symbol.render();\n    }\n  }\n};\n\nParallel.prototype.renderLines = function() {\n  if (this.path1_symbol) {\n    this.drawLineTo(this.path1_symbol, this.path1_annotation, this.path1_direction);\n  }\n\n  if (this.path2_symbol) {\n    this.drawLineTo(this.path2_symbol, this.path2_annotation, this.path2_direction);\n  }\n\n  if (this.path3_symbol) {\n    this.drawLineTo(this.path3_symbol, this.path3_annotation, this.path3_direction);\n  }\n};\n\nmodule.exports = Parallel;"
  },
  {
    "path": "src/flowchart.symbol.start.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Start(chart, options) {\n  var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n  options = options || {};\n  options.text = options.text || 'Start';\n  Symbol.call(this, chart, options, symbol);\n}\ninherits(Start, Symbol);\n\nmodule.exports = Start;\n\n// Start.prototype.render = function() {\n//   if (this.next) {\n//     var lineLength = this.chart.options.symbols[this.symbolType]['line-length'] || this.chart.options['line-length'];\n\n//     var bottomPoint = this.getBottom();\n//     var topPoint = this.next.getTop();\n\n//     if (!this.next.isPositioned) {\n//       this.next.shiftY(this.getY() + this.height + lineLength);\n//       this.next.setX(bottomPoint.x - this.next.width/2);\n//       this.next.isPositioned = true;\n\n//       this.next.render();\n//     }\n//   }\n// };\n\n// Start.prototype.renderLines = function() {\n//   if (this.next) {\n//     this.drawLineTo(this.next);\n//   }\n// };\n"
  },
  {
    "path": "src/flowchart.symbol.subroutine.js",
    "content": "var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Subroutine(chart, options) {\n  var symbol = chart.paper.rect(0, 0, 0, 0);\n  options = options || {};\n  Symbol.call(this, chart, options, symbol);\n\n  symbol.attr({\n    width: this.text.getBBox().width + 4 * this.getAttr('text-margin')\n  });\n\n  this.text.attr({\n    'x': 2 * this.getAttr('text-margin')\n  });\n\n  var innerWrap = chart.paper.rect(0, 0, 0, 0);\n  innerWrap.attr({\n    x: this.getAttr('text-margin'),\n    stroke: this.getAttr('element-color'),\n    'stroke-width': this.getAttr('line-width'),\n    width: this.text.getBBox().width + 2 * this.getAttr('text-margin'),\n    height: this.text.getBBox().height + 2 * this.getAttr('text-margin'),\n    fill: this.getAttr('fill')\n  });\n  if (options.key) { innerWrap.node.id = options.key + 'i'; }\n\n  var font = this.getAttr('font');\n  var fontF = this.getAttr('font-family');\n  var fontW = this.getAttr('font-weight');\n\n  if (font) innerWrap.attr({ 'font': font });\n  if (fontF) innerWrap.attr({ 'font-family': fontF });\n  if (fontW) innerWrap.attr({ 'font-weight': fontW });\n\n  if (options.link) { innerWrap.attr('href', options.link); }\n  if (options.target) { innerWrap.attr('target', options.target); }\n  this.group.push(innerWrap);\n  innerWrap.insertBefore(this.text);\n\n  this.initialize();\n}\ninherits(Subroutine, Symbol);\n\nmodule.exports = Subroutine;\n"
  },
  {
    "path": "src/jquery-plugin.js",
    "content": "if (typeof jQuery != 'undefined') {\n\tvar parse = require('./flowchart.parse');\n\n\t(function( $ ) {\n\t\tfunction paramFit(needle, haystack) {\n\t\t\treturn needle == haystack ||\n\t\t\t( Array.isArray(haystack) && (haystack.includes(needle) || haystack.includes(Number(needle)) ))\n\t\t}\n\t\tvar methods = {\n\t\t\tinit : function(options) {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\tthis.chart = parse($this.text());\n\t\t\t\t\t$this.html('');\n\t\t\t\t\tthis.chart.drawSVG(this, options);\n\t\t\t\t});\n\t\t\t},\n\t\t\tsetFlowStateByParam : function(param, paramValue, newFlowState) {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tvar chart = this.chart;\n\n\t\t\t\t\t// @todo this should be part of Symbol API\n\t\t\t\t\tvar nextSymbolKeys = ['next', 'yes', 'no', 'path1', 'path2', 'path3'];\n\n\t\t\t\t\tfor (var property in chart.symbols) {\n\t\t\t\t\t\tif (chart.symbols.hasOwnProperty(property)) {\n\t\t\t\t\t\t\tvar symbol = chart.symbols[property];\n\t\t\t\t\t\t\tvar val = symbol.params[param];\n\t\t\t\t\t\t\tif (paramFit(val, paramValue)) {\n\t\t\t\t\t\t\t\tsymbol.flowstate = newFlowState;\n\t\t\t\t\t\t\t\tfor (var nski = 0; nski < nextSymbolKeys.length; nski++) {\n\t\t\t\t\t\t\t\t\tvar nextSymbolKey = nextSymbolKeys[nski];\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey] &&\n\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey]['params'] &&\n\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey]['params'][param] &&\n\t\t\t\t\t\t\t\t\t\tparamFit(symbol[nextSymbolKey]['params'][param], paramValue)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tsymbol.lineStyle[symbol[nextSymbolKey]['key']] = {stroke: chart.options()['flowstate'][newFlowState]['fill']};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tchart.clean();\n\t\t\t\t\tchart.drawSVG(this);\n\t\t\t\t});\n\n\t\t\t},\n\t\t\tclearFlowState: function () {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tvar chart = this.chart;\n\n\t\t\t\t\tfor (var property in chart.symbols) {\n\t\t\t\t\t\tif (chart.symbols.hasOwnProperty(property)) {\n\t\t\t\t\t\t\tvar node = chart.symbols[property];\n\t\t\t\t\t\t\tnode.flowstate = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tchart.clean();\n\t\t\t\t\tchart.drawSVG(this);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\t$.fn.flowChart = function(methodOrOptions) {\n\t\t\tif ( methods[methodOrOptions] ) {\n\t\t\t\treturn methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));\n\t\t\t} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {\n\t\t\t\t// Default to \"init\"\n\t\t\t\treturn methods.init.apply( this, arguments );\n\t\t\t} else {\n\t\t\t\t$.error( 'Method ' +  methodOrOptions + ' does not exist on jQuery.flowChart' );\n\t\t\t}\n\t\t};\n\n\t})(jQuery); // eslint-disable-line\n}\n"
  },
  {
    "path": "types/index.d.ts",
    "content": "declare module \"flowchart.js\" {\n  namespace FlowChart {\n    interface SVGOptions {\n      x: number;\n      y: number;\n      \"line-width\": number;\n      \"line-length\": number;\n      \"text-margin\": number;\n      \"font-size\": number;\n      \"font-color\": string;\n      \"line-color\": string;\n      \"element-color\": string;\n      fill: string;\n      roundness?: number;\n      \"yes-text\": string;\n      \"no-text\": string;\n      \"arrow-end\": string;\n      scale: number;\n      class: string;\n      [props: string]: any;\n    }\n\n    interface DrawOptions extends Partial<SVGOptions> {\n      /** Stymbol Styles */\n      symbols?: Record<string, Partial<SVGOptions>>;\n      /** FlowState config */\n      flowstate?: Record<string, Partial<SVGOptions>>;\n    }\n\n    interface Instance {\n      clean: () => void;\n      drawSVG: (container: HTMLElement | string, options?: DrawOptions) => void;\n    }\n  }\n\n  interface FlowChart {\n    parse: (code: string) => FlowChart.Instance;\n  }\n\n  const FlowChart: FlowChart;\n\n  export = FlowChart;\n}\n"
  },
  {
    "path": "webpack.config.js",
    "content": "var path = require('path');\nvar webpack = require('webpack');\nvar moment = require('moment');\n\nvar component = require('./package.json');\nvar banner =\n\t'// ' + component.name + ', v' + component.version + '\\n' +\n\t'// Copyright (c)' + moment().format('YYYY') + ' Adriano Raiano (adrai).\\n' +\n\t'// Distributed under MIT license\\n' +\n\t'// http://adrai.github.io/flowchart.js\\n';\n\nvar NODE_ENV = process.env.NODE_ENV || 'development';\nvar defines = new webpack.DefinePlugin({\n\t'process.env': {\n\t\t'NODE_ENV': JSON.stringify(NODE_ENV)\n\t}\n});\n\nvar config = {\n\tdevtool: 'source-map', // always build source map\n\tentry: [\n\t\t'webpack-hot-middleware/client',\n\t\t'./index'\n\t],\n\toutput: {\n\t\tpath: path.join(__dirname, 'release'),\n\t\tfilename: component.name + '.js',\n\t\tpublicPath: '/release/'\n\t},\n\tplugins: [\n\t\tnew webpack.HotModuleReplacementPlugin(),\n\t\tnew webpack.NoErrorsPlugin(),\n\t\tdefines\n\t],\n\tresolve: {\n\t\textensions: ['', '.js'],\n\t\tmodulesDirectories: ['src', 'node_modules'],\n\t\talias: {\n\t\t\t'dev/raphael.core.js': './dev/raphael.core.js',\n\t\t\t'raphael.core': './raphael.core.js',\n\t\t\t'raphael.svg': './dev/raphael.svg.js',\n\t\t\t'raphael.vml': './dev/raphael.vml.js'\n\t\t}\n\t}\n};\n\nif (NODE_ENV === 'production') {\n\tvar minified = process.env.MINIFIED == '1';\n\tvar withoutJs = component.name;\n\twithoutJs = withoutJs.replace('.js', '');\n\tvar filename = minified ? withoutJs + '.min.js' : withoutJs + '.js';\n\tvar uglifyOptions = {\n\t\tsourceMap: true,\n\t\tcompressor: {\n\t\t\twarnings: false,\n\t\t\tdead_code: true\n\t\t},\n\t\toutput: {\n\t\t\tpreamble: banner,\n\t\t\tcomments: false\n\t\t}\n\t};\n\tif (!minified) {\n\t\tuglifyOptions.beautify = true;\n\t\tuglifyOptions.mangle = false;\n\t\tuglifyOptions.output.comments = 'all';\n\t}\n\tconfig.entry = './index';\n\tconfig.externals = {\n\t\traphael: 'Raphael'\n\t};\n\tconfig.output = {\n\t\tdevtoolLineToLine: true,\n\t\tsourceMapFilename: filename + '.map',\n\t\tpath: path.join(__dirname, 'release'),\n\t\tfilename: filename,\n\t\tlibraryTarget: 'umd'\n\t};\n\tconfig.plugins = [\n\t\tnew webpack.optimize.OccurenceOrderPlugin(),\n\t\tdefines,\n\t\tnew webpack.optimize.UglifyJsPlugin(uglifyOptions)\n\t];\n}\n\nmodule.exports = config;\n"
  }
]