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AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,aAAa,EAAE,QArDF;;AAuDb;AACF;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,WAAW,EAAE,IA9DA;;AAgEb;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE/O,EAAAA,mBAAmB,EAAE,KA3ER;;AA6Eb;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE3L,EAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,eAAX,EAA4B,aAA5B,EAA2C,aAA3C,CAvFK;;AAyFb;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE2a,EAAAA,gBAAgB,EAAE,KArGL;;AAuGb;AACF;AACA;AACA;AACA;AACEC,EAAAA,mBAAmB,EAAEhZ,SA5GR;;AA8Gb;AACAG,EAAAA,SAAS,EAAE;AACT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI8Y,IAAAA,cAAc,EAAE,CAbP;;AAeT;AACJ;AACA;AACA;AACA;AACA;AACA;AACI7Y,IAAAA,UAAU,EAAE,IAtBH;;AAwBT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI8Y,IAAAA,WAAW,EAAE,EApCJ;;AAsCT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,WAAW,EAAE,EAlDJ;;AAoDT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI5P,IAAAA,KAAK,EAAE,OA7DE;AA8DT;AACA;AACA5I,IAAAA,OAAO,EAAE,EAhEA;;AAkET;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIyY,IAAAA,WAAW,EAAE,IA9EJ;;AAgFT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,eAAe,EAAE;AA5FR,GA/GE;;AA8Mb;AACAC,EAAAA,QAAQ,EAAE;AACR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,eAAe,EAAE,EART;;AAUR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,cAAc,EAAE,EAjBR;;AAmBR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,cAAc,EAAE,EA1BR;;AA4BR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,WAAW,EAAE,EAnCL;;AAqCR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIjZ,IAAAA,KAAK,EAAE,GA5CC;;AA8CR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,MAAM,EAAE,EArDA;;AAuDR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIiZ,IAAAA,SAAS,EAAE,EA9DH;;AAgER;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,aAAa,EAAE,CAvEP;;AAyER;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,UAAU,EAAE,EAhFJ;;AAkFR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,aAAa,EAAE,EAzFP;;AA2FR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,YAAY,EAAE,QAlGN;;AAoGR;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,YAAY,EAAE,IA3GN;;AA6GR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,UAAU,EAAE,KAtHJ;;AAwHR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,eAAe,EAAE,CAnIT;;AAqIR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACId,IAAAA,WAAW,EAAE,IA/IL;;AAiJR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIe,IAAAA,WAAW,EAAE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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI9C,IAAAA,WAAW,EAAE,IAtHR;;AAwHL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI+C,IAAAA,OAAO,EAAE,KAjIJ;AAmILC,IAAAA,QAAQ,EAAEpc;AAnIL,GA9fM;;AAooBb;AACAqc,EAAAA,OAAO,EAAE;AACP;AACJ;AACA;AACA;AACA;AACA;AACA;AACI7C,IAAAA,cAAc,EAAE,EART;;AAUP;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,cAAc,EAAE,EAjBT;;AAmBP;AACJ;AACA;AACA;AACA;AACA;AACA;AACI6C,IAAAA,UAAU,EAAE,GA1BL;;AA4BP;AACJ;AACA;AACA;AACA;AACA;AACA;AACI7b,IAAAA,KAAK,EAAE,GAnCA;;AAqCP;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,MAAM,EAAE,EA5CD;;AA8CP;AACJ;AACA;AACA;AACA;AACA;AACA;AACIiZ,IAAAA,SAAS,EAAE,EArDJ;;AAuDP;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,aAAa,EAAE,CA9DR;;AAgEP;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,UAAU,EAAE,EAvEL;;AAyEP;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,aAAa,EAAE,EApFR;;AAsFP;AACJ;AACA;AACA;AACA;AACA;AACA;AACIC,IAAAA,YAAY,EAAE,QA7FP;;AA+FP;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIG,IAAAA,eAAe,EAAE,CA1GV;;AA4GP;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACId,IAAAA,WAAW,EAAE,IAxHN;;AA0HP;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACIe,IAAAA,WAAW,EAAE,KArIN;AA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,iBAAM;AACX;AACAogB,IAAAA,0CAAA,GAFW,CAGX;AACA;AACD,GAf8B;AAgB/By4C,EAAAA,WAAW,EAAE,uBAAM;AACjBz4C,IAAAA,0CAAA,CAAgBA,kDAAhB;AACAu4C,IAAAA,qBAAqB,CAACv4C,8CAAA,EAAD,CAArB;AACD,GAnB8B;AAoB/BziB,EAAAA,aAAa,EAAEyiB,kDAAuBziB;AApBP,CAAd,CAAnB;AAuBA02D,oDAAW,CAACj0C,8CAAA,GAAsBrG,QAAvB,CAAX;AACAqG,0CAAA,CAAgBA,8CAAA,EAAhB;AAEA,iEAAeE,UAAf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AChsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAM04C,MAAM,GAAG;AACb13D,EAAAA,SAAS,EAATA,kEADa;AAEb,kBAAgBA,kEAFH;AAGbmZ,EAAAA,QAAQ,EAARA,iEAHa;AAIbkC,EAAAA,KAAK,EAALA,8DAJa;AAKbm8C,EAAAA,YAAY,EAAZA,8DALa;AAMb,qBAAmBA,8DANN;AAObj4D,EAAAA,KAAK,EAAEi4D,8DAPM;AAQbC,EAAAA,YAAY,EAAZA,8DARa;AASb9tD,EAAAA,KAAK,EAAE8tD,8DATM;AAUb96C,EAAAA,GAAG,EAAHA,4DAVa;AAWbva,EAAAA,IAAI,EAAJA,6DAXa;AAYb2b,EAAAA,GAAG,EAAHA,4DAZa;AAabP,EAAAA,EAAE,EAAFA,2DA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mBb3jB,EAAAA,MAAM,EAANA,MAnBa;AAoBbq1B,EAAAA,OAAO,EAAPA,OApBa;AAqBbp5C,EAAAA,OAAO,EAAPA,OArBa;AAsBbqxC,EAAAA,YAAY,EAAZA,YAtBa;AAuBbF,EAAAA,gBAAgB,EAAhBA,gBAvBa;AAwBboC,EAAAA,kBAAkB,EAAlBA;AAxBa,CAAf;;;;;;;;;;;AC99BA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,8BAA8B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,YAAY;AACZ;AACA,sCAAsC;AACtC;AACA;AACA,UAAU;AACV;AACA;AACA,iDAAiD;AACjD;AACA,YAAY;AACZ;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD;AAChD;AACA,MAAM;AACN,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA,8DAA8D;;AAE9D;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AChhBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,4uCAA4uC;AACvvC,aAAa,yvBAAyvB;AACtwB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,iDAAiD,wBAAwB;AACzE;AACA;AACA,sBAAsB,mCAAmC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA,kCAAkC;AAClC;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,qCAAqC;AACvD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA,kBAAkB,uCAAuC;AACzD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+CAA+C;AACjE;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,kEAAkE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,mEAAmE,EAAE,QAAQ,sDAAsD,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,uBAAuB,oBAAoB,sMAAs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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,WAAW;AACX;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iCAAiC;AAChE;AACA;AACA;AACA;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,yIAAyI,8BAA8B,mBAAmB,yBAAyB,gIAAgI,oBAAoB,WAAW,yBAAyB,0fAA0f,EAAE,MAAM,YAAY,EAAE;AAC56B,aAAa,iBAAiB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,kBAAkB,kCAAkC,kBAAkB,qCAAqC,SAAS,kCAAkC,WAAW,2CAA2C,YAAY,kCAAkC,aAAa,kCAAkC,WAAW,kCAAkC,YAAY;AACpgB,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACt3BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,kqBAAkqB;AAC7qB,aAAa,oWAAoW;AACjX;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mCAAmC;AACrD;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,0BAA0B,EAAE,MAAM,cAAc,IAAI,GAAG,0BAA0B,EAAE,cAAc,EAAE,UAAU,EAAE,qEAAqE,EAAE,QAAQ,EAAE,uBAAuB,gCAAgC,QAAQ,gBAAgB,oCAAoC,uDAAuD,kDAAkD,8CAA8C,UAAU,EAAE,gBAAgB,EAAE,UAAU,eAAe,aAAa,EAAE,mCAAmC,EAAE,0BAA0B,uEAAuE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,gBAAgB,mCAAmC,EAAE,gBAAgB,EAAE,UAAU,EAAE,kCAAkC,8BAA8B,UAAU,EAAE,0BAA0B,gBAAgB,UAAU,eAAe,0BAA0B,2BAA2B,UAAU,uEAAuE,UAAU;AAClkC,iBAAiB,mEAAmE;AACpF;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,yBAAyB,oBAAoB,gGAAgG,2GAA2G,mCAAmC,cAAc,uCAAuC,aAAa;AACpb,aAAa,kBAAkB,8BAA8B,mBAAmB,gCAAgC,kBAAkB,gCAAgC,UAAU,iDAAiD,YAAY;AACzO,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACjwBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,m1DAAm1D;AAC91D,aAAa,omCAAomC;AACjnC;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,8CAA8C,WAAW;AACtG;AACA;AACA,+CAA+C,gDAAgD,WAAW;AAC1G;AACA;AACA,iCAAiC,aAAa;AAC9C;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA,iCAAiC;AACjC;AACA;AACA,mCAAmC,qDAAqD;AACxF;AACA;AACA,oBAAoB;AACpB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA,uBAAuB;AACvB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,6CAA6C,UAAU;AACvD;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,qCAAqC;AACvD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+CAA+C;AACjE;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,uCAAuC;AACzD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,8CAA8C;AAChE;AACA;AACA,kBAAkB,4CAA4C;AAC9D;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD,SAAS,iDAAiD,EAAE,MAAM,EAAE,QAAQ,EAAE,kDAAkD,YAAY,MAAM,GAAG,eAAe,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,SAAS,EAA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A,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,WAAW;AACX;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,iBAAiB,8BAA8B,mBAAmB,yBAAyB,mBAAmB,0xBAA0xB,+zJAA+zJ,UAAU;AACluL,aAAa,mBAAmB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,iBAAiB,kCAAkC,iBAAiB,qCAAqC,SAAS,kCAAkC,UAAU,kCAAkC,WAAW,6BAA6B,QAAQ,6DAA6D,WAAW,gCAAgC,YAAY;AACvjB,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AClgCA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,6iBAA6iB;AACxjB,aAAa,kWAAkW;AAC/W;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb;AACA;AACA,oCAAoC;AACpC;AACA;AACA,iCAAiC;AACjC;AACA;AACA,iCAAiC;AACjC;AACA;AACA,qCAAqC;AACrC;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,gCAAgC;AAChC;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,2CAA2C;AAC7D;AACA;AACA,kBAAkB,+CAA+C;AACjE;AACA;AACA,kBAAkB,yCAAyC;AAC3D;AACA;AACA,kBAAkB,6CAA6C;AAC/D;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,cAAc,IAAI,GAAG,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,2IAA2I,EAAE,uBAAuB,gCAAgC,QAAQ,gBAAgB,0GAA0G,uKAAuK,UAAU,gBAAgB,oBAAoB,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,0CAA0C,oBAAoB,gBAAgB,UAAU,iBAAiB,aAAa,EAAE,UAAU,eAAe,UAAU,8BAA8B,UAAU,GAAG,UAAU;AACv5B,iBAAiB,qCAAqC;AACtD;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,0BAA0B,qBAAqB,8TAA8T,2EAA2E,2BAA2B,2BAA2B,6BAA6B,qDAAqD,2BAA2B,kBAAkB,kBAAkB;AACttB,aAAa,mBAAmB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,iBAAiB,kCAAkC,iBAAiB,qCAAqC,SAAS,kCAAkC,UAAU,kCAAkC,YAAY;AAC/Z,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC7vBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,uSAAuS;AAClT,aAAa,0JAA0J;AACvK;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,QAAQ,cAAc,gBAAgB,gBAAgB,sBAAsB,EAAE,QAAQ,EAAE,gFAAgF,eAAe,SAAS,eAAe,UAAU,gBAAgB,0BAA0B,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,0BAA0B,EAAE,QAAQ,eAAe,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,UAAU,EAAE,oBAAoB,EAAE,UAAU,EAAE,UAAU;AAC1lB,iBAAiB,2GAA2G;AAC5H;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,aAAa,WAAW,kCAAkC,WAAW,kCAAkC,YAAY;AACnH,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACvrBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,mHAAmH;AAC9H,aAAa,gDAAgD;AAC7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,YAAY,EAAE,MAAM,cAAc,IAAI,GAAG,iCAAiC,EAAE,QAAQ;AAC7F,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,aAAa,WAAW;AACxB,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC7mBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,sPAAsP,mHAAmH;AACpX,aAAa,wGAAwG,2FAA2F;AAChN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,mDAAmD,EAAE,MAAM,EAAE,oDAAoD,EAAE,oDAAoD,YAAY,cAAc,6CAA6C,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,YAAY,kDAAkD,aAAa,KAAK,GAAG,uBAAuB,iCAAiC,0BAA0B,EAAE,UAAU,EAAE,UAAU,0BAA0B,kDAAkD,iBAAiB,gBAAgB,wDAAwD,aAAa,EAAE,UAAU;AAClqB,iBAAiB,qCAAqC;AACtD;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,0BAA0B,oBAAoB;AACrI,aAAa,mBAAmB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,UAAU,+BAA+B,WAAW,kCAAkC,YAAY;AACrT,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACppBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,6iCAA6iC;AACxjC,aAAa,yrBAAyrB;AACtsB;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,yBAAyB,EAAE,MAAM,EAAE,iCAAiC,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,0BAA0B,EAAE,QAAQ,EAAE,8HAA8H,EAAE,uBAAuB,mBAAmB,QAAQ,EAAE,SAAS,EAAE,8HAA8H,EAAE,8HAA8H,EAAE,8HAA8H,EAAE,8HAA8H,EAAE,8HAA8H,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,oBAAoB,+HAA+H,gBAAgB,eAAe,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,uDAAuD,EAAE,uDAAuD,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,oGAAoG,UAAU,eAAe,+CAA+C,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,oBAAoB,gBAAgB,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,+CAA+C,8BAA8B,UAAU,EAAE,UAAU,EAAE,iCAAiC,4CAA4C,oBAAoB,EAAE,0BAA0B,EAAE,oCAAoC,EAAE,8CAA8C,gBAAgB,4BAA4B,EAAE,6BAA6B,gBAAgB,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,gDAAgD,EAAE,gDAAgD,EAAE,gDAAgD,EAAE,gDAAgD,EAAE,kCAAkC,EAAE,kCAAkC;AAC5qF,iBAAiB,2QAA2Q;AAC5R;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,yHAAyH,WAAW,qoBAAqoB;AACh2B,aAAa,mBAAmB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,cAAc,6BAA6B,UAAU,6BAA6B,WAAW,kCAAkC,YAAY;AAC9V,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC/xBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,m/BAAm/B;AAC9/B,aAAa,kmBAAkmB;AAC/mB;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gDAAgD;AAC/E;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,yBAAyB,gDAAgD;AACzE;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA,SAAS,+BAA+B;AACxC;AACA;;AAEA,oBAAoB,0FAA0F;AAC9G,iBAAiB,qEAAqE;AACtF;AACA;AACA;;AAEA,oBAAoB,wFAAwF;AAC5G,iBAAiB,oFAAoF;AACrG;AACA;AACA;;AAEA,oBAAoB,uFAAuF;AAC3G,iBAAiB,mFAAmF;AACpG;AACA;AACA;;AAEA;AACA,oBAAoB,uFAAuF;AAC3G;AACA;AACA,iBAAiB,gDAAgD;AACjE;AACA;AACA;;AAEA;AACA,oBAAoB,uFAAuF;AAC3G;AACA;AACA,iBAAiB,gDAAgD;AACjE;AACA;AACA;AACA,4BAA4B,gFAAgF;AAC5G;AACA;AACA,4BAA4B,kFAAkF;AAC9G;AACA;;AAEA,uBAAuB,sEAAsE;AAC7F;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,qFAAqF;AAC5G;AACA;;AAEA,uBAAuB,mDAAmD;AAC1E;AACA;AACA;;AAEA,uBAAuB,mDAAmD;AAC1E;AACA;AACA;;AAEA,uBAAuB,wDAAwD;AAC/E;AACA;AACA;;AAEA,uBAAuB,qDAAqD;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4FAA4F;AAC1H,gBAAgB;AAChB;AACA;AACA;AACA,8BAA8B,4FAA4F;AAC1H,eAAe;AACf;AACA;AACA;AACA,8BAA8B,4FAA4F;AAC1H;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,sCAAsC,EAAE,MAAM,EAAE,sCAAsC,EAAE,sCAAsC,EAA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N;AACzO;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,2BAA2B;AAC3B;AACA,yCAAyC,qBAAqB;AAC9D;AACA,0BAA0B,iBAAiB,oBAAoB;AAC/D;AACA,0BAA0B,iBAAiB;AAC3C;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,uFAAuF,oBAAoB,kEAAkE,iCAAiC,sKAAsK,oRAAoR,qBAAqB,yCAAyC,4IAA4I;AACz6B,aAAa,kBAAkB,gCAAgC,mBAAmB,kCAAkC,kBAAkB,kCAAkC,OAAO,mCAAmC,UAAU,sCAAsC,SAAS,mCAAmC,YAAY;AAC1T,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACt3BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,khBAAkhB,qJAAqJ;AAClrB,aAAa,iVAAiV,6HAA6H;AAC3d;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,yBAAyB;AAClE;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,6DAA6D,WAAW;AACxE;AACA;;AAEA,2CAA2C,iCAAiC;AAC5E,iBAAiB,4BAA4B,+DAA+D,WAAW;AACvH;AACA;AACA;;AAEA,sEAAsE;AACtE,iBAAiB,4BAA4B,+DAA+D,WAAW,8DAA8D;AACrL;AACA;AACA;;AAEA,2EAA2E;AAC3E,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iB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AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,gCAAgC;AAChC;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,0BAA0B,EAAE,MAAM,cAAc,IAAI,GAAG,0BAA0B,EAAE,cAAc,EAAE,UAAU,EAAE,6EAA6E,EAAE,QAAQ,EAAE,uBAAuB,gCAAgC,QAAQ,gBAAgB,4CAA4C,wDAAwD,UAAU,gBAAgB,UAAU,EAAE,gBAAgB,EAAE,UAAU,0CAA0C,aAAa,EAAE,UAAU,EAAE,UAAU;AACrhB,iBAAiB,qCAAqC;AACtD;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,yBAAyB,oBAAoB,2FAA2F,2BAA2B,kBAAkB,kBAAkB;AAC9R,aAAa,kBAAkB,8BAA8B,mBAAmB,gCAAgC,kBAAkB,gCAAgC,YAAY;AAC9K,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC9pBA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;UEJA;UACA;UACA;UACA","sources":["webpack://mermaid/webpack/universalModuleDefinition","webpack://mermaid/./src/config.js","webpack://mermaid/./src/dagre-wrapper/clusters.js","webpack://mermaid/./src/dagre-wrapper/createLabel.js","webpack://mermaid/./src/dagre-wrapper/edges.js","webpack://mermaid/./src/dagre-wrapper/index.js","webpack://mermaid/./src/dagre-wrapper/intersect/index.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-circle.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-ellipse.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-line.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-node.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-polygon.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-rect.js","webpack://mermaid/./src/dagre-wrapper/markers.js","webpack://mermaid/./src/dagre-wrapper/mermaid-graphlib.js","webpack://mermaid/./src/dagre-wrapper/nodes.js","webpack://mermaid/./src/dagre-wrapper/shapes/note.js","webpack://mermaid/./src/dagre-wrapper/shapes/util.js","webpack://mermaid/./src/defaultConfig.js","webpack://mermaid/./src/diagrams/class/classDb.js","webpack://mermaid/./src/diagrams/class/classRenderer-v2.js","webpack://mermaid/./src/diagrams/class/classRenderer.js","webpack://mermaid/./src/diagrams/class/styles.js","webpack://mermaid/./src/diagrams/class/svgDraw.js","webpack://mermaid/./src/diagrams/common/common.js","webpack://mermaid/./src/diagrams/er/erDb.js","webpack://mermaid/./src/diagrams/er/erMarkers.js","webpack://mermaid/./src/diagrams/er/erRenderer.js","webpack://mermaid/./src/diagrams/er/styles.js","webpack://mermaid/./src/diagrams/flowchart/flowChartShapes.js","webpack://mermaid/./src/diagrams/flowchart/flowDb.js","webpack://mermaid/./src/diagrams/flowchart/flowRenderer-v2.js","webpack://mermaid/./src/diagrams/flowchart/flowRenderer.js","webpack://mermaid/./src/diagrams/flowchart/styles.js","webpack://mermaid/./src/diagrams/gantt/ganttDb.js","webpack://mermaid/./src/diagrams/gantt/ganttRenderer.js","webpack://mermaid/./src/diagrams/gantt/styles.js","webpack://mermaid/./src/diagrams/git/gitGraphAst.js","webpack://mermaid/./src/diagrams/git/gitGraphRenderer.js","webpack://mermaid/./src/diagrams/git/styles.js","webpack://mermaid/./src/diagrams/info/infoDb.js","webpack://mermaid/./src/diagrams/info/infoRenderer.js","webpack://mermaid/./src/diagrams/info/styles.js","webpack://mermaid/./src/diagrams/pie/pieDb.js","webpack://mermaid/./src/diagrams/pie/pieRenderer.js","webpack://mermaid/./src/diagrams/pie/styles.js","webpack://mermaid/./src/diagrams/requirement/requirementDb.js","webpack://mermaid/./src/diagrams/requirement/requirementMarkers.js","webpack://mermaid/./src/diagrams/requirement/requirementRenderer.js","webpack://mermaid/./src/diagrams/requirement/styles.js","webpack://mermaid/./src/diagrams/sequence/sequenceDb.js","webpack://mermaid/./src/diagrams/sequence/sequenceRenderer.js","webpack://mermaid/./src/diagrams/sequence/styles.js","webpack://mermaid/./src/diagrams/sequence/svgDraw.js","webpack://mermaid/./src/diagrams/state/id-cache.js","webpack://mermaid/./src/diagrams/state/shapes.js","webpack://mermaid/./src/diagrams/state/stateDb.js","webpack://mermaid/./src/diagrams/state/stateRenderer-v2.js","webpack://mermaid/./src/diagrams/state/stateRenderer.js","webpack://mermaid/./src/diagrams/state/styles.js","webpack://mermaid/./src/diagrams/user-journey/journeyDb.js","webpack://mermaid/./src/diagrams/user-journey/journeyRenderer.js","webpack://mermaid/./src/diagrams/user-journey/styles.js","webpack://mermaid/./src/diagrams/user-journey/svgDraw.js","webpack://mermaid/./src/errorRenderer.js","webpack://mermaid/./src/interactionDb.js","webpack://mermaid/./src/logger.js","webpack://mermaid/./src/mermaid.js","webpack://mermaid/./src/mermaidAPI.js","webpack://mermaid/./src/styles.js","webpack://mermaid/./src/themes/index.js","webpack://mermaid/./src/themes/theme-base.js","webpack://mermaid/./src/themes/theme-dark.js","webpack://mermaid/./src/themes/theme-default.js","webpack://mermaid/./src/themes/theme-forest.js","webpack://mermaid/./src/themes/theme-helpers.js","webpack://mermaid/./src/themes/theme-neutral.js","webpack://mermaid/./src/utils.js","webpack://mermaid/./node_modules/path-browserify/index.js","webpack://mermaid/./src/diagrams/class/parser/classDiagram.jison","webpack://mermaid/./src/diagrams/er/parser/erDiagram.jison","webpack://mermaid/./src/diagrams/flowchart/parser/flow.jison","webpack://mermaid/./src/diagrams/gantt/parser/gantt.jison","webpack://mermaid/./src/diagrams/git/parser/gitGraph.jison","webpack://mermaid/./src/diagrams/info/parser/info.jison","webpack://mermaid/./src/diagrams/pie/parser/pie.jison","webpack://mermaid/./src/diagrams/requirement/parser/requirementDiagram.jison","webpack://mermaid/./src/diagrams/sequence/parser/sequenceDiagram.jison","webpack://mermaid/./src/diagrams/state/parser/stateDiagram.jison","webpack://mermaid/./src/diagrams/user-journey/parser/journey.jison","webpack://mermaid/external commonjs \"@braintree/sanitize-url\"","webpack://mermaid/external commonjs \"d3\"","webpack://mermaid/external commonjs \"dagre\"","webpack://mermaid/external commonjs \"dagre-d3\"","webpack://mermaid/external commonjs \"dagre-d3/lib/label/add-html-label.js\"","webpack://mermaid/external commonjs \"dompurify\"","webpack://mermaid/external commonjs \"graphlib\"","webpack://mermaid/external commonjs \"khroma\"","webpack://mermaid/external commonjs \"moment-mini\"","webpack://mermaid/external commonjs \"stylis\"","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/class/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/er/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/flowchart/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/gantt/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/git/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/info/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/pie/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/requirement/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/sequence/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/state/parser|fs","webpack://mermaid/ignored|/Users/knuts/source/priv/atlantica/mermaid/src/diagrams/user-journey/parser|fs","webpack://mermaid/webpack/bootstrap","webpack://mermaid/webpack/runtime/compat get default export","webpack://mermaid/webpack/runtime/define property getters","webpack://mermaid/webpack/runtime/hasOwnProperty shorthand","webpack://mermaid/webpack/runtime/make namespace object","webpack://mermaid/webpack/runtime/node module decorator","webpack://mermaid/webpack/before-startup","webpack://mermaid/webpack/startup","webpack://mermaid/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mermaid\"] = factory();\n\telse\n\t\troot[\"mermaid\"] = factory();\n})(typeof self !== \"undefined\" ? self : this, function() {\nreturn ","import { assignWithDepth } from './utils';\nimport { log } from './logger';\nimport theme from './themes';\nimport config from './defaultConfig';\n\n// debugger;\n\nexport const defaultConfig = Object.freeze(config);\n\nlet siteConfig = assignWithDepth({}, defaultConfig);\nlet configFromInitialize;\nlet directives = [];\nlet currentConfig = assignWithDepth({}, defaultConfig);\n\nexport const updateCurrentConfig = (siteCfg, _directives) => {\n // start with config beeing the siteConfig\n let cfg = assignWithDepth({}, siteCfg);\n // let sCfg = assignWithDepth(defaultConfig, siteConfigDelta);\n\n // Join directives\n let sumOfDirectives = {};\n for (let i = 0; i < _directives.length; i++) {\n const d = _directives[i];\n sanitize(d);\n\n // Apply the data from the directive where the the overrides the themeVaraibles\n sumOfDirectives = assignWithDepth(sumOfDirectives, d);\n }\n\n cfg = assignWithDepth(cfg, sumOfDirectives);\n\n if (sumOfDirectives.theme) {\n const tmpConfigFromInitialize = assignWithDepth({}, configFromInitialize);\n const themeVariables = assignWithDepth(\n tmpConfigFromInitialize.themeVariables || {},\n sumOfDirectives.themeVariables\n );\n cfg.themeVariables = theme[cfg.theme].getThemeVariables(themeVariables);\n }\n\n currentConfig = cfg;\n return cfg;\n};\n\n/**\n * ## setSiteConfig\n *\n * | Function | Description | Type | Values |\n * | ------------- | ------------------------------------- | ----------- | --------------------------------------- |\n * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |\n *\n * **Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls\n * to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig)\n * will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this\n * function *Default value: At default, will mirror Global Config**\n *\n * @param conf - The base currentConfig to use as siteConfig\n * @returns {object} - The siteConfig\n */\nexport const setSiteConfig = (conf) => {\n siteConfig = assignWithDepth({}, defaultConfig);\n siteConfig = assignWithDepth(siteConfig, conf);\n\n if (conf.theme) {\n siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables);\n }\n\n currentConfig = updateCurrentConfig(siteConfig, directives);\n return siteConfig;\n};\n\nexport const saveConfigFromInitilize = (conf) => {\n configFromInitialize = assignWithDepth({}, conf);\n};\n\nexport const updateSiteConfig = (conf) => {\n siteConfig = assignWithDepth(siteConfig, conf);\n updateCurrentConfig(siteConfig, directives);\n\n return siteConfig;\n};\n/**\n * ## getSiteConfig\n *\n * | Function | Description | Type | Values |\n * | ------------- | ------------------------------------------------- | ----------- | -------------------------------- |\n * | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig |\n *\n * **Notes**: Returns **any** values in siteConfig.\n *\n * @returns {object} - The siteConfig\n */\nexport const getSiteConfig = () => {\n return assignWithDepth({}, siteConfig);\n};\n/**\n * ## setConfig\n *\n * | Function | Description | Type | Values |\n * | ------------- | ------------------------------------- | ----------- | --------------------------------------- |\n * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |\n *\n * **Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure\n * keys. Any values found in conf with key found in siteConfig.secure will be replaced with the\n * corresponding siteConfig value.\n *\n * @param {any} conf - The potential currentConfig\n * @returns {any} - The currentConfig merged with the sanitized conf\n */\nexport const setConfig = (conf) => {\n // sanitize(conf);\n // Object.keys(conf).forEach(key => {\n // const manipulator = manipulators[key];\n // conf[key] = manipulator ? manipulator(conf[key]) : conf[key];\n // });\n\n assignWithDepth(currentConfig, conf);\n\n return getConfig();\n};\n\n/**\n * ## getConfig\n *\n * | Function | Description | Type | Return Values |\n * | --------- | ------------------------- | ----------- | ------------------------------ |\n * | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config |\n *\n * **Notes**: Returns **any** the currentConfig\n *\n * @returns {any} - The currentConfig\n */\nexport const getConfig = () => {\n return assignWithDepth({}, currentConfig);\n};\n/**\n * ## sanitize\n *\n * | Function | Description | Type | Values |\n * | -------- | -------------------------------------- | ----------- | ------ |\n * | sanitize | Sets the siteConfig to desired values. | Put Request | None |\n *\n * Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies\n * options in-place\n *\n * @param {any} options - The potential setConfig parameter\n */\nexport const sanitize = (options) => {\n // Checking that options are not in the list of excluded options\n Object.keys(siteConfig.secure).forEach((key) => {\n if (typeof options[siteConfig.secure[key]] !== 'undefined') {\n // DO NOT attempt to print options[siteConfig.secure[key]] within `${}` as a malicious script\n // can exploit the logger's attempt to stringify the value and execute arbitrary code\n log.debug(\n `Denied attempt to modify a secure key ${siteConfig.secure[key]}`,\n options[siteConfig.secure[key]]\n );\n delete options[siteConfig.secure[key]];\n }\n });\n\n // Check that there no attempts of prototype pollution\n Object.keys(options).forEach((key) => {\n if (key.indexOf('__') === 0) {\n delete options[key];\n }\n });\n // Check that there no attempts of xss, there should be no tags at all in the directive\n // blocking data urls as base64 urls can contain svgs with inline script tags\n Object.keys(options).forEach((key) => {\n if (typeof options[key] === 'string') {\n if (\n options[key].indexOf('<') > -1 ||\n options[key].indexOf('>') > -1 ||\n options[key].indexOf('url(data:') > -1\n ) {\n delete options[key];\n }\n }\n if (typeof options[key] === 'object') {\n sanitize(options[key]);\n }\n });\n};\n\n/**\n * Pushes in a directive to the configuration\n *\n * @param {object} directive The directive to push in\n */\nexport const addDirective = (directive) => {\n if (directive.fontFamily) {\n if (!directive.themeVariables) {\n directive.themeVariables = { fontFamily: directive.fontFamily };\n } else {\n if (!directive.themeVariables.fontFamily) {\n directive.themeVariables = { fontFamily: directive.fontFamily };\n }\n }\n }\n directives.push(directive);\n updateCurrentConfig(siteConfig, directives);\n};\n\n/**\n * ## reset\n *\n * | Function | Description | Type | Required | Values |\n * | -------- | ---------------------------- | ----------- | -------- | ------ |\n * | reset | Resets currentConfig to conf | Put Request | Required | None |\n *\n * ## conf\n *\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- |\n * | conf | base set of values, which currentConfig coul be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array |\n *\n * **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`)\n */\nexport const reset = () => {\n // Replace current config with siteConfig\n directives = [];\n updateCurrentConfig(siteConfig, directives);\n};\n","import intersectRect from './intersect/intersect-rect';\nimport { log } from '../logger';\nimport createLabel from './createLabel';\nimport { select } from 'd3';\nimport { getConfig } from '../config';\nimport { evaluate } from '../diagrams/common/common';\n\nconst rect = (parent, node) => {\n log.trace('Creating subgraph rect for ', node.id, node);\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster' + (node.class ? ' ' + node.class : ''))\n .attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'cluster-label');\n\n const text = label\n .node()\n .appendChild(createLabel(node.labelText, node.labelStyle, undefined, true));\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n const width = node.width <= bbox.width + padding ? bbox.width + padding : node.width;\n if (node.width <= bbox.width + padding) {\n node.diff = (bbox.width - node.width) / 2;\n } else {\n node.diff = -node.padding / 2;\n }\n\n log.trace('Data ', node, JSON.stringify(node));\n // center the rect around its coordinate\n rect\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', node.x - width / 2)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', width)\n .attr('height', node.height + padding);\n\n // Center the label\n label.attr(\n 'transform',\n 'translate(' +\n (node.x - bbox.width / 2) +\n ', ' +\n (node.y - node.height / 2 + node.padding / 3) +\n ')'\n );\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\n\n/**\n * Non visiable cluster where the note is group with its\n *\n * @param {any} parent\n * @param {any} node\n * @returns {any} ShapeSvg\n */\nconst noteGroup = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', 'note-cluster').attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n // center the rect around its coordinate\n rect\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', node.x - node.width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', node.width + padding)\n .attr('height', node.height + padding)\n .attr('fill', 'none');\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\nconst roundedWithTitle = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'cluster-label');\n const innerRect = shapeSvg.append('rect');\n\n const text = label\n .node()\n .appendChild(createLabel(node.labelText, node.labelStyle, undefined, true));\n\n // Get the size of the label\n let bbox = text.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n bbox = text.getBBox();\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (bbox.width + node.padding * 0 - node.width) / 2;\n } else {\n node.diff = -node.padding / 2;\n }\n\n // center the rect around its coordinate\n rect\n .attr('class', 'outer')\n .attr('x', node.x - width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', width + padding)\n .attr('height', node.height + padding);\n innerRect\n .attr('class', 'inner')\n .attr('x', node.x - width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1)\n .attr('width', width + padding)\n .attr('height', node.height + padding - bbox.height - 3);\n\n // Center the label\n label.attr(\n 'transform',\n 'translate(' +\n (node.x - bbox.width / 2) +\n ', ' +\n (node.y -\n node.height / 2 -\n node.padding / 3 +\n (evaluate(getConfig().flowchart.htmlLabels) ? 5 : 3)) +\n ')'\n );\n\n const rectBox = rect.node().getBBox();\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst divider = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n // center the rect around its coordinate\n rect\n .attr('class', 'divider')\n .attr('x', node.x - node.width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2)\n .attr('width', node.width + padding)\n .attr('height', node.height + padding);\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n node.diff = -node.padding / 2;\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst shapes = { rect, roundedWithTitle, noteGroup, divider };\n\nlet clusterElems = {};\n\nexport const insertCluster = (elem, node) => {\n log.trace('Inserting cluster');\n const shape = node.shape || 'rect';\n clusterElems[node.id] = shapes[shape](elem, node);\n};\nexport const getClusterTitleWidth = (elem, node) => {\n const label = createLabel(node.labelText, node.labelStyle, undefined, true);\n elem.node().appendChild(label);\n const width = label.getBBox().width;\n elem.node().removeChild(label);\n return width;\n};\n\nexport const clear = () => {\n clusterElems = {};\n};\n\nexport const positionCluster = (node) => {\n log.info('Position cluster (' + node.id + ', ' + node.x + ', ' + node.y + ')');\n const el = clusterElems[node.id];\n\n el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');\n};\n","import { select } from 'd3';\nimport { log } from '../logger'; // eslint-disable-line\nimport { getConfig } from '../config';\nimport { evaluate } from '../diagrams/common/common';\n\n/**\n * @param dom\n * @param styleFn\n */\nfunction applyStyle(dom, styleFn) {\n if (styleFn) {\n dom.attr('style', styleFn);\n }\n}\n\n/**\n * @param {any} node\n * @returns {SVGForeignObjectElement} Node\n */\nfunction addHtmlLabel(node) {\n const fo = select(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject'));\n const div = fo.append('xhtml:div');\n\n const label = node.label;\n const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel';\n div.html(\n '<span class=\"' +\n labelClass +\n '\" ' +\n (node.labelStyle ? 'style=\"' + node.labelStyle + '\"' : '') +\n '>' +\n label +\n '</span>'\n );\n\n applyStyle(div, node.labelStyle);\n div.style('display', 'inline-block');\n // Fix for firefox\n div.style('white-space', 'nowrap');\n div.attr('xmlns', 'http://www.w3.org/1999/xhtml');\n return fo.node();\n}\n\nconst createLabel = (_vertexText, style, isTitle, isNode) => {\n let vertexText = _vertexText || '';\n if (typeof vertexText === 'object') vertexText = vertexText[0];\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?\n vertexText = vertexText.replace(/\\\\n|\\n/g, '<br />');\n log.info('vertexText' + vertexText);\n const node = {\n isNode,\n label: vertexText.replace(\n /fa[lrsb]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n ),\n labelStyle: style.replace('fill:', 'color:'),\n };\n let vertexNode = addHtmlLabel(node);\n // vertexNode.parentNode.removeChild(vertexNode);\n return vertexNode;\n } else {\n const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('style', style.replace('color:', 'fill:'));\n let rows = [];\n if (typeof vertexText === 'string') {\n rows = vertexText.split(/\\\\n|\\n|<br\\s*\\/?>/gi);\n } else if (Array.isArray(vertexText)) {\n rows = vertexText;\n } else {\n rows = [];\n }\n\n for (let j = 0; j < rows.length; j++) {\n const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n tspan.setAttribute('dy', '1em');\n tspan.setAttribute('x', '0');\n if (isTitle) {\n tspan.setAttribute('class', 'title-row');\n } else {\n tspan.setAttribute('class', 'row');\n }\n tspan.textContent = rows[j].trim();\n svgLabel.appendChild(tspan);\n }\n return svgLabel;\n }\n};\n\nexport default createLabel;\n","import { log } from '../logger'; // eslint-disable-line\nimport createLabel from './createLabel';\nimport { line, curveBasis, select } from 'd3';\nimport { getConfig } from '../config';\nimport utils from '../utils';\nimport { evaluate } from '../diagrams/common/common';\n\nlet edgeLabels = {};\nlet terminalLabels = {};\n\nexport const clear = () => {\n edgeLabels = {};\n terminalLabels = {};\n};\n\nexport const insertEdgeLabel = (elem, edge) => {\n // Create the actual text element\n const labelElement = createLabel(edge.label, edge.labelStyle);\n\n // Create outer g, edgeLabel, this will be positioned after graph layout\n const edgeLabel = elem.insert('g').attr('class', 'edgeLabel');\n\n // Create inner g, label, this will be positioned now for centering the text\n const label = edgeLabel.insert('g').attr('class', 'label');\n label.node().appendChild(labelElement);\n\n // Center the label\n let bbox = labelElement.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = labelElement.children[0];\n const dv = select(labelElement);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n\n // Make element accessible by id for positioning\n edgeLabels[edge.id] = edgeLabel;\n\n // Update the abstract data of the edge with the new information about its width and height\n edge.width = bbox.width;\n edge.height = bbox.height;\n\n let fo;\n if (edge.startLabelLeft) {\n // Create the actual text element\n const startLabelElement = createLabel(edge.startLabelLeft, edge.labelStyle);\n const startEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = startEdgeLabelLeft.insert('g').attr('class', 'inner');\n fo = inner.node().appendChild(startLabelElement);\n const slBox = startLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].startLeft = startEdgeLabelLeft;\n setTerminalWidth(fo, edge.startLabelLeft);\n }\n if (edge.startLabelRight) {\n // Create the actual text element\n const startLabelElement = createLabel(edge.startLabelRight, edge.labelStyle);\n const startEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = startEdgeLabelRight.insert('g').attr('class', 'inner');\n fo = startEdgeLabelRight.node().appendChild(startLabelElement);\n inner.node().appendChild(startLabelElement);\n const slBox = startLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].startRight = startEdgeLabelRight;\n setTerminalWidth(fo, edge.startLabelRight);\n }\n if (edge.endLabelLeft) {\n // Create the actual text element\n const endLabelElement = createLabel(edge.endLabelLeft, edge.labelStyle);\n const endEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = endEdgeLabelLeft.insert('g').attr('class', 'inner');\n fo = inner.node().appendChild(endLabelElement);\n const slBox = endLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n\n endEdgeLabelLeft.node().appendChild(endLabelElement);\n\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].endLeft = endEdgeLabelLeft;\n setTerminalWidth(fo, edge.endLabelLeft);\n }\n if (edge.endLabelRight) {\n // Create the actual text element\n const endLabelElement = createLabel(edge.endLabelRight, edge.labelStyle);\n const endEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = endEdgeLabelRight.insert('g').attr('class', 'inner');\n\n fo = inner.node().appendChild(endLabelElement);\n const slBox = endLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n\n endEdgeLabelRight.node().appendChild(endLabelElement);\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].endRight = endEdgeLabelRight;\n setTerminalWidth(fo, edge.endLabelRight);\n }\n};\n\n/**\n * @param {any} fo\n * @param {any} value\n */\nfunction setTerminalWidth(fo, value) {\n if (getConfig().flowchart.htmlLabels && fo) {\n fo.style.width = value.length * 9 + 'px';\n fo.style.height = '12px';\n }\n}\n\nexport const positionEdgeLabel = (edge, paths) => {\n log.info('Moving label abc78 ', edge.id, edge.label, edgeLabels[edge.id]);\n let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;\n if (edge.label) {\n const el = edgeLabels[edge.id];\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // // debugger;\n const pos = utils.calcLabelPosition(path);\n log.info('Moving label from (', x, ',', y, ') to (', pos.x, ',', pos.y, ') abc78');\n // x = pos.x;\n // y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n\n //let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;\n if (edge.startLabelLeft) {\n const el = terminalLabels[edge.id].startLeft;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_left', path);\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n if (edge.startLabelRight) {\n const el = terminalLabels[edge.id].startRight;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(\n edge.arrowTypeStart ? 10 : 0,\n 'start_right',\n path\n );\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n if (edge.endLabelLeft) {\n const el = terminalLabels[edge.id].endLeft;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_left', path);\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n if (edge.endLabelRight) {\n const el = terminalLabels[edge.id].endRight;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_right', path);\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n};\n\n// const getRelationType = function(type) {\n// switch (type) {\n// case stateDb.relationType.AGGREGATION:\n// return 'aggregation';\n// case stateDb.relationType.EXTENSION:\n// return 'extension';\n// case stateDb.relationType.COMPOSITION:\n// return 'composition';\n// case stateDb.relationType.DEPENDENCY:\n// return 'dependency';\n// }\n// };\n\nconst outsideNode = (node, point) => {\n // log.warn('Checking bounds ', node, point);\n const x = node.x;\n const y = node.y;\n const dx = Math.abs(point.x - x);\n const dy = Math.abs(point.y - y);\n const w = node.width / 2;\n const h = node.height / 2;\n if (dx >= w || dy >= h) {\n return true;\n }\n return false;\n};\n\nexport const intersection = (node, outsidePoint, insidePoint) => {\n log.warn(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(outsidePoint)}\n insidePoint : ${JSON.stringify(insidePoint)}\n node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);\n const x = node.x;\n const y = node.y;\n\n const dx = Math.abs(x - insidePoint.x);\n // const dy = Math.abs(y - insidePoint.y);\n const w = node.width / 2;\n let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;\n const h = node.height / 2;\n\n // const edges = {\n // x1: x - w,\n // x2: x + w,\n // y1: y - h,\n // y2: y + h\n // };\n\n // if (\n // outsidePoint.x === edges.x1 ||\n // outsidePoint.x === edges.x2 ||\n // outsidePoint.y === edges.y1 ||\n // outsidePoint.y === edges.y2\n // ) {\n // log.warn('abc89 calc equals on edge', outsidePoint, edges);\n // return outsidePoint;\n // }\n\n const Q = Math.abs(outsidePoint.y - insidePoint.y);\n const R = Math.abs(outsidePoint.x - insidePoint.x);\n // log.warn();\n if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) { // eslint-disable-line\n // Intersection is top or bottom of rect.\n // let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;\n let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;\n r = (R * q) / Q;\n const res = {\n x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,\n y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q,\n };\n\n if (r === 0) {\n res.x = outsidePoint.x;\n res.y = outsidePoint.y;\n }\n if (R === 0) {\n res.x = outsidePoint.x;\n }\n if (Q === 0) {\n res.y = outsidePoint.y;\n }\n\n log.warn(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);\n\n return res;\n } else {\n // Intersection onn sides of rect\n if (insidePoint.x < outsidePoint.x) {\n r = outsidePoint.x - w - x;\n } else {\n // r = outsidePoint.x - w - x;\n r = x - w - outsidePoint.x;\n }\n let q = (Q * r) / R;\n // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w;\n // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r;\n let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;\n // let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r;\n let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;\n log.warn(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });\n if (r === 0) {\n _x = outsidePoint.x;\n _y = outsidePoint.y;\n }\n if (R === 0) {\n _x = outsidePoint.x;\n }\n if (Q === 0) {\n _y = outsidePoint.y;\n }\n\n return { x: _x, y: _y };\n }\n};\n/**\n * This function will page a path and node where the last point(s) in the path is inside the node\n * and return an update path ending by the border of the node.\n *\n * @param {Array} _points\n * @param {any} boundryNode\n * @returns {Array} Points\n */\nconst cutPathAtIntersect = (_points, boundryNode) => {\n log.warn('abc88 cutPathAtIntersect', _points, boundryNode);\n let points = [];\n let lastPointOutside = _points[0];\n let isInside = false;\n _points.forEach((point) => {\n // const node = clusterDb[edge.toCluster].node;\n log.info('abc88 checking point', point, boundryNode);\n\n // check if point is inside the boundry rect\n if (!outsideNode(boundryNode, point) && !isInside) {\n // First point inside the rect found\n // Calc the intersection coord between the point anf the last opint ouside the rect\n const inter = intersection(boundryNode, lastPointOutside, point);\n log.warn('abc88 inside', point, lastPointOutside, inter);\n log.warn('abc88 intersection', inter);\n\n // // Check case where the intersection is the same as the last point\n let pointPresent = false;\n points.forEach((p) => {\n pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y);\n });\n // // if (!pointPresent) {\n if (!points.find((e) => e.x === inter.x && e.y === inter.y)) {\n points.push(inter);\n } else {\n log.warn('abc88 no intersect', inter, points);\n }\n // points.push(inter);\n isInside = true;\n } else {\n // Outside\n log.warn('abc88 outside', point, lastPointOutside);\n lastPointOutside = point;\n // points.push(point);\n if (!isInside) points.push(point);\n }\n });\n log.warn('abc88 returning points', points);\n return points;\n};\n\n//(edgePaths, e, edge, clusterDb, diagramtype, graph)\nexport const insertEdge = function (elem, e, edge, clusterDb, diagramType, graph) {\n let points = edge.points;\n let pointsHasChanged = false;\n const tail = graph.node(e.v);\n var head = graph.node(e.w);\n\n log.info('abc88 InsertEdge: ', edge);\n if (head.intersect && tail.intersect) {\n points = points.slice(1, edge.points.length - 1);\n points.unshift(tail.intersect(points[0]));\n log.info(\n 'Last point',\n points[points.length - 1],\n head,\n head.intersect(points[points.length - 1])\n );\n points.push(head.intersect(points[points.length - 1]));\n }\n if (edge.toCluster) {\n log.info('to cluster abc88', clusterDb[edge.toCluster]);\n points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node);\n // log.trace('edge', edge);\n // points = [];\n // let lastPointOutside; // = edge.points[0];\n // let isInside = false;\n // edge.points.forEach(point => {\n // const node = clusterDb[edge.toCluster].node;\n // log.warn('checking from', edge.fromCluster, point, node);\n\n // if (!outsideNode(node, point) && !isInside) {\n // log.trace('inside', edge.toCluster, point, lastPointOutside);\n\n // // First point inside the rect\n // const inter = intersection(node, lastPointOutside, point);\n\n // let pointPresent = false;\n // points.forEach(p => {\n // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y);\n // });\n // // if (!pointPresent) {\n // if (!points.find(e => e.x === inter.x && e.y === inter.y)) {\n // points.push(inter);\n // } else {\n // log.warn('no intersect', inter, points);\n // }\n // isInside = true;\n // } else {\n // // outtside\n // lastPointOutside = point;\n // if (!isInside) points.push(point);\n // }\n // });\n pointsHasChanged = true;\n }\n\n if (edge.fromCluster) {\n log.info('from cluster abc88', clusterDb[edge.fromCluster]);\n points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse();\n // log.warn('edge', edge);\n // log.warn('from cluster', clusterDb[edge.fromCluster], points);\n // const updatedPoints = [];\n // let lastPointOutside = edge.points[edge.points.length - 1];\n // let isInside = false;\n // for (let i = points.length - 1; i >= 0; i--) {\n // const point = points[i];\n // const node = clusterDb[edge.fromCluster].node;\n // log.warn('checking to', edge.fromCluster, point, node);\n\n // if (!outsideNode(node, point) && !isInside) {\n // log.warn('inside', edge.fromCluster, point, node);\n\n // // First point inside the rect\n // const inter = intersection(node, lastPointOutside, point);\n // log.warn('intersect', intersection(node, lastPointOutside, point));\n // let pointPresent = false;\n // points.forEach(p => {\n // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y);\n // });\n // // if (!pointPresent) {\n // if (!points.find(e => e.x === inter.x && e.y === inter.y)) {\n // updatedPoints.unshift(inter);\n // log.warn('Adding point -updated = ', updatedPoints);\n // } else {\n // log.warn('no intersect', inter, points);\n // }\n // // points.push(insterection);\n // isInside = true;\n // } else {\n // // at the outside\n // // if (!isInside) updatedPoints.unshift(point);\n // updatedPoints.unshift(point);\n // log.warn('Outside point', point, updatedPoints);\n // }\n // lastPointOutside = point;\n // }\n // points = updatedPoints;\n // points = edge.points;\n pointsHasChanged = true;\n }\n\n // The data for our line\n const lineData = points.filter((p) => !Number.isNaN(p.y));\n\n // This is the accessor function we talked about above\n let curve;\n // Currently only flowcharts get the curve from the settings, perhaps this should\n // be expanded to a common setting? Restricting it for now in order not to cause side-effects that\n // have not been thought through\n if (diagramType === 'graph' || diagramType === 'flowchart') {\n curve = edge.curve || curveBasis;\n } else {\n curve = curveBasis;\n }\n // curve = curveLinear;\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curve);\n\n // Contruct stroke classes based on properties\n let strokeClasses;\n switch (edge.thickness) {\n case 'normal':\n strokeClasses = 'edge-thickness-normal';\n break;\n case 'thick':\n strokeClasses = 'edge-thickness-thick';\n break;\n default:\n strokeClasses = '';\n }\n switch (edge.pattern) {\n case 'solid':\n strokeClasses += ' edge-pattern-solid';\n break;\n case 'dotted':\n strokeClasses += ' edge-pattern-dotted';\n break;\n case 'dashed':\n strokeClasses += ' edge-pattern-dashed';\n break;\n }\n\n const svgPath = elem\n .append('path')\n .attr('d', lineFunction(lineData))\n .attr('id', edge.id)\n .attr('class', ' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : ''))\n .attr('style', edge.style);\n\n // DEBUG code, adds a red circle at each edge coordinate\n // edge.points.forEach(point => {\n // elem\n // .append('circle')\n // .style('stroke', 'red')\n // .style('fill', 'red')\n // .attr('r', 1)\n // .attr('cx', point.x)\n // .attr('cy', point.y);\n // });\n\n let url = '';\n if (getConfig().state.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n log.info('arrowTypeStart', edge.arrowTypeStart);\n log.info('arrowTypeEnd', edge.arrowTypeEnd);\n\n switch (edge.arrowTypeStart) {\n case 'arrow_cross':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-crossStart' + ')');\n break;\n case 'arrow_point':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-pointStart' + ')');\n break;\n case 'arrow_barb':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-barbStart' + ')');\n break;\n case 'arrow_circle':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-circleStart' + ')');\n break;\n case 'aggregation':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-aggregationStart' + ')');\n break;\n case 'extension':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-extensionStart' + ')');\n break;\n case 'composition':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-compositionStart' + ')');\n break;\n case 'dependency':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-dependencyStart' + ')');\n break;\n default:\n }\n switch (edge.arrowTypeEnd) {\n case 'arrow_cross':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-crossEnd' + ')');\n break;\n case 'arrow_point':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-pointEnd' + ')');\n break;\n case 'arrow_barb':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-barbEnd' + ')');\n break;\n case 'arrow_circle':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-circleEnd' + ')');\n break;\n case 'aggregation':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-aggregationEnd' + ')');\n break;\n case 'extension':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-extensionEnd' + ')');\n break;\n case 'composition':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-compositionEnd' + ')');\n break;\n case 'dependency':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-dependencyEnd' + ')');\n break;\n default:\n }\n let paths = {};\n if (pointsHasChanged) {\n paths.updatedPath = points;\n }\n paths.originalPath = edge.points;\n return paths;\n};\n","import dagre from 'dagre';\nimport graphlib from 'graphlib';\nimport insertMarkers from './markers';\nimport { updateNodeBounds } from './shapes/util';\nimport {\n clear as clearGraphlib,\n clusterDb,\n adjustClustersAndEdges,\n findNonClusterChild,\n sortNodesByHierarchy,\n} from './mermaid-graphlib';\nimport { insertNode, positionNode, clear as clearNodes, setNodeElem } from './nodes';\nimport { insertCluster, clear as clearClusters } from './clusters';\nimport { insertEdgeLabel, positionEdgeLabel, insertEdge, clear as clearEdges } from './edges';\nimport { log } from '../logger';\n\nconst recursiveRender = (_elem, graph, diagramtype, parentCluster) => {\n log.info('Graph in recursive render: XXX', graphlib.json.write(graph), parentCluster);\n const dir = graph.graph().rankdir;\n log.trace('Dir in recursive render - dir:', dir);\n\n const elem = _elem.insert('g').attr('class', 'root'); // eslint-disable-line\n if (!graph.nodes()) {\n log.info('No nodes found for', graph);\n } else {\n log.info('Recursive render XXX', graph.nodes());\n }\n if (graph.edges().length > 0) {\n log.trace('Recursive edges', graph.edge(graph.edges()[0]));\n }\n const clusters = elem.insert('g').attr('class', 'clusters'); // eslint-disable-line\n const edgePaths = elem.insert('g').attr('class', 'edgePaths');\n const edgeLabels = elem.insert('g').attr('class', 'edgeLabels');\n const nodes = elem.insert('g').attr('class', 'nodes');\n\n // Insert nodes, this will insert them into the dom and each node will get a size. The size is updated\n // to the abstract node and is later used by dagre for the layout\n graph.nodes().forEach(function (v) {\n const node = graph.node(v);\n if (typeof parentCluster !== 'undefined') {\n const data = JSON.parse(JSON.stringify(parentCluster.clusterData));\n // data.clusterPositioning = true;\n log.info('Setting data for cluster XXX (', v, ') ', data, parentCluster);\n graph.setNode(parentCluster.id, data);\n if (!graph.parent(v)) {\n log.trace('Setting parent', v, parentCluster.id);\n graph.setParent(v, parentCluster.id, data);\n }\n }\n log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v)));\n if (node && node.clusterNode) {\n // const children = graph.children(v);\n log.info('Cluster identified', v, node.width, graph.node(v));\n const o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v));\n const newEl = o.elem;\n updateNodeBounds(node, newEl);\n node.diff = o.diff || 0;\n log.info('Node bounds (abc123)', v, node, node.width, node.x, node.y);\n setNodeElem(newEl, node);\n\n log.warn('Recursive render complete ', newEl, node);\n } else {\n if (graph.children(v).length > 0) {\n // This is a cluster but not to be rendered recusively\n // Render as before\n log.info('Cluster - the non recursive path XXX', v, node.id, node, graph);\n log.info(findNonClusterChild(node.id, graph));\n clusterDb[node.id] = { id: findNonClusterChild(node.id, graph), node };\n // insertCluster(clusters, graph.node(v));\n } else {\n log.info('Node - the non recursive path', v, node.id, node);\n insertNode(nodes, graph.node(v), dir);\n }\n }\n });\n\n // Insert labels, this will insert them into the dom so that the width can be calculated\n // Also figure out which edges point to/from clusters and adjust them accordingly\n // Edges from/to clusters really points to the first child in the cluster.\n // TODO: pick optimal child in the cluster to us as link anchor\n graph.edges().forEach(function (e) {\n const edge = graph.edge(e.v, e.w, e.name);\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e));\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ', e, ' ', JSON.stringify(graph.edge(e)));\n\n // Check if link is either from or to a cluster\n log.info('Fix', clusterDb, 'ids:', e.v, e.w, 'Translateing: ', clusterDb[e.v], clusterDb[e.w]);\n insertEdgeLabel(edgeLabels, edge);\n });\n\n graph.edges().forEach(function (e) {\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e));\n });\n log.info('#############################################');\n log.info('### Layout ###');\n log.info('#############################################');\n log.info(graph);\n dagre.layout(graph);\n log.info('Graph after layout:', graphlib.json.write(graph));\n // Move the nodes to the correct place\n let diff = 0;\n sortNodesByHierarchy(graph).forEach(function (v) {\n const node = graph.node(v);\n log.info('Position ' + v + ': ' + JSON.stringify(graph.node(v)));\n log.info(\n 'Position ' + v + ': (' + node.x,\n ',' + node.y,\n ') width: ',\n node.width,\n ' height: ',\n node.height\n );\n if (node && node.clusterNode) {\n // clusterDb[node.id].node = node;\n\n positionNode(node);\n } else {\n // Non cluster node\n if (graph.children(v).length > 0) {\n // A cluster in the non-recurive way\n // positionCluster(node);\n insertCluster(clusters, node);\n clusterDb[node.id].node = node;\n } else {\n positionNode(node);\n }\n }\n });\n\n // Move the edge labels to the correct place after layout\n graph.edges().forEach(function (e) {\n const edge = graph.edge(e);\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(edge), edge);\n\n const paths = insertEdge(edgePaths, e, edge, clusterDb, diagramtype, graph);\n positionEdgeLabel(edge, paths);\n });\n\n graph.nodes().forEach(function (v) {\n const n = graph.node(v);\n log.info(v, n.type, n.diff);\n if (n.type === 'group') {\n diff = n.diff;\n }\n });\n return { elem, diff };\n};\n\nexport const render = (elem, graph, markers, diagramtype, id) => {\n insertMarkers(elem, markers, diagramtype, id);\n clearNodes();\n clearEdges();\n clearClusters();\n clearGraphlib();\n\n log.warn('Graph at first:', graphlib.json.write(graph));\n adjustClustersAndEdges(graph);\n log.warn('Graph after:', graphlib.json.write(graph));\n // log.warn('Graph ever after:', graphlib.json.write(graph.node('A').graph));\n recursiveRender(elem, graph, diagramtype);\n};\n\n// const shapeDefinitions = {};\n// export const addShape = ({ shapeType: fun }) => {\n// shapeDefinitions[shapeType] = fun;\n// };\n\n// const arrowDefinitions = {};\n// export const addArrow = ({ arrowType: fun }) => {\n// arrowDefinitions[arrowType] = fun;\n// };\n","/*\n * Borrowed with love from from dagrge-d3. Many thanks to cpettitt!\n */\n\nimport node from './intersect-node.js';\nimport circle from './intersect-circle.js';\nimport ellipse from './intersect-ellipse.js';\nimport polygon from './intersect-polygon.js';\nimport rect from './intersect-rect.js';\n\nexport default {\n node,\n circle,\n ellipse,\n polygon,\n rect,\n};\n","import intersectEllipse from './intersect-ellipse';\n\n/**\n * @param node\n * @param rx\n * @param point\n */\nfunction intersectCircle(node, rx, point) {\n return intersectEllipse(node, rx, rx, point);\n}\n\nexport default intersectCircle;\n","/**\n * @param node\n * @param rx\n * @param ry\n * @param point\n */\nfunction intersectEllipse(node, rx, ry, point) {\n // Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html\n\n var cx = node.x;\n var cy = node.y;\n\n var px = cx - point.x;\n var py = cy - point.y;\n\n var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);\n\n var dx = Math.abs((rx * ry * px) / det);\n if (point.x < cx) {\n dx = -dx;\n }\n var dy = Math.abs((rx * ry * py) / det);\n if (point.y < cy) {\n dy = -dy;\n }\n\n return { x: cx + dx, y: cy + dy };\n}\n\nexport default intersectEllipse;\n","/**\n * Returns the point at which two lines, p and q, intersect or returns undefined if they do not intersect.\n *\n * @param p1\n * @param p2\n * @param q1\n * @param q2\n */\nfunction intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y;\n\n // Compute r3 and r4.\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1;\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y;\n\n // Compute r1 and r2\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = a1 * b2 - a2 * b1;\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n return { x: x, y: y };\n}\n\n/**\n * @param r1\n * @param r2\n */\nfunction sameSign(r1, r2) {\n return r1 * r2 > 0;\n}\n\nexport default intersectLine;\n","module.exports = intersectNode;\n\n/**\n * @param node\n * @param point\n */\nfunction intersectNode(node, point) {\n // console.info('Intersect Node');\n return node.intersect(point);\n}\n","/* eslint \"no-console\": off */\n\nimport intersectLine from './intersect-line';\n\nexport default intersectPolygon;\n\n/**\n * Returns the point ({x, y}) at which the point argument intersects with the node argument assuming\n * that it has the shape specified by polygon.\n *\n * @param node\n * @param polyPoints\n * @param point\n */\nfunction intersectPolygon(node, polyPoints, point) {\n var x1 = node.x;\n var y1 = node.y;\n\n var intersections = [];\n\n var minX = Number.POSITIVE_INFINITY;\n var minY = Number.POSITIVE_INFINITY;\n if (typeof polyPoints.forEach === 'function') {\n polyPoints.forEach(function (entry) {\n minX = Math.min(minX, entry.x);\n minY = Math.min(minY, entry.y);\n });\n } else {\n minX = Math.min(minX, polyPoints.x);\n minY = Math.min(minY, polyPoints.y);\n }\n\n var left = x1 - node.width / 2 - minX;\n var top = y1 - node.height / 2 - minY;\n\n for (var i = 0; i < polyPoints.length; i++) {\n var p1 = polyPoints[i];\n var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];\n var intersect = intersectLine(\n node,\n point,\n { x: left + p1.x, y: top + p1.y },\n { x: left + p2.x, y: top + p2.y }\n );\n if (intersect) {\n intersections.push(intersect);\n }\n }\n\n if (!intersections.length) {\n // console.log('NO INTERSECTION FOUND, RETURN NODE CENTER', node);\n return node;\n }\n\n if (intersections.length > 1) {\n // More intersections, find the one nearest to edge end point\n intersections.sort(function (p, q) {\n var pdx = p.x - point.x;\n var pdy = p.y - point.y;\n var distp = Math.sqrt(pdx * pdx + pdy * pdy);\n\n var qdx = q.x - point.x;\n var qdy = q.y - point.y;\n var distq = Math.sqrt(qdx * qdx + qdy * qdy);\n\n return distp < distq ? -1 : distp === distq ? 0 : 1;\n });\n }\n return intersections[0];\n}\n","const intersectRect = (node, point) => {\n var x = node.x;\n var y = node.y;\n\n // Rectangle intersection algorithm from:\n // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\n var dx = point.x - x;\n var dy = point.y - y;\n var w = node.width / 2;\n var h = node.height / 2;\n\n var sx, sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : (h * dx) / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : (w * dy) / dx;\n }\n\n return { x: x + sx, y: y + sy };\n};\n\nexport default intersectRect;\n","/** Setup arrow head and define the marker. The result is appended to the svg. */\n\nimport { log } from '../logger';\n\n// Only add the number of markers that the diagram needs\nconst insertMarkers = (elem, markerArray, type, id) => {\n markerArray.forEach((markerName) => {\n markers[markerName](elem, type, id);\n });\n};\n\nconst extension = (elem, type, id) => {\n log.trace('Making markers for ', id);\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-extensionStart')\n .attr('class', 'marker extension ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-extensionEnd')\n .attr('class', 'marker extension ' + type)\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n};\n\nconst composition = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-compositionStart')\n .attr('class', 'marker composition ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-compositionEnd')\n .attr('class', 'marker composition ' + type)\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n};\nconst aggregation = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-aggregationStart')\n .attr('class', 'marker aggregation ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-aggregationEnd')\n .attr('class', 'marker aggregation ' + type)\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n};\nconst dependency = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-dependencyStart')\n .attr('class', 'marker dependency ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-dependencyEnd')\n .attr('class', 'marker dependency ' + type)\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\nconst point = (elem, type) => {\n elem\n .append('marker')\n .attr('id', type + '-pointEnd')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 12)\n .attr('markerHeight', 12)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 z')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n elem\n .append('marker')\n .attr('id', type + '-pointStart')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 0)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 12)\n .attr('markerHeight', 12)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 0 5 L 10 10 L 10 0 z')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n};\nconst circle = (elem, type) => {\n elem\n .append('marker')\n .attr('id', type + '-circleEnd')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 11)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('circle')\n .attr('cx', '5')\n .attr('cy', '5')\n .attr('r', '5')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n\n elem\n .append('marker')\n .attr('id', type + '-circleStart')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', -1)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('circle')\n .attr('cx', '5')\n .attr('cy', '5')\n .attr('r', '5')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n};\nconst cross = (elem, type) => {\n elem\n .append('marker')\n .attr('id', type + '-crossEnd')\n .attr('class', 'marker cross ' + type)\n .attr('viewBox', '0 0 11 11')\n .attr('refX', 12)\n .attr('refY', 5.2)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('path')\n // .attr('stroke', 'black')\n .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 2)\n .style('stroke-dasharray', '1,0');\n\n elem\n .append('marker')\n .attr('id', type + '-crossStart')\n .attr('class', 'marker cross ' + type)\n .attr('viewBox', '0 0 11 11')\n .attr('refX', -1)\n .attr('refY', 5.2)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('path')\n // .attr('stroke', 'black')\n .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 2)\n .style('stroke-dasharray', '1,0');\n};\nconst barb = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-barbEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 14)\n .attr('markerUnits', 'strokeWidth')\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');\n};\n\n// TODO rename the class diagram markers to something shape descriptive and semanitc free\nconst markers = {\n extension,\n composition,\n aggregation,\n dependency,\n point,\n circle,\n cross,\n barb,\n};\nexport default insertMarkers;\n","/** Decorates with functions required by mermaids dagre-wrapper. */\nimport { log } from '../logger';\nimport graphlib from 'graphlib';\n\nexport let clusterDb = {};\nlet decendants = {};\nlet parents = {};\n\nexport const clear = () => {\n decendants = {};\n parents = {};\n clusterDb = {};\n};\n\nconst isDecendant = (id, ancenstorId) => {\n // if (id === ancenstorId) return true;\n\n log.trace(\n 'In isDecendant',\n ancenstorId,\n ' ',\n id,\n ' = ',\n decendants[ancenstorId].indexOf(id) >= 0\n );\n if (decendants[ancenstorId].indexOf(id) >= 0) return true;\n\n return false;\n};\n\nconst edgeInCluster = (edge, clusterId) => {\n log.info('Decendants of ', clusterId, ' is ', decendants[clusterId]);\n log.info('Edge is ', edge);\n // Edges to/from the cluster is not in the cluster, they are in the parent\n if (edge.v === clusterId) return false;\n if (edge.w === clusterId) return false;\n\n if (!decendants[clusterId]) {\n log.debug('Tilt, ', clusterId, ',not in decendants');\n return false;\n }\n log.info('Here ');\n\n if (decendants[clusterId].indexOf(edge.v) >= 0) return true;\n if (isDecendant(edge.v, clusterId)) return true;\n if (isDecendant(edge.w, clusterId)) return true;\n if (decendants[clusterId].indexOf(edge.w) >= 0) return true;\n\n return false;\n};\n\nconst copy = (clusterId, graph, newGraph, rootId) => {\n log.warn(\n 'Copying children of ',\n clusterId,\n 'root',\n rootId,\n 'data',\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n\n // Include cluster node if it is not the root\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n\n log.warn('Copying (nodes) clusterId', clusterId, 'nodes', nodes);\n\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info('cp ', node, ' to ', rootId, ' with parent ', clusterId); //,node, data, ' parent is ', clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn('Setting parent', node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n\n if (clusterId !== rootId && node !== clusterId) {\n log.debug('Setting parent', node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info('In copy ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId);\n log.debug(\n 'Not Setting parent for node=',\n node,\n 'cluster!==rootId',\n clusterId !== rootId,\n 'node!==clusterId',\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug('Copying Edges', edges);\n edges.forEach((edge) => {\n log.info('Edge', edge);\n const data = graph.edge(edge.v, edge.w, edge.name);\n log.info('Edge data', data, rootId);\n try {\n // Do not copy edges in and out of the root cluster, they belong to the parent graph\n if (edgeInCluster(edge, rootId)) {\n log.info('Copying as ', edge.v, edge.w, data, edge.name);\n newGraph.setEdge(edge.v, edge.w, data, edge.name);\n log.info('newGraph edges ', newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n log.info(\n 'Skipping copy of edge ',\n edge.v,\n '-->',\n edge.w,\n ' rootId: ',\n rootId,\n ' clusterId:',\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug('Removing node', node);\n graph.removeNode(node);\n });\n};\nexport const extractDecendants = (id, graph) => {\n // log.debug('Extracting ', id);\n const children = graph.children(id);\n let res = [].concat(children);\n\n for (let i = 0; i < children.length; i++) {\n parents[children[i]] = id;\n res = res.concat(extractDecendants(children[i], graph));\n }\n\n return res;\n};\n\n/**\n * Validates the graph, checking that all parent child relation points to existing nodes and that\n * edges between nodes also ia correct. When not correct the function logs the discrepancies.\n *\n * @param graph\n */\nexport const validate = (graph) => {\n const edges = graph.edges();\n log.trace('Edges: ', edges);\n for (let i = 0; i < edges.length; i++) {\n if (graph.children(edges[i].v).length > 0) {\n log.trace('The node ', edges[i].v, ' is part of and edge even though it has children');\n return false;\n }\n if (graph.children(edges[i].w).length > 0) {\n log.trace('The node ', edges[i].w, ' is part of and edge even though it has children');\n return false;\n }\n }\n return true;\n};\n\n/**\n * Finds a child that is not a cluster. When faking a edge between a node and a cluster.\n *\n * @param {Finds a} id\n * @param {any} graph\n */\nexport const findNonClusterChild = (id, graph) => {\n // const node = graph.node(id);\n log.trace('Searching', id);\n // const children = graph.children(id).reverse();\n const children = graph.children(id); //.reverse();\n log.trace('Searching children of id ', id, children);\n if (children.length < 1) {\n log.trace('This is a valid node', id);\n return id;\n }\n for (let i = 0; i < children.length; i++) {\n const _id = findNonClusterChild(children[i], graph);\n if (_id) {\n log.trace('Found replacement for', id, ' => ', _id);\n return _id;\n }\n }\n};\n\nconst getAnchorId = (id) => {\n if (!clusterDb[id]) {\n return id;\n }\n // If the cluster has no external connections\n if (!clusterDb[id].externalConnections) {\n return id;\n }\n\n // Return the replacement node\n if (clusterDb[id]) {\n return clusterDb[id].id;\n }\n return id;\n};\n\nexport const adjustClustersAndEdges = (graph, depth) => {\n if (!graph || depth > 10) {\n log.debug('Opting out, no graph ');\n return;\n } else {\n log.debug('Opting in, graph ');\n }\n // Go through the nodes and for each cluster found, save a replacment node, this can be used when\n // faking a link to a cluster\n graph.nodes().forEach(function (id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n 'Cluster identified',\n id,\n ' Replacement id in edges: ',\n findNonClusterChild(id, graph)\n );\n decendants[id] = extractDecendants(id, graph);\n clusterDb[id] = { id: findNonClusterChild(id, graph), clusterData: graph.node(id) };\n }\n });\n\n // Check incoming and outgoing edges for each cluster\n graph.nodes().forEach(function (id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug('Cluster identified', id, decendants);\n edges.forEach((edge) => {\n // log.debug('Edge, decendants: ', edge, decendants[id]);\n\n // Check if any edge leaves the cluster (not the actual cluster, thats a link from the box)\n if (edge.v !== id && edge.w !== id) {\n // Any edge where either the one of the nodes is decending to the cluster but not the other\n // if (decendants[id].indexOf(edge.v) < 0 && decendants[id].indexOf(edge.w) < 0) {\n\n const d1 = isDecendant(edge.v, id);\n const d2 = isDecendant(edge.w, id);\n\n // d1 xor d2 - if either d1 is true and d2 is false or the other way around\n if (d1 ^ d2) {\n log.warn('Edge: ', edge, ' leaves cluster ', id);\n log.warn('Decendants of XXX ', id, ': ', decendants[id]);\n clusterDb[id].externalConnections = true;\n }\n }\n });\n } else {\n log.debug('Not a cluster ', id, decendants);\n }\n });\n\n // For clusters with incoming and/or outgoing edges translate those edges to a real node\n // in the cluster inorder to fake the edge\n graph.edges().forEach(function (e) {\n const edge = graph.edge(e);\n log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e));\n log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e)));\n\n let v = e.v;\n let w = e.w;\n // Check if link is either from or to a cluster\n log.warn(\n 'Fix XXX',\n clusterDb,\n 'ids:',\n e.v,\n e.w,\n 'Translateing: ',\n clusterDb[e.v],\n ' --- ',\n clusterDb[e.w]\n );\n if (clusterDb[e.v] || clusterDb[e.w]) {\n log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) edge.fromCluster = e.v;\n if (w !== e.w) edge.toCluster = e.w;\n log.warn('Fix Replacing with XXX', v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn('Adjusted Graph', graphlib.json.write(graph));\n extractor(graph, 0);\n\n log.trace(clusterDb);\n\n // Remove references to extracted cluster\n // graph.edges().forEach(edge => {\n // if (isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId)) {\n // graph.removeEdge(edge);\n // }\n // });\n};\n\nexport const extractor = (graph, depth) => {\n log.warn('extractor - ', depth, graphlib.json.write(graph), graph.children('D'));\n if (depth > 10) {\n log.error('Bailing out');\n return;\n }\n // For clusters without incoming and/or outgoing edges, create a new cluster-node\n // containing the nodes and edges in the custer in a new graph\n // for (let i = 0;)\n let nodes = graph.nodes();\n let hasChildren = false;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n\n if (!hasChildren) {\n log.debug('Done, no node has children', graph.nodes());\n return;\n }\n // const clusters = Object.keys(clusterDb);\n // clusters.forEach(clusterId => {\n log.debug('Nodes = ', nodes, depth);\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n log.debug(\n 'Extracting node',\n node,\n clusterDb,\n clusterDb[node] && !clusterDb[node].externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children('D'),\n ' Depth ',\n depth\n );\n // Note that the node might have been removed after the Object.keys call so better check\n // that it still is in the game\n if (!clusterDb[node]) {\n // Skip if the node is not a cluster\n log.debug('Not a cluster', node, depth);\n // break;\n } else if (\n !clusterDb[node].externalConnections &&\n // !graph.parent(node) &&\n graph.children(node) &&\n graph.children(node).length > 0\n ) {\n log.warn(\n 'Cluster without external connections, without a parent and with children',\n node,\n depth\n );\n\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB';\n if (clusterDb[node]) {\n if (clusterDb[node].clusterData && clusterDb[node].clusterData.dir) {\n dir = clusterDb[node].clusterData.dir;\n log.warn('Fixing dir', clusterDb[node].clusterData.dir, dir);\n }\n }\n\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: dir, // Todo: set proper spacing\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n log.warn('Old graph before copy', graphlib.json.write(graph));\n copy(node, graph, clusterGraph, node);\n graph.setNode(node, {\n clusterNode: true,\n id: node,\n clusterData: clusterDb[node].clusterData,\n labelText: clusterDb[node].labelText,\n graph: clusterGraph,\n });\n log.warn('New graph after copy node: (', node, ')', graphlib.json.write(clusterGraph));\n log.debug('Old graph after copy', graphlib.json.write(graph));\n } else {\n log.warn(\n 'Cluster ** ',\n node,\n ' **not meeting the criteria !externalConnections:',\n !clusterDb[node].externalConnections,\n ' no parent: ',\n !graph.parent(node),\n ' children ',\n graph.children(node) && graph.children(node).length > 0,\n graph.children('D'),\n depth\n );\n log.debug(clusterDb);\n }\n }\n\n nodes = graph.nodes();\n log.warn('New list of nodes', nodes);\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const data = graph.node(node);\n log.warn(' Now next level', node, data);\n if (data.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n};\n\nconst sorter = (graph, nodes) => {\n if (nodes.length === 0) return [];\n let result = Object.assign(nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = result.concat(sorted);\n });\n\n return result;\n};\n\nexport const sortNodesByHierarchy = (graph) => sorter(graph, graph.children());\n","import { select } from 'd3';\nimport { log } from '../logger'; // eslint-disable-line\nimport { labelHelper, updateNodeBounds, insertPolygonShape } from './shapes/util';\nimport { getConfig } from '../config';\nimport intersect from './intersect/index.js';\nimport createLabel from './createLabel';\nimport note from './shapes/note';\nimport { parseMember } from '../diagrams/class/svgDraw';\nimport { evaluate } from '../diagrams/common/common';\n\nconst question = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const s = w + h;\n const points = [\n { x: s / 2, y: 0 },\n { x: s, y: -s / 2 },\n { x: s / 2, y: -s },\n { x: 0, y: -s / 2 },\n ];\n\n log.info('Question main (Circle)');\n\n const questionElem = insertPolygonShape(shapeSvg, s, s, points);\n questionElem.attr('style', node.style);\n updateNodeBounds(node, questionElem);\n\n node.intersect = function (point) {\n log.warn('Intersect called');\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst choice = (parent, node) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n\n const s = 28;\n const points = [\n { x: 0, y: s / 2 },\n { x: s / 2, y: 0 },\n { x: 0, y: -s / 2 },\n { x: -s / 2, y: 0 },\n ];\n\n const choice = shapeSvg.insert('polygon', ':first-child').attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n );\n // center the circle around its coordinate\n choice.attr('class', 'state-start').attr('r', 7).attr('width', 28).attr('height', 28);\n node.width = 28;\n node.height = 28;\n\n node.intersect = function (point) {\n return intersect.circle(node, 14, point);\n };\n\n return shapeSvg;\n};\n\nconst hexagon = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const f = 4;\n const h = bbox.height + node.padding;\n const m = h / f;\n const w = bbox.width + 2 * m + node.padding;\n const points = [\n { x: m, y: 0 },\n { x: w - m, y: 0 },\n { x: w, y: -h / 2 },\n { x: w - m, y: -h },\n { x: m, y: -h },\n { x: 0, y: -h / 2 },\n ];\n\n const hex = insertPolygonShape(shapeSvg, w, h, points);\n hex.attr('style', node.style);\n updateNodeBounds(node, hex);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst rect_left_inv_arrow = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: -h / 2, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: -h / 2, y: -h },\n { x: 0, y: -h / 2 },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n\n node.width = w + h;\n node.height = h;\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst lean_right = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst lean_left = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: (2 * h) / 6, y: 0 },\n { x: w + h / 6, y: 0 },\n { x: w - (2 * h) / 6, y: -h },\n { x: -h / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst trapezoid = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w + (2 * h) / 6, y: 0 },\n { x: w - h / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst inv_trapezoid = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: h / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: (-2 * h) / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst rect_right_inv_arrow = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: 0, y: 0 },\n { x: w + h / 2, y: 0 },\n { x: w, y: -h / 2 },\n { x: w + h / 2, y: -h },\n { x: 0, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst cylinder = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = bbox.height + ry + node.padding;\n\n const shape =\n 'M 0,' +\n ry +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n -w +\n ' 0 l 0,' +\n h +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 l 0,' +\n -h;\n\n const el = shapeSvg\n .attr('label-offset-y', ry)\n .insert('path', ':first-child')\n .attr('style', node.style)\n .attr('d', shape)\n .attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')');\n\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n const pos = intersect.rect(node, point);\n const x = pos.x - node.x;\n\n if (\n rx != 0 &&\n (Math.abs(x) < node.width / 2 ||\n (Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry))\n ) {\n // ellipsis equation: x*x / a*a + y*y / b*b = 1\n // solve for y to get adjustion value for pos.y\n let y = ry * ry * (1 - (x * x) / (rx * rx));\n if (y != 0) y = Math.sqrt(y);\n y = ry - y;\n if (point.y - node.y > 0) y = -y;\n\n pos.y += y;\n }\n\n return pos;\n };\n\n return shapeSvg;\n};\n\nconst rect = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes, true);\n\n log.trace('Classes = ', node.classes);\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const totalWidth = bbox.width + node.padding;\n const totalHeight = bbox.height + node.padding;\n rect\n .attr('class', 'basic label-container')\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', -bbox.width / 2 - halfPadding)\n .attr('y', -bbox.height / 2 - halfPadding)\n .attr('width', totalWidth)\n .attr('height', totalHeight);\n\n if (node.props) {\n const propKeys = new Set(Object.keys(node.props));\n if (node.props.borders) {\n applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);\n propKeys.delete('borders');\n }\n propKeys.forEach((propKey) => {\n log.warn(`Unknown node property ${propKey}`);\n });\n }\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\n/**\n * @param rect\n * @param borders\n * @param totalWidth\n * @param totalHeight\n */\nfunction applyNodePropertyBorders(rect, borders, totalWidth, totalHeight) {\n const strokeDashArray = [];\n const addBorder = (length) => {\n strokeDashArray.push(length);\n strokeDashArray.push(0);\n };\n const skipBorder = (length) => {\n strokeDashArray.push(0);\n strokeDashArray.push(length);\n };\n if (borders.includes('t')) {\n log.debug('add top border');\n addBorder(totalWidth);\n } else {\n skipBorder(totalWidth);\n }\n if (borders.includes('r')) {\n log.debug('add right border');\n addBorder(totalHeight);\n } else {\n skipBorder(totalHeight);\n }\n if (borders.includes('b')) {\n log.debug('add bottom border');\n addBorder(totalWidth);\n } else {\n skipBorder(totalWidth);\n }\n if (borders.includes('l')) {\n log.debug('add left border');\n addBorder(totalHeight);\n } else {\n skipBorder(totalHeight);\n }\n rect.attr('stroke-dasharray', strokeDashArray.join(' '));\n}\n\nconst rectWithTitle = (parent, node) => {\n // const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes);\n\n let classes;\n if (!node.classes) {\n classes = 'node default';\n } else {\n classes = 'node ' + node.classes;\n }\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', classes)\n .attr('id', node.domId || node.id);\n\n // Create the title label and insert it after the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n // const innerRect = shapeSvg.insert('rect');\n const innerLine = shapeSvg.insert('line');\n\n const label = shapeSvg.insert('g').attr('class', 'label');\n\n const text2 = node.labelText.flat ? node.labelText.flat() : node.labelText;\n // const text2 = typeof text2prim === 'object' ? text2prim[0] : text2prim;\n\n let title = '';\n if (typeof text2 === 'object') {\n title = text2[0];\n } else {\n title = text2;\n }\n log.info('Label text abc79', title, text2, typeof text2 === 'object');\n\n const text = label.node().appendChild(createLabel(title, node.labelStyle, true, true));\n let bbox = { width: 0, height: 0 };\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n log.info('Text 2', text2);\n const textRows = text2.slice(1, text2.length);\n let titleBox = text.getBBox();\n const descr = label\n .node()\n .appendChild(\n createLabel(textRows.join ? textRows.join('<br/>') : textRows, node.labelStyle, true, true)\n );\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = descr.children[0];\n const dv = select(descr);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n // bbox = label.getBBox();\n // log.info(descr);\n const halfPadding = node.padding / 2;\n select(descr).attr(\n 'transform',\n 'translate( ' +\n // (titleBox.width - bbox.width) / 2 +\n (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) +\n ', ' +\n (titleBox.height + halfPadding + 5) +\n ')'\n );\n select(text).attr(\n 'transform',\n 'translate( ' +\n // (titleBox.width - bbox.width) / 2 +\n (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) +\n ', ' +\n 0 +\n ')'\n );\n // Get the size of the label\n\n // Bounding box for title and text\n bbox = label.node().getBBox();\n\n // Center the label\n label.attr(\n 'transform',\n 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'\n );\n\n rect\n .attr('class', 'outer title-state')\n .attr('x', -bbox.width / 2 - halfPadding)\n .attr('y', -bbox.height / 2 - halfPadding)\n .attr('width', bbox.width + node.padding)\n .attr('height', bbox.height + node.padding);\n\n innerLine\n .attr('class', 'divider')\n .attr('x1', -bbox.width / 2 - halfPadding)\n .attr('x2', bbox.width / 2 + halfPadding)\n .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding)\n .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst stadium = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const h = bbox.height + node.padding;\n const w = bbox.width + h / 4 + node.padding;\n\n // add the rect\n const rect = shapeSvg\n .insert('rect', ':first-child')\n .attr('style', node.style)\n .attr('rx', h / 2)\n .attr('ry', h / 2)\n .attr('x', -w / 2)\n .attr('y', -h / 2)\n .attr('width', w)\n .attr('height', h);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst circle = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, undefined, true);\n const circle = shapeSvg.insert('circle', ':first-child');\n\n // center the circle around its coordinate\n circle\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('r', bbox.width / 2 + halfPadding)\n .attr('width', bbox.width + node.padding)\n .attr('height', bbox.height + node.padding);\n\n log.info('Circle main');\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n log.info('Circle intersect', node, bbox.width / 2 + halfPadding, point);\n return intersect.circle(node, bbox.width / 2 + halfPadding, point);\n };\n\n return shapeSvg;\n};\n\nconst subroutine = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n { x: 0, y: 0 },\n { x: -8, y: 0 },\n { x: w + 8, y: 0 },\n { x: w + 8, y: -h },\n { x: -8, y: -h },\n { x: -8, y: 0 },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst start = (parent, node) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n const circle = shapeSvg.insert('circle', ':first-child');\n\n // center the circle around its coordinate\n circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14);\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n return intersect.circle(node, 7, point);\n };\n\n return shapeSvg;\n};\n\nconst forkJoin = (parent, node, dir) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n\n let width = 70;\n let height = 10;\n\n if (dir === 'LR') {\n width = 10;\n height = 70;\n }\n\n const shape = shapeSvg\n .append('rect')\n .attr('x', (-1 * width) / 2)\n .attr('y', (-1 * height) / 2)\n .attr('width', width)\n .attr('height', height)\n .attr('class', 'fork-join');\n\n updateNodeBounds(node, shape);\n node.height = node.height + node.padding / 2;\n node.width = node.width + node.padding / 2;\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst end = (parent, node) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n const innerCircle = shapeSvg.insert('circle', ':first-child');\n const circle = shapeSvg.insert('circle', ':first-child');\n\n circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14);\n\n innerCircle.attr('class', 'state-end').attr('r', 5).attr('width', 10).attr('height', 10);\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n return intersect.circle(node, 7, point);\n };\n\n return shapeSvg;\n};\n\nconst class_box = (parent, node) => {\n const halfPadding = node.padding / 2;\n const rowPadding = 4;\n const lineHeight = 8;\n\n let classes;\n if (!node.classes) {\n classes = 'node default';\n } else {\n classes = 'node ' + node.classes;\n }\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', classes)\n .attr('id', node.domId || node.id);\n\n // Create the title label and insert it after the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n const topLine = shapeSvg.insert('line');\n const bottomLine = shapeSvg.insert('line');\n let maxWidth = 0;\n let maxHeight = rowPadding;\n\n const labelContainer = shapeSvg.insert('g').attr('class', 'label');\n let verticalPos = 0;\n const hasInterface = node.classData.annotations && node.classData.annotations[0];\n\n // 1. Create the labels\n const interfaceLabelText = node.classData.annotations[0]\n ? '«' + node.classData.annotations[0] + '»'\n : '';\n const interfaceLabel = labelContainer\n .node()\n .appendChild(createLabel(interfaceLabelText, node.labelStyle, true, true));\n let interfaceBBox = interfaceLabel.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = interfaceLabel.children[0];\n const dv = select(interfaceLabel);\n interfaceBBox = div.getBoundingClientRect();\n dv.attr('width', interfaceBBox.width);\n dv.attr('height', interfaceBBox.height);\n }\n if (node.classData.annotations[0]) {\n maxHeight += interfaceBBox.height + rowPadding;\n maxWidth += interfaceBBox.width;\n }\n\n let classTitleString = node.classData.id;\n\n if (node.classData.type !== undefined && node.classData.type !== '') {\n if (getConfig().flowchart.htmlLabels) {\n classTitleString += '<' + node.classData.type + '>';\n } else {\n classTitleString += '<' + node.classData.type + '>';\n }\n }\n const classTitleLabel = labelContainer\n .node()\n .appendChild(createLabel(classTitleString, node.labelStyle, true, true));\n select(classTitleLabel).attr('class', 'classTitle');\n let classTitleBBox = classTitleLabel.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = classTitleLabel.children[0];\n const dv = select(classTitleLabel);\n classTitleBBox = div.getBoundingClientRect();\n dv.attr('width', classTitleBBox.width);\n dv.attr('height', classTitleBBox.height);\n }\n maxHeight += classTitleBBox.height + rowPadding;\n if (classTitleBBox.width > maxWidth) {\n maxWidth = classTitleBBox.width;\n }\n const classAttributes = [];\n node.classData.members.forEach((str) => {\n const parsedInfo = parseMember(str);\n let parsedText = parsedInfo.displayText;\n if (getConfig().flowchart.htmlLabels) {\n parsedText = parsedText.replace(/</g, '<').replace(/>/g, '>');\n }\n const lbl = labelContainer\n .node()\n .appendChild(\n createLabel(\n parsedText,\n parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,\n true,\n true\n )\n );\n let bbox = lbl.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = lbl.children[0];\n const dv = select(lbl);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n if (bbox.width > maxWidth) {\n maxWidth = bbox.width;\n }\n maxHeight += bbox.height + rowPadding;\n classAttributes.push(lbl);\n });\n\n maxHeight += lineHeight;\n\n const classMethods = [];\n node.classData.methods.forEach((str) => {\n const parsedInfo = parseMember(str);\n let displayText = parsedInfo.displayText;\n if (getConfig().flowchart.htmlLabels) {\n displayText = displayText.replace(/</g, '<').replace(/>/g, '>');\n }\n const lbl = labelContainer\n .node()\n .appendChild(\n createLabel(\n displayText,\n parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,\n true,\n true\n )\n );\n let bbox = lbl.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = lbl.children[0];\n const dv = select(lbl);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n if (bbox.width > maxWidth) {\n maxWidth = bbox.width;\n }\n maxHeight += bbox.height + rowPadding;\n\n classMethods.push(lbl);\n });\n\n maxHeight += lineHeight;\n\n // 2. Position the labels\n\n // position the interface label\n if (hasInterface) {\n let diffX = (maxWidth - interfaceBBox.width) / 2;\n select(interfaceLabel).attr(\n 'transform',\n 'translate( ' + ((-1 * maxWidth) / 2 + diffX) + ', ' + (-1 * maxHeight) / 2 + ')'\n );\n verticalPos = interfaceBBox.height + rowPadding;\n }\n // Positin the class title label\n let diffX = (maxWidth - classTitleBBox.width) / 2;\n select(classTitleLabel).attr(\n 'transform',\n 'translate( ' +\n ((-1 * maxWidth) / 2 + diffX) +\n ', ' +\n ((-1 * maxHeight) / 2 + verticalPos) +\n ')'\n );\n verticalPos += classTitleBBox.height + rowPadding;\n\n topLine\n .attr('class', 'divider')\n .attr('x1', -maxWidth / 2 - halfPadding)\n .attr('x2', maxWidth / 2 + halfPadding)\n .attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos)\n .attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos);\n\n verticalPos += lineHeight;\n\n classAttributes.forEach((lbl) => {\n select(lbl).attr(\n 'transform',\n 'translate( ' +\n -maxWidth / 2 +\n ', ' +\n ((-1 * maxHeight) / 2 + verticalPos + lineHeight / 2) +\n ')'\n );\n verticalPos += classTitleBBox.height + rowPadding;\n });\n\n verticalPos += lineHeight;\n bottomLine\n .attr('class', 'divider')\n .attr('x1', -maxWidth / 2 - halfPadding)\n .attr('x2', maxWidth / 2 + halfPadding)\n .attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos)\n .attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos);\n\n verticalPos += lineHeight;\n\n classMethods.forEach((lbl) => {\n select(lbl).attr(\n 'transform',\n 'translate( ' + -maxWidth / 2 + ', ' + ((-1 * maxHeight) / 2 + verticalPos) + ')'\n );\n verticalPos += classTitleBBox.height + rowPadding;\n });\n //\n // let bbox;\n // if (evaluate(getConfig().flowchart.htmlLabels)) {\n // const div = interfaceLabel.children[0];\n // const dv = select(interfaceLabel);\n // bbox = div.getBoundingClientRect();\n // dv.attr('width', bbox.width);\n // dv.attr('height', bbox.height);\n // }\n // bbox = labelContainer.getBBox();\n\n // log.info('Text 2', text2);\n // const textRows = text2.slice(1, text2.length);\n // let titleBox = text.getBBox();\n // const descr = label\n // .node()\n // .appendChild(createLabel(textRows.join('<br/>'), node.labelStyle, true, true));\n\n // if (evaluate(getConfig().flowchart.htmlLabels)) {\n // const div = descr.children[0];\n // const dv = select(descr);\n // bbox = div.getBoundingClientRect();\n // dv.attr('width', bbox.width);\n // dv.attr('height', bbox.height);\n // }\n // // bbox = label.getBBox();\n // // log.info(descr);\n // select(descr).attr(\n // 'transform',\n // 'translate( ' +\n // // (titleBox.width - bbox.width) / 2 +\n // (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) +\n // ', ' +\n // (titleBox.height + halfPadding + 5) +\n // ')'\n // );\n // select(text).attr(\n // 'transform',\n // 'translate( ' +\n // // (titleBox.width - bbox.width) / 2 +\n // (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) +\n // ', ' +\n // 0 +\n // ')'\n // );\n // // Get the size of the label\n\n // // Bounding box for title and text\n // bbox = label.node().getBBox();\n\n // // Center the label\n // label.attr(\n // 'transform',\n // 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'\n // );\n\n rect\n .attr('class', 'outer title-state')\n .attr('x', -maxWidth / 2 - halfPadding)\n .attr('y', -(maxHeight / 2) - halfPadding)\n .attr('width', maxWidth + node.padding)\n .attr('height', maxHeight + node.padding);\n\n // innerLine\n // .attr('class', 'divider')\n // .attr('x1', -bbox.width / 2 - halfPadding)\n // .attr('x2', bbox.width / 2 + halfPadding)\n // .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding)\n // .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst shapes = {\n question,\n rect,\n rectWithTitle,\n choice,\n circle,\n stadium,\n hexagon,\n rect_left_inv_arrow,\n lean_right,\n lean_left,\n trapezoid,\n inv_trapezoid,\n rect_right_inv_arrow,\n cylinder,\n start,\n end,\n note,\n subroutine,\n fork: forkJoin,\n join: forkJoin,\n class_box,\n};\n\nlet nodeElems = {};\n\nexport const insertNode = (elem, node, dir) => {\n let newEl;\n let el;\n\n // Add link when appropriate\n if (node.link) {\n newEl = elem\n .insert('svg:a')\n .attr('xlink:href', node.link)\n .attr('target', node.linkTarget || '_blank');\n el = shapes[node.shape](newEl, node, dir);\n } else {\n el = shapes[node.shape](elem, node, dir);\n newEl = el;\n }\n if (node.tooltip) {\n el.attr('title', node.tooltip);\n }\n if (node.class) {\n el.attr('class', 'node default ' + node.class);\n }\n\n nodeElems[node.id] = newEl;\n\n if (node.haveCallback) {\n nodeElems[node.id].attr('class', nodeElems[node.id].attr('class') + ' clickable');\n }\n};\nexport const setNodeElem = (elem, node) => {\n nodeElems[node.id] = elem;\n};\nexport const clear = () => {\n nodeElems = {};\n};\n\nexport const positionNode = (node) => {\n const el = nodeElems[node.id];\n log.trace(\n 'Transforming node',\n node.diff,\n node,\n 'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'\n );\n const padding = 8;\n const diff = node.diff || 0;\n if (node.clusterNode) {\n el.attr(\n 'transform',\n 'translate(' +\n (node.x + diff - node.width / 2) +\n ', ' +\n (node.y - node.height / 2 - padding) +\n ')'\n );\n } else {\n el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');\n }\n return diff;\n};\n","import { updateNodeBounds, labelHelper } from './util';\nimport { log } from '../../logger'; // eslint-disable-line\nimport intersect from '../intersect/index.js';\n\nconst note = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes, true);\n\n log.info('Classes = ', node.classes);\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n rect\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', -bbox.width / 2 - halfPadding)\n .attr('y', -bbox.height / 2 - halfPadding)\n .attr('width', bbox.width + node.padding)\n .attr('height', bbox.height + node.padding);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nexport default note;\n","import createLabel from '../createLabel';\nimport { getConfig } from '../../config';\nimport { decodeEntities } from '../../mermaidAPI';\nimport { select } from 'd3';\nimport { evaluate, sanitizeText } from '../../diagrams/common/common';\nexport const labelHelper = (parent, node, _classes, isNode) => {\n let classes;\n if (!_classes) {\n classes = 'node default';\n } else {\n classes = _classes;\n }\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', classes)\n .attr('id', node.domId || node.id);\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle);\n\n const labelText = typeof node.labelText === 'string' ? node.labelText : node.labelText[0];\n\n const text = label\n .node()\n .appendChild(\n createLabel(\n sanitizeText(decodeEntities(labelText), getConfig()),\n node.labelStyle,\n false,\n isNode\n )\n );\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const halfPadding = node.padding / 2;\n\n // Center the label\n label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n\n return { shapeSvg, bbox, halfPadding, label };\n};\n\nexport const updateNodeBounds = (node, element) => {\n const bbox = element.node().getBBox();\n node.width = bbox.width;\n node.height = bbox.height;\n};\n\n/**\n * @param parent\n * @param w\n * @param h\n * @param points\n */\nexport function insertPolygonShape(parent, w, h, points) {\n return parent\n .insert('polygon', ':first-child')\n .attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n )\n .attr('class', 'label-container')\n .attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');\n}\n","import theme from './themes';\n/**\n * **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click\n * here](8.6.0_docs.md)].**\n *\n * ## **What follows are config instructions for older versions**\n *\n * These are the default options which can be overridden with the initialization call like so:\n *\n * **Example 1:**<pre> mermaid.initialize({ flowchart:{ htmlLabels: false } }); </pre>\n *\n * **Example 2:**<pre> <script> var config = { startOnLoad:true, flowchart:{ useMaxWidth:true,\n * htmlLabels:true, curve:'cardinal', },\n *\n * securityLevel:'loose',\n *\n * }; mermaid.initialize(config); </script> </pre>\n *\n * A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults).\n * A description of each option follows below.\n *\n * @name Configuration\n */\nconst config = {\n /**\n * Theme , the CSS style sheet\n *\n * | Parameter | Description | Type | Required | Values |\n * | --------- | --------------- | ------ | -------- | ---------------------------------------------- |\n * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' |\n *\n * **Notes:** To disable any pre-defined mermaid theme, use \"null\".<pre> \"theme\": \"forest\",\n * \"themeCSS\": \".node rect { fill: red; }\" </pre>\n */\n theme: 'default',\n themeVariables: theme['default'].getThemeVariables(),\n themeCSS: undefined,\n /* **maxTextSize** - The maximum allowed size of the users text diamgram */\n maxTextSize: 50000,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- |\n * | fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: '\"trebuchet ms\", verdana, arial, sans-serif;'.\n */\n fontFamily: '\"trebuchet ms\", verdana, arial, sans-serif;',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------------------------------------------------- | ---------------- | -------- | ------------- |\n * | logLevel | This option decides the amount of logging to be used. | string \\| number | Required | 1, 2, 3, 4, 5 |\n *\n * **Notes:**\n *\n * - Debug: 1\n * - Info: 2\n * - Warn: 3\n * - Error: 4\n * - Fatal: 5 (default)\n */\n logLevel: 5,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | --------------------------------- | ------ | -------- | ------------------------------- |\n * | securitylevel | Level of trust for parsed diagram | string | Required | 'strict', 'loose', 'antiscript' |\n *\n * **Notes**:\n *\n * - **strict**: (**default**) tags in text are encoded, click functionality is disabled\n * - **loose**: tags in text are allowed, click functionality is enabled\n * - **antiscript**: html tags in text are allowed, (only script element is removed), click\n * functionality is enabled\n */\n securityLevel: 'strict',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | -------------------------------------------- | ------- | -------- | ----------- |\n * | startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false |\n *\n * **Notes:** Default value: true\n */\n startOnLoad: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- |\n * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false |\n *\n * **Notes**:\n *\n * This matters if you are using base tag settings.\n *\n * Default value: false\n */\n arrowMarkerAbsolute: false,\n\n /**\n * This option controls which currentConfig keys are considered *secure* and can only be changed\n * via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the\n * `secure` keys in the current currentConfig. This prevents malicious graph directives from\n * overriding a site's default security.\n *\n * **Notes**:\n *\n * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']\n */\n secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],\n\n /**\n * This option controls if the generated ids of nodes in the SVG are generated randomly or based\n * on a seed. If set to false, the IDs are generated based on the current date and thus are not\n * deterministic. This is the default behaviour.\n *\n * **Notes**:\n *\n * This matters if your files are checked into sourcecontrol e.g. git and should not change unless\n * content is changed.\n *\n * Default value: false\n */\n deterministicIds: false,\n\n /**\n * This option is the optional seed for deterministic ids. if set to undefined but\n * deterministicIds is true, a simple number iterator is used. You can set this attribute to base\n * the seed on a static string.\n */\n deterministicIDSeed: undefined,\n\n /** The object containing configurations specific for flowcharts */\n flowchart: {\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * The amount of padding around the diagram as a whole so that embedded diagrams have margins,\n * expressed in pixels\n *\n * Default value: 8\n */\n diagramPadding: 8,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- |\n * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false |\n *\n * **Notes:** Default value: true.\n */\n htmlLabels: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------------------------------------- | ------- | -------- | ------------------- |\n * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number |\n *\n * **Notes:**\n *\n * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the\n * vertical spacing for LR as well as RL graphs.**\n *\n * Default value: 50\n */\n nodeSpacing: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- |\n * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number |\n *\n * **Notes**:\n *\n * Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal\n * spacing for LR as well as RL graphs.\n *\n * Default value 50\n */\n rankSpacing: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- |\n * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' |\n *\n * **Notes:**\n *\n * Default Value: 'basis'\n */\n curve: 'basis',\n // Only used in new experimental rendering\n // represents the padding between the labels and the shape\n padding: 15,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------- | ------- | -------- | ----------------------- |\n * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |\n *\n * **Notes:**\n *\n * Decides which rendering engine that is to be used for the rendering. Legal values are:\n * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid\n *\n * Default value: 'dagre-d3'\n */\n defaultRenderer: 'dagre-d3',\n },\n\n /** The object containing configurations specific for sequence diagrams */\n sequence: {\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------------- | ------- | -------- | ------------------ |\n * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value :10\n */\n activationWidth: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n diagramMarginX: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n diagramMarginY: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------- | ------- | -------- | ------------------ |\n * | actorMargin | Margin between actors | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n actorMargin: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------- | ------- | -------- | ------------------ |\n * | width | Width of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 150\n */\n width: 150,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | --------------------- | ------- | -------- | ------------------ |\n * | height | Height of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 65\n */\n height: 65,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------------ | ------- | -------- | ------------------ |\n * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n boxMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ |\n * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 5\n */\n boxTextMargin: 5,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ------------------- | ------- | -------- | ------------------ |\n * | noteMargin | margin around notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n noteMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | ---------------------- | ------- | -------- | ------------------ |\n * | messageMargin | Space between messages | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 35\n */\n messageMargin: 35,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | --------------------------- | ------ | -------- | ------------------------- |\n * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' |\n *\n * **Notes:** Default value: 'center'\n */\n messageAlign: 'center',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | --------------------------- | ------- | -------- | ----------- |\n * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false |\n *\n * **Notes:** Default value: true\n */\n mirrorActors: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- |\n * | forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False |\n *\n * **Notes:**\n *\n * Default value: false.\n */\n forceMenus: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ |\n * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * Depending on css styling this might need adjustment.\n *\n * Default value: 1\n */\n bottomMarginAdj: 1,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:** When this flag is set to true, the height and width is set to 100% and is then\n * scaling with the available space. If set to false, the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ------------------------------------ | ------- | -------- | ----------- |\n * | rightAngles | display curve arrows as right angles | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * This will display arrows that start and begin at the same node as right angles, rather than a curve\n *\n * Default value: false\n */\n rightAngles: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------------- | ------------------------------- | ------- | -------- | ----------- |\n * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false |\n *\n * **Notes:** Default value: false\n */\n showSequenceNumbers: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | -------------------------------------------------- | ------- | -------- | ------------------ |\n * | actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value |\n *\n * **Notes:** **Default value 14**..\n */\n actorFontSize: 14,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- |\n * | actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: \"'Open-Sans\", \"sans-serif\"'\n */\n actorFontFamily: '\"Open-Sans\", \"sans-serif\"',\n\n /**\n * This sets the font weight of the actor's description\n *\n * **Notes:** Default value: 400.\n */\n actorFontWeight: 400,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | ----------------------------------------------- | ------- | -------- | ------------------ |\n * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 14\n */\n noteFontSize: 14,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- |\n * | noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: ''\"trebuchet ms\", verdana, arial, sans-serif'\n */\n noteFontFamily: '\"trebuchet ms\", verdana, arial, sans-serif',\n\n /**\n * This sets the font weight of the note's description\n *\n * **Notes:** Default value: 400\n */\n noteFontWeight: 400,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- |\n * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' |\n *\n * **Notes:** Default value: 'center'\n */\n noteAlign: 'center',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------------------------------------- | ------- | -------- | ------------------- |\n * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number |\n *\n * **Notes:** Default value: 16\n */\n messageFontSize: 16,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- |\n * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: '\"trebuchet ms\", verdana, arial, sans-serif'\n */\n messageFontFamily: '\"trebuchet ms\", verdana, arial, sans-serif',\n\n /**\n * This sets the font weight of the message's description\n *\n * **Notes:** Default value: 400.\n */\n messageFontWeight: 400,\n\n /**\n * This sets the auto-wrap state for the diagram\n *\n * **Notes:** Default value: false.\n */\n wrap: false,\n\n /**\n * This sets the auto-wrap padding for the diagram (sides only)\n *\n * **Notes:** Default value: 0.\n */\n wrapPadding: 10,\n\n /**\n * This sets the width of the loop-box (loop, alt, opt, par)\n *\n * **Notes:** Default value: 50.\n */\n labelBoxWidth: 50,\n\n /**\n * This sets the height of the loop-box (loop, alt, opt, par)\n *\n * **Notes:** Default value: 20.\n */\n labelBoxHeight: 20,\n\n messageFont: function () {\n return {\n fontFamily: this.messageFontFamily,\n fontSize: this.messageFontSize,\n fontWeight: this.messageFontWeight,\n };\n },\n noteFont: function () {\n return {\n fontFamily: this.noteFontFamily,\n fontSize: this.noteFontSize,\n fontWeight: this.noteFontWeight,\n };\n },\n actorFont: function () {\n return {\n fontFamily: this.actorFontFamily,\n fontSize: this.actorFontSize,\n fontWeight: this.actorFontWeight,\n };\n },\n },\n\n /** The object containing configurations specific for gantt diagrams */\n gantt: {\n /**\n * ### titleTopMargin\n *\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ |\n * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 25\n */\n titleTopMargin: 25,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------------------------------- | ------- | -------- | ------------------ |\n * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 20\n */\n barHeight: 20,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value |\n *\n * **Notes:** Default value: 4\n */\n barGap: 4,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n topPadding: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 75\n */\n rightPadding: 75,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 75\n */\n leftPadding: 75,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------------- | -------------------------------------------- | ------- | -------- | ------------------ |\n * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 35\n */\n gridLineStartPadding: 35,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------- | ------- | -------- | ------------------ |\n * | fontSize | Font size | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 11\n */\n fontSize: 11,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------- | ------- | -------- | ------------------ |\n * | sectionFontSize | Font size for sections | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 11\n */\n sectionFontSize: 11,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------------- | ---------------------------------------- | ------- | -------- | ------------------ |\n * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value |\n *\n * **Notes:** Default value: 4\n */\n numberSectionStyles: 4,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | --------------------------- | ---- | -------- | ---------------- |\n * | axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd |\n *\n * **Notes:**\n *\n * This might need adjustment to match your locale and preferences\n *\n * Default value: '%Y-%m-%d'.\n */\n axisFormat: '%Y-%m-%d',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------- | ------- | -------- | ----------- |\n * | topAxis | See notes | Boolean | 4 | True, False |\n *\n * **Notes:** when this flag is set date labels will be added to the top of the chart\n *\n * **Default value false**.\n */\n topAxis: false,\n\n useWidth: undefined,\n },\n\n /** The object containing configurations specific for journey diagrams */\n journey: {\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n diagramMarginX: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n diagramMarginY: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------- | ------- | -------- | ------------------ |\n * | actorMargin | Margin between actors | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n leftMargin: 150,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------- | ------- | -------- | ------------------ |\n * | width | Width of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 150\n */\n width: 150,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | --------------------- | ------- | -------- | ------------------ |\n * | height | Height of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 65\n */\n height: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------------ | ------- | -------- | ------------------ |\n * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n boxMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ |\n * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 5\n */\n boxTextMargin: 5,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ------------------- | ------- | -------- | ------------------ |\n * | noteMargin | Margin around notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n noteMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | ----------------------- | ------- | -------- | ------------------ |\n * | messageMargin | Space between messages. | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * Space between messages.\n *\n * Default value: 35\n */\n messageMargin: 35,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | --------------------------- | ---- | -------- | ------------------------- |\n * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' |\n *\n * **Notes:** Default value: 'center'\n */\n messageAlign: 'center',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ |\n * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value |\n *\n * **Notes:**\n *\n * Depending on css styling this might need adjustment.\n *\n * Default value: 1\n */\n bottomMarginAdj: 1,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------------------- | ---- | -------- | ----------- |\n * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false |\n *\n * **Notes:**\n *\n * This will display arrows that start and begin at the same node as right angles, rather than a curves\n *\n * Default value: false\n */\n rightAngles: false,\n taskFontSize: 14,\n taskFontFamily: '\"Open-Sans\", \"sans-serif\"',\n taskMargin: 50,\n // width of activation box\n activationWidth: 10,\n\n // text placement as: tspan | fo | old only text as before\n textPlacement: 'fo',\n actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'],\n\n sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'],\n sectionColours: ['#fff'],\n },\n class: {\n arrowMarkerAbsolute: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------- | ------- | -------- | ----------------------- |\n * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |\n *\n * **Notes**:\n *\n * Decides which rendering engine that is to be used for the rendering. Legal values are:\n * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid\n *\n * Default value: 'dagre-d3'\n */\n defaultRenderer: 'dagre-wrapper',\n },\n git: {\n arrowMarkerAbsolute: false,\n\n useWidth: undefined,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n },\n state: {\n dividerMargin: 10,\n sizeUnit: 5,\n padding: 8,\n textHeight: 10,\n titleShift: -15,\n noteMargin: 10,\n forkWidth: 70,\n forkHeight: 7,\n // Used\n miniPadding: 2,\n // Font size factor, this is used to guess the width of the edges labels before rendering by dagre\n // layout. This might need updating if/when switching font\n fontSizeFactor: 5.02,\n fontSize: 24,\n labelHeight: 16,\n edgeLengthFactor: '20',\n compositTitleSize: 35,\n radius: 5,\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------- | ------- | -------- | ----------------------- |\n * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |\n *\n * **Notes:**\n *\n * Decides which rendering engine that is to be used for the rendering. Legal values are:\n * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid\n *\n * Default value: 'dagre-d3'\n */\n defaultRenderer: 'dagre-wrapper',\n },\n\n /** The object containing configurations specific for entity relationship diagrams */\n er: {\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * The amount of padding around the diagram as a whole so that embedded diagrams have margins,\n * expressed in pixels\n *\n * Default value: 20\n */\n diagramPadding: 20,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------------------------- | ------ | -------- | ---------------------- |\n * | layoutDirection | Directional bias for layout of entities. | string | Required | \"TB\", \"BT\", \"LR\", \"RL\" |\n *\n * **Notes:**\n *\n * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left.\n *\n * T = top, B = bottom, L = left, and R = right.\n *\n * Default value: 'TB'\n */\n layoutDirection: 'TB',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------- | ------- | -------- | ------------------ |\n * | minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value |\n *\n * **Notes:** Expressed in pixels. Default value: 100\n */\n minEntityWidth: 100,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------------------------------- | ------- | -------- | ------------------ |\n * | minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value |\n *\n * **Notes:** Expressed in pixels Default value: 75\n */\n minEntityHeight: 75,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | ----------------------------------------------------------- | ------- | -------- | ------------------ |\n * | entityPadding | Minimum internal padding betweentext in box and box borders | Integer | 4 | Any Positive Value |\n *\n * **Notes:**\n *\n * The minimum internal padding betweentext in an entity box and the enclosing box borders,\n * expressed in pixels.\n *\n * Default value: 15\n */\n entityPadding: 15,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------------------------------- | ------ | -------- | -------------------- |\n * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color |\n *\n * **Notes:** Default value: 'gray'\n */\n stroke: 'gray',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------------- | ------ | -------- | -------------------- |\n * | fill | Fill color of entity boxes | string | 4 | Any recognized color |\n *\n * **Notes:** Default value: 'honeydew'\n */\n fill: 'honeydew',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------- | ------- | -------- | ------------------ |\n * | fontSize | Font Size in pixels | Integer | | Any Positive Value |\n *\n * **Notes:**\n *\n * Font size (expressed as an integer representing a number of pixels) Default value: 12\n */\n fontSize: 12,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * When this flag is set to true, the diagram width is locked to 100% and scaled based on\n * available space. If set to false, the diagram reserves its absolute width.\n *\n * Default value: true\n */\n useMaxWidth: true,\n },\n\n /** The object containing configurations specific for pie diagrams */\n pie: {\n useWidth: undefined,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * When this flag is set to true, the diagram width is locked to 100% and scaled based on\n * available space. If set to false, the diagram reserves its absolute width.\n *\n * Default value: true\n */\n useMaxWidth: true,\n },\n\n /** The object containing configurations specific for req diagrams */\n requirement: {\n useWidth: undefined,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * When this flag is set to true, the diagram width is locked to 100% and scaled based on\n * available space. If set to false, the diagram reserves its absolute width.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n rect_fill: '#f9f9f9',\n text_color: '#333',\n rect_border_size: '0.5px',\n rect_border_color: '#bbb',\n rect_min_width: 200,\n rect_min_height: 200,\n fontSize: 14,\n rect_padding: 10,\n line_height: 20,\n },\n};\n\nconfig.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;\nconfig.git.arrowMarkerAbsolute = config.arrowMarkerAbsolute;\n\nconst keyify = (obj, prefix = '') =>\n Object.keys(obj).reduce((res, el) => {\n if (Array.isArray(obj[el])) {\n return res;\n } else if (typeof obj[el] === 'object' && obj[el] !== null) {\n return [...res, prefix + el, ...keyify(obj[el], '')];\n }\n return [...res, prefix + el];\n }, []);\n\nexport const configKeys = keyify(config, '');\nexport default config;\n","import { select } from 'd3';\nimport { log } from '../../logger';\nimport * as configApi from '../../config';\nimport common from '../common/common';\nimport utils from '../../utils';\nimport mermaidAPI from '../../mermaidAPI';\n\nconst MERMAID_DOM_ID_PREFIX = 'classid-';\n\nlet relations = [];\nlet classes = {};\nlet classCounter = 0;\n\nlet funs = [];\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nconst splitClassNameAndType = function (id) {\n let genericType = '';\n let className = id;\n\n if (id.indexOf('~') > 0) {\n let split = id.split('~');\n className = split[0];\n\n genericType = common.sanitizeText(split[1], configApi.getConfig());\n }\n\n return { className: className, type: genericType };\n};\n\n/**\n * Function called by parser when a node definition has been found.\n *\n * @param id\n * @public\n */\nexport const addClass = function (id) {\n let classId = splitClassNameAndType(id);\n // Only add class if not exists\n if (typeof classes[classId.className] !== 'undefined') return;\n\n classes[classId.className] = {\n id: classId.className,\n type: classId.type,\n cssClasses: [],\n methods: [],\n members: [],\n annotations: [],\n domId: MERMAID_DOM_ID_PREFIX + classId.className + '-' + classCounter,\n };\n\n classCounter++;\n};\n\n/**\n * Function to lookup domId from id in the graph definition.\n *\n * @param id\n * @public\n */\nexport const lookUpDomId = function (id) {\n const classKeys = Object.keys(classes);\n for (let i = 0; i < classKeys.length; i++) {\n if (classes[classKeys[i]].id === id) {\n return classes[classKeys[i]].domId;\n }\n }\n};\n\nexport const clear = function () {\n relations = [];\n classes = {};\n funs = [];\n funs.push(setupToolTips);\n};\n\nexport const getClass = function (id) {\n return classes[id];\n};\nexport const getClasses = function () {\n return classes;\n};\n\nexport const getRelations = function () {\n return relations;\n};\n\nexport const addRelation = function (relation) {\n log.debug('Adding relation: ' + JSON.stringify(relation));\n addClass(relation.id1);\n addClass(relation.id2);\n\n relation.id1 = splitClassNameAndType(relation.id1).className;\n relation.id2 = splitClassNameAndType(relation.id2).className;\n\n relations.push(relation);\n};\n\n/**\n * Adds an annotation to the specified class Annotations mark special properties of the given type\n * (like 'interface' or 'service')\n *\n * @param className The class name\n * @param annotation The name of the annotation without any brackets\n * @public\n */\nexport const addAnnotation = function (className, annotation) {\n const validatedClassName = splitClassNameAndType(className).className;\n classes[validatedClassName].annotations.push(annotation);\n};\n\n/**\n * Adds a member to the specified class\n *\n * @param className The class name\n * @param member The full name of the member. If the member is enclosed in <<brackets>> it is\n * treated as an annotation If the member is ending with a closing bracket ) it is treated as a\n * method Otherwise the member will be treated as a normal property\n * @public\n */\nexport const addMember = function (className, member) {\n const validatedClassName = splitClassNameAndType(className).className;\n const theClass = classes[validatedClassName];\n\n if (typeof member === 'string') {\n // Member can contain white spaces, we trim them out\n const memberString = member.trim();\n\n if (memberString.startsWith('<<') && memberString.endsWith('>>')) {\n // Remove leading and trailing brackets\n theClass.annotations.push(memberString.substring(2, memberString.length - 2));\n } else if (memberString.indexOf(')') > 0) {\n theClass.methods.push(memberString);\n } else if (memberString) {\n theClass.members.push(memberString);\n }\n }\n};\n\nexport const addMembers = function (className, members) {\n if (Array.isArray(members)) {\n members.reverse();\n members.forEach((member) => addMember(className, member));\n }\n};\n\nexport const cleanupLabel = function (label) {\n if (label.substring(0, 1) === ':') {\n return common.sanitizeText(label.substr(1).trim(), configApi.getConfig());\n } else {\n return label.trim();\n }\n};\n\n/**\n * Called by parser when a special node is found, e.g. a clickable element.\n *\n * @param ids Comma separated list of ids\n * @param className Class to add\n */\nexport const setCssClass = function (ids, className) {\n ids.split(',').forEach(function (_id) {\n let id = _id;\n if (_id[0].match(/\\d/)) id = MERMAID_DOM_ID_PREFIX + id;\n if (typeof classes[id] !== 'undefined') {\n classes[id].cssClasses.push(className);\n }\n });\n};\n\n/**\n * Called by parser when a tooltip is found, e.g. a clickable element.\n *\n * @param ids Comma separated list of ids\n * @param tooltip Tooltip to add\n */\nconst setTooltip = function (ids, tooltip) {\n const config = configApi.getConfig();\n ids.split(',').forEach(function (id) {\n if (typeof tooltip !== 'undefined') {\n classes[id].tooltip = common.sanitizeText(tooltip, config);\n }\n });\n};\n\n/**\n * Called by parser when a link is found. Adds the URL to the vertex data.\n *\n * @param ids Comma separated list of ids\n * @param linkStr URL to create a link for\n * @param target Target of the link, _blank by default as originally defined in the svgDraw.js file\n */\nexport const setLink = function (ids, linkStr, target) {\n const config = configApi.getConfig();\n ids.split(',').forEach(function (_id) {\n let id = _id;\n if (_id[0].match(/\\d/)) id = MERMAID_DOM_ID_PREFIX + id;\n if (typeof classes[id] !== 'undefined') {\n classes[id].link = utils.formatUrl(linkStr, config);\n if (typeof target === 'string') {\n classes[id].linkTarget = target;\n } else {\n classes[id].linkTarget = '_blank';\n }\n }\n });\n setCssClass(ids, 'clickable');\n};\n\n/**\n * Called by parser when a click definition is found. Registers an event handler.\n *\n * @param ids Comma separated list of ids\n * @param functionName Function to be called on click\n * @param functionArgs Function args the function should be called with\n */\nexport const setClickEvent = function (ids, functionName, functionArgs) {\n ids.split(',').forEach(function (id) {\n setClickFunc(id, functionName, functionArgs);\n classes[id].haveCallback = true;\n });\n setCssClass(ids, 'clickable');\n};\n\nconst setClickFunc = function (domId, functionName, functionArgs) {\n const config = configApi.getConfig();\n let id = domId;\n let elemId = lookUpDomId(id);\n\n if (config.securityLevel !== 'loose') {\n return;\n }\n if (typeof functionName === 'undefined') {\n return;\n }\n if (typeof classes[id] !== 'undefined') {\n let argList = [];\n if (typeof functionArgs === 'string') {\n /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */\n argList = functionArgs.split(/,(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/);\n for (let i = 0; i < argList.length; i++) {\n let item = argList[i].trim();\n /* Removes all double quotes at the start and end of an argument */\n /* This preserves all starting and ending whitespace inside */\n if (item.charAt(0) === '\"' && item.charAt(item.length - 1) === '\"') {\n item = item.substr(1, item.length - 2);\n }\n argList[i] = item;\n }\n }\n\n /* if no arguments passed into callback, default to passing in id */\n if (argList.length === 0) {\n argList.push(elemId);\n }\n\n funs.push(function () {\n const elem = document.querySelector(`[id=\"${elemId}\"]`);\n if (elem !== null) {\n elem.addEventListener(\n 'click',\n function () {\n utils.runFunc(functionName, ...argList);\n },\n false\n );\n }\n });\n }\n};\n\nexport const bindFunctions = function (element) {\n funs.forEach(function (fun) {\n fun(element);\n });\n};\n\nexport const lineType = {\n LINE: 0,\n DOTTED_LINE: 1,\n};\n\nexport const relationType = {\n AGGREGATION: 0,\n EXTENSION: 1,\n COMPOSITION: 2,\n DEPENDENCY: 3,\n};\n\nconst setupToolTips = function (element) {\n let tooltipElem = select('.mermaidTooltip');\n if ((tooltipElem._groups || tooltipElem)[0][0] === null) {\n tooltipElem = select('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);\n }\n\n const svg = select(element).select('svg');\n\n const nodes = svg.selectAll('g.node');\n nodes\n .on('mouseover', function () {\n const el = select(this);\n const title = el.attr('title');\n // Dont try to draw a tooltip if no data is provided\n if (title === null) {\n return;\n }\n const rect = this.getBoundingClientRect();\n\n tooltipElem.transition().duration(200).style('opacity', '.9');\n tooltipElem\n .html(el.attr('title'))\n .style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px')\n .style('top', window.scrollY + rect.top - 14 + document.body.scrollTop + 'px');\n el.classed('hover', true);\n })\n .on('mouseout', function () {\n tooltipElem.transition().duration(500).style('opacity', 0);\n const el = select(this);\n el.classed('hover', false);\n });\n};\nfuns.push(setupToolTips);\n\nlet direction = 'TB';\nconst getDirection = () => direction;\nconst setDirection = (dir) => {\n direction = dir;\n};\n\nexport default {\n parseDirective,\n getConfig: () => configApi.getConfig().class,\n addClass,\n bindFunctions,\n clear,\n getClass,\n getClasses,\n addAnnotation,\n getRelations,\n addRelation,\n getDirection,\n setDirection,\n addMember,\n addMembers,\n cleanupLabel,\n lineType,\n relationType,\n setClickEvent,\n setCssClass,\n setLink,\n setTooltip,\n lookUpDomId,\n};\n","import { select } from 'd3';\nimport dagre from 'dagre';\nimport graphlib from 'graphlib';\nimport { log } from '../../logger';\nimport classDb, { lookUpDomId } from './classDb';\nimport { parser } from './parser/classDiagram';\nimport svgDraw from './svgDraw';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\n// import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js';\nimport { curveLinear } from 'd3';\nimport { interpolateToCurve, getStylesFromArray, configureSvgSize } from '../../utils';\nimport common from '../common/common';\n\nparser.yy = classDb;\n\nlet idCache = {};\nconst padding = 20;\n\nconst conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param {Object<\n * string,\n * { cssClasses: string[]; text: string; id: string; type: string; domId: string }\n * >} classes\n * Object containing the vertices.\n * @param {SVGGElement} g The graph that is to be drawn.\n */\nexport const addClasses = function (classes, g) {\n // const svg = select(`[id=\"${svgId}\"]`);\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n *\n * @type {string}\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n // if (vertex.classes.length > 0) {\n // classStr = vertex.classes.join(' ');\n // }\n\n const styles = { labelStyle: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;\n\n // We create a SVG label, either by delegating to addHtmlLabel or manually\n // let vertexNode;\n // if (evaluate(getConfig().flowchart.htmlLabels)) {\n // const node = {\n // label: vertexText.replace(\n // /fa[lrsb]?:fa-[\\w-]+/g,\n // s => `<i class='${s.replace(':', ' ')}'></i>`\n // )\n // };\n // vertexNode = addHtmlLabel(svg, node).node();\n // vertexNode.parentNode.removeChild(vertexNode);\n // } else {\n // const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n // svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:'));\n\n // const rows = vertexText.split(common.lineBreakRegex);\n\n // for (let j = 0; j < rows.length; j++) {\n // const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n // tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n // tspan.setAttribute('dy', '1em');\n // tspan.setAttribute('x', '1');\n // tspan.textContent = rows[j];\n // svgLabel.appendChild(tspan);\n // }\n // vertexNode = svgLabel;\n // }\n\n let radious = 0;\n let _shape = '';\n // Set the shape based parameters\n switch (vertex.type) {\n case 'class':\n _shape = 'class_box';\n break;\n default:\n _shape = 'class_box';\n }\n // Add the node\n g.setNode(vertex.id, {\n labelStyle: styles.labelStyle,\n shape: _shape,\n labelText: vertexText,\n classData: vertex,\n rx: radious,\n ry: radious,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n padding: getConfig().flowchart.padding,\n });\n\n log.info('setNode', {\n labelStyle: styles.labelStyle,\n shape: _shape,\n labelText: vertexText,\n rx: radious,\n ry: radious,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n padding: getConfig().flowchart.padding,\n });\n });\n};\n\n/**\n * Add edges to graph based on parsed graph defninition\n *\n * @param relations\n * @param {object} g The graph object\n */\nexport const addRelations = function (relations, g) {\n let cnt = 0;\n\n let defaultStyle;\n let defaultLabelStyle;\n\n // if (typeof relations.defaultStyle !== 'undefined') {\n // const defaultStyles = getStylesFromArray(relations.defaultStyle);\n // defaultStyle = defaultStyles.style;\n // defaultLabelStyle = defaultStyles.labelStyle;\n // }\n\n relations.forEach(function (edge) {\n cnt++;\n const edgeData = {};\n //Set relationship style and line type\n edgeData.classes = 'relation';\n edgeData.pattern = edge.relation.lineType == 1 ? 'dashed' : 'solid';\n\n edgeData.id = 'id' + cnt;\n // Set link type for rendering\n if (edge.type === 'arrow_open') {\n edgeData.arrowhead = 'none';\n } else {\n edgeData.arrowhead = 'normal';\n }\n\n log.info(edgeData, edge);\n //Set edge extra labels\n //edgeData.startLabelLeft = edge.relationTitle1;\n edgeData.startLabelRight = edge.relationTitle1 === 'none' ? '' : edge.relationTitle1;\n edgeData.endLabelLeft = edge.relationTitle2 === 'none' ? '' : edge.relationTitle2;\n //edgeData.endLabelRight = edge.relationTitle2;\n\n //Set relation arrow types\n edgeData.arrowTypeStart = getArrowMarker(edge.relation.type1);\n edgeData.arrowTypeEnd = getArrowMarker(edge.relation.type2);\n let style = '';\n let labelStyle = '';\n\n if (typeof edge.style !== 'undefined') {\n const styles = getStylesFromArray(edge.style);\n style = styles.style;\n labelStyle = styles.labelStyle;\n } else {\n style = 'fill:none';\n if (typeof defaultStyle !== 'undefined') {\n style = defaultStyle;\n }\n if (typeof defaultLabelStyle !== 'undefined') {\n labelStyle = defaultLabelStyle;\n }\n }\n\n edgeData.style = style;\n edgeData.labelStyle = labelStyle;\n\n if (typeof edge.interpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear);\n } else if (typeof relations.defaultInterpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(relations.defaultInterpolate, curveLinear);\n } else {\n edgeData.curve = interpolateToCurve(conf.curve, curveLinear);\n }\n\n edge.text = edge.title;\n if (typeof edge.text === 'undefined') {\n if (typeof edge.style !== 'undefined') {\n edgeData.arrowheadStyle = 'fill: #333';\n }\n } else {\n edgeData.arrowheadStyle = 'fill: #333';\n edgeData.labelpos = 'c';\n\n if (getConfig().flowchart.htmlLabels) {\n // eslint-disable-line\n edgeData.labelType = 'html';\n edgeData.label = '<span class=\"edgeLabel\">' + edge.text + '</span>';\n } else {\n edgeData.labelType = 'text';\n edgeData.label = edge.text.replace(common.lineBreakRegex, '\\n');\n\n if (typeof edge.style === 'undefined') {\n edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';\n }\n\n edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:');\n }\n }\n // Add the edge to the graph\n g.setEdge(edge.id1, edge.id2, edgeData, cnt);\n });\n};\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Merges the value of `conf` with the passed `cnf`\n *\n * @param {object} cnf Config to merge\n */\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n */\nexport const drawOld = function (text, id) {\n idCache = {};\n parser.yy.clear();\n parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n // Fetch the default direction, use TD if none was found\n const diagram = select(`[id='${id}']`);\n // insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = classDb.getClasses();\n log.info('classes:');\n log.info(classes);\n const keys = Object.keys(classes);\n for (let i = 0; i < keys.length; i++) {\n const classDef = classes[keys[i]];\n const node = svgDraw.drawClass(diagram, classDef, conf);\n idCache[node.id] = node;\n\n // Add nodes to the graph. The first argument is the node id. The second is\n // metadata about the node. In this case we're going to add labels to each of\n // our nodes.\n g.setNode(node.id, node);\n\n log.info('Org height: ' + node.height);\n }\n\n const relations = classDb.getRelations();\n log.info('relations:', relations);\n relations.forEach(function (relation) {\n log.info(\n 'tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)\n );\n g.setEdge(\n getGraphId(relation.id1),\n getGraphId(relation.id2),\n {\n relation: relation,\n },\n relation.title || 'DEFAULT'\n );\n });\n\n dagre.layout(g);\n g.nodes().forEach(function (v) {\n if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {\n log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));\n select('#' + lookUpDomId(v)).attr(\n 'transform',\n 'translate(' +\n (g.node(v).x - g.node(v).width / 2) +\n ',' +\n (g.node(v).y - g.node(v).height / 2) +\n ' )'\n );\n }\n });\n\n g.edges().forEach(function (e) {\n if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {\n log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));\n svgDraw.drawEdge(diagram, g.edge(e), g.edge(e).relation, conf);\n }\n });\n\n const svgBounds = diagram.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n\n configureSvgSize(diagram, height, width, conf.useMaxWidth);\n\n // Ensure the viewBox includes the whole svgBounds area with extra space for padding\n const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;\n log.debug(`viewBox ${vBox}`);\n diagram.attr('viewBox', vBox);\n};\n\nexport const draw = function (text, id) {\n log.info('Drawing class');\n classDb.clear();\n // const parser = classDb.parser;\n // parser.yy = classDb;\n\n // Parse the graph definition\n // try {\n parser.parse(text);\n // } catch (err) {\n // log.debug('Parsing failed');\n // }\n\n // Fetch the default direction, use TD if none was found\n //let dir = 'TD';\n\n const conf = getConfig().flowchart;\n log.info('config:', conf);\n const nodeSpacing = conf.nodeSpacing || 50;\n const rankSpacing = conf.rankSpacing || 50;\n\n // Create the input mermaid.graph\n const g = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: classDb.getDirection(),\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n // let subG;\n // const subGraphs = flowDb.getSubGraphs();\n // log.info('Subgraphs - ', subGraphs);\n // for (let i = subGraphs.length - 1; i >= 0; i--) {\n // subG = subGraphs[i];\n // log.info('Subgraph - ', subG);\n // flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes);\n // }\n\n // Fetch the verices/nodes and edges/links from the parsed graph definition\n const classes = classDb.getClasses();\n const relations = classDb.getRelations();\n\n log.info(relations);\n // let i = 0;\n // for (i = subGraphs.length - 1; i >= 0; i--) {\n // subG = subGraphs[i];\n\n // selectAll('cluster').append('text');\n\n // for (let j = 0; j < subG.nodes.length; j++) {\n // g.setParent(subG.nodes[j], subG.id);\n // }\n // }\n addClasses(classes, g, id);\n addRelations(relations, g);\n\n // Add custom shapes\n // flowChartShapes.addToRenderV2(addShape);\n\n // Set up an SVG group so that we can translate the final graph.\n const svg = select(`[id=\"${id}\"]`);\n svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n // Run the renderer. This is what draws the final graph.\n const element = select('#' + id + ' g');\n render(element, g, ['aggregation', 'extension', 'composition', 'dependency'], 'classDiagram', id);\n\n // element.selectAll('g.node').attr('title', function() {\n // return flowDb.getTooltip(this.id);\n // });\n\n const padding = 8;\n const svgBounds = svg.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n log.debug(\n `new ViewBox 0 0 ${width} ${height}`,\n `translate(${padding - g._label.marginx}, ${padding - g._label.marginy})`\n );\n\n configureSvgSize(svg, height, width, conf.useMaxWidth);\n\n svg.attr('viewBox', `0 0 ${width} ${height}`);\n svg\n .select('g')\n .attr('transform', `translate(${padding - g._label.marginx}, ${padding - svgBounds.y})`);\n\n // Index nodes\n // flowDb.indexNodes('subGraph' + i);\n\n // Add label rects for non html labels\n if (!conf.htmlLabels) {\n const labels = document.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n for (let k = 0; k < labels.length; k++) {\n const label = labels[k];\n\n // Get dimensions of label\n const dim = label.getBBox();\n\n const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n // rect.setAttribute('style', 'fill:#e8e8e8;');\n\n label.insertBefore(rect, label.firstChild);\n }\n }\n\n // If node has a link, wrap it in an anchor SVG object.\n // const keys = Object.keys(classes);\n // keys.forEach(function(key) {\n // const vertex = classes[key];\n\n // if (vertex.link) {\n // const node = select('#' + id + ' [id=\"' + key + '\"]');\n // if (node) {\n // const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');\n // link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));\n // link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);\n // link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');\n\n // const linkNode = node.insert(function() {\n // return link;\n // }, ':first-child');\n\n // const shape = node.select('.label-container');\n // if (shape) {\n // linkNode.append(function() {\n // return shape.node();\n // });\n // }\n\n // const label = node.select('.label');\n // if (label) {\n // linkNode.append(function() {\n // return label.node();\n // });\n // }\n // }\n // }\n // });\n};\n\n/**\n * Gets the arrow marker for a type index\n *\n * @param {number} type The type to look for\n * @returns {'aggregation' | 'extension' | 'composition' | 'dependency'} The arrow marker\n */\nfunction getArrowMarker(type) {\n let marker;\n switch (type) {\n case 0:\n marker = 'aggregation';\n break;\n case 1:\n marker = 'extension';\n break;\n case 2:\n marker = 'composition';\n break;\n case 3:\n marker = 'dependency';\n break;\n default:\n marker = 'none';\n }\n return marker;\n}\n\nexport default {\n setConf,\n draw,\n};\n","import { select } from 'd3';\nimport dagre from 'dagre';\nimport graphlib from 'graphlib';\nimport { log } from '../../logger';\nimport classDb, { lookUpDomId } from './classDb';\nimport { parser } from './parser/classDiagram';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../utils';\n\nparser.yy = classDb;\n\nlet idCache = {};\nconst padding = 20;\n\nconst conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n};\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Merges the value of `conf` with the passed `cnf`\n *\n * @param {object} cnf Config to merge\n */\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n */\nexport const draw = function (text, id) {\n idCache = {};\n parser.yy.clear();\n parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n // Fetch the default direction, use TD if none was found\n const diagram = select(`[id='${id}']`);\n diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = classDb.getClasses();\n const keys = Object.keys(classes);\n\n for (let i = 0; i < keys.length; i++) {\n const classDef = classes[keys[i]];\n const node = svgDraw.drawClass(diagram, classDef, conf);\n idCache[node.id] = node;\n\n // Add nodes to the graph. The first argument is the node id. The second is\n // metadata about the node. In this case we're going to add labels to each of\n // our nodes.\n g.setNode(node.id, node);\n\n log.info('Org height: ' + node.height);\n }\n\n const relations = classDb.getRelations();\n relations.forEach(function (relation) {\n log.info(\n 'tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)\n );\n g.setEdge(\n getGraphId(relation.id1),\n getGraphId(relation.id2),\n {\n relation: relation,\n },\n relation.title || 'DEFAULT'\n );\n });\n\n dagre.layout(g);\n g.nodes().forEach(function (v) {\n if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {\n log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));\n select('#' + lookUpDomId(v)).attr(\n 'transform',\n 'translate(' +\n (g.node(v).x - g.node(v).width / 2) +\n ',' +\n (g.node(v).y - g.node(v).height / 2) +\n ' )'\n );\n }\n });\n\n g.edges().forEach(function (e) {\n if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {\n log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));\n svgDraw.drawEdge(diagram, g.edge(e), g.edge(e).relation, conf);\n }\n });\n\n const svgBounds = diagram.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n\n configureSvgSize(diagram, height, width, conf.useMaxWidth);\n\n // Ensure the viewBox includes the whole svgBounds area with extra space for padding\n const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;\n log.debug(`viewBox ${vBox}`);\n diagram.attr('viewBox', vBox);\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `g.classGroup text {\n fill: ${options.nodeBorder};\n fill: ${options.classText};\n stroke: none;\n font-family: ${options.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${options.classText};\n}\n.edgeLabel .label rect {\n fill: ${options.mainBkg};\n}\n.label text {\n fill: ${options.classText};\n}\n.edgeLabel .label span {\n background: ${options.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${options.nodeBorder};\n stroke: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${options.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${options.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${options.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${options.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n#compositionStart, .composition {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ${options.mainBkg} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ${options.mainBkg} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n`;\n\nexport default getStyles;\n","import { line, curveBasis } from 'd3';\nimport { lookUpDomId, relationType } from './classDb';\nimport utils from '../../utils';\nimport { log } from '../../logger';\n\nlet edgeCount = 0;\nexport const drawEdge = function (elem, path, relation, conf) {\n const getRelationType = function (type) {\n switch (type) {\n case relationType.AGGREGATION:\n return 'aggregation';\n case relationType.EXTENSION:\n return 'extension';\n case relationType.COMPOSITION:\n return 'composition';\n case relationType.DEPENDENCY:\n return 'dependency';\n }\n };\n\n path.points = path.points.filter((p) => !Number.isNaN(p.y));\n\n // The data for our line\n const lineData = path.points;\n\n // This is the accessor function we talked about above\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curveBasis);\n\n const svgPath = elem\n .append('path')\n .attr('d', lineFunction(lineData))\n .attr('id', 'edge' + edgeCount)\n .attr('class', 'relation');\n let url = '';\n if (conf.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n if (relation.relation.lineType == 1) {\n svgPath.attr('class', 'relation dashed-line');\n }\n if (relation.relation.type1 !== 'none') {\n svgPath.attr(\n 'marker-start',\n 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')'\n );\n }\n if (relation.relation.type2 !== 'none') {\n svgPath.attr(\n 'marker-end',\n 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')'\n );\n }\n\n let x, y;\n const l = path.points.length;\n // Calculate Label position\n let labelPosition = utils.calcLabelPosition(path.points);\n x = labelPosition.x;\n y = labelPosition.y;\n\n let p1_card_x, p1_card_y;\n let p2_card_x, p2_card_y;\n\n if (l % 2 !== 0 && l > 1) {\n let cardinality_1_point = utils.calcCardinalityPosition(\n relation.relation.type1 !== 'none',\n path.points,\n path.points[0]\n );\n let cardinality_2_point = utils.calcCardinalityPosition(\n relation.relation.type2 !== 'none',\n path.points,\n path.points[l - 1]\n );\n\n log.debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point));\n log.debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point));\n\n p1_card_x = cardinality_1_point.x;\n p1_card_y = cardinality_1_point.y;\n p2_card_x = cardinality_2_point.x;\n p2_card_y = cardinality_2_point.y;\n }\n\n if (typeof relation.title !== 'undefined') {\n const g = elem.append('g').attr('class', 'classLabel');\n const label = g\n .append('text')\n .attr('class', 'label')\n .attr('x', x)\n .attr('y', y)\n .attr('fill', 'red')\n .attr('text-anchor', 'middle')\n .text(relation.title);\n\n window.label = label;\n const bounds = label.node().getBBox();\n\n g.insert('rect', ':first-child')\n .attr('class', 'box')\n .attr('x', bounds.x - conf.padding / 2)\n .attr('y', bounds.y - conf.padding / 2)\n .attr('width', bounds.width + conf.padding)\n .attr('height', bounds.height + conf.padding);\n }\n\n log.info('Rendering relation ' + JSON.stringify(relation));\n if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') {\n const g = elem.append('g').attr('class', 'cardinality');\n g.append('text')\n .attr('class', 'type1')\n .attr('x', p1_card_x)\n .attr('y', p1_card_y)\n .attr('fill', 'black')\n .attr('font-size', '6')\n .text(relation.relationTitle1);\n }\n if (typeof relation.relationTitle2 !== 'undefined' && relation.relationTitle2 !== 'none') {\n const g = elem.append('g').attr('class', 'cardinality');\n g.append('text')\n .attr('class', 'type2')\n .attr('x', p2_card_x)\n .attr('y', p2_card_y)\n .attr('fill', 'black')\n .attr('font-size', '6')\n .text(relation.relationTitle2);\n }\n\n edgeCount++;\n};\n\n/**\n * Renders a class diagram\n *\n * @param {SVGSVGElement} elem The element to draw it into\n * @param classDef\n * @param conf\n * @todo Add more information in the JSDOC here\n */\nexport const drawClass = function (elem, classDef, conf) {\n log.info('Rendering class ' + classDef);\n\n const id = classDef.id;\n const classInfo = {\n id: id,\n label: classDef.id,\n width: 0,\n height: 0,\n };\n\n // add class group\n const g = elem.append('g').attr('id', lookUpDomId(id)).attr('class', 'classGroup');\n\n // add title\n let title;\n if (classDef.link) {\n title = g\n .append('svg:a')\n .attr('xlink:href', classDef.link)\n .attr('target', classDef.linkTarget)\n .append('text')\n .attr('y', conf.textHeight + conf.padding)\n .attr('x', 0);\n } else {\n title = g\n .append('text')\n .attr('y', conf.textHeight + conf.padding)\n .attr('x', 0);\n }\n\n // add annotations\n let isFirst = true;\n classDef.annotations.forEach(function (member) {\n const titleText2 = title.append('tspan').text('«' + member + '»');\n if (!isFirst) titleText2.attr('dy', conf.textHeight);\n isFirst = false;\n });\n\n let classTitleString = classDef.id;\n\n if (classDef.type !== undefined && classDef.type !== '') {\n classTitleString += '<' + classDef.type + '>';\n }\n\n const classTitle = title.append('tspan').text(classTitleString).attr('class', 'title');\n\n // If class has annotations the title needs to have an offset of the text height\n if (!isFirst) classTitle.attr('dy', conf.textHeight);\n\n const titleHeight = title.node().getBBox().height;\n\n const membersLine = g\n .append('line') // text label for the x axis\n .attr('x1', 0)\n .attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2)\n .attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);\n\n const members = g\n .append('text') // text label for the x axis\n .attr('x', conf.padding)\n .attr('y', titleHeight + conf.dividerMargin + conf.textHeight)\n .attr('fill', 'white')\n .attr('class', 'classText');\n\n isFirst = true;\n classDef.members.forEach(function (member) {\n addTspan(members, member, isFirst, conf);\n isFirst = false;\n });\n\n const membersBox = members.node().getBBox();\n\n const methodsLine = g\n .append('line') // text label for the x axis\n .attr('x1', 0)\n .attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height)\n .attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);\n\n const methods = g\n .append('text') // text label for the x axis\n .attr('x', conf.padding)\n .attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight)\n .attr('fill', 'white')\n .attr('class', 'classText');\n\n isFirst = true;\n\n classDef.methods.forEach(function (method) {\n addTspan(methods, method, isFirst, conf);\n isFirst = false;\n });\n\n const classBox = g.node().getBBox();\n var cssClassStr = ' ';\n\n if (classDef.cssClasses.length > 0) {\n cssClassStr = cssClassStr + classDef.cssClasses.join(' ');\n }\n\n const rect = g\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', classBox.width + 2 * conf.padding)\n .attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin)\n .attr('class', cssClassStr);\n\n const rectWidth = rect.node().getBBox().width;\n\n // Center title\n // We subtract the width of each text element from the class box width and divide it by 2\n title.node().childNodes.forEach(function (x) {\n x.setAttribute('x', (rectWidth - x.getBBox().width) / 2);\n });\n\n if (classDef.tooltip) {\n title.insert('title').text(classDef.tooltip);\n }\n\n membersLine.attr('x2', rectWidth);\n methodsLine.attr('x2', rectWidth);\n\n classInfo.width = rectWidth;\n classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;\n\n return classInfo;\n};\n\nexport const parseMember = function (text) {\n const fieldRegEx = /^(\\+|-|~|#)?(\\w+)(~\\w+~|\\[\\])?\\s+(\\w+) *(\\*|\\$)?$/;\n const methodRegEx = /^([+|\\-|~|#])?(\\w+) *\\( *(.*)\\) *(\\*|\\$)? *(\\w*[~|[\\]]*\\s*\\w*~?)$/;\n\n let fieldMatch = text.match(fieldRegEx);\n let methodMatch = text.match(methodRegEx);\n\n if (fieldMatch && !methodMatch) {\n return buildFieldDisplay(fieldMatch);\n } else if (methodMatch) {\n return buildMethodDisplay(methodMatch);\n } else {\n return buildLegacyDisplay(text);\n }\n};\n\nconst buildFieldDisplay = function (parsedText) {\n let cssStyle = '';\n let displayText = '';\n\n try {\n let visibility = parsedText[1] ? parsedText[1].trim() : '';\n let fieldType = parsedText[2] ? parsedText[2].trim() : '';\n let genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : '';\n let fieldName = parsedText[4] ? parsedText[4].trim() : '';\n let classifier = parsedText[5] ? parsedText[5].trim() : '';\n\n displayText = visibility + fieldType + genericType + ' ' + fieldName;\n cssStyle = parseClassifier(classifier);\n } catch (err) {\n displayText = parsedText;\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\nconst buildMethodDisplay = function (parsedText) {\n let cssStyle = '';\n let displayText = '';\n\n try {\n let visibility = parsedText[1] ? parsedText[1].trim() : '';\n let methodName = parsedText[2] ? parsedText[2].trim() : '';\n let parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : '';\n let classifier = parsedText[4] ? parsedText[4].trim() : '';\n let returnType = parsedText[5] ? ' : ' + parseGenericTypes(parsedText[5]).trim() : '';\n\n displayText = visibility + methodName + '(' + parameters + ')' + returnType;\n cssStyle = parseClassifier(classifier);\n } catch (err) {\n displayText = parsedText;\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\nconst buildLegacyDisplay = function (text) {\n // if for some reason we dont have any match, use old format to parse text\n let displayText = '';\n let cssStyle = '';\n let memberText = '';\n let returnType = '';\n let methodStart = text.indexOf('(');\n let methodEnd = text.indexOf(')');\n\n if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text.length) {\n let visibility = '';\n let methodName = '';\n\n let firstChar = text.substring(0, 1);\n if (firstChar.match(/\\w/)) {\n methodName = text.substring(0, methodStart).trim();\n } else {\n if (firstChar.match(/\\+|-|~|#/)) {\n visibility = firstChar;\n }\n\n methodName = text.substring(1, methodStart).trim();\n }\n\n let parameters = text.substring(methodStart + 1, methodEnd);\n let classifier = text.substring(methodEnd + 1, 1);\n cssStyle = parseClassifier(classifier);\n\n displayText = visibility + methodName + '(' + parseGenericTypes(parameters.trim()) + ')';\n\n if (methodEnd < memberText.length) {\n returnType = text.substring(methodEnd + 2).trim();\n if (returnType !== '') {\n returnType = ' : ' + parseGenericTypes(returnType);\n }\n }\n } else {\n // finally - if all else fails, just send the text back as written (other than parsing for generic types)\n displayText = parseGenericTypes(text);\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\n/**\n * Adds a <tspan> for a member in a diagram\n *\n * @param {SVGElement} textEl The element to append to\n * @param {string} txt The member\n * @param {boolean} isFirst\n * @param {{ padding: string; textHeight: string }} conf The configuration for the member\n */\nconst addTspan = function (textEl, txt, isFirst, conf) {\n let member = parseMember(txt);\n\n const tSpan = textEl.append('tspan').attr('x', conf.padding).text(member.displayText);\n\n if (member.cssStyle !== '') {\n tSpan.attr('style', member.cssStyle);\n }\n\n if (!isFirst) {\n tSpan.attr('dy', conf.textHeight);\n }\n};\n\n/**\n * Makes generics in typescript syntax\n *\n * @example <caption>Array of array of strings in typescript syntax</caption>\n * // returns \"Array<Array<string>>\"\n * parseGenericTypes('Array~Array~string~~');\n *\n * @param {string} text The text to convert\n * @returns {string} The converted string\n */\nconst parseGenericTypes = function (text) {\n let cleanedText = text;\n\n if (text.indexOf('~') != -1) {\n cleanedText = cleanedText.replace('~', '<');\n cleanedText = cleanedText.replace('~', '>');\n\n return parseGenericTypes(cleanedText);\n } else {\n return cleanedText;\n }\n};\n\n/**\n * Gives the styles for a classifier\n *\n * @param {'+' | '-' | '#' | '~' | '*' | '$'} classifier The classifier string\n * @returns {string} Styling for the classifier\n */\nconst parseClassifier = function (classifier) {\n switch (classifier) {\n case '*':\n return 'font-style:italic;';\n case '$':\n return 'text-decoration:underline;';\n default:\n return '';\n }\n};\n\nexport default {\n drawClass,\n drawEdge,\n parseMember,\n};\n","import DOMPurify from 'dompurify';\n\n/**\n * Gets the number of lines in a string\n *\n * @param {string | undefined} s The string to check the lines for\n * @returns {number} The number of lines in that string\n */\nexport const getRows = (s) => {\n if (!s) return 1;\n let str = breakToPlaceholder(s);\n str = str.replace(/\\\\n/g, '#br#');\n return str.split('#br#');\n};\n\n/**\n * Removes script tags from a text\n *\n * @param {string} txt The text to sanitize\n * @returns {string} The safer text\n */\nexport const removeScript = (txt) => {\n var rs = '';\n var idx = 0;\n\n while (idx >= 0) {\n idx = txt.indexOf('<script');\n if (idx >= 0) {\n rs += txt.substr(0, idx);\n txt = txt.substr(idx + 1);\n\n idx = txt.indexOf('</script>');\n if (idx >= 0) {\n idx += 9;\n txt = txt.substr(idx);\n }\n } else {\n rs += txt;\n idx = -1;\n break;\n }\n }\n\n rs = rs.replace(/script>/gi, '#');\n rs = rs.replace(/script>/gi, '#');\n rs = rs.replace(/javascript:/gi, '#');\n rs = rs.replace(/onerror=/gi, 'onerror:');\n rs = rs.replace(/<iframe/gi, '');\n return rs;\n};\n\nconst sanitizeMore = (text, config) => {\n let txt = text;\n let htmlLabels = true;\n if (\n config.flowchart &&\n (config.flowchart.htmlLabels === false || config.flowchart.htmlLabels === 'false')\n ) {\n htmlLabels = false;\n }\n\n if (htmlLabels) {\n const level = config.securityLevel;\n\n if (level === 'antiscript') {\n txt = removeScript(txt);\n } else if (level !== 'loose') {\n // eslint-disable-line\n txt = breakToPlaceholder(txt);\n txt = txt.replace(/</g, '<').replace(/>/g, '>');\n txt = txt.replace(/=/g, '=');\n txt = placeholderToBreak(txt);\n }\n }\n\n return txt;\n};\n\nexport const sanitizeText = (text, config) => {\n if (!text) return text;\n const txt = DOMPurify.sanitize(sanitizeMore(text, config));\n return txt;\n};\n\nexport const sanitizeTextOrArray = (a, config) => {\n if (typeof a === 'string') return sanitizeText(a, config);\n\n const f = (x) => sanitizeText(x, config);\n return a.flat().map(f);\n};\n\nexport const lineBreakRegex = /<br\\s*\\/?>/gi;\n\n/**\n * Whether or not a text has any linebreaks\n *\n * @param {string} text The text to test\n * @returns {boolean} Whether or not the text has breaks\n */\nexport const hasBreaks = (text) => {\n return lineBreakRegex.test(text);\n};\n\n/**\n * Splits on <br> tags\n *\n * @param {string} text Text to split\n * @returns {string[]} List of lines as strings\n */\nexport const splitBreaks = (text) => {\n return text.split(lineBreakRegex);\n};\n\n/**\n * Converts placeholders to linebreaks in HTML\n *\n * @param {string} s HTML with placeholders\n * @returns {string} HTML with breaks instead of placeholders\n */\nconst placeholderToBreak = (s) => {\n return s.replace(/#br#/g, '<br/>');\n};\n\n/**\n * Opposite of `placeholderToBreak`, converts breaks to placeholders\n *\n * @param {string} s HTML string\n * @returns {string} String with placeholders\n */\nconst breakToPlaceholder = (s) => {\n return s.replace(lineBreakRegex, '#br#');\n};\n\n/**\n * Gets the current URL\n *\n * @param {boolean} useAbsolute Whether to return the absolute URL or not\n * @returns {string} The current URL\n */\nconst getUrl = (useAbsolute) => {\n let url = '';\n if (useAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n return url;\n};\n\n/**\n * Converts a string/boolean into a boolean\n *\n * @param {string | boolean} val String or boolean to convert\n * @returns {boolean} The result from the input\n */\nexport const evaluate = (val) => (val === 'false' || val === false ? false : true);\n\nexport default {\n getRows,\n sanitizeText,\n sanitizeTextOrArray,\n hasBreaks,\n splitBreaks,\n lineBreakRegex,\n removeScript,\n getUrl,\n evaluate,\n};\n","import { log } from '../../logger';\nimport mermaidAPI from '../../mermaidAPI';\nimport * as configApi from '../../config';\n\nlet entities = {};\nlet relationships = [];\nlet title = '';\n\nconst Cardinality = {\n ZERO_OR_ONE: 'ZERO_OR_ONE',\n ZERO_OR_MORE: 'ZERO_OR_MORE',\n ONE_OR_MORE: 'ONE_OR_MORE',\n ONLY_ONE: 'ONLY_ONE',\n};\n\nconst Identification = {\n NON_IDENTIFYING: 'NON_IDENTIFYING',\n IDENTIFYING: 'IDENTIFYING',\n};\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nconst addEntity = function (name) {\n if (typeof entities[name] === 'undefined') {\n entities[name] = { attributes: [] };\n log.info('Added new entity :', name);\n }\n\n return entities[name];\n};\n\nconst getEntities = () => entities;\n\nconst addAttributes = function (entityName, attribs) {\n let entity = addEntity(entityName); // May do nothing (if entity has already been added)\n\n // Process attribs in reverse order due to effect of recursive construction (last attribute is first)\n let i;\n for (i = attribs.length - 1; i >= 0; i--) {\n entity.attributes.push(attribs[i]);\n log.debug('Added attribute ', attribs[i].attributeName);\n }\n};\n\n/**\n * Add a relationship\n *\n * @param entA The first entity in the relationship\n * @param rolA The role played by the first entity in relation to the second\n * @param entB The second entity in the relationship\n * @param rSpec The details of the relationship between the two entities\n */\nconst addRelationship = function (entA, rolA, entB, rSpec) {\n let rel = {\n entityA: entA,\n roleA: rolA,\n entityB: entB,\n relSpec: rSpec,\n };\n\n relationships.push(rel);\n log.debug('Added new relationship :', rel);\n};\n\nconst getRelationships = () => relationships;\n\n// Keep this - TODO: revisit...allow the diagram to have a title\nconst setTitle = function (txt) {\n title = txt;\n};\n\nconst getTitle = function () {\n return title;\n};\n\nconst clear = function () {\n entities = {};\n relationships = [];\n title = '';\n};\n\nexport default {\n Cardinality,\n Identification,\n parseDirective,\n getConfig: () => configApi.getConfig().er,\n addEntity,\n addAttributes,\n getEntities,\n addRelationship,\n getRelationships,\n clear,\n setTitle,\n getTitle,\n};\n","const ERMarkers = {\n ONLY_ONE_START: 'ONLY_ONE_START',\n ONLY_ONE_END: 'ONLY_ONE_END',\n ZERO_OR_ONE_START: 'ZERO_OR_ONE_START',\n ZERO_OR_ONE_END: 'ZERO_OR_ONE_END',\n ONE_OR_MORE_START: 'ONE_OR_MORE_START',\n ONE_OR_MORE_END: 'ONE_OR_MORE_END',\n ZERO_OR_MORE_START: 'ZERO_OR_MORE_START',\n ZERO_OR_MORE_END: 'ZERO_OR_MORE_END',\n};\n\n/**\n * Put the markers into the svg DOM for later use with edge paths\n *\n * @param elem\n * @param conf\n */\nconst insertMarkers = function (elem, conf) {\n let marker;\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONLY_ONE_START)\n .attr('refX', 0)\n .attr('refY', 9)\n .attr('markerWidth', 18)\n .attr('markerHeight', 18)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M9,0 L9,18 M15,0 L15,18');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONLY_ONE_END)\n .attr('refX', 18)\n .attr('refY', 9)\n .attr('markerWidth', 18)\n .attr('markerHeight', 18)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M3,0 L3,18 M9,0 L9,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_ONE_START)\n .attr('refX', 0)\n .attr('refY', 9)\n .attr('markerWidth', 30)\n .attr('markerHeight', 18)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 21)\n .attr('cy', 9)\n .attr('r', 6);\n marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M9,0 L9,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_ONE_END)\n .attr('refX', 30)\n .attr('refY', 9)\n .attr('markerWidth', 30)\n .attr('markerHeight', 18)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 9)\n .attr('cy', 9)\n .attr('r', 6);\n marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M21,0 L21,18');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONE_OR_MORE_START)\n .attr('refX', 18)\n .attr('refY', 18)\n .attr('markerWidth', 45)\n .attr('markerHeight', 36)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONE_OR_MORE_END)\n .attr('refX', 27)\n .attr('refY', 18)\n .attr('markerWidth', 45)\n .attr('markerHeight', 36)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_MORE_START)\n .attr('refX', 18)\n .attr('refY', 18)\n .attr('markerWidth', 57)\n .attr('markerHeight', 36)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 48)\n .attr('cy', 18)\n .attr('r', 6);\n marker\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M0,18 Q18,0 36,18 Q18,36 0,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_MORE_END)\n .attr('refX', 39)\n .attr('refY', 18)\n .attr('markerWidth', 57)\n .attr('markerHeight', 36)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 9)\n .attr('cy', 18)\n .attr('r', 6);\n marker\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M21,18 Q39,0 57,18 Q39,36 21,18');\n\n return;\n};\n\nexport default {\n ERMarkers,\n insertMarkers,\n};\n","import graphlib from 'graphlib';\nimport { line, curveBasis, select } from 'd3';\nimport erDb from './erDb';\nimport erParser from './parser/erDiagram';\nimport dagre from 'dagre';\nimport { getConfig } from '../../config';\nimport { log } from '../../logger';\nimport erMarkers from './erMarkers';\nimport { configureSvgSize } from '../../utils';\n\nconst conf = {};\n\n/**\n * Allows the top-level API module to inject config specific to this renderer, storing it in the\n * local conf object. Note that generic config still needs to be retrieved using getConfig()\n * imported from the config module\n *\n * @param cnf\n */\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n for (let i = 0; i < keys.length; i++) {\n conf[keys[i]] = cnf[keys[i]];\n }\n};\n\n/**\n * Draw attributes for an entity\n *\n * @param groupNode The svg group node for the entity\n * @param entityTextNode The svg node for the entity label text\n * @param attributes An array of attributes defined for the entity (each attribute has a type and a name)\n * @returns The bounding box of the entity, after attributes have been added\n */\nconst drawAttributes = (groupNode, entityTextNode, attributes) => {\n const heightPadding = conf.entityPadding / 3; // Padding internal to attribute boxes\n const widthPadding = conf.entityPadding / 3; // Ditto\n const attrFontSize = conf.fontSize * 0.85;\n const labelBBox = entityTextNode.node().getBBox();\n const attributeNodes = []; // Intermediate storage for attribute nodes created so that we can do a second pass\n let hasKeyType = false;\n let hasComment = false;\n let maxWidth = 0;\n let maxTypeWidth = 0;\n let maxNameWidth = 0;\n let maxKeyWidth = 0;\n let maxCommentWidth = 0;\n let cumulativeHeight = labelBBox.height + heightPadding * 2;\n let attrNum = 1;\n\n attributes.forEach((item) => {\n const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`;\n let nodeWidth = 0;\n let nodeHeight = 0;\n\n // Add a text node for the attribute type\n const typeNode = groupNode\n .append('text')\n .attr('class', 'er entityLabel')\n .attr('id', `${attrPrefix}-type`)\n .attr('x', 0)\n .attr('y', 0)\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'left')\n .attr(\n 'style',\n 'font-family: ' + getConfig().fontFamily + '; font-size: ' + attrFontSize + 'px'\n )\n .text(item.attributeType);\n\n // Add a text node for the attribute name\n const nameNode = groupNode\n .append('text')\n .attr('class', 'er entityLabel')\n .attr('id', `${attrPrefix}-name`)\n .attr('x', 0)\n .attr('y', 0)\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'left')\n .attr(\n 'style',\n 'font-family: ' + getConfig().fontFamily + '; font-size: ' + attrFontSize + 'px'\n )\n .text(item.attributeName);\n\n const attributeNode = {};\n attributeNode.tn = typeNode;\n attributeNode.nn = nameNode;\n\n const typeBBox = typeNode.node().getBBox();\n const nameBBox = nameNode.node().getBBox();\n maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width);\n maxNameWidth = Math.max(maxNameWidth, nameBBox.width);\n nodeWidth += typeBBox.width;\n nodeWidth += nameBBox.width;\n\n nodeHeight = Math.max(typeBBox.height, nameBBox.height);\n\n if (hasKeyType || item.attributeKeyType !== undefined) {\n const keyTypeNode = groupNode\n .append('text')\n .attr('class', 'er entityLabel')\n .attr('id', `${attrPrefix}-name`)\n .attr('x', 0)\n .attr('y', 0)\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'left')\n .attr(\n 'style',\n 'font-family: ' + getConfig().fontFamily + '; font-size: ' + attrFontSize + 'px'\n )\n .text(item.attributeKeyType || '');\n\n attributeNode.kn = keyTypeNode;\n const keyTypeBBox = keyTypeNode.node().getBBox();\n nodeWidth += keyTypeBBox.width;\n maxKeyWidth = Math.max(maxKeyWidth, nodeWidth);\n nodeHeight = Math.max(nodeHeight, keyTypeBBox.height);\n hasKeyType = true;\n }\n\n if (hasComment || item.attributeComment !== undefined) {\n const commentNode = groupNode\n .append('text')\n .attr('class', 'er entityLabel')\n .attr('id', `${attrPrefix}-name`)\n .attr('x', 0)\n .attr('y', 0)\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'left')\n .attr(\n 'style',\n 'font-family: ' + getConfig().fontFamily + '; font-size: ' + attrFontSize + 'px'\n )\n .text(item.attributeComment || '');\n\n attributeNode.cn = commentNode;\n const commentNodeBBox = commentNode.node().getBBox();\n nodeWidth += commentNodeBBox.width;\n maxCommentWidth = Math.max(nodeWidth, nameBBox.width);\n nodeHeight = Math.max(nodeHeight, commentNodeBBox.height);\n hasComment = true;\n }\n\n attributeNode.height = nodeHeight;\n // Keep a reference to the nodes so that we can iterate through them later\n attributeNodes.push(attributeNode);\n maxWidth = Math.max(maxWidth, nodeWidth);\n cumulativeHeight += nodeHeight + heightPadding * 2;\n attrNum += 1;\n });\n\n // Calculate the new bounding box of the overall entity, now that attributes have been added\n const bBox = {\n width: Math.max(\n conf.minEntityWidth,\n Math.max(labelBBox.width + conf.entityPadding * 2, maxWidth + widthPadding * 4)\n ),\n height:\n attributes.length > 0\n ? cumulativeHeight\n : Math.max(conf.minEntityHeight, labelBBox.height + conf.entityPadding * 2),\n };\n\n // There might be some spare width for padding out attributes if the entity name is very long\n const spareWidth = Math.max(0, bBox.width - maxWidth - widthPadding * 4);\n\n if (attributes.length > 0) {\n // Position the entity label near the top of the entity bounding box\n entityTextNode.attr(\n 'transform',\n 'translate(' + bBox.width / 2 + ',' + (heightPadding + labelBBox.height / 2) + ')'\n );\n\n // Add rectangular boxes for the attribute types/names\n let heightOffset = labelBBox.height + heightPadding * 2; // Start at the bottom of the entity label\n let attribStyle = 'attributeBoxOdd'; // We will flip the style on alternate rows to achieve a banded effect\n\n attributeNodes.forEach((attributeNode) => {\n // Calculate the alignment y co-ordinate for the type/name of the attribute\n const alignY = heightOffset + heightPadding + attributeNode.height / 2;\n\n // Position the type of the attribute\n attributeNode.tn.attr('transform', 'translate(' + widthPadding + ',' + alignY + ')');\n\n // Insert a rectangle for the type\n const typeRect = groupNode\n .insert('rect', '#' + attributeNode.tn.node().id)\n .attr('class', `er ${attribStyle}`)\n .attr('fill', conf.fill)\n .attr('fill-opacity', '100%')\n .attr('stroke', conf.stroke)\n .attr('x', 0)\n .attr('y', heightOffset)\n .attr('width', maxTypeWidth * 2 + spareWidth / 2)\n .attr('height', attributeNode.tn.node().getBBox().height + heightPadding * 2);\n\n // Position the name of the attribute\n attributeNode.nn.attr(\n 'transform',\n 'translate(' + (parseFloat(typeRect.attr('width')) + widthPadding) + ',' + alignY + ')'\n );\n\n // Insert a rectangle for the name\n groupNode\n .insert('rect', '#' + attributeNode.nn.node().id)\n .attr('class', `er ${attribStyle}`)\n .attr('fill', conf.fill)\n .attr('fill-opacity', '100%')\n .attr('stroke', conf.stroke)\n .attr('x', `${typeRect.attr('x') + typeRect.attr('width')}`)\n .attr('y', heightOffset)\n .attr('width', maxNameWidth + widthPadding * 2 + spareWidth / 2)\n .attr('height', attributeNode.nn.node().getBBox().height + heightPadding * 2);\n\n if (hasKeyType) {\n // Position the name of the attribute\n attributeNode.kn.attr(\n 'transform',\n 'translate(' + (parseFloat(typeRect.attr('width')) + widthPadding) + ',' + alignY + ')'\n );\n\n // Insert a rectangle for the name\n groupNode\n .insert('rect', '#' + attributeNode.kn.node().id)\n .attr('class', `er ${attribStyle}`)\n .attr('fill', conf.fill)\n .attr('fill-opacity', '100%')\n .attr('stroke', conf.stroke)\n .attr('x', `${typeRect.attr('x') + typeRect.attr('width')}`)\n .attr('y', heightOffset)\n .attr('width', maxKeyWidth + widthPadding * 2 + spareWidth / 2)\n .attr('height', attributeNode.kn.node().getBBox().height + heightPadding * 2);\n }\n\n if (hasComment) {\n // Position the name of the attribute\n attributeNode.cn.attr(\n 'transform',\n 'translate(' + (parseFloat(typeRect.attr('width')) + widthPadding) + ',' + alignY + ')'\n );\n\n // Insert a rectangle for the name\n groupNode\n .insert('rect', '#' + attributeNode.cn.node().id)\n .attr('class', `er ${attribStyle}`)\n .attr('fill', conf.fill)\n .attr('fill-opacity', '100%')\n .attr('stroke', conf.stroke)\n .attr('x', `${typeRect.attr('x') + typeRect.attr('width')}`)\n .attr('y', heightOffset)\n .attr('width', maxCommentWidth + widthPadding * 2 + spareWidth / 2)\n .attr('height', attributeNode.cn.node().getBBox().height + heightPadding * 2);\n }\n\n // Increment the height offset to move to the next row\n heightOffset += attributeNode.height + heightPadding * 2;\n\n // Flip the attribute style for row banding\n attribStyle = attribStyle == 'attributeBoxOdd' ? 'attributeBoxEven' : 'attributeBoxOdd';\n });\n } else {\n // Ensure the entity box is a decent size without any attributes\n bBox.height = Math.max(conf.minEntityHeight, cumulativeHeight);\n\n // Position the entity label in the middle of the box\n entityTextNode.attr('transform', 'translate(' + bBox.width / 2 + ',' + bBox.height / 2 + ')');\n }\n\n return bBox;\n};\n\n/**\n * Use D3 to construct the svg elements for the entities\n *\n * @param svgNode The svg node that contains the diagram\n * @param entities The entities to be drawn\n * @param graph The graph that contains the vertex and edge definitions post-layout\n * @returns The first entity that was inserted\n */\nconst drawEntities = function (svgNode, entities, graph) {\n const keys = Object.keys(entities);\n let firstOne;\n\n keys.forEach(function (id) {\n // Create a group for each entity\n const groupNode = svgNode.append('g').attr('id', id);\n\n firstOne = firstOne === undefined ? id : firstOne;\n\n // Label the entity - this is done first so that we can get the bounding box\n // which then determines the size of the rectangle\n const textId = 'entity-' + id;\n const textNode = groupNode\n .append('text')\n .attr('class', 'er entityLabel')\n .attr('id', textId)\n .attr('x', 0)\n .attr('y', 0)\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'middle')\n .attr(\n 'style',\n 'font-family: ' + getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px'\n )\n .text(id);\n\n const { width: entityWidth, height: entityHeight } = drawAttributes(\n groupNode,\n textNode,\n entities[id].attributes\n );\n\n // Draw the rectangle - insert it before the text so that the text is not obscured\n const rectNode = groupNode\n .insert('rect', '#' + textId)\n .attr('class', 'er entityBox')\n .attr('fill', conf.fill)\n .attr('fill-opacity', '100%')\n .attr('stroke', conf.stroke)\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', entityWidth)\n .attr('height', entityHeight);\n\n const rectBBox = rectNode.node().getBBox();\n\n // Add the entity to the graph\n graph.setNode(id, {\n width: rectBBox.width,\n height: rectBBox.height,\n shape: 'rect',\n id: id,\n });\n });\n return firstOne;\n}; // drawEntities\n\nconst adjustEntities = function (svgNode, graph) {\n graph.nodes().forEach(function (v) {\n if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') {\n svgNode\n .select('#' + v)\n .attr(\n 'transform',\n 'translate(' +\n (graph.node(v).x - graph.node(v).width / 2) +\n ',' +\n (graph.node(v).y - graph.node(v).height / 2) +\n ' )'\n );\n }\n });\n return;\n};\n\nconst getEdgeName = function (rel) {\n return (rel.entityA + rel.roleA + rel.entityB).replace(/\\s/g, '');\n};\n\n/**\n * Add each relationship to the graph\n *\n * @param relationships The relationships to be added\n * @param g The graph\n * @returns {Array} The array of relationships\n */\nconst addRelationships = function (relationships, g) {\n relationships.forEach(function (r) {\n g.setEdge(r.entityA, r.entityB, { relationship: r }, getEdgeName(r));\n });\n return relationships;\n}; // addRelationships\n\nlet relCnt = 0;\n/**\n * Draw a relationship using edge information from the graph\n *\n * @param svg The svg node\n * @param rel The relationship to draw in the svg\n * @param g The graph containing the edge information\n * @param insert The insertion point in the svg DOM (because relationships have markers that need to\n * sit 'behind' opaque entity boxes)\n */\nconst drawRelationshipFromLayout = function (svg, rel, g, insert) {\n relCnt++;\n\n // Find the edge relating to this relationship\n const edge = g.edge(rel.entityA, rel.entityB, getEdgeName(rel));\n\n // Get a function that will generate the line path\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curveBasis);\n\n // Insert the line at the right place\n const svgPath = svg\n .insert('path', '#' + insert)\n .attr('class', 'er relationshipLine')\n .attr('d', lineFunction(edge.points))\n .attr('stroke', conf.stroke)\n .attr('fill', 'none');\n\n // ...and with dashes if necessary\n if (rel.relSpec.relType === erDb.Identification.NON_IDENTIFYING) {\n svgPath.attr('stroke-dasharray', '8,8');\n }\n\n // TODO: Understand this better\n let url = '';\n if (conf.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n // Decide which start and end markers it needs. It may be possible to be more concise here\n // by reversing a start marker to make an end marker...but this will do for now\n\n // Note that the 'A' entity's marker is at the end of the relationship and the 'B' entity's marker is at the start\n switch (rel.relSpec.cardA) {\n case erDb.Cardinality.ZERO_OR_ONE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ZERO_OR_ONE_END + ')');\n break;\n case erDb.Cardinality.ZERO_OR_MORE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ZERO_OR_MORE_END + ')');\n break;\n case erDb.Cardinality.ONE_OR_MORE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ONE_OR_MORE_END + ')');\n break;\n case erDb.Cardinality.ONLY_ONE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ONLY_ONE_END + ')');\n break;\n }\n\n switch (rel.relSpec.cardB) {\n case erDb.Cardinality.ZERO_OR_ONE:\n svgPath.attr(\n 'marker-start',\n 'url(' + url + '#' + erMarkers.ERMarkers.ZERO_OR_ONE_START + ')'\n );\n break;\n case erDb.Cardinality.ZERO_OR_MORE:\n svgPath.attr(\n 'marker-start',\n 'url(' + url + '#' + erMarkers.ERMarkers.ZERO_OR_MORE_START + ')'\n );\n break;\n case erDb.Cardinality.ONE_OR_MORE:\n svgPath.attr(\n 'marker-start',\n 'url(' + url + '#' + erMarkers.ERMarkers.ONE_OR_MORE_START + ')'\n );\n break;\n case erDb.Cardinality.ONLY_ONE:\n svgPath.attr('marker-start', 'url(' + url + '#' + erMarkers.ERMarkers.ONLY_ONE_START + ')');\n break;\n }\n\n // Now label the relationship\n\n // Find the half-way point\n const len = svgPath.node().getTotalLength();\n const labelPoint = svgPath.node().getPointAtLength(len * 0.5);\n\n // Append a text node containing the label\n const labelId = 'rel' + relCnt;\n\n const labelNode = svg\n .append('text')\n .attr('class', 'er relationshipLabel')\n .attr('id', labelId)\n .attr('x', labelPoint.x)\n .attr('y', labelPoint.y)\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n .attr(\n 'style',\n 'font-family: ' + getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px'\n )\n .text(rel.roleA);\n\n // Figure out how big the opaque 'container' rectangle needs to be\n const labelBBox = labelNode.node().getBBox();\n\n // Insert the opaque rectangle before the text label\n svg\n .insert('rect', '#' + labelId)\n .attr('class', 'er relationshipLabelBox')\n .attr('x', labelPoint.x - labelBBox.width / 2)\n .attr('y', labelPoint.y - labelBBox.height / 2)\n .attr('width', labelBBox.width)\n .attr('height', labelBBox.height)\n .attr('fill', 'white')\n .attr('fill-opacity', '85%');\n\n return;\n};\n\n/**\n * Draw en E-R diagram in the tag with id: id based on the text definition of the diagram\n *\n * @param text The text of the diagram\n * @param id The unique id of the DOM node that contains the diagram\n */\nexport const draw = function (text, id) {\n log.info('Drawing ER diagram');\n erDb.clear();\n const parser = erParser.parser;\n parser.yy = erDb;\n\n // Parse the text to populate erDb\n try {\n parser.parse(text);\n } catch (err) {\n log.debug('Parsing failed');\n }\n\n // Get a reference to the svg node that contains the text\n const svg = select(`[id='${id}']`);\n\n // Add cardinality marker definitions to the svg\n erMarkers.insertMarkers(svg, conf);\n\n // Now we have to construct the diagram in a specific way:\n // ---\n // 1. Create all the entities in the svg node at 0,0, but with the correct dimensions (allowing for text content)\n // 2. Make sure they are all added to the graph\n // 3. Add all the edges (relationships) to the graph aswell\n // 4. Let dagre do its magic to layout the graph. This assigns:\n // - the centre co-ordinates for each node, bearing in mind the dimensions and edge relationships\n // - the path co-ordinates for each edge\n // But it has no impact on the svg child nodes - the diagram remains with every entity rooted at 0,0\n // 5. Now assign a transform to each entity in the svg node so that it gets drawn in the correct place, as determined by\n // its centre point, which is obtained from the graph, and it's width and height\n // 6. And finally, create all the edges in the svg node using information from the graph\n // ---\n\n // Create the graph\n let g;\n\n // TODO: Explore directed vs undirected graphs, and how the layout is affected\n // An E-R diagram could be said to be undirected, but there is merit in setting\n // the direction from parent to child in a one-to-many as this influences graphlib to\n // put the parent above the child (does it?), which is intuitive. Most relationships\n // in ER diagrams are one-to-many.\n g = new graphlib.Graph({\n multigraph: true,\n directed: true,\n compound: false,\n })\n .setGraph({\n rankdir: conf.layoutDirection,\n marginx: 20,\n marginy: 20,\n nodesep: 100,\n edgesep: 100,\n ranksep: 100,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n // Draw the entities (at 0,0), returning the first svg node that got\n // inserted - this represents the insertion point for relationship paths\n const firstEntity = drawEntities(svg, erDb.getEntities(), g);\n\n // TODO: externalise the addition of entities to the graph - it's a bit 'buried' in the above\n\n // Add all the relationships to the graph\n const relationships = addRelationships(erDb.getRelationships(), g);\n\n dagre.layout(g); // Node and edge positions will be updated\n\n // Adjust the positions of the entities so that they adhere to the layout\n adjustEntities(svg, g);\n\n // Draw the relationships\n relationships.forEach(function (rel) {\n drawRelationshipFromLayout(svg, rel, g, firstEntity);\n });\n\n const padding = conf.diagramPadding;\n\n const svgBounds = svg.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n\n configureSvgSize(svg, height, width, conf.useMaxWidth);\n\n svg.attr('viewBox', `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);\n}; // draw\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `\n .entityBox {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n }\n\n .attributeBoxOdd {\n fill: #ffffff;\n stroke: ${options.nodeBorder};\n }\n\n .attributeBoxEven {\n fill: #f2f2f2;\n stroke: ${options.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${options.tertiaryColor};\n opacity: 0.7;\n background-color: ${options.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ${options.lineColor};\n }\n`;\n\nexport default getStyles;\n","import dagreD3 from 'dagre-d3';\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction question(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const s = (w + h) * 0.9;\n const points = [\n { x: s / 2, y: 0 },\n { x: s, y: -s / 2 },\n { x: s / 2, y: -s },\n { x: 0, y: -s / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, s, s, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction hexagon(parent, bbox, node) {\n const f = 4;\n const h = bbox.height;\n const m = h / f;\n const w = bbox.width + 2 * m;\n const points = [\n { x: m, y: 0 },\n { x: w - m, y: 0 },\n { x: w, y: -h / 2 },\n { x: w - m, y: -h },\n { x: m, y: -h },\n { x: 0, y: -h / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction rect_left_inv_arrow(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: -h / 2, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: -h / 2, y: -h },\n { x: 0, y: -h / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction lean_right(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction lean_left(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (2 * h) / 6, y: 0 },\n { x: w + h / 6, y: 0 },\n { x: w - (2 * h) / 6, y: -h },\n { x: -h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction trapezoid(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w + (2 * h) / 6, y: 0 },\n { x: w - h / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction inv_trapezoid(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: h / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: (-2 * h) / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction rect_right_inv_arrow(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: 0, y: 0 },\n { x: w + h / 2, y: 0 },\n { x: w, y: -h / 2 },\n { x: w + h / 2, y: -h },\n { x: 0, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction stadium(parent, bbox, node) {\n const h = bbox.height;\n const w = bbox.width + h / 4;\n\n const shapeSvg = parent\n .insert('rect', ':first-child')\n .attr('rx', h / 2)\n .attr('ry', h / 2)\n .attr('x', -w / 2)\n .attr('y', -h / 2)\n .attr('width', w)\n .attr('height', h);\n\n node.intersect = function (point) {\n return dagreD3.intersect.rect(node, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction subroutine(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n { x: 0, y: 0 },\n { x: -8, y: 0 },\n { x: w + 8, y: 0 },\n { x: w + 8, y: -h },\n { x: -8, y: -h },\n { x: -8, y: 0 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return dagreD3.intersect.polygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction cylinder(parent, bbox, node) {\n const w = bbox.width;\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = bbox.height + ry;\n\n const shape =\n 'M 0,' +\n ry +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n -w +\n ' 0 l 0,' +\n h +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 l 0,' +\n -h;\n\n const shapeSvg = parent\n .attr('label-offset-y', ry)\n .insert('path', ':first-child')\n .attr('d', shape)\n .attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')');\n\n node.intersect = function (point) {\n const pos = dagreD3.intersect.rect(node, point);\n const x = pos.x - node.x;\n\n if (\n rx != 0 &&\n (Math.abs(x) < node.width / 2 ||\n (Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry))\n ) {\n // ellipsis equation: x*x / a*a + y*y / b*b = 1\n // solve for y to get adjustion value for pos.y\n let y = ry * ry * (1 - (x * x) / (rx * rx));\n if (y != 0) y = Math.sqrt(y);\n y = ry - y;\n if (point.y - node.y > 0) y = -y;\n\n pos.y += y;\n }\n\n return pos;\n };\n\n return shapeSvg;\n}\n\n/** @param render */\nexport function addToRender(render) {\n render.shapes().question = question;\n render.shapes().hexagon = hexagon;\n render.shapes().stadium = stadium;\n render.shapes().subroutine = subroutine;\n render.shapes().cylinder = cylinder;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().rect_left_inv_arrow = rect_left_inv_arrow;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().lean_right = lean_right;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().lean_left = lean_left;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().trapezoid = trapezoid;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().inv_trapezoid = inv_trapezoid;\n\n // Add custom shape for box with inverted arrow on right side\n render.shapes().rect_right_inv_arrow = rect_right_inv_arrow;\n}\n\n/** @param addShape */\nexport function addToRenderV2(addShape) {\n addShape({ question });\n addShape({ hexagon });\n addShape({ stadium });\n addShape({ subroutine });\n addShape({ cylinder });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ rect_left_inv_arrow });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ lean_right });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ lean_left });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ trapezoid });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ inv_trapezoid });\n\n // Add custom shape for box with inverted arrow on right side\n addShape({ rect_right_inv_arrow });\n}\n\n/**\n * @param parent\n * @param w\n * @param h\n * @param points\n */\nfunction insertPolygonShape(parent, w, h, points) {\n return parent\n .insert('polygon', ':first-child')\n .attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n )\n .attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');\n}\n\nexport default {\n addToRender,\n addToRenderV2,\n};\n","import { select } from 'd3';\nimport utils from '../../utils';\nimport * as configApi from '../../config';\nimport common from '../common/common';\nimport mermaidAPI from '../../mermaidAPI';\nimport { log } from '../../logger';\n\nconst MERMAID_DOM_ID_PREFIX = 'flowchart-';\nlet vertexCounter = 0;\nlet config = configApi.getConfig();\nlet vertices = {};\nlet edges = [];\nlet classes = [];\nlet subGraphs = [];\nlet subGraphLookup = {};\nlet tooltips = {};\nlet subCount = 0;\nlet firstGraphFlag = true;\nlet direction;\n\nlet version; // As in graph\n\n// Functions to be run after graph rendering\nlet funs = [];\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\n/**\n * Function to lookup domId from id in the graph definition.\n *\n * @param id\n * @public\n */\nexport const lookUpDomId = function (id) {\n const veritceKeys = Object.keys(vertices);\n for (let i = 0; i < veritceKeys.length; i++) {\n if (vertices[veritceKeys[i]].id === id) {\n return vertices[veritceKeys[i]].domId;\n }\n }\n return id;\n};\n\n/**\n * Function called by parser when a node definition has been found\n *\n * @param _id\n * @param text\n * @param type\n * @param style\n * @param classes\n * @param dir\n * @param props\n */\nexport const addVertex = function (_id, text, type, style, classes, dir, props = {}) {\n let txt;\n let id = _id;\n if (typeof id === 'undefined') {\n return;\n }\n if (id.trim().length === 0) {\n return;\n }\n\n // if (id[0].match(/\\d/)) id = MERMAID_DOM_ID_PREFIX + id;\n\n if (typeof vertices[id] === 'undefined') {\n vertices[id] = {\n id: id,\n domId: MERMAID_DOM_ID_PREFIX + id + '-' + vertexCounter,\n styles: [],\n classes: [],\n };\n }\n vertexCounter++;\n if (typeof text !== 'undefined') {\n config = configApi.getConfig();\n txt = common.sanitizeText(text.trim(), config);\n\n // strip quotes if string starts and ends with a quote\n if (txt[0] === '\"' && txt[txt.length - 1] === '\"') {\n txt = txt.substring(1, txt.length - 1);\n }\n\n vertices[id].text = txt;\n } else {\n if (typeof vertices[id].text === 'undefined') {\n vertices[id].text = _id;\n }\n }\n if (typeof type !== 'undefined') {\n vertices[id].type = type;\n }\n if (typeof style !== 'undefined') {\n if (style !== null) {\n style.forEach(function (s) {\n vertices[id].styles.push(s);\n });\n }\n }\n if (typeof classes !== 'undefined') {\n if (classes !== null) {\n classes.forEach(function (s) {\n vertices[id].classes.push(s);\n });\n }\n }\n if (typeof dir !== 'undefined') {\n vertices[id].dir = dir;\n }\n vertices[id].props = props;\n};\n\n/**\n * Function called by parser when a link/edge definition has been found\n *\n * @param _start\n * @param _end\n * @param type\n * @param linktext\n */\nexport const addSingleLink = function (_start, _end, type, linktext) {\n let start = _start;\n let end = _end;\n // if (start[0].match(/\\d/)) start = MERMAID_DOM_ID_PREFIX + start;\n // if (end[0].match(/\\d/)) end = MERMAID_DOM_ID_PREFIX + end;\n // log.info('Got edge...', start, end);\n\n const edge = { start: start, end: end, type: undefined, text: '' };\n linktext = type.text;\n\n if (typeof linktext !== 'undefined') {\n edge.text = common.sanitizeText(linktext.trim(), config);\n\n // strip quotes if string starts and exnds with a quote\n if (edge.text[0] === '\"' && edge.text[edge.text.length - 1] === '\"') {\n edge.text = edge.text.substring(1, edge.text.length - 1);\n }\n }\n\n if (typeof type !== 'undefined') {\n edge.type = type.type;\n edge.stroke = type.stroke;\n edge.length = type.length;\n }\n edges.push(edge);\n};\nexport const addLink = function (_start, _end, type, linktext) {\n let i, j;\n for (i = 0; i < _start.length; i++) {\n for (j = 0; j < _end.length; j++) {\n addSingleLink(_start[i], _end[j], type, linktext);\n }\n }\n};\n\n/**\n * Updates a link's line interpolation algorithm\n *\n * @param positions\n * @param interp\n */\nexport const updateLinkInterpolate = function (positions, interp) {\n positions.forEach(function (pos) {\n if (pos === 'default') {\n edges.defaultInterpolate = interp;\n } else {\n edges[pos].interpolate = interp;\n }\n });\n};\n\n/**\n * Updates a link with a style\n *\n * @param positions\n * @param style\n */\nexport const updateLink = function (positions, style) {\n positions.forEach(function (pos) {\n if (pos === 'default') {\n edges.defaultStyle = style;\n } else {\n if (utils.isSubstringInArray('fill', style) === -1) {\n style.push('fill:none');\n }\n edges[pos].style = style;\n }\n });\n};\n\nexport const addClass = function (id, style) {\n if (typeof classes[id] === 'undefined') {\n classes[id] = { id: id, styles: [], textStyles: [] };\n }\n\n if (typeof style !== 'undefined') {\n if (style !== null) {\n style.forEach(function (s) {\n if (s.match('color')) {\n const newStyle1 = s.replace('fill', 'bgFill');\n const newStyle2 = newStyle1.replace('color', 'fill');\n classes[id].textStyles.push(newStyle2);\n }\n classes[id].styles.push(s);\n });\n }\n }\n};\n\n/**\n * Called by parser when a graph definition is found, stores the direction of the chart.\n *\n * @param dir\n */\nexport const setDirection = function (dir) {\n direction = dir;\n if (direction.match(/.*</)) {\n direction = 'RL';\n }\n if (direction.match(/.*\\^/)) {\n direction = 'BT';\n }\n if (direction.match(/.*>/)) {\n direction = 'LR';\n }\n if (direction.match(/.*v/)) {\n direction = 'TB';\n }\n};\n\n/**\n * Called by parser when a special node is found, e.g. a clickable element.\n *\n * @param ids Comma separated list of ids\n * @param className Class to add\n */\nexport const setClass = function (ids, className) {\n ids.split(',').forEach(function (_id) {\n // let id = version === 'gen-2' ? lookUpDomId(_id) : _id;\n let id = _id;\n // if (_id[0].match(/\\d/)) id = MERMAID_DOM_ID_PREFIX + id;\n if (typeof vertices[id] !== 'undefined') {\n vertices[id].classes.push(className);\n }\n\n if (typeof subGraphLookup[id] !== 'undefined') {\n subGraphLookup[id].classes.push(className);\n }\n });\n};\n\nconst setTooltip = function (ids, tooltip) {\n ids.split(',').forEach(function (id) {\n if (typeof tooltip !== 'undefined') {\n tooltips[version === 'gen-1' ? lookUpDomId(id) : id] = common.sanitizeText(tooltip, config);\n }\n });\n};\n\nconst setClickFun = function (id, functionName, functionArgs) {\n let domId = lookUpDomId(id);\n // if (_id[0].match(/\\d/)) id = MERMAID_DOM_ID_PREFIX + id;\n if (configApi.getConfig().securityLevel !== 'loose') {\n return;\n }\n if (typeof functionName === 'undefined') {\n return;\n }\n let argList = [];\n if (typeof functionArgs === 'string') {\n /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */\n argList = functionArgs.split(/,(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/);\n for (let i = 0; i < argList.length; i++) {\n let item = argList[i].trim();\n /* Removes all double quotes at the start and end of an argument */\n /* This preserves all starting and ending whitespace inside */\n if (item.charAt(0) === '\"' && item.charAt(item.length - 1) === '\"') {\n item = item.substr(1, item.length - 2);\n }\n argList[i] = item;\n }\n }\n\n /* if no arguments passed into callback, default to passing in id */\n if (argList.length === 0) {\n argList.push(id);\n }\n\n if (typeof vertices[id] !== 'undefined') {\n vertices[id].haveCallback = true;\n funs.push(function () {\n const elem = document.querySelector(`[id=\"${domId}\"]`);\n if (elem !== null) {\n elem.addEventListener(\n 'click',\n function () {\n utils.runFunc(functionName, ...argList);\n },\n false\n );\n }\n });\n }\n};\n\n/**\n * Called by parser when a link is found. Adds the URL to the vertex data.\n *\n * @param ids Comma separated list of ids\n * @param linkStr URL to create a link for\n * @param target\n */\nexport const setLink = function (ids, linkStr, target) {\n ids.split(',').forEach(function (id) {\n if (typeof vertices[id] !== 'undefined') {\n vertices[id].link = utils.formatUrl(linkStr, config);\n vertices[id].linkTarget = target;\n }\n });\n setClass(ids, 'clickable');\n};\nexport const getTooltip = function (id) {\n return tooltips[id];\n};\n\n/**\n * Called by parser when a click definition is found. Registers an event handler.\n *\n * @param ids Comma separated list of ids\n * @param functionName Function to be called on click\n * @param functionArgs\n */\nexport const setClickEvent = function (ids, functionName, functionArgs) {\n ids.split(',').forEach(function (id) {\n setClickFun(id, functionName, functionArgs);\n });\n setClass(ids, 'clickable');\n};\n\nexport const bindFunctions = function (element) {\n funs.forEach(function (fun) {\n fun(element);\n });\n};\nexport const getDirection = function () {\n return direction.trim();\n};\n/**\n * Retrieval function for fetching the found nodes after parsing has completed.\n *\n * @returns {{} | any | vertices}\n */\nexport const getVertices = function () {\n return vertices;\n};\n\n/**\n * Retrieval function for fetching the found links after parsing has completed.\n *\n * @returns {{} | any | edges}\n */\nexport const getEdges = function () {\n return edges;\n};\n\n/**\n * Retrieval function for fetching the found class definitions after parsing has completed.\n *\n * @returns {{} | any | classes}\n */\nexport const getClasses = function () {\n return classes;\n};\n\nconst setupToolTips = function (element) {\n let tooltipElem = select('.mermaidTooltip');\n if ((tooltipElem._groups || tooltipElem)[0][0] === null) {\n tooltipElem = select('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);\n }\n\n const svg = select(element).select('svg');\n\n const nodes = svg.selectAll('g.node');\n nodes\n .on('mouseover', function () {\n const el = select(this);\n const title = el.attr('title');\n\n // Dont try to draw a tooltip if no data is provided\n if (title === null) {\n return;\n }\n const rect = this.getBoundingClientRect();\n\n tooltipElem.transition().duration(200).style('opacity', '.9');\n tooltipElem\n .html(el.attr('title'))\n .style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px')\n .style('top', window.scrollY + rect.top - 14 + document.body.scrollTop + 'px');\n el.classed('hover', true);\n })\n .on('mouseout', function () {\n tooltipElem.transition().duration(500).style('opacity', 0);\n const el = select(this);\n el.classed('hover', false);\n });\n};\nfuns.push(setupToolTips);\n\n/**\n * Clears the internal graph db so that a new graph can be parsed.\n *\n * @param ver\n */\nexport const clear = function (ver) {\n vertices = {};\n classes = {};\n edges = [];\n funs = [];\n funs.push(setupToolTips);\n subGraphs = [];\n subGraphLookup = {};\n subCount = 0;\n tooltips = [];\n firstGraphFlag = true;\n version = ver || 'gen-1';\n};\nexport const setGen = (ver) => {\n version = ver || 'gen-1';\n};\n/** @returns {string} */\nexport const defaultStyle = function () {\n return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;';\n};\n\n/**\n * Clears the internal graph db so that a new graph can be parsed.\n *\n * @param _id\n * @param list\n * @param _title\n */\nexport const addSubGraph = function (_id, list, _title) {\n // console.log('addSubGraph', _id, list, _title);\n let id = _id.trim();\n let title = _title;\n if (_id === _title && _title.match(/\\s/)) {\n id = undefined;\n }\n /** @param a */\n function uniq(a) {\n const prims = { boolean: {}, number: {}, string: {} };\n const objs = [];\n\n let dir; // = unbdefined; direction.trim();\n const nodeList = a.filter(function (item) {\n const type = typeof item;\n if (item.stmt && item.stmt === 'dir') {\n dir = item.value;\n return false;\n }\n if (item.trim() === '') {\n return false;\n }\n if (type in prims) {\n return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true); // eslint-disable-line\n } else {\n return objs.indexOf(item) >= 0 ? false : objs.push(item);\n }\n });\n return { nodeList, dir };\n }\n\n let nodeList = [];\n\n const { nodeList: nl, dir } = uniq(nodeList.concat.apply(nodeList, list));\n nodeList = nl;\n if (version === 'gen-1') {\n log.warn('LOOKING UP');\n for (let i = 0; i < nodeList.length; i++) {\n nodeList[i] = lookUpDomId(nodeList[i]);\n }\n }\n\n id = id || 'subGraph' + subCount;\n // if (id[0].match(/\\d/)) id = lookUpDomId(id);\n title = title || '';\n title = common.sanitizeText(title, config);\n subCount = subCount + 1;\n const subGraph = { id: id, nodes: nodeList, title: title.trim(), classes: [], dir };\n\n log.info('Adding', subGraph.id, subGraph.nodes, subGraph.dir);\n\n /** Deletes an id from all subgraphs */\n // const del = _id => {\n // subGraphs.forEach(sg => {\n // const pos = sg.nodes.indexOf(_id);\n // if (pos >= 0) {\n // sg.nodes.splice(pos, 1);\n // }\n // });\n // };\n\n // // Removes the members of this subgraph from any other subgraphs, a node only belong to one subgraph\n // subGraph.nodes.forEach(_id => del(_id));\n\n // Remove the members in the new subgraph if they already belong to another subgraph\n subGraph.nodes = makeUniq(subGraph, subGraphs).nodes;\n subGraphs.push(subGraph);\n subGraphLookup[id] = subGraph;\n return id;\n};\n\nconst getPosForId = function (id) {\n for (let i = 0; i < subGraphs.length; i++) {\n if (subGraphs[i].id === id) {\n return i;\n }\n }\n return -1;\n};\nlet secCount = -1;\nconst posCrossRef = [];\nconst indexNodes2 = function (id, pos) {\n const nodes = subGraphs[pos].nodes;\n secCount = secCount + 1;\n if (secCount > 2000) {\n return;\n }\n posCrossRef[secCount] = pos;\n // Check if match\n if (subGraphs[pos].id === id) {\n return {\n result: true,\n count: 0,\n };\n }\n\n let count = 0;\n let posCount = 1;\n while (count < nodes.length) {\n const childPos = getPosForId(nodes[count]);\n // Ignore regular nodes (pos will be -1)\n if (childPos >= 0) {\n const res = indexNodes2(id, childPos);\n if (res.result) {\n return {\n result: true,\n count: posCount + res.count,\n };\n } else {\n posCount = posCount + res.count;\n }\n }\n count = count + 1;\n }\n\n return {\n result: false,\n count: posCount,\n };\n};\n\nexport const getDepthFirstPos = function (pos) {\n return posCrossRef[pos];\n};\nexport const indexNodes = function () {\n secCount = -1;\n if (subGraphs.length > 0) {\n indexNodes2('none', subGraphs.length - 1, 0);\n }\n};\n\nexport const getSubGraphs = function () {\n return subGraphs;\n};\n\nexport const firstGraph = () => {\n if (firstGraphFlag) {\n firstGraphFlag = false;\n return true;\n }\n return false;\n};\n\nconst destructStartLink = (_str) => {\n let str = _str.trim();\n let type = 'arrow_open';\n\n switch (str[0]) {\n case '<':\n type = 'arrow_point';\n str = str.slice(1);\n break;\n case 'x':\n type = 'arrow_cross';\n str = str.slice(1);\n break;\n case 'o':\n type = 'arrow_circle';\n str = str.slice(1);\n break;\n }\n\n let stroke = 'normal';\n\n if (str.indexOf('=') !== -1) {\n stroke = 'thick';\n }\n\n if (str.indexOf('.') !== -1) {\n stroke = 'dotted';\n }\n\n return { type, stroke };\n};\n\nconst countChar = (char, str) => {\n const length = str.length;\n let count = 0;\n for (let i = 0; i < length; ++i) {\n if (str[i] === char) {\n ++count;\n }\n }\n return count;\n};\n\nconst destructEndLink = (_str) => {\n const str = _str.trim();\n let line = str.slice(0, -1);\n let type = 'arrow_open';\n\n switch (str.slice(-1)) {\n case 'x':\n type = 'arrow_cross';\n if (str[0] === 'x') {\n type = 'double_' + type;\n line = line.slice(1);\n }\n break;\n case '>':\n type = 'arrow_point';\n if (str[0] === '<') {\n type = 'double_' + type;\n line = line.slice(1);\n }\n break;\n case 'o':\n type = 'arrow_circle';\n if (str[0] === 'o') {\n type = 'double_' + type;\n line = line.slice(1);\n }\n break;\n }\n\n let stroke = 'normal';\n let length = line.length - 1;\n\n if (line[0] === '=') {\n stroke = 'thick';\n }\n\n let dots = countChar('.', line);\n\n if (dots) {\n stroke = 'dotted';\n length = dots;\n }\n\n return { type, stroke, length };\n};\n\nconst destructLink = (_str, _startStr) => {\n const info = destructEndLink(_str);\n let startInfo;\n if (_startStr) {\n startInfo = destructStartLink(_startStr);\n\n if (startInfo.stroke !== info.stroke) {\n return { type: 'INVALID', stroke: 'INVALID' };\n }\n\n if (startInfo.type === 'arrow_open') {\n // -- xyz --> - take arrow type from ending\n startInfo.type = info.type;\n } else {\n // x-- xyz --> - not supported\n if (startInfo.type !== info.type) return { type: 'INVALID', stroke: 'INVALID' };\n\n startInfo.type = 'double_' + startInfo.type;\n }\n\n if (startInfo.type === 'double_arrow') {\n startInfo.type = 'double_arrow_point';\n }\n\n startInfo.length = info.length;\n return startInfo;\n }\n\n return info;\n};\n\n// Todo optimizer this by caching existing nodes\nconst exists = (allSgs, _id) => {\n let res = false;\n allSgs.forEach((sg) => {\n const pos = sg.nodes.indexOf(_id);\n if (pos >= 0) {\n res = true;\n }\n });\n return res;\n};\n/**\n * Deletes an id from all subgraphs\n *\n * @param sg\n * @param allSubgraphs\n */\nconst makeUniq = (sg, allSubgraphs) => {\n const res = [];\n sg.nodes.forEach((_id, pos) => {\n if (!exists(allSubgraphs, _id)) {\n res.push(sg.nodes[pos]);\n }\n });\n return { nodes: res };\n};\n\nexport default {\n parseDirective,\n defaultConfig: () => configApi.defaultConfig.flowchart,\n addVertex,\n lookUpDomId,\n addLink,\n updateLinkInterpolate,\n updateLink,\n addClass,\n setDirection,\n setClass,\n setTooltip,\n getTooltip,\n setClickEvent,\n setLink,\n bindFunctions,\n getDirection,\n getVertices,\n getEdges,\n getClasses,\n clear,\n setGen,\n defaultStyle,\n addSubGraph,\n getDepthFirstPos,\n indexNodes,\n getSubGraphs,\n destructLink,\n lex: {\n firstGraph,\n },\n exists,\n makeUniq,\n};\n","import graphlib from 'graphlib';\nimport { select, curveLinear, selectAll } from 'd3';\n\nimport flowDb from './flowDb';\nimport flow from './parser/flow';\nimport { getConfig } from '../../config';\n\nimport { render } from '../../dagre-wrapper/index.js';\nimport addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js';\nimport { log } from '../../logger';\nimport common, { evaluate } from '../common/common';\nimport { interpolateToCurve, getStylesFromArray, configureSvgSize } from '../../utils';\n\nconst conf = {};\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n for (let i = 0; i < keys.length; i++) {\n conf[keys[i]] = cnf[keys[i]];\n }\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param vert Object containing the vertices.\n * @param g The graph that is to be drawn.\n * @param svgId\n */\nexport const addVertices = function (vert, g, svgId) {\n const svg = select(`[id=\"${svgId}\"]`);\n const keys = Object.keys(vert);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = vert[id];\n\n /**\n * Variable for storing the classes for the vertex\n *\n * @type {string}\n */\n let classStr = 'default';\n if (vertex.classes.length > 0) {\n classStr = vertex.classes.join(' ');\n }\n\n const styles = getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;\n\n // We create a SVG label, either by delegating to addHtmlLabel or manually\n let vertexNode;\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?\n const node = {\n label: vertexText.replace(\n /fa[lrsb]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n ),\n };\n vertexNode = addHtmlLabel(svg, node).node();\n vertexNode.parentNode.removeChild(vertexNode);\n } else {\n const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:'));\n\n const rows = vertexText.split(common.lineBreakRegex);\n\n for (let j = 0; j < rows.length; j++) {\n const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n tspan.setAttribute('dy', '1em');\n tspan.setAttribute('x', '1');\n tspan.textContent = rows[j];\n svgLabel.appendChild(tspan);\n }\n vertexNode = svgLabel;\n }\n\n let radious = 0;\n let _shape = '';\n // Set the shape based parameters\n switch (vertex.type) {\n case 'round':\n radious = 5;\n _shape = 'rect';\n break;\n case 'square':\n _shape = 'rect';\n break;\n case 'diamond':\n _shape = 'question';\n break;\n case 'hexagon':\n _shape = 'hexagon';\n break;\n case 'odd':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'lean_right':\n _shape = 'lean_right';\n break;\n case 'lean_left':\n _shape = 'lean_left';\n break;\n case 'trapezoid':\n _shape = 'trapezoid';\n break;\n case 'inv_trapezoid':\n _shape = 'inv_trapezoid';\n break;\n case 'odd_right':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'circle':\n _shape = 'circle';\n break;\n case 'ellipse':\n _shape = 'ellipse';\n break;\n case 'stadium':\n _shape = 'stadium';\n break;\n case 'subroutine':\n _shape = 'subroutine';\n break;\n case 'cylinder':\n _shape = 'cylinder';\n break;\n case 'group':\n _shape = 'rect';\n break;\n default:\n _shape = 'rect';\n }\n // Add the node\n g.setNode(vertex.id, {\n labelStyle: styles.labelStyle,\n shape: _shape,\n labelText: vertexText,\n rx: radious,\n ry: radious,\n class: classStr,\n style: styles.style,\n id: vertex.id,\n link: vertex.link,\n linkTarget: vertex.linkTarget,\n tooltip: flowDb.getTooltip(vertex.id) || '',\n domId: flowDb.lookUpDomId(vertex.id),\n haveCallback: vertex.haveCallback,\n width: vertex.type === 'group' ? 500 : undefined,\n dir: vertex.dir,\n type: vertex.type,\n props: vertex.props,\n padding: getConfig().flowchart.padding,\n });\n\n log.info('setNode', {\n labelStyle: styles.labelStyle,\n shape: _shape,\n labelText: vertexText,\n rx: radious,\n ry: radious,\n class: classStr,\n style: styles.style,\n id: vertex.id,\n domId: flowDb.lookUpDomId(vertex.id),\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n dir: vertex.dir,\n props: vertex.props,\n padding: getConfig().flowchart.padding,\n });\n });\n};\n\n/**\n * Add edges to graph based on parsed graph defninition\n *\n * @param {object} edges The edges to add to the graph\n * @param {object} g The graph object\n */\nexport const addEdges = function (edges, g) {\n log.info('abc78 edges = ', edges);\n let cnt = 0;\n let linkIdCnt = {};\n\n let defaultStyle;\n let defaultLabelStyle;\n\n if (typeof edges.defaultStyle !== 'undefined') {\n const defaultStyles = getStylesFromArray(edges.defaultStyle);\n defaultStyle = defaultStyles.style;\n defaultLabelStyle = defaultStyles.labelStyle;\n }\n\n edges.forEach(function (edge) {\n cnt++;\n\n // Identify Link\n var linkIdBase = 'L-' + edge.start + '-' + edge.end;\n // count the links from+to the same node to give unique id\n if (typeof linkIdCnt[linkIdBase] === 'undefined') {\n linkIdCnt[linkIdBase] = 0;\n log.info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]);\n } else {\n linkIdCnt[linkIdBase]++;\n log.info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]);\n }\n let linkId = linkIdBase + '-' + linkIdCnt[linkIdBase];\n log.info('abc78 new link id to be used is', linkIdBase, linkId, linkIdCnt[linkIdBase]);\n var linkNameStart = 'LS-' + edge.start;\n var linkNameEnd = 'LE-' + edge.end;\n\n const edgeData = { style: '', labelStyle: '' };\n edgeData.minlen = edge.length || 1;\n //edgeData.id = 'id' + cnt;\n\n // Set link type for rendering\n if (edge.type === 'arrow_open') {\n edgeData.arrowhead = 'none';\n } else {\n edgeData.arrowhead = 'normal';\n }\n\n // Check of arrow types, placed here in order not to break old rendering\n edgeData.arrowTypeStart = 'arrow_open';\n edgeData.arrowTypeEnd = 'arrow_open';\n\n /* eslint-disable no-fallthrough */\n switch (edge.type) {\n case 'double_arrow_cross':\n edgeData.arrowTypeStart = 'arrow_cross';\n case 'arrow_cross':\n edgeData.arrowTypeEnd = 'arrow_cross';\n break;\n case 'double_arrow_point':\n edgeData.arrowTypeStart = 'arrow_point';\n case 'arrow_point':\n edgeData.arrowTypeEnd = 'arrow_point';\n break;\n case 'double_arrow_circle':\n edgeData.arrowTypeStart = 'arrow_circle';\n case 'arrow_circle':\n edgeData.arrowTypeEnd = 'arrow_circle';\n break;\n }\n\n let style = '';\n let labelStyle = '';\n\n switch (edge.stroke) {\n case 'normal':\n style = 'fill:none;';\n if (typeof defaultStyle !== 'undefined') {\n style = defaultStyle;\n }\n if (typeof defaultLabelStyle !== 'undefined') {\n labelStyle = defaultLabelStyle;\n }\n edgeData.thickness = 'normal';\n edgeData.pattern = 'solid';\n break;\n case 'dotted':\n edgeData.thickness = 'normal';\n edgeData.pattern = 'dotted';\n edgeData.style = 'fill:none;stroke-width:2px;stroke-dasharray:3;';\n break;\n case 'thick':\n edgeData.thickness = 'thick';\n edgeData.pattern = 'solid';\n edgeData.style = 'stroke-width: 3.5px;fill:none;';\n break;\n }\n if (typeof edge.style !== 'undefined') {\n const styles = getStylesFromArray(edge.style);\n style = styles.style;\n labelStyle = styles.labelStyle;\n }\n\n edgeData.style = edgeData.style += style;\n edgeData.labelStyle = edgeData.labelStyle += labelStyle;\n\n if (typeof edge.interpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear);\n } else if (typeof edges.defaultInterpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(edges.defaultInterpolate, curveLinear);\n } else {\n edgeData.curve = interpolateToCurve(conf.curve, curveLinear);\n }\n\n if (typeof edge.text === 'undefined') {\n if (typeof edge.style !== 'undefined') {\n edgeData.arrowheadStyle = 'fill: #333';\n }\n } else {\n edgeData.arrowheadStyle = 'fill: #333';\n edgeData.labelpos = 'c';\n }\n // if (evaluate(getConfig().flowchart.htmlLabels) && false) {\n // // eslint-disable-line\n // edgeData.labelType = 'html';\n // edgeData.label = `<span id=\"L-${linkId}\" class=\"edgeLabel L-${linkNameStart}' L-${linkNameEnd}\">${edge.text}</span>`;\n // } else {\n edgeData.labelType = 'text';\n edgeData.label = edge.text.replace(common.lineBreakRegex, '\\n');\n\n if (typeof edge.style === 'undefined') {\n edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none;';\n }\n\n edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:');\n // }\n\n edgeData.id = linkId;\n edgeData.classes = 'flowchart-link ' + linkNameStart + ' ' + linkNameEnd;\n\n // Add the edge to the graph\n g.setEdge(edge.start, edge.end, edgeData, cnt);\n });\n};\n\n/**\n * Returns the all the styles from classDef statements in the graph definition.\n *\n * @param text\n * @returns {object} ClassDef styles\n */\nexport const getClasses = function (text) {\n log.info('Extracting classes');\n flowDb.clear();\n const parser = flow.parser;\n parser.yy = flowDb;\n\n try {\n // Parse the graph definition\n parser.parse(text);\n } catch (e) {\n return;\n }\n\n return flowDb.getClasses();\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param text\n * @param id\n */\n\nexport const draw = function (text, id) {\n log.info('Drawing flowchart');\n flowDb.clear();\n flowDb.setGen('gen-2');\n const parser = flow.parser;\n parser.yy = flowDb;\n\n // Parse the graph definition\n // try {\n parser.parse(text);\n // } catch (err) {\n // log.debug('Parsing failed');\n // }\n\n // Fetch the default direction, use TD if none was found\n let dir = flowDb.getDirection();\n if (typeof dir === 'undefined') {\n dir = 'TD';\n }\n\n const conf = getConfig().flowchart;\n const nodeSpacing = conf.nodeSpacing || 50;\n const rankSpacing = conf.rankSpacing || 50;\n\n // Create the input mermaid.graph\n const g = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: dir,\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n let subG;\n const subGraphs = flowDb.getSubGraphs();\n log.info('Subgraphs - ', subGraphs);\n for (let i = subGraphs.length - 1; i >= 0; i--) {\n subG = subGraphs[i];\n log.info('Subgraph - ', subG);\n flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes, subG.dir);\n }\n\n // Fetch the verices/nodes and edges/links from the parsed graph definition\n const vert = flowDb.getVertices();\n\n const edges = flowDb.getEdges();\n\n log.info(edges);\n let i = 0;\n for (i = subGraphs.length - 1; i >= 0; i--) {\n // for (let i = 0; i < subGraphs.length; i++) {\n subG = subGraphs[i];\n\n selectAll('cluster').append('text');\n\n for (let j = 0; j < subG.nodes.length; j++) {\n log.info('Setting up subgraphs', subG.nodes[j], subG.id);\n g.setParent(subG.nodes[j], subG.id);\n }\n }\n addVertices(vert, g, id);\n addEdges(edges, g);\n\n // Add custom shapes\n // flowChartShapes.addToRenderV2(addShape);\n\n // Set up an SVG group so that we can translate the final graph.\n const svg = select(`[id=\"${id}\"]`);\n svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n // Run the renderer. This is what draws the final graph.\n const element = select('#' + id + ' g');\n render(element, g, ['point', 'circle', 'cross'], 'flowchart', id);\n\n const padding = conf.diagramPadding;\n const svgBounds = svg.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n log.debug(\n `new ViewBox 0 0 ${width} ${height}`,\n `translate(${padding - g._label.marginx}, ${padding - g._label.marginy})`\n );\n\n configureSvgSize(svg, height, width, conf.useMaxWidth);\n\n svg.attr('viewBox', `0 0 ${width} ${height}`);\n svg\n .select('g')\n .attr('transform', `translate(${padding - g._label.marginx}, ${padding - svgBounds.y})`);\n\n // Index nodes\n flowDb.indexNodes('subGraph' + i);\n\n // Add label rects for non html labels\n if (!conf.htmlLabels) {\n const labels = document.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n for (let k = 0; k < labels.length; k++) {\n const label = labels[k];\n\n // Get dimensions of label\n const dim = label.getBBox();\n\n const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n // rect.setAttribute('style', 'fill:#e8e8e8;');\n\n label.insertBefore(rect, label.firstChild);\n }\n }\n\n // If node has a link, wrap it in an anchor SVG object.\n const keys = Object.keys(vert);\n keys.forEach(function (key) {\n const vertex = vert[key];\n\n if (vertex.link) {\n const node = select('#' + id + ' [id=\"' + key + '\"]');\n if (node) {\n const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');\n link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));\n link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);\n link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');\n if (vertex.linkTarget) {\n link.setAttributeNS('http://www.w3.org/2000/svg', 'target', vertex.linkTarget);\n }\n\n const linkNode = node.insert(function () {\n return link;\n }, ':first-child');\n\n const shape = node.select('.label-container');\n if (shape) {\n linkNode.append(function () {\n return shape.node();\n });\n }\n\n const label = node.select('.label');\n if (label) {\n linkNode.append(function () {\n return label.node();\n });\n }\n }\n }\n });\n};\n\nexport default {\n setConf,\n addVertices,\n addEdges,\n getClasses,\n draw,\n};\n","import graphlib from 'graphlib';\nimport { select, curveLinear, selectAll } from 'd3';\n\nimport flowDb from './flowDb';\nimport flow from './parser/flow';\nimport { getConfig } from '../../config';\n\nimport dagreD3 from 'dagre-d3';\nimport addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js';\nimport { log } from '../../logger';\nimport common, { evaluate } from '../common/common';\nimport { interpolateToCurve, getStylesFromArray, configureSvgSize } from '../../utils';\nimport flowChartShapes from './flowChartShapes';\n\nconst conf = {};\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n for (let i = 0; i < keys.length; i++) {\n conf[keys[i]] = cnf[keys[i]];\n }\n};\n\n/**\n * Function that adds the vertices found in the graph definition to the graph to be rendered.\n *\n * @param vert Object containing the vertices.\n * @param g The graph that is to be drawn.\n * @param svgId\n */\nexport const addVertices = function (vert, g, svgId) {\n const svg = select(`[id=\"${svgId}\"]`);\n const keys = Object.keys(vert);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = vert[id];\n\n /**\n * Variable for storing the classes for the vertex\n *\n * @type {string}\n */\n let classStr = 'default';\n if (vertex.classes.length > 0) {\n classStr = vertex.classes.join(' ');\n }\n\n const styles = getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;\n\n // We create a SVG label, either by delegating to addHtmlLabel or manually\n let vertexNode;\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?\n const node = {\n label: vertexText.replace(\n /fa[lrsb]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n ),\n };\n vertexNode = addHtmlLabel(svg, node).node();\n vertexNode.parentNode.removeChild(vertexNode);\n } else {\n const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:'));\n\n const rows = vertexText.split(common.lineBreakRegex);\n\n for (let j = 0; j < rows.length; j++) {\n const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n tspan.setAttribute('dy', '1em');\n tspan.setAttribute('x', '1');\n tspan.textContent = rows[j];\n svgLabel.appendChild(tspan);\n }\n vertexNode = svgLabel;\n }\n\n let radious = 0;\n let _shape = '';\n // Set the shape based parameters\n switch (vertex.type) {\n case 'round':\n radious = 5;\n _shape = 'rect';\n break;\n case 'square':\n _shape = 'rect';\n break;\n case 'diamond':\n _shape = 'question';\n break;\n case 'hexagon':\n _shape = 'hexagon';\n break;\n case 'odd':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'lean_right':\n _shape = 'lean_right';\n break;\n case 'lean_left':\n _shape = 'lean_left';\n break;\n case 'trapezoid':\n _shape = 'trapezoid';\n break;\n case 'inv_trapezoid':\n _shape = 'inv_trapezoid';\n break;\n case 'odd_right':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'circle':\n _shape = 'circle';\n break;\n case 'ellipse':\n _shape = 'ellipse';\n break;\n case 'stadium':\n _shape = 'stadium';\n break;\n case 'subroutine':\n _shape = 'subroutine';\n break;\n case 'cylinder':\n _shape = 'cylinder';\n break;\n case 'group':\n _shape = 'rect';\n break;\n default:\n _shape = 'rect';\n }\n // Add the node\n log.warn('Adding node', vertex.id, vertex.domId);\n g.setNode(flowDb.lookUpDomId(vertex.id), {\n labelType: 'svg',\n labelStyle: styles.labelStyle,\n shape: _shape,\n label: vertexNode,\n rx: radious,\n ry: radious,\n class: classStr,\n style: styles.style,\n id: flowDb.lookUpDomId(vertex.id),\n });\n });\n};\n\n/**\n * Add edges to graph based on parsed graph defninition\n *\n * @param {object} edges The edges to add to the graph\n * @param {object} g The graph object\n */\nexport const addEdges = function (edges, g) {\n let cnt = 0;\n\n let defaultStyle;\n let defaultLabelStyle;\n\n if (typeof edges.defaultStyle !== 'undefined') {\n const defaultStyles = getStylesFromArray(edges.defaultStyle);\n defaultStyle = defaultStyles.style;\n defaultLabelStyle = defaultStyles.labelStyle;\n }\n\n edges.forEach(function (edge) {\n cnt++;\n\n // Identify Link\n var linkId = 'L-' + edge.start + '-' + edge.end;\n var linkNameStart = 'LS-' + edge.start;\n var linkNameEnd = 'LE-' + edge.end;\n\n const edgeData = {};\n\n // Set link type for rendering\n if (edge.type === 'arrow_open') {\n edgeData.arrowhead = 'none';\n } else {\n edgeData.arrowhead = 'normal';\n }\n\n let style = '';\n let labelStyle = '';\n\n if (typeof edge.style !== 'undefined') {\n const styles = getStylesFromArray(edge.style);\n style = styles.style;\n labelStyle = styles.labelStyle;\n } else {\n switch (edge.stroke) {\n case 'normal':\n style = 'fill:none';\n if (typeof defaultStyle !== 'undefined') {\n style = defaultStyle;\n }\n if (typeof defaultLabelStyle !== 'undefined') {\n labelStyle = defaultLabelStyle;\n }\n break;\n case 'dotted':\n style = 'fill:none;stroke-width:2px;stroke-dasharray:3;';\n break;\n case 'thick':\n style = ' stroke-width: 3.5px;fill:none';\n break;\n }\n }\n\n edgeData.style = style;\n edgeData.labelStyle = labelStyle;\n\n if (typeof edge.interpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear);\n } else if (typeof edges.defaultInterpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(edges.defaultInterpolate, curveLinear);\n } else {\n edgeData.curve = interpolateToCurve(conf.curve, curveLinear);\n }\n\n if (typeof edge.text === 'undefined') {\n if (typeof edge.style !== 'undefined') {\n edgeData.arrowheadStyle = 'fill: #333';\n }\n } else {\n edgeData.arrowheadStyle = 'fill: #333';\n edgeData.labelpos = 'c';\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n edgeData.labelType = 'html';\n edgeData.label = `<span id=\"L-${linkId}\" class=\"edgeLabel L-${linkNameStart}' L-${linkNameEnd}\">${edge.text.replace(\n /fa[lrsb]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n )}</span>`;\n } else {\n edgeData.labelType = 'text';\n edgeData.label = edge.text.replace(common.lineBreakRegex, '\\n');\n\n if (typeof edge.style === 'undefined') {\n edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';\n }\n\n edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:');\n }\n }\n\n edgeData.id = linkId;\n edgeData.class = linkNameStart + ' ' + linkNameEnd;\n edgeData.minlen = edge.length || 1;\n\n // Add the edge to the graph\n g.setEdge(flowDb.lookUpDomId(edge.start), flowDb.lookUpDomId(edge.end), edgeData, cnt);\n });\n};\n\n/**\n * Returns the all the styles from classDef statements in the graph definition.\n *\n * @param text\n * @returns {object} ClassDef styles\n */\nexport const getClasses = function (text) {\n log.info('Extracting classes');\n flowDb.clear();\n try {\n const parser = flow.parser;\n parser.yy = flowDb;\n\n // Parse the graph definition\n parser.parse(text);\n return flowDb.getClasses();\n } catch (e) {\n return;\n }\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param text\n * @param id\n */\nexport const draw = function (text, id) {\n log.info('Drawing flowchart');\n flowDb.clear();\n flowDb.setGen('gen-1');\n const parser = flow.parser;\n parser.yy = flowDb;\n\n // Parse the graph definition\n // try {\n parser.parse(text);\n // } catch (err) {\n // log.debug('Parsing failed');\n // }\n\n // Fetch the default direction, use TD if none was found\n let dir = flowDb.getDirection();\n if (typeof dir === 'undefined') {\n dir = 'TD';\n }\n\n const conf = getConfig().flowchart;\n const nodeSpacing = conf.nodeSpacing || 50;\n const rankSpacing = conf.rankSpacing || 50;\n\n // Create the input mermaid.graph\n const g = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: dir,\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n let subG;\n const subGraphs = flowDb.getSubGraphs();\n for (let i = subGraphs.length - 1; i >= 0; i--) {\n subG = subGraphs[i];\n flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes);\n }\n\n // Fetch the verices/nodes and edges/links from the parsed graph definition\n const vert = flowDb.getVertices();\n log.warn('Get vertices', vert);\n\n const edges = flowDb.getEdges();\n\n let i = 0;\n for (i = subGraphs.length - 1; i >= 0; i--) {\n subG = subGraphs[i];\n\n selectAll('cluster').append('text');\n\n for (let j = 0; j < subG.nodes.length; j++) {\n log.warn(\n 'Setting subgraph',\n subG.nodes[j],\n flowDb.lookUpDomId(subG.nodes[j]),\n flowDb.lookUpDomId(subG.id)\n );\n g.setParent(flowDb.lookUpDomId(subG.nodes[j]), flowDb.lookUpDomId(subG.id));\n }\n }\n addVertices(vert, g, id);\n addEdges(edges, g);\n\n // Create the renderer\n const Render = dagreD3.render;\n const render = new Render();\n\n // Add custom shapes\n flowChartShapes.addToRender(render);\n\n // Add our custom arrow - an empty arrowhead\n render.arrows().none = function normal(parent, id, edge, type) {\n const marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n const path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');\n dagreD3.util.applyStyle(path, edge[type + 'Style']);\n };\n\n // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.\n render.arrows().normal = function normal(parent, id) {\n const marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n marker\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 z')\n .attr('class', 'arrowheadPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n };\n\n // Set up an SVG group so that we can translate the final graph.\n const svg = select(`[id=\"${id}\"]`);\n svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n log.warn(g);\n\n // Run the renderer. This is what draws the final graph.\n const element = select('#' + id + ' g');\n render(element, g);\n\n element.selectAll('g.node').attr('title', function () {\n return flowDb.getTooltip(this.id);\n });\n\n const padding = conf.diagramPadding;\n const svgBounds = svg.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n\n configureSvgSize(svg, height, width, conf.useMaxWidth);\n\n // Ensure the viewBox includes the whole svgBounds area with extra space for padding\n const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;\n log.debug(`viewBox ${vBox}`);\n svg.attr('viewBox', vBox);\n\n // Index nodes\n flowDb.indexNodes('subGraph' + i);\n\n // reposition labels\n for (i = 0; i < subGraphs.length; i++) {\n subG = subGraphs[i];\n if (subG.title !== 'undefined') {\n const clusterRects = document.querySelectorAll(\n '#' + id + ' [id=\"' + flowDb.lookUpDomId(subG.id) + '\"] rect'\n );\n const clusterEl = document.querySelectorAll(\n '#' + id + ' [id=\"' + flowDb.lookUpDomId(subG.id) + '\"]'\n );\n\n const xPos = clusterRects[0].x.baseVal.value;\n const yPos = clusterRects[0].y.baseVal.value;\n const width = clusterRects[0].width.baseVal.value;\n const cluster = select(clusterEl[0]);\n const te = cluster.select('.label');\n te.attr('transform', `translate(${xPos + width / 2}, ${yPos + 14})`);\n te.attr('id', id + 'Text');\n\n for (let j = 0; j < subG.classes.length; j++) {\n clusterEl[0].classList.add(subG.classes[j]);\n }\n }\n }\n\n // Add label rects for non html labels\n if (!evaluate(conf.htmlLabels) || true) { // eslint-disable-line\n const labels = document.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n for (let k = 0; k < labels.length; k++) {\n const label = labels[k];\n\n // Get dimensions of label\n const dim = label.getBBox();\n\n const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n // rect.setAttribute('style', 'fill:#e8e8e8;');\n\n label.insertBefore(rect, label.firstChild);\n }\n }\n\n // If node has a link, wrap it in an anchor SVG object.\n const keys = Object.keys(vert);\n keys.forEach(function (key) {\n const vertex = vert[key];\n\n if (vertex.link) {\n const node = select('#' + id + ' [id=\"' + flowDb.lookUpDomId(key) + '\"]');\n if (node) {\n const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');\n link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));\n link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);\n link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');\n if (vertex.linkTarget) {\n link.setAttributeNS('http://www.w3.org/2000/svg', 'target', vertex.linkTarget);\n }\n\n const linkNode = node.insert(function () {\n return link;\n }, ':first-child');\n\n const shape = node.select('.label-container');\n if (shape) {\n linkNode.append(function () {\n return shape.node();\n });\n }\n\n const label = node.select('.label');\n if (label) {\n linkNode.append(function () {\n return label.node();\n });\n }\n }\n }\n });\n};\n\nexport default {\n setConf,\n addVertices,\n addEdges,\n getClasses,\n draw,\n};\n","/**\n * Returns the styles given options\n *\n * @param {{\n * fontFamily: string;\n * nodeTextColor: string;\n * textColor: string;\n * titleColor: string;\n * mainBkg: string;\n * nodeBorder: string;\n * arrowheadColor: string;\n * lineColor: string;\n * edgeLabelBackground: string;\n * clusterBkg: string;\n * clusterBorder: string;\n * tertiaryColor: string;\n * border2: string;\n * }} options\n * The options for the styles\n * @returns {string} The resulting styles\n */\nconst getStyles = (options) =>\n `.label {\n font-family: ${options.fontFamily};\n color: ${options.nodeTextColor || options.textColor};\n }\n .cluster-label text {\n fill: ${options.titleColor};\n }\n .cluster-label span {\n color: ${options.titleColor};\n }\n\n .label text,span {\n fill: ${options.nodeTextColor || options.textColor};\n color: ${options.nodeTextColor || options.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${options.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${options.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${options.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${options.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${options.edgeLabelBackground};\n fill: ${options.edgeLabelBackground};\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ${options.clusterBkg};\n stroke: ${options.clusterBorder};\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${options.titleColor};\n }\n\n .cluster span {\n color: ${options.titleColor};\n }\n /* .cluster div {\n color: ${options.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${options.fontFamily};\n font-size: 12px;\n background: ${options.tertiaryColor};\n border: 1px solid ${options.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n`;\n\nexport default getStyles;\n","import moment from 'moment-mini';\nimport { sanitizeUrl } from '@braintree/sanitize-url';\nimport { log } from '../../logger';\nimport * as configApi from '../../config';\nimport utils from '../../utils';\nimport mermaidAPI from '../../mermaidAPI';\n\nlet dateFormat = '';\nlet axisFormat = '';\nlet todayMarker = '';\nlet includes = [];\nlet excludes = [];\nlet title = '';\nlet sections = [];\nlet tasks = [];\nlet currentSection = '';\nconst tags = ['active', 'done', 'crit', 'milestone'];\nlet funs = [];\nlet inclusiveEndDates = false;\nlet topAxis = false;\n\n// The serial order of the task in the script\nlet lastOrder = 0;\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nexport const clear = function () {\n sections = [];\n tasks = [];\n currentSection = '';\n funs = [];\n title = '';\n taskCnt = 0;\n lastTask = undefined;\n lastTaskID = undefined;\n rawTasks = [];\n dateFormat = '';\n axisFormat = '';\n todayMarker = '';\n includes = [];\n excludes = [];\n inclusiveEndDates = false;\n topAxis = false;\n lastOrder = 0;\n};\n\nexport const setAxisFormat = function (txt) {\n axisFormat = txt;\n};\n\nexport const getAxisFormat = function () {\n return axisFormat;\n};\n\nexport const setTodayMarker = function (txt) {\n todayMarker = txt;\n};\n\nexport const getTodayMarker = function () {\n return todayMarker;\n};\n\nexport const setDateFormat = function (txt) {\n dateFormat = txt;\n};\n\nexport const enableInclusiveEndDates = function () {\n inclusiveEndDates = true;\n};\n\nexport const endDatesAreInclusive = function () {\n return inclusiveEndDates;\n};\n\nexport const enableTopAxis = function () {\n topAxis = true;\n};\n\nexport const topAxisEnabled = function () {\n return topAxis;\n};\n\nexport const getDateFormat = function () {\n return dateFormat;\n};\n\nexport const setIncludes = function (txt) {\n includes = txt.toLowerCase().split(/[\\s,]+/);\n};\n\nexport const getIncludes = function () {\n return includes;\n};\nexport const setExcludes = function (txt) {\n excludes = txt.toLowerCase().split(/[\\s,]+/);\n};\n\nexport const getExcludes = function () {\n return excludes;\n};\n\nexport const setTitle = function (txt) {\n title = txt;\n};\n\nexport const getTitle = function () {\n return title;\n};\n\nexport const addSection = function (txt) {\n currentSection = txt;\n sections.push(txt);\n};\n\nexport const getSections = function () {\n return sections;\n};\n\nexport const getTasks = function () {\n let allItemsPricessed = compileTasks();\n const maxDepth = 10;\n let iterationCount = 0;\n while (!allItemsPricessed && iterationCount < maxDepth) {\n allItemsPricessed = compileTasks();\n iterationCount++;\n }\n\n tasks = rawTasks;\n\n return tasks;\n};\n\nexport const isInvalidDate = function (date, dateFormat, excludes, includes) {\n if (includes.indexOf(date.format(dateFormat.trim())) >= 0) {\n return false;\n }\n if (date.isoWeekday() >= 6 && excludes.indexOf('weekends') >= 0) {\n return true;\n }\n if (excludes.indexOf(date.format('dddd').toLowerCase()) >= 0) {\n return true;\n }\n return excludes.indexOf(date.format(dateFormat.trim())) >= 0;\n};\n\nconst checkTaskDates = function (task, dateFormat, excludes, includes) {\n if (!excludes.length || task.manualEndTime) return;\n let startTime = moment(task.startTime, dateFormat, true);\n startTime.add(1, 'd');\n let endTime = moment(task.endTime, dateFormat, true);\n let renderEndTime = fixTaskDates(startTime, endTime, dateFormat, excludes, includes);\n task.endTime = endTime.toDate();\n task.renderEndTime = renderEndTime;\n};\n\nconst fixTaskDates = function (startTime, endTime, dateFormat, excludes, includes) {\n let invalid = false;\n let renderEndTime = null;\n while (startTime <= endTime) {\n if (!invalid) {\n renderEndTime = endTime.toDate();\n }\n invalid = isInvalidDate(startTime, dateFormat, excludes, includes);\n if (invalid) {\n endTime.add(1, 'd');\n }\n startTime.add(1, 'd');\n }\n return renderEndTime;\n};\n\nconst getStartDate = function (prevTime, dateFormat, str) {\n str = str.trim();\n\n // Test for after\n const re = /^after\\s+([\\d\\w- ]+)/;\n const afterStatement = re.exec(str.trim());\n\n if (afterStatement !== null) {\n // check all after ids and take the latest\n let latestEndingTask = null;\n afterStatement[1].split(' ').forEach(function (id) {\n let task = findTaskById(id);\n if (typeof task !== 'undefined') {\n if (!latestEndingTask) {\n latestEndingTask = task;\n } else {\n if (task.endTime > latestEndingTask.endTime) {\n latestEndingTask = task;\n }\n }\n }\n });\n\n if (!latestEndingTask) {\n const dt = new Date();\n dt.setHours(0, 0, 0, 0);\n return dt;\n } else {\n return latestEndingTask.endTime;\n }\n }\n\n // Check for actual date set\n let mDate = moment(str, dateFormat.trim(), true);\n if (mDate.isValid()) {\n return mDate.toDate();\n } else {\n log.debug('Invalid date:' + str);\n log.debug('With date format:' + dateFormat.trim());\n }\n\n // Default date - now\n return new Date();\n};\n\nconst durationToDate = function (durationStatement, relativeTime) {\n if (durationStatement !== null) {\n switch (durationStatement[2]) {\n case 's':\n relativeTime.add(durationStatement[1], 'seconds');\n break;\n case 'm':\n relativeTime.add(durationStatement[1], 'minutes');\n break;\n case 'h':\n relativeTime.add(durationStatement[1], 'hours');\n break;\n case 'd':\n relativeTime.add(durationStatement[1], 'days');\n break;\n case 'w':\n relativeTime.add(durationStatement[1], 'weeks');\n break;\n }\n }\n // Default date - now\n return relativeTime.toDate();\n};\n\nconst getEndDate = function (prevTime, dateFormat, str, inclusive) {\n inclusive = inclusive || false;\n str = str.trim();\n\n // Check for actual date\n let mDate = moment(str, dateFormat.trim(), true);\n if (mDate.isValid()) {\n if (inclusive) {\n mDate.add(1, 'd');\n }\n return mDate.toDate();\n }\n\n return durationToDate(/^([\\d]+)([wdhms])/.exec(str.trim()), moment(prevTime));\n};\n\nlet taskCnt = 0;\nconst parseId = function (idStr) {\n if (typeof idStr === 'undefined') {\n taskCnt = taskCnt + 1;\n return 'task' + taskCnt;\n }\n return idStr;\n};\n// id, startDate, endDate\n// id, startDate, length\n// id, after x, endDate\n// id, after x, length\n// startDate, endDate\n// startDate, length\n// after x, endDate\n// after x, length\n// endDate\n// length\n\nconst compileData = function (prevTask, dataStr) {\n let ds;\n\n if (dataStr.substr(0, 1) === ':') {\n ds = dataStr.substr(1, dataStr.length);\n } else {\n ds = dataStr;\n }\n\n const data = ds.split(',');\n\n const task = {};\n\n // Get tags like active, done, crit and milestone\n getTaskTags(data, task, tags);\n\n for (let i = 0; i < data.length; i++) {\n data[i] = data[i].trim();\n }\n\n let endTimeData = '';\n switch (data.length) {\n case 1:\n task.id = parseId();\n task.startTime = prevTask.endTime;\n endTimeData = data[0];\n break;\n case 2:\n task.id = parseId();\n task.startTime = getStartDate(undefined, dateFormat, data[0]);\n endTimeData = data[1];\n break;\n case 3:\n task.id = parseId(data[0]);\n task.startTime = getStartDate(undefined, dateFormat, data[1]);\n endTimeData = data[2];\n break;\n default:\n }\n\n if (endTimeData) {\n task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates);\n task.manualEndTime = moment(endTimeData, 'YYYY-MM-DD', true).isValid();\n checkTaskDates(task, dateFormat, excludes, includes);\n }\n\n return task;\n};\n\nconst parseData = function (prevTaskId, dataStr) {\n let ds;\n if (dataStr.substr(0, 1) === ':') {\n ds = dataStr.substr(1, dataStr.length);\n } else {\n ds = dataStr;\n }\n\n const data = ds.split(',');\n\n const task = {};\n\n // Get tags like active, done, crit and milestone\n getTaskTags(data, task, tags);\n\n for (let i = 0; i < data.length; i++) {\n data[i] = data[i].trim();\n }\n\n switch (data.length) {\n case 1:\n task.id = parseId();\n task.startTime = {\n type: 'prevTaskEnd',\n id: prevTaskId,\n };\n task.endTime = {\n data: data[0],\n };\n break;\n case 2:\n task.id = parseId();\n task.startTime = {\n type: 'getStartDate',\n startData: data[0],\n };\n task.endTime = {\n data: data[1],\n };\n break;\n case 3:\n task.id = parseId(data[0]);\n task.startTime = {\n type: 'getStartDate',\n startData: data[1],\n };\n task.endTime = {\n data: data[2],\n };\n break;\n default:\n }\n\n return task;\n};\n\nlet lastTask;\nlet lastTaskID;\nlet rawTasks = [];\nconst taskDb = {};\nexport const addTask = function (descr, data) {\n const rawTask = {\n section: currentSection,\n type: currentSection,\n processed: false,\n manualEndTime: false,\n renderEndTime: null,\n raw: { data: data },\n task: descr,\n classes: [],\n };\n const taskInfo = parseData(lastTaskID, data);\n rawTask.raw.startTime = taskInfo.startTime;\n rawTask.raw.endTime = taskInfo.endTime;\n rawTask.id = taskInfo.id;\n rawTask.prevTaskId = lastTaskID;\n rawTask.active = taskInfo.active;\n rawTask.done = taskInfo.done;\n rawTask.crit = taskInfo.crit;\n rawTask.milestone = taskInfo.milestone;\n rawTask.order = lastOrder;\n\n lastOrder++;\n\n const pos = rawTasks.push(rawTask);\n\n lastTaskID = rawTask.id;\n // Store cross ref\n taskDb[rawTask.id] = pos - 1;\n};\n\nexport const findTaskById = function (id) {\n const pos = taskDb[id];\n return rawTasks[pos];\n};\n\nexport const addTaskOrg = function (descr, data) {\n const newTask = {\n section: currentSection,\n type: currentSection,\n description: descr,\n task: descr,\n classes: [],\n };\n const taskInfo = compileData(lastTask, data);\n newTask.startTime = taskInfo.startTime;\n newTask.endTime = taskInfo.endTime;\n newTask.id = taskInfo.id;\n newTask.active = taskInfo.active;\n newTask.done = taskInfo.done;\n newTask.crit = taskInfo.crit;\n newTask.milestone = taskInfo.milestone;\n lastTask = newTask;\n tasks.push(newTask);\n};\n\nconst compileTasks = function () {\n const compileTask = function (pos) {\n const task = rawTasks[pos];\n let startTime = '';\n switch (rawTasks[pos].raw.startTime.type) {\n case 'prevTaskEnd': {\n const prevTask = findTaskById(task.prevTaskId);\n task.startTime = prevTask.endTime;\n break;\n }\n case 'getStartDate':\n startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData);\n if (startTime) {\n rawTasks[pos].startTime = startTime;\n }\n break;\n }\n\n if (rawTasks[pos].startTime) {\n rawTasks[pos].endTime = getEndDate(\n rawTasks[pos].startTime,\n dateFormat,\n rawTasks[pos].raw.endTime.data,\n inclusiveEndDates\n );\n if (rawTasks[pos].endTime) {\n rawTasks[pos].processed = true;\n rawTasks[pos].manualEndTime = moment(\n rawTasks[pos].raw.endTime.data,\n 'YYYY-MM-DD',\n true\n ).isValid();\n checkTaskDates(rawTasks[pos], dateFormat, excludes, includes);\n }\n }\n\n return rawTasks[pos].processed;\n };\n\n let allProcessed = true;\n for (let i = 0; i < rawTasks.length; i++) {\n compileTask(i);\n\n allProcessed = allProcessed && rawTasks[i].processed;\n }\n return allProcessed;\n};\n\n/**\n * Called by parser when a link is found. Adds the URL to the vertex data.\n *\n * @param ids Comma separated list of ids\n * @param _linkStr URL to create a link for\n */\nexport const setLink = function (ids, _linkStr) {\n let linkStr = _linkStr;\n if (configApi.getConfig().securityLevel !== 'loose') {\n linkStr = sanitizeUrl(_linkStr);\n }\n ids.split(',').forEach(function (id) {\n let rawTask = findTaskById(id);\n if (typeof rawTask !== 'undefined') {\n pushFun(id, () => {\n window.open(linkStr, '_self');\n });\n }\n });\n setClass(ids, 'clickable');\n};\n\n/**\n * Called by parser when a special node is found, e.g. a clickable element.\n *\n * @param ids Comma separated list of ids\n * @param className Class to add\n */\nexport const setClass = function (ids, className) {\n ids.split(',').forEach(function (id) {\n let rawTask = findTaskById(id);\n if (typeof rawTask !== 'undefined') {\n rawTask.classes.push(className);\n }\n });\n};\n\nconst setClickFun = function (id, functionName, functionArgs) {\n if (configApi.getConfig().securityLevel !== 'loose') {\n return;\n }\n if (typeof functionName === 'undefined') {\n return;\n }\n\n let argList = [];\n if (typeof functionArgs === 'string') {\n /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */\n argList = functionArgs.split(/,(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/);\n for (let i = 0; i < argList.length; i++) {\n let item = argList[i].trim();\n /* Removes all double quotes at the start and end of an argument */\n /* This preserves all starting and ending whitespace inside */\n if (item.charAt(0) === '\"' && item.charAt(item.length - 1) === '\"') {\n item = item.substr(1, item.length - 2);\n }\n argList[i] = item;\n }\n }\n\n /* if no arguments passed into callback, default to passing in id */\n if (argList.length === 0) {\n argList.push(id);\n }\n\n let rawTask = findTaskById(id);\n if (typeof rawTask !== 'undefined') {\n pushFun(id, () => {\n utils.runFunc(functionName, ...argList);\n });\n }\n};\n\n/**\n * The callbackFunction is executed in a click event bound to the task with the specified id or the\n * task's assigned text\n *\n * @param id The task's id\n * @param callbackFunction A function to be executed when clicked on the task or the task's text\n */\nconst pushFun = function (id, callbackFunction) {\n funs.push(function () {\n // const elem = d3.select(element).select(`[id=\"${id}\"]`)\n const elem = document.querySelector(`[id=\"${id}\"]`);\n if (elem !== null) {\n elem.addEventListener('click', function () {\n callbackFunction();\n });\n }\n });\n funs.push(function () {\n // const elem = d3.select(element).select(`[id=\"${id}-text\"]`)\n const elem = document.querySelector(`[id=\"${id}-text\"]`);\n if (elem !== null) {\n elem.addEventListener('click', function () {\n callbackFunction();\n });\n }\n });\n};\n\n/**\n * Called by parser when a click definition is found. Registers an event handler.\n *\n * @param ids Comma separated list of ids\n * @param functionName Function to be called on click\n * @param functionArgs Function args the function should be called with\n */\nexport const setClickEvent = function (ids, functionName, functionArgs) {\n ids.split(',').forEach(function (id) {\n setClickFun(id, functionName, functionArgs);\n });\n setClass(ids, 'clickable');\n};\n\n/**\n * Binds all functions previously added to fun (specified through click) to the element\n *\n * @param element\n */\nexport const bindFunctions = function (element) {\n funs.forEach(function (fun) {\n fun(element);\n });\n};\n\nexport default {\n parseDirective,\n getConfig: () => configApi.getConfig().gantt,\n clear,\n setDateFormat,\n getDateFormat,\n enableInclusiveEndDates,\n endDatesAreInclusive,\n enableTopAxis,\n topAxisEnabled,\n setAxisFormat,\n getAxisFormat,\n setTodayMarker,\n getTodayMarker,\n setTitle,\n getTitle,\n addSection,\n getSections,\n getTasks,\n addTask,\n findTaskById,\n addTaskOrg,\n setIncludes,\n getIncludes,\n setExcludes,\n getExcludes,\n setClickEvent,\n setLink,\n bindFunctions,\n durationToDate,\n isInvalidDate,\n};\n\n/**\n * @param data\n * @param task\n * @param tags\n */\nfunction getTaskTags(data, task, tags) {\n let matchFound = true;\n while (matchFound) {\n matchFound = false;\n tags.forEach(function (t) {\n const pattern = '^\\\\s*' + t + '\\\\s*$';\n const regex = new RegExp(pattern);\n if (data[0].match(regex)) {\n task[t] = true;\n data.shift(1);\n matchFound = true;\n }\n });\n }\n}\n","import moment from 'moment-mini';\nimport {\n select,\n scaleTime,\n min,\n max,\n scaleLinear,\n interpolateHcl,\n axisBottom,\n axisTop,\n timeFormat,\n} from 'd3';\nimport { parser } from './parser/gantt';\nimport common from '../common/common';\nimport ganttDb from './ganttDb';\nimport { getConfig } from '../../config';\nimport { configureSvgSize } from '../../utils';\n\nparser.yy = ganttDb;\nexport const setConf = function () {\n // const keys = Object.keys(cnf);\n // keys.forEach(function(key) {\n // conf[key] = cnf[key];\n // });\n};\nlet w;\nexport const draw = function (text, id) {\n const conf = getConfig().gantt;\n parser.yy.clear();\n parser.parse(text);\n\n const elem = document.getElementById(id);\n w = elem.parentElement.offsetWidth;\n\n if (typeof w === 'undefined') {\n w = 1200;\n }\n\n if (typeof conf.useWidth !== 'undefined') {\n w = conf.useWidth;\n }\n\n const taskArray = parser.yy.getTasks();\n\n // Set height based on number of tasks\n const h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;\n\n // Set viewBox\n elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h);\n const svg = select(`[id=\"${id}\"]`);\n\n // Set timescale\n const timeScale = scaleTime()\n .domain([\n min(taskArray, function (d) {\n return d.startTime;\n }),\n max(taskArray, function (d) {\n return d.endTime;\n }),\n ])\n .rangeRound([0, w - conf.leftPadding - conf.rightPadding]);\n\n let categories = [];\n\n for (let i = 0; i < taskArray.length; i++) {\n categories.push(taskArray[i].type);\n }\n\n const catsUnfiltered = categories; // for vert labels\n\n categories = checkUnique(categories);\n\n /**\n * @param a\n * @param b\n */\n function taskCompare(a, b) {\n const taskA = a.startTime;\n const taskB = b.startTime;\n let result = 0;\n if (taskA > taskB) {\n result = 1;\n } else if (taskA < taskB) {\n result = -1;\n }\n return result;\n }\n\n // Sort the task array using the above taskCompare() so that\n // tasks are created based on their order of startTime\n taskArray.sort(taskCompare);\n\n makeGant(taskArray, w, h);\n\n configureSvgSize(svg, h, w, conf.useMaxWidth);\n\n svg\n .append('text')\n .text(parser.yy.getTitle())\n .attr('x', w / 2)\n .attr('y', conf.titleTopMargin)\n .attr('class', 'titleText');\n\n /**\n * @param tasks\n * @param pageWidth\n * @param pageHeight\n */\n function makeGant(tasks, pageWidth, pageHeight) {\n const barHeight = conf.barHeight;\n const gap = barHeight + conf.barGap;\n const topPadding = conf.topPadding;\n const leftPadding = conf.leftPadding;\n\n const colorScale = scaleLinear()\n .domain([0, categories.length])\n .range(['#00B9FA', '#F95002'])\n .interpolate(interpolateHcl);\n\n drawExcludeDays(\n gap,\n topPadding,\n leftPadding,\n pageWidth,\n pageHeight,\n tasks,\n parser.yy.getExcludes(),\n parser.yy.getIncludes()\n );\n makeGrid(leftPadding, topPadding, pageWidth, pageHeight);\n drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight);\n vertLabels(gap, topPadding, leftPadding, barHeight, colorScale);\n drawToday(leftPadding, topPadding, pageWidth, pageHeight);\n }\n\n /**\n * @param theArray\n * @param theGap\n * @param theTopPad\n * @param theSidePad\n * @param theBarHeight\n * @param theColorScale\n * @param w\n */\n function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w) {\n // Draw background rects covering the entire width of the graph, these form the section rows.\n svg\n .append('g')\n .selectAll('rect')\n .data(theArray)\n .enter()\n .append('rect')\n .attr('x', 0)\n .attr('y', function (d, i) {\n // Ignore the incoming i value and use our order instead\n i = d.order;\n return i * theGap + theTopPad - 2;\n })\n .attr('width', function () {\n return w - conf.rightPadding / 2;\n })\n .attr('height', theGap)\n .attr('class', function (d) {\n for (let i = 0; i < categories.length; i++) {\n if (d.type === categories[i]) {\n return 'section section' + (i % conf.numberSectionStyles);\n }\n }\n return 'section section0';\n });\n\n // Draw the rects representing the tasks\n const rectangles = svg.append('g').selectAll('rect').data(theArray).enter();\n\n rectangles\n .append('rect')\n .attr('id', function (d) {\n return d.id;\n })\n .attr('rx', 3)\n .attr('ry', 3)\n .attr('x', function (d) {\n if (d.milestone) {\n return (\n timeScale(d.startTime) +\n theSidePad +\n 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) -\n 0.5 * theBarHeight\n );\n }\n return timeScale(d.startTime) + theSidePad;\n })\n .attr('y', function (d, i) {\n // Ignore the incoming i value and use our order instead\n i = d.order;\n return i * theGap + theTopPad;\n })\n .attr('width', function (d) {\n if (d.milestone) {\n return theBarHeight;\n }\n return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);\n })\n .attr('height', theBarHeight)\n .attr('transform-origin', function (d, i) {\n // Ignore the incoming i value and use our order instead\n i = d.order;\n\n return (\n (\n timeScale(d.startTime) +\n theSidePad +\n 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))\n ).toString() +\n 'px ' +\n (i * theGap + theTopPad + 0.5 * theBarHeight).toString() +\n 'px'\n );\n })\n .attr('class', function (d) {\n const res = 'task';\n\n let classStr = '';\n if (d.classes.length > 0) {\n classStr = d.classes.join(' ');\n }\n\n let secNum = 0;\n for (let i = 0; i < categories.length; i++) {\n if (d.type === categories[i]) {\n secNum = i % conf.numberSectionStyles;\n }\n }\n\n let taskClass = '';\n if (d.active) {\n if (d.crit) {\n taskClass += ' activeCrit';\n } else {\n taskClass = ' active';\n }\n } else if (d.done) {\n if (d.crit) {\n taskClass = ' doneCrit';\n } else {\n taskClass = ' done';\n }\n } else {\n if (d.crit) {\n taskClass += ' crit';\n }\n }\n\n if (taskClass.length === 0) {\n taskClass = ' task';\n }\n\n if (d.milestone) {\n taskClass = ' milestone ' + taskClass;\n }\n\n taskClass += secNum;\n\n taskClass += ' ' + classStr;\n\n return res + taskClass;\n });\n\n // Append task labels\n rectangles\n .append('text')\n .attr('id', function (d) {\n return d.id + '-text';\n })\n .text(function (d) {\n return d.task;\n })\n .attr('font-size', conf.fontSize)\n .attr('x', function (d) {\n let startX = timeScale(d.startTime);\n let endX = timeScale(d.renderEndTime || d.endTime);\n if (d.milestone) {\n startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;\n }\n if (d.milestone) {\n endX = startX + theBarHeight;\n }\n const textWidth = this.getBBox().width;\n\n // Check id text width > width of rectangle\n if (textWidth > endX - startX) {\n if (endX + textWidth + 1.5 * conf.leftPadding > w) {\n return startX + theSidePad - 5;\n } else {\n return endX + theSidePad + 5;\n }\n } else {\n return (endX - startX) / 2 + startX + theSidePad;\n }\n })\n .attr('y', function (d, i) {\n // Ignore the incoming i value and use our order instead\n i = d.order;\n return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;\n })\n .attr('text-height', theBarHeight)\n .attr('class', function (d) {\n const startX = timeScale(d.startTime);\n let endX = timeScale(d.endTime);\n if (d.milestone) {\n endX = startX + theBarHeight;\n }\n const textWidth = this.getBBox().width;\n\n let classStr = '';\n if (d.classes.length > 0) {\n classStr = d.classes.join(' ');\n }\n\n let secNum = 0;\n for (let i = 0; i < categories.length; i++) {\n if (d.type === categories[i]) {\n secNum = i % conf.numberSectionStyles;\n }\n }\n\n let taskType = '';\n if (d.active) {\n if (d.crit) {\n taskType = 'activeCritText' + secNum;\n } else {\n taskType = 'activeText' + secNum;\n }\n }\n\n if (d.done) {\n if (d.crit) {\n taskType = taskType + ' doneCritText' + secNum;\n } else {\n taskType = taskType + ' doneText' + secNum;\n }\n } else {\n if (d.crit) {\n taskType = taskType + ' critText' + secNum;\n }\n }\n\n if (d.milestone) {\n taskType += ' milestoneText';\n }\n\n // Check id text width > width of rectangle\n if (textWidth > endX - startX) {\n if (endX + textWidth + 1.5 * conf.leftPadding > w) {\n return classStr + ' taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;\n } else {\n return (\n classStr +\n ' taskTextOutsideRight taskTextOutside' +\n secNum +\n ' ' +\n taskType +\n ' width-' +\n textWidth\n );\n }\n } else {\n return classStr + ' taskText taskText' + secNum + ' ' + taskType + ' width-' + textWidth;\n }\n });\n }\n /**\n * @param theGap\n * @param theTopPad\n * @param theSidePad\n * @param w\n * @param h\n * @param tasks\n * @param excludes\n * @param includes\n */\n function drawExcludeDays(theGap, theTopPad, theSidePad, w, h, tasks, excludes, includes) {\n const minTime = tasks.reduce(\n (min, { startTime }) => (min ? Math.min(min, startTime) : startTime),\n 0\n );\n const maxTime = tasks.reduce((max, { endTime }) => (max ? Math.max(max, endTime) : endTime), 0);\n const dateFormat = parser.yy.getDateFormat();\n if (!minTime || !maxTime) return;\n\n const excludeRanges = [];\n let range = null;\n let d = moment(minTime);\n while (d.valueOf() <= maxTime) {\n if (parser.yy.isInvalidDate(d, dateFormat, excludes, includes)) {\n if (!range) {\n range = {\n start: d.clone(),\n end: d.clone(),\n };\n } else {\n range.end = d.clone();\n }\n } else {\n if (range) {\n excludeRanges.push(range);\n range = null;\n }\n }\n d.add(1, 'd');\n }\n\n const rectangles = svg.append('g').selectAll('rect').data(excludeRanges).enter();\n\n rectangles\n .append('rect')\n .attr('id', function (d) {\n return 'exclude-' + d.start.format('YYYY-MM-DD');\n })\n .attr('x', function (d) {\n return timeScale(d.start) + theSidePad;\n })\n .attr('y', conf.gridLineStartPadding)\n .attr('width', function (d) {\n const renderEnd = d.end.clone().add(1, 'day');\n return timeScale(renderEnd) - timeScale(d.start);\n })\n .attr('height', h - theTopPad - conf.gridLineStartPadding)\n .attr('transform-origin', function (d, i) {\n return (\n (\n timeScale(d.start) +\n theSidePad +\n 0.5 * (timeScale(d.end) - timeScale(d.start))\n ).toString() +\n 'px ' +\n (i * theGap + 0.5 * h).toString() +\n 'px'\n );\n })\n .attr('class', 'exclude-range');\n }\n\n /**\n * @param theSidePad\n * @param theTopPad\n * @param w\n * @param h\n */\n function makeGrid(theSidePad, theTopPad, w, h) {\n let bottomXAxis = axisBottom(timeScale)\n .tickSize(-h + theTopPad + conf.gridLineStartPadding)\n .tickFormat(timeFormat(parser.yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));\n\n svg\n .append('g')\n .attr('class', 'grid')\n .attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')')\n .call(bottomXAxis)\n .selectAll('text')\n .style('text-anchor', 'middle')\n .attr('fill', '#000')\n .attr('stroke', 'none')\n .attr('font-size', 10)\n .attr('dy', '1em');\n\n if (ganttDb.topAxisEnabled() || conf.topAxis) {\n let topXAxis = axisTop(timeScale)\n .tickSize(-h + theTopPad + conf.gridLineStartPadding)\n .tickFormat(timeFormat(parser.yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));\n\n svg\n .append('g')\n .attr('class', 'grid')\n .attr('transform', 'translate(' + theSidePad + ', ' + theTopPad + ')')\n .call(topXAxis)\n .selectAll('text')\n .style('text-anchor', 'middle')\n .attr('fill', '#000')\n .attr('stroke', 'none')\n .attr('font-size', 10);\n // .attr('dy', '1em');\n }\n }\n\n /**\n * @param theGap\n * @param theTopPad\n */\n function vertLabels(theGap, theTopPad) {\n const numOccurances = [];\n let prevGap = 0;\n\n for (let i = 0; i < categories.length; i++) {\n numOccurances[i] = [categories[i], getCount(categories[i], catsUnfiltered)];\n }\n\n svg\n .append('g') // without doing this, impossible to put grid lines behind text\n .selectAll('text')\n .data(numOccurances)\n .enter()\n .append(function (d) {\n const rows = d[0].split(common.lineBreakRegex);\n const dy = -(rows.length - 1) / 2;\n\n const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('dy', dy + 'em');\n\n for (let j = 0; j < rows.length; j++) {\n const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttribute('alignment-baseline', 'central');\n tspan.setAttribute('x', '10');\n if (j > 0) tspan.setAttribute('dy', '1em');\n tspan.textContent = rows[j];\n svgLabel.appendChild(tspan);\n }\n return svgLabel;\n })\n .attr('x', 10)\n .attr('y', function (d, i) {\n if (i > 0) {\n for (let j = 0; j < i; j++) {\n prevGap += numOccurances[i - 1][1];\n return (d[1] * theGap) / 2 + prevGap * theGap + theTopPad;\n }\n } else {\n return (d[1] * theGap) / 2 + theTopPad;\n }\n })\n .attr('font-size', conf.sectionFontSize)\n .attr('font-size', conf.sectionFontSize)\n .attr('class', function (d) {\n for (let i = 0; i < categories.length; i++) {\n if (d[0] === categories[i]) {\n return 'sectionTitle sectionTitle' + (i % conf.numberSectionStyles);\n }\n }\n return 'sectionTitle';\n });\n }\n\n /**\n * @param theSidePad\n * @param theTopPad\n * @param w\n * @param h\n */\n function drawToday(theSidePad, theTopPad, w, h) {\n const todayMarker = ganttDb.getTodayMarker();\n if (todayMarker === 'off') {\n return;\n }\n\n const todayG = svg.append('g').attr('class', 'today');\n const today = new Date();\n const todayLine = todayG.append('line');\n\n todayLine\n .attr('x1', timeScale(today) + theSidePad)\n .attr('x2', timeScale(today) + theSidePad)\n .attr('y1', conf.titleTopMargin)\n .attr('y2', h - conf.titleTopMargin)\n .attr('class', 'today');\n\n if (todayMarker !== '') {\n todayLine.attr('style', todayMarker.replace(/,/g, ';'));\n }\n }\n\n /**\n * From this stackexchange question:\n * http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript\n *\n * @param arr\n */\n function checkUnique(arr) {\n const hash = {};\n const result = [];\n for (let i = 0, l = arr.length; i < l; ++i) {\n if (!Object.prototype.hasOwnProperty.call(hash, arr[i])) {\n // eslint-disable-line\n // it works with objects! in FF, at least\n hash[arr[i]] = true;\n result.push(arr[i]);\n }\n }\n return result;\n }\n\n /**\n * From this stackexchange question:\n * http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array\n *\n * @param arr\n */\n function getCounts(arr) {\n let i = arr.length; // const to loop over\n const obj = {}; // obj to store results\n while (i) {\n obj[arr[--i]] = (obj[arr[i]] || 0) + 1; // count occurrences\n }\n return obj;\n }\n\n /**\n * Get specific from everything\n *\n * @param word\n * @param arr\n */\n function getCount(word, arr) {\n return getCounts(arr)[word] || 0;\n }\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `\n .mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n .exclude-range {\n fill: ${options.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${options.sectionBkgColor};\n }\n\n .section2 {\n fill: ${options.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${options.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${options.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${options.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${options.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${options.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n // font-size: ${options.ganttFontSize};\n // text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${options.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ${options.fontFamily};\n fill: ${options.textColor};\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${options.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n // .taskText:not([font-size]) {\n // font-size: ${options.ganttFontSize};\n // }\n\n .taskTextOutsideRight {\n fill: ${options.taskTextDarkColor};\n text-anchor: start;\n // font-size: ${options.ganttFontSize};\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ${options.taskTextDarkColor};\n text-anchor: end;\n // font-size: ${options.ganttFontSize};\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ${options.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${options.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${options.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${options.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${options.taskBkgColor};\n stroke: ${options.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${options.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${options.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${options.activeTaskBkgColor};\n stroke: ${options.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${options.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${options.doneTaskBorderColor};\n fill: ${options.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${options.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${options.critBorderColor};\n fill: ${options.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${options.critBorderColor};\n fill: ${options.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${options.critBorderColor};\n fill: ${options.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${options.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${options.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${options.textColor} ;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n`;\n\nexport default getStyles;\n","import { log } from '../../logger';\nimport { random } from '../../utils';\nlet commits = {};\nlet head = null;\nlet branches = { master: head };\nlet curBranch = 'master';\nlet direction = 'LR';\nlet seq = 0;\n\nfunction getId() {\n return random({ length: 7 });\n}\n\n/**\n * @param currentCommit\n * @param otherCommit\n */\nfunction isfastforwardable(currentCommit, otherCommit) {\n log.debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id);\n while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {\n // only if other branch has more commits\n if (otherCommit.parent == null) break;\n if (Array.isArray(otherCommit.parent)) {\n log.debug('In merge commit:', otherCommit.parent);\n return (\n isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) ||\n isfastforwardable(currentCommit, commits[otherCommit.parent[1]])\n );\n } else {\n otherCommit = commits[otherCommit.parent];\n }\n }\n log.debug(currentCommit.id, otherCommit.id);\n return currentCommit.id === otherCommit.id;\n}\n\n/**\n * @param currentCommit\n * @param otherCommit\n */\nfunction isReachableFrom(currentCommit, otherCommit) {\n const currentSeq = currentCommit.seq;\n const otherSeq = otherCommit.seq;\n if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit);\n return false;\n}\n\n/**\n * @param list\n * @param fn\n */\nfunction uniqBy(list, fn) {\n const recordMap = Object.create(null);\n return list.reduce((out, item) => {\n const key = fn(item);\n if (!recordMap[key]) {\n recordMap[key] = true;\n out.push(item);\n }\n return out;\n }, []);\n}\n\nexport const setDirection = function (dir) {\n direction = dir;\n};\nlet options = {};\nexport const setOptions = function (rawOptString) {\n log.debug('options str', rawOptString);\n rawOptString = rawOptString && rawOptString.trim();\n rawOptString = rawOptString || '{}';\n try {\n options = JSON.parse(rawOptString);\n } catch (e) {\n log.error('error while parsing gitGraph options', e.message);\n }\n};\n\nexport const getOptions = function () {\n return options;\n};\n\nexport const commit = function (msg) {\n const commit = {\n id: getId(),\n message: msg,\n seq: seq++,\n parent: head == null ? null : head.id,\n };\n head = commit;\n commits[commit.id] = commit;\n branches[curBranch] = commit.id;\n log.debug('in pushCommit ' + commit.id);\n};\n\nexport const branch = function (name) {\n branches[name] = head != null ? head.id : null;\n log.debug('in createBranch');\n};\n\nexport const merge = function (otherBranch) {\n const currentCommit = commits[branches[curBranch]];\n const otherCommit = commits[branches[otherBranch]];\n if (isReachableFrom(currentCommit, otherCommit)) {\n log.debug('Already merged');\n return;\n }\n if (isfastforwardable(currentCommit, otherCommit)) {\n branches[curBranch] = branches[otherBranch];\n head = commits[branches[curBranch]];\n } else {\n // create merge commit\n const commit = {\n id: getId(),\n message: 'merged branch ' + otherBranch + ' into ' + curBranch,\n seq: seq++,\n parent: [head == null ? null : head.id, branches[otherBranch]],\n };\n head = commit;\n commits[commit.id] = commit;\n branches[curBranch] = commit.id;\n }\n log.debug(branches);\n log.debug('in mergeBranch');\n};\n\nexport const checkout = function (branch) {\n log.debug('in checkout');\n curBranch = branch;\n const id = branches[curBranch];\n head = commits[id];\n};\n\nexport const reset = function (commitRef) {\n log.debug('in reset', commitRef);\n const ref = commitRef.split(':')[0];\n let parentCount = parseInt(commitRef.split(':')[1]);\n let commit = ref === 'HEAD' ? head : commits[branches[ref]];\n log.debug(commit, parentCount);\n while (parentCount > 0) {\n commit = commits[commit.parent];\n parentCount--;\n if (!commit) {\n const err = 'Critical error - unique parent commit not found during reset';\n log.error(err);\n throw err;\n }\n }\n head = commit;\n branches[curBranch] = commit.id;\n};\n\n/**\n * @param arr\n * @param key\n * @param newval\n */\nfunction upsert(arr, key, newval) {\n const index = arr.indexOf(key);\n if (index === -1) {\n arr.push(newval);\n } else {\n arr.splice(index, 1, newval);\n }\n}\n\n/** @param commitArr */\nfunction prettyPrintCommitHistory(commitArr) {\n const commit = commitArr.reduce((out, commit) => {\n if (out.seq > commit.seq) return out;\n return commit;\n }, commitArr[0]);\n let line = '';\n commitArr.forEach(function (c) {\n if (c === commit) {\n line += '\\t*';\n } else {\n line += '\\t|';\n }\n });\n const label = [line, commit.id, commit.seq];\n for (let branch in branches) {\n if (branches[branch] === commit.id) label.push(branch);\n }\n log.debug(label.join(' '));\n if (Array.isArray(commit.parent)) {\n const newCommit = commits[commit.parent[0]];\n upsert(commitArr, commit, newCommit);\n commitArr.push(commits[commit.parent[1]]);\n } else if (commit.parent == null) {\n return;\n } else {\n const nextCommit = commits[commit.parent];\n upsert(commitArr, commit, nextCommit);\n }\n commitArr = uniqBy(commitArr, (c) => c.id);\n prettyPrintCommitHistory(commitArr);\n}\n\nexport const prettyPrint = function () {\n log.debug(commits);\n const node = getCommitsArray()[0];\n prettyPrintCommitHistory([node]);\n};\n\nexport const clear = function () {\n commits = {};\n head = null;\n branches = { master: head };\n curBranch = 'master';\n seq = 0;\n};\n\nexport const getBranchesAsObjArray = function () {\n const branchArr = [];\n for (let branch in branches) {\n branchArr.push({ name: branch, commit: commits[branches[branch]] });\n }\n return branchArr;\n};\n\nexport const getBranches = function () {\n return branches;\n};\nexport const getCommits = function () {\n return commits;\n};\nexport const getCommitsArray = function () {\n const commitArr = Object.keys(commits).map(function (key) {\n return commits[key];\n });\n commitArr.forEach(function (o) {\n log.debug(o.id);\n });\n commitArr.sort((a, b) => b.seq - a.seq);\n return commitArr;\n};\nexport const getCurrentBranch = function () {\n return curBranch;\n};\nexport const getDirection = function () {\n return direction;\n};\nexport const getHead = function () {\n return head;\n};\n\nexport default {\n setDirection,\n setOptions,\n getOptions,\n commit,\n branch,\n merge,\n checkout,\n reset,\n prettyPrint,\n clear,\n getBranchesAsObjArray,\n getBranches,\n getCommits,\n getCommitsArray,\n getCurrentBranch,\n getDirection,\n getHead,\n};\n","import { curveBasis, line, select } from 'd3';\n\nimport db from './gitGraphAst';\nimport gitGraphParser from './parser/gitGraph';\nimport { log } from '../../logger';\nimport { interpolateToCurve } from '../../utils';\n\nlet allCommitsDict = {};\nlet branchNum;\nlet config = {\n nodeSpacing: 150,\n nodeFillColor: 'yellow',\n nodeStrokeWidth: 2,\n nodeStrokeColor: 'grey',\n lineStrokeWidth: 4,\n branchOffset: 50,\n lineColor: 'grey',\n leftMargin: 50,\n branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],\n nodeRadius: 10,\n nodeLabel: {\n width: 75,\n height: 100,\n x: -25,\n y: 0,\n },\n};\nlet apiConfig = {};\nexport const setConf = function (c) {\n apiConfig = c;\n};\n\n/** @param svg */\nfunction svgCreateDefs(svg) {\n svg\n .append('defs')\n .append('g')\n .attr('id', 'def-commit')\n .append('circle')\n .attr('r', config.nodeRadius)\n .attr('cx', 0)\n .attr('cy', 0);\n svg\n .select('#def-commit')\n .append('foreignObject')\n .attr('width', config.nodeLabel.width)\n .attr('height', config.nodeLabel.height)\n .attr('x', config.nodeLabel.x)\n .attr('y', config.nodeLabel.y)\n .attr('class', 'node-label')\n .attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility')\n .append('p')\n .html('');\n}\n\n/**\n * @param svg\n * @param points\n * @param colorIdx\n * @param interpolate\n */\nfunction svgDrawLine(svg, points, colorIdx, interpolate) {\n const curve = interpolateToCurve(interpolate, curveBasis);\n const color = config.branchColors[colorIdx % config.branchColors.length];\n const lineGen = line()\n .x(function (d) {\n return Math.round(d.x);\n })\n .y(function (d) {\n return Math.round(d.y);\n })\n .curve(curve);\n\n svg\n .append('svg:path')\n .attr('d', lineGen(points))\n .style('stroke', color)\n .style('stroke-width', config.lineStrokeWidth)\n .style('fill', 'none');\n}\n\n/**\n * Pass in the element and its pre-transform coords\n *\n * @param element\n * @param coords\n */\nfunction getElementCoords(element, coords) {\n coords = coords || element.node().getBBox();\n const ctm = element.node().getCTM();\n const xn = ctm.e + coords.x * ctm.a;\n const yn = ctm.f + coords.y * ctm.d;\n return {\n left: xn,\n top: yn,\n width: coords.width,\n height: coords.height,\n };\n}\n\n/**\n * @param svg\n * @param fromId\n * @param toId\n * @param direction\n * @param color\n */\nfunction svgDrawLineForCommits(svg, fromId, toId, direction, color) {\n log.debug('svgDrawLineForCommits: ', fromId, toId);\n const fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));\n const toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));\n switch (direction) {\n case 'LR':\n // (toBbox)\n // +--------\n // + (fromBbox)\n if (fromBbox.left - toBbox.left > config.nodeSpacing) {\n const lineStart = {\n x: fromBbox.left - config.nodeSpacing,\n y: toBbox.top + toBbox.height / 2,\n };\n const lineEnd = { x: toBbox.left + toBbox.width, y: toBbox.top + toBbox.height / 2 };\n svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');\n svgDrawLine(\n svg,\n [\n { x: fromBbox.left, y: fromBbox.top + fromBbox.height / 2 },\n { x: fromBbox.left - config.nodeSpacing / 2, y: fromBbox.top + fromBbox.height / 2 },\n { x: fromBbox.left - config.nodeSpacing / 2, y: lineStart.y },\n lineStart,\n ],\n color\n );\n } else {\n svgDrawLine(\n svg,\n [\n {\n x: fromBbox.left,\n y: fromBbox.top + fromBbox.height / 2,\n },\n {\n x: fromBbox.left - config.nodeSpacing / 2,\n y: fromBbox.top + fromBbox.height / 2,\n },\n {\n x: fromBbox.left - config.nodeSpacing / 2,\n y: toBbox.top + toBbox.height / 2,\n },\n {\n x: toBbox.left + toBbox.width,\n y: toBbox.top + toBbox.height / 2,\n },\n ],\n color\n );\n }\n break;\n case 'BT':\n // + (fromBbox)\n // |\n // |\n // + (toBbox)\n if (toBbox.top - fromBbox.top > config.nodeSpacing) {\n const lineStart = {\n x: toBbox.left + toBbox.width / 2,\n y: fromBbox.top + fromBbox.height + config.nodeSpacing,\n };\n const lineEnd = { x: toBbox.left + toBbox.width / 2, y: toBbox.top };\n svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');\n svgDrawLine(\n svg,\n [\n { x: fromBbox.left + fromBbox.width / 2, y: fromBbox.top + fromBbox.height },\n {\n x: fromBbox.left + fromBbox.width / 2,\n y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2,\n },\n { x: toBbox.left + toBbox.width / 2, y: lineStart.y - config.nodeSpacing / 2 },\n lineStart,\n ],\n color\n );\n } else {\n svgDrawLine(\n svg,\n [\n {\n x: fromBbox.left + fromBbox.width / 2,\n y: fromBbox.top + fromBbox.height,\n },\n {\n x: fromBbox.left + fromBbox.width / 2,\n y: fromBbox.top + config.nodeSpacing / 2,\n },\n {\n x: toBbox.left + toBbox.width / 2,\n y: toBbox.top - config.nodeSpacing / 2,\n },\n {\n x: toBbox.left + toBbox.width / 2,\n y: toBbox.top,\n },\n ],\n color\n );\n }\n break;\n }\n}\n\n/**\n * @param svg\n * @param selector\n */\nfunction cloneNode(svg, selector) {\n return svg.select(selector).node().cloneNode(true);\n}\n\n/**\n * @param svg\n * @param commitid\n * @param branches\n * @param direction\n */\nfunction renderCommitHistory(svg, commitid, branches, direction) {\n let commit;\n const numCommits = Object.keys(allCommitsDict).length;\n if (typeof commitid === 'string') {\n do {\n commit = allCommitsDict[commitid];\n log.debug('in renderCommitHistory', commit.id, commit.seq);\n if (svg.select('#node-' + commitid).size() > 0) {\n return;\n }\n svg\n .append(function () {\n return cloneNode(svg, '#def-commit');\n })\n .attr('class', 'commit')\n .attr('id', function () {\n return 'node-' + commit.id;\n })\n .attr('transform', function () {\n switch (direction) {\n case 'LR':\n return (\n 'translate(' +\n (commit.seq * config.nodeSpacing + config.leftMargin) +\n ', ' +\n branchNum * config.branchOffset +\n ')'\n );\n case 'BT':\n return (\n 'translate(' +\n (branchNum * config.branchOffset + config.leftMargin) +\n ', ' +\n (numCommits - commit.seq) * config.nodeSpacing +\n ')'\n );\n }\n })\n .attr('fill', config.nodeFillColor)\n .attr('stroke', config.nodeStrokeColor)\n .attr('stroke-width', config.nodeStrokeWidth);\n\n let branch;\n for (let branchName in branches) {\n if (branches[branchName].commit === commit) {\n branch = branches[branchName];\n break;\n }\n }\n if (branch) {\n log.debug('found branch ', branch.name);\n svg\n .select('#node-' + commit.id + ' p')\n .append('xhtml:span')\n .attr('class', 'branch-label')\n .text(branch.name + ', ');\n }\n svg\n .select('#node-' + commit.id + ' p')\n .append('xhtml:span')\n .attr('class', 'commit-id')\n .text(commit.id);\n if (commit.message !== '' && direction === 'BT') {\n svg\n .select('#node-' + commit.id + ' p')\n .append('xhtml:span')\n .attr('class', 'commit-msg')\n .text(', ' + commit.message);\n }\n commitid = commit.parent;\n } while (commitid && allCommitsDict[commitid]);\n }\n\n if (Array.isArray(commitid)) {\n log.debug('found merge commmit', commitid);\n renderCommitHistory(svg, commitid[0], branches, direction);\n branchNum++;\n renderCommitHistory(svg, commitid[1], branches, direction);\n branchNum--;\n }\n}\n\n/**\n * @param svg\n * @param commit\n * @param direction\n * @param branchColor\n */\nfunction renderLines(svg, commit, direction, branchColor) {\n branchColor = branchColor || 0;\n while (commit.seq > 0 && !commit.lineDrawn) {\n if (typeof commit.parent === 'string') {\n svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor);\n commit.lineDrawn = true;\n commit = allCommitsDict[commit.parent];\n } else if (Array.isArray(commit.parent)) {\n svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor);\n svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1);\n renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1);\n commit.lineDrawn = true;\n commit = allCommitsDict[commit.parent[0]];\n }\n }\n}\n\nexport const draw = function (txt, id, ver) {\n try {\n const parser = gitGraphParser.parser;\n parser.yy = db;\n parser.yy.clear();\n\n log.debug('in gitgraph renderer', txt + '\\n', 'id:', id, ver);\n // Parse the graph definition\n parser.parse(txt + '\\n');\n\n config = Object.assign(config, apiConfig, db.getOptions());\n log.debug('effective options', config);\n const direction = db.getDirection();\n allCommitsDict = db.getCommits();\n const branches = db.getBranchesAsObjArray();\n if (direction === 'BT') {\n config.nodeLabel.x = branches.length * config.branchOffset;\n config.nodeLabel.width = '100%';\n config.nodeLabel.y = -1 * 2 * config.nodeRadius;\n }\n const svg = select(`[id=\"${id}\"]`);\n svgCreateDefs(svg);\n branchNum = 1;\n for (let branch in branches) {\n const v = branches[branch];\n renderCommitHistory(svg, v.commit.id, branches, direction);\n renderLines(svg, v.commit, direction);\n branchNum++;\n }\n svg.attr('height', function () {\n if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;\n return (branches.length + 1) * config.branchOffset;\n });\n } catch (e) {\n log.error('Error while rendering gitgraph');\n log.error(e.message);\n }\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = () =>\n `\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n`;\n\nexport default getStyles;\n","/** Created by knut on 15-01-14. */\nimport { log } from '../../logger';\n\nvar message = '';\nvar info = false;\n\nexport const setMessage = (txt) => {\n log.debug('Setting message to: ' + txt);\n message = txt;\n};\n\nexport const getMessage = () => {\n return message;\n};\n\nexport const setInfo = (inf) => {\n info = inf;\n};\n\nexport const getInfo = () => {\n return info;\n};\n\n// export const parseError = (err, hash) => {\n// global.mermaidAPI.parseError(err, hash)\n// }\n\nexport default {\n setMessage,\n getMessage,\n setInfo,\n getInfo,\n // parseError\n};\n","/** Created by knut on 14-12-11. */\nimport { select } from 'd3';\nimport db from './infoDb';\nimport infoParser from './parser/info';\nimport { log } from '../../logger';\n\nconst conf = {};\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n};\n\n/**\n * Draws a an info picture in the tag with id: id based on the graph definition in text.\n *\n * @param {any} text\n * @param {any} id\n * @param {any} version\n */\nexport const draw = (text, id, version) => {\n try {\n const parser = infoParser.parser;\n parser.yy = db;\n log.debug('Renering info diagram\\n' + text);\n // Parse the graph definition\n parser.parse(text);\n log.debug('Parsed info diagram');\n // Fetch the default direction, use TD if none was found\n const svg = select('#' + id);\n\n const g = svg.append('g');\n\n g.append('text') // text label for the x axis\n .attr('x', 100)\n .attr('y', 40)\n .attr('class', 'version')\n .attr('font-size', '32px')\n .style('text-anchor', 'middle')\n .text('v ' + version);\n\n svg.attr('height', 100);\n svg.attr('width', 400);\n // svg.attr('viewBox', '0 0 300 150');\n } catch (e) {\n log.error('Error while rendering info diagram');\n log.error(e.message);\n }\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = () => ``;\n\nexport default getStyles;\n","import { log } from '../../logger';\nimport mermaidAPI from '../../mermaidAPI';\nimport * as configApi from '../../config';\n\nlet sections = {};\nlet title = '';\nlet showData = false;\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nconst addSection = function (id, value) {\n if (typeof sections[id] === 'undefined') {\n sections[id] = value;\n log.debug('Added new section :', id);\n }\n};\nconst getSections = () => sections;\n\nconst setTitle = function (txt) {\n title = txt;\n};\n\nconst setShowData = function (toggle) {\n showData = toggle;\n};\n\nconst getShowData = function () {\n return showData;\n};\n\nconst getTitle = function () {\n return title;\n};\nconst cleanupValue = function (value) {\n if (value.substring(0, 1) === ':') {\n value = value.substring(1).trim();\n return Number(value.trim());\n } else {\n return Number(value.trim());\n }\n};\n\nconst clear = function () {\n sections = {};\n title = '';\n showData = false;\n};\n// export const parseError = (err, hash) => {\n// global.mermaidAPI.parseError(err, hash)\n// }\n\nexport default {\n parseDirective,\n getConfig: () => configApi.getConfig().pie,\n addSection,\n getSections,\n cleanupValue,\n clear,\n setTitle,\n getTitle,\n setShowData,\n getShowData,\n // parseError\n};\n","/** Created by AshishJ on 11-09-2019. */\nimport { select, scaleOrdinal, pie as d3pie, arc } from 'd3';\nimport pieData from './pieDb';\nimport pieParser from './parser/pie';\nimport { log } from '../../logger';\nimport { configureSvgSize } from '../../utils';\nimport * as configApi from '../../config';\n\nlet conf = configApi.getConfig();\n\n/**\n * Draws a Pie Chart with the data given in text.\n *\n * @param text\n * @param id\n */\nlet width;\nconst height = 450;\nexport const draw = (txt, id) => {\n try {\n conf = configApi.getConfig();\n const parser = pieParser.parser;\n parser.yy = pieData;\n log.debug('Rendering info diagram\\n' + txt);\n // Parse the Pie Chart definition\n parser.yy.clear();\n parser.parse(txt);\n log.debug('Parsed info diagram');\n const elem = document.getElementById(id);\n width = elem.parentElement.offsetWidth;\n\n if (typeof width === 'undefined') {\n width = 1200;\n }\n\n if (typeof conf.useWidth !== 'undefined') {\n width = conf.useWidth;\n }\n if (typeof conf.pie.useWidth !== 'undefined') {\n width = conf.pie.useWidth;\n }\n\n const diagram = select('#' + id);\n configureSvgSize(diagram, height, width, conf.pie.useMaxWidth);\n\n // Set viewBox\n elem.setAttribute('viewBox', '0 0 ' + width + ' ' + height);\n\n // Fetch the default direction, use TD if none was found\n var margin = 40;\n var legendRectSize = 18;\n var legendSpacing = 4;\n\n var radius = Math.min(width, height) / 2 - margin;\n\n var svg = diagram\n .append('g')\n .attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')');\n\n var data = pieData.getSections();\n var sum = 0;\n Object.keys(data).forEach(function (key) {\n sum += data[key];\n });\n\n const themeVariables = conf.themeVariables;\n var myGeneratedColors = [\n themeVariables.pie1,\n themeVariables.pie2,\n themeVariables.pie3,\n themeVariables.pie4,\n themeVariables.pie5,\n themeVariables.pie6,\n themeVariables.pie7,\n themeVariables.pie8,\n themeVariables.pie9,\n themeVariables.pie10,\n themeVariables.pie11,\n themeVariables.pie12,\n ];\n\n // Set the color scale\n var color = scaleOrdinal().range(myGeneratedColors);\n\n // Compute the position of each group on the pie:\n var pie = d3pie().value(function (d) {\n return d[1];\n });\n var dataReady = pie(Object.entries(data));\n\n // Shape helper to build arcs:\n var arcGenerator = arc().innerRadius(0).outerRadius(radius);\n\n // Build the pie chart: each part of the pie is a path that we build using the arc function.\n svg\n .selectAll('mySlices')\n .data(dataReady)\n .enter()\n .append('path')\n .attr('d', arcGenerator)\n .attr('fill', function (d) {\n return color(d.data[0]);\n })\n .attr('class', 'pieCircle');\n\n // Now add the percentage.\n // Use the centroid method to get the best coordinates.\n svg\n .selectAll('mySlices')\n .data(dataReady)\n .enter()\n .append('text')\n .text(function (d) {\n return ((d.data[1] / sum) * 100).toFixed(0) + '%';\n })\n .attr('transform', function (d) {\n return 'translate(' + arcGenerator.centroid(d) + ')';\n })\n .style('text-anchor', 'middle')\n .attr('class', 'slice');\n\n svg\n .append('text')\n .text(parser.yy.getTitle())\n .attr('x', 0)\n .attr('y', -(height - 50) / 2)\n .attr('class', 'pieTitleText');\n\n // Add the legends/annotations for each section\n var legend = svg\n .selectAll('.legend')\n .data(color.domain())\n .enter()\n .append('g')\n .attr('class', 'legend')\n .attr('transform', function (d, i) {\n var height = legendRectSize + legendSpacing;\n var offset = (height * color.domain().length) / 2;\n var horz = 12 * legendRectSize;\n var vert = i * height - offset;\n return 'translate(' + horz + ',' + vert + ')';\n });\n\n legend\n .append('rect')\n .attr('width', legendRectSize)\n .attr('height', legendRectSize)\n .style('fill', color)\n .style('stroke', color);\n\n legend\n .data(dataReady)\n .append('text')\n .attr('x', legendRectSize + legendSpacing)\n .attr('y', legendRectSize - legendSpacing)\n .text(function (d) {\n if (parser.yy.getShowData() || conf.showData || conf.pie.showData) {\n return d.data[0] + ' [' + d.data[1] + ']';\n } else {\n return d.data[0];\n }\n });\n } catch (e) {\n log.error('Error while rendering info diagram');\n log.error(e);\n }\n};\n\nexport default {\n draw,\n};\n","const getStyles = (options) =>\n `\n .pieCircle{\n stroke: ${options.pieStrokeColor};\n stroke-width : ${options.pieStrokeWidth};\n opacity : ${options.pieOpacity};\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${options.pieTitleTextSize};\n fill: ${options.pieTitleTextColor};\n font-family: ${options.fontFamily};\n }\n .slice {\n font-family: ${options.fontFamily};\n fill: ${options.pieSectionTextColor};\n font-size:${options.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${options.pieLegendTextColor};\n font-family: ${options.fontFamily};\n font-size: ${options.pieLegendTextSize};\n }\n`;\n\nexport default getStyles;\n","import * as configApi from '../../config';\nimport { log } from '../../logger';\nimport mermaidAPI from '../../mermaidAPI';\n\nlet relations = [];\nlet latestRequirement = {};\nlet requirements = {};\nlet latestElement = {};\nlet elements = {};\n\nconst RequirementType = {\n REQUIREMENT: 'Requirement',\n FUNCTIONAL_REQUIREMENT: 'Functional Requirement',\n INTERFACE_REQUIREMENT: 'Interface Requirement',\n PERFORMANCE_REQUIREMENT: 'Performance Requirement',\n PHYSICAL_REQUIREMENT: 'Physical Requirement',\n DESIGN_CONSTRAINT: 'Design Constraint',\n};\n\nconst RiskLevel = {\n LOW_RISK: 'Low',\n MED_RISK: 'Medium',\n HIGH_RISK: 'High',\n};\n\nconst VerifyType = {\n VERIFY_ANALYSIS: 'Analysis',\n VERIFY_DEMONSTRATION: 'Demonstration',\n VERIFY_INSPECTION: 'Inspection',\n VERIFY_TEST: 'Test',\n};\n\nconst Relationships = {\n CONTAINS: 'contains',\n COPIES: 'copies',\n DERIVES: 'derives',\n SATISFIES: 'satisfies',\n VERIFIES: 'verifies',\n REFINES: 'refines',\n TRACES: 'traces',\n};\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nconst addRequirement = (name, type) => {\n if (typeof requirements[name] === 'undefined') {\n requirements[name] = {\n name,\n type,\n\n id: latestRequirement.id,\n text: latestRequirement.text,\n risk: latestRequirement.risk,\n verifyMethod: latestRequirement.verifyMethod,\n };\n }\n latestRequirement = {};\n\n return requirements[name];\n};\n\nconst getRequirements = () => requirements;\n\nconst setNewReqId = (id) => {\n if (typeof latestRequirement != 'undefined') {\n latestRequirement.id = id;\n }\n};\n\nconst setNewReqText = (text) => {\n if (typeof latestRequirement != 'undefined') {\n latestRequirement.text = text;\n }\n};\n\nconst setNewReqRisk = (risk) => {\n if (typeof latestRequirement != 'undefined') {\n latestRequirement.risk = risk;\n }\n};\n\nconst setNewReqVerifyMethod = (verifyMethod) => {\n if (typeof latestRequirement != 'undefined') {\n latestRequirement.verifyMethod = verifyMethod;\n }\n};\n\nconst addElement = (name) => {\n if (typeof elements[name] === 'undefined') {\n elements[name] = {\n name,\n\n type: latestElement.type,\n docRef: latestElement.docRef,\n };\n log.info('Added new requirement: ', name);\n }\n latestElement = {};\n\n return elements[name];\n};\n\nconst getElements = () => elements;\n\nconst setNewElementType = (type) => {\n if (typeof latestElement != 'undefined') {\n latestElement.type = type;\n }\n};\n\nconst setNewElementDocRef = (docRef) => {\n if (typeof latestElement != 'undefined') {\n latestElement.docRef = docRef;\n }\n};\n\nconst addRelationship = (type, src, dst) => {\n relations.push({\n type,\n src,\n dst,\n });\n};\n\nconst getRelationships = () => relations;\n\nconst clear = () => {\n relations = [];\n latestRequirement = {};\n requirements = {};\n latestElement = {};\n elements = {};\n};\n\nexport default {\n RequirementType,\n RiskLevel,\n VerifyType,\n Relationships,\n\n parseDirective,\n getConfig: () => configApi.getConfig().req,\n\n addRequirement,\n getRequirements,\n setNewReqId,\n setNewReqText,\n setNewReqRisk,\n setNewReqVerifyMethod,\n\n addElement,\n getElements,\n setNewElementType,\n setNewElementDocRef,\n\n addRelationship,\n getRelationships,\n\n clear,\n};\n","const ReqMarkers = {\n CONTAINS: 'contains',\n ARROW: 'arrow',\n};\n\nconst insertLineEndings = (parentNode, conf) => {\n let containsNode = parentNode\n .append('defs')\n .append('marker')\n .attr('id', ReqMarkers.CONTAINS + '_line_ending')\n .attr('refX', 0)\n .attr('refY', conf.line_height / 2)\n .attr('markerWidth', conf.line_height)\n .attr('markerHeight', conf.line_height)\n .attr('orient', 'auto')\n .append('g');\n\n containsNode\n .append('circle')\n .attr('cx', conf.line_height / 2)\n .attr('cy', conf.line_height / 2)\n .attr('r', conf.line_height / 2)\n // .attr('stroke', conf.rect_border_color)\n // .attr('stroke-width', 1)\n .attr('fill', 'none');\n\n containsNode\n .append('line')\n .attr('x1', 0)\n .attr('x2', conf.line_height)\n .attr('y1', conf.line_height / 2)\n .attr('y2', conf.line_height / 2)\n // .attr('stroke', conf.rect_border_color)\n .attr('stroke-width', 1);\n\n containsNode\n .append('line')\n .attr('y1', 0)\n .attr('y2', conf.line_height)\n .attr('x1', conf.line_height / 2)\n .attr('x2', conf.line_height / 2)\n // .attr('stroke', conf.rect_border_color)\n .attr('stroke-width', 1);\n\n parentNode\n .append('defs')\n .append('marker')\n .attr('id', ReqMarkers.ARROW + '_line_ending')\n .attr('refX', conf.line_height)\n .attr('refY', 0.5 * conf.line_height)\n .attr('markerWidth', conf.line_height)\n .attr('markerHeight', conf.line_height)\n .attr('orient', 'auto')\n .append('path')\n .attr(\n 'd',\n `M0,0\n L${conf.line_height},${conf.line_height / 2}\n M${conf.line_height},${conf.line_height / 2}\n L0,${conf.line_height}`\n )\n .attr('stroke-width', 1);\n // .attr('stroke', conf.rect_border_color);\n};\n\nexport default {\n ReqMarkers,\n insertLineEndings,\n};\n","import { line, select } from 'd3';\nimport dagre from 'dagre';\nimport graphlib from 'graphlib';\n// import * as configApi from '../../config';\nimport { log } from '../../logger';\nimport { configureSvgSize } from '../../utils';\nimport common from '../common/common';\nimport { parser } from './parser/requirementDiagram';\nimport requirementDb from './requirementDb';\nimport markers from './requirementMarkers';\n\nconst conf = {};\nlet relCnt = 0;\n\nexport const setConf = function (cnf) {\n if (typeof cnf === 'undefined') {\n return;\n }\n const keys = Object.keys(cnf);\n for (let i = 0; i < keys.length; i++) {\n conf[keys[i]] = cnf[keys[i]];\n }\n};\n\nconst newRectNode = (parentNode, id) => {\n return parentNode\n .insert('rect', '#' + id)\n .attr('class', 'req reqBox')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', conf.rect_min_width + 'px')\n .attr('height', conf.rect_min_height + 'px');\n};\n\nconst newTitleNode = (parentNode, id, txts) => {\n let x = conf.rect_min_width / 2;\n\n let title = parentNode\n .append('text')\n .attr('class', 'req reqLabel reqTitle')\n .attr('id', id)\n .attr('x', x)\n .attr('y', conf.rect_padding)\n .attr('dominant-baseline', 'hanging');\n // .attr(\n // 'style',\n // 'font-family: ' + configApi.getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px'\n // )\n let i = 0;\n txts.forEach((textStr) => {\n if (i == 0) {\n title\n .append('tspan')\n .attr('text-anchor', 'middle')\n .attr('x', conf.rect_min_width / 2)\n .attr('dy', 0)\n .text(textStr);\n } else {\n title\n .append('tspan')\n .attr('text-anchor', 'middle')\n .attr('x', conf.rect_min_width / 2)\n .attr('dy', conf.line_height * 0.75)\n .text(textStr);\n }\n i++;\n });\n\n let yPadding = 1.5 * conf.rect_padding;\n let linePadding = i * conf.line_height * 0.75;\n let totalY = yPadding + linePadding;\n\n parentNode\n .append('line')\n .attr('class', 'req-title-line')\n .attr('x1', '0')\n .attr('x2', conf.rect_min_width)\n .attr('y1', totalY)\n .attr('y2', totalY);\n\n return {\n titleNode: title,\n y: totalY,\n };\n};\n\nconst newBodyNode = (parentNode, id, txts, yStart) => {\n let body = parentNode\n .append('text')\n .attr('class', 'req reqLabel')\n .attr('id', id)\n .attr('x', conf.rect_padding)\n .attr('y', yStart)\n .attr('dominant-baseline', 'hanging');\n // .attr(\n // 'style',\n // 'font-family: ' + configApi.getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px'\n // );\n\n let currentRow = 0;\n const charLimit = 30;\n let wrappedTxts = [];\n txts.forEach((textStr) => {\n let currentTextLen = textStr.length;\n while (currentTextLen > charLimit && currentRow < 3) {\n let firstPart = textStr.substring(0, charLimit);\n textStr = textStr.substring(charLimit, textStr.length);\n currentTextLen = textStr.length;\n wrappedTxts[wrappedTxts.length] = firstPart;\n currentRow++;\n }\n if (currentRow == 3) {\n let lastStr = wrappedTxts[wrappedTxts.length - 1];\n wrappedTxts[wrappedTxts.length - 1] = lastStr.substring(0, lastStr.length - 4) + '...';\n } else {\n wrappedTxts[wrappedTxts.length] = textStr;\n }\n currentRow = 0;\n });\n\n wrappedTxts.forEach((textStr) => {\n body.append('tspan').attr('x', conf.rect_padding).attr('dy', conf.line_height).text(textStr);\n });\n\n return body;\n};\n\nconst addEdgeLabel = (parentNode, svgPath, conf, txt) => {\n // Find the half-way point\n const len = svgPath.node().getTotalLength();\n const labelPoint = svgPath.node().getPointAtLength(len * 0.5);\n\n // Append a text node containing the label\n const labelId = 'rel' + relCnt;\n relCnt++;\n\n const labelNode = parentNode\n .append('text')\n .attr('class', 'req relationshipLabel')\n .attr('id', labelId)\n .attr('x', labelPoint.x)\n .attr('y', labelPoint.y)\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n // .attr('style', 'font-family: ' + conf.fontFamily + '; font-size: ' + conf.fontSize + 'px')\n .text(txt);\n\n // Figure out how big the opaque 'container' rectangle needs to be\n const labelBBox = labelNode.node().getBBox();\n\n // Insert the opaque rectangle before the text label\n parentNode\n .insert('rect', '#' + labelId)\n .attr('class', 'req reqLabelBox')\n .attr('x', labelPoint.x - labelBBox.width / 2)\n .attr('y', labelPoint.y - labelBBox.height / 2)\n .attr('width', labelBBox.width)\n .attr('height', labelBBox.height)\n .attr('fill', 'white')\n .attr('fill-opacity', '85%');\n};\n\nconst drawRelationshipFromLayout = function (svg, rel, g, insert) {\n // Find the edge relating to this relationship\n const edge = g.edge(elementString(rel.src), elementString(rel.dst));\n\n // Get a function that will generate the line path\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n });\n\n // Insert the line at the right place\n const svgPath = svg\n .insert('path', '#' + insert)\n .attr('class', 'er relationshipLine')\n .attr('d', lineFunction(edge.points))\n .attr('fill', 'none');\n\n if (rel.type == requirementDb.Relationships.CONTAINS) {\n svgPath.attr(\n 'marker-start',\n 'url(' + common.getUrl(conf.arrowMarkerAbsolute) + '#' + rel.type + '_line_ending' + ')'\n );\n } else {\n svgPath.attr('stroke-dasharray', '10,7');\n svgPath.attr(\n 'marker-end',\n 'url(' +\n common.getUrl(conf.arrowMarkerAbsolute) +\n '#' +\n markers.ReqMarkers.ARROW +\n '_line_ending' +\n ')'\n );\n }\n\n addEdgeLabel(svg, svgPath, conf, `<<${rel.type}>>`);\n\n return;\n};\n\nexport const drawReqs = (reqs, graph, svgNode) => {\n Object.keys(reqs).forEach((reqName) => {\n let req = reqs[reqName];\n reqName = elementString(reqName);\n log.info('Added new requirement: ', reqName);\n\n const groupNode = svgNode.append('g').attr('id', reqName);\n const textId = 'req-' + reqName;\n const rectNode = newRectNode(groupNode, textId);\n\n let nodes = [];\n\n let titleNodeInfo = newTitleNode(groupNode, reqName + '_title', [\n `<<${req.type}>>`,\n `${req.name}`,\n ]);\n\n nodes.push(titleNodeInfo.titleNode);\n\n let bodyNode = newBodyNode(\n groupNode,\n reqName + '_body',\n [\n `Id: ${req.id}`,\n `Text: ${req.text}`,\n `Risk: ${req.risk}`,\n `Verification: ${req.verifyMethod}`,\n ],\n titleNodeInfo.y\n );\n\n nodes.push(bodyNode);\n\n const rectBBox = rectNode.node().getBBox();\n\n // Add the entity to the graph\n graph.setNode(reqName, {\n width: rectBBox.width,\n height: rectBBox.height,\n shape: 'rect',\n id: reqName,\n });\n });\n};\n\nexport const drawElements = (els, graph, svgNode) => {\n Object.keys(els).forEach((elName) => {\n let el = els[elName];\n const id = elementString(elName);\n\n const groupNode = svgNode.append('g').attr('id', id);\n const textId = 'element-' + id;\n const rectNode = newRectNode(groupNode, textId);\n\n let nodes = [];\n\n let titleNodeInfo = newTitleNode(groupNode, textId + '_title', [`<<Element>>`, `${elName}`]);\n\n nodes.push(titleNodeInfo.titleNode);\n\n let bodyNode = newBodyNode(\n groupNode,\n textId + '_body',\n [`Type: ${el.type || 'Not Specified'}`, `Doc Ref: ${el.docRef || 'None'}`],\n titleNodeInfo.y\n );\n\n nodes.push(bodyNode);\n\n const rectBBox = rectNode.node().getBBox();\n\n // Add the entity to the graph\n graph.setNode(id, {\n width: rectBBox.width,\n height: rectBBox.height,\n shape: 'rect',\n id: id,\n });\n });\n};\n\nconst addRelationships = (relationships, g) => {\n relationships.forEach(function (r) {\n let src = elementString(r.src);\n let dst = elementString(r.dst);\n g.setEdge(src, dst, { relationship: r });\n });\n return relationships;\n};\n\nconst adjustEntities = function (svgNode, graph) {\n graph.nodes().forEach(function (v) {\n if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') {\n svgNode.select('#' + v);\n svgNode\n .select('#' + v)\n .attr(\n 'transform',\n 'translate(' +\n (graph.node(v).x - graph.node(v).width / 2) +\n ',' +\n (graph.node(v).y - graph.node(v).height / 2) +\n ' )'\n );\n }\n });\n return;\n};\n\nconst elementString = (str) => {\n return str.replace(/\\s/g, '').replace(/\\./g, '_');\n};\n\nexport const draw = (text, id) => {\n parser.yy = requirementDb;\n parser.yy.clear();\n parser.parse(text);\n\n const svg = select(`[id='${id}']`);\n markers.insertLineEndings(svg, conf);\n\n const g = new graphlib.Graph({\n multigraph: false,\n compound: false,\n directed: true,\n })\n .setGraph({\n rankdir: conf.layoutDirection,\n marginx: 20,\n marginy: 20,\n nodesep: 100,\n edgesep: 100,\n ranksep: 100,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n let requirements = requirementDb.getRequirements();\n let elements = requirementDb.getElements();\n let relationships = requirementDb.getRelationships();\n\n drawReqs(requirements, g, svg);\n drawElements(elements, g, svg);\n addRelationships(relationships, g);\n dagre.layout(g);\n adjustEntities(svg, g);\n\n relationships.forEach(function (rel) {\n drawRelationshipFromLayout(svg, rel, g, id);\n });\n\n // svg.attr('height', '500px');\n const padding = conf.rect_padding;\n const svgBounds = svg.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n\n configureSvgSize(svg, height, width, conf.useMaxWidth);\n\n svg.attr('viewBox', `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) => `\n\n marker {\n fill: ${options.relationColor};\n stroke: ${options.relationColor};\n }\n\n marker.cross {\n stroke: ${options.lineColor};\n }\n\n svg {\n font-family: ${options.fontFamily};\n font-size: ${options.fontSize};\n }\n\n .reqBox {\n fill: ${options.requirementBackground};\n fill-opacity: 100%;\n stroke: ${options.requirementBorderColor};\n stroke-width: ${options.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${options.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${options.relationLabelBackground};\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ${options.requirementBorderColor};\n stroke-width: ${options.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${options.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${options.relationLabelColor};\n }\n\n`;\n// fill', conf.rect_fill)\nexport default getStyles;\n","import mermaidAPI from '../../mermaidAPI';\nimport * as configApi from '../../config';\nimport { log } from '../../logger';\nimport { sanitizeText } from '../common/common';\n\nlet prevActor = undefined;\nlet actors = {};\nlet messages = [];\nconst notes = [];\nlet title = '';\nlet titleWrapped = false;\nlet sequenceNumbersEnabled = false;\nlet wrapEnabled = false;\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nexport const addActor = function (id, name, description, type) {\n // Don't allow description nulling\n const old = actors[id];\n if (old && name === old.name && description == null) return;\n\n // Don't allow null descriptions, either\n if (description == null || description.text == null) {\n description = { text: name, wrap: null, type };\n }\n if (type == null || description.text == null) {\n description = { text: name, wrap: null, type };\n }\n\n actors[id] = {\n name: name,\n description: description.text,\n wrap: (description.wrap === undefined && autoWrap()) || !!description.wrap,\n prevActor: prevActor,\n links: {},\n properties: {},\n actorCnt: null,\n rectData: null,\n type: type || 'participant',\n };\n if (prevActor && actors[prevActor]) {\n actors[prevActor].nextActor = id;\n }\n\n prevActor = id;\n};\n\nconst activationCount = (part) => {\n let i;\n let count = 0;\n for (i = 0; i < messages.length; i++) {\n if (messages[i].type === LINETYPE.ACTIVE_START) {\n if (messages[i].from.actor === part) {\n count++;\n }\n }\n if (messages[i].type === LINETYPE.ACTIVE_END) {\n if (messages[i].from.actor === part) {\n count--;\n }\n }\n }\n return count;\n};\n\nexport const addMessage = function (idFrom, idTo, message, answer) {\n messages.push({\n from: idFrom,\n to: idTo,\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n answer: answer,\n });\n};\n\nexport const addSignal = function (\n idFrom,\n idTo,\n message = { text: undefined, wrap: undefined },\n messageType\n) {\n if (messageType === LINETYPE.ACTIVE_END) {\n const cnt = activationCount(idFrom.actor);\n if (cnt < 1) {\n // Bail out as there is an activation signal from an inactive participant\n let error = new Error('Trying to inactivate an inactive participant (' + idFrom.actor + ')');\n error.hash = {\n text: '->>-',\n token: '->>-',\n line: '1',\n loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },\n expected: [\"'ACTIVE_PARTICIPANT'\"],\n };\n throw error;\n }\n }\n messages.push({\n from: idFrom,\n to: idTo,\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n type: messageType,\n });\n return true;\n};\n\nexport const getMessages = function () {\n return messages;\n};\n\nexport const getActors = function () {\n return actors;\n};\nexport const getActor = function (id) {\n return actors[id];\n};\nexport const getActorKeys = function () {\n return Object.keys(actors);\n};\nexport const getTitle = function () {\n return title;\n};\nexport const getTitleWrapped = function () {\n return titleWrapped;\n};\nexport const enableSequenceNumbers = function () {\n sequenceNumbersEnabled = true;\n};\nexport const showSequenceNumbers = () => sequenceNumbersEnabled;\n\nexport const setWrap = function (wrapSetting) {\n wrapEnabled = wrapSetting;\n};\n\nexport const autoWrap = () => wrapEnabled;\n\nexport const clear = function () {\n actors = {};\n messages = [];\n};\n\nexport const parseMessage = function (str) {\n const _str = str.trim();\n const message = {\n text: _str.replace(/^[:]?(?:no)?wrap:/, '').trim(),\n wrap:\n _str.match(/^[:]?wrap:/) !== null\n ? true\n : _str.match(/^[:]?nowrap:/) !== null\n ? false\n : undefined,\n };\n log.debug('parseMessage:', message);\n return message;\n};\n\nexport const LINETYPE = {\n SOLID: 0,\n DOTTED: 1,\n NOTE: 2,\n SOLID_CROSS: 3,\n DOTTED_CROSS: 4,\n SOLID_OPEN: 5,\n DOTTED_OPEN: 6,\n LOOP_START: 10,\n LOOP_END: 11,\n ALT_START: 12,\n ALT_ELSE: 13,\n ALT_END: 14,\n OPT_START: 15,\n OPT_END: 16,\n ACTIVE_START: 17,\n ACTIVE_END: 18,\n PAR_START: 19,\n PAR_AND: 20,\n PAR_END: 21,\n RECT_START: 22,\n RECT_END: 23,\n SOLID_POINT: 24,\n DOTTED_POINT: 25,\n};\n\nexport const ARROWTYPE = {\n FILLED: 0,\n OPEN: 1,\n};\n\nexport const PLACEMENT = {\n LEFTOF: 0,\n RIGHTOF: 1,\n OVER: 2,\n};\n\nexport const addNote = function (actor, placement, message) {\n const note = {\n actor: actor,\n placement: placement,\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n };\n\n // Coerce actor into a [to, from, ...] array\n const actors = [].concat(actor, actor);\n\n notes.push(note);\n messages.push({\n from: actors[0],\n to: actors[1],\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n type: LINETYPE.NOTE,\n placement: placement,\n });\n};\n\nexport const addLinks = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n // JSON.parse the text\n try {\n let sanitizedText = sanitizeText(text.text, configApi.getConfig());\n sanitizedText = sanitizedText.replace(/&/g, '&');\n sanitizedText = sanitizedText.replace(/=/g, '=');\n const links = JSON.parse(sanitizedText);\n // add the deserialized text to the actor's links field.\n insertLinks(actor, links);\n } catch (e) {\n log.error('error while parsing actor link text', e);\n }\n};\n\nexport const addALink = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n try {\n const links = {};\n let sanitizedText = sanitizeText(text.text, configApi.getConfig());\n var sep = sanitizedText.indexOf('@');\n sanitizedText = sanitizedText.replace(/&/g, '&');\n sanitizedText = sanitizedText.replace(/=/g, '=');\n var label = sanitizedText.slice(0, sep - 1).trim();\n var link = sanitizedText.slice(sep + 1).trim();\n\n links[label] = link;\n // add the deserialized text to the actor's links field.\n insertLinks(actor, links);\n } catch (e) {\n log.error('error while parsing actor link text', e);\n }\n};\n\n/**\n * @param {any} actor\n * @param {any} links\n */\nfunction insertLinks(actor, links) {\n if (actor.links == null) {\n actor.links = links;\n } else {\n for (let key in links) {\n actor.links[key] = links[key];\n }\n }\n}\n\nexport const addProperties = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n // JSON.parse the text\n try {\n let sanitizedText = sanitizeText(text.text, configApi.getConfig());\n const properties = JSON.parse(sanitizedText);\n // add the deserialized text to the actor's property field.\n insertProperties(actor, properties);\n } catch (e) {\n log.error('error while parsing actor properties text', e);\n }\n};\n\n/**\n * @param {any} actor\n * @param {any} properties\n */\nfunction insertProperties(actor, properties) {\n if (actor.properties == null) {\n actor.properties = properties;\n } else {\n for (let key in properties) {\n actor.properties[key] = properties[key];\n }\n }\n}\n\nexport const addDetails = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n const elem = document.getElementById(text.text);\n\n // JSON.parse the text\n try {\n const text = elem.innerHTML;\n const details = JSON.parse(text);\n // add the deserialized text to the actor's property field.\n if (details['properties']) {\n insertProperties(actor, details['properties']);\n }\n\n if (details['links']) {\n insertLinks(actor, details['links']);\n }\n } catch (e) {\n log.error('error while parsing actor details text', e);\n }\n};\n\nexport const getActorProperty = function (actor, key) {\n if (typeof actor !== 'undefined' && typeof actor.properties !== 'undefined') {\n return actor.properties[key];\n }\n\n return undefined;\n};\n\nexport const setTitle = function (titleWrap) {\n title = titleWrap.text;\n titleWrapped = (titleWrap.wrap === undefined && autoWrap()) || !!titleWrap.wrap;\n};\n\nexport const apply = function (param) {\n if (param instanceof Array) {\n param.forEach(function (item) {\n apply(item);\n });\n } else {\n switch (param.type) {\n case 'addParticipant':\n addActor(param.actor, param.actor, param.description, 'participant');\n break;\n case 'addActor':\n addActor(param.actor, param.actor, param.description, 'actor');\n break;\n case 'activeStart':\n addSignal(param.actor, undefined, undefined, param.signalType);\n break;\n case 'activeEnd':\n addSignal(param.actor, undefined, undefined, param.signalType);\n break;\n case 'addNote':\n addNote(param.actor, param.placement, param.text);\n break;\n case 'addLinks':\n addLinks(param.actor, param.text);\n break;\n case 'addALink':\n addALink(param.actor, param.text);\n break;\n case 'addProperties':\n addProperties(param.actor, param.text);\n break;\n case 'addDetails':\n addDetails(param.actor, param.text);\n break;\n case 'addMessage':\n addSignal(param.from, param.to, param.msg, param.signalType);\n break;\n case 'loopStart':\n addSignal(undefined, undefined, param.loopText, param.signalType);\n break;\n case 'loopEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'rectStart':\n addSignal(undefined, undefined, param.color, param.signalType);\n break;\n case 'rectEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'optStart':\n addSignal(undefined, undefined, param.optText, param.signalType);\n break;\n case 'optEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'altStart':\n addSignal(undefined, undefined, param.altText, param.signalType);\n break;\n case 'else':\n addSignal(undefined, undefined, param.altText, param.signalType);\n break;\n case 'altEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'setTitle':\n setTitle(param.text);\n break;\n case 'parStart':\n addSignal(undefined, undefined, param.parText, param.signalType);\n break;\n case 'and':\n addSignal(undefined, undefined, param.parText, param.signalType);\n break;\n case 'parEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n }\n }\n};\n\nexport default {\n addActor,\n addMessage,\n addSignal,\n addLinks,\n addDetails,\n addProperties,\n autoWrap,\n setWrap,\n enableSequenceNumbers,\n showSequenceNumbers,\n getMessages,\n getActors,\n getActor,\n getActorKeys,\n getActorProperty,\n getTitle,\n parseDirective,\n getConfig: () => configApi.getConfig().sequence,\n getTitleWrapped,\n clear,\n parseMessage,\n LINETYPE,\n ARROWTYPE,\n PLACEMENT,\n addNote,\n setTitle,\n apply,\n};\n","import { select, selectAll } from 'd3';\nimport svgDraw, { drawText, fixLifeLineHeights } from './svgDraw';\nimport { log } from '../../logger';\nimport { parser } from './parser/sequenceDiagram';\nimport common from '../common/common';\nimport sequenceDb from './sequenceDb';\nimport * as configApi from '../../config';\nimport utils, { assignWithDepth, configureSvgSize } from '../../utils';\n\nparser.yy = sequenceDb;\n\nlet conf = {};\n\nexport const bounds = {\n data: {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n },\n verticalPos: 0,\n sequenceItems: [],\n activations: [],\n models: {\n getHeight: function () {\n return (\n Math.max.apply(\n null,\n this.actors.length === 0 ? [0] : this.actors.map((actor) => actor.height || 0)\n ) +\n (this.loops.length === 0\n ? 0\n : this.loops.map((it) => it.height || 0).reduce((acc, h) => acc + h)) +\n (this.messages.length === 0\n ? 0\n : this.messages.map((it) => it.height || 0).reduce((acc, h) => acc + h)) +\n (this.notes.length === 0\n ? 0\n : this.notes.map((it) => it.height || 0).reduce((acc, h) => acc + h))\n );\n },\n clear: function () {\n this.actors = [];\n this.loops = [];\n this.messages = [];\n this.notes = [];\n },\n addActor: function (actorModel) {\n this.actors.push(actorModel);\n },\n addLoop: function (loopModel) {\n this.loops.push(loopModel);\n },\n addMessage: function (msgModel) {\n this.messages.push(msgModel);\n },\n addNote: function (noteModel) {\n this.notes.push(noteModel);\n },\n lastActor: function () {\n return this.actors[this.actors.length - 1];\n },\n lastLoop: function () {\n return this.loops[this.loops.length - 1];\n },\n lastMessage: function () {\n return this.messages[this.messages.length - 1];\n },\n lastNote: function () {\n return this.notes[this.notes.length - 1];\n },\n actors: [],\n loops: [],\n messages: [],\n notes: [],\n },\n init: function () {\n this.sequenceItems = [];\n this.activations = [];\n this.models.clear();\n this.data = {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n };\n this.verticalPos = 0;\n setConf(parser.yy.getConfig());\n },\n updateVal: function (obj, key, val, fun) {\n if (typeof obj[key] === 'undefined') {\n obj[key] = val;\n } else {\n obj[key] = fun(val, obj[key]);\n }\n },\n updateBounds: function (startx, starty, stopx, stopy) {\n const _self = this;\n let cnt = 0;\n /** @param {any} type */\n function updateFn(type) {\n return function updateItemBounds(item) {\n cnt++;\n // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems\n const n = _self.sequenceItems.length - cnt + 1;\n\n _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);\n _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);\n _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n if (!(type === 'activation')) {\n _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);\n _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);\n _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);\n }\n };\n }\n\n this.sequenceItems.forEach(updateFn());\n this.activations.forEach(updateFn('activation'));\n },\n insert: function (startx, starty, stopx, stopy) {\n const _startx = Math.min(startx, stopx);\n const _stopx = Math.max(startx, stopx);\n const _starty = Math.min(starty, stopy);\n const _stopy = Math.max(starty, stopy);\n\n this.updateVal(bounds.data, 'startx', _startx, Math.min);\n this.updateVal(bounds.data, 'starty', _starty, Math.min);\n this.updateVal(bounds.data, 'stopx', _stopx, Math.max);\n this.updateVal(bounds.data, 'stopy', _stopy, Math.max);\n\n this.updateBounds(_startx, _starty, _stopx, _stopy);\n },\n newActivation: function (message, diagram, actors) {\n const actorRect = actors[message.from.actor];\n const stackedSize = actorActivations(message.from.actor).length || 0;\n const x = actorRect.x + actorRect.width / 2 + ((stackedSize - 1) * conf.activationWidth) / 2;\n this.activations.push({\n startx: x,\n starty: this.verticalPos + 2,\n stopx: x + conf.activationWidth,\n stopy: undefined,\n actor: message.from.actor,\n anchored: svgDraw.anchorElement(diagram),\n });\n },\n endActivation: function (message) {\n // find most recent activation for given actor\n const lastActorActivationIdx = this.activations\n .map(function (activation) {\n return activation.actor;\n })\n .lastIndexOf(message.from.actor);\n return this.activations.splice(lastActorActivationIdx, 1)[0];\n },\n createLoop: function (title = { message: undefined, wrap: false, width: undefined }, fill) {\n return {\n startx: undefined,\n starty: this.verticalPos,\n stopx: undefined,\n stopy: undefined,\n title: title.message,\n wrap: title.wrap,\n width: title.width,\n height: 0,\n fill: fill,\n };\n },\n newLoop: function (title = { message: undefined, wrap: false, width: undefined }, fill) {\n this.sequenceItems.push(this.createLoop(title, fill));\n },\n endLoop: function () {\n return this.sequenceItems.pop();\n },\n addSectionToLoop: function (message) {\n const loop = this.sequenceItems.pop();\n loop.sections = loop.sections || [];\n loop.sectionTitles = loop.sectionTitles || [];\n loop.sections.push({ y: bounds.getVerticalPos(), height: 0 });\n loop.sectionTitles.push(message);\n this.sequenceItems.push(loop);\n },\n bumpVerticalPos: function (bump) {\n this.verticalPos = this.verticalPos + bump;\n this.data.stopy = this.verticalPos;\n },\n getVerticalPos: function () {\n return this.verticalPos;\n },\n getBounds: function () {\n return { bounds: this.data, models: this.models };\n },\n};\n\n/**\n * Draws an note in the diagram with the attached line\n *\n * @param {any} elem - The diagram to draw to.\n * @param {{ x: number; y: number; message: string; width: number }} noteModel - Startx: x axis\n * start position, verticalPos: y axis position, messsage: the message to be shown, width: Set\n * this with a custom width to override the default configured width.\n */\nconst drawNote = function (elem, noteModel) {\n bounds.bumpVerticalPos(conf.boxMargin);\n noteModel.height = conf.boxMargin;\n noteModel.starty = bounds.getVerticalPos();\n const rect = svgDraw.getNoteRect();\n rect.x = noteModel.startx;\n rect.y = noteModel.starty;\n rect.width = noteModel.width || conf.width;\n rect.class = 'note';\n\n let g = elem.append('g');\n const rectElem = svgDraw.drawRect(g, rect);\n const textObj = svgDraw.getTextObj();\n textObj.x = noteModel.startx;\n textObj.y = noteModel.starty;\n textObj.width = rect.width;\n textObj.dy = '1em';\n textObj.text = noteModel.message;\n textObj.class = 'noteText';\n textObj.fontFamily = conf.noteFontFamily;\n textObj.fontSize = conf.noteFontSize;\n textObj.fontWeight = conf.noteFontWeight;\n textObj.anchor = conf.noteAlign;\n textObj.textMargin = conf.noteMargin;\n textObj.valign = conf.noteAlign;\n\n let textElem = drawText(g, textObj);\n\n let textHeight = Math.round(\n textElem\n .map((te) => (te._groups || te)[0][0].getBBox().height)\n .reduce((acc, curr) => acc + curr)\n );\n\n rectElem.attr('height', textHeight + 2 * conf.noteMargin);\n noteModel.height += textHeight + 2 * conf.noteMargin;\n bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);\n noteModel.stopy = noteModel.starty + textHeight + 2 * conf.noteMargin;\n noteModel.stopx = noteModel.startx + rect.width;\n bounds.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy);\n bounds.models.addNote(noteModel);\n};\n\nconst messageFont = (cnf) => {\n return {\n fontFamily: cnf.messageFontFamily,\n fontSize: cnf.messageFontSize,\n fontWeight: cnf.messageFontWeight,\n };\n};\nconst noteFont = (cnf) => {\n return {\n fontFamily: cnf.noteFontFamily,\n fontSize: cnf.noteFontSize,\n fontWeight: cnf.noteFontWeight,\n };\n};\nconst actorFont = (cnf) => {\n return {\n fontFamily: cnf.actorFontFamily,\n fontSize: cnf.actorFontSize,\n fontWeight: cnf.actorFontWeight,\n };\n};\n\n/**\n * Draws a message\n *\n * @param {any} g - The parent of the message element\n * @param {any} msgModel - The model containing fields describing a message\n */\nconst drawMessage = function (g, msgModel) {\n bounds.bumpVerticalPos(10);\n const { startx, stopx, starty, message, type, sequenceIndex } = msgModel;\n const lines = common.splitBreaks(message).length;\n let textDims = utils.calculateTextDimensions(message, messageFont(conf));\n const lineHeight = textDims.height / lines;\n msgModel.height += lineHeight;\n\n bounds.bumpVerticalPos(lineHeight);\n const textObj = svgDraw.getTextObj();\n textObj.x = startx;\n textObj.y = starty + 10;\n textObj.width = stopx - startx;\n textObj.class = 'messageText';\n textObj.dy = '1em';\n textObj.text = message;\n textObj.fontFamily = conf.messageFontFamily;\n textObj.fontSize = conf.messageFontSize;\n textObj.fontWeight = conf.messageFontWeight;\n textObj.anchor = conf.messageAlign;\n textObj.valign = conf.messageAlign;\n textObj.textMargin = conf.wrapPadding;\n textObj.tspan = false;\n\n drawText(g, textObj);\n\n let totalOffset = textDims.height - 10;\n\n let textWidth = textDims.width;\n\n let line, lineStarty;\n if (startx === stopx) {\n lineStarty = bounds.getVerticalPos() + totalOffset;\n if (conf.rightAngles) {\n line = g\n .append('path')\n .attr(\n 'd',\n `M ${startx},${lineStarty} H ${startx + Math.max(conf.width / 2, textWidth / 2)} V ${\n lineStarty + 25\n } H ${startx}`\n );\n } else {\n totalOffset += conf.boxMargin;\n\n lineStarty = bounds.getVerticalPos() + totalOffset;\n line = g\n .append('path')\n .attr(\n 'd',\n 'M ' +\n startx +\n ',' +\n lineStarty +\n ' C ' +\n (startx + 60) +\n ',' +\n (lineStarty - 10) +\n ' ' +\n (startx + 60) +\n ',' +\n (lineStarty + 30) +\n ' ' +\n startx +\n ',' +\n (lineStarty + 20)\n );\n }\n\n totalOffset += 30;\n const dx = Math.max(textWidth / 2, conf.width / 2);\n bounds.insert(\n startx - dx,\n bounds.getVerticalPos() - 10 + totalOffset,\n stopx + dx,\n bounds.getVerticalPos() + 30 + totalOffset\n );\n } else {\n totalOffset += conf.boxMargin;\n lineStarty = bounds.getVerticalPos() + totalOffset;\n line = g.append('line');\n line.attr('x1', startx);\n line.attr('y1', lineStarty);\n line.attr('x2', stopx);\n line.attr('y2', lineStarty);\n bounds.insert(startx, lineStarty - 10, stopx, lineStarty);\n }\n // Make an SVG Container\n // Draw the line\n if (\n type === parser.yy.LINETYPE.DOTTED ||\n type === parser.yy.LINETYPE.DOTTED_CROSS ||\n type === parser.yy.LINETYPE.DOTTED_POINT ||\n type === parser.yy.LINETYPE.DOTTED_OPEN\n ) {\n line.style('stroke-dasharray', '3, 3');\n line.attr('class', 'messageLine1');\n } else {\n line.attr('class', 'messageLine0');\n }\n\n let url = '';\n if (conf.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n line.attr('stroke-width', 2);\n line.attr('stroke', 'none'); // handled by theme/css anyway\n line.style('fill', 'none'); // remove any fill colour\n if (type === parser.yy.LINETYPE.SOLID || type === parser.yy.LINETYPE.DOTTED) {\n line.attr('marker-end', 'url(' + url + '#arrowhead)');\n }\n if (type === parser.yy.LINETYPE.SOLID_POINT || type === parser.yy.LINETYPE.DOTTED_POINT) {\n line.attr('marker-end', 'url(' + url + '#filled-head)');\n }\n\n if (type === parser.yy.LINETYPE.SOLID_CROSS || type === parser.yy.LINETYPE.DOTTED_CROSS) {\n line.attr('marker-end', 'url(' + url + '#crosshead)');\n }\n\n // add node number\n if (sequenceDb.showSequenceNumbers() || conf.showSequenceNumbers) {\n line.attr('marker-start', 'url(' + url + '#sequencenumber)');\n g.append('text')\n .attr('x', startx)\n .attr('y', lineStarty + 4)\n .attr('font-family', 'sans-serif')\n .attr('font-size', '12px')\n .attr('text-anchor', 'middle')\n .attr('textLength', '16px')\n .attr('class', 'sequenceNumber')\n .text(sequenceIndex);\n }\n bounds.bumpVerticalPos(totalOffset);\n msgModel.height += totalOffset;\n msgModel.stopy = msgModel.starty + msgModel.height;\n bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy);\n};\n\nexport const drawActors = function (diagram, actors, actorKeys, verticalPos) {\n // Draw the actors\n let prevWidth = 0;\n let prevMargin = 0;\n let maxHeight = 0;\n for (let i = 0; i < actorKeys.length; i++) {\n const actor = actors[actorKeys[i]];\n\n // Add some rendering data to the object\n actor.width = actor.width || conf.width;\n actor.height = Math.max(actor.height || conf.height, conf.height);\n actor.margin = actor.margin || conf.actorMargin;\n\n actor.x = prevWidth + prevMargin;\n actor.y = verticalPos;\n\n // Draw the box with the attached line\n const height = svgDraw.drawActor(diagram, actor, conf);\n maxHeight = Math.max(maxHeight, height);\n bounds.insert(actor.x, verticalPos, actor.x + actor.width, actor.height);\n\n prevWidth += actor.width;\n prevMargin += actor.margin;\n bounds.models.addActor(actor);\n }\n\n // Add a margin between the actor boxes and the first arrow\n bounds.bumpVerticalPos(maxHeight);\n};\n\nexport const drawActorsPopup = function (diagram, actors, actorKeys) {\n var maxHeight = 0;\n var maxWidth = 0;\n for (let i = 0; i < actorKeys.length; i++) {\n const actor = actors[actorKeys[i]];\n const minMenuWidth = getRequiredPopupWidth(actor);\n var menuDimensions = svgDraw.drawPopup(diagram, actor, minMenuWidth, conf, conf.forceMenus);\n if (menuDimensions.height > maxHeight) {\n maxHeight = menuDimensions.height;\n }\n if (menuDimensions.width + actor.x > maxWidth) {\n maxWidth = menuDimensions.width + actor.x;\n }\n }\n\n return { maxHeight: maxHeight, maxWidth: maxWidth };\n};\n\nexport const setConf = function (cnf) {\n assignWithDepth(conf, cnf);\n\n if (cnf.fontFamily) {\n conf.actorFontFamily = conf.noteFontFamily = conf.messageFontFamily = cnf.fontFamily;\n }\n if (cnf.fontSize) {\n conf.actorFontSize = conf.noteFontSize = conf.messageFontSize = cnf.fontSize;\n }\n if (cnf.fontWeight) {\n conf.actorFontWeight = conf.noteFontWeight = conf.messageFontWeight = cnf.fontWeight;\n }\n};\n\nconst actorActivations = function (actor) {\n return bounds.activations.filter(function (activation) {\n return activation.actor === actor;\n });\n};\n\nconst activationBounds = function (actor, actors) {\n // handle multiple stacked activations for same actor\n const actorObj = actors[actor];\n const activations = actorActivations(actor);\n\n const left = activations.reduce(function (acc, activation) {\n return Math.min(acc, activation.startx);\n }, actorObj.x + actorObj.width / 2);\n const right = activations.reduce(function (acc, activation) {\n return Math.max(acc, activation.stopx);\n }, actorObj.x + actorObj.width / 2);\n return [left, right];\n};\n\n/**\n * @param {any} loopWidths\n * @param {any} msg\n * @param {any} preMargin\n * @param {any} postMargin\n * @param {any} addLoopFn\n */\nfunction adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) {\n bounds.bumpVerticalPos(preMargin);\n let heightAdjust = postMargin;\n if (msg.id && msg.message && loopWidths[msg.id]) {\n let loopWidth = loopWidths[msg.id].width;\n let textConf = messageFont(conf);\n msg.message = utils.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf.wrapPadding, textConf);\n msg.width = loopWidth;\n msg.wrap = true;\n\n // const lines = common.splitBreaks(msg.message).length;\n const textDims = utils.calculateTextDimensions(msg.message, textConf);\n const totalOffset = Math.max(textDims.height, conf.labelBoxHeight);\n heightAdjust = postMargin + totalOffset;\n log.debug(`${totalOffset} - ${msg.message}`);\n }\n addLoopFn(msg);\n bounds.bumpVerticalPos(heightAdjust);\n}\n\n/**\n * Draws a sequenceDiagram in the tag with id: id based on the graph definition in text.\n *\n * @param {any} text\n * @param {any} id\n */\nexport const draw = function (text, id) {\n conf = configApi.getConfig().sequence;\n parser.yy.clear();\n parser.yy.setWrap(conf.wrap);\n parser.parse(text + '\\n');\n bounds.init();\n log.debug(`C:${JSON.stringify(conf, null, 2)}`);\n\n const diagram = select(`[id=\"${id}\"]`);\n\n // Fetch data from the parsing\n const actors = parser.yy.getActors();\n const actorKeys = parser.yy.getActorKeys();\n const messages = parser.yy.getMessages();\n const title = parser.yy.getTitle();\n\n const maxMessageWidthPerActor = getMaxMessageWidthPerActor(actors, messages);\n conf.height = calculateActorMargins(actors, maxMessageWidthPerActor);\n\n svgDraw.insertComputerIcon(diagram);\n svgDraw.insertDatabaseIcon(diagram);\n svgDraw.insertClockIcon(diagram);\n\n drawActors(diagram, actors, actorKeys, 0);\n const loopWidths = calculateLoopBounds(messages, actors, maxMessageWidthPerActor);\n\n // The arrow head definition is attached to the svg once\n svgDraw.insertArrowHead(diagram);\n svgDraw.insertArrowCrossHead(diagram);\n svgDraw.insertArrowFilledHead(diagram);\n svgDraw.insertSequenceNumber(diagram);\n\n /**\n * @param {any} msg\n * @param {any} verticalPos\n */\n function activeEnd(msg, verticalPos) {\n const activationData = bounds.endActivation(msg);\n if (activationData.starty + 18 > verticalPos) {\n activationData.starty = verticalPos - 6;\n verticalPos += 12;\n }\n svgDraw.drawActivation(\n diagram,\n activationData,\n verticalPos,\n conf,\n actorActivations(msg.from.actor).length\n );\n\n bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);\n }\n\n // Draw the messages/signals\n let sequenceIndex = 1;\n messages.forEach(function (msg) {\n let loopModel, noteModel, msgModel;\n\n switch (msg.type) {\n case parser.yy.LINETYPE.NOTE:\n noteModel = msg.noteModel;\n drawNote(diagram, noteModel);\n break;\n case parser.yy.LINETYPE.ACTIVE_START:\n bounds.newActivation(msg, diagram, actors);\n break;\n case parser.yy.LINETYPE.ACTIVE_END:\n activeEnd(msg, bounds.getVerticalPos());\n break;\n case parser.yy.LINETYPE.LOOP_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case parser.yy.LINETYPE.LOOP_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'loop', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case parser.yy.LINETYPE.RECT_START:\n adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin, conf.boxMargin, (message) =>\n bounds.newLoop(undefined, message.message)\n );\n break;\n case parser.yy.LINETYPE.RECT_END:\n loopModel = bounds.endLoop();\n svgDraw.drawBackgroundRect(diagram, loopModel);\n bounds.models.addLoop(loopModel);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n break;\n case parser.yy.LINETYPE.OPT_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case parser.yy.LINETYPE.OPT_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'opt', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case parser.yy.LINETYPE.ALT_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case parser.yy.LINETYPE.ALT_ELSE:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin + conf.boxTextMargin,\n conf.boxMargin,\n (message) => bounds.addSectionToLoop(message)\n );\n break;\n case parser.yy.LINETYPE.ALT_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'alt', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case parser.yy.LINETYPE.PAR_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case parser.yy.LINETYPE.PAR_AND:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin + conf.boxTextMargin,\n conf.boxMargin,\n (message) => bounds.addSectionToLoop(message)\n );\n break;\n case parser.yy.LINETYPE.PAR_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'par', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n default:\n try {\n // lastMsg = msg\n msgModel = msg.msgModel;\n msgModel.starty = bounds.getVerticalPos();\n msgModel.sequenceIndex = sequenceIndex;\n drawMessage(diagram, msgModel);\n bounds.models.addMessage(msgModel);\n } catch (e) {\n log.error('error while drawing message', e);\n }\n }\n // Increment sequence counter if msg.type is a line (and not another event like activation or note, etc)\n if (\n [\n parser.yy.LINETYPE.SOLID_OPEN,\n parser.yy.LINETYPE.DOTTED_OPEN,\n parser.yy.LINETYPE.SOLID,\n parser.yy.LINETYPE.DOTTED,\n parser.yy.LINETYPE.SOLID_CROSS,\n parser.yy.LINETYPE.DOTTED_CROSS,\n parser.yy.LINETYPE.SOLID_POINT,\n parser.yy.LINETYPE.DOTTED_POINT,\n ].includes(msg.type)\n ) {\n sequenceIndex++;\n }\n });\n\n if (conf.mirrorActors) {\n // Draw actors below diagram\n bounds.bumpVerticalPos(conf.boxMargin * 2);\n drawActors(diagram, actors, actorKeys, bounds.getVerticalPos());\n bounds.bumpVerticalPos(conf.boxMargin);\n fixLifeLineHeights(diagram, bounds.getVerticalPos());\n }\n\n // only draw popups for the top row of actors.\n var requiredBoxSize = drawActorsPopup(diagram, actors, actorKeys);\n\n const { bounds: box } = bounds.getBounds();\n\n // Adjust line height of actor lines now that the height of the diagram is known\n log.debug('For line height fix Querying: #' + id + ' .actor-line');\n const actorLines = selectAll('#' + id + ' .actor-line');\n actorLines.attr('y2', box.stopy);\n\n // Make sure the height of the diagram supports long menus.\n let boxHeight = box.stopy - box.starty;\n if (boxHeight < requiredBoxSize.maxHeight) {\n boxHeight = requiredBoxSize.maxHeight;\n }\n\n let height = boxHeight + 2 * conf.diagramMarginY;\n if (conf.mirrorActors) {\n height = height - conf.boxMargin + conf.bottomMarginAdj;\n }\n\n // Make sure the width of the diagram supports wide menus.\n let boxWidth = box.stopx - box.startx;\n if (boxWidth < requiredBoxSize.maxWidth) {\n boxWidth = requiredBoxSize.maxWidth;\n }\n const width = boxWidth + 2 * conf.diagramMarginX;\n\n if (title) {\n diagram\n .append('text')\n .text(title)\n .attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX)\n .attr('y', -25);\n }\n\n configureSvgSize(diagram, height, width, conf.useMaxWidth);\n\n const extraVertForTitle = title ? 40 : 0;\n diagram.attr(\n 'viewBox',\n box.startx -\n conf.diagramMarginX +\n ' -' +\n (conf.diagramMarginY + extraVertForTitle) +\n ' ' +\n width +\n ' ' +\n (height + extraVertForTitle)\n );\n log.debug(`models:`, bounds.models);\n};\n\n/**\n * Retrieves the max message width of each actor, supports signals (messages, loops) and notes.\n *\n * It will enumerate each given message, and will determine its text width, in relation to the actor\n * it originates from, and destined to.\n *\n * @param {any} actors - The actors map\n * @param {Array} messages - A list of message objects to iterate\n * @returns {any}\n */\nconst getMaxMessageWidthPerActor = function (actors, messages) {\n const maxMessageWidthPerActor = {};\n\n messages.forEach(function (msg) {\n if (actors[msg.to] && actors[msg.from]) {\n const actor = actors[msg.to];\n\n // If this is the first actor, and the message is left of it, no need to calculate the margin\n if (msg.placement === parser.yy.PLACEMENT.LEFTOF && !actor.prevActor) {\n return;\n }\n\n // If this is the last actor, and the message is right of it, no need to calculate the margin\n if (msg.placement === parser.yy.PLACEMENT.RIGHTOF && !actor.nextActor) {\n return;\n }\n\n const isNote = msg.placement !== undefined;\n const isMessage = !isNote;\n\n const textFont = isNote ? noteFont(conf) : messageFont(conf);\n let wrappedMessage = msg.wrap\n ? utils.wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont)\n : msg.message;\n const messageDimensions = utils.calculateTextDimensions(wrappedMessage, textFont);\n const messageWidth = messageDimensions.width + 2 * conf.wrapPadding;\n\n /*\n * The following scenarios should be supported:\n *\n * - There's a message (non-note) between fromActor and toActor\n * - If fromActor is on the right and toActor is on the left, we should\n * define the toActor's margin\n * - If fromActor is on the left and toActor is on the right, we should\n * define the fromActor's margin\n * - There's a note, in which case fromActor == toActor\n * - If the note is to the left of the actor, we should define the previous actor\n * margin\n * - If the note is on the actor, we should define both the previous and next actor\n * margins, each being the half of the note size\n * - If the note is on the right of the actor, we should define the current actor\n * margin\n */\n if (isMessage && msg.from === actor.nextActor) {\n maxMessageWidthPerActor[msg.to] = Math.max(\n maxMessageWidthPerActor[msg.to] || 0,\n messageWidth\n );\n } else if (isMessage && msg.from === actor.prevActor) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth\n );\n } else if (isMessage && msg.from === msg.to) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth / 2\n );\n\n maxMessageWidthPerActor[msg.to] = Math.max(\n maxMessageWidthPerActor[msg.to] || 0,\n messageWidth / 2\n );\n } else if (msg.placement === parser.yy.PLACEMENT.RIGHTOF) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth\n );\n } else if (msg.placement === parser.yy.PLACEMENT.LEFTOF) {\n maxMessageWidthPerActor[actor.prevActor] = Math.max(\n maxMessageWidthPerActor[actor.prevActor] || 0,\n messageWidth\n );\n } else if (msg.placement === parser.yy.PLACEMENT.OVER) {\n if (actor.prevActor) {\n maxMessageWidthPerActor[actor.prevActor] = Math.max(\n maxMessageWidthPerActor[actor.prevActor] || 0,\n messageWidth / 2\n );\n }\n\n if (actor.nextActor) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth / 2\n );\n }\n }\n }\n });\n\n log.debug('maxMessageWidthPerActor:', maxMessageWidthPerActor);\n return maxMessageWidthPerActor;\n};\n\nconst getRequiredPopupWidth = function (actor) {\n let requiredPopupWidth = 0;\n const textFont = actorFont(conf);\n for (let key in actor.links) {\n let labelDimensions = utils.calculateTextDimensions(key, textFont);\n let labelWidth = labelDimensions.width + 2 * conf.wrapPadding + 2 * conf.boxMargin;\n if (requiredPopupWidth < labelWidth) {\n requiredPopupWidth = labelWidth;\n }\n }\n\n return requiredPopupWidth;\n};\n\n/**\n * This will calculate the optimal margin for each given actor, for a given actor->messageWidth map.\n *\n * An actor's margin is determined by the width of the actor, the width of the largest message that\n * originates from it, and the configured conf.actorMargin.\n *\n * @param {any} actors - The actors map to calculate margins for\n * @param {any} actorToMessageWidth - A map of actor key -> max message width it holds\n */\nconst calculateActorMargins = function (actors, actorToMessageWidth) {\n let maxHeight = 0;\n Object.keys(actors).forEach((prop) => {\n const actor = actors[prop];\n if (actor.wrap) {\n actor.description = utils.wrapLabel(\n actor.description,\n conf.width - 2 * conf.wrapPadding,\n actorFont(conf)\n );\n }\n const actDims = utils.calculateTextDimensions(actor.description, actorFont(conf));\n actor.width = actor.wrap\n ? conf.width\n : Math.max(conf.width, actDims.width + 2 * conf.wrapPadding);\n\n actor.height = actor.wrap ? Math.max(actDims.height, conf.height) : conf.height;\n maxHeight = Math.max(maxHeight, actor.height);\n });\n\n for (let actorKey in actorToMessageWidth) {\n const actor = actors[actorKey];\n\n if (!actor) {\n continue;\n }\n\n const nextActor = actors[actor.nextActor];\n\n // No need to space out an actor that doesn't have a next link\n if (!nextActor) {\n continue;\n }\n\n const messageWidth = actorToMessageWidth[actorKey];\n const actorWidth = messageWidth + conf.actorMargin - actor.width / 2 - nextActor.width / 2;\n\n actor.margin = Math.max(actorWidth, conf.actorMargin);\n }\n\n return Math.max(maxHeight, conf.height);\n};\n\nconst buildNoteModel = function (msg, actors) {\n let startx = actors[msg.from].x;\n let stopx = actors[msg.to].x;\n let shouldWrap = msg.wrap && msg.message;\n\n let textDimensions = utils.calculateTextDimensions(\n shouldWrap ? utils.wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message,\n noteFont(conf)\n );\n let noteModel = {\n width: shouldWrap\n ? conf.width\n : Math.max(conf.width, textDimensions.width + 2 * conf.noteMargin),\n height: 0,\n startx: actors[msg.from].x,\n stopx: 0,\n starty: 0,\n stopy: 0,\n message: msg.message,\n };\n if (msg.placement === parser.yy.PLACEMENT.RIGHTOF) {\n noteModel.width = shouldWrap\n ? Math.max(conf.width, textDimensions.width)\n : Math.max(\n actors[msg.from].width / 2 + actors[msg.to].width / 2,\n textDimensions.width + 2 * conf.noteMargin\n );\n noteModel.startx = startx + (actors[msg.from].width + conf.actorMargin) / 2;\n } else if (msg.placement === parser.yy.PLACEMENT.LEFTOF) {\n noteModel.width = shouldWrap\n ? Math.max(conf.width, textDimensions.width + 2 * conf.noteMargin)\n : Math.max(\n actors[msg.from].width / 2 + actors[msg.to].width / 2,\n textDimensions.width + 2 * conf.noteMargin\n );\n noteModel.startx = startx - noteModel.width + (actors[msg.from].width - conf.actorMargin) / 2;\n } else if (msg.to === msg.from) {\n textDimensions = utils.calculateTextDimensions(\n shouldWrap\n ? utils.wrapLabel(msg.message, Math.max(conf.width, actors[msg.from].width), noteFont(conf))\n : msg.message,\n noteFont(conf)\n );\n noteModel.width = shouldWrap\n ? Math.max(conf.width, actors[msg.from].width)\n : Math.max(actors[msg.from].width, conf.width, textDimensions.width + 2 * conf.noteMargin);\n noteModel.startx = startx + (actors[msg.from].width - noteModel.width) / 2;\n } else {\n noteModel.width =\n Math.abs(startx + actors[msg.from].width / 2 - (stopx + actors[msg.to].width / 2)) +\n conf.actorMargin;\n noteModel.startx =\n startx < stopx\n ? startx + actors[msg.from].width / 2 - conf.actorMargin / 2\n : stopx + actors[msg.to].width / 2 - conf.actorMargin / 2;\n }\n if (shouldWrap) {\n noteModel.message = utils.wrapLabel(\n msg.message,\n noteModel.width - 2 * conf.wrapPadding,\n noteFont(conf)\n );\n }\n log.debug(\n `NM:[${noteModel.startx},${noteModel.stopx},${noteModel.starty},${noteModel.stopy}:${noteModel.width},${noteModel.height}=${msg.message}]`\n );\n return noteModel;\n};\n\nconst buildMessageModel = function (msg, actors) {\n let process = false;\n if (\n [\n parser.yy.LINETYPE.SOLID_OPEN,\n parser.yy.LINETYPE.DOTTED_OPEN,\n parser.yy.LINETYPE.SOLID,\n parser.yy.LINETYPE.DOTTED,\n parser.yy.LINETYPE.SOLID_CROSS,\n parser.yy.LINETYPE.DOTTED_CROSS,\n parser.yy.LINETYPE.SOLID_POINT,\n parser.yy.LINETYPE.DOTTED_POINT,\n ].includes(msg.type)\n ) {\n process = true;\n }\n if (!process) {\n return {};\n }\n const fromBounds = activationBounds(msg.from, actors);\n const toBounds = activationBounds(msg.to, actors);\n const fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;\n const toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;\n const allBounds = fromBounds.concat(toBounds);\n const boundedWidth = Math.abs(toBounds[toIdx] - fromBounds[fromIdx]);\n if (msg.wrap && msg.message) {\n msg.message = utils.wrapLabel(\n msg.message,\n Math.max(boundedWidth + 2 * conf.wrapPadding, conf.width),\n messageFont(conf)\n );\n }\n const msgDims = utils.calculateTextDimensions(msg.message, messageFont(conf));\n\n return {\n width: Math.max(\n msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding,\n boundedWidth + 2 * conf.wrapPadding,\n conf.width\n ),\n height: 0,\n startx: fromBounds[fromIdx],\n stopx: toBounds[toIdx],\n starty: 0,\n stopy: 0,\n message: msg.message,\n type: msg.type,\n wrap: msg.wrap,\n fromBounds: Math.min.apply(null, allBounds),\n toBounds: Math.max.apply(null, allBounds),\n };\n};\n\nconst calculateLoopBounds = function (messages, actors) {\n const loops = {};\n const stack = [];\n let current, noteModel, msgModel;\n\n messages.forEach(function (msg) {\n msg.id = utils.random({ length: 10 });\n switch (msg.type) {\n case parser.yy.LINETYPE.LOOP_START:\n case parser.yy.LINETYPE.ALT_START:\n case parser.yy.LINETYPE.OPT_START:\n case parser.yy.LINETYPE.PAR_START:\n stack.push({\n id: msg.id,\n msg: msg.message,\n from: Number.MAX_SAFE_INTEGER,\n to: Number.MIN_SAFE_INTEGER,\n width: 0,\n });\n break;\n case parser.yy.LINETYPE.ALT_ELSE:\n case parser.yy.LINETYPE.PAR_AND:\n if (msg.message) {\n current = stack.pop();\n loops[current.id] = current;\n loops[msg.id] = current;\n stack.push(current);\n }\n break;\n case parser.yy.LINETYPE.LOOP_END:\n case parser.yy.LINETYPE.ALT_END:\n case parser.yy.LINETYPE.OPT_END:\n case parser.yy.LINETYPE.PAR_END:\n current = stack.pop();\n loops[current.id] = current;\n break;\n case parser.yy.LINETYPE.ACTIVE_START:\n {\n const actorRect = actors[msg.from ? msg.from.actor : msg.to.actor];\n const stackedSize = actorActivations(msg.from ? msg.from.actor : msg.to.actor).length;\n const x =\n actorRect.x + actorRect.width / 2 + ((stackedSize - 1) * conf.activationWidth) / 2;\n const toAdd = {\n startx: x,\n stopx: x + conf.activationWidth,\n actor: msg.from.actor,\n enabled: true,\n };\n bounds.activations.push(toAdd);\n }\n break;\n case parser.yy.LINETYPE.ACTIVE_END:\n {\n const lastActorActivationIdx = bounds.activations\n .map((a) => a.actor)\n .lastIndexOf(msg.from.actor);\n delete bounds.activations.splice(lastActorActivationIdx, 1)[0];\n }\n break;\n }\n const isNote = msg.placement !== undefined;\n if (isNote) {\n noteModel = buildNoteModel(msg, actors);\n msg.noteModel = noteModel;\n stack.forEach((stk) => {\n current = stk;\n current.from = Math.min(current.from, noteModel.startx);\n current.to = Math.max(current.to, noteModel.startx + noteModel.width);\n current.width =\n Math.max(current.width, Math.abs(current.from - current.to)) - conf.labelBoxWidth;\n });\n } else {\n msgModel = buildMessageModel(msg, actors);\n msg.msgModel = msgModel;\n if (msgModel.startx && msgModel.stopx && stack.length > 0) {\n stack.forEach((stk) => {\n current = stk;\n if (msgModel.startx === msgModel.stopx) {\n let from = actors[msg.from];\n let to = actors[msg.to];\n current.from = Math.min(\n from.x - msgModel.width / 2,\n from.x - from.width / 2,\n current.from\n );\n current.to = Math.max(to.x + msgModel.width / 2, to.x + from.width / 2, current.to);\n current.width =\n Math.max(current.width, Math.abs(current.to - current.from)) - conf.labelBoxWidth;\n } else {\n current.from = Math.min(msgModel.startx, current.from);\n current.to = Math.max(msgModel.stopx, current.to);\n current.width = Math.max(current.width, msgModel.width) - conf.labelBoxWidth;\n }\n });\n }\n }\n });\n bounds.activations = [];\n log.debug('Loop type widths:', loops);\n return loops;\n};\n\nexport default {\n bounds,\n drawActors,\n drawActorsPopup,\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `.actor {\n stroke: ${options.actorBorder};\n fill: ${options.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${options.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${options.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${options.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${options.signalColor};\n }\n\n #arrowhead path {\n fill: ${options.signalColor};\n stroke: ${options.signalColor};\n }\n\n .sequenceNumber {\n fill: ${options.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${options.signalColor};\n }\n\n #crosshead path {\n fill: ${options.signalColor};\n stroke: ${options.signalColor};\n }\n\n .messageText {\n fill: ${options.signalTextColor};\n stroke: ${options.signalTextColor};\n }\n\n .labelBox {\n stroke: ${options.labelBoxBorderColor};\n fill: ${options.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${options.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${options.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${options.labelBoxBorderColor};\n fill: ${options.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${options.noteBorderColor};\n fill: ${options.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${options.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${options.activationBkgColor};\n stroke: ${options.activationBorderColor};\n }\n\n .activation1 {\n fill: ${options.activationBkgColor};\n stroke: ${options.activationBorderColor};\n }\n\n .activation2 {\n fill: ${options.activationBkgColor};\n stroke: ${options.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${options.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${options.actorBorder};\n fill: ${options.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${options.actorBorder};\n fill: ${options.actorBkg};\n stroke-width: 2px;\n }\n`;\n\nexport default getStyles;\n","import common from '../common/common';\nimport { addFunction } from '../../interactionDb';\n\nexport const drawRect = function (elem, rectData) {\n const rectElem = elem.append('rect');\n rectElem.attr('x', rectData.x);\n rectElem.attr('y', rectData.y);\n rectElem.attr('fill', rectData.fill);\n rectElem.attr('stroke', rectData.stroke);\n rectElem.attr('width', rectData.width);\n rectElem.attr('height', rectData.height);\n rectElem.attr('rx', rectData.rx);\n rectElem.attr('ry', rectData.ry);\n\n if (typeof rectData.class !== 'undefined') {\n rectElem.attr('class', rectData.class);\n }\n\n return rectElem;\n};\n\nconst sanitizeUrl = function (s) {\n return s\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/javascript:/g, '');\n};\n\nconst addPopupInteraction = (id, actorCnt) => {\n addFunction(() => {\n const arr = document.querySelectorAll(id);\n arr[0].addEventListener('mouseover', function () {\n popupMenuUpFunc('actor' + actorCnt + '_popup');\n });\n arr[0].addEventListener('mouseout', function () {\n popupMenuDownFunc('actor' + actorCnt + '_popup');\n });\n });\n};\nexport const drawPopup = function (elem, actor, minMenuWidth, textAttrs, forceMenus) {\n if (actor.links === undefined || actor.links === null || Object.keys(actor.links).length === 0) {\n return { height: 0, width: 0 };\n }\n\n const links = actor.links;\n const actorCnt = actor.actorCnt;\n const rectData = actor.rectData;\n\n var displayValue = 'none';\n if (forceMenus) {\n displayValue = 'block !important';\n }\n\n const g = elem.append('g');\n g.attr('id', 'actor' + actorCnt + '_popup');\n g.attr('class', 'actorPopupMenu');\n g.attr('display', displayValue);\n addPopupInteraction('#actor' + actorCnt + '_popup', actorCnt);\n var actorClass = '';\n if (typeof rectData.class !== 'undefined') {\n actorClass = ' ' + rectData.class;\n }\n\n let menuWidth = rectData.width > minMenuWidth ? rectData.width : minMenuWidth;\n\n const rectElem = g.append('rect');\n rectElem.attr('class', 'actorPopupMenuPanel' + actorClass);\n rectElem.attr('x', rectData.x);\n rectElem.attr('y', rectData.height);\n rectElem.attr('fill', rectData.fill);\n rectElem.attr('stroke', rectData.stroke);\n rectElem.attr('width', menuWidth);\n rectElem.attr('height', rectData.height);\n rectElem.attr('rx', rectData.rx);\n rectElem.attr('ry', rectData.ry);\n if (links != null) {\n var linkY = 20;\n for (let key in links) {\n var linkElem = g.append('a');\n var sanitizedLink = sanitizeUrl(links[key]);\n linkElem.attr('xlink:href', sanitizedLink);\n linkElem.attr('target', '_blank');\n\n _drawMenuItemTextCandidateFunc(textAttrs)(\n key,\n linkElem,\n rectData.x + 10,\n rectData.height + linkY,\n menuWidth,\n 20,\n { class: 'actor' },\n textAttrs\n );\n\n linkY += 30;\n }\n }\n\n rectElem.attr('height', linkY);\n\n return { height: rectData.height + linkY, width: menuWidth };\n};\n\nexport const drawImage = function (elem, x, y, link) {\n const imageElem = elem.append('image');\n imageElem.attr('x', x);\n imageElem.attr('y', y);\n var sanitizedLink = sanitizeUrl(link);\n imageElem.attr('xlink:href', sanitizedLink);\n};\n\nexport const drawEmbeddedImage = function (elem, x, y, link) {\n const imageElem = elem.append('use');\n imageElem.attr('x', x);\n imageElem.attr('y', y);\n var sanitizedLink = sanitizeUrl(link);\n imageElem.attr('xlink:href', '#' + sanitizedLink);\n};\n\nexport const popupMenu = function (popid) {\n return (\n \"var pu = document.getElementById('\" +\n popid +\n \"'); if (pu != null) { pu.style.display = 'block'; }\"\n );\n};\n\nexport const popdownMenu = function (popid) {\n return (\n \"var pu = document.getElementById('\" +\n popid +\n \"'); if (pu != null) { pu.style.display = 'none'; }\"\n );\n};\n\nconst popupMenuUpFunc = function (popupId) {\n var pu = document.getElementById(popupId);\n if (pu != null) {\n pu.style.display = 'block';\n }\n};\n\nconst popupMenuDownFunc = function (popupId) {\n var pu = document.getElementById(popupId);\n if (pu != null) {\n pu.style.display = 'none';\n }\n};\nexport const drawText = function (elem, textData) {\n let prevTextHeight = 0,\n textHeight = 0;\n const lines = textData.text.split(common.lineBreakRegex);\n\n let textElems = [];\n let dy = 0;\n let yfunc = () => textData.y;\n if (\n typeof textData.valign !== 'undefined' &&\n typeof textData.textMargin !== 'undefined' &&\n textData.textMargin > 0\n ) {\n switch (textData.valign) {\n case 'top':\n case 'start':\n yfunc = () => Math.round(textData.y + textData.textMargin);\n break;\n case 'middle':\n case 'center':\n yfunc = () =>\n Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2);\n break;\n case 'bottom':\n case 'end':\n yfunc = () =>\n Math.round(\n textData.y +\n (prevTextHeight + textHeight + 2 * textData.textMargin) -\n textData.textMargin\n );\n break;\n }\n }\n if (\n typeof textData.anchor !== 'undefined' &&\n typeof textData.textMargin !== 'undefined' &&\n typeof textData.width !== 'undefined'\n ) {\n switch (textData.anchor) {\n case 'left':\n case 'start':\n textData.x = Math.round(textData.x + textData.textMargin);\n textData.anchor = 'start';\n textData.dominantBaseline = 'text-after-edge';\n textData.alignmentBaseline = 'middle';\n break;\n case 'middle':\n case 'center':\n textData.x = Math.round(textData.x + textData.width / 2);\n textData.anchor = 'middle';\n textData.dominantBaseline = 'middle';\n textData.alignmentBaseline = 'middle';\n break;\n case 'right':\n case 'end':\n textData.x = Math.round(textData.x + textData.width - textData.textMargin);\n textData.anchor = 'end';\n textData.dominantBaseline = 'text-before-edge';\n textData.alignmentBaseline = 'middle';\n break;\n }\n }\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i];\n if (\n typeof textData.textMargin !== 'undefined' &&\n textData.textMargin === 0 &&\n typeof textData.fontSize !== 'undefined'\n ) {\n dy = i * textData.fontSize;\n }\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', yfunc());\n if (typeof textData.anchor !== 'undefined') {\n textElem\n .attr('text-anchor', textData.anchor)\n .attr('dominant-baseline', textData.dominantBaseline)\n .attr('alignment-baseline', textData.alignmentBaseline);\n }\n if (typeof textData.fontFamily !== 'undefined') {\n textElem.style('font-family', textData.fontFamily);\n }\n if (typeof textData.fontSize !== 'undefined') {\n textElem.style('font-size', textData.fontSize);\n }\n if (typeof textData.fontWeight !== 'undefined') {\n textElem.style('font-weight', textData.fontWeight);\n }\n if (typeof textData.fill !== 'undefined') {\n textElem.attr('fill', textData.fill);\n }\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n if (typeof textData.dy !== 'undefined') {\n textElem.attr('dy', textData.dy);\n } else if (dy !== 0) {\n textElem.attr('dy', dy);\n }\n\n if (textData.tspan) {\n const span = textElem.append('tspan');\n span.attr('x', textData.x);\n if (typeof textData.fill !== 'undefined') {\n span.attr('fill', textData.fill);\n }\n span.text(line);\n } else {\n textElem.text(line);\n }\n if (\n typeof textData.valign !== 'undefined' &&\n typeof textData.textMargin !== 'undefined' &&\n textData.textMargin > 0\n ) {\n textHeight += (textElem._groups || textElem)[0][0].getBBox().height;\n prevTextHeight = textHeight;\n }\n\n textElems.push(textElem);\n }\n\n return textElems;\n};\n\nexport const drawLabel = function (elem, txtObject) {\n /**\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} cut\n * @returns {any}\n */\n function genPoints(x, y, width, height, cut) {\n return (\n x +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n (y + height - cut) +\n ' ' +\n (x + width - cut * 1.2) +\n ',' +\n (y + height) +\n ' ' +\n x +\n ',' +\n (y + height)\n );\n }\n const polygon = elem.append('polygon');\n polygon.attr('points', genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7));\n polygon.attr('class', 'labelBox');\n\n txtObject.y = txtObject.y + txtObject.height / 2;\n\n drawText(elem, txtObject);\n return polygon;\n};\n\nlet actorCnt = -1;\n\nexport const fixLifeLineHeights = (diagram, bounds) => {\n if (!diagram.selectAll) return;\n diagram\n .selectAll('.actor-line')\n .attr('class', '200')\n .attr('y2', bounds - 55);\n};\n\n/**\n * Draws an actor in the diagram with the attached line\n *\n * @param {any} elem - The diagram we'll draw to.\n * @param {any} actor - The actor to draw.\n * @param {any} conf - DrawText implementation discriminator object\n */\nconst drawActorTypeParticipant = function (elem, actor, conf) {\n const center = actor.x + actor.width / 2;\n\n const boxpluslineGroup = elem.append('g');\n var g = boxpluslineGroup;\n\n if (actor.y === 0) {\n actorCnt++;\n g.append('line')\n .attr('id', 'actor' + actorCnt)\n .attr('x1', center)\n .attr('y1', 5)\n .attr('x2', center)\n .attr('y2', 2000)\n .attr('class', 'actor-line')\n .attr('stroke-width', '0.5px')\n .attr('stroke', '#999');\n\n g = boxpluslineGroup.append('g');\n actor.actorCnt = actorCnt;\n\n if (actor.links != null) {\n g.attr('id', 'root-' + actorCnt);\n addPopupInteraction('#root-' + actorCnt, actorCnt);\n }\n }\n\n const rect = getNoteRect();\n var cssclass = 'actor';\n if (actor.properties != null && actor.properties['class']) {\n cssclass = actor.properties['class'];\n } else {\n rect.fill = '#eaeaea';\n }\n rect.x = actor.x;\n rect.y = actor.y;\n rect.width = actor.width;\n rect.height = actor.height;\n rect.class = cssclass;\n rect.rx = 3;\n rect.ry = 3;\n const rectElem = drawRect(g, rect);\n actor.rectData = rect;\n\n if (actor.properties != null && actor.properties['icon']) {\n const iconSrc = actor.properties['icon'].trim();\n if (iconSrc.charAt(0) === '@') {\n drawEmbeddedImage(g, rect.x + rect.width - 20, rect.y + 10, iconSrc.substr(1));\n } else {\n drawImage(g, rect.x + rect.width - 20, rect.y + 10, iconSrc);\n }\n }\n\n _drawTextCandidateFunc(conf)(\n actor.description,\n g,\n rect.x,\n rect.y,\n rect.width,\n rect.height,\n { class: 'actor' },\n conf\n );\n\n let height = actor.height;\n if (rectElem.node) {\n const bounds = rectElem.node().getBBox();\n actor.height = bounds.height;\n height = bounds.height;\n }\n\n return height;\n};\n\nconst drawActorTypeActor = function (elem, actor, conf) {\n const center = actor.x + actor.width / 2;\n\n if (actor.y === 0) {\n actorCnt++;\n elem\n .append('line')\n .attr('id', 'actor' + actorCnt)\n .attr('x1', center)\n .attr('y1', 80)\n .attr('x2', center)\n .attr('y2', 2000)\n .attr('class', 'actor-line')\n .attr('stroke-width', '0.5px')\n .attr('stroke', '#999');\n }\n const actElem = elem.append('g');\n actElem.attr('class', 'actor-man');\n\n const rect = getNoteRect();\n rect.x = actor.x;\n rect.y = actor.y;\n rect.fill = '#eaeaea';\n rect.width = actor.width;\n rect.height = actor.height;\n rect.class = 'actor';\n rect.rx = 3;\n rect.ry = 3;\n // drawRect(actElem, rect);\n\n actElem\n .append('line')\n .attr('id', 'actor-man-torso' + actorCnt)\n .attr('x1', center)\n .attr('y1', actor.y + 25)\n .attr('x2', center)\n .attr('y2', actor.y + 45);\n\n actElem\n .append('line')\n .attr('id', 'actor-man-arms' + actorCnt)\n .attr('x1', center - 18)\n .attr('y1', actor.y + 33)\n .attr('x2', center + 18)\n .attr('y2', actor.y + 33);\n actElem\n .append('line')\n .attr('x1', center - 18)\n .attr('y1', actor.y + 60)\n .attr('x2', center)\n .attr('y2', actor.y + 45);\n actElem\n .append('line')\n .attr('x1', center)\n .attr('y1', actor.y + 45)\n .attr('x2', center + 16)\n .attr('y2', actor.y + 60);\n\n const circle = actElem.append('circle');\n circle.attr('cx', actor.x + actor.width / 2);\n circle.attr('cy', actor.y + 10);\n circle.attr('r', 15);\n circle.attr('width', actor.width);\n circle.attr('height', actor.height);\n\n const bounds = actElem.node().getBBox();\n actor.height = bounds.height;\n\n _drawTextCandidateFunc(conf)(\n actor.description,\n actElem,\n rect.x,\n rect.y + 35,\n rect.width,\n rect.height,\n { class: 'actor' },\n conf\n );\n\n return actor.height;\n};\n\nexport const drawActor = function (elem, actor, conf) {\n switch (actor.type) {\n case 'actor':\n return drawActorTypeActor(elem, actor, conf);\n case 'participant':\n return drawActorTypeParticipant(elem, actor, conf);\n }\n};\n\nexport const anchorElement = function (elem) {\n return elem.append('g');\n};\n/**\n * Draws an activation in the diagram\n *\n * @param {any} elem - Element to append activation rect.\n * @param {any} bounds - Activation box bounds.\n * @param {any} verticalPos - Precise y cooridnate of bottom activation box edge.\n * @param {any} conf - Sequence diagram config object.\n * @param {any} actorActivations - Number of activations on the actor.\n */\nexport const drawActivation = function (elem, bounds, verticalPos, conf, actorActivations) {\n const rect = getNoteRect();\n const g = bounds.anchored;\n rect.x = bounds.startx;\n rect.y = bounds.starty;\n rect.class = 'activation' + (actorActivations % 3); // Will evaluate to 0, 1 or 2\n rect.width = bounds.stopx - bounds.startx;\n rect.height = verticalPos - bounds.starty;\n drawRect(g, rect);\n};\n\n/**\n * Draws a loop in the diagram\n *\n * @param {any} elem - Elemenet to append the loop to.\n * @param {any} loopModel - LoopModel of the given loop.\n * @param {any} labelText - Text within the loop.\n * @param {any} conf - Diagrom configuration\n * @returns {any}\n */\nexport const drawLoop = function (elem, loopModel, labelText, conf) {\n const {\n boxMargin,\n boxTextMargin,\n labelBoxHeight,\n labelBoxWidth,\n messageFontFamily: fontFamily,\n messageFontSize: fontSize,\n messageFontWeight: fontWeight,\n } = conf;\n const g = elem.append('g');\n const drawLoopLine = function (startx, starty, stopx, stopy) {\n return g\n .append('line')\n .attr('x1', startx)\n .attr('y1', starty)\n .attr('x2', stopx)\n .attr('y2', stopy)\n .attr('class', 'loopLine');\n };\n drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty);\n drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy);\n drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy);\n drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy);\n if (typeof loopModel.sections !== 'undefined') {\n loopModel.sections.forEach(function (item) {\n drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style(\n 'stroke-dasharray',\n '3, 3'\n );\n });\n }\n\n let txt = getTextObj();\n txt.text = labelText;\n txt.x = loopModel.startx;\n txt.y = loopModel.starty;\n txt.fontFamily = fontFamily;\n txt.fontSize = fontSize;\n txt.fontWeight = fontWeight;\n txt.anchor = 'middle';\n txt.valign = 'middle';\n txt.tspan = false;\n txt.width = labelBoxWidth || 50;\n txt.height = labelBoxHeight || 20;\n txt.textMargin = boxTextMargin;\n txt.class = 'labelText';\n\n drawLabel(g, txt);\n txt = getTextObj();\n txt.text = loopModel.title;\n txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2;\n txt.y = loopModel.starty + boxMargin + boxTextMargin;\n txt.anchor = 'middle';\n txt.valign = 'middle';\n txt.textMargin = boxTextMargin;\n txt.class = 'loopText';\n txt.fontFamily = fontFamily;\n txt.fontSize = fontSize;\n txt.fontWeight = fontWeight;\n txt.wrap = true;\n\n let textElem = drawText(g, txt);\n\n if (typeof loopModel.sectionTitles !== 'undefined') {\n loopModel.sectionTitles.forEach(function (item, idx) {\n if (item.message) {\n txt.text = item.message;\n txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2;\n txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin;\n txt.class = 'loopText';\n txt.anchor = 'middle';\n txt.valign = 'middle';\n txt.tspan = false;\n txt.fontFamily = fontFamily;\n txt.fontSize = fontSize;\n txt.fontWeight = fontWeight;\n txt.wrap = loopModel.wrap;\n textElem = drawText(g, txt);\n let sectionHeight = Math.round(\n textElem\n .map((te) => (te._groups || te)[0][0].getBBox().height)\n .reduce((acc, curr) => acc + curr)\n );\n loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin);\n }\n });\n }\n\n loopModel.height = Math.round(loopModel.stopy - loopModel.starty);\n return g;\n};\n\n/**\n * Draws a background rectangle\n *\n * @param {any} elem Diagram (reference for bounds)\n * @param {any} bounds Shape of the rectangle\n */\nexport const drawBackgroundRect = function (elem, bounds) {\n const rectElem = drawRect(elem, {\n x: bounds.startx,\n y: bounds.starty,\n width: bounds.stopx - bounds.startx,\n height: bounds.stopy - bounds.starty,\n fill: bounds.fill,\n class: 'rect',\n });\n rectElem.lower();\n};\n\nexport const insertDatabaseIcon = function (elem) {\n elem\n .append('defs')\n .append('symbol')\n .attr('id', 'database')\n .attr('fill-rule', 'evenodd')\n .attr('clip-rule', 'evenodd')\n .append('path')\n .attr('transform', 'scale(.5)')\n .attr(\n 'd',\n 'M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z'\n );\n};\n\nexport const insertComputerIcon = function (elem) {\n elem\n .append('defs')\n .append('symbol')\n .attr('id', 'computer')\n .attr('width', '24')\n .attr('height', '24')\n .append('path')\n .attr('transform', 'scale(.5)')\n .attr(\n 'd',\n 'M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z'\n );\n};\n\nexport const insertClockIcon = function (elem) {\n elem\n .append('defs')\n .append('symbol')\n .attr('id', 'clock')\n .attr('width', '24')\n .attr('height', '24')\n .append('path')\n .attr('transform', 'scale(.5)')\n .attr(\n 'd',\n 'M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z'\n );\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param elem\n */\nexport const insertArrowHead = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'arrowhead')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 12)\n .attr('markerHeight', 12)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead\n};\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {any} elem\n */\nexport const insertArrowFilledHead = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'filled-head')\n .attr('refX', 18)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n/**\n * Setup node number. The result is appended to the svg.\n *\n * @param {any} elem\n */\nexport const insertSequenceNumber = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'sequencenumber')\n .attr('refX', 15)\n .attr('refY', 15)\n .attr('markerWidth', 60)\n .attr('markerHeight', 40)\n .attr('orient', 'auto')\n .append('circle')\n .attr('cx', 15)\n .attr('cy', 15)\n .attr('r', 6);\n // .style(\"fill\", '#f00');\n};\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {any} elem\n */\nexport const insertArrowCrossHead = function (elem) {\n const defs = elem.append('defs');\n const marker = defs\n .append('marker')\n .attr('id', 'crosshead')\n .attr('markerWidth', 15)\n .attr('markerHeight', 8)\n .attr('orient', 'auto')\n .attr('refX', 16)\n .attr('refY', 4);\n\n // The arrow\n marker\n .append('path')\n .attr('fill', 'black')\n .attr('stroke', '#000000')\n .style('stroke-dasharray', '0, 0')\n .attr('stroke-width', '1px')\n .attr('d', 'M 9,2 V 6 L16,4 Z');\n\n // The cross\n marker\n .append('path')\n .attr('fill', 'none')\n .attr('stroke', '#000000')\n .style('stroke-dasharray', '0, 0')\n .attr('stroke-width', '1px')\n .attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7');\n // this is actual shape for arrowhead\n};\n\nexport const getTextObj = function () {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n anchor: undefined,\n style: '#666',\n width: undefined,\n height: undefined,\n textMargin: 0,\n rx: 0,\n ry: 0,\n tspan: true,\n valign: undefined,\n };\n};\n\nexport const getNoteRect = function () {\n return {\n x: 0,\n y: 0,\n fill: '#EDF2AE',\n stroke: '#666',\n width: 100,\n anchor: 'start',\n height: 100,\n rx: 0,\n ry: 0,\n };\n};\n\nconst _drawTextCandidateFunc = (function () {\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n */\n function byText(content, g, x, y, width, height, textAttrs) {\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y + height / 2 + 5)\n .style('text-anchor', 'middle')\n .text(content);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byTspan(content, g, x, y, width, height, textAttrs, conf) {\n const { actorFontSize, actorFontFamily, actorFontWeight } = conf;\n\n const lines = content.split(common.lineBreakRegex);\n for (let i = 0; i < lines.length; i++) {\n const dy = i * actorFontSize - (actorFontSize * (lines.length - 1)) / 2;\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y)\n .style('text-anchor', 'middle')\n .style('font-size', actorFontSize)\n .style('font-weight', actorFontWeight)\n .style('font-family', actorFontFamily);\n text\n .append('tspan')\n .attr('x', x + width / 2)\n .attr('dy', dy)\n .text(lines[i]);\n\n text\n .attr('y', y + height / 2.0)\n .attr('dominant-baseline', 'central')\n .attr('alignment-baseline', 'central');\n\n _setTextAttrs(text, textAttrs);\n }\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byFo(content, g, x, y, width, height, textAttrs, conf) {\n const s = g.append('switch');\n const f = s\n .append('foreignObject')\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n\n const text = f\n .append('xhtml:div')\n .style('display', 'table')\n .style('height', '100%')\n .style('width', '100%');\n\n text\n .append('div')\n .style('display', 'table-cell')\n .style('text-align', 'center')\n .style('vertical-align', 'middle')\n .text(content);\n\n byTspan(content, s, x, y, width, height, textAttrs, conf);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} toText\n * @param {any} fromTextAttrsDict\n */\n function _setTextAttrs(toText, fromTextAttrsDict) {\n for (const key in fromTextAttrsDict) {\n if (fromTextAttrsDict.hasOwnProperty(key)) { // eslint-disable-line\n toText.attr(key, fromTextAttrsDict[key]);\n }\n }\n }\n\n return function (conf) {\n return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;\n };\n})();\n\nconst _drawMenuItemTextCandidateFunc = (function () {\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n */\n function byText(content, g, x, y, width, height, textAttrs) {\n const text = g\n .append('text')\n .attr('x', x)\n .attr('y', y)\n .style('text-anchor', 'start')\n .text(content);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byTspan(content, g, x, y, width, height, textAttrs, conf) {\n const { actorFontSize, actorFontFamily, actorFontWeight } = conf;\n\n const lines = content.split(common.lineBreakRegex);\n for (let i = 0; i < lines.length; i++) {\n const dy = i * actorFontSize - (actorFontSize * (lines.length - 1)) / 2;\n const text = g\n .append('text')\n .attr('x', x)\n .attr('y', y)\n .style('text-anchor', 'start')\n .style('font-size', actorFontSize)\n .style('font-weight', actorFontWeight)\n .style('font-family', actorFontFamily);\n text.append('tspan').attr('x', x).attr('dy', dy).text(lines[i]);\n\n text\n .attr('y', y + height / 2.0)\n .attr('dominant-baseline', 'central')\n .attr('alignment-baseline', 'central');\n\n _setTextAttrs(text, textAttrs);\n }\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byFo(content, g, x, y, width, height, textAttrs, conf) {\n const s = g.append('switch');\n const f = s\n .append('foreignObject')\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n\n const text = f\n .append('xhtml:div')\n .style('display', 'table')\n .style('height', '100%')\n .style('width', '100%');\n\n text\n .append('div')\n .style('display', 'table-cell')\n .style('text-align', 'center')\n .style('vertical-align', 'middle')\n .text(content);\n\n byTspan(content, s, x, y, width, height, textAttrs, conf);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} toText\n * @param {any} fromTextAttrsDict\n */\n function _setTextAttrs(toText, fromTextAttrsDict) {\n for (const key in fromTextAttrsDict) {\n if (fromTextAttrsDict.hasOwnProperty(key)) { // eslint-disable-line\n toText.attr(key, fromTextAttrsDict[key]);\n }\n }\n }\n\n return function (conf) {\n return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;\n };\n})();\n\nexport default {\n drawRect,\n drawText,\n drawLabel,\n drawActor,\n drawPopup,\n drawImage,\n drawEmbeddedImage,\n anchorElement,\n drawActivation,\n drawLoop,\n drawBackgroundRect,\n insertArrowHead,\n insertArrowFilledHead,\n insertSequenceNumber,\n insertArrowCrossHead,\n insertDatabaseIcon,\n insertComputerIcon,\n insertClockIcon,\n getTextObj,\n getNoteRect,\n popupMenu,\n popdownMenu,\n fixLifeLineHeights,\n};\n","const idCache = {};\n\nexport const set = (key, val) => {\n idCache[key] = val;\n};\n\nexport const get = (k) => idCache[k];\nexport const keys = () => Object.keys(idCache);\nexport const size = () => keys().length;\n\nexport default {\n get,\n set,\n keys,\n size,\n};\n","import { line, curveBasis } from 'd3';\nimport idCache from './id-cache.js';\nimport stateDb from './stateDb';\nimport utils from '../../utils';\nimport common from '../common/common';\nimport { getConfig } from '../../config';\nimport { log } from '../../logger';\n\n/**\n * Draws a start state as a black circle\n *\n * @param {any} g\n */\nexport const drawStartState = (g) =>\n g\n .append('circle')\n // .style('stroke', 'black')\n // .style('fill', 'black')\n .attr('class', 'start-state')\n .attr('r', getConfig().state.sizeUnit)\n .attr('cx', getConfig().state.padding + getConfig().state.sizeUnit)\n .attr('cy', getConfig().state.padding + getConfig().state.sizeUnit);\n\n/**\n * Draws a start state as a black circle\n *\n * @param {any} g\n */\nexport const drawDivider = (g) =>\n g\n .append('line')\n .style('stroke', 'grey')\n .style('stroke-dasharray', '3')\n .attr('x1', getConfig().state.textHeight)\n .attr('class', 'divider')\n .attr('x2', getConfig().state.textHeight * 2)\n .attr('y1', 0)\n .attr('y2', 0);\n\n/**\n * Draws a an end state as a black circle\n *\n * @param {any} g\n * @param {any} stateDef\n */\nexport const drawSimpleState = (g, stateDef) => {\n const state = g\n .append('text')\n .attr('x', 2 * getConfig().state.padding)\n .attr('y', getConfig().state.textHeight + 2 * getConfig().state.padding)\n .attr('font-size', getConfig().state.fontSize)\n .attr('class', 'state-title')\n .text(stateDef.id);\n\n const classBox = state.node().getBBox();\n g.insert('rect', ':first-child')\n .attr('x', getConfig().state.padding)\n .attr('y', getConfig().state.padding)\n .attr('width', classBox.width + 2 * getConfig().state.padding)\n .attr('height', classBox.height + 2 * getConfig().state.padding)\n .attr('rx', getConfig().state.radius);\n\n return state;\n};\n\n/**\n * Draws a state with descriptions\n *\n * @param {any} g\n * @param {any} stateDef\n * @returns\n */\nexport const drawDescrState = (g, stateDef) => {\n const addTspan = function (textEl, txt, isFirst) {\n const tSpan = textEl\n .append('tspan')\n .attr('x', 2 * getConfig().state.padding)\n .text(txt);\n if (!isFirst) {\n tSpan.attr('dy', getConfig().state.textHeight);\n }\n };\n const title = g\n .append('text')\n .attr('x', 2 * getConfig().state.padding)\n .attr('y', getConfig().state.textHeight + 1.3 * getConfig().state.padding)\n .attr('font-size', getConfig().state.fontSize)\n .attr('class', 'state-title')\n .text(stateDef.descriptions[0]);\n\n const titleBox = title.node().getBBox();\n const titleHeight = titleBox.height;\n\n const description = g\n .append('text') // text label for the x axis\n .attr('x', getConfig().state.padding)\n .attr(\n 'y',\n titleHeight +\n getConfig().state.padding * 0.4 +\n getConfig().state.dividerMargin +\n getConfig().state.textHeight\n )\n .attr('class', 'state-description');\n\n let isFirst = true;\n let isSecond = true;\n stateDef.descriptions.forEach(function (descr) {\n if (!isFirst) {\n addTspan(description, descr, isSecond);\n isSecond = false;\n }\n isFirst = false;\n });\n\n const descrLine = g\n .append('line') // text label for the x axis\n .attr('x1', getConfig().state.padding)\n .attr('y1', getConfig().state.padding + titleHeight + getConfig().state.dividerMargin / 2)\n .attr('y2', getConfig().state.padding + titleHeight + getConfig().state.dividerMargin / 2)\n .attr('class', 'descr-divider');\n const descrBox = description.node().getBBox();\n const width = Math.max(descrBox.width, titleBox.width);\n\n descrLine.attr('x2', width + 3 * getConfig().state.padding);\n // const classBox = title.node().getBBox();\n\n g.insert('rect', ':first-child')\n .attr('x', getConfig().state.padding)\n .attr('y', getConfig().state.padding)\n .attr('width', width + 2 * getConfig().state.padding)\n .attr('height', descrBox.height + titleHeight + 2 * getConfig().state.padding)\n .attr('rx', getConfig().state.radius);\n\n return g;\n};\n\n/** Adds the creates a box around the existing content and adds a panel for the id on top of the content. */\n/**\n * Function that creates an title row and a frame around a substate for a composit state diagram.\n * The function returns a new d3 svg object with updated width and height properties;\n *\n * @param {any} g The d3 svg object for the substate to framed\n * @param {any} stateDef The info about the\n * @param {any} altBkg\n */\nexport const addTitleAndBox = (g, stateDef, altBkg) => {\n const pad = getConfig().state.padding;\n const dblPad = 2 * getConfig().state.padding;\n const orgBox = g.node().getBBox();\n const orgWidth = orgBox.width;\n const orgX = orgBox.x;\n\n const title = g\n .append('text')\n .attr('x', 0)\n .attr('y', getConfig().state.titleShift)\n .attr('font-size', getConfig().state.fontSize)\n .attr('class', 'state-title')\n .text(stateDef.id);\n\n const titleBox = title.node().getBBox();\n const titleWidth = titleBox.width + dblPad;\n let width = Math.max(titleWidth, orgWidth); // + dblPad;\n if (width === orgWidth) {\n width = width + dblPad;\n }\n let startX;\n // const lineY = 1 - getConfig().state.textHeight;\n // const descrLine = g\n // .append('line') // text label for the x axis\n // .attr('x1', 0)\n // .attr('y1', lineY)\n // .attr('y2', lineY)\n // .attr('class', 'descr-divider');\n\n const graphBox = g.node().getBBox();\n // descrLine.attr('x2', graphBox.width + getConfig().state.padding);\n\n if (stateDef.doc) {\n // cnsole.warn(\n // stateDef.id,\n // 'orgX: ',\n // orgX,\n // 'width: ',\n // width,\n // 'titleWidth: ',\n // titleWidth,\n // 'orgWidth: ',\n // orgWidth,\n // 'width',\n // width\n // );\n }\n\n startX = orgX - pad;\n if (titleWidth > orgWidth) {\n startX = (orgWidth - width) / 2 + pad;\n }\n if (Math.abs(orgX - graphBox.x) < pad) {\n if (titleWidth > orgWidth) {\n startX = orgX - (titleWidth - orgWidth) / 2;\n }\n }\n\n const lineY = 1 - getConfig().state.textHeight;\n // White color\n g.insert('rect', ':first-child')\n .attr('x', startX)\n .attr('y', lineY)\n .attr('class', altBkg ? 'alt-composit' : 'composit')\n .attr('width', width)\n .attr(\n 'height',\n graphBox.height + getConfig().state.textHeight + getConfig().state.titleShift + 1\n )\n .attr('rx', '0');\n\n title.attr('x', startX + pad);\n if (titleWidth <= orgWidth) title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad);\n\n // Title background\n g.insert('rect', ':first-child')\n .attr('x', startX)\n .attr(\n 'y',\n getConfig().state.titleShift - getConfig().state.textHeight - getConfig().state.padding\n )\n .attr('width', width)\n // Just needs to be higher then the descr line, will be clipped by the white color box\n .attr('height', getConfig().state.textHeight * 3)\n .attr('rx', getConfig().state.radius);\n\n // Full background\n g.insert('rect', ':first-child')\n .attr('x', startX)\n .attr(\n 'y',\n getConfig().state.titleShift - getConfig().state.textHeight - getConfig().state.padding\n )\n .attr('width', width)\n .attr('height', graphBox.height + 3 + 2 * getConfig().state.textHeight)\n .attr('rx', getConfig().state.radius);\n\n return g;\n};\n\nconst drawEndState = (g) => {\n g.append('circle')\n // .style('stroke', 'black')\n // .style('fill', 'white')\n .attr('class', 'end-state-outer')\n .attr('r', getConfig().state.sizeUnit + getConfig().state.miniPadding)\n .attr(\n 'cx',\n getConfig().state.padding + getConfig().state.sizeUnit + getConfig().state.miniPadding\n )\n .attr(\n 'cy',\n getConfig().state.padding + getConfig().state.sizeUnit + getConfig().state.miniPadding\n );\n\n return (\n g\n .append('circle')\n // .style('stroke', 'black')\n // .style('fill', 'black')\n .attr('class', 'end-state-inner')\n .attr('r', getConfig().state.sizeUnit)\n .attr('cx', getConfig().state.padding + getConfig().state.sizeUnit + 2)\n .attr('cy', getConfig().state.padding + getConfig().state.sizeUnit + 2)\n );\n};\nconst drawForkJoinState = (g, stateDef) => {\n let width = getConfig().state.forkWidth;\n let height = getConfig().state.forkHeight;\n\n if (stateDef.parentId) {\n let tmp = width;\n width = height;\n height = tmp;\n }\n return g\n .append('rect')\n .style('stroke', 'black')\n .style('fill', 'black')\n .attr('width', width)\n .attr('height', height)\n .attr('x', getConfig().state.padding)\n .attr('y', getConfig().state.padding);\n};\n\nexport const drawText = function (elem, textData) {\n // Remove and ignore br:s\n const nText = textData.text.replace(common.lineBreakRegex, ' ');\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.style('text-anchor', textData.anchor);\n textElem.attr('fill', textData.fill);\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n\n const span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.attr('fill', textData.fill);\n span.text(nText);\n\n return textElem;\n};\n\nconst _drawLongText = (_text, x, y, g) => {\n let textHeight = 0;\n\n const textElem = g.append('text');\n textElem.style('text-anchor', 'start');\n textElem.attr('class', 'noteText');\n\n let text = _text.replace(/\\r\\n/g, '<br/>');\n text = text.replace(/\\n/g, '<br/>');\n const lines = text.split(common.lineBreakRegex);\n\n let tHeight = 1.25 * getConfig().state.noteMargin;\n for (const line of lines) {\n const txt = line.trim();\n\n if (txt.length > 0) {\n const span = textElem.append('tspan');\n span.text(txt);\n if (tHeight === 0) {\n const textBounds = span.node().getBBox();\n tHeight += textBounds.height;\n }\n textHeight += tHeight;\n span.attr('x', x + getConfig().state.noteMargin);\n span.attr('y', y + textHeight + 1.25 * getConfig().state.noteMargin);\n }\n }\n return { textWidth: textElem.node().getBBox().width, textHeight };\n};\n\n/**\n * Draws a note to the diagram\n *\n * @param text - The text of the given note.\n * @param g - The element the note is attached to.\n */\n\nexport const drawNote = (text, g) => {\n g.attr('class', 'state-note');\n const note = g.append('rect').attr('x', 0).attr('y', getConfig().state.padding);\n const rectElem = g.append('g');\n\n const { textWidth, textHeight } = _drawLongText(text, 0, 0, rectElem);\n note.attr('height', textHeight + 2 * getConfig().state.noteMargin);\n note.attr('width', textWidth + getConfig().state.noteMargin * 2);\n\n return note;\n};\n\n/**\n * Starting point for drawing a state. The function finds out the specifics about the state and\n * renders with approprtiate function.\n *\n * @param {any} elem\n * @param {any} stateDef\n */\n\nexport const drawState = function (elem, stateDef) {\n const id = stateDef.id;\n const stateInfo = {\n id: id,\n label: stateDef.id,\n width: 0,\n height: 0,\n };\n\n const g = elem.append('g').attr('id', id).attr('class', 'stateGroup');\n\n if (stateDef.type === 'start') drawStartState(g);\n if (stateDef.type === 'end') drawEndState(g);\n if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g, stateDef);\n if (stateDef.type === 'note') drawNote(stateDef.note.text, g);\n if (stateDef.type === 'divider') drawDivider(g);\n if (stateDef.type === 'default' && stateDef.descriptions.length === 0)\n drawSimpleState(g, stateDef);\n if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef);\n\n const stateBox = g.node().getBBox();\n stateInfo.width = stateBox.width + 2 * getConfig().state.padding;\n stateInfo.height = stateBox.height + 2 * getConfig().state.padding;\n\n idCache.set(id, stateInfo);\n // stateCnt++;\n return stateInfo;\n};\n\nlet edgeCount = 0;\nexport const drawEdge = function (elem, path, relation) {\n const getRelationType = function (type) {\n switch (type) {\n case stateDb.relationType.AGGREGATION:\n return 'aggregation';\n case stateDb.relationType.EXTENSION:\n return 'extension';\n case stateDb.relationType.COMPOSITION:\n return 'composition';\n case stateDb.relationType.DEPENDENCY:\n return 'dependency';\n }\n };\n\n path.points = path.points.filter((p) => !Number.isNaN(p.y));\n\n // The data for our line\n const lineData = path.points;\n\n // This is the accessor function we talked about above\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curveBasis);\n\n const svgPath = elem\n .append('path')\n .attr('d', lineFunction(lineData))\n .attr('id', 'edge' + edgeCount)\n .attr('class', 'transition');\n let url = '';\n if (getConfig().state.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n svgPath.attr(\n 'marker-end',\n 'url(' + url + '#' + getRelationType(stateDb.relationType.DEPENDENCY) + 'End' + ')'\n );\n\n if (typeof relation.title !== 'undefined') {\n const label = elem.append('g').attr('class', 'stateLabel');\n\n const { x, y } = utils.calcLabelPosition(path.points);\n\n const rows = common.getRows(relation.title);\n\n let titleHeight = 0;\n const titleRows = [];\n let maxWidth = 0;\n let minX = 0;\n\n for (let i = 0; i <= rows.length; i++) {\n const title = label\n .append('text')\n .attr('text-anchor', 'middle')\n .text(rows[i])\n .attr('x', x)\n .attr('y', y + titleHeight);\n\n const boundstmp = title.node().getBBox();\n maxWidth = Math.max(maxWidth, boundstmp.width);\n minX = Math.min(minX, boundstmp.x);\n\n log.info(boundstmp.x, x, y + titleHeight);\n\n if (titleHeight === 0) {\n const titleBox = title.node().getBBox();\n titleHeight = titleBox.height;\n log.info('Title height', titleHeight, y);\n }\n titleRows.push(title);\n }\n\n let boxHeight = titleHeight * rows.length;\n if (rows.length > 1) {\n const heightAdj = (rows.length - 1) * titleHeight * 0.5;\n\n titleRows.forEach((title, i) => title.attr('y', y + i * titleHeight - heightAdj));\n boxHeight = titleHeight * rows.length;\n }\n\n const bounds = label.node().getBBox();\n\n label\n .insert('rect', ':first-child')\n .attr('class', 'box')\n .attr('x', x - maxWidth / 2 - getConfig().state.padding / 2)\n .attr('y', y - boxHeight / 2 - getConfig().state.padding / 2 - 3.5)\n .attr('width', maxWidth + getConfig().state.padding)\n .attr('height', boxHeight + getConfig().state.padding);\n\n log.info(bounds);\n\n //label.attr('transform', '0 -' + (bounds.y / 2));\n\n // Debug points\n // path.points.forEach(point => {\n // g.append('circle')\n // .style('stroke', 'red')\n // .style('fill', 'red')\n // .attr('r', 1)\n // .attr('cx', point.x)\n // .attr('cy', point.y);\n // });\n // g.append('circle')\n // .style('stroke', 'blue')\n // .style('fill', 'blue')\n // .attr('r', 1)\n // .attr('cx', x)\n // .attr('cy', y);\n }\n\n edgeCount++;\n};\n","import { log } from '../../logger';\nimport { generateId } from '../../utils';\nimport mermaidAPI from '../../mermaidAPI';\nimport common from '../common/common';\nimport * as configApi from '../../config';\n\nconst clone = (o) => JSON.parse(JSON.stringify(o));\nlet rootDoc = [];\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nconst setRootDoc = (o) => {\n log.info('Setting root doc', o);\n // rootDoc = { id: 'root', doc: o };\n rootDoc = o;\n};\n\nconst getRootDoc = () => rootDoc;\n\nconst docTranslator = (parent, node, first) => {\n if (node.stmt === 'relation') {\n docTranslator(parent, node.state1, true);\n docTranslator(parent, node.state2, false);\n } else {\n if (node.stmt === 'state') {\n if (node.id === '[*]') {\n node.id = first ? parent.id + '_start' : parent.id + '_end';\n node.start = first;\n }\n }\n\n if (node.doc) {\n const doc = [];\n // Check for concurrency\n let i = 0;\n let currentDoc = [];\n for (i = 0; i < node.doc.length; i++) {\n if (node.doc[i].type === 'divider') {\n // debugger;\n const newNode = clone(node.doc[i]);\n newNode.doc = clone(currentDoc);\n doc.push(newNode);\n currentDoc = [];\n } else {\n currentDoc.push(node.doc[i]);\n }\n }\n\n // If any divider was encountered\n if (doc.length > 0 && currentDoc.length > 0) {\n const newNode = {\n stmt: 'state',\n id: generateId(),\n type: 'divider',\n doc: clone(currentDoc),\n };\n doc.push(clone(newNode));\n node.doc = doc;\n }\n\n node.doc.forEach((docNode) => docTranslator(node, docNode, true));\n }\n }\n};\nconst getRootDocV2 = () => {\n docTranslator({ id: 'root' }, { id: 'root', doc: rootDoc }, true);\n return { id: 'root', doc: rootDoc };\n // Here\n};\n\nconst extract = (_doc) => {\n // const res = { states: [], relations: [] };\n let doc;\n if (_doc.doc) {\n doc = _doc.doc;\n } else {\n doc = _doc;\n }\n // let doc = root.doc;\n // if (!doc) {\n // doc = root;\n // }\n log.info(doc);\n clear();\n\n log.info('Extract', doc);\n\n doc.forEach((item) => {\n if (item.stmt === 'state') {\n addState(item.id, item.type, item.doc, item.description, item.note);\n }\n if (item.stmt === 'relation') {\n addRelation(item.state1.id, item.state2.id, item.description);\n }\n });\n};\n\nconst newDoc = () => {\n return {\n relations: [],\n states: {},\n documents: {},\n };\n};\n\nlet documents = {\n root: newDoc(),\n};\n\nlet currentDocument = documents.root;\n\nlet startCnt = 0;\nlet endCnt = 0; // eslint-disable-line\n// let stateCnt = 0;\n\n/**\n * Function called by parser when a node definition has been found.\n *\n * @param {any} id\n * @param {any} type\n * @param {any} doc\n * @param {any} descr\n * @param {any} note\n */\nexport const addState = function (id, type, doc, descr, note) {\n if (typeof currentDocument.states[id] === 'undefined') {\n currentDocument.states[id] = {\n id: id,\n descriptions: [],\n type,\n doc,\n note,\n };\n } else {\n if (!currentDocument.states[id].doc) {\n currentDocument.states[id].doc = doc;\n }\n if (!currentDocument.states[id].type) {\n currentDocument.states[id].type = type;\n }\n }\n if (descr) {\n log.info('Adding state ', id, descr);\n if (typeof descr === 'string') addDescription(id, descr.trim());\n\n if (typeof descr === 'object') {\n descr.forEach((des) => addDescription(id, des.trim()));\n }\n }\n\n if (note) {\n currentDocument.states[id].note = note;\n currentDocument.states[id].note.text = common.sanitizeText(\n currentDocument.states[id].note.text,\n configApi.getConfig()\n );\n }\n};\n\nexport const clear = function () {\n documents = {\n root: newDoc(),\n };\n currentDocument = documents.root;\n\n currentDocument = documents.root;\n\n startCnt = 0;\n endCnt = 0; // eslint-disable-line\n classes = [];\n};\n\nexport const getState = function (id) {\n return currentDocument.states[id];\n};\n\nexport const getStates = function () {\n return currentDocument.states;\n};\nexport const logDocuments = function () {\n log.info('Documents = ', documents);\n};\nexport const getRelations = function () {\n return currentDocument.relations;\n};\n\nexport const addRelation = function (_id1, _id2, title) {\n let id1 = _id1;\n let id2 = _id2;\n let type1 = 'default';\n let type2 = 'default';\n if (_id1 === '[*]') {\n startCnt++;\n id1 = 'start' + startCnt;\n type1 = 'start';\n }\n if (_id2 === '[*]') {\n endCnt++;\n id2 = 'end' + startCnt;\n type2 = 'end';\n }\n addState(id1, type1);\n addState(id2, type2);\n currentDocument.relations.push({\n id1,\n id2,\n title: common.sanitizeText(title, configApi.getConfig()),\n });\n};\n\nconst addDescription = function (id, _descr) {\n const theState = currentDocument.states[id];\n let descr = _descr;\n if (descr[0] === ':') {\n descr = descr.substr(1).trim();\n }\n theState.descriptions.push(common.sanitizeText(descr, configApi.getConfig()));\n};\n\nexport const cleanupLabel = function (label) {\n if (label.substring(0, 1) === ':') {\n return label.substr(2).trim();\n } else {\n return label.trim();\n }\n};\n\nexport const lineType = {\n LINE: 0,\n DOTTED_LINE: 1,\n};\n\nlet dividerCnt = 0;\nconst getDividerId = () => {\n dividerCnt++;\n return 'divider-id-' + dividerCnt;\n};\n\nlet classes = [];\n\nconst getClasses = () => classes;\n\nlet direction = 'TB';\nconst getDirection = () => direction;\nconst setDirection = (dir) => {\n direction = dir;\n};\n\nexport const relationType = {\n AGGREGATION: 0,\n EXTENSION: 1,\n COMPOSITION: 2,\n DEPENDENCY: 3,\n};\n\nconst trimColon = (str) => (str && str[0] === ':' ? str.substr(1).trim() : str.trim());\n\nexport default {\n parseDirective,\n getConfig: () => configApi.getConfig().state,\n addState,\n clear,\n getState,\n getStates,\n getRelations,\n getClasses,\n getDirection,\n addRelation,\n getDividerId,\n setDirection,\n // addDescription,\n cleanupLabel,\n lineType,\n relationType,\n logDocuments,\n getRootDoc,\n setRootDoc,\n getRootDocV2,\n extract,\n trimColon,\n};\n","import graphlib from 'graphlib';\nimport { select } from 'd3';\nimport stateDb from './stateDb';\nimport state from './parser/stateDiagram';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\nimport { log } from '../../logger';\nimport { configureSvgSize } from '../../utils';\nimport common from '../common/common';\n\nconst conf = {};\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n for (let i = 0; i < keys.length; i++) {\n conf[keys[i]] = cnf[keys[i]];\n }\n};\n\nlet nodeDb = {};\n\n/**\n * Returns the all the styles from classDef statements in the graph definition.\n *\n * @param {any} text\n * @returns {object} ClassDef styles\n */\nexport const getClasses = function (text) {\n log.trace('Extracting classes');\n stateDb.clear();\n const parser = state.parser;\n parser.yy = stateDb;\n\n // Parse the graph definition\n parser.parse(text);\n return stateDb.getClasses();\n};\n\nconst setupNode = (g, parent, node, altFlag) => {\n // Add the node\n if (node.id !== 'root') {\n let shape = 'rect';\n if (node.start === true) {\n shape = 'start';\n }\n if (node.start === false) {\n shape = 'end';\n }\n if (node.type !== 'default') {\n shape = node.type;\n }\n\n if (!nodeDb[node.id]) {\n nodeDb[node.id] = {\n id: node.id,\n shape,\n description: common.sanitizeText(node.id, getConfig()),\n classes: 'statediagram-state',\n };\n }\n\n // Build of the array of description strings accordinging\n if (node.description) {\n if (Array.isArray(nodeDb[node.id].description)) {\n // There already is an array of strings,add to it\n nodeDb[node.id].shape = 'rectWithTitle';\n nodeDb[node.id].description.push(node.description);\n } else {\n if (nodeDb[node.id].description.length > 0) {\n // if there is a description already transformit to an array\n nodeDb[node.id].shape = 'rectWithTitle';\n if (nodeDb[node.id].description === node.id) {\n // If the previous description was the is, remove it\n nodeDb[node.id].description = [node.description];\n } else {\n nodeDb[node.id].description = [nodeDb[node.id].description, node.description];\n }\n } else {\n nodeDb[node.id].shape = 'rect';\n nodeDb[node.id].description = node.description;\n }\n }\n nodeDb[node.id].description = common.sanitizeTextOrArray(\n nodeDb[node.id].description,\n getConfig()\n );\n }\n\n //\n if (nodeDb[node.id].description.length === 1 && nodeDb[node.id].shape === 'rectWithTitle') {\n nodeDb[node.id].shape = 'rect';\n }\n\n // Save data for description and group so that for instance a statement without description overwrites\n // one with description\n\n // group\n if (!nodeDb[node.id].type && node.doc) {\n log.info('Setting cluster for ', node.id, getDir(node));\n nodeDb[node.id].type = 'group';\n nodeDb[node.id].dir = getDir(node);\n nodeDb[node.id].shape = node.type === 'divider' ? 'divider' : 'roundedWithTitle';\n nodeDb[node.id].classes =\n nodeDb[node.id].classes +\n ' ' +\n (altFlag ? 'statediagram-cluster statediagram-cluster-alt' : 'statediagram-cluster');\n }\n\n const nodeData = {\n labelStyle: '',\n shape: nodeDb[node.id].shape,\n labelText: nodeDb[node.id].description,\n // typeof nodeDb[node.id].description === 'object'\n // ? nodeDb[node.id].description[0]\n // : nodeDb[node.id].description,\n classes: nodeDb[node.id].classes, //classStr,\n style: '', //styles.style,\n id: node.id,\n dir: nodeDb[node.id].dir,\n domId: 'state-' + node.id + '-' + cnt,\n type: nodeDb[node.id].type,\n padding: 15, //getConfig().flowchart.padding\n };\n\n if (node.note) {\n // Todo: set random id\n const noteData = {\n labelStyle: '',\n shape: 'note',\n labelText: node.note.text,\n classes: 'statediagram-note', //classStr,\n style: '', //styles.style,\n id: node.id + '----note-' + cnt,\n domId: 'state-' + node.id + '----note-' + cnt,\n type: nodeDb[node.id].type,\n padding: 15, //getConfig().flowchart.padding\n };\n const groupData = {\n labelStyle: '',\n shape: 'noteGroup',\n labelText: node.note.text,\n classes: nodeDb[node.id].classes, //classStr,\n style: '', //styles.style,\n id: node.id + '----parent',\n domId: 'state-' + node.id + '----parent-' + cnt,\n type: 'group',\n padding: 0, //getConfig().flowchart.padding\n };\n cnt++;\n\n g.setNode(node.id + '----parent', groupData);\n\n g.setNode(noteData.id, noteData);\n g.setNode(node.id, nodeData);\n\n g.setParent(node.id, node.id + '----parent');\n g.setParent(noteData.id, node.id + '----parent');\n\n let from = node.id;\n let to = noteData.id;\n\n if (node.note.position === 'left of') {\n from = noteData.id;\n to = node.id;\n }\n g.setEdge(from, to, {\n arrowhead: 'none',\n arrowType: '',\n style: 'fill:none',\n labelStyle: '',\n classes: 'transition note-edge',\n arrowheadStyle: 'fill: #333',\n labelpos: 'c',\n labelType: 'text',\n thickness: 'normal',\n });\n } else {\n g.setNode(node.id, nodeData);\n }\n }\n\n if (parent) {\n if (parent.id !== 'root') {\n log.trace('Setting node ', node.id, ' to be child of its parent ', parent.id);\n g.setParent(node.id, parent.id);\n }\n }\n if (node.doc) {\n log.trace('Adding nodes children ');\n setupDoc(g, node, node.doc, !altFlag);\n }\n};\nlet cnt = 0;\nconst setupDoc = (g, parent, doc, altFlag) => {\n // cnt = 0;\n log.trace('items', doc);\n doc.forEach((item) => {\n if (item.stmt === 'state' || item.stmt === 'default') {\n setupNode(g, parent, item, altFlag);\n } else if (item.stmt === 'relation') {\n setupNode(g, parent, item.state1, altFlag);\n setupNode(g, parent, item.state2, altFlag);\n const edgeData = {\n id: 'edge' + cnt,\n arrowhead: 'normal',\n arrowTypeEnd: 'arrow_barb',\n style: 'fill:none',\n labelStyle: '',\n label: common.sanitizeText(item.description, getConfig()),\n arrowheadStyle: 'fill: #333',\n labelpos: 'c',\n labelType: 'text',\n thickness: 'normal',\n classes: 'transition',\n };\n let startId = item.state1.id;\n let endId = item.state2.id;\n\n g.setEdge(startId, endId, edgeData, cnt);\n cnt++;\n }\n });\n};\nconst getDir = (nodes, defaultDir) => {\n let dir = defaultDir || 'TB';\n if (nodes.doc) {\n for (let i = 0; i < nodes.doc.length; i++) {\n const node = nodes.doc[i];\n if (node.stmt === 'dir') {\n dir = node.value;\n }\n }\n }\n return dir;\n};\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {any} text\n * @param {any} id\n */\nexport const draw = function (text, id) {\n log.info('Drawing state diagram (v2)', id);\n stateDb.clear();\n nodeDb = {};\n const parser = state.parser;\n parser.yy = stateDb;\n\n // Parse the graph definition\n parser.parse(text);\n\n // Fetch the default direction, use TD if none was found\n let dir = stateDb.getDirection();\n if (typeof dir === 'undefined') {\n dir = 'LR';\n }\n\n const conf = getConfig().state;\n const nodeSpacing = conf.nodeSpacing || 50;\n const rankSpacing = conf.rankSpacing || 50;\n\n log.info(stateDb.getRootDocV2());\n stateDb.extract(stateDb.getRootDocV2());\n log.info(stateDb.getRootDocV2());\n\n // Create the input mermaid.graph\n const g = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: getDir(stateDb.getRootDocV2()),\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n setupNode(g, undefined, stateDb.getRootDocV2(), true);\n\n // Set up an SVG group so that we can translate the final graph.\n const svg = select(`[id=\"${id}\"]`);\n\n // Run the renderer. This is what draws the final graph.\n const element = select('#' + id + ' g');\n render(element, g, ['barb'], 'statediagram', id);\n\n const padding = 8;\n\n const bounds = svg.node().getBBox();\n\n const width = bounds.width + padding * 2;\n const height = bounds.height + padding * 2;\n\n // Zoom in a bit\n svg.attr('class', 'statediagram');\n\n const svgBounds = svg.node().getBBox();\n\n configureSvgSize(svg, height, width * 1.75, conf.useMaxWidth);\n\n // Ensure the viewBox includes the whole svgBounds area with extra space for padding\n const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;\n log.debug(`viewBox ${vBox}`);\n svg.attr('viewBox', vBox);\n\n // Add label rects for non html labels\n // if (!evaluate(conf.htmlLabels) || true) {\n const labels = document.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n for (let k = 0; k < labels.length; k++) {\n const label = labels[k];\n\n // Get dimensions of label\n const dim = label.getBBox();\n\n const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n\n label.insertBefore(rect, label.firstChild);\n // }\n }\n};\n\nexport default {\n setConf,\n getClasses,\n draw,\n};\n","import { select } from 'd3';\nimport dagre from 'dagre';\nimport graphlib from 'graphlib';\nimport { log } from '../../logger';\nimport stateDb from './stateDb';\nimport common from '../common/common';\nimport { parser } from './parser/stateDiagram';\n// import idCache from './id-cache';\nimport { drawState, addTitleAndBox, drawEdge } from './shapes';\nimport { getConfig } from '../../config';\nimport { configureSvgSize } from '../../utils';\n\nparser.yy = stateDb;\n\n// TODO Move conf object to main conf in mermaidAPI\nlet conf;\n\nconst transformationLog = {};\n\nexport const setConf = function () {};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {any} elem\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {any} text\n * @param {any} id\n */\nexport const draw = function (text, id) {\n conf = getConfig().state;\n parser.yy.clear();\n parser.parse(text);\n log.debug('Rendering diagram ' + text);\n\n // Fetch the default direction, use TD if none was found\n const diagram = select(`[id='${id}']`);\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const graph = new graphlib.Graph({\n multigraph: true,\n compound: true,\n // acyclicer: 'greedy',\n rankdir: 'RL',\n // ranksep: '20'\n });\n\n // Default to assigning a new object as a label for each new edge.\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const rootDoc = stateDb.getRootDoc();\n renderDoc(rootDoc, diagram, undefined, false);\n\n const padding = conf.padding;\n const bounds = diagram.node().getBBox();\n\n const width = bounds.width + padding * 2;\n const height = bounds.height + padding * 2;\n\n // zoom in a bit\n const svgWidth = width * 1.75;\n configureSvgSize(diagram, height, svgWidth, conf.useMaxWidth);\n\n diagram.attr(\n 'viewBox',\n `${bounds.x - conf.padding} ${bounds.y - conf.padding} ` + width + ' ' + height\n );\n};\nconst getLabelWidth = (text) => {\n return text ? text.length * conf.fontSizeFactor : 1;\n};\n\nconst renderDoc = (doc, diagram, parentId, altBkg) => {\n // Layout graph, Create a new directed graph\n const graph = new graphlib.Graph({\n compound: true,\n multigraph: true,\n });\n\n let i;\n let edgeFreeDoc = true;\n for (i = 0; i < doc.length; i++) {\n if (doc[i].stmt === 'relation') {\n edgeFreeDoc = false;\n break;\n }\n }\n\n // Set an object for the graph label\n if (parentId)\n graph.setGraph({\n rankdir: 'LR',\n multigraph: true,\n compound: true,\n // acyclicer: 'greedy',\n ranker: 'tight-tree',\n ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,\n nodeSep: edgeFreeDoc ? 1 : 50,\n isMultiGraph: true,\n // ranksep: 5,\n // nodesep: 1\n });\n else {\n graph.setGraph({\n rankdir: 'TB',\n multigraph: true,\n compound: true,\n // isCompound: true,\n // acyclicer: 'greedy',\n // ranker: 'longest-path'\n ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,\n nodeSep: edgeFreeDoc ? 1 : 50,\n ranker: 'tight-tree',\n // ranker: 'network-simplex'\n isMultiGraph: true,\n });\n }\n\n // Default to assigning a new object as a label for each new edge.\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n\n stateDb.extract(doc);\n const states = stateDb.getStates();\n const relations = stateDb.getRelations();\n\n const keys = Object.keys(states);\n\n let first = true;\n\n for (let i = 0; i < keys.length; i++) {\n const stateDef = states[keys[i]];\n\n if (parentId) {\n stateDef.parentId = parentId;\n }\n\n let node;\n if (stateDef.doc) {\n let sub = diagram.append('g').attr('id', stateDef.id).attr('class', 'stateGroup');\n node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg);\n\n if (first) {\n // first = false;\n sub = addTitleAndBox(sub, stateDef, altBkg);\n let boxBounds = sub.node().getBBox();\n node.width = boxBounds.width;\n node.height = boxBounds.height + conf.padding / 2;\n transformationLog[stateDef.id] = { y: conf.compositTitleSize };\n } else {\n // sub = addIdAndBox(sub, stateDef);\n let boxBounds = sub.node().getBBox();\n node.width = boxBounds.width;\n node.height = boxBounds.height;\n // transformationLog[stateDef.id] = { y: conf.compositTitleSize };\n }\n } else {\n node = drawState(diagram, stateDef, graph);\n }\n\n if (stateDef.note) {\n // Draw note note\n const noteDef = {\n descriptions: [],\n id: stateDef.id + '-note',\n note: stateDef.note,\n type: 'note',\n };\n const note = drawState(diagram, noteDef, graph);\n\n // graph.setNode(node.id, node);\n if (stateDef.note.position === 'left of') {\n graph.setNode(node.id + '-note', note);\n graph.setNode(node.id, node);\n } else {\n graph.setNode(node.id, node);\n graph.setNode(node.id + '-note', note);\n }\n // graph.setNode(node.id);\n graph.setParent(node.id, node.id + '-group');\n graph.setParent(node.id + '-note', node.id + '-group');\n } else {\n // Add nodes to the graph. The first argument is the node id. The second is\n // metadata about the node. In this case we're going to add labels to each of\n // our nodes.\n graph.setNode(node.id, node);\n }\n }\n\n log.debug('Count=', graph.nodeCount(), graph);\n let cnt = 0;\n relations.forEach(function (relation) {\n cnt++;\n log.debug('Setting edge', relation);\n graph.setEdge(\n relation.id1,\n relation.id2,\n {\n relation: relation,\n width: getLabelWidth(relation.title),\n height: conf.labelHeight * common.getRows(relation.title).length,\n labelpos: 'c',\n },\n 'id' + cnt\n );\n });\n\n dagre.layout(graph);\n\n log.debug('Graph after layout', graph.nodes());\n const svgElem = diagram.node();\n\n graph.nodes().forEach(function (v) {\n if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') {\n log.warn('Node ' + v + ': ' + JSON.stringify(graph.node(v)));\n select('#' + svgElem.id + ' #' + v).attr(\n 'transform',\n 'translate(' +\n (graph.node(v).x - graph.node(v).width / 2) +\n ',' +\n (graph.node(v).y +\n (transformationLog[v] ? transformationLog[v].y : 0) -\n graph.node(v).height / 2) +\n ' )'\n );\n select('#' + svgElem.id + ' #' + v).attr(\n 'data-x-shift',\n graph.node(v).x - graph.node(v).width / 2\n );\n const dividers = document.querySelectorAll('#' + svgElem.id + ' #' + v + ' .divider');\n dividers.forEach((divider) => {\n const parent = divider.parentElement;\n let pWidth = 0;\n let pShift = 0;\n if (parent) {\n if (parent.parentElement) pWidth = parent.parentElement.getBBox().width;\n pShift = parseInt(parent.getAttribute('data-x-shift'), 10);\n if (Number.isNaN(pShift)) {\n pShift = 0;\n }\n }\n divider.setAttribute('x1', 0 - pShift + 8);\n divider.setAttribute('x2', pWidth - pShift - 8);\n });\n } else {\n log.debug('No Node ' + v + ': ' + JSON.stringify(graph.node(v)));\n }\n });\n\n let stateBox = svgElem.getBBox();\n\n graph.edges().forEach(function (e) {\n if (typeof e !== 'undefined' && typeof graph.edge(e) !== 'undefined') {\n log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e)));\n drawEdge(diagram, graph.edge(e), graph.edge(e).relation);\n }\n });\n\n stateBox = svgElem.getBBox();\n\n const stateInfo = {\n id: parentId ? parentId : 'root',\n label: parentId ? parentId : 'root',\n width: 0,\n height: 0,\n };\n\n stateInfo.width = stateBox.width + 2 * conf.padding;\n stateInfo.height = stateBox.height + 2 * conf.padding;\n\n log.debug('Doc rendered', stateInfo, graph);\n return stateInfo;\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `\ndefs #statediagram-barbEnd {\n fill: ${options.transitionColor};\n stroke: ${options.transitionColor};\n }\ng.stateGroup text {\n fill: ${options.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${options.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${options.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${options.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${options.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${options.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${options.noteBorderColor};\n fill: ${options.noteBkgColor};\n\n text {\n fill: ${options.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${options.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${options.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ${options.transitionLabelColor || options.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${options.transitionLabelColor || options.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${options.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${options.specialStateColor};\n stroke: ${options.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${options.specialStateColor};\n stroke: ${options.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${options.innerEndBackground};\n stroke: ${options.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${options.compositeBackground || options.background};\n // stroke: ${options.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${options.stateBkg || options.mainBkg};\n stroke: ${options.stateBorder || options.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${options.mainBkg};\n stroke: ${options.stateBorder || options.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${options.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${options.compositeTitleBackground};\n stroke: ${options.stateBorder || options.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${options.stateLabelColor};\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${options.stateBorder || options.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${options.compositeBackground || options.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${options.altBackground ? options.altBackground : '#efefef'};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${options.altBackground ? options.altBackground : '#efefef'};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${options.noteBkgColor};\n stroke: ${options.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${options.noteBkgColor};\n stroke: ${options.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${options.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${options.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${options.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${options.lineColor};\n stroke: ${options.lineColor};\n stroke-width: 1;\n}\n`;\n\nexport default getStyles;\n","import mermaidAPI from '../../mermaidAPI';\nimport * as configApi from '../../config';\n\nlet title = '';\nlet currentSection = '';\n\nconst sections = [];\nconst tasks = [];\nconst rawTasks = [];\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nexport const clear = function () {\n sections.length = 0;\n tasks.length = 0;\n currentSection = '';\n title = '';\n rawTasks.length = 0;\n};\n\nexport const setTitle = function (txt) {\n title = txt;\n};\n\nexport const getTitle = function () {\n return title;\n};\n\nexport const addSection = function (txt) {\n currentSection = txt;\n sections.push(txt);\n};\n\nexport const getSections = function () {\n return sections;\n};\n\nexport const getTasks = function () {\n let allItemsProcessed = compileTasks();\n const maxDepth = 100;\n let iterationCount = 0;\n while (!allItemsProcessed && iterationCount < maxDepth) {\n allItemsProcessed = compileTasks();\n iterationCount++;\n }\n\n tasks.push(...rawTasks);\n\n return tasks;\n};\n\nconst updateActors = function () {\n const tempActors = [];\n tasks.forEach((task) => {\n if (task.people) {\n tempActors.push(...task.people);\n }\n });\n\n const unique = new Set(tempActors);\n return [...unique].sort();\n};\n\nexport const addTask = function (descr, taskData) {\n const pieces = taskData.substr(1).split(':');\n\n let score = 0;\n let peeps = [];\n if (pieces.length === 1) {\n score = Number(pieces[0]);\n peeps = [];\n } else {\n score = Number(pieces[0]);\n peeps = pieces[1].split(',');\n }\n const peopleList = peeps.map((s) => s.trim());\n\n const rawTask = {\n section: currentSection,\n type: currentSection,\n people: peopleList,\n task: descr,\n score,\n };\n\n rawTasks.push(rawTask);\n};\n\nexport const addTaskOrg = function (descr) {\n const newTask = {\n section: currentSection,\n type: currentSection,\n description: descr,\n task: descr,\n classes: [],\n };\n tasks.push(newTask);\n};\n\nconst compileTasks = function () {\n const compileTask = function (pos) {\n return rawTasks[pos].processed;\n };\n\n let allProcessed = true;\n for (let i = 0; i < rawTasks.length; i++) {\n compileTask(i);\n\n allProcessed = allProcessed && rawTasks[i].processed;\n }\n return allProcessed;\n};\n\nconst getActors = function () {\n return updateActors();\n};\n\nexport default {\n parseDirective,\n getConfig: () => configApi.getConfig().journey,\n clear,\n setTitle,\n getTitle,\n addSection,\n getSections,\n getTasks,\n addTask,\n addTaskOrg,\n getActors,\n};\n","import { select } from 'd3';\nimport { parser } from './parser/journey';\nimport journeyDb from './journeyDb';\nimport svgDraw from './svgDraw';\nimport { getConfig } from '../../config';\nimport { configureSvgSize } from '../../utils';\n\nparser.yy = journeyDb;\n\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n};\n\nconst actors = {};\n\n/** @param {any} diagram */\nfunction drawActorLegend(diagram) {\n const conf = getConfig().journey;\n // Draw the actors\n let yPos = 60;\n Object.keys(actors).forEach((person) => {\n const colour = actors[person].color;\n\n const circleData = {\n cx: 20,\n cy: yPos,\n r: 7,\n fill: colour,\n stroke: '#000',\n pos: actors[person].position,\n };\n svgDraw.drawCircle(diagram, circleData);\n\n const labelData = {\n x: 40,\n y: yPos + 7,\n fill: '#666',\n text: person,\n textMargin: conf.boxTextMargin | 5,\n };\n svgDraw.drawText(diagram, labelData);\n\n yPos += 20;\n });\n}\nconst conf = getConfig().journey;\nconst LEFT_MARGIN = getConfig().journey.leftMargin;\nexport const draw = function (text, id) {\n const conf = getConfig().journey;\n parser.yy.clear();\n parser.parse(text + '\\n');\n\n bounds.init();\n const diagram = select('#' + id);\n diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n svgDraw.initGraphics(diagram);\n\n const tasks = parser.yy.getTasks();\n const title = parser.yy.getTitle();\n\n const actorNames = parser.yy.getActors();\n for (let member in actors) delete actors[member];\n let actorPos = 0;\n actorNames.forEach((actorName) => {\n actors[actorName] = {\n color: conf.actorColours[actorPos % conf.actorColours.length],\n position: actorPos,\n };\n actorPos++;\n });\n\n drawActorLegend(diagram);\n bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);\n drawTasks(diagram, tasks, 0);\n\n const box = bounds.getBounds();\n if (title) {\n diagram\n .append('text')\n .text(title)\n .attr('x', LEFT_MARGIN)\n .attr('font-size', '4ex')\n .attr('font-weight', 'bold')\n .attr('y', 25);\n }\n const height = box.stopy - box.starty + 2 * conf.diagramMarginY;\n const width = LEFT_MARGIN + box.stopx + 2 * conf.diagramMarginX;\n\n configureSvgSize(diagram, height, width, conf.useMaxWidth);\n\n // Draw activity line\n diagram\n .append('line')\n .attr('x1', LEFT_MARGIN)\n .attr('y1', conf.height * 4) // One section head + one task + margins\n .attr('x2', width - LEFT_MARGIN - 4) // Subtract stroke width so arrow point is retained\n .attr('y2', conf.height * 4)\n .attr('stroke-width', 4)\n .attr('stroke', 'black')\n .attr('marker-end', 'url(#arrowhead)');\n\n const extraVertForTitle = title ? 70 : 0;\n diagram.attr('viewBox', `${box.startx} -25 ${width} ${height + extraVertForTitle}`);\n diagram.attr('preserveAspectRatio', 'xMinYMin meet');\n diagram.attr('height', height + extraVertForTitle + 25);\n};\n\nexport const bounds = {\n data: {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n },\n verticalPos: 0,\n\n sequenceItems: [],\n init: function () {\n this.sequenceItems = [];\n this.data = {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n };\n this.verticalPos = 0;\n },\n updateVal: function (obj, key, val, fun) {\n if (typeof obj[key] === 'undefined') {\n obj[key] = val;\n } else {\n obj[key] = fun(val, obj[key]);\n }\n },\n updateBounds: function (startx, starty, stopx, stopy) {\n const conf = getConfig().journey;\n const _self = this;\n let cnt = 0;\n /** @param {any} type */\n function updateFn(type) {\n return function updateItemBounds(item) {\n cnt++;\n // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems\n const n = _self.sequenceItems.length - cnt + 1;\n _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);\n _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);\n _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n if (!(type === 'activation')) {\n _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);\n _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);\n _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);\n }\n };\n }\n\n this.sequenceItems.forEach(updateFn());\n },\n insert: function (startx, starty, stopx, stopy) {\n const _startx = Math.min(startx, stopx);\n const _stopx = Math.max(startx, stopx);\n const _starty = Math.min(starty, stopy);\n const _stopy = Math.max(starty, stopy);\n\n this.updateVal(bounds.data, 'startx', _startx, Math.min);\n this.updateVal(bounds.data, 'starty', _starty, Math.min);\n this.updateVal(bounds.data, 'stopx', _stopx, Math.max);\n this.updateVal(bounds.data, 'stopy', _stopy, Math.max);\n\n this.updateBounds(_startx, _starty, _stopx, _stopy);\n },\n bumpVerticalPos: function (bump) {\n this.verticalPos = this.verticalPos + bump;\n this.data.stopy = this.verticalPos;\n },\n getVerticalPos: function () {\n return this.verticalPos;\n },\n getBounds: function () {\n return this.data;\n },\n};\n\nconst fills = conf.sectionFills;\nconst textColours = conf.sectionColours;\n\nexport const drawTasks = function (diagram, tasks, verticalPos) {\n const conf = getConfig().journey;\n let lastSection = '';\n const sectionVHeight = conf.height * 2 + conf.diagramMarginY;\n const taskPos = verticalPos + sectionVHeight;\n\n let sectionNumber = 0;\n let fill = '#CCC';\n let colour = 'black';\n let num = 0;\n\n // Draw the tasks\n for (let i = 0; i < tasks.length; i++) {\n let task = tasks[i];\n if (lastSection !== task.section) {\n fill = fills[sectionNumber % fills.length];\n num = sectionNumber % fills.length;\n colour = textColours[sectionNumber % textColours.length];\n\n const section = {\n x: i * conf.taskMargin + i * conf.width + LEFT_MARGIN,\n y: 50,\n text: task.section,\n fill,\n num,\n colour,\n };\n\n svgDraw.drawSection(diagram, section, conf);\n lastSection = task.section;\n sectionNumber++;\n }\n\n // Collect the actors involved in the task\n const taskActors = task.people.reduce((acc, actorName) => {\n if (actors[actorName]) {\n acc[actorName] = actors[actorName];\n }\n\n return acc;\n }, {});\n\n // Add some rendering data to the object\n task.x = i * conf.taskMargin + i * conf.width + LEFT_MARGIN;\n task.y = taskPos;\n task.width = conf.diagramMarginX;\n task.height = conf.diagramMarginY;\n task.colour = colour;\n task.fill = fill;\n task.num = num;\n task.actors = taskActors;\n\n // Draw the box with the attached line\n svgDraw.drawTask(diagram, task, conf);\n bounds.insert(task.x, task.y, task.x + task.width + conf.taskMargin, 300 + 5 * 30); // stopy is the length of the descenders.\n }\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${options.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${options.textColor}\n }\n\n .legend {\n fill: ${options.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${options.textColor}\n }\n\n .face {\n ${options.faceColor ? `fill: ${options.faceColor}` : 'fill: #FFF8DC'};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${options.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${options.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${options.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${options.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${options.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${options.tertiaryColor};\n border: 1px solid ${options.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${options.fillType0 ? `fill: ${options.fillType0}` : ''};\n }\n .task-type-1, .section-type-1 {\n ${options.fillType0 ? `fill: ${options.fillType1}` : ''};\n }\n .task-type-2, .section-type-2 {\n ${options.fillType0 ? `fill: ${options.fillType2}` : ''};\n }\n .task-type-3, .section-type-3 {\n ${options.fillType0 ? `fill: ${options.fillType3}` : ''};\n }\n .task-type-4, .section-type-4 {\n ${options.fillType0 ? `fill: ${options.fillType4}` : ''};\n }\n .task-type-5, .section-type-5 {\n ${options.fillType0 ? `fill: ${options.fillType5}` : ''};\n }\n .task-type-6, .section-type-6 {\n ${options.fillType0 ? `fill: ${options.fillType6}` : ''};\n }\n .task-type-7, .section-type-7 {\n ${options.fillType0 ? `fill: ${options.fillType7}` : ''};\n }\n\n .actor-0 {\n ${options.actor0 ? `fill: ${options.actor0}` : ''};\n }\n .actor-1 {\n ${options.actor1 ? `fill: ${options.actor1}` : ''};\n }\n .actor-2 {\n ${options.actor2 ? `fill: ${options.actor2}` : ''};\n }\n .actor-3 {\n ${options.actor3 ? `fill: ${options.actor3}` : ''};\n }\n .actor-4 {\n ${options.actor4 ? `fill: ${options.actor4}` : ''};\n }\n .actor-5 {\n ${options.actor5 ? `fill: ${options.actor5}` : ''};\n }\n\n }\n`;\n\nexport default getStyles;\n","import { arc as d3arc } from 'd3';\n\nexport const drawRect = function (elem, rectData) {\n const rectElem = elem.append('rect');\n rectElem.attr('x', rectData.x);\n rectElem.attr('y', rectData.y);\n rectElem.attr('fill', rectData.fill);\n rectElem.attr('stroke', rectData.stroke);\n rectElem.attr('width', rectData.width);\n rectElem.attr('height', rectData.height);\n rectElem.attr('rx', rectData.rx);\n rectElem.attr('ry', rectData.ry);\n\n if (typeof rectData.class !== 'undefined') {\n rectElem.attr('class', rectData.class);\n }\n\n return rectElem;\n};\n\nexport const drawFace = function (element, faceData) {\n const radius = 15;\n const circleElement = element\n .append('circle')\n .attr('cx', faceData.cx)\n .attr('cy', faceData.cy)\n .attr('class', 'face')\n .attr('r', radius)\n .attr('stroke-width', 2)\n .attr('overflow', 'visible');\n\n const face = element.append('g');\n\n //left eye\n face\n .append('circle')\n .attr('cx', faceData.cx - radius / 3)\n .attr('cy', faceData.cy - radius / 3)\n .attr('r', 1.5)\n .attr('stroke-width', 2)\n .attr('fill', '#666')\n .attr('stroke', '#666');\n\n //right eye\n face\n .append('circle')\n .attr('cx', faceData.cx + radius / 3)\n .attr('cy', faceData.cy - radius / 3)\n .attr('r', 1.5)\n .attr('stroke-width', 2)\n .attr('fill', '#666')\n .attr('stroke', '#666');\n\n /** @param {any} face */\n function smile(face) {\n const arc = d3arc()\n .startAngle(Math.PI / 2)\n .endAngle(3 * (Math.PI / 2))\n .innerRadius(radius / 2)\n .outerRadius(radius / 2.2);\n //mouth\n face\n .append('path')\n .attr('class', 'mouth')\n .attr('d', arc)\n .attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 2) + ')');\n }\n\n /** @param {any} face */\n function sad(face) {\n const arc = d3arc()\n .startAngle((3 * Math.PI) / 2)\n .endAngle(5 * (Math.PI / 2))\n .innerRadius(radius / 2)\n .outerRadius(radius / 2.2);\n //mouth\n face\n .append('path')\n .attr('class', 'mouth')\n .attr('d', arc)\n .attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 7) + ')');\n }\n\n /** @param {any} face */\n function ambivalent(face) {\n face\n .append('line')\n .attr('class', 'mouth')\n .attr('stroke', 2)\n .attr('x1', faceData.cx - 5)\n .attr('y1', faceData.cy + 7)\n .attr('x2', faceData.cx + 5)\n .attr('y2', faceData.cy + 7)\n .attr('class', 'mouth')\n .attr('stroke-width', '1px')\n .attr('stroke', '#666');\n }\n\n if (faceData.score > 3) {\n smile(face);\n } else if (faceData.score < 3) {\n sad(face);\n } else {\n ambivalent(face);\n }\n\n return circleElement;\n};\n\nexport const drawCircle = function (element, circleData) {\n const circleElement = element.append('circle');\n circleElement.attr('cx', circleData.cx);\n circleElement.attr('cy', circleData.cy);\n circleElement.attr('class', 'actor-' + circleData.pos);\n circleElement.attr('fill', circleData.fill);\n circleElement.attr('stroke', circleData.stroke);\n circleElement.attr('r', circleData.r);\n\n if (typeof circleElement.class !== 'undefined') {\n circleElement.attr('class', circleElement.class);\n }\n\n if (typeof circleData.title !== 'undefined') {\n circleElement.append('title').text(circleData.title);\n }\n\n return circleElement;\n};\n\nexport const drawText = function (elem, textData) {\n // Remove and ignore br:s\n const nText = textData.text.replace(/<br\\s*\\/?>/gi, ' ');\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.attr('class', 'legend');\n\n textElem.style('text-anchor', textData.anchor);\n\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n\n const span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.text(nText);\n\n return textElem;\n};\n\nexport const drawLabel = function (elem, txtObject) {\n /**\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} cut\n */\n function genPoints(x, y, width, height, cut) {\n return (\n x +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n (y + height - cut) +\n ' ' +\n (x + width - cut * 1.2) +\n ',' +\n (y + height) +\n ' ' +\n x +\n ',' +\n (y + height)\n );\n }\n const polygon = elem.append('polygon');\n polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));\n polygon.attr('class', 'labelBox');\n\n txtObject.y = txtObject.y + txtObject.labelMargin;\n txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;\n drawText(elem, txtObject);\n};\n\nexport const drawSection = function (elem, section, conf) {\n const g = elem.append('g');\n\n const rect = getNoteRect();\n rect.x = section.x;\n rect.y = section.y;\n rect.fill = section.fill;\n rect.width = conf.width;\n rect.height = conf.height;\n rect.class = 'journey-section section-type-' + section.num;\n rect.rx = 3;\n rect.ry = 3;\n drawRect(g, rect);\n\n _drawTextCandidateFunc(conf)(\n section.text,\n g,\n rect.x,\n rect.y,\n rect.width,\n rect.height,\n { class: 'journey-section section-type-' + section.num },\n conf,\n section.colour\n );\n};\n\nlet taskCount = -1;\n/**\n * Draws an actor in the diagram with the attaced line\n *\n * @param {any} elem The HTML element\n * @param {any} task The task to render\n * @param {any} conf The global configuration\n */\nexport const drawTask = function (elem, task, conf) {\n const center = task.x + conf.width / 2;\n const g = elem.append('g');\n taskCount++;\n const maxHeight = 300 + 5 * 30;\n g.append('line')\n .attr('id', 'task' + taskCount)\n .attr('x1', center)\n .attr('y1', task.y)\n .attr('x2', center)\n .attr('y2', maxHeight)\n .attr('class', 'task-line')\n .attr('stroke-width', '1px')\n .attr('stroke-dasharray', '4 2')\n .attr('stroke', '#666');\n\n drawFace(g, {\n cx: center,\n cy: 300 + (5 - task.score) * 30,\n score: task.score,\n });\n\n const rect = getNoteRect();\n rect.x = task.x;\n rect.y = task.y;\n rect.fill = task.fill;\n rect.width = conf.width;\n rect.height = conf.height;\n rect.class = 'task task-type-' + task.num;\n rect.rx = 3;\n rect.ry = 3;\n drawRect(g, rect);\n\n let xPos = task.x + 14;\n task.people.forEach((person) => {\n const colour = task.actors[person].color;\n\n const circle = {\n cx: xPos,\n cy: task.y,\n r: 7,\n fill: colour,\n stroke: '#000',\n title: person,\n pos: task.actors[person].position,\n };\n\n drawCircle(g, circle);\n xPos += 10;\n });\n\n _drawTextCandidateFunc(conf)(\n task.task,\n g,\n rect.x,\n rect.y,\n rect.width,\n rect.height,\n { class: 'task' },\n conf,\n task.colour\n );\n};\n\n/**\n * Draws a background rectangle\n *\n * @param {any} elem The html element\n * @param {any} bounds The bounds of the drawing\n */\nexport const drawBackgroundRect = function (elem, bounds) {\n const rectElem = drawRect(elem, {\n x: bounds.startx,\n y: bounds.starty,\n width: bounds.stopx - bounds.startx,\n height: bounds.stopy - bounds.starty,\n fill: bounds.fill,\n class: 'rect',\n });\n rectElem.lower();\n};\n\nexport const getTextObj = function () {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n 'text-anchor': 'start',\n width: 100,\n height: 100,\n textMargin: 0,\n rx: 0,\n ry: 0,\n };\n};\n\nexport const getNoteRect = function () {\n return {\n x: 0,\n y: 0,\n width: 100,\n anchor: 'start',\n height: 100,\n rx: 0,\n ry: 0,\n };\n};\n\nconst _drawTextCandidateFunc = (function () {\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} colour\n */\n function byText(content, g, x, y, width, height, textAttrs, colour) {\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y + height / 2 + 5)\n .style('font-color', colour)\n .style('text-anchor', 'middle')\n .text(content);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n * @param {any} colour\n */\n function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {\n const { taskFontSize, taskFontFamily } = conf;\n\n const lines = content.split(/<br\\s*\\/?>/gi);\n for (let i = 0; i < lines.length; i++) {\n const dy = i * taskFontSize - (taskFontSize * (lines.length - 1)) / 2;\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y)\n .attr('fill', colour)\n .style('text-anchor', 'middle')\n .style('font-size', taskFontSize)\n .style('font-family', taskFontFamily);\n text\n .append('tspan')\n .attr('x', x + width / 2)\n .attr('dy', dy)\n .text(lines[i]);\n\n text\n .attr('y', y + height / 2.0)\n .attr('dominant-baseline', 'central')\n .attr('alignment-baseline', 'central');\n\n _setTextAttrs(text, textAttrs);\n }\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byFo(content, g, x, y, width, height, textAttrs, conf) {\n const body = g.append('switch');\n const f = body\n .append('foreignObject')\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n .attr('position', 'fixed');\n\n const text = f\n .append('xhtml:div')\n .style('display', 'table')\n .style('height', '100%')\n .style('width', '100%');\n\n text\n .append('div')\n .attr('class', 'label')\n .style('display', 'table-cell')\n .style('text-align', 'center')\n .style('vertical-align', 'middle')\n .text(content);\n\n byTspan(content, body, x, y, width, height, textAttrs, conf);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} toText\n * @param {any} fromTextAttrsDict\n */\n function _setTextAttrs(toText, fromTextAttrsDict) {\n for (const key in fromTextAttrsDict) {\n if (key in fromTextAttrsDict) {\n // eslint-disable-line\n // noinspection JSUnfilteredForInLoop\n toText.attr(key, fromTextAttrsDict[key]);\n }\n }\n }\n\n return function (conf) {\n return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;\n };\n})();\n\nconst initGraphics = function (graphics) {\n graphics\n .append('defs')\n .append('marker')\n .attr('id', 'arrowhead')\n .attr('refX', 5)\n .attr('refY', 2)\n .attr('markerWidth', 6)\n .attr('markerHeight', 4)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead\n};\n\nexport default {\n drawRect,\n drawCircle,\n drawSection,\n drawText,\n drawLabel,\n drawTask,\n drawBackgroundRect,\n getTextObj,\n getNoteRect,\n initGraphics,\n};\n","/** Created by knut on 14-12-11. */\nimport { select } from 'd3';\nimport { log } from './logger';\n\nconst conf = {};\n\n/**\n * Merges the value of `conf` with the passed `cnf`\n *\n * @param {object} cnf Config to merge\n */\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n};\n\n/**\n * Draws a an info picture in the tag with id: id based on the graph definition in text.\n *\n * @param {string} id The text for the error\n * @param {string} ver The version\n */\nexport const draw = (id, ver) => {\n try {\n log.debug('Renering svg for syntax error\\n');\n\n const svg = select('#' + id);\n\n const g = svg.append('g');\n\n g.append('path')\n .attr('class', 'error-icon')\n .attr(\n 'd',\n 'm411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z'\n );\n\n g.append('path')\n .attr('class', 'error-icon')\n .attr(\n 'd',\n 'm459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z'\n );\n\n g.append('path')\n .attr('class', 'error-icon')\n .attr(\n 'd',\n 'm340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z'\n );\n\n g.append('path')\n .attr('class', 'error-icon')\n .attr(\n 'd',\n 'm400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z'\n );\n\n g.append('path')\n .attr('class', 'error-icon')\n .attr(\n 'd',\n 'm496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z'\n );\n\n g.append('path')\n .attr('class', 'error-icon')\n .attr(\n 'd',\n 'm436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z'\n );\n\n g.append('text') // text label for the x axis\n .attr('class', 'error-text')\n .attr('x', 1240)\n .attr('y', 250)\n .attr('font-size', '150px')\n .style('text-anchor', 'middle')\n .text('Syntax error in graph');\n g.append('text') // text label for the x axis\n .attr('class', 'error-text')\n .attr('x', 1050)\n .attr('y', 400)\n .attr('font-size', '100px')\n .style('text-anchor', 'middle')\n .text('mermaid version ' + ver);\n\n svg.attr('height', 100);\n svg.attr('width', 400);\n svg.attr('viewBox', '768 0 512 512');\n } catch (e) {\n log.error('Error while rendering info diagram');\n log.error(e.message);\n }\n};\n\nexport default {\n setConf,\n draw,\n};\n","let interactionFunctions = [];\nexport const addFunction = (func) => {\n interactionFunctions.push(func);\n};\nexport const attachFunctions = () => {\n interactionFunctions.forEach((f) => {\n f();\n });\n interactionFunctions = [];\n};\n","import moment from 'moment-mini';\n\n/** @typedef {'debug' | 'info' | 'warn' | 'error' | 'fatal'} LogLevel A log level */\n\n/** @type {object<LogLevel, number>} */\nexport const LEVELS = {\n debug: 1,\n info: 2,\n warn: 3,\n error: 4,\n fatal: 5,\n};\n\nexport const log = {\n debug: () => {},\n info: () => {},\n warn: () => {},\n error: () => {},\n fatal: () => {},\n};\n\n/**\n * Sets a log level\n *\n * @param {LogLevel} [level=\"fatal\"] The level to set the logging to. Default is `\"fatal\"`\n */\nexport const setLogLevel = function (level = 'fatal') {\n if (isNaN(level)) {\n level = level.toLowerCase();\n if (LEVELS[level] !== undefined) {\n level = LEVELS[level];\n }\n }\n log.trace = () => {};\n log.debug = () => {};\n log.info = () => {};\n log.warn = () => {};\n log.error = () => {};\n log.fatal = () => {};\n if (level <= LEVELS.fatal) {\n log.fatal = console.error\n ? console.error.bind(console, format('FATAL'), 'color: orange')\n : console.log.bind(console, '\\x1b[35m', format('FATAL'));\n }\n if (level <= LEVELS.error) {\n log.error = console.error\n ? console.error.bind(console, format('ERROR'), 'color: orange')\n : console.log.bind(console, '\\x1b[31m', format('ERROR'));\n }\n if (level <= LEVELS.warn) {\n log.warn = console.warn\n ? console.warn.bind(console, format('WARN'), 'color: orange')\n : console.log.bind(console, `\\x1b[33m`, format('WARN'));\n }\n if (level <= LEVELS.info) {\n log.info = console.info // ? console.info.bind(console, '\\x1b[34m', format('INFO'), 'color: blue')\n ? console.info.bind(console, format('INFO'), 'color: lightblue')\n : console.log.bind(console, '\\x1b[34m', format('INFO'));\n }\n if (level <= LEVELS.debug) {\n log.debug = console.debug\n ? console.debug.bind(console, format('DEBUG'), 'color: lightgreen')\n : console.log.bind(console, '\\x1b[32m', format('DEBUG'));\n }\n};\n\n/**\n * Returns a format with the timestamp and the log level\n *\n * @param {LogLevel} level The level for the log format\n * @returns {string} The format with the timestamp and log level\n */\nconst format = (level) => {\n const time = moment().format('ss.SSS');\n return `%c${time} : ${level} : `;\n};\n","/**\n * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid\n * functionality and to render the diagrams to svg code.\n */\nimport { log } from './logger';\nimport mermaidAPI from './mermaidAPI';\nimport utils from './utils';\n\n/**\n * ## init\n *\n * Function that goes through the document to find the chart definitions in there and render them.\n *\n * The function tags the processed attributes with the attribute data-processed and ignores found\n * elements with the attribute already set. This way the init function can be triggered several times.\n *\n * Optionally, `init` can accept in the second argument one of the following:\n *\n * - A DOM Node\n * - An array of DOM nodes (as would come from a jQuery selector)\n * - A W3C selector, a la `.mermaid`\n *\n * ```mermaid\n * graph LR;\n * a(Find elements)-->b{Processed}\n * b-->|Yes|c(Leave element)\n * b-->|No |d(Transform)\n * ```\n *\n * Renders the mermaid diagrams\n */\nconst init = function () {\n const conf = mermaidAPI.getConfig();\n // console.log('Starting rendering diagrams (init) - mermaid.init', conf);\n let nodes;\n if (arguments.length >= 2) {\n /*! sequence config was passed as #1 */\n if (typeof arguments[0] !== 'undefined') {\n mermaid.sequenceConfig = arguments[0];\n }\n\n nodes = arguments[1];\n } else {\n nodes = arguments[0];\n }\n\n // if last argument is a function this is the callback function\n let callback;\n if (typeof arguments[arguments.length - 1] === 'function') {\n callback = arguments[arguments.length - 1];\n log.debug('Callback function found');\n } else {\n if (typeof conf.mermaid !== 'undefined') {\n if (typeof conf.mermaid.callback === 'function') {\n callback = conf.mermaid.callback;\n log.debug('Callback function found');\n } else {\n log.debug('No Callback function found');\n }\n }\n }\n nodes =\n nodes === undefined\n ? document.querySelectorAll('.mermaid')\n : typeof nodes === 'string'\n ? document.querySelectorAll(nodes)\n : nodes instanceof window.Node\n ? [nodes]\n : nodes; // Last case - sequence config was passed pick next\n\n log.debug('Start On Load before: ' + mermaid.startOnLoad);\n if (typeof mermaid.startOnLoad !== 'undefined') {\n log.debug('Start On Load inner: ' + mermaid.startOnLoad);\n mermaidAPI.updateSiteConfig({ startOnLoad: mermaid.startOnLoad });\n }\n\n if (typeof mermaid.ganttConfig !== 'undefined') {\n mermaidAPI.updateSiteConfig({ gantt: mermaid.ganttConfig });\n }\n\n const idGeneratior = new utils.initIdGeneratior(conf.deterministicIds, conf.deterministicIDSeed);\n\n let txt;\n\n for (let i = 0; i < nodes.length; i++) {\n const element = nodes[i];\n\n /*! Check if previously processed */\n if (!element.getAttribute('data-processed')) {\n element.setAttribute('data-processed', true);\n } else {\n continue;\n }\n\n const id = `mermaid-${idGeneratior.next()}`;\n\n // Fetch the graph definition including tags\n txt = element.innerHTML;\n\n // transforms the html to pure text\n txt = utils\n .entityDecode(txt)\n .trim()\n .replace(/<br\\s*\\/?>/gi, '<br/>');\n\n const init = utils.detectInit(txt);\n if (init) {\n log.debug('Detected early reinit: ', init);\n }\n\n try {\n mermaidAPI.render(\n id,\n txt,\n (svgCode, bindFunctions) => {\n element.innerHTML = svgCode;\n if (typeof callback !== 'undefined') {\n callback(id);\n }\n if (bindFunctions) bindFunctions(element);\n },\n element\n );\n } catch (e) {\n log.warn('Syntax Error rendering');\n log.warn(e);\n if (this.parseError) {\n this.parseError(e);\n }\n }\n }\n};\n\nconst initialize = function (config) {\n // mermaidAPI.reset();\n if (typeof config.mermaid !== 'undefined') {\n if (typeof config.mermaid.startOnLoad !== 'undefined') {\n mermaid.startOnLoad = config.mermaid.startOnLoad;\n }\n if (typeof config.mermaid.htmlLabels !== 'undefined') {\n mermaid.htmlLabels =\n config.mermaid.htmlLabels === 'false' || config.mermaid.htmlLabels === false ? false : true;\n }\n }\n mermaidAPI.initialize(config);\n // mermaidAPI.reset();\n};\n\n/**\n * ##contentLoaded Callback function that is called when page is loaded. This functions fetches\n * configuration for mermaid rendering and calls init for rendering the mermaid diagrams on the page.\n */\nconst contentLoaded = function () {\n let config;\n\n if (mermaid.startOnLoad) {\n // No config found, do check API config\n config = mermaidAPI.getConfig();\n if (config.startOnLoad) {\n mermaid.init();\n }\n } else {\n if (typeof mermaid.startOnLoad === 'undefined') {\n log.debug('In start, no config');\n config = mermaidAPI.getConfig();\n if (config.startOnLoad) {\n mermaid.init();\n }\n }\n }\n};\n\nif (typeof document !== 'undefined') {\n /*!\n * Wait for document loaded before starting the execution\n */\n window.addEventListener(\n 'load',\n function () {\n contentLoaded();\n },\n false\n );\n}\n\nconst mermaid = {\n startOnLoad: true,\n htmlLabels: true,\n\n mermaidAPI,\n parse: mermaidAPI.parse,\n render: mermaidAPI.render,\n\n init,\n initialize,\n\n contentLoaded,\n};\n\nexport default mermaid;\n","/**\n * Edit this\n * Page[[N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/src/mermaidAPI.js)\n *\n * This is the API to be used when optionally handling the integration with the web page, instead of\n * using the default integration provided by mermaid.js.\n *\n * The core of this api is the [**render**](Setup.md?id=render) function which, given a graph\n * definition as text, renders the graph/diagram and returns an svg element for the graph.\n *\n * It is is then up to the user of the API to make use of the svg, either insert it somewhere in the\n * page or do something completely different.\n *\n * In addition to the render function, a number of behavioral configuration options are available.\n *\n * @name mermaidAPI\n */\nimport { select } from 'd3';\nimport { compile, serialize, stringify } from 'stylis';\nimport pkg from '../package.json';\nimport * as configApi from './config';\nimport classDb from './diagrams/class/classDb';\nimport classRenderer from './diagrams/class/classRenderer';\nimport classRendererV2 from './diagrams/class/classRenderer-v2';\nimport classParser from './diagrams/class/parser/classDiagram';\nimport erDb from './diagrams/er/erDb';\nimport erRenderer from './diagrams/er/erRenderer';\nimport erParser from './diagrams/er/parser/erDiagram';\nimport flowDb from './diagrams/flowchart/flowDb';\nimport flowRenderer from './diagrams/flowchart/flowRenderer';\nimport flowRendererV2 from './diagrams/flowchart/flowRenderer-v2';\nimport flowParser from './diagrams/flowchart/parser/flow';\nimport ganttDb from './diagrams/gantt/ganttDb';\nimport ganttRenderer from './diagrams/gantt/ganttRenderer';\nimport ganttParser from './diagrams/gantt/parser/gantt';\nimport gitGraphAst from './diagrams/git/gitGraphAst';\nimport gitGraphRenderer from './diagrams/git/gitGraphRenderer';\nimport gitGraphParser from './diagrams/git/parser/gitGraph';\nimport infoDb from './diagrams/info/infoDb';\nimport infoRenderer from './diagrams/info/infoRenderer';\nimport infoParser from './diagrams/info/parser/info';\nimport pieParser from './diagrams/pie/parser/pie';\nimport pieDb from './diagrams/pie/pieDb';\nimport pieRenderer from './diagrams/pie/pieRenderer';\nimport requirementParser from './diagrams/requirement/parser/requirementDiagram';\nimport requirementDb from './diagrams/requirement/requirementDb';\nimport requirementRenderer from './diagrams/requirement/requirementRenderer';\nimport sequenceParser from './diagrams/sequence/parser/sequenceDiagram';\nimport sequenceDb from './diagrams/sequence/sequenceDb';\nimport sequenceRenderer from './diagrams/sequence/sequenceRenderer';\nimport stateParser from './diagrams/state/parser/stateDiagram';\nimport stateDb from './diagrams/state/stateDb';\nimport stateRenderer from './diagrams/state/stateRenderer';\nimport stateRendererV2 from './diagrams/state/stateRenderer-v2';\nimport journeyDb from './diagrams/user-journey/journeyDb';\nimport journeyRenderer from './diagrams/user-journey/journeyRenderer';\nimport journeyParser from './diagrams/user-journey/parser/journey';\nimport errorRenderer from './errorRenderer';\nimport { attachFunctions } from './interactionDb';\nimport { log, setLogLevel } from './logger';\nimport getStyles from './styles';\nimport theme from './themes';\nimport utils, { directiveSanitizer, assignWithDepth } from './utils';\n\n/**\n * @param text\n * @returns {any}\n */\nfunction parse(text) {\n const cnf = configApi.getConfig();\n const graphInit = utils.detectInit(text, cnf);\n if (graphInit) {\n reinitialize(graphInit);\n log.debug('reinit ', graphInit);\n }\n const graphType = utils.detectType(text, cnf);\n let parser;\n\n log.debug('Type ' + graphType);\n switch (graphType) {\n case 'git':\n parser = gitGraphParser;\n parser.parser.yy = gitGraphAst;\n break;\n case 'flowchart':\n flowDb.clear();\n parser = flowParser;\n parser.parser.yy = flowDb;\n break;\n case 'flowchart-v2':\n flowDb.clear();\n parser = flowParser;\n parser.parser.yy = flowDb;\n break;\n case 'sequence':\n parser = sequenceParser;\n parser.parser.yy = sequenceDb;\n break;\n case 'gantt':\n parser = ganttParser;\n parser.parser.yy = ganttDb;\n break;\n case 'class':\n parser = classParser;\n parser.parser.yy = classDb;\n break;\n case 'classDiagram':\n parser = classParser;\n parser.parser.yy = classDb;\n break;\n case 'state':\n parser = stateParser;\n parser.parser.yy = stateDb;\n break;\n case 'stateDiagram':\n parser = stateParser;\n parser.parser.yy = stateDb;\n break;\n case 'info':\n log.debug('info info info');\n parser = infoParser;\n parser.parser.yy = infoDb;\n break;\n case 'pie':\n log.debug('pie');\n parser = pieParser;\n parser.parser.yy = pieDb;\n break;\n case 'er':\n log.debug('er');\n parser = erParser;\n parser.parser.yy = erDb;\n break;\n case 'journey':\n log.debug('Journey');\n parser = journeyParser;\n parser.parser.yy = journeyDb;\n break;\n case 'requirement':\n case 'requirementDiagram':\n log.debug('RequirementDiagram');\n parser = requirementParser;\n parser.parser.yy = requirementDb;\n break;\n }\n parser.parser.yy.graphType = graphType;\n parser.parser.yy.parseError = (str, hash) => {\n const error = { str, hash };\n throw error;\n };\n\n parser.parse(text);\n return parser;\n}\n\nexport const encodeEntities = function (text) {\n let txt = text;\n\n txt = txt.replace(/style.*:\\S*#.*;/g, function (s) {\n const innerTxt = s.substring(0, s.length - 1);\n return innerTxt;\n });\n txt = txt.replace(/classDef.*:\\S*#.*;/g, function (s) {\n const innerTxt = s.substring(0, s.length - 1);\n return innerTxt;\n });\n\n txt = txt.replace(/#\\w+;/g, function (s) {\n const innerTxt = s.substring(1, s.length - 1);\n\n const isInt = /^\\+?\\d+$/.test(innerTxt);\n if (isInt) {\n return 'fl°°' + innerTxt + '¶ß';\n } else {\n return 'fl°' + innerTxt + '¶ß';\n }\n });\n\n return txt;\n};\n\nexport const decodeEntities = function (text) {\n let txt = text;\n\n txt = txt.replace(/fl°°/g, function () {\n return '&#';\n });\n txt = txt.replace(/fl°/g, function () {\n return '&';\n });\n txt = txt.replace(/¶ß/g, function () {\n return ';';\n });\n\n return txt;\n};\n/**\n * Function that renders an svg with a graph from a chart definition. Usage example below.\n *\n * ```javascript\n * mermaidAPI.initialize({\n * startOnLoad: true,\n * });\n * $(function () {\n * const graphDefinition = 'graph TB\\na-->b';\n * const cb = function (svgGraph) {\n * console.log(svgGraph);\n * };\n * mermaidAPI.render('id1', graphDefinition, cb);\n * });\n * ```\n *\n * @param {any} id The id of the element to be rendered\n * @param {any} _txt The graph definition\n * @param {any} cb Callback which is called after rendering is finished with the svg code as inparam.\n * @param {any} container Selector to element in which a div with the graph temporarily will be\n * inserted. In one is provided a hidden div will be inserted in the body of the page instead. The\n * element will be removed when rendering is completed.\n * @returns {any}\n */\nconst render = function (id, _txt, cb, container) {\n configApi.reset();\n let txt = _txt;\n const graphInit = utils.detectInit(txt);\n if (graphInit) {\n configApi.addDirective(graphInit);\n }\n let cnf = configApi.getConfig();\n // Check the maximum allowed text size\n if (_txt.length > cnf.maxTextSize) {\n txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';\n }\n\n if (typeof container !== 'undefined') {\n container.innerHTML = '';\n\n select(container)\n .append('div')\n .attr('id', 'd' + id)\n .attr('style', 'font-family: ' + cnf.fontFamily)\n .append('svg')\n .attr('id', id)\n .attr('width', '100%')\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .append('g');\n } else {\n const existingSvg = document.getElementById(id);\n if (existingSvg) {\n existingSvg.remove();\n }\n const element = document.querySelector('#' + 'd' + id);\n if (element) {\n element.remove();\n }\n\n select('body')\n .append('div')\n .attr('id', 'd' + id)\n .append('svg')\n .attr('id', id)\n .attr('width', '100%')\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .append('g');\n }\n\n window.txt = txt;\n txt = encodeEntities(txt);\n\n const element = select('#d' + id).node();\n const graphType = utils.detectType(txt, cnf);\n\n // insert inline style into svg\n const svg = element.firstChild;\n const firstChild = svg.firstChild;\n\n let userStyles = '';\n // user provided theme CSS\n if (cnf.themeCSS !== undefined) {\n userStyles += `\\n${cnf.themeCSS}`;\n }\n // user provided theme CSS\n if (cnf.fontFamily !== undefined) {\n userStyles += `\\n:root { --mermaid-font-family: ${cnf.fontFamily}}`;\n }\n // user provided theme CSS\n if (cnf.altFontFamily !== undefined) {\n userStyles += `\\n:root { --mermaid-alt-font-family: ${cnf.altFontFamily}}`;\n }\n\n // classDef\n if (graphType === 'flowchart' || graphType === 'flowchart-v2' || graphType === 'graph') {\n const classes = flowRenderer.getClasses(txt);\n const htmlLabels = cnf.htmlLabels || cnf.flowchart.htmlLabels;\n for (const className in classes) {\n if (htmlLabels) {\n userStyles += `\\n.${className} > * { ${classes[className].styles.join(\n ' !important; '\n )} !important; }`;\n userStyles += `\\n.${className} span { ${classes[className].styles.join(\n ' !important; '\n )} !important; }`;\n } else {\n userStyles += `\\n.${className} path { ${classes[className].styles.join(\n ' !important; '\n )} !important; }`;\n userStyles += `\\n.${className} rect { ${classes[className].styles.join(\n ' !important; '\n )} !important; }`;\n userStyles += `\\n.${className} polygon { ${classes[className].styles.join(\n ' !important; '\n )} !important; }`;\n userStyles += `\\n.${className} ellipse { ${classes[className].styles.join(\n ' !important; '\n )} !important; }`;\n userStyles += `\\n.${className} circle { ${classes[className].styles.join(\n ' !important; '\n )} !important; }`;\n if (classes[className].textStyles) {\n userStyles += `\\n.${className} tspan { ${classes[className].textStyles.join(\n ' !important; '\n )} !important; }`;\n }\n }\n }\n }\n\n // log.warn(cnf.themeVariables);\n\n const stylis = (selector, styles) => serialize(compile(`${selector}{${styles}}`), stringify);\n const rules = stylis(`#${id}`, getStyles(graphType, userStyles, cnf.themeVariables));\n\n const style1 = document.createElement('style');\n style1.innerHTML = `#${id} ` + rules;\n svg.insertBefore(style1, firstChild);\n\n // Verify that the generated svgs are ok before removing this\n\n // const style2 = document.createElement('style');\n // const cs = window.getComputedStyle(svg);\n // style2.innerHTML = `#d${id} * {\n // color: ${cs.color};\n // // font: ${cs.font};\n // // font-family: Arial;\n // // font-size: 24px;\n // }`;\n // svg.insertBefore(style2, firstChild);\n\n try {\n switch (graphType) {\n case 'git':\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n gitGraphRenderer.setConf(cnf.git);\n gitGraphRenderer.draw(txt, id, false);\n break;\n case 'flowchart':\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n flowRenderer.setConf(cnf.flowchart);\n flowRenderer.draw(txt, id, false);\n break;\n case 'flowchart-v2':\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n flowRendererV2.setConf(cnf.flowchart);\n flowRendererV2.draw(txt, id, false);\n break;\n case 'sequence':\n cnf.sequence.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n if (cnf.sequenceDiagram) {\n // backwards compatibility\n sequenceRenderer.setConf(Object.assign(cnf.sequence, cnf.sequenceDiagram));\n console.error(\n '`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.'\n );\n } else {\n sequenceRenderer.setConf(cnf.sequence);\n }\n sequenceRenderer.draw(txt, id);\n break;\n case 'gantt':\n cnf.gantt.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n ganttRenderer.setConf(cnf.gantt);\n ganttRenderer.draw(txt, id);\n break;\n case 'class':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n classRenderer.setConf(cnf.class);\n classRenderer.draw(txt, id);\n break;\n case 'classDiagram':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n classRendererV2.setConf(cnf.class);\n classRendererV2.draw(txt, id);\n break;\n case 'state':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n stateRenderer.setConf(cnf.state);\n stateRenderer.draw(txt, id);\n break;\n case 'stateDiagram':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n stateRendererV2.setConf(cnf.state);\n stateRendererV2.draw(txt, id);\n break;\n case 'info':\n cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n infoRenderer.setConf(cnf.class);\n infoRenderer.draw(txt, id, pkg.version);\n break;\n case 'pie':\n //cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n //pieRenderer.setConf(cnf.pie);\n pieRenderer.draw(txt, id, pkg.version);\n break;\n case 'er':\n erRenderer.setConf(cnf.er);\n erRenderer.draw(txt, id, pkg.version);\n break;\n case 'journey':\n journeyRenderer.setConf(cnf.journey);\n journeyRenderer.draw(txt, id, pkg.version);\n break;\n case 'requirement':\n requirementRenderer.setConf(cnf.requirement);\n requirementRenderer.draw(txt, id, pkg.version);\n break;\n }\n } catch (e) {\n // errorRenderer.setConf(cnf.class);\n errorRenderer.draw(id, pkg.version);\n throw e;\n }\n\n select(`[id=\"${id}\"]`)\n .selectAll('foreignobject > *')\n .attr('xmlns', 'http://www.w3.org/1999/xhtml');\n\n // Fix for when the base tag is used\n let svgCode = select('#d' + id).node().innerHTML;\n log.debug('cnf.arrowMarkerAbsolute', cnf.arrowMarkerAbsolute);\n if (!cnf.arrowMarkerAbsolute || cnf.arrowMarkerAbsolute === 'false') {\n svgCode = svgCode.replace(/marker-end=\"url\\(.*?#/g, 'marker-end=\"url(#', 'g');\n }\n\n svgCode = decodeEntities(svgCode);\n\n // Fix for when the br tag is used\n svgCode = svgCode.replace(/<br>/g, '<br/>');\n\n if (typeof cb !== 'undefined') {\n switch (graphType) {\n case 'flowchart':\n case 'flowchart-v2':\n cb(svgCode, flowDb.bindFunctions);\n break;\n case 'gantt':\n cb(svgCode, ganttDb.bindFunctions);\n break;\n case 'class':\n case 'classDiagram':\n cb(svgCode, classDb.bindFunctions);\n break;\n default:\n cb(svgCode);\n }\n } else {\n log.debug('CB = undefined!');\n }\n attachFunctions();\n\n const node = select('#d' + id).node();\n if (node !== null && typeof node.remove === 'function') {\n select('#d' + id)\n .node()\n .remove();\n }\n\n return svgCode;\n};\n\nlet currentDirective = {};\n\nconst parseDirective = function (p, statement, context, type) {\n try {\n if (statement !== undefined) {\n statement = statement.trim();\n switch (context) {\n case 'open_directive':\n currentDirective = {};\n break;\n case 'type_directive':\n currentDirective.type = statement.toLowerCase();\n break;\n case 'arg_directive':\n currentDirective.args = JSON.parse(statement);\n break;\n case 'close_directive':\n handleDirective(p, currentDirective, type);\n currentDirective = null;\n break;\n }\n }\n } catch (error) {\n log.error(\n `Error while rendering sequenceDiagram directive: ${statement} jison context: ${context}`\n );\n log.error(error.message);\n }\n};\n\nconst handleDirective = function (p, directive, type) {\n log.debug(`Directive type=${directive.type} with args:`, directive.args);\n switch (directive.type) {\n case 'init':\n case 'initialize': {\n ['config'].forEach((prop) => {\n if (typeof directive.args[prop] !== 'undefined') {\n if (type === 'flowchart-v2') {\n type = 'flowchart';\n }\n directive.args[type] = directive.args[prop];\n delete directive.args[prop];\n }\n });\n log.debug('sanitize in handleDirective', directive.args);\n directiveSanitizer(directive.args);\n log.debug('sanitize in handleDirective (done)', directive.args);\n reinitialize(directive.args);\n configApi.addDirective(directive.args);\n break;\n }\n case 'wrap':\n case 'nowrap':\n if (p && p['setWrap']) {\n p.setWrap(directive.type === 'wrap');\n }\n break;\n default:\n log.warn(\n `Unhandled directive: source: '%%{${directive.type}: ${JSON.stringify(\n directive.args ? directive.args : {}\n )}}%%`,\n directive\n );\n break;\n }\n};\n\n/** @param {any} conf */\nfunction updateRendererConfigs(conf) {\n // Todo remove, all diagrams should get config on demoand from the config object, no need for this\n gitGraphRenderer.setConf(conf.git);\n flowRenderer.setConf(conf.flowchart);\n flowRendererV2.setConf(conf.flowchart);\n if (typeof conf['sequenceDiagram'] !== 'undefined') {\n sequenceRenderer.setConf(assignWithDepth(conf.sequence, conf['sequenceDiagram']));\n }\n sequenceRenderer.setConf(conf.sequence);\n ganttRenderer.setConf(conf.gantt);\n classRenderer.setConf(conf.class);\n stateRenderer.setConf(conf.state);\n stateRendererV2.setConf(conf.state);\n infoRenderer.setConf(conf.class);\n // pieRenderer.setConf(conf.class);\n erRenderer.setConf(conf.er);\n journeyRenderer.setConf(conf.journey);\n requirementRenderer.setConf(conf.requirement);\n errorRenderer.setConf(conf.class);\n}\n\nfunction reinitialize() {\n // `mermaidAPI.reinitialize: v${pkg.version}`,\n // JSON.stringify(options),\n // options.themeVariables.primaryColor;\n // // if (options.theme && theme[options.theme]) {\n // // options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables);\n // // }\n // // Set default options\n // const config =\n // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig();\n // updateRendererConfigs(config);\n // setLogLevel(config.logLevel);\n // log.debug('mermaidAPI.reinitialize: ', config);\n}\n\n/** @param {any} options */\nfunction initialize(options) {\n // console.warn(`mermaidAPI.initialize: v${pkg.version} `, options);\n\n // Handle legacy location of font-family configuration\n if (options && options.fontFamily) {\n if (!options.themeVariables) {\n options.themeVariables = { fontFamily: options.fontFamily };\n } else {\n if (!options.themeVariables.fontFamily) {\n options.themeVariables = { fontFamily: options.fontFamily };\n }\n }\n }\n // Set default options\n configApi.saveConfigFromInitilize(options);\n\n if (options && options.theme && theme[options.theme]) {\n // Todo merge with user options\n options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables);\n } else {\n if (options) options.themeVariables = theme.default.getThemeVariables(options.themeVariables);\n }\n\n const config =\n typeof options === 'object' ? configApi.setSiteConfig(options) : configApi.getSiteConfig();\n\n updateRendererConfigs(config);\n setLogLevel(config.logLevel);\n // log.debug('mermaidAPI.initialize: ', config);\n}\n\nconst mermaidAPI = Object.freeze({\n render,\n parse,\n parseDirective,\n initialize,\n reinitialize,\n getConfig: configApi.getConfig,\n setConfig: configApi.setConfig,\n getSiteConfig: configApi.getSiteConfig,\n updateSiteConfig: configApi.updateSiteConfig,\n reset: () => {\n // console.warn('reset');\n configApi.reset();\n // const siteConfig = configApi.getSiteConfig();\n // updateRendererConfigs(siteConfig);\n },\n globalReset: () => {\n configApi.reset(configApi.defaultConfig);\n updateRendererConfigs(configApi.getConfig());\n },\n defaultConfig: configApi.defaultConfig,\n});\n\nsetLogLevel(configApi.getConfig().logLevel);\nconfigApi.reset(configApi.getConfig());\n\nexport default mermaidAPI;\n/**\n * ## mermaidAPI configuration defaults\n *\n * ```html\n * <script>\n * var config = {\n * theme: 'default',\n * logLevel: 'fatal',\n * securityLevel: 'strict',\n * startOnLoad: true,\n * arrowMarkerAbsolute: false,\n *\n * er: {\n * diagramPadding: 20,\n * layoutDirection: 'TB',\n * minEntityWidth: 100,\n * minEntityHeight: 75,\n * entityPadding: 15,\n * stroke: 'gray',\n * fill: 'honeydew',\n * fontSize: 12,\n * useMaxWidth: true,\n * },\n * flowchart: {\n * diagramPadding: 8,\n * htmlLabels: true,\n * curve: 'basis',\n * },\n * sequence: {\n * diagramMarginX: 50,\n * diagramMarginY: 10,\n * actorMargin: 50,\n * width: 150,\n * height: 65,\n * boxMargin: 10,\n * boxTextMargin: 5,\n * noteMargin: 10,\n * messageMargin: 35,\n * messageAlign: 'center',\n * mirrorActors: true,\n * bottomMarginAdj: 1,\n * useMaxWidth: true,\n * rightAngles: false,\n * showSequenceNumbers: false,\n * },\n * gantt: {\n * titleTopMargin: 25,\n * barHeight: 20,\n * barGap: 4,\n * topPadding: 50,\n * leftPadding: 75,\n * gridLineStartPadding: 35,\n * fontSize: 11,\n * fontFamily: '\"Open-Sans\", \"sans-serif\"',\n * numberSectionStyles: 4,\n * axisFormat: '%Y-%m-%d',\n * topAxis: false,\n * },\n * };\n * mermaid.initialize(config);\n * </script>\n * ```\n */\n","import classDiagram from './diagrams/class/styles';\nimport er from './diagrams/er/styles';\nimport flowchart from './diagrams/flowchart/styles';\nimport gantt from './diagrams/gantt/styles';\nimport git from './diagrams/git/styles';\nimport info from './diagrams/info/styles';\nimport pie from './diagrams/pie/styles';\nimport requirement from './diagrams/requirement/styles';\nimport sequence from './diagrams/sequence/styles';\nimport stateDiagram from './diagrams/state/styles';\nimport journey from './diagrams/user-journey/styles';\n\nconst themes = {\n flowchart,\n 'flowchart-v2': flowchart,\n sequence,\n gantt,\n classDiagram,\n 'classDiagram-v2': classDiagram,\n class: classDiagram,\n stateDiagram,\n state: stateDiagram,\n git,\n info,\n pie,\n er,\n journey,\n requirement,\n};\n\nexport const calcThemeVariables = (theme, userOverRides) => theme.calcColors(userOverRides);\n\nconst getStyles = (type, userStyles, options) => {\n //console.warn('options in styles: ', options);\n return ` {\n font-family: ${options.fontFamily};\n font-size: ${options.fontSize};\n fill: ${options.textColor}\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ${options.errorBkgColor};\n }\n .error-text {\n fill: ${options.errorTextColor};\n stroke: ${options.errorTextColor};\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ${options.lineColor};\n stroke: ${options.lineColor};\n }\n .marker.cross {\n stroke: ${options.lineColor};\n }\n\n svg {\n font-family: ${options.fontFamily};\n font-size: ${options.fontSize};\n }\n\n ${themes[type](options)}\n\n ${userStyles}\n`;\n};\n\nexport default getStyles;\n","import { getThemeVariables as baseThemeVariables } from './theme-base';\nimport { getThemeVariables as darkThemeVariables } from './theme-dark';\nimport { getThemeVariables as defaultThemeVariables } from './theme-default';\nimport { getThemeVariables as forestThemeVariables } from './theme-forest';\nimport { getThemeVariables as neutralThemeVariables } from './theme-neutral';\n\nexport default {\n base: {\n getThemeVariables: baseThemeVariables,\n },\n dark: {\n getThemeVariables: darkThemeVariables,\n },\n default: {\n getThemeVariables: defaultThemeVariables,\n },\n forest: {\n getThemeVariables: forestThemeVariables,\n },\n neutral: {\n getThemeVariables: neutralThemeVariables,\n },\n};\n","import { darken, lighten, adjust, invert } from 'khroma';\nimport { mkBorder } from './theme-helpers';\nclass Theme {\n constructor() {\n /** # Base variables */\n /**\n * - Background - used to know what the background color is of the diagram. This is used for\n * deducing colors for istance line color. Defaulr value is #f4f4f4.\n */\n this.background = '#f4f4f4';\n this.darkMode = false;\n\n // this.background = '#0c0c0c';\n // this.darkMode = true;\n this.primaryColor = '#fff4dd';\n // this.background = '#0c0c0c';\n // this.primaryColor = '#1f1f00';\n\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = '#333';\n\n // dark\n\n // this.primaryColor = '#034694';\n // this.primaryColor = '#f2ee7e';\n // this.primaryColor = '#9f33be';\n // this.primaryColor = '#f0fff0';\n // this.primaryColor = '#fa255e';\n // this.primaryColor = '#ECECFF';\n\n // this.secondaryColor = '#c39ea0';\n // this.tertiaryColor = '#f8e5e5';\n\n // this.secondaryColor = '#dfdfde';\n // this.tertiaryColor = '#CCCCFF';\n\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n // this.updateColors();\n }\n updateColors() {\n // The || is to make sure that if the variable has been defiend by a user override that value is to be used\n\n /* Main */\n this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#ddd' : '#333'); // invert(this.primaryColor);\n this.secondaryColor = this.secondaryColor || adjust(this.primaryColor, { h: -120 });\n this.tertiaryColor = this.tertiaryColor || adjust(this.primaryColor, { h: 180, l: 5 });\n\n this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor =\n this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor =\n this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode);\n this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode);\n this.noteBkgColor = this.noteBkgColor || '#fff5ad';\n this.noteTextColor = this.noteTextColor || '#333';\n\n this.secondaryTextColor = this.secondaryTextColor || invert(this.secondaryColor);\n this.tertiaryTextColor = this.tertiaryTextColor || invert(this.tertiaryColor);\n this.lineColor = this.lineColor || invert(this.background);\n this.textColor = this.textColor || this.primaryTextColor;\n\n /* Flowchart variables */\n this.nodeBkg = this.nodeBkg || this.primaryColor;\n this.mainBkg = this.mainBkg || this.primaryColor;\n this.nodeBorder = this.nodeBorder || this.primaryBorderColor;\n this.clusterBkg = this.clusterBkg || this.tertiaryColor;\n this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor;\n this.defaultLinkColor = this.defaultLinkColor || this.lineColor;\n this.titleColor = this.titleColor || this.tertiaryTextColor;\n this.edgeLabelBackground =\n this.edgeLabelBackground ||\n (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);\n this.nodeTextColor = this.nodeTextColor || this.primaryTextColor;\n /* Sequence Diagram variables */\n\n // this.actorBorder = lighten(this.border1, 0.5);\n this.actorBorder = this.actorBorder || this.primaryBorderColor;\n this.actorBkg = this.actorBkg || this.mainBkg;\n this.actorTextColor = this.actorTextColor || this.primaryTextColor;\n this.actorLineColor = this.actorLineColor || 'grey';\n this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg;\n this.signalColor = this.signalColor || this.textColor;\n this.signalTextColor = this.signalTextColor || this.textColor;\n this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder;\n this.labelTextColor = this.labelTextColor || this.actorTextColor;\n this.loopTextColor = this.loopTextColor || this.actorTextColor;\n this.activationBorderColor = this.activationBorderColor || darken(this.secondaryColor, 10);\n this.activationBkgColor = this.activationBkgColor || this.secondaryColor;\n this.sequenceNumberColor = this.sequenceNumberColor || invert(this.lineColor);\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor;\n this.altSectionBkgColor = this.altSectionBkgColor || 'white';\n this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor;\n this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor;\n this.excludeBkgColor = this.excludeBkgColor || '#eeeeee';\n this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor;\n this.taskBkgColor = this.taskBkgColor || this.primaryColor;\n this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor;\n this.activeTaskBkgColor = this.activeTaskBkgColor || lighten(this.primaryColor, 23);\n this.gridColor = this.gridColor || 'lightgrey';\n this.doneTaskBkgColor = this.doneTaskBkgColor || 'lightgrey';\n this.doneTaskBorderColor = this.doneTaskBorderColor || 'grey';\n this.critBorderColor = this.critBorderColor || '#ff8888';\n this.critBkgColor = this.critBkgColor || 'red';\n this.todayLineColor = this.todayLineColor || 'red';\n this.taskTextColor = this.taskTextColor || this.textColor;\n this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor;\n this.taskTextLightColor = this.taskTextLightColor || this.textColor;\n this.taskTextColor = this.taskTextColor || this.primaryTextColor;\n this.taskTextDarkColor = this.taskTextDarkColor || this.textColor;\n this.taskTextClickableColor = this.taskTextClickableColor || '#003163';\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n /* The color of the text tables of the tstates*/\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || this.tertiaryColor;\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.nodeBorder;\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n this.transitionColor = this.transitionColor || this.lineColor;\n this.specialStateColor = this.lineColor;\n\n /* class */\n this.classText = this.classText || this.textColor;\n\n /* user-journey */\n this.fillType0 = this.fillType0 || this.primaryColor;\n this.fillType1 = this.fillType1 || this.secondaryColor;\n this.fillType2 = this.fillType2 || adjust(this.primaryColor, { h: 64 });\n this.fillType3 = this.fillType3 || adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = this.fillType4 || adjust(this.primaryColor, { h: -64 });\n this.fillType5 = this.fillType5 || adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = this.fillType6 || adjust(this.primaryColor, { h: 128 });\n this.fillType7 = this.fillType7 || adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || this.primaryColor;\n this.pie2 = this.pie2 || this.secondaryColor;\n this.pie3 = this.pie3 || this.tertiaryColor;\n this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });\n this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });\n this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });\n this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });\n this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });\n this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });\n this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 });\n this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });\n this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground =\n this.relationLabelBackground ||\n (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { invert, lighten, darken, rgba, adjust } from 'khroma';\nimport { mkBorder } from './theme-helpers';\nclass Theme {\n constructor() {\n this.background = '#333';\n this.primaryColor = '#1f2020';\n this.secondaryColor = lighten(this.primaryColor, 16);\n\n this.tertiaryColor = adjust(this.primaryColor, { h: -160 });\n this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.tertiaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n this.mainBkg = '#1f2020';\n this.secondBkg = 'calculated';\n this.mainContrastColor = 'lightgrey';\n this.darkTextColor = lighten(invert('#323D47'), 10);\n this.lineColor = 'calculated';\n this.border1 = '#81B1DB';\n this.border2 = rgba(255, 255, 255, 0.25);\n this.arrowheadColor = 'calculated';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n this.labelBackground = '#181818';\n this.textColor = '#ccc';\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = '#F9FFFE';\n this.edgeLabelBackground = 'calculated';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'calculated';\n this.actorLineColor = 'calculated';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = 'calculated';\n this.activationBkgColor = 'calculated';\n this.sequenceNumberColor = 'black';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = darken('#EAE8D9', 30);\n this.altSectionBkgColor = 'calculated';\n this.sectionBkgColor2 = '#EAE8D9';\n this.taskBorderColor = rgba(255, 255, 255, 70);\n this.taskBkgColor = 'calculated';\n this.taskTextColor = 'calculated';\n this.taskTextLightColor = 'calculated';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = rgba(255, 255, 255, 50);\n this.activeTaskBkgColor = '#81B1DB';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#E83737';\n this.critBkgColor = '#E83737';\n this.taskTextDarkColor = 'calculated';\n this.todayLineColor = '#DB5757';\n\n /* state colors */\n this.labelColor = 'calculated';\n\n this.errorBkgColor = '#a44141';\n this.errorTextColor = '#ddd';\n }\n updateColors() {\n this.secondBkg = lighten(this.mainBkg, 16);\n this.lineColor = this.mainContrastColor;\n this.arrowheadColor = this.mainContrastColor;\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.edgeLabelBackground = lighten(this.labelBackground, 25);\n\n /* Sequence Diagram variables */\n\n this.actorBorder = this.border1;\n this.actorBkg = this.mainBkg;\n this.actorTextColor = this.mainContrastColor;\n this.actorLineColor = this.mainContrastColor;\n this.signalColor = this.mainContrastColor;\n this.signalTextColor = this.mainContrastColor;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.mainContrastColor;\n this.loopTextColor = this.mainContrastColor;\n this.noteBorderColor = this.secondaryBorderColor;\n this.noteBkgColor = this.secondBkg;\n this.noteTextColor = this.secondaryTextColor;\n this.activationBorderColor = this.border1;\n this.activationBkgColor = this.secondBkg;\n\n /* Gantt chart variables */\n\n this.altSectionBkgColor = this.background;\n this.taskBkgColor = lighten(this.mainBkg, 23);\n this.taskTextColor = this.darkTextColor;\n this.taskTextLightColor = this.mainContrastColor;\n this.taskTextOutsideColor = this.taskTextLightColor;\n this.gridColor = this.mainContrastColor;\n this.doneTaskBkgColor = this.mainContrastColor;\n this.taskTextDarkColor = this.darkTextColor;\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#555';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.primaryBorderColor;\n this.specialStateColor = '#f4f4f4'; // this.lineColor;\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || '#0b0000';\n this.pie2 = this.pie2 || '#4d1037';\n this.pie3 = this.pie3 || '#3f5258';\n this.pie4 = this.pie4 || '#4f2f1b';\n this.pie5 = this.pie5 || '#6e0a0a';\n this.pie6 = this.pie6 || '#3b0048';\n this.pie7 = this.pie7 || '#995a01';\n this.pie8 = this.pie8 || '#154706';\n this.pie9 = this.pie9 || '#161722';\n this.pie10 = this.pie10 || '#00296f';\n this.pie11 = this.pie11 || '#01629c';\n this.pie12 = this.pie12 || '#010029';\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* class */\n this.classText = this.primaryTextColor;\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground =\n this.relationLabelBackground ||\n (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { invert, lighten, rgba, adjust } from 'khroma';\nimport { mkBorder } from './theme-helpers';\n\nclass Theme {\n constructor() {\n /* Base variables */\n this.background = '#f4f4f4';\n this.primaryColor = '#ECECFF';\n\n this.secondaryColor = adjust(this.primaryColor, { h: 120 });\n this.secondaryColor = '#ffffde';\n this.tertiaryColor = adjust(this.primaryColor, { h: -160 });\n this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);\n\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.tertiaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n this.background = 'white';\n this.mainBkg = '#ECECFF';\n this.secondBkg = '#ffffde';\n this.lineColor = '#333333';\n this.border1 = '#9370DB';\n this.border2 = '#aaaa33';\n this.arrowheadColor = '#333333';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n this.labelBackground = '#e8e8e8';\n this.textColor = '#333';\n\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = 'calculated';\n this.edgeLabelBackground = 'calculated';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'black';\n this.actorLineColor = 'grey';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = 'calculated';\n this.altSectionBkgColor = 'calculated';\n this.sectionBkgColor2 = 'calculated';\n this.excludeBkgColor = '#eeeeee';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = 'calculated';\n this.taskTextLightColor = 'calculated';\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextDarkColor = 'calculated';\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.taskTextClickableColor = 'calculated';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'calculated';\n this.critBorderColor = 'calculated';\n this.critBkgColor = 'calculated';\n this.todayLineColor = 'calculated';\n\n this.sectionBkgColor = rgba(102, 102, 255, 0.49);\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = '#fff400';\n this.taskBorderColor = '#534fbc';\n this.taskBkgColor = '#8a90dd';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'black';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = '#534fbc';\n this.activeTaskBkgColor = '#bfc7ff';\n this.gridColor = 'lightgrey';\n this.doneTaskBkgColor = 'lightgrey';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#ff8888';\n this.critBkgColor = 'red';\n this.todayLineColor = 'red';\n\n /* state colors */\n this.labelColor = 'black';\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n this.updateColors();\n }\n updateColors() {\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1; // border 1\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.titleColor = this.textColor;\n this.edgeLabelBackground = this.labelBackground;\n\n /* Sequence Diagram variables */\n\n // this.actorBorder = lighten(this.border1, 0.5);\n this.actorBorder = lighten(this.border1, 23);\n this.actorBkg = this.mainBkg;\n this.labelBoxBkgColor = this.actorBkg;\n this.signalColor = this.textColor;\n this.signalTextColor = this.textColor;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.actorTextColor;\n this.loopTextColor = this.actorTextColor;\n this.noteBorderColor = this.border2;\n this.noteTextColor = this.actorTextColor;\n\n /* Gantt chart variables */\n\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#f0f0f0';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.nodeBorder;\n this.specialStateColor = this.lineColor;\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n this.transitionColor = this.transitionColor || this.lineColor;\n /* class */\n this.classText = this.primaryTextColor;\n /* journey */\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || this.primaryColor;\n this.pie2 = this.pie2 || this.secondaryColor;\n this.pie3 = this.pie3 || adjust(this.tertiaryColor, { l: -40 });\n this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });\n this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 });\n this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -20 });\n this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -20 });\n this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -40 });\n this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: -40 });\n this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -40 });\n this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -90, l: -40 });\n this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -30 });\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground = this.relationLabelBackground || this.labelBackground;\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { darken, lighten, adjust, invert } from 'khroma';\nimport { mkBorder } from './theme-helpers';\nclass Theme {\n constructor() {\n /* Base vales */\n this.background = '#f4f4f4';\n this.primaryColor = '#cde498';\n this.secondaryColor = '#cdffb2';\n this.background = 'white';\n this.mainBkg = '#cde498';\n this.secondBkg = '#cdffb2';\n this.lineColor = 'green';\n this.border1 = '#13540c';\n this.border2 = '#6eaa49';\n this.arrowheadColor = 'green';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n\n this.tertiaryColor = lighten('#cde498', 10);\n this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.primaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n /* Flowchart variables */\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = '#333';\n this.edgeLabelBackground = '#e8e8e8';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'black';\n this.actorLineColor = 'grey';\n this.signalColor = '#333';\n this.signalTextColor = '#333';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = '#326932';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = '#6eaa49';\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = '#6eaa49';\n this.excludeBkgColor = '#eeeeee';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = '#487e3a';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'black';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'lightgrey';\n this.doneTaskBkgColor = 'lightgrey';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#ff8888';\n this.critBkgColor = 'red';\n this.todayLineColor = 'red';\n\n /* state colors */\n this.labelColor = 'black';\n\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n }\n updateColors() {\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n\n /* Sequence Diagram variables */\n\n this.actorBorder = darken(this.mainBkg, 20);\n this.actorBkg = this.mainBkg;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelTextColor = this.actorTextColor;\n this.loopTextColor = this.actorTextColor;\n this.noteBorderColor = this.border2;\n this.noteTextColor = this.actorTextColor;\n\n /* Gantt chart variables */\n\n this.taskBorderColor = this.border1;\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.activeTaskBorderColor = this.taskBorderColor;\n this.activeTaskBkgColor = this.mainBkg;\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#f0f0f0';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.primaryBorderColor;\n this.specialStateColor = this.lineColor;\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n this.transitionColor = this.transitionColor || this.lineColor;\n /* class */\n this.classText = this.primaryTextColor;\n /* journey */\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || this.primaryColor;\n this.pie2 = this.pie2 || this.secondaryColor;\n this.pie3 = this.pie3 || this.tertiaryColor;\n this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -30 });\n this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 });\n this.pie6 = this.pie6 || adjust(this.tertiaryColor, { h: +40, l: -40 });\n this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });\n this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });\n this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });\n this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -50 });\n this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -50 });\n this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -50 });\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { adjust } from 'khroma';\n\nexport const mkBorder = (col, darkMode) =>\n darkMode ? adjust(col, { s: -40, l: 10 }) : adjust(col, { s: -40, l: -10 });\n","import { invert, darken, lighten, adjust } from 'khroma';\nimport { mkBorder } from './theme-helpers';\n\n// const Color = require ( 'khroma/dist/color' ).default\n// Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => \"#EAF2FB\"\n\nclass Theme {\n constructor() {\n this.primaryColor = '#eee';\n this.contrast = '#707070';\n this.secondaryColor = lighten(this.contrast, 55);\n this.background = '#ffffff';\n\n // this.secondaryColor = adjust(this.primaryColor, { h: 120 });\n this.tertiaryColor = adjust(this.primaryColor, { h: -160 });\n this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);\n\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.tertiaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n // this.altBackground = lighten(this.contrast, 55);\n this.mainBkg = '#eee';\n this.secondBkg = 'calculated';\n this.lineColor = '#666';\n this.border1 = '#999';\n this.border2 = 'calculated';\n this.note = '#ffa';\n this.text = '#333';\n this.critical = '#d42';\n this.done = '#bbb';\n this.arrowheadColor = '#333333';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = 'calculated';\n this.edgeLabelBackground = 'white';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'calculated';\n this.actorLineColor = 'calculated';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = 'calculated';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = 'calculated';\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = 'calculated';\n this.excludeBkgColor = '#eeeeee';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = 'calculated';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'calculated';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'calculated';\n this.critBkgColor = 'calculated';\n this.critBorderColor = 'calculated';\n this.todayLineColor = 'calculated';\n\n /* state colors */\n this.labelColor = 'black';\n\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n }\n updateColors() {\n this.secondBkg = lighten(this.contrast, 55);\n this.border2 = this.contrast;\n\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.titleColor = this.text;\n\n /* Sequence Diagram variables */\n\n this.actorBorder = lighten(this.border1, 23);\n this.actorBkg = this.mainBkg;\n this.actorTextColor = this.text;\n this.actorLineColor = this.lineColor;\n this.signalColor = this.text;\n this.signalTextColor = this.text;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.text;\n this.loopTextColor = this.text;\n this.noteBorderColor = '#999';\n this.noteBkgColor = '#666';\n this.noteTextColor = '#fff';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = lighten(this.contrast, 30);\n this.sectionBkgColor2 = lighten(this.contrast, 30);\n\n this.taskBorderColor = darken(this.contrast, 10);\n\n this.taskBkgColor = this.contrast;\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextDarkColor = this.text;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.activeTaskBorderColor = this.taskBorderColor;\n this.activeTaskBkgColor = this.mainBkg;\n this.gridColor = lighten(this.border1, 30);\n\n this.doneTaskBkgColor = this.done;\n this.doneTaskBorderColor = this.lineColor;\n this.critBkgColor = this.critical;\n this.critBorderColor = darken(this.critBkgColor, 10);\n\n this.todayLineColor = this.critBkgColor;\n\n /* state colors */\n this.transitionColor = this.transitionColor || '#000';\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#f4f4f4';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.stateBorder = this.stateBorder || '#000';\n this.innerEndBackground = this.primaryBorderColor;\n this.specialStateColor = '#222';\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n\n /* class */\n this.classText = this.primaryTextColor;\n /* journey */\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n // /* pie */\n this.pie1 = this.pie1 || '#F4F4F4';\n this.pie2 = this.pie2 || '#555';\n this.pie3 = this.pie3 || '#BBB';\n this.pie4 = this.pie4 || '#777';\n this.pie5 = this.pie5 || '#999';\n this.pie6 = this.pie6 || '#DDD';\n this.pie7 = this.pie7 || '#FFF';\n this.pie8 = this.pie8 || '#DDD';\n this.pie9 = this.pie9 || '#BBB';\n this.pie10 = this.pie10 || '#999';\n this.pie11 = this.pie11 || '#777';\n this.pie12 = this.pie12 || '#555';\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n // this.pie1 = this.pie1 || '#212529';\n // this.pie2 = this.pie2 || '#343A40';\n // this.pie3 = this.pie3 || '#495057';\n // this.pie4 = this.pie4 || '#6C757D';\n // this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });\n // this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });\n // this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });\n // this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });\n // this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });\n // this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 });\n // this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });\n // this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { sanitizeUrl } from '@braintree/sanitize-url';\nimport {\n curveBasis,\n curveBasisClosed,\n curveBasisOpen,\n curveLinear,\n curveLinearClosed,\n curveMonotoneX,\n curveMonotoneY,\n curveNatural,\n curveStep,\n curveStepAfter,\n curveStepBefore,\n select,\n} from 'd3';\nimport common from './diagrams/common/common';\nimport { configKeys } from './defaultConfig';\nimport { log } from './logger';\n\n// Effectively an enum of the supported curve types, accessible by name\nconst d3CurveTypes = {\n curveBasis: curveBasis,\n curveBasisClosed: curveBasisClosed,\n curveBasisOpen: curveBasisOpen,\n curveLinear: curveLinear,\n curveLinearClosed: curveLinearClosed,\n curveMonotoneX: curveMonotoneX,\n curveMonotoneY: curveMonotoneY,\n curveNatural: curveNatural,\n curveStep: curveStep,\n curveStepAfter: curveStepAfter,\n curveStepBefore: curveStepBefore,\n};\nconst directive =\n /[%]{2}[{]\\s*(?:(?:(\\w+)\\s*:|(\\w+))\\s*(?:(?:(\\w+))|((?:(?![}][%]{2}).|\\r?\\n)*))?\\s*)(?:[}][%]{2})?/gi;\nconst directiveWithoutOpen =\n /\\s*(?:(?:(\\w+)(?=:):|(\\w+))\\s*(?:(?:(\\w+))|((?:(?![}][%]{2}).|\\r?\\n)*))?\\s*)(?:[}][%]{2})?/gi;\nconst anyComment = /\\s*%%.*\\n/gm;\n\n/**\n * @function detectInit Detects the init config object from the text\n *\n * ```mermaid\n * %%{init: {\"theme\": \"debug\", \"logLevel\": 1 }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n *\n * Or\n *\n * ```mermaid\n * %%{initialize: {\"theme\": \"dark\", logLevel: \"debug\" }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n * @param {string} text The text defining the graph\n * @param {any} cnf\n * @returns {object} The json object representing the init passed to mermaid.initialize()\n */\nexport const detectInit = function (text, cnf) {\n let inits = detectDirective(text, /(?:init\\b)|(?:initialize\\b)/);\n let results = {};\n\n if (Array.isArray(inits)) {\n let args = inits.map((init) => init.args);\n directiveSanitizer(args);\n\n results = assignWithDepth(results, [...args]);\n } else {\n results = inits.args;\n }\n if (results) {\n let type = detectType(text, cnf);\n ['config'].forEach((prop) => {\n if (typeof results[prop] !== 'undefined') {\n if (type === 'flowchart-v2') {\n type = 'flowchart';\n }\n results[type] = results[prop];\n delete results[prop];\n }\n });\n }\n\n // Todo: refactor this, these results are never used\n return results;\n};\n\n/**\n * @function detectDirective Detects the directive from the text. Text can be single line or\n * multiline. If type is null or omitted the first directive encountered in text will be returned\n *\n * ```mermaid\n * graph LR\n * %%{somedirective}%%\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n * @param {string} text The text defining the graph\n * @param {string | RegExp} type The directive to return (default: null)\n * @returns {object | Array} An object or Array representing the directive(s): { type: string, args:\n * object|null } matched by the input type if a single directive was found, that directive object\n * will be returned.\n */\nexport const detectDirective = function (text, type = null) {\n try {\n const commentWithoutDirectives = new RegExp(\n `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*\\n`,\n 'ig'\n );\n text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '\"');\n log.debug(\n `Detecting diagram directive${type !== null ? ' type:' + type : ''} based on the text:${text}`\n );\n let match,\n result = [];\n while ((match = directive.exec(text)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (match.index === directive.lastIndex) {\n directive.lastIndex++;\n }\n if (\n (match && !type) ||\n (type && match[1] && match[1].match(type)) ||\n (type && match[2] && match[2].match(type))\n ) {\n let type = match[1] ? match[1] : match[2];\n let args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;\n result.push({ type, args });\n }\n }\n if (result.length === 0) {\n result.push({ type: text, args: null });\n }\n\n return result.length === 1 ? result[0] : result;\n } catch (error) {\n log.error(\n `ERROR: ${error.message} - Unable to parse directive\n ${type !== null ? ' type:' + type : ''} based on the text:${text}`\n );\n return { type: null, args: null };\n }\n};\n\n/**\n * @function detectType Detects the type of the graph text. Takes into consideration the possible\n * existence of an %%init directive\n *\n * ```mermaid\n * %%{initialize: {\"startOnLoad\": true, logLevel: \"fatal\" }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n * @param {string} text The text defining the graph\n * @param {{\n * class: { defaultRenderer: string } | undefined;\n * state: { defaultRenderer: string } | undefined;\n * flowchart: { defaultRenderer: string } | undefined;\n * }} [cnf]\n * @returns {string} A graph definition key\n */\nexport const detectType = function (text, cnf) {\n text = text.replace(directive, '').replace(anyComment, '\\n');\n if (text.match(/^\\s*sequenceDiagram/)) {\n return 'sequence';\n }\n\n if (text.match(/^\\s*gantt/)) {\n return 'gantt';\n }\n if (text.match(/^\\s*classDiagram-v2/)) {\n return 'classDiagram';\n }\n if (text.match(/^\\s*classDiagram/)) {\n if (cnf && cnf.class && cnf.class.defaultRenderer === 'dagre-wrapper') return 'classDiagram';\n return 'class';\n }\n\n if (text.match(/^\\s*stateDiagram-v2/)) {\n return 'stateDiagram';\n }\n\n if (text.match(/^\\s*stateDiagram/)) {\n if (cnf && cnf.class && cnf.state.defaultRenderer === 'dagre-wrapper') return 'stateDiagram';\n return 'state';\n }\n\n if (text.match(/^\\s*gitGraph/)) {\n return 'git';\n }\n if (text.match(/^\\s*flowchart/)) {\n return 'flowchart-v2';\n }\n\n if (text.match(/^\\s*info/)) {\n return 'info';\n }\n if (text.match(/^\\s*pie/)) {\n return 'pie';\n }\n\n if (text.match(/^\\s*erDiagram/)) {\n return 'er';\n }\n\n if (text.match(/^\\s*journey/)) {\n return 'journey';\n }\n\n if (text.match(/^\\s*requirement/) || text.match(/^\\s*requirementDiagram/)) {\n return 'requirement';\n }\n if (cnf && cnf.flowchart && cnf.flowchart.defaultRenderer === 'dagre-wrapper')\n return 'flowchart-v2';\n\n return 'flowchart';\n};\n\n/**\n * Caches results of functions based on input\n *\n * @param {Function} fn Function to run\n * @param {Function} resolver Function that resolves to an ID given arguments the `fn` takes\n * @returns {Function} An optimized caching function\n */\nconst memoize = (fn, resolver) => {\n let cache = {};\n return (...args) => {\n let n = resolver ? resolver.apply(this, args) : args[0];\n if (n in cache) {\n return cache[n];\n } else {\n let result = fn(...args);\n cache[n] = result;\n return result;\n }\n };\n};\n\n/**\n * @function isSubstringInArray Detects whether a substring in present in a given array\n * @param {string} str The substring to detect\n * @param {Array} arr The array to search\n * @returns {number} The array index containing the substring or -1 if not present\n */\nexport const isSubstringInArray = function (str, arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].match(str)) return i;\n }\n return -1;\n};\n\n/**\n * Returns a d3 curve given a curve name\n *\n * @param {string | undefined} interpolate The interpolation name\n * @param {any} defaultCurve The default curve to return\n * @returns {import('d3-shape').CurveFactory} The curve factory to use\n */\nexport const interpolateToCurve = (interpolate, defaultCurve) => {\n if (!interpolate) {\n return defaultCurve;\n }\n const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;\n return d3CurveTypes[curveName] || defaultCurve;\n};\n\n/**\n * Formats a URL string\n *\n * @param {string} linkStr String of the URL\n * @param {{ securityLevel: string }} config Configuration passed to MermaidJS\n * @returns {string | undefined} The formatted URL\n */\nexport const formatUrl = (linkStr, config) => {\n let url = linkStr.trim();\n\n if (url) {\n if (config.securityLevel !== 'loose') {\n return sanitizeUrl(url);\n }\n\n return url;\n }\n};\n\n/**\n * Runs a function\n *\n * @param {string} functionName A dot seperated path to the function relative to the `window`\n * @param {...any} params Parameters to pass to the function\n */\nexport const runFunc = (functionName, ...params) => {\n const arrPaths = functionName.split('.');\n\n const len = arrPaths.length - 1;\n const fnName = arrPaths[len];\n\n let obj = window;\n for (let i = 0; i < len; i++) {\n obj = obj[arrPaths[i]];\n if (!obj) return;\n }\n\n obj[fnName](...params);\n};\n\n/**\n * @typedef {object} Point A (x, y) point\n * @property {number} x The x value\n * @property {number} y The y value\n */\n\n/**\n * Finds the distance between two points using the Distance Formula\n *\n * @param {Point} p1 The first point\n * @param {Point} p2 The second point\n * @returns {number} The distance\n */\nconst distance = (p1, p2) =>\n p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0;\n\n/**\n * @param {Point[]} points List of points\n * @returns {Point}\n * @todo Give this a description\n */\nconst traverseEdge = (points) => {\n let prevPoint;\n let totalDistance = 0;\n\n points.forEach((point) => {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n });\n\n // Traverse half of total distance along points\n let remainingDistance = totalDistance / 2;\n let center = undefined;\n prevPoint = undefined;\n points.forEach((point) => {\n if (prevPoint && !center) {\n const vectorDistance = distance(point, prevPoint);\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n const distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = { x: point.x, y: point.y };\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y,\n };\n }\n }\n }\n prevPoint = point;\n });\n return center;\n};\n\n/**\n * Alias for `traverseEdge`\n *\n * @param {Point[]} points List of points\n * @returns {Point} Return result of `transverseEdge`\n */\nconst calcLabelPosition = (points) => {\n return traverseEdge(points);\n};\n\nconst calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => {\n let prevPoint;\n let totalDistance = 0; // eslint-disable-line\n log.info('our points', points);\n if (points[0] !== initialPosition) {\n points = points.reverse();\n }\n points.forEach((point) => {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n });\n\n // Traverse only 25 total distance along points to find cardinality point\n const distanceToCardinalityPoint = 25;\n\n let remainingDistance = distanceToCardinalityPoint;\n let center;\n prevPoint = undefined;\n points.forEach((point) => {\n if (prevPoint && !center) {\n const vectorDistance = distance(point, prevPoint);\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n const distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = { x: point.x, y: point.y };\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y,\n };\n }\n }\n }\n prevPoint = point;\n });\n // if relation is present (Arrows will be added), change cardinality point off-set distance (d)\n let d = isRelationTypePresent ? 10 : 5;\n //Calculate Angle for x and y axis\n let angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);\n let cardinalityPosition = { x: 0, y: 0 };\n //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance\n cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;\n cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;\n return cardinalityPosition;\n};\n\n/**\n * Position ['start_left', 'start_right', 'end_left', 'end_right']\n *\n * @param {any} terminalMarkerSize\n * @param {any} position\n * @param {any} _points\n * @returns {any}\n */\nconst calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => {\n // Todo looking to faster cloning method\n let points = JSON.parse(JSON.stringify(_points));\n let prevPoint;\n let totalDistance = 0; // eslint-disable-line\n log.info('our points', points);\n if (position !== 'start_left' && position !== 'start_right') {\n points = points.reverse();\n }\n\n points.forEach((point) => {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n });\n\n // Traverse only 25 total distance along points to find cardinality point\n const distanceToCardinalityPoint = 25 + terminalMarkerSize;\n\n let remainingDistance = distanceToCardinalityPoint;\n let center;\n prevPoint = undefined;\n points.forEach((point) => {\n if (prevPoint && !center) {\n const vectorDistance = distance(point, prevPoint);\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n const distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = { x: point.x, y: point.y };\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y,\n };\n }\n }\n }\n prevPoint = point;\n });\n // if relation is present (Arrows will be added), change cardinality point off-set distance (d)\n let d = 10 + terminalMarkerSize * 0.5;\n //Calculate Angle for x and y axis\n let angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);\n\n let cardinalityPosition = { x: 0, y: 0 };\n\n //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance\n\n cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;\n cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;\n if (position === 'start_left') {\n cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2;\n cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2;\n }\n if (position === 'end_right') {\n cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5;\n cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5;\n }\n if (position === 'end_left') {\n cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5;\n cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5;\n }\n return cardinalityPosition;\n};\n\n/**\n * Gets styles from an array of declarations\n *\n * @param {string[]} arr Declarations\n * @returns {{ style: string; labelStyle: string }} The styles grouped as strings\n */\nexport const getStylesFromArray = (arr) => {\n let style = '';\n let labelStyle = '';\n\n for (let i = 0; i < arr.length; i++) {\n if (typeof arr[i] !== 'undefined') {\n // add text properties to label style definition\n if (arr[i].startsWith('color:') || arr[i].startsWith('text-align:')) {\n labelStyle = labelStyle + arr[i] + ';';\n } else {\n style = style + arr[i] + ';';\n }\n }\n }\n\n return { style: style, labelStyle: labelStyle };\n};\n\nlet cnt = 0;\nexport const generateId = () => {\n cnt++;\n return 'id-' + Math.random().toString(36).substr(2, 12) + '-' + cnt;\n};\n\n/**\n * @param {any} length\n * @returns {any}\n */\nfunction makeid(length) {\n var result = '';\n var characters = '0123456789abcdef';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}\n\nexport const random = (options) => {\n return makeid(options.length);\n};\n\n/**\n * @function assignWithDepth Extends the functionality of {@link ObjectConstructor.assign} with the\n * ability to merge arbitrary-depth objects For each key in src with path `k` (recursively)\n * performs an Object.assign(dst[`k`], src[`k`]) with a slight change from the typical handling of\n * undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to {} and\n * effectively merged with src[`k`]<p> Additionally, dissimilar types will not clobber unless the\n * config.clobber parameter === true. Example:\n *\n * ```js\n * let config_0 = { foo: { bar: 'bar' }, bar: 'foo' };\n * let config_1 = { foo: 'foo', bar: 'bar' };\n * let result = assignWithDepth(config_0, config_1);\n * console.log(result);\n * //-> result: { foo: { bar: 'bar' }, bar: 'bar' }\n * ```\n *\n * Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. If src is a\n * destructured array of objects and dst is not an array, assignWithDepth will apply each element\n * of src to dst in order.\n * @param dst\n * @param src\n * @param config\n * @param dst\n * @param src\n * @param config\n * @param dst\n * @param src\n * @param config\n * @param {any} dst - The destination of the merge\n * @param {any} src - The source object(s) to merge into destination\n * @param {{ depth: number; clobber: boolean }} [config={ depth: 2, clobber: false }] - Depth: depth\n * to traverse within src and dst for merging - clobber: should dissimilar types clobber (default:\n * { depth: 2, clobber: false }). Default is `{ depth: 2, clobber: false }`\n * @returns {any}\n */\nexport const assignWithDepth = function (dst, src, config) {\n const { depth, clobber } = Object.assign({ depth: 2, clobber: false }, config);\n if (Array.isArray(src) && !Array.isArray(dst)) {\n src.forEach((s) => assignWithDepth(dst, s, config));\n return dst;\n } else if (Array.isArray(src) && Array.isArray(dst)) {\n src.forEach((s) => {\n if (dst.indexOf(s) === -1) {\n dst.push(s);\n }\n });\n return dst;\n }\n if (typeof dst === 'undefined' || depth <= 0) {\n if (dst !== undefined && dst !== null && typeof dst === 'object' && typeof src === 'object') {\n return Object.assign(dst, src);\n } else {\n return src;\n }\n }\n if (typeof src !== 'undefined' && typeof dst === 'object' && typeof src === 'object') {\n Object.keys(src).forEach((key) => {\n if (\n typeof src[key] === 'object' &&\n (dst[key] === undefined || typeof dst[key] === 'object')\n ) {\n if (dst[key] === undefined) {\n dst[key] = Array.isArray(src[key]) ? [] : {};\n }\n dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber });\n } else if (clobber || (typeof dst[key] !== 'object' && typeof src[key] !== 'object')) {\n dst[key] = src[key];\n }\n });\n }\n return dst;\n};\n\nexport const getTextObj = function () {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n anchor: 'start',\n style: '#666',\n width: 100,\n height: 100,\n textMargin: 0,\n rx: 0,\n ry: 0,\n valign: undefined,\n };\n};\n\n/**\n * Adds text to an element\n *\n * @param {SVGElement} elem Element to add text to\n * @param {{\n * text: string;\n * x: number;\n * y: number;\n * anchor: 'start' | 'middle' | 'end';\n * fontFamily: string;\n * fontSize: string | number;\n * fontWeight: string | number;\n * fill: string;\n * class: string | undefined;\n * textMargin: number;\n * }} textData\n * @returns {SVGTextElement} Text element with given styling and content\n */\nexport const drawSimpleText = function (elem, textData) {\n // Remove and ignore br:s\n const nText = textData.text.replace(common.lineBreakRegex, ' ');\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.style('text-anchor', textData.anchor);\n textElem.style('font-family', textData.fontFamily);\n textElem.style('font-size', textData.fontSize);\n textElem.style('font-weight', textData.fontWeight);\n textElem.attr('fill', textData.fill);\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n\n const span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.attr('fill', textData.fill);\n span.text(nText);\n\n return textElem;\n};\n\nexport const wrapLabel = memoize(\n (label, maxWidth, config) => {\n if (!label) {\n return label;\n }\n config = Object.assign(\n { fontSize: 12, fontWeight: 400, fontFamily: 'Arial', joinWith: '<br/>' },\n config\n );\n if (common.lineBreakRegex.test(label)) {\n return label;\n }\n const words = label.split(' ');\n const completedLines = [];\n let nextLine = '';\n words.forEach((word, index) => {\n const wordLength = calculateTextWidth(`${word} `, config);\n const nextLineLength = calculateTextWidth(nextLine, config);\n if (wordLength > maxWidth) {\n const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, '-', config);\n completedLines.push(nextLine, ...hyphenatedStrings);\n nextLine = remainingWord;\n } else if (nextLineLength + wordLength >= maxWidth) {\n completedLines.push(nextLine);\n nextLine = word;\n } else {\n nextLine = [nextLine, word].filter(Boolean).join(' ');\n }\n const currentWord = index + 1;\n const isLastWord = currentWord === words.length;\n if (isLastWord) {\n completedLines.push(nextLine);\n }\n });\n return completedLines.filter((line) => line !== '').join(config.joinWith);\n },\n (label, maxWidth, config) =>\n `${label}-${maxWidth}-${config.fontSize}-${config.fontWeight}-${config.fontFamily}-${config.joinWith}`\n);\n\nconst breakString = memoize(\n (word, maxWidth, hyphenCharacter = '-', config) => {\n config = Object.assign(\n { fontSize: 12, fontWeight: 400, fontFamily: 'Arial', margin: 0 },\n config\n );\n const characters = word.split('');\n const lines = [];\n let currentLine = '';\n characters.forEach((character, index) => {\n const nextLine = `${currentLine}${character}`;\n const lineWidth = calculateTextWidth(nextLine, config);\n if (lineWidth >= maxWidth) {\n const currentCharacter = index + 1;\n const isLastLine = characters.length === currentCharacter;\n const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;\n lines.push(isLastLine ? nextLine : hyphenatedNextLine);\n currentLine = '';\n } else {\n currentLine = nextLine;\n }\n });\n return { hyphenatedStrings: lines, remainingWord: currentLine };\n },\n (word, maxWidth, hyphenCharacter = '-', config) =>\n `${word}-${maxWidth}-${hyphenCharacter}-${config.fontSize}-${config.fontWeight}-${config.fontFamily}`\n);\n\n/**\n * This calculates the text's height, taking into account the wrap breaks and both the statically\n * configured height, width, and the length of the text (in pixels).\n *\n * If the wrapped text text has greater height, we extend the height, so it's value won't overflow.\n *\n * @param {any} text The text to measure\n * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size\n * @returns {any} - The height for the given text\n */\nexport const calculateTextHeight = function (text, config) {\n config = Object.assign(\n { fontSize: 12, fontWeight: 400, fontFamily: 'Arial', margin: 15 },\n config\n );\n return calculateTextDimensions(text, config).height;\n};\n\n/**\n * This calculates the width of the given text, font size and family.\n *\n * @param {any} text - The text to calculate the width of\n * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size\n * @returns {any} - The width for the given text\n */\nexport const calculateTextWidth = function (text, config) {\n config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config);\n return calculateTextDimensions(text, config).width;\n};\n\n/**\n * This calculates the dimensions of the given text, font size, font family, font weight, and margins.\n *\n * @param {any} text - The text to calculate the width of\n * @param {any} config - The config for fontSize, fontFamily, fontWeight, and margin all impacting\n * the resulting size\n * @returns - The width for the given text\n */\nexport const calculateTextDimensions = memoize(\n function (text, config) {\n config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config);\n const { fontSize, fontFamily, fontWeight } = config;\n if (!text) {\n return { width: 0, height: 0 };\n }\n\n // We can't really know if the user supplied font family will render on the user agent;\n // thus, we'll take the max width between the user supplied font family, and a default\n // of sans-serif.\n const fontFamilies = ['sans-serif', fontFamily];\n const lines = text.split(common.lineBreakRegex);\n let dims = [];\n\n const body = select('body');\n // We don't want to leak DOM elements - if a removal operation isn't available\n // for any reason, do not continue.\n if (!body.remove) {\n return { width: 0, height: 0, lineHeight: 0 };\n }\n\n const g = body.append('svg');\n\n for (let fontFamily of fontFamilies) {\n let cheight = 0;\n let dim = { width: 0, height: 0, lineHeight: 0 };\n for (let line of lines) {\n const textObj = getTextObj();\n textObj.text = line;\n const textElem = drawSimpleText(g, textObj)\n .style('font-size', fontSize)\n .style('font-weight', fontWeight)\n .style('font-family', fontFamily);\n\n let bBox = (textElem._groups || textElem)[0][0].getBBox();\n dim.width = Math.round(Math.max(dim.width, bBox.width));\n cheight = Math.round(bBox.height);\n dim.height += cheight;\n dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight));\n }\n dims.push(dim);\n }\n\n g.remove();\n\n let index =\n isNaN(dims[1].height) ||\n isNaN(dims[1].width) ||\n isNaN(dims[1].lineHeight) ||\n (dims[0].height > dims[1].height &&\n dims[0].width > dims[1].width &&\n dims[0].lineHeight > dims[1].lineHeight)\n ? 0\n : 1;\n return dims[index];\n },\n (text, config) => `${text}-${config.fontSize}-${config.fontWeight}-${config.fontFamily}`\n);\n\n/**\n * Applys d3 attributes\n *\n * @param {any} d3Elem D3 Element to apply the attributes onto\n * @param {[string, string][]} attrs Object.keys equivalent format of key to value mapping of attributes\n */\nconst d3Attrs = function (d3Elem, attrs) {\n for (let attr of attrs) {\n d3Elem.attr(attr[0], attr[1]);\n }\n};\n\n/**\n * Gives attributes for an SVG's size given arguments\n *\n * @param {number} height The height of the SVG\n * @param {number} width The width of the SVG\n * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100%\n * @returns {Map<'height' | 'width' | 'style', string>} Attributes for the SVG\n */\nexport const calculateSvgSizeAttrs = function (height, width, useMaxWidth) {\n let attrs = new Map();\n attrs.set('height', height);\n if (useMaxWidth) {\n attrs.set('width', '100%');\n attrs.set('style', `max-width: ${width}px;`);\n } else {\n attrs.set('width', width);\n }\n return attrs;\n};\n\n/**\n * Applies attributes from `calculateSvgSizeAttrs`\n *\n * @param {SVGSVGElement} svgElem The SVG Element to configure\n * @param {number} height The height of the SVG\n * @param {number} width The width of the SVG\n * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100%\n */\nexport const configureSvgSize = function (svgElem, height, width, useMaxWidth) {\n const attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);\n d3Attrs(svgElem, attrs);\n};\n\nexport const initIdGeneratior = class iterator {\n constructor(deterministic, seed) {\n this.deterministic = deterministic;\n this.seed = seed;\n\n this.count = seed ? seed.length : 0;\n }\n\n next() {\n if (!this.deterministic) return Date.now();\n\n return this.count++;\n }\n};\n\nlet decoder;\n\n/**\n * Decodes HTML, source: {@link https://github.com/shrpne/entity-decode/blob/v2.0.1/browser.js}\n *\n * @param {string} html HTML as a string\n * @returns Unescaped HTML\n */\nexport const entityDecode = function (html) {\n decoder = decoder || document.createElement('div');\n // Escape HTML before decoding for HTML Entities\n html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';');\n // decoding\n decoder.innerHTML = html;\n return unescape(decoder.textContent);\n};\n\n/**\n * Sanitizes directive objects\n *\n * @param {object} args Directive's JSON\n */\nexport const directiveSanitizer = (args) => {\n log.debug('directiveSanitizer called with', args);\n if (typeof args === 'object') {\n // check for array\n if (args.length) {\n args.forEach((arg) => directiveSanitizer(arg));\n } else {\n // This is an object\n Object.keys(args).forEach((key) => {\n log.debug('Checking key', key);\n if (key.indexOf('__') === 0) {\n log.debug('sanitize deleting __ option', key);\n delete args[key];\n }\n\n if (key.indexOf('proto') >= 0) {\n log.debug('sanitize deleting proto option', key);\n delete args[key];\n }\n\n if (key.indexOf('constr') >= 0) {\n log.debug('sanitize deleting constr option', key);\n delete args[key];\n }\n if (configKeys.indexOf(key) < 0) {\n log.debug('sanitize deleting option', key);\n delete args[key];\n } else {\n if (typeof args[key] === 'object') {\n log.debug('sanitize deleting object', key);\n directiveSanitizer(args[key]);\n }\n }\n });\n }\n }\n};\n\nexport default {\n assignWithDepth,\n wrapLabel,\n calculateTextHeight,\n calculateTextWidth,\n calculateTextDimensions,\n calculateSvgSizeAttrs,\n configureSvgSize,\n detectInit,\n detectDirective,\n detectType,\n isSubstringInArray,\n interpolateToCurve,\n calcLabelPosition,\n calcCardinalityPosition,\n calcTerminalLabelPosition,\n formatUrl,\n getStylesFromArray,\n generateId,\n random,\n memoize,\n runFunc,\n entityDecode,\n initIdGeneratior,\n directiveSanitizer,\n};\n","// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n// transplited with Babel\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n var dir = pathObject.dir || pathObject.root;\n var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\n\nvar posix = {\n // path.resolve([from ...], to)\n resolve: function resolve() {\n var resolvedPath = '';\n var resolvedAbsolute = false;\n var cwd;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path;\n if (i >= 0)\n path = arguments[i];\n else {\n if (cwd === undefined)\n cwd = process.cwd();\n path = cwd;\n }\n\n assertPath(path);\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0)\n return '/' + resolvedPath;\n else\n return '/';\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return '.';\n }\n },\n\n normalize: function normalize(path) {\n assertPath(path);\n\n if (path.length === 0) return '.';\n\n var isAbsolute = path.charCodeAt(0) === 47 /*/*/;\n var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;\n\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n\n if (path.length === 0 && !isAbsolute) path = '.';\n if (path.length > 0 && trailingSeparator) path += '/';\n\n if (isAbsolute) return '/' + path;\n return path;\n },\n\n isAbsolute: function isAbsolute(path) {\n assertPath(path);\n return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n },\n\n join: function join() {\n if (arguments.length === 0)\n return '.';\n var joined;\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n joined = arg;\n else\n joined += '/' + arg;\n }\n }\n if (joined === undefined)\n return '.';\n return posix.normalize(joined);\n },\n\n relative: function relative(from, to) {\n assertPath(from);\n assertPath(to);\n\n if (from === to) return '';\n\n from = posix.resolve(from);\n to = posix.resolve(to);\n\n if (from === to) return '';\n\n // Trim any leading backslashes\n var fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/)\n break;\n }\n var fromEnd = from.length;\n var fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n var toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/)\n break;\n }\n var toEnd = to.length;\n var toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === 47 /*/*/)\n lastCommonSep = i;\n }\n\n var out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0)\n out += '..';\n else\n out += '/..';\n }\n }\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0)\n return out + to.slice(toStart + lastCommonSep);\n else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/)\n ++toStart;\n return to.slice(toStart);\n }\n },\n\n _makeLong: function _makeLong(path) {\n return path;\n },\n\n dirname: function dirname(path) {\n assertPath(path);\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) return '//';\n return path.slice(0, end);\n },\n\n basename: function basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string');\n assertPath(path);\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return '';\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n }\n },\n\n extname: function extname(path) {\n assertPath(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject);\n }\n return _format('/', pathObject);\n },\n\n parse: function parse(path) {\n assertPath(path);\n\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) return ret;\n var code = path.charCodeAt(0);\n var isAbsolute = code === 47 /*/*/;\n var start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n } else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';\n\n return ret;\n },\n\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\n\nposix.posix = posix;\n\nmodule.exports = posix;\n","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,6],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,12],$V5=[1,11],$V6=[1,15,24],$V7=[1,19],$V8=[1,31],$V9=[1,34],$Va=[1,32],$Vb=[1,33],$Vc=[1,35],$Vd=[1,36],$Ve=[1,37],$Vf=[1,38],$Vg=[1,41],$Vh=[1,42],$Vi=[1,43],$Vj=[1,44],$Vk=[15,24],$Vl=[1,56],$Vm=[1,57],$Vn=[1,58],$Vo=[1,59],$Vp=[1,60],$Vq=[1,61],$Vr=[15,24,31,38,39,47,50,51,52,53,54,55,60,62],$Vs=[15,24,29,31,38,39,43,47,50,51,52,53,54,55,60,62,77,78,79,80],$Vt=[7,8,9,10,15,18,22,24],$Vu=[47,77,78,79,80],$Vv=[47,54,55,77,78,79,80],$Vw=[47,50,51,52,53,77,78,79,80],$Vx=[15,24,31],$Vy=[1,93];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"mermaidDoc\":4,\"direction\":5,\"directive\":6,\"direction_tb\":7,\"direction_bt\":8,\"direction_rl\":9,\"direction_lr\":10,\"graphConfig\":11,\"openDirective\":12,\"typeDirective\":13,\"closeDirective\":14,\"NEWLINE\":15,\":\":16,\"argDirective\":17,\"open_directive\":18,\"type_directive\":19,\"arg_directive\":20,\"close_directive\":21,\"CLASS_DIAGRAM\":22,\"statements\":23,\"EOF\":24,\"statement\":25,\"className\":26,\"alphaNumToken\":27,\"classLiteralName\":28,\"GENERICTYPE\":29,\"relationStatement\":30,\"LABEL\":31,\"classStatement\":32,\"methodStatement\":33,\"annotationStatement\":34,\"clickStatement\":35,\"cssClassStatement\":36,\"CLASS\":37,\"STYLE_SEPARATOR\":38,\"STRUCT_START\":39,\"members\":40,\"STRUCT_STOP\":41,\"ANNOTATION_START\":42,\"ANNOTATION_END\":43,\"MEMBER\":44,\"SEPARATOR\":45,\"relation\":46,\"STR\":47,\"relationType\":48,\"lineType\":49,\"AGGREGATION\":50,\"EXTENSION\":51,\"COMPOSITION\":52,\"DEPENDENCY\":53,\"LINE\":54,\"DOTTED_LINE\":55,\"CALLBACK\":56,\"LINK\":57,\"LINK_TARGET\":58,\"CLICK\":59,\"CALLBACK_NAME\":60,\"CALLBACK_ARGS\":61,\"HREF\":62,\"CSSCLASS\":63,\"commentToken\":64,\"textToken\":65,\"graphCodeTokens\":66,\"textNoTagsToken\":67,\"TAGSTART\":68,\"TAGEND\":69,\"==\":70,\"--\":71,\"PCT\":72,\"DEFAULT\":73,\"SPACE\":74,\"MINUS\":75,\"keywords\":76,\"UNICODE_TEXT\":77,\"NUM\":78,\"ALPHA\":79,\"BQUOTE_STR\":80,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",7:\"direction_tb\",8:\"direction_bt\",9:\"direction_rl\",10:\"direction_lr\",15:\"NEWLINE\",16:\":\",18:\"open_directive\",19:\"type_directive\",20:\"arg_directive\",21:\"close_directive\",22:\"CLASS_DIAGRAM\",24:\"EOF\",29:\"GENERICTYPE\",31:\"LABEL\",37:\"CLASS\",38:\"STYLE_SEPARATOR\",39:\"STRUCT_START\",41:\"STRUCT_STOP\",42:\"ANNOTATION_START\",43:\"ANNOTATION_END\",44:\"MEMBER\",45:\"SEPARATOR\",47:\"STR\",50:\"AGGREGATION\",51:\"EXTENSION\",52:\"COMPOSITION\",53:\"DEPENDENCY\",54:\"LINE\",55:\"DOTTED_LINE\",56:\"CALLBACK\",57:\"LINK\",58:\"LINK_TARGET\",59:\"CLICK\",60:\"CALLBACK_NAME\",61:\"CALLBACK_ARGS\",62:\"HREF\",63:\"CSSCLASS\",66:\"graphCodeTokens\",68:\"TAGSTART\",69:\"TAGEND\",70:\"==\",71:\"--\",72:\"PCT\",73:\"DEFAULT\",74:\"SPACE\",75:\"MINUS\",76:\"keywords\",77:\"UNICODE_TEXT\",78:\"NUM\",79:\"ALPHA\",80:\"BQUOTE_STR\"},\nproductions_: [0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[23,1],[23,2],[23,3],[26,1],[26,1],[26,2],[26,2],[26,2],[25,1],[25,2],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[32,2],[32,4],[32,5],[32,7],[34,4],[40,1],[40,2],[33,1],[33,2],[33,1],[33,1],[30,3],[30,4],[30,4],[30,5],[46,3],[46,2],[46,2],[46,1],[48,1],[48,1],[48,1],[48,1],[49,1],[49,1],[35,3],[35,4],[35,3],[35,4],[35,4],[35,5],[35,3],[35,4],[35,4],[35,5],[35,3],[35,4],[35,4],[35,5],[36,3],[64,1],[64,1],[65,1],[65,1],[65,1],[65,1],[65,1],[65,1],[65,1],[67,1],[67,1],[67,1],[67,1],[27,1],[27,1],[27,1],[28,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\n yy.setDirection('TB');\nbreak;\ncase 5:\n yy.setDirection('BT');\nbreak;\ncase 6:\n yy.setDirection('RL');\nbreak;\ncase 7:\n yy.setDirection('LR');\nbreak;\ncase 11:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 12:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 13:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 14:\n yy.parseDirective('}%%', 'close_directive', 'class'); \nbreak;\ncase 19: case 20:\n this.$=$$[$0]; \nbreak;\ncase 21:\n this.$=$$[$0-1]+$$[$0]; \nbreak;\ncase 22: case 23:\n this.$=$$[$0-1]+'~'+$$[$0]; \nbreak;\ncase 24:\n yy.addRelation($$[$0]); \nbreak;\ncase 25:\n $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]); \nbreak;\ncase 33:\nyy.addClass($$[$0]);\nbreak;\ncase 34:\nyy.addClass($$[$0-2]);yy.setCssClass($$[$0-2], $$[$0]);\nbreak;\ncase 35:\n/*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]);\nbreak;\ncase 36:\nyy.addClass($$[$0-5]);yy.setCssClass($$[$0-5], $$[$0-3]);yy.addMembers($$[$0-5],$$[$0-1]);\nbreak;\ncase 37:\n yy.addAnnotation($$[$0],$$[$0-2]); \nbreak;\ncase 38:\n this.$ = [$$[$0]]; \nbreak;\ncase 39:\n $$[$0].push($$[$0-1]);this.$=$$[$0];\nbreak;\ncase 40:\n/*console.log('Rel found',$$[$0]);*/\nbreak;\ncase 41:\nyy.addMember($$[$0-1],yy.cleanupLabel($$[$0]));\nbreak;\ncase 42:\n/*console.warn('Member',$$[$0]);*/\nbreak;\ncase 43:\n/*console.log('sep found',$$[$0]);*/\nbreak;\ncase 44:\n this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'}; \nbreak;\ncase 45:\n this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'}\nbreak;\ncase 46:\n this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]}; \nbreak;\ncase 47:\n this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]} \nbreak;\ncase 48:\n this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]}; \nbreak;\ncase 49:\n this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]}; \nbreak;\ncase 50:\n this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]}; \nbreak;\ncase 51:\n this.$={type1:'none',type2:'none',lineType:$$[$0]}; \nbreak;\ncase 52:\n this.$=yy.relationType.AGGREGATION;\nbreak;\ncase 53:\n this.$=yy.relationType.EXTENSION;\nbreak;\ncase 54:\n this.$=yy.relationType.COMPOSITION;\nbreak;\ncase 55:\n this.$=yy.relationType.DEPENDENCY;\nbreak;\ncase 56:\nthis.$=yy.lineType.LINE;\nbreak;\ncase 57:\nthis.$=yy.lineType.DOTTED_LINE;\nbreak;\ncase 58: case 64:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0]);\nbreak;\ncase 59: case 65:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]);\nbreak;\ncase 60: case 68:\nthis.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0]);\nbreak;\ncase 61:\nthis.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1],$$[$0]);\nbreak;\ncase 62: case 70:\nthis.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]);\nbreak;\ncase 63: case 71:\nthis.$ = $$[$0-4];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);yy.setTooltip($$[$0-3], $$[$0-1]);\nbreak;\ncase 66:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 67:\nthis.$ = $$[$0-4];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-3], $$[$0]);\nbreak;\ncase 69:\nthis.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 72:\nyy.setCssClass($$[$0-1], $$[$0]);\nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5},{1:[3]},{1:[2,1]},{1:[2,2]},{3:13,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5},{1:[2,8]},o($V6,[2,4]),o($V6,[2,5]),o($V6,[2,6]),o($V6,[2,7]),{13:14,19:[1,15]},{15:[1,16]},{19:[2,11]},{1:[2,3]},{14:17,16:[1,18],21:$V7},o([16,21],[2,12]),{5:29,6:28,7:$V0,8:$V1,9:$V2,10:$V3,12:10,18:$V4,23:20,25:21,26:30,27:39,28:40,30:22,32:23,33:24,34:25,35:26,36:27,37:$V8,42:$V9,44:$Va,45:$Vb,56:$Vc,57:$Vd,59:$Ve,63:$Vf,77:$Vg,78:$Vh,79:$Vi,80:$Vj},{15:[1,45]},{17:46,20:[1,47]},{15:[2,14]},{24:[1,48]},{15:[1,49],24:[2,16]},o($Vk,[2,24],{31:[1,50]}),o($Vk,[2,26]),o($Vk,[2,27]),o($Vk,[2,28]),o($Vk,[2,29]),o($Vk,[2,30]),o($Vk,[2,31]),o($Vk,[2,32]),o($Vk,[2,40],{46:51,48:54,49:55,31:[1,53],47:[1,52],50:$Vl,51:$Vm,52:$Vn,53:$Vo,54:$Vp,55:$Vq}),{26:62,27:39,28:40,77:$Vg,78:$Vh,79:$Vi,80:$Vj},o($Vk,[2,42]),o($Vk,[2,43]),{27:63,77:$Vg,78:$Vh,79:$Vi},{26:64,27:39,28:40,77:$Vg,78:$Vh,79:$Vi,80:$Vj},{26:65,27:39,28:40,77:$Vg,78:$Vh,79:$Vi,80:$Vj},{26:66,27:39,28:40,77:$Vg,78:$Vh,79:$Vi,80:$Vj},{47:[1,67]},o($Vr,[2,19],{27:39,28:40,26:68,29:[1,69],77:$Vg,78:$Vh,79:$Vi,80:$Vj}),o($Vr,[2,20],{29:[1,70]}),o($Vs,[2,86]),o($Vs,[2,87]),o($Vs,[2,88]),o([15,24,29,31,38,39,47,50,51,52,53,54,55,60,62],[2,89]),o($Vt,[2,9]),{14:71,21:$V7},{21:[2,13]},{1:[2,15]},{5:29,6:28,7:$V0,8:$V1,9:$V2,10:$V3,12:10,18:$V4,23:72,24:[2,17],25:21,26:30,27:39,28:40,30:22,32:23,33:24,34:25,35:26,36:27,37:$V8,42:$V9,44:$Va,45:$Vb,56:$Vc,57:$Vd,59:$Ve,63:$Vf,77:$Vg,78:$Vh,79:$Vi,80:$Vj},o($Vk,[2,25]),{26:73,27:39,28:40,47:[1,74],77:$Vg,78:$Vh,79:$Vi,80:$Vj},{46:75,48:54,49:55,50:$Vl,51:$Vm,52:$Vn,53:$Vo,54:$Vp,55:$Vq},o($Vk,[2,41]),{49:76,54:$Vp,55:$Vq},o($Vu,[2,51],{48:77,50:$Vl,51:$Vm,52:$Vn,53:$Vo}),o($Vv,[2,52]),o($Vv,[2,53]),o($Vv,[2,54]),o($Vv,[2,55]),o($Vw,[2,56]),o($Vw,[2,57]),o($Vk,[2,33],{38:[1,78],39:[1,79]}),{43:[1,80]},{47:[1,81]},{47:[1,82]},{60:[1,83],62:[1,84]},{27:85,77:$Vg,78:$Vh,79:$Vi},o($Vr,[2,21]),o($Vr,[2,22]),o($Vr,[2,23]),{15:[1,86]},{24:[2,18]},o($Vx,[2,44]),{26:87,27:39,28:40,77:$Vg,78:$Vh,79:$Vi,80:$Vj},{26:88,27:39,28:40,47:[1,89],77:$Vg,78:$Vh,79:$Vi,80:$Vj},o($Vu,[2,50],{48:90,50:$Vl,51:$Vm,52:$Vn,53:$Vo}),o($Vu,[2,49]),{27:91,77:$Vg,78:$Vh,79:$Vi},{40:92,44:$Vy},{26:94,27:39,28:40,77:$Vg,78:$Vh,79:$Vi,80:$Vj},o($Vk,[2,58],{47:[1,95]}),o($Vk,[2,60],{47:[1,97],58:[1,96]}),o($Vk,[2,64],{47:[1,98],61:[1,99]}),o($Vk,[2,68],{47:[1,101],58:[1,100]}),o($Vk,[2,72]),o($Vt,[2,10]),o($Vx,[2,46]),o($Vx,[2,45]),{26:102,27:39,28:40,77:$Vg,78:$Vh,79:$Vi,80:$Vj},o($Vu,[2,48]),o($Vk,[2,34],{39:[1,103]}),{41:[1,104]},{40:105,41:[2,38],44:$Vy},o($Vk,[2,37]),o($Vk,[2,59]),o($Vk,[2,61]),o($Vk,[2,62],{58:[1,106]}),o($Vk,[2,65]),o($Vk,[2,66],{47:[1,107]}),o($Vk,[2,69]),o($Vk,[2,70],{58:[1,108]}),o($Vx,[2,47]),{40:109,44:$Vy},o($Vk,[2,35]),{41:[2,39]},o($Vk,[2,63]),o($Vk,[2,67]),o($Vk,[2,71]),{41:[1,110]},o($Vk,[2,36])],\ndefaultActions: {2:[2,1],3:[2,2],5:[2,8],12:[2,11],13:[2,3],19:[2,14],47:[2,13],48:[2,15],72:[2,18],105:[2,39]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 18; \nbreak;\ncase 1:return 7;\nbreak;\ncase 2:return 8;\nbreak;\ncase 3:return 9;\nbreak;\ncase 4:return 10;\nbreak;\ncase 5: this.begin('type_directive'); return 19; \nbreak;\ncase 6: this.popState(); this.begin('arg_directive'); return 16; \nbreak;\ncase 7: this.popState(); this.popState(); return 21; \nbreak;\ncase 8:return 20;\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:/* skip comments */\nbreak;\ncase 11:return 15;\nbreak;\ncase 12:/* skip whitespace */\nbreak;\ncase 13:return 22;\nbreak;\ncase 14:return 22;\nbreak;\ncase 15: this.begin(\"struct\"); /*console.log('Starting struct');*/ return 39;\nbreak;\ncase 16:return \"EOF_IN_STRUCT\";\nbreak;\ncase 17:return \"OPEN_IN_STRUCT\";\nbreak;\ncase 18: /*console.log('Ending struct');*/this.popState(); return 41;\nbreak;\ncase 19:/* nothing */\nbreak;\ncase 20: /*console.log('lex-member: ' + yy_.yytext);*/ return \"MEMBER\";\nbreak;\ncase 21:return 37;\nbreak;\ncase 22:return 63;\nbreak;\ncase 23:return 56;\nbreak;\ncase 24:return 57;\nbreak;\ncase 25:return 59;\nbreak;\ncase 26:return 42;\nbreak;\ncase 27:return 43;\nbreak;\ncase 28:this.begin(\"generic\");\nbreak;\ncase 29:this.popState();\nbreak;\ncase 30:return \"GENERICTYPE\";\nbreak;\ncase 31:this.begin(\"string\");\nbreak;\ncase 32:this.popState();\nbreak;\ncase 33:return \"STR\";\nbreak;\ncase 34:this.begin(\"bqstring\");\nbreak;\ncase 35:this.popState();\nbreak;\ncase 36:return \"BQUOTE_STR\";\nbreak;\ncase 37:this.begin(\"href\");\nbreak;\ncase 38:this.popState();\nbreak;\ncase 39:return 62;\nbreak;\ncase 40:this.begin(\"callback_name\");\nbreak;\ncase 41:this.popState();\nbreak;\ncase 42:this.popState(); this.begin(\"callback_args\");\nbreak;\ncase 43:return 60;\nbreak;\ncase 44:this.popState();\nbreak;\ncase 45:return 61;\nbreak;\ncase 46:return 58;\nbreak;\ncase 47:return 58;\nbreak;\ncase 48:return 58;\nbreak;\ncase 49:return 58;\nbreak;\ncase 50:return 51;\nbreak;\ncase 51:return 51;\nbreak;\ncase 52:return 53;\nbreak;\ncase 53:return 53;\nbreak;\ncase 54:return 52;\nbreak;\ncase 55:return 50;\nbreak;\ncase 56:return 54;\nbreak;\ncase 57:return 55;\nbreak;\ncase 58:return 31;\nbreak;\ncase 59:return 38;\nbreak;\ncase 60:return 75;\nbreak;\ncase 61:return 'DOT';\nbreak;\ncase 62:return 'PLUS';\nbreak;\ncase 63:return 72;\nbreak;\ncase 64:return 'EQUALS';\nbreak;\ncase 65:return 'EQUALS';\nbreak;\ncase 66:return 79;\nbreak;\ncase 67:return 'PUNCTUATION';\nbreak;\ncase 68:return 78;\nbreak;\ncase 69:return 77;\nbreak;\ncase 70:return 74;\nbreak;\ncase 71:return 24;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/,/^(?:.*direction\\s+TB[^\\n]*)/,/^(?:.*direction\\s+BT[^\\n]*)/,/^(?:.*direction\\s+RL[^\\n]*)/,/^(?:.*direction\\s+LR[^\\n]*)/,/^(?:((?:(?!\\}%%)[^:.])*))/,/^(?::)/,/^(?:\\}%%)/,/^(?:((?:(?!\\}%%).|\\n)*))/,/^(?:%%(?!\\{)*[^\\n]*(\\r?\\n?)+)/,/^(?:%%[^\\n]*(\\r?\\n)*)/,/^(?:\\s*(\\r?\\n)+)/,/^(?:\\s+)/,/^(?:classDiagram-v2\\b)/,/^(?:classDiagram\\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\\n])/,/^(?:[^{}\\n]*)/,/^(?:class\\b)/,/^(?:cssClass\\b)/,/^(?:callback\\b)/,/^(?:link\\b)/,/^(?:click\\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\\s]+[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:call[\\s]+)/,/^(?:\\([\\s]*\\))/,/^(?:\\()/,/^(?:[^(]*)/,/^(?:\\))/,/^(?:[^)]*)/,/^(?:_self\\b)/,/^(?:_blank\\b)/,/^(?:_parent\\b)/,/^(?:_top\\b)/,/^(?:\\s*<\\|)/,/^(?:\\s*\\|>)/,/^(?:\\s*>)/,/^(?:\\s*<)/,/^(?:\\s*\\*)/,/^(?:\\s*o\\b)/,/^(?:--)/,/^(?:\\.\\.)/,/^(?::{1}[^:\\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\\.)/,/^(?:\\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\\w+)/,/^(?:[!\"#$%&'*+,-.`?\\\\/])/,/^(?:[0-9]+)/,/^(?:[\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6]|[\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377]|[\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5]|[\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA]|[\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE]|[\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA]|[\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0]|[\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977]|[\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2]|[\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A]|[\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0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-\\u0EC4\\u0EC6]|[\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A]|[\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081]|[\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D]|[\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0]|[\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310]|[\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C]|[\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711]|[\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7]|[\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C]|[\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16]|[\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF]|[\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC]|[\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D]|[\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D]|[\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3]|[\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F]|[\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128]|[\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184]|[\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3]|[\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6]|[\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE]|[\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C]|[\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D]|[\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC]|[\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B]|[\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788]|[\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805]|[\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB]|[\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28]|[\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5]|[\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4]|[\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E]|[\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D]|[\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36]|[\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D]|[\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC]|[\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF]|[\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC])/,/^(?:\\s)/,/^(?:$)/],\nconditions: {\"arg_directive\":{\"rules\":[7,8],\"inclusive\":false},\"type_directive\":{\"rules\":[6,7],\"inclusive\":false},\"open_directive\":{\"rules\":[5],\"inclusive\":false},\"callback_args\":{\"rules\":[44,45],\"inclusive\":false},\"callback_name\":{\"rules\":[41,42,43],\"inclusive\":false},\"href\":{\"rules\":[38,39],\"inclusive\":false},\"struct\":{\"rules\":[16,17,18,19,20],\"inclusive\":false},\"generic\":{\"rules\":[29,30],\"inclusive\":false},\"bqstring\":{\"rules\":[35,36],\"inclusive\":false},\"string\":{\"rules\":[32,33],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,2,3,4,9,10,11,12,13,14,15,21,22,23,24,25,26,27,28,31,34,37,40,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,23,40],$V3=[1,17],$V4=[1,20],$V5=[1,25],$V6=[1,26],$V7=[1,27],$V8=[1,28],$V9=[1,37],$Va=[23,37,38],$Vb=[4,6,9,11,23,40],$Vc=[33,34,35,36],$Vd=[22,29];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"ER_DIAGRAM\":4,\"document\":5,\"EOF\":6,\"directive\":7,\"line\":8,\"SPACE\":9,\"statement\":10,\"NEWLINE\":11,\"openDirective\":12,\"typeDirective\":13,\"closeDirective\":14,\":\":15,\"argDirective\":16,\"entityName\":17,\"relSpec\":18,\"role\":19,\"BLOCK_START\":20,\"attributes\":21,\"BLOCK_STOP\":22,\"ALPHANUM\":23,\"attribute\":24,\"attributeType\":25,\"attributeName\":26,\"attributeKeyType\":27,\"COMMENT\":28,\"ATTRIBUTE_WORD\":29,\"ATTRIBUTE_KEY\":30,\"cardinality\":31,\"relType\":32,\"ZERO_OR_ONE\":33,\"ZERO_OR_MORE\":34,\"ONE_OR_MORE\":35,\"ONLY_ONE\":36,\"NON_IDENTIFYING\":37,\"IDENTIFYING\":38,\"WORD\":39,\"open_directive\":40,\"type_directive\":41,\"arg_directive\":42,\"close_directive\":43,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"ER_DIAGRAM\",6:\"EOF\",9:\"SPACE\",11:\"NEWLINE\",15:\":\",20:\"BLOCK_START\",22:\"BLOCK_STOP\",23:\"ALPHANUM\",28:\"COMMENT\",29:\"ATTRIBUTE_WORD\",30:\"ATTRIBUTE_KEY\",33:\"ZERO_OR_ONE\",34:\"ZERO_OR_MORE\",35:\"ONE_OR_MORE\",36:\"ONLY_ONE\",37:\"NON_IDENTIFYING\",38:\"IDENTIFYING\",39:\"WORD\",40:\"open_directive\",41:\"type_directive\",42:\"arg_directive\",43:\"close_directive\"},\nproductions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[17,1],[21,1],[21,2],[24,2],[24,3],[24,3],[24,4],[25,1],[26,1],[27,1],[18,3],[31,1],[31,1],[31,1],[31,1],[32,1],[32,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n /*console.log('finished parsing');*/ \nbreak;\ncase 3:\n this.$ = [] \nbreak;\ncase 4:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 5: case 6:\n this.$ = $$[$0] \nbreak;\ncase 7: case 8:\n this.$=[];\nbreak;\ncase 12:\n\n yy.addEntity($$[$0-4]);\n yy.addEntity($$[$0-2]);\n yy.addRelationship($$[$0-4], $$[$0], $$[$0-2], $$[$0-3]);\n /*console.log($$[$0-4] + $$[$0-3] + $$[$0-2] + ':' + $$[$0]);*/\n \nbreak;\ncase 13:\n\n /* console.log('detected block'); */\n yy.addEntity($$[$0-3]);\n yy.addAttributes($$[$0-3], $$[$0-1]);\n /* console.log('handled block'); */\n \nbreak;\ncase 14:\n yy.addEntity($$[$0-2]); \nbreak;\ncase 15:\n yy.addEntity($$[$0]); \nbreak;\ncase 16:\n this.$ = $$[$0]; /*console.log('Entity: ' + $$[$0]);*/ \nbreak;\ncase 17:\n this.$ = [$$[$0]]; \nbreak;\ncase 18:\n $$[$0].push($$[$0-1]); this.$=$$[$0]; \nbreak;\ncase 19:\n this.$ = { attributeType: $$[$0-1], attributeName: $$[$0] }; \nbreak;\ncase 20:\n this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeKeyType: $$[$0] }; \nbreak;\ncase 21:\n this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeComment: $$[$0] }; \nbreak;\ncase 22:\n this.$ = { attributeType: $$[$0-3], attributeName: $$[$0-2], attributeKeyType: $$[$0-1], attributeComment: $$[$0] }; \nbreak;\ncase 23: case 24: case 25:\n this.$=$$[$0]; \nbreak;\ncase 26:\n\n this.$ = { cardA: $$[$0], relType: $$[$0-1], cardB: $$[$0-2] };\n /*console.log('relSpec: ' + $$[$0] + $$[$0-1] + $$[$0-2]);*/\n \nbreak;\ncase 27:\n this.$ = yy.Cardinality.ZERO_OR_ONE; \nbreak;\ncase 28:\n this.$ = yy.Cardinality.ZERO_OR_MORE; \nbreak;\ncase 29:\n this.$ = yy.Cardinality.ONE_OR_MORE; \nbreak;\ncase 30:\n this.$ = yy.Cardinality.ONLY_ONE; \nbreak;\ncase 31:\n this.$ = yy.Identification.NON_IDENTIFYING; \nbreak;\ncase 32:\n this.$ = yy.Identification.IDENTIFYING; \nbreak;\ncase 33:\n this.$ = $$[$0].replace(/\"/g, ''); \nbreak;\ncase 34:\n this.$ = $$[$0]; \nbreak;\ncase 35:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 36:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 37:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 38:\n yy.parseDirective('}%%', 'close_directive', 'er'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,7:3,12:4,40:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,40:$V1},{13:8,41:[1,9]},{41:[2,35]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:$V3,40:$V1},{1:[2,2]},{14:18,15:[1,19],43:$V4},o([15,43],[2,36]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:15,10:21,12:4,17:16,23:$V3,40:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,15],{18:22,31:24,20:[1,23],33:$V5,34:$V6,35:$V7,36:$V8}),o([6,9,11,15,20,23,33,34,35,36,40],[2,16]),{11:[1,29]},{16:30,42:[1,31]},{11:[2,38]},o($V2,[2,5]),{17:32,23:$V3},{21:33,22:[1,34],24:35,25:36,29:$V9},{32:38,37:[1,39],38:[1,40]},o($Va,[2,27]),o($Va,[2,28]),o($Va,[2,29]),o($Va,[2,30]),o($Vb,[2,9]),{14:41,43:$V4},{43:[2,37]},{15:[1,42]},{22:[1,43]},o($V2,[2,14]),{21:44,22:[2,17],24:35,25:36,29:$V9},{26:45,29:[1,46]},{29:[2,23]},{31:47,33:$V5,34:$V6,35:$V7,36:$V8},o($Vc,[2,31]),o($Vc,[2,32]),{11:[1,48]},{19:49,23:[1,51],39:[1,50]},o($V2,[2,13]),{22:[2,18]},o($Vd,[2,19],{27:52,28:[1,53],30:[1,54]}),o([22,28,29,30],[2,24]),{23:[2,26]},o($Vb,[2,10]),o($V2,[2,12]),o($V2,[2,33]),o($V2,[2,34]),o($Vd,[2,20],{28:[1,55]}),o($Vd,[2,21]),o([22,28,29],[2,25]),o($Vd,[2,22])],\ndefaultActions: {5:[2,35],7:[2,2],20:[2,38],31:[2,37],37:[2,23],44:[2,18],47:[2,26]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 40; \nbreak;\ncase 1: this.begin('type_directive'); return 41; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 15; \nbreak;\ncase 3: this.popState(); this.popState(); return 43; \nbreak;\ncase 4:return 42;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */\nbreak;\ncase 7:return 11;\nbreak;\ncase 8:/* skip whitespace */\nbreak;\ncase 9:return 9;\nbreak;\ncase 10:return 39;\nbreak;\ncase 11:return 4;\nbreak;\ncase 12: this.begin(\"block\"); return 20; \nbreak;\ncase 13:/* skip whitespace in block */\nbreak;\ncase 14:return 30\nbreak;\ncase 15:return 29\nbreak;\ncase 16:return 28;\nbreak;\ncase 17:/* nothing */\nbreak;\ncase 18: this.popState(); return 22; \nbreak;\ncase 19:return yy_.yytext[0];\nbreak;\ncase 20:return 33;\nbreak;\ncase 21:return 34;\nbreak;\ncase 22:return 35;\nbreak;\ncase 23:return 36;\nbreak;\ncase 24:return 33;\nbreak;\ncase 25:return 34;\nbreak;\ncase 26:return 35;\nbreak;\ncase 27:return 37;\nbreak;\ncase 28:return 38;\nbreak;\ncase 29:return 37;\nbreak;\ncase 30:return 37;\nbreak;\ncase 31:return 23;\nbreak;\ncase 32:return yy_.yytext[0];\nbreak;\ncase 33:return 6;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:[\\s]+)/i,/^(?:\"[^\"]*\")/i,/^(?:erDiagram\\b)/i,/^(?:\\{)/i,/^(?:\\s+)/i,/^(?:(?:PK)|(?:FK))/i,/^(?:[A-Za-z][A-Za-z0-9\\-_]*)/i,/^(?:\"[^\"]*\")/i,/^(?:[\\n]+)/i,/^(?:\\})/i,/^(?:.)/i,/^(?:\\|o\\b)/i,/^(?:\\}o\\b)/i,/^(?:\\}\\|)/i,/^(?:\\|\\|)/i,/^(?:o\\|)/i,/^(?:o\\{)/i,/^(?:\\|\\{)/i,/^(?:\\.\\.)/i,/^(?:--)/i,/^(?:\\.-)/i,/^(?:-\\.)/i,/^(?:[A-Za-z][A-Za-z0-9\\-_]*)/i,/^(?:.)/i,/^(?:$)/i],\nconditions: {\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"block\":{\"rules\":[13,14,15,16,17,18,19],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,8,9,10,11,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,47,59,60,79,80,81,82,83,84,88,98,99,102,104,105,111,112,113,114,115,116,117,118,119,120],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,59],$Vc=[1,45],$Vd=[1,49],$Ve=[1,33],$Vf=[1,34],$Vg=[1,35],$Vh=[1,36],$Vi=[1,37],$Vj=[1,53],$Vk=[1,60],$Vl=[1,48],$Vm=[1,50],$Vn=[1,52],$Vo=[1,56],$Vp=[1,57],$Vq=[1,38],$Vr=[1,39],$Vs=[1,40],$Vt=[1,41],$Vu=[1,58],$Vv=[1,47],$Vw=[1,51],$Vx=[1,54],$Vy=[1,55],$Vz=[1,46],$VA=[1,63],$VB=[1,68],$VC=[1,20,21,22,23,38,42,47,59,60,79,80,81,82,83,84,88,98,99,102,104,105,111,112,113,114,115,116,117,118,119,120],$VD=[1,72],$VE=[1,71],$VF=[1,73],$VG=[20,21,23,74,75],$VH=[1,94],$VI=[1,99],$VJ=[1,102],$VK=[1,103],$VL=[1,96],$VM=[1,101],$VN=[1,104],$VO=[1,97],$VP=[1,109],$VQ=[1,108],$VR=[1,98],$VS=[1,100],$VT=[1,105],$VU=[1,106],$VV=[1,107],$VW=[1,110],$VX=[20,21,22,23,74,75],$VY=[20,21,22,23,48,74,75],$VZ=[20,21,22,23,40,47,48,50,52,54,56,58,59,60,62,64,66,67,69,74,75,84,88,98,99,102,104,105,115,116,117,118,119,120],$V_=[20,21,23],$V$=[20,21,23,47,59,60,74,75,84,88,98,99,102,104,105,115,116,117,118,119,120],$V01=[1,12,20,21,22,23,24,38,42,47,59,60,79,80,81,82,83,84,88,98,99,102,104,105,111,112,113,114,115,116,117,118,119,120],$V11=[47,59,60,84,88,98,99,102,104,105,115,116,117,118,119,120],$V21=[1,143],$V31=[1,151],$V41=[1,152],$V51=[1,153],$V61=[1,154],$V71=[1,138],$V81=[1,139],$V91=[1,135],$Va1=[1,146],$Vb1=[1,147],$Vc1=[1,148],$Vd1=[1,149],$Ve1=[1,150],$Vf1=[1,155],$Vg1=[1,156],$Vh1=[1,141],$Vi1=[1,144],$Vj1=[1,140],$Vk1=[1,137],$Vl1=[20,21,22,23,38,42,47,59,60,79,80,81,82,83,84,88,98,99,102,104,105,111,112,113,114,115,116,117,118,119,120],$Vm1=[1,159],$Vn1=[20,21,22,23,26,47,59,60,84,98,99,102,104,105,115,116,117,118,119,120],$Vo1=[20,21,22,23,24,26,38,40,41,42,47,51,53,55,57,59,60,61,63,65,66,68,70,74,75,79,80,81,82,83,84,85,88,98,99,102,104,105,106,107,115,116,117,118,119,120],$Vp1=[12,21,22,24],$Vq1=[22,99],$Vr1=[1,242],$Vs1=[1,237],$Vt1=[1,238],$Vu1=[1,246],$Vv1=[1,243],$Vw1=[1,240],$Vx1=[1,239],$Vy1=[1,241],$Vz1=[1,244],$VA1=[1,245],$VB1=[1,247],$VC1=[1,265],$VD1=[20,21,23,99],$VE1=[20,21,22,23,59,60,79,95,98,99,102,103,104,105,106];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"mermaidDoc\":4,\"directive\":5,\"openDirective\":6,\"typeDirective\":7,\"closeDirective\":8,\"separator\":9,\":\":10,\"argDirective\":11,\"open_directive\":12,\"type_directive\":13,\"arg_directive\":14,\"close_directive\":15,\"graphConfig\":16,\"document\":17,\"line\":18,\"statement\":19,\"SEMI\":20,\"NEWLINE\":21,\"SPACE\":22,\"EOF\":23,\"GRAPH\":24,\"NODIR\":25,\"DIR\":26,\"FirstStmtSeperator\":27,\"ending\":28,\"endToken\":29,\"spaceList\":30,\"spaceListNewline\":31,\"verticeStatement\":32,\"styleStatement\":33,\"linkStyleStatement\":34,\"classDefStatement\":35,\"classStatement\":36,\"clickStatement\":37,\"subgraph\":38,\"text\":39,\"SQS\":40,\"SQE\":41,\"end\":42,\"direction\":43,\"link\":44,\"node\":45,\"vertex\":46,\"AMP\":47,\"STYLE_SEPARATOR\":48,\"idString\":49,\"PS\":50,\"PE\":51,\"(-\":52,\"-)\":53,\"STADIUMSTART\":54,\"STADIUMEND\":55,\"SUBROUTINESTART\":56,\"SUBROUTINEEND\":57,\"VERTEX_WITH_PROPS_START\":58,\"ALPHA\":59,\"COLON\":60,\"PIPE\":61,\"CYLINDERSTART\":62,\"CYLINDEREND\":63,\"DIAMOND_START\":64,\"DIAMOND_STOP\":65,\"TAGEND\":66,\"TRAPSTART\":67,\"TRAPEND\":68,\"INVTRAPSTART\":69,\"INVTRAPEND\":70,\"linkStatement\":71,\"arrowText\":72,\"TESTSTR\":73,\"START_LINK\":74,\"LINK\":75,\"textToken\":76,\"STR\":77,\"keywords\":78,\"STYLE\":79,\"LINKSTYLE\":80,\"CLASSDEF\":81,\"CLASS\":82,\"CLICK\":83,\"DOWN\":84,\"UP\":85,\"textNoTags\":86,\"textNoTagsToken\":87,\"DEFAULT\":88,\"stylesOpt\":89,\"alphaNum\":90,\"CALLBACKNAME\":91,\"CALLBACKARGS\":92,\"HREF\":93,\"LINK_TARGET\":94,\"HEX\":95,\"numList\":96,\"INTERPOLATE\":97,\"NUM\":98,\"COMMA\":99,\"style\":100,\"styleComponent\":101,\"MINUS\":102,\"UNIT\":103,\"BRKT\":104,\"DOT\":105,\"PCT\":106,\"TAGSTART\":107,\"alphaNumToken\":108,\"idStringToken\":109,\"alphaNumStatement\":110,\"direction_tb\":111,\"direction_bt\":112,\"direction_rl\":113,\"direction_lr\":114,\"PUNCTUATION\":115,\"UNICODE_TEXT\":116,\"PLUS\":117,\"EQUALS\":118,\"MULT\":119,\"UNDERSCORE\":120,\"graphCodeTokens\":121,\"ARROW_CROSS\":122,\"ARROW_POINT\":123,\"ARROW_CIRCLE\":124,\"ARROW_OPEN\":125,\"QUOTE\":126,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",10:\":\",12:\"open_directive\",13:\"type_directive\",14:\"arg_directive\",15:\"close_directive\",20:\"SEMI\",21:\"NEWLINE\",22:\"SPACE\",23:\"EOF\",24:\"GRAPH\",25:\"NODIR\",26:\"DIR\",38:\"subgraph\",40:\"SQS\",41:\"SQE\",42:\"end\",47:\"AMP\",48:\"STYLE_SEPARATOR\",50:\"PS\",51:\"PE\",52:\"(-\",53:\"-)\",54:\"STADIUMSTART\",55:\"STADIUMEND\",56:\"SUBROUTINESTART\",57:\"SUBROUTINEEND\",58:\"VERTEX_WITH_PROPS_START\",59:\"ALPHA\",60:\"COLON\",61:\"PIPE\",62:\"CYLINDERSTART\",63:\"CYLINDEREND\",64:\"DIAMOND_START\",65:\"DIAMOND_STOP\",66:\"TAGEND\",67:\"TRAPSTART\",68:\"TRAPEND\",69:\"INVTRAPSTART\",70:\"INVTRAPEND\",73:\"TESTSTR\",74:\"START_LINK\",75:\"LINK\",77:\"STR\",79:\"STYLE\",80:\"LINKSTYLE\",81:\"CLASSDEF\",82:\"CLASS\",83:\"CLICK\",84:\"DOWN\",85:\"UP\",88:\"DEFAULT\",91:\"CALLBACKNAME\",92:\"CALLBACKARGS\",93:\"HREF\",94:\"LINK_TARGET\",95:\"HEX\",97:\"INTERPOLATE\",98:\"NUM\",99:\"COMMA\",102:\"MINUS\",103:\"UNIT\",104:\"BRKT\",105:\"DOT\",106:\"PCT\",107:\"TAGSTART\",111:\"direction_tb\",112:\"direction_bt\",113:\"direction_rl\",114:\"direction_lr\",115:\"PUNCTUATION\",116:\"UNICODE_TEXT\",117:\"PLUS\",118:\"EQUALS\",119:\"MULT\",120:\"UNDERSCORE\",122:\"ARROW_CROSS\",123:\"ARROW_POINT\",124:\"ARROW_CIRCLE\",125:\"ARROW_OPEN\",126:\"QUOTE\"},\nproductions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[45,1],[45,5],[45,3],[46,4],[46,6],[46,4],[46,4],[46,4],[46,8],[46,4],[46,4],[46,4],[46,6],[46,4],[46,4],[46,4],[46,4],[46,4],[46,1],[44,2],[44,3],[44,3],[44,1],[44,3],[71,1],[72,3],[39,1],[39,2],[39,1],[78,1],[78,1],[78,1],[78,1],[78,1],[78,1],[78,1],[78,1],[78,1],[78,1],[78,1],[86,1],[86,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[96,1],[96,3],[89,1],[89,3],[100,1],[100,2],[101,1],[101,1],[101,1],[101,1],[101,1],[101,1],[101,1],[101,1],[101,1],[101,1],[101,1],[76,1],[76,1],[76,1],[76,1],[76,1],[76,1],[87,1],[87,1],[87,1],[87,1],[49,1],[49,2],[90,1],[90,2],[110,1],[110,1],[110,1],[110,1],[43,1],[43,1],[43,1],[43,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1],[121,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 5:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 6:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 7:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 8:\n yy.parseDirective('}%%', 'close_directive', 'flowchart'); \nbreak;\ncase 10:\n this.$ = [];\nbreak;\ncase 11:\n\n\t if($$[$0] !== []){\n\t $$[$0-1].push($$[$0]);\n\t }\n\t this.$=$$[$0-1];\nbreak;\ncase 12: case 78: case 80: case 92: case 148: case 150: case 151:\nthis.$=$$[$0];\nbreak;\ncase 19:\n yy.setDirection('TB');this.$ = 'TB';\nbreak;\ncase 20:\n yy.setDirection($$[$0-1]);this.$ = $$[$0-1];\nbreak;\ncase 35:\n /* console.warn('finat vs', $$[$0-1].nodes); */ this.$=$$[$0-1].nodes\nbreak;\ncase 36: case 37: case 38: case 39: case 40:\nthis.$=[];\nbreak;\ncase 41:\nthis.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]);\nbreak;\ncase 42:\nthis.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]);\nbreak;\ncase 43:\nthis.$=yy.addSubGraph(undefined,$$[$0-1],undefined);\nbreak;\ncase 48:\n /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) } \nbreak;\ncase 49:\n /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) } \nbreak;\ncase 50:\n/*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] }\nbreak;\ncase 51:\n /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] }\nbreak;\ncase 52:\n /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]];\nbreak;\ncase 53:\n this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */ \nbreak;\ncase 54:\nthis.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0])\nbreak;\ncase 55:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square');\nbreak;\ncase 56:\nthis.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle');\nbreak;\ncase 57:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse');\nbreak;\ncase 58:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium');\nbreak;\ncase 59:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'subroutine');\nbreak;\ncase 60:\nthis.$ = $$[$0-7];yy.addVertex($$[$0-7],$$[$0-1],'rect',undefined,undefined,undefined, Object.fromEntries([[$$[$0-5], $$[$0-3]]]));\nbreak;\ncase 61:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder');\nbreak;\ncase 62:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round');\nbreak;\ncase 63:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond');\nbreak;\ncase 64:\nthis.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon');\nbreak;\ncase 65:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd');\nbreak;\ncase 66:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid');\nbreak;\ncase 67:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid');\nbreak;\ncase 68:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right');\nbreak;\ncase 69:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left');\nbreak;\ncase 70:\n /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]);\nbreak;\ncase 71:\n$$[$0-1].text = $$[$0];this.$ = $$[$0-1];\nbreak;\ncase 72: case 73:\n$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2];\nbreak;\ncase 74:\nthis.$ = $$[$0];\nbreak;\ncase 75:\nvar inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {\"type\":inf.type,\"stroke\":inf.stroke,\"length\":inf.length,\"text\":$$[$0-1]};\nbreak;\ncase 76:\nvar inf = yy.destructLink($$[$0]);this.$ = {\"type\":inf.type,\"stroke\":inf.stroke,\"length\":inf.length};\nbreak;\ncase 77:\nthis.$ = $$[$0-1];\nbreak;\ncase 79: case 93: case 149:\nthis.$=$$[$0-1]+''+$$[$0];\nbreak;\ncase 94: case 95:\nthis.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]);\nbreak;\ncase 96:\nthis.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]);\nbreak;\ncase 97: case 105:\nthis.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0]);\nbreak;\ncase 98: case 106:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]);\nbreak;\ncase 99:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 100:\nthis.$ = $$[$0-4];yy.setClickEvent($$[$0-4], $$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-4], $$[$0]);\nbreak;\ncase 101: case 107:\nthis.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]);\nbreak;\ncase 102: case 108:\nthis.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]);\nbreak;\ncase 103: case 109:\nthis.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);\nbreak;\ncase 104: case 110:\nthis.$ = $$[$0-5];yy.setLink($$[$0-5], $$[$0-4], $$[$0]);yy.setTooltip($$[$0-5], $$[$0-2]);\nbreak;\ncase 111:\nthis.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]);\nbreak;\ncase 112: case 114:\nthis.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]);\nbreak;\ncase 113:\nthis.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]);\nbreak;\ncase 115:\nthis.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]);\nbreak;\ncase 116:\nthis.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]);\nbreak;\ncase 117:\nthis.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]);\nbreak;\ncase 118:\nthis.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]);\nbreak;\ncase 119: case 121:\nthis.$ = [$$[$0]]\nbreak;\ncase 120: case 122:\n$$[$0-2].push($$[$0]);this.$ = $$[$0-2];\nbreak;\ncase 124:\nthis.$ = $$[$0-1] + $$[$0];\nbreak;\ncase 146:\nthis.$=$$[$0]\nbreak;\ncase 147:\nthis.$=$$[$0-1]+''+$$[$0]\nbreak;\ncase 152:\nthis.$='v';\nbreak;\ncase 153:\nthis.$='-';\nbreak;\ncase 154:\n this.$={stmt:'dir', value:'TB'};\nbreak;\ncase 155:\n this.$={stmt:'dir', value:'BT'};\nbreak;\ncase 156:\n this.$={stmt:'dir', value:'RL'};\nbreak;\ncase 157:\n this.$={stmt:'dir', value:'LR'};\nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,43:31,45:32,46:42,47:$Vb,49:43,59:$Vc,60:$Vd,79:$Ve,80:$Vf,81:$Vg,82:$Vh,83:$Vi,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,109:44,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz},{8:61,10:[1,62],15:$VA},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,65],21:[1,66],22:$VB,27:64,30:67},o($VC,[2,11]),o($VC,[2,12]),o($VC,[2,13]),o($VC,[2,14]),o($VC,[2,15]),o($VC,[2,16]),{9:69,20:$VD,21:$VE,23:$VF,44:70,71:74,74:[1,75],75:[1,76]},{9:77,20:$VD,21:$VE,23:$VF},{9:78,20:$VD,21:$VE,23:$VF},{9:79,20:$VD,21:$VE,23:$VF},{9:80,20:$VD,21:$VE,23:$VF},{9:81,20:$VD,21:$VE,23:$VF},{9:83,20:$VD,21:$VE,22:[1,82],23:$VF},o($VC,[2,44]),o($VG,[2,51],{30:84,22:$VB}),{22:[1,85]},{22:[1,86]},{22:[1,87]},{22:[1,88]},{26:$VH,47:$VI,59:$VJ,60:$VK,77:[1,92],84:$VL,90:91,91:[1,89],93:[1,90],98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:93,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($VC,[2,154]),o($VC,[2,155]),o($VC,[2,156]),o($VC,[2,157]),o($VX,[2,52],{48:[1,111]}),o($VY,[2,70],{109:123,40:[1,112],47:$Vb,50:[1,113],52:[1,114],54:[1,115],56:[1,116],58:[1,117],59:$Vc,60:$Vd,62:[1,118],64:[1,119],66:[1,120],67:[1,121],69:[1,122],84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz}),o($VZ,[2,146]),o($VZ,[2,171]),o($VZ,[2,172]),o($VZ,[2,173]),o($VZ,[2,174]),o($VZ,[2,175]),o($VZ,[2,176]),o($VZ,[2,177]),o($VZ,[2,178]),o($VZ,[2,179]),o($VZ,[2,180]),o($VZ,[2,181]),o($VZ,[2,182]),o($VZ,[2,183]),o($VZ,[2,184]),o($VZ,[2,185]),o($VZ,[2,186]),{9:124,20:$VD,21:$VE,23:$VF},{11:125,14:[1,126]},o($V_,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,127]},o($V$,[2,34],{30:128,22:$VB}),o($VC,[2,35]),{45:129,46:42,47:$Vb,49:43,59:$Vc,60:$Vd,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,109:44,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz},o($V01,[2,45]),o($V01,[2,46]),o($V01,[2,47]),o($V11,[2,74],{72:130,61:[1,132],73:[1,131]}),{22:$V21,24:$V31,26:$V41,38:$V51,39:133,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o([47,59,60,61,73,84,88,98,99,102,104,105,115,116,117,118,119,120],[2,76]),o($VC,[2,36]),o($VC,[2,37]),o($VC,[2,38]),o($VC,[2,39]),o($VC,[2,40]),{22:$V21,24:$V31,26:$V41,38:$V51,39:157,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($Vl1,$V5,{17:158}),o($VG,[2,50],{47:$Vm1}),{26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,90:160,95:[1,161],98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:93,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{88:[1,162],96:163,98:[1,164]},{26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,88:[1,165],90:166,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:93,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,90:167,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:93,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($V_,[2,97],{22:[1,168],92:[1,169]}),o($V_,[2,101],{22:[1,170]}),o($V_,[2,105],{108:95,110:172,22:[1,171],26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW}),o($V_,[2,107],{22:[1,173]}),o($Vn1,[2,148]),o($Vn1,[2,150]),o($Vn1,[2,151]),o($Vn1,[2,152]),o($Vn1,[2,153]),o($Vo1,[2,158]),o($Vo1,[2,159]),o($Vo1,[2,160]),o($Vo1,[2,161]),o($Vo1,[2,162]),o($Vo1,[2,163]),o($Vo1,[2,164]),o($Vo1,[2,165]),o($Vo1,[2,166]),o($Vo1,[2,167]),o($Vo1,[2,168]),o($Vo1,[2,169]),o($Vo1,[2,170]),{47:$Vb,49:174,59:$Vc,60:$Vd,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,109:44,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz},{22:$V21,24:$V31,26:$V41,38:$V51,39:175,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:177,42:$V61,47:$VI,50:[1,176],59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:178,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:179,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:180,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{59:[1,181]},{22:$V21,24:$V31,26:$V41,38:$V51,39:182,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:183,42:$V61,47:$VI,59:$VJ,60:$VK,64:[1,184],66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:185,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:186,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:187,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($VZ,[2,147]),o($Vp1,[2,3]),{8:188,15:$VA},{15:[2,7]},o($V4,[2,28]),o($V$,[2,33]),o($VG,[2,48],{30:189,22:$VB}),o($V11,[2,71],{22:[1,190]}),{22:[1,191]},{22:$V21,24:$V31,26:$V41,38:$V51,39:192,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,75:[1,193],76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($Vo1,[2,78]),o($Vo1,[2,80]),o($Vo1,[2,136]),o($Vo1,[2,137]),o($Vo1,[2,138]),o($Vo1,[2,139]),o($Vo1,[2,140]),o($Vo1,[2,141]),o($Vo1,[2,142]),o($Vo1,[2,143]),o($Vo1,[2,144]),o($Vo1,[2,145]),o($Vo1,[2,81]),o($Vo1,[2,82]),o($Vo1,[2,83]),o($Vo1,[2,84]),o($Vo1,[2,85]),o($Vo1,[2,86]),o($Vo1,[2,87]),o($Vo1,[2,88]),o($Vo1,[2,89]),o($Vo1,[2,90]),o($Vo1,[2,91]),{9:196,20:$VD,21:$VE,22:$V21,23:$VF,24:$V31,26:$V41,38:$V51,40:[1,195],42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,197],43:31,45:32,46:42,47:$Vb,49:43,59:$Vc,60:$Vd,79:$Ve,80:$Vf,81:$Vg,82:$Vh,83:$Vi,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,109:44,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz},{22:$VB,30:198},{22:[1,199],26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:172,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:[1,200]},{22:[1,201]},{22:[1,202],99:[1,203]},o($Vq1,[2,119]),{22:[1,204]},{22:[1,205],26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:172,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:[1,206],26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:172,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{77:[1,207]},o($V_,[2,99],{22:[1,208]}),{77:[1,209],94:[1,210]},{77:[1,211]},o($Vn1,[2,149]),{77:[1,212],94:[1,213]},o($VX,[2,54],{109:123,47:$Vb,59:$Vc,60:$Vd,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz}),{22:$V21,24:$V31,26:$V41,38:$V51,41:[1,214],42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:215,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,51:[1,216],59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,53:[1,217],59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,55:[1,218],59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,57:[1,219],59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{60:[1,220]},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,59:$VJ,60:$VK,63:[1,221],66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,59:$VJ,60:$VK,65:[1,222],66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,39:223,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,41:[1,224],42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,68:[1,225],70:[1,226],74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,68:[1,228],70:[1,227],74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{9:229,20:$VD,21:$VE,23:$VF},o($VG,[2,49],{47:$Vm1}),o($V11,[2,73]),o($V11,[2,72]),{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,59:$VJ,60:$VK,61:[1,230],66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($V11,[2,75]),o($Vo1,[2,79]),{22:$V21,24:$V31,26:$V41,38:$V51,39:231,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($Vl1,$V5,{17:232}),o($VC,[2,43]),{46:233,47:$Vb,49:43,59:$Vc,60:$Vd,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,109:44,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:234,95:$Vv1,98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:248,95:$Vv1,98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:249,95:$Vv1,97:[1,250],98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:251,95:$Vv1,97:[1,252],98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},{98:[1,253]},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:254,95:$Vv1,98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:255,95:$Vv1,98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},{26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,90:256,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:93,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($V_,[2,98]),{77:[1,257]},o($V_,[2,102],{22:[1,258]}),o($V_,[2,103]),o($V_,[2,106]),o($V_,[2,108],{22:[1,259]}),o($V_,[2,109]),o($VY,[2,55]),{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,51:[1,260],59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($VY,[2,62]),o($VY,[2,57]),o($VY,[2,58]),o($VY,[2,59]),{59:[1,261]},o($VY,[2,61]),o($VY,[2,63]),{22:$V21,24:$V31,26:$V41,38:$V51,42:$V61,47:$VI,59:$VJ,60:$VK,65:[1,262],66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($VY,[2,65]),o($VY,[2,66]),o($VY,[2,68]),o($VY,[2,67]),o($VY,[2,69]),o($Vp1,[2,4]),o([22,47,59,60,84,88,98,99,102,104,105,115,116,117,118,119,120],[2,77]),{22:$V21,24:$V31,26:$V41,38:$V51,41:[1,263],42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,264],43:31,45:32,46:42,47:$Vb,49:43,59:$Vc,60:$Vd,79:$Ve,80:$Vf,81:$Vg,82:$Vh,83:$Vi,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,109:44,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz},o($VX,[2,53]),o($V_,[2,111],{99:$VC1}),o($VD1,[2,121],{101:266,22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,95:$Vv1,98:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1}),o($VE1,[2,123]),o($VE1,[2,125]),o($VE1,[2,126]),o($VE1,[2,127]),o($VE1,[2,128]),o($VE1,[2,129]),o($VE1,[2,130]),o($VE1,[2,131]),o($VE1,[2,132]),o($VE1,[2,133]),o($VE1,[2,134]),o($VE1,[2,135]),o($V_,[2,112],{99:$VC1}),o($V_,[2,113],{99:$VC1}),{22:[1,267]},o($V_,[2,114],{99:$VC1}),{22:[1,268]},o($Vq1,[2,120]),o($V_,[2,94],{99:$VC1}),o($V_,[2,95],{99:$VC1}),o($V_,[2,96],{108:95,110:172,26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW}),o($V_,[2,100]),{94:[1,269]},{94:[1,270]},{51:[1,271]},{61:[1,272]},{65:[1,273]},{9:274,20:$VD,21:$VE,23:$VF},o($VC,[2,42]),{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,95:$Vv1,98:$Vw1,100:275,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},o($VE1,[2,124]),{26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,90:276,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:93,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,90:277,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,108:95,110:93,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($V_,[2,104]),o($V_,[2,110]),o($VY,[2,56]),{22:$V21,24:$V31,26:$V41,38:$V51,39:278,42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:134,77:$V91,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},o($VY,[2,64]),o($Vl1,$V5,{17:279}),o($VD1,[2,122],{101:266,22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,95:$Vv1,98:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1}),o($V_,[2,117],{108:95,110:172,22:[1,280],26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW}),o($V_,[2,118],{108:95,110:172,22:[1,281],26:$VH,47:$VI,59:$VJ,60:$VK,84:$VL,98:$VM,99:$VN,102:$VO,104:$VP,105:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW}),{22:$V21,24:$V31,26:$V41,38:$V51,41:[1,282],42:$V61,47:$VI,59:$VJ,60:$VK,66:$V71,74:$V81,76:194,78:145,79:$Va1,80:$Vb1,81:$Vc1,82:$Vd1,83:$Ve1,84:$Vf1,85:$Vg1,87:136,88:$Vh1,98:$VM,99:$VN,102:$Vi1,104:$VP,105:$VQ,106:$Vj1,107:$Vk1,108:142,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV,120:$VW},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,283],43:31,45:32,46:42,47:$Vb,49:43,59:$Vc,60:$Vd,79:$Ve,80:$Vf,81:$Vg,82:$Vh,83:$Vi,84:$Vj,88:$Vk,98:$Vl,99:$Vm,102:$Vn,104:$Vo,105:$Vp,109:44,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy,120:$Vz},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:284,95:$Vv1,98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},{22:$Vr1,59:$Vs1,60:$Vt1,79:$Vu1,89:285,95:$Vv1,98:$Vw1,100:235,101:236,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1,106:$VB1},o($VY,[2,60]),o($VC,[2,41]),o($V_,[2,115],{99:$VC1}),o($V_,[2,116],{99:$VC1})],\ndefaultActions: {2:[2,1],9:[2,5],10:[2,2],126:[2,7]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 12; \nbreak;\ncase 1: this.begin('type_directive'); return 13; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 10; \nbreak;\ncase 3: this.popState(); this.popState(); return 15; \nbreak;\ncase 4:return 14;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */\nbreak;\ncase 7:this.begin(\"string\");\nbreak;\ncase 8:this.popState();\nbreak;\ncase 9:return \"STR\";\nbreak;\ncase 10:return 79;\nbreak;\ncase 11:return 88;\nbreak;\ncase 12:return 80;\nbreak;\ncase 13:return 97;\nbreak;\ncase 14:return 81;\nbreak;\ncase 15:return 82;\nbreak;\ncase 16:this.begin(\"href\");\nbreak;\ncase 17:this.popState();\nbreak;\ncase 18:return 93;\nbreak;\ncase 19:this.begin(\"callbackname\");\nbreak;\ncase 20:this.popState();\nbreak;\ncase 21:this.popState(); this.begin(\"callbackargs\");\nbreak;\ncase 22:return 91;\nbreak;\ncase 23:this.popState();\nbreak;\ncase 24:return 92;\nbreak;\ncase 25:this.begin(\"click\");\nbreak;\ncase 26:this.popState();\nbreak;\ncase 27:return 83;\nbreak;\ncase 28:if(yy.lex.firstGraph()){this.begin(\"dir\");} return 24;\nbreak;\ncase 29:if(yy.lex.firstGraph()){this.begin(\"dir\");} return 24;\nbreak;\ncase 30:return 38;\nbreak;\ncase 31:return 42;\nbreak;\ncase 32:return 94;\nbreak;\ncase 33:return 94;\nbreak;\ncase 34:return 94;\nbreak;\ncase 35:return 94;\nbreak;\ncase 36: this.popState(); return 25; \nbreak;\ncase 37: this.popState(); return 26; \nbreak;\ncase 38: this.popState(); return 26; \nbreak;\ncase 39: this.popState(); return 26; \nbreak;\ncase 40: this.popState(); return 26; \nbreak;\ncase 41: this.popState(); return 26; \nbreak;\ncase 42: this.popState(); return 26; \nbreak;\ncase 43: this.popState(); return 26; \nbreak;\ncase 44: this.popState(); return 26; \nbreak;\ncase 45: this.popState(); return 26; \nbreak;\ncase 46: this.popState(); return 26; \nbreak;\ncase 47:return 111;\nbreak;\ncase 48:return 112;\nbreak;\ncase 49:return 113;\nbreak;\ncase 50:return 114;\nbreak;\ncase 51: return 98;\nbreak;\ncase 52:return 104;\nbreak;\ncase 53:return 48;\nbreak;\ncase 54:return 60;\nbreak;\ncase 55:return 47;\nbreak;\ncase 56:return 20;\nbreak;\ncase 57:return 99;\nbreak;\ncase 58:return 119;\nbreak;\ncase 59:return 75;\nbreak;\ncase 60:return 75;\nbreak;\ncase 61:return 75;\nbreak;\ncase 62:return 74;\nbreak;\ncase 63:return 74;\nbreak;\ncase 64:return 74;\nbreak;\ncase 65:return 52;\nbreak;\ncase 66:return 53;\nbreak;\ncase 67:return 54;\nbreak;\ncase 68:return 55;\nbreak;\ncase 69:return 56;\nbreak;\ncase 70:return 57;\nbreak;\ncase 71:return 58;\nbreak;\ncase 72:return 62;\nbreak;\ncase 73:return 63;\nbreak;\ncase 74:return 102;\nbreak;\ncase 75:return 105;\nbreak;\ncase 76:return 120;\nbreak;\ncase 77:return 117;\nbreak;\ncase 78:return 106;\nbreak;\ncase 79:return 118;\nbreak;\ncase 80:return 118;\nbreak;\ncase 81:return 107;\nbreak;\ncase 82:return 66;\nbreak;\ncase 83:return 85;\nbreak;\ncase 84:return 'SEP';\nbreak;\ncase 85:return 84;\nbreak;\ncase 86:return 59;\nbreak;\ncase 87:return 68;\nbreak;\ncase 88:return 67;\nbreak;\ncase 89:return 70;\nbreak;\ncase 90:return 69;\nbreak;\ncase 91:return 115;\nbreak;\ncase 92:return 116;\nbreak;\ncase 93:return 61;\nbreak;\ncase 94:return 50;\nbreak;\ncase 95:return 51;\nbreak;\ncase 96:return 40;\nbreak;\ncase 97:return 41;\nbreak;\ncase 98:return 64\nbreak;\ncase 99:return 65\nbreak;\ncase 100:return 126;\nbreak;\ncase 101:return 21;\nbreak;\ncase 102:return 22;\nbreak;\ncase 103:return 23;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/,/^(?:((?:(?!\\}%%)[^:.])*))/,/^(?::)/,/^(?:\\}%%)/,/^(?:((?:(?!\\}%%).|\\n)*))/,/^(?:%%(?!\\{)[^\\n]*)/,/^(?:[^\\}]%%[^\\n]*)/,/^(?:[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:style\\b)/,/^(?:default\\b)/,/^(?:linkStyle\\b)/,/^(?:interpolate\\b)/,/^(?:classDef\\b)/,/^(?:class\\b)/,/^(?:href[\\s]+[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:call[\\s]+)/,/^(?:\\([\\s]*\\))/,/^(?:\\()/,/^(?:[^(]*)/,/^(?:\\))/,/^(?:[^)]*)/,/^(?:click[\\s]+)/,/^(?:[\\s\\n])/,/^(?:[^\\s\\n]*)/,/^(?:graph\\b)/,/^(?:flowchart\\b)/,/^(?:subgraph\\b)/,/^(?:end\\b\\s*)/,/^(?:_self\\b)/,/^(?:_blank\\b)/,/^(?:_parent\\b)/,/^(?:_top\\b)/,/^(?:(\\r?\\n)*\\s*\\n)/,/^(?:\\s*LR\\b)/,/^(?:\\s*RL\\b)/,/^(?:\\s*TB\\b)/,/^(?:\\s*BT\\b)/,/^(?:\\s*TD\\b)/,/^(?:\\s*BR\\b)/,/^(?:\\s*<)/,/^(?:\\s*>)/,/^(?:\\s*\\^)/,/^(?:\\s*v\\b)/,/^(?:.*direction\\s+TB[^\\n]*)/,/^(?:.*direction\\s+BT[^\\n]*)/,/^(?:.*direction\\s+RL[^\\n]*)/,/^(?:.*direction\\s+LR[^\\n]*)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\\*)/,/^(?:\\s*[xo<]?--+[-xo>]\\s*)/,/^(?:\\s*[xo<]?==+[=xo>]\\s*)/,/^(?:\\s*[xo<]?-?\\.+-[xo>]?\\s*)/,/^(?:\\s*[xo<]?--\\s*)/,/^(?:\\s*[xo<]?==\\s*)/,/^(?:\\s*[xo<]?-\\.\\s*)/,/^(?:\\(-)/,/^(?:-\\))/,/^(?:\\(\\[)/,/^(?:\\]\\))/,/^(?:\\[\\[)/,/^(?:\\]\\])/,/^(?:\\[\\|)/,/^(?:\\[\\()/,/^(?:\\)\\])/,/^(?:-)/,/^(?:\\.)/,/^(?:[\\_])/,/^(?:\\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\\^)/,/^(?:\\\\\\|)/,/^(?:v\\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\\\\])/,/^(?:\\[\\/)/,/^(?:\\/\\])/,/^(?:\\[\\\\)/,/^(?:[!\"#$%&'*+,-.`?\\\\_/])/,/^(?:[\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6]|[\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377]|[\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5]|[\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA]|[\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE]|[\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA]|[\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0]|[\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977]|[\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2]|[\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A]|[\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39]|[\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8]|[\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C]|[\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C]|[\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99]|[\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0]|[\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D]|[\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3]|[\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10]|[\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1]|[\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81]|[\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3]|[\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6]|[\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A]|[\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081]|[\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D]|[\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0]|[\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310]|[\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C]|[\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711]|[\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7]|[\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C]|[\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16]|[\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF]|[\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC]|[\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D]|[\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D]|[\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3]|[\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F]|[\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128]|[\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184]|[\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3]|[\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6]|[\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE]|[\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C]|[\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D]|[\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC]|[\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B]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/,/^(?:$)/],\nconditions: {\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"callbackargs\":{\"rules\":[23,24],\"inclusive\":false},\"callbackname\":{\"rules\":[20,21,22],\"inclusive\":false},\"href\":{\"rules\":[17,18],\"inclusive\":false},\"click\":{\"rules\":[26,27],\"inclusive\":false},\"vertex\":{\"rules\":[],\"inclusive\":false},\"dir\":{\"rules\":[36,37,38,39,40,41,42,43,44,45,46],\"inclusive\":false},\"string\":{\"rules\":[8,9],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,10,11,12,13,14,15,16,19,25,28,29,30,31,32,33,34,35,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,19,20,22,29,34],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,25],$Vd=[1,27],$Ve=[1,30],$Vf=[5,7,9,11,12,13,14,15,16,17,18,19,20,22,29,34];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"directive\":4,\"gantt\":5,\"document\":6,\"EOF\":7,\"line\":8,\"SPACE\":9,\"statement\":10,\"NL\":11,\"dateFormat\":12,\"inclusiveEndDates\":13,\"topAxis\":14,\"axisFormat\":15,\"excludes\":16,\"includes\":17,\"todayMarker\":18,\"title\":19,\"section\":20,\"clickStatement\":21,\"taskTxt\":22,\"taskData\":23,\"openDirective\":24,\"typeDirective\":25,\"closeDirective\":26,\":\":27,\"argDirective\":28,\"click\":29,\"callbackname\":30,\"callbackargs\":31,\"href\":32,\"clickStatementDebug\":33,\"open_directive\":34,\"type_directive\":35,\"arg_directive\":36,\"close_directive\":37,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"gantt\",7:\"EOF\",9:\"SPACE\",11:\"NL\",12:\"dateFormat\",13:\"inclusiveEndDates\",14:\"topAxis\",15:\"axisFormat\",16:\"excludes\",17:\"includes\",18:\"todayMarker\",19:\"title\",20:\"section\",22:\"taskTxt\",23:\"taskData\",27:\":\",29:\"click\",30:\"callbackname\",31:\"callbackargs\",32:\"href\",34:\"open_directive\",35:\"type_directive\",36:\"arg_directive\",37:\"close_directive\"},\nproductions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[21,2],[21,3],[21,3],[21,4],[21,3],[21,4],[21,2],[33,2],[33,3],[33,3],[33,4],[33,3],[33,4],[33,2],[24,1],[25,1],[28,1],[26,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 2:\n return $$[$0-1]; \nbreak;\ncase 3:\n this.$ = [] \nbreak;\ncase 4:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 5: case 6:\n this.$ = $$[$0] \nbreak;\ncase 7: case 8:\n this.$=[];\nbreak;\ncase 9:\nyy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11);\nbreak;\ncase 10:\nyy.enableInclusiveEndDates();this.$=$$[$0].substr(18);\nbreak;\ncase 11:\nyy.TopAxis();this.$=$$[$0].substr(8);\nbreak;\ncase 12:\nyy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11);\nbreak;\ncase 13:\nyy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9);\nbreak;\ncase 14:\nyy.setIncludes($$[$0].substr(9));this.$=$$[$0].substr(9);\nbreak;\ncase 15:\nyy.setTodayMarker($$[$0].substr(12));this.$=$$[$0].substr(12);\nbreak;\ncase 16:\nyy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);\nbreak;\ncase 17:\nyy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);\nbreak;\ncase 19:\nyy.addTask($$[$0-1],$$[$0]);this.$='task';\nbreak;\ncase 23:\nthis.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null);\nbreak;\ncase 24:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 25:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]);\nbreak;\ncase 26:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]);\nbreak;\ncase 27:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]);\nbreak;\ncase 28:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]);\nbreak;\ncase 29:\nthis.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]);\nbreak;\ncase 30: case 36:\nthis.$=$$[$0-1] + ' ' + $$[$0];\nbreak;\ncase 31: case 32: case 34:\nthis.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];\nbreak;\ncase 33: case 35:\nthis.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];\nbreak;\ncase 37:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 38:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 39:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 40:\n yy.parseDirective('}%%', 'close_directive', 'gantt'); \nbreak;\n}\n},\ntable: [{3:1,4:2,5:$V0,24:4,34:$V1},{1:[3]},{3:6,4:2,5:$V0,24:4,34:$V1},o($V2,[2,3],{6:7}),{25:8,35:[1,9]},{35:[2,37]},{1:[2,1]},{4:26,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,21:24,22:$Vc,24:4,29:$Vd,34:$V1},{26:28,27:[1,29],37:$Ve},o([27,37],[2,38]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:26,10:31,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,21:24,22:$Vc,24:4,29:$Vd,34:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),o($V2,[2,17]),o($V2,[2,18]),{23:[1,32]},o($V2,[2,20]),{30:[1,33],32:[1,34]},{11:[1,35]},{28:36,36:[1,37]},{11:[2,40]},o($V2,[2,5]),o($V2,[2,19]),o($V2,[2,23],{31:[1,38],32:[1,39]}),o($V2,[2,29],{30:[1,40]}),o($Vf,[2,21]),{26:41,37:$Ve},{37:[2,39]},o($V2,[2,24],{32:[1,42]}),o($V2,[2,25]),o($V2,[2,27],{31:[1,43]}),{11:[1,44]},o($V2,[2,26]),o($V2,[2,28]),o($Vf,[2,22])],\ndefaultActions: {5:[2,37],6:[2,1],30:[2,40],37:[2,39]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 34; \nbreak;\ncase 1: this.begin('type_directive'); return 35; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 27; \nbreak;\ncase 3: this.popState(); this.popState(); return 37; \nbreak;\ncase 4:return 36;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */\nbreak;\ncase 7:/* do nothing */\nbreak;\ncase 8:return 11;\nbreak;\ncase 9:/* skip whitespace */\nbreak;\ncase 10:/* skip comments */\nbreak;\ncase 11:/* skip comments */\nbreak;\ncase 12:this.begin(\"href\");\nbreak;\ncase 13:this.popState();\nbreak;\ncase 14:return 32;\nbreak;\ncase 15:this.begin(\"callbackname\");\nbreak;\ncase 16:this.popState();\nbreak;\ncase 17:this.popState(); this.begin(\"callbackargs\");\nbreak;\ncase 18:return 30;\nbreak;\ncase 19:this.popState();\nbreak;\ncase 20:return 31;\nbreak;\ncase 21:this.begin(\"click\");\nbreak;\ncase 22:this.popState();\nbreak;\ncase 23:return 29;\nbreak;\ncase 24:return 5;\nbreak;\ncase 25:return 12;\nbreak;\ncase 26:return 13;\nbreak;\ncase 27:return 14;\nbreak;\ncase 28:return 15;\nbreak;\ncase 29:return 17;\nbreak;\ncase 30:return 16;\nbreak;\ncase 31:return 18;\nbreak;\ncase 32:return 'date';\nbreak;\ncase 33:return 19;\nbreak;\ncase 34:return 20;\nbreak;\ncase 35:return 22;\nbreak;\ncase 36:return 23;\nbreak;\ncase 37:return 27;\nbreak;\ncase 38:return 7;\nbreak;\ncase 39:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%%(?!\\{)*[^\\n]*)/i,/^(?:[^\\}]%%*[^\\n]*)/i,/^(?:%%*[^\\n]*[\\n]*)/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:href[\\s]+[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:call[\\s]+)/i,/^(?:\\([\\s]*\\))/i,/^(?:\\()/i,/^(?:[^(]*)/i,/^(?:\\))/i,/^(?:[^)]*)/i,/^(?:click[\\s]+)/i,/^(?:[\\s\\n])/i,/^(?:[^\\s\\n]*)/i,/^(?:gantt\\b)/i,/^(?:dateFormat\\s[^#\\n;]+)/i,/^(?:inclusiveEndDates\\b)/i,/^(?:topAxis\\b)/i,/^(?:axisFormat\\s[^#\\n;]+)/i,/^(?:includes\\s[^#\\n;]+)/i,/^(?:excludes\\s[^#\\n;]+)/i,/^(?:todayMarker\\s[^\\n;]+)/i,/^(?:\\d\\d\\d\\d-\\d\\d-\\d\\d\\b)/i,/^(?:title\\s[^#\\n;]+)/i,/^(?:section\\s[^#:\\n;]+)/i,/^(?:[^#:\\n;]+)/i,/^(?::[^#\\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"callbackargs\":{\"rules\":[19,20],\"inclusive\":false},\"callbackname\":{\"rules\":[16,17,18],\"inclusive\":false},\"href\":{\"rules\":[13,14],\"inclusive\":false},\"click\":{\"rules\":[22,23],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,8,9,10,11,12,15,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[2,3],$V1=[1,7],$V2=[7,12,15,17,19,20,21],$V3=[7,11,12,15,17,19,20,21],$V4=[2,20],$V5=[1,32];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"GG\":4,\":\":5,\"document\":6,\"EOF\":7,\"DIR\":8,\"options\":9,\"body\":10,\"OPT\":11,\"NL\":12,\"line\":13,\"statement\":14,\"COMMIT\":15,\"commit_arg\":16,\"BRANCH\":17,\"ID\":18,\"CHECKOUT\":19,\"MERGE\":20,\"RESET\":21,\"reset_arg\":22,\"STR\":23,\"HEAD\":24,\"reset_parents\":25,\"CARET\":26,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"GG\",5:\":\",7:\"EOF\",8:\"DIR\",11:\"OPT\",12:\"NL\",15:\"COMMIT\",17:\"BRANCH\",18:\"ID\",19:\"CHECKOUT\",20:\"MERGE\",21:\"RESET\",23:\"STR\",24:\"HEAD\",26:\"CARET\"},\nproductions_: [0,[3,4],[3,5],[6,0],[6,2],[9,2],[9,1],[10,0],[10,2],[13,2],[13,1],[14,2],[14,2],[14,2],[14,2],[14,2],[16,0],[16,1],[22,2],[22,2],[25,0],[25,2]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n return $$[$0-1]; \nbreak;\ncase 2:\nyy.setDirection($$[$0-3]); return $$[$0-1];\nbreak;\ncase 4:\n yy.setOptions($$[$0-1]); this.$ = $$[$0]\nbreak;\ncase 5:\n$$[$0-1] +=$$[$0]; this.$=$$[$0-1]\nbreak;\ncase 7:\nthis.$ = []\nbreak;\ncase 8:\n$$[$0-1].push($$[$0]); this.$=$$[$0-1];\nbreak;\ncase 9:\nthis.$ =$$[$0-1]\nbreak;\ncase 11:\nyy.commit($$[$0])\nbreak;\ncase 12:\nyy.branch($$[$0])\nbreak;\ncase 13:\nyy.checkout($$[$0])\nbreak;\ncase 14:\nyy.merge($$[$0])\nbreak;\ncase 15:\nyy.reset($$[$0])\nbreak;\ncase 16:\nthis.$ = \"\"\nbreak;\ncase 17:\nthis.$=$$[$0]\nbreak;\ncase 18:\nthis.$ = $$[$0-1]+ \":\" + $$[$0] \nbreak;\ncase 19:\nthis.$ = $$[$0-1]+ \":\" + yy.count; yy.count = 0\nbreak;\ncase 20:\nyy.count = 0\nbreak;\ncase 21:\n yy.count += 1 \nbreak;\n}\n},\ntable: [{3:1,4:[1,2]},{1:[3]},{5:[1,3],8:[1,4]},{6:5,7:$V0,9:6,12:$V1},{5:[1,8]},{7:[1,9]},o($V2,[2,7],{10:10,11:[1,11]}),o($V3,[2,6]),{6:12,7:$V0,9:6,12:$V1},{1:[2,1]},{7:[2,4],12:[1,15],13:13,14:14,15:[1,16],17:[1,17],19:[1,18],20:[1,19],21:[1,20]},o($V3,[2,5]),{7:[1,21]},o($V2,[2,8]),{12:[1,22]},o($V2,[2,10]),{12:[2,16],16:23,23:[1,24]},{18:[1,25]},{18:[1,26]},{18:[1,27]},{18:[1,30],22:28,24:[1,29]},{1:[2,2]},o($V2,[2,9]),{12:[2,11]},{12:[2,17]},{12:[2,12]},{12:[2,13]},{12:[2,14]},{12:[2,15]},{12:$V4,25:31,26:$V5},{12:$V4,25:33,26:$V5},{12:[2,18]},{12:$V4,25:34,26:$V5},{12:[2,19]},{12:[2,21]}],\ndefaultActions: {9:[2,1],21:[2,2],23:[2,11],24:[2,17],25:[2,12],26:[2,13],27:[2,14],28:[2,15],31:[2,18],33:[2,19],34:[2,21]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 12;\nbreak;\ncase 1:/* skip all whitespace */\nbreak;\ncase 2:/* skip comments */\nbreak;\ncase 3:/* skip comments */\nbreak;\ncase 4:return 4;\nbreak;\ncase 5:return 15;\nbreak;\ncase 6:return 17;\nbreak;\ncase 7:return 20;\nbreak;\ncase 8:return 21;\nbreak;\ncase 9:return 19;\nbreak;\ncase 10:return 8;\nbreak;\ncase 11:return 8;\nbreak;\ncase 12:return 5;\nbreak;\ncase 13:return 26\nbreak;\ncase 14:this.begin(\"options\");\nbreak;\ncase 15:this.popState();\nbreak;\ncase 16:return 11;\nbreak;\ncase 17:this.begin(\"string\");\nbreak;\ncase 18:this.popState();\nbreak;\ncase 19:return 23;\nbreak;\ncase 20:return 18;\nbreak;\ncase 21:return 7;\nbreak;\n}\n},\nrules: [/^(?:(\\r?\\n)+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:gitGraph\\b)/i,/^(?:commit\\b)/i,/^(?:branch\\b)/i,/^(?:merge\\b)/i,/^(?:reset\\b)/i,/^(?:checkout\\b)/i,/^(?:LR\\b)/i,/^(?:BT\\b)/i,/^(?::)/i,/^(?:\\^)/i,/^(?:options\\r?\\n)/i,/^(?:end\\r?\\n)/i,/^(?:[^\\n]+\\r?\\n)/i,/^(?:[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[a-zA-Z][-_\\.a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i],\nconditions: {\"options\":{\"rules\":[15,16],\"inclusive\":false},\"string\":{\"rules\":[18,19],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,20,21],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"info\":4,\"document\":5,\"EOF\":6,\"line\":7,\"statement\":8,\"NL\":9,\"showInfo\":10,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"info\",6:\"EOF\",9:\"NL\",10:\"showInfo\"},\nproductions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n return yy; \nbreak;\ncase 4:\n \nbreak;\ncase 6:\n yy.setInfo(true); \nbreak;\n}\n},\ntable: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])],\ndefaultActions: {4:[2,1]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\n\t// Pre-lexer code can go here\n\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 4 ;\nbreak;\ncase 1:return 9 ;\nbreak;\ncase 2:return 'space';\nbreak;\ncase 3:return 10;\nbreak;\ncase 4:return 6 ;\nbreak;\ncase 5:return 'TXT' ;\nbreak;\n}\n},\nrules: [/^(?:info\\b)/i,/^(?:[\\s\\n\\r]+)/i,/^(?:[\\s]+)/i,/^(?:showInfo\\b)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,20,21,22,23],$V6=[2,5],$V7=[1,6,11,13,20,21,22,23],$V8=[20,21,22],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,24],$Vd=[6,20,21,22,23];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"eol\":4,\"directive\":5,\"PIE\":6,\"document\":7,\"showData\":8,\"line\":9,\"statement\":10,\"txt\":11,\"value\":12,\"title\":13,\"title_value\":14,\"openDirective\":15,\"typeDirective\":16,\"closeDirective\":17,\":\":18,\"argDirective\":19,\"NEWLINE\":20,\";\":21,\"EOF\":22,\"open_directive\":23,\"type_directive\":24,\"arg_directive\":25,\"close_directive\":26,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",6:\"PIE\",8:\"showData\",11:\"txt\",12:\"value\",13:\"title\",14:\"title_value\",18:\":\",20:\"NEWLINE\",21:\";\",22:\"EOF\",23:\"open_directive\",24:\"type_directive\",25:\"arg_directive\",26:\"close_directive\"},\nproductions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[15,1],[16,1],[19,1],[17,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\nyy.setShowData(true);\nbreak;\ncase 7:\n this.$ = $$[$0-1] \nbreak;\ncase 9:\n yy.addSection($$[$0-1],yy.cleanupValue($$[$0])); \nbreak;\ncase 10:\n this.$=$$[$0].trim();yy.setTitle(this.$); \nbreak;\ncase 17:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 18:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 19:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 20:\n yy.parseDirective('}%%', 'close_directive', 'pie'); \nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{3:11,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,14]),o($V7,[2,15]),o($V7,[2,16]),{16:14,24:[1,15]},{24:[2,17]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,3],11:$Va,13:$Vb,23:$V4}),o($V5,$V6,{7:21}),{17:22,18:[1,23],26:$Vc},o([18,26],[2,18]),o($V5,[2,6]),{4:25,20:$V1,21:$V2,22:$V3},{12:[1,26]},{14:[1,27]},o($V8,[2,11]),o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,4],11:$Va,13:$Vb,23:$V4}),o($Vd,[2,12]),{19:28,25:[1,29]},o($Vd,[2,20]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),{17:30,26:$Vc},{26:[2,19]},o($Vd,[2,13])],\ndefaultActions: {9:[2,17],10:[2,1],11:[2,2],29:[2,19]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 23; \nbreak;\ncase 1: this.begin('type_directive'); return 24; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 18; \nbreak;\ncase 3: this.popState(); this.popState(); return 26; \nbreak;\ncase 4:return 25;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */{ /*console.log('');*/ }\nbreak;\ncase 7:return 20;\nbreak;\ncase 8:/* do nothing */\nbreak;\ncase 9:/* ignore */\nbreak;\ncase 10: this.begin(\"title\");return 13; \nbreak;\ncase 11: this.popState(); return \"title_value\"; \nbreak;\ncase 12: this.begin(\"string\"); \nbreak;\ncase 13: this.popState(); \nbreak;\ncase 14: return \"txt\"; \nbreak;\ncase 15:return 6;\nbreak;\ncase 16:return 8;\nbreak;\ncase 17:return \"value\";\nbreak;\ncase 18:return 22;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n\\r]+)/i,/^(?:%%[^\\n]*)/i,/^(?:[\\s]+)/i,/^(?:title\\b)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:pie\\b)/i,/^(?:showData\\b)/i,/^(?::[\\s]*[\\d]+(?:\\.[\\d]+)?)/i,/^(?:$)/i],\nconditions: {\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"title\":{\"rules\":[11],\"inclusive\":false},\"string\":{\"rules\":[13,14],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,8,9,10,12,15,16,17,18],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[1,17],$V3=[2,10],$V4=[1,21],$V5=[1,22],$V6=[1,23],$V7=[1,24],$V8=[1,25],$V9=[1,26],$Va=[1,19],$Vb=[1,27],$Vc=[1,28],$Vd=[1,31],$Ve=[66,67],$Vf=[5,8,14,35,36,37,38,39,40,48,55,57,66,67],$Vg=[5,6,8,14,35,36,37,38,39,40,48,66,67],$Vh=[1,51],$Vi=[1,52],$Vj=[1,53],$Vk=[1,54],$Vl=[1,55],$Vm=[1,56],$Vn=[1,57],$Vo=[57,58],$Vp=[1,69],$Vq=[1,65],$Vr=[1,66],$Vs=[1,67],$Vt=[1,68],$Vu=[1,70],$Vv=[1,74],$Vw=[1,75],$Vx=[1,72],$Vy=[1,73],$Vz=[5,8,14,35,36,37,38,39,40,48,66,67];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"directive\":4,\"NEWLINE\":5,\"RD\":6,\"diagram\":7,\"EOF\":8,\"openDirective\":9,\"typeDirective\":10,\"closeDirective\":11,\":\":12,\"argDirective\":13,\"open_directive\":14,\"type_directive\":15,\"arg_directive\":16,\"close_directive\":17,\"requirementDef\":18,\"elementDef\":19,\"relationshipDef\":20,\"requirementType\":21,\"requirementName\":22,\"STRUCT_START\":23,\"requirementBody\":24,\"ID\":25,\"COLONSEP\":26,\"id\":27,\"TEXT\":28,\"text\":29,\"RISK\":30,\"riskLevel\":31,\"VERIFYMTHD\":32,\"verifyType\":33,\"STRUCT_STOP\":34,\"REQUIREMENT\":35,\"FUNCTIONAL_REQUIREMENT\":36,\"INTERFACE_REQUIREMENT\":37,\"PERFORMANCE_REQUIREMENT\":38,\"PHYSICAL_REQUIREMENT\":39,\"DESIGN_CONSTRAINT\":40,\"LOW_RISK\":41,\"MED_RISK\":42,\"HIGH_RISK\":43,\"VERIFY_ANALYSIS\":44,\"VERIFY_DEMONSTRATION\":45,\"VERIFY_INSPECTION\":46,\"VERIFY_TEST\":47,\"ELEMENT\":48,\"elementName\":49,\"elementBody\":50,\"TYPE\":51,\"type\":52,\"DOCREF\":53,\"ref\":54,\"END_ARROW_L\":55,\"relationship\":56,\"LINE\":57,\"END_ARROW_R\":58,\"CONTAINS\":59,\"COPIES\":60,\"DERIVES\":61,\"SATISFIES\":62,\"VERIFIES\":63,\"REFINES\":64,\"TRACES\":65,\"unqString\":66,\"qString\":67,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"NEWLINE\",6:\"RD\",8:\"EOF\",12:\":\",14:\"open_directive\",15:\"type_directive\",16:\"arg_directive\",17:\"close_directive\",23:\"STRUCT_START\",25:\"ID\",26:\"COLONSEP\",28:\"TEXT\",30:\"RISK\",32:\"VERIFYMTHD\",34:\"STRUCT_STOP\",35:\"REQUIREMENT\",36:\"FUNCTIONAL_REQUIREMENT\",37:\"INTERFACE_REQUIREMENT\",38:\"PERFORMANCE_REQUIREMENT\",39:\"PHYSICAL_REQUIREMENT\",40:\"DESIGN_CONSTRAINT\",41:\"LOW_RISK\",42:\"MED_RISK\",43:\"HIGH_RISK\",44:\"VERIFY_ANALYSIS\",45:\"VERIFY_DEMONSTRATION\",46:\"VERIFY_INSPECTION\",47:\"VERIFY_TEST\",48:\"ELEMENT\",51:\"TYPE\",53:\"DOCREF\",55:\"END_ARROW_L\",57:\"LINE\",58:\"END_ARROW_R\",59:\"CONTAINS\",60:\"COPIES\",61:\"DERIVES\",62:\"SATISFIES\",63:\"VERIFIES\",64:\"REFINES\",65:\"TRACES\",66:\"unqString\",67:\"qString\"},\nproductions_: [0,[3,3],[3,2],[3,4],[4,3],[4,5],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[18,5],[24,5],[24,5],[24,5],[24,5],[24,2],[24,1],[21,1],[21,1],[21,1],[21,1],[21,1],[21,1],[31,1],[31,1],[31,1],[33,1],[33,1],[33,1],[33,1],[19,5],[50,5],[50,5],[50,2],[50,1],[20,5],[20,5],[56,1],[56,1],[56,1],[56,1],[56,1],[56,1],[56,1],[22,1],[22,1],[27,1],[27,1],[29,1],[29,1],[49,1],[49,1],[52,1],[52,1],[54,1],[54,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 6:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 7:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 8:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 9:\n yy.parseDirective('}%%', 'close_directive', 'pie'); \nbreak;\ncase 10:\n this.$ = [] \nbreak;\ncase 16:\n yy.addRequirement($$[$0-3], $$[$0-4]) \nbreak;\ncase 17:\n yy.setNewReqId($$[$0-2]); \nbreak;\ncase 18:\n yy.setNewReqText($$[$0-2]); \nbreak;\ncase 19:\n yy.setNewReqRisk($$[$0-2]); \nbreak;\ncase 20:\n yy.setNewReqVerifyMethod($$[$0-2]); \nbreak;\ncase 23:\n this.$=yy.RequirementType.REQUIREMENT;\nbreak;\ncase 24:\n this.$=yy.RequirementType.FUNCTIONAL_REQUIREMENT;\nbreak;\ncase 25:\n this.$=yy.RequirementType.INTERFACE_REQUIREMENT;\nbreak;\ncase 26:\n this.$=yy.RequirementType.PERFORMANCE_REQUIREMENT;\nbreak;\ncase 27:\n this.$=yy.RequirementType.PHYSICAL_REQUIREMENT;\nbreak;\ncase 28:\n this.$=yy.RequirementType.DESIGN_CONSTRAINT;\nbreak;\ncase 29:\n this.$=yy.RiskLevel.LOW_RISK;\nbreak;\ncase 30:\n this.$=yy.RiskLevel.MED_RISK;\nbreak;\ncase 31:\n this.$=yy.RiskLevel.HIGH_RISK;\nbreak;\ncase 32:\n this.$=yy.VerifyType.VERIFY_ANALYSIS;\nbreak;\ncase 33:\n this.$=yy.VerifyType.VERIFY_DEMONSTRATION;\nbreak;\ncase 34:\n this.$=yy.VerifyType.VERIFY_INSPECTION;\nbreak;\ncase 35:\n this.$=yy.VerifyType.VERIFY_TEST;\nbreak;\ncase 36:\n yy.addElement($$[$0-3]) \nbreak;\ncase 37:\n yy.setNewElementType($$[$0-2]); \nbreak;\ncase 38:\n yy.setNewElementDocRef($$[$0-2]); \nbreak;\ncase 41:\n yy.addRelationship($$[$0-2], $$[$0], $$[$0-4]) \nbreak;\ncase 42:\n yy.addRelationship($$[$0-2], $$[$0-4], $$[$0]) \nbreak;\ncase 43:\n this.$=yy.Relationships.CONTAINS;\nbreak;\ncase 44:\n this.$=yy.Relationships.COPIES;\nbreak;\ncase 45:\n this.$=yy.Relationships.DERIVES;\nbreak;\ncase 46:\n this.$=yy.Relationships.SATISFIES;\nbreak;\ncase 47:\n this.$=yy.Relationships.VERIFIES;\nbreak;\ncase 48:\n this.$=yy.Relationships.REFINES;\nbreak;\ncase 49:\n this.$=yy.Relationships.TRACES;\nbreak;\n}\n},\ntable: [{3:1,4:2,6:$V0,9:4,14:$V1},{1:[3]},{3:7,4:2,5:[1,6],6:$V0,9:4,14:$V1},{5:[1,8]},{10:9,15:[1,10]},{15:[2,6]},{3:11,4:2,6:$V0,9:4,14:$V1},{1:[2,2]},{4:16,5:$V2,7:12,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{11:29,12:[1,30],17:$Vd},o([12,17],[2,7]),{1:[2,1]},{8:[1,32]},{4:16,5:$V2,7:33,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:34,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:35,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:36,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:37,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{22:38,66:[1,39],67:[1,40]},{49:41,66:[1,42],67:[1,43]},{55:[1,44],57:[1,45]},o($Ve,[2,23]),o($Ve,[2,24]),o($Ve,[2,25]),o($Ve,[2,26]),o($Ve,[2,27]),o($Ve,[2,28]),o($Vf,[2,52]),o($Vf,[2,53]),o($Vg,[2,4]),{13:46,16:[1,47]},o($Vg,[2,9]),{1:[2,3]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{23:[1,48]},{23:[2,50]},{23:[2,51]},{23:[1,49]},{23:[2,56]},{23:[2,57]},{56:50,59:$Vh,60:$Vi,61:$Vj,62:$Vk,63:$Vl,64:$Vm,65:$Vn},{56:58,59:$Vh,60:$Vi,61:$Vj,62:$Vk,63:$Vl,64:$Vm,65:$Vn},{11:59,17:$Vd},{17:[2,8]},{5:[1,60]},{5:[1,61]},{57:[1,62]},o($Vo,[2,43]),o($Vo,[2,44]),o($Vo,[2,45]),o($Vo,[2,46]),o($Vo,[2,47]),o($Vo,[2,48]),o($Vo,[2,49]),{58:[1,63]},o($Vg,[2,5]),{5:$Vp,24:64,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vv,34:$Vw,50:71,51:$Vx,53:$Vy},{27:76,66:$Vb,67:$Vc},{27:77,66:$Vb,67:$Vc},o($Vz,[2,16]),{26:[1,78]},{26:[1,79]},{26:[1,80]},{26:[1,81]},{5:$Vp,24:82,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},o($Vz,[2,22]),o($Vz,[2,36]),{26:[1,83]},{26:[1,84]},{5:$Vv,34:$Vw,50:85,51:$Vx,53:$Vy},o($Vz,[2,40]),o($Vz,[2,41]),o($Vz,[2,42]),{27:86,66:$Vb,67:$Vc},{29:87,66:[1,88],67:[1,89]},{31:90,41:[1,91],42:[1,92],43:[1,93]},{33:94,44:[1,95],45:[1,96],46:[1,97],47:[1,98]},o($Vz,[2,21]),{52:99,66:[1,100],67:[1,101]},{54:102,66:[1,103],67:[1,104]},o($Vz,[2,39]),{5:[1,105]},{5:[1,106]},{5:[2,54]},{5:[2,55]},{5:[1,107]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[1,108]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[2,35]},{5:[1,109]},{5:[2,58]},{5:[2,59]},{5:[1,110]},{5:[2,60]},{5:[2,61]},{5:$Vp,24:111,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vp,24:112,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vp,24:113,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vp,24:114,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vv,34:$Vw,50:115,51:$Vx,53:$Vy},{5:$Vv,34:$Vw,50:116,51:$Vx,53:$Vy},o($Vz,[2,17]),o($Vz,[2,18]),o($Vz,[2,19]),o($Vz,[2,20]),o($Vz,[2,37]),o($Vz,[2,38])],\ndefaultActions: {5:[2,6],7:[2,2],11:[2,1],32:[2,3],33:[2,11],34:[2,12],35:[2,13],36:[2,14],37:[2,15],39:[2,50],40:[2,51],42:[2,56],43:[2,57],47:[2,8],88:[2,54],89:[2,55],91:[2,29],92:[2,30],93:[2,31],95:[2,32],96:[2,33],97:[2,34],98:[2,35],100:[2,58],101:[2,59],103:[2,60],104:[2,61]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 14; \nbreak;\ncase 1: this.begin('type_directive'); return 15; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 12; \nbreak;\ncase 3: this.popState(); this.popState(); return 17; \nbreak;\ncase 4:return 16;\nbreak;\ncase 5:return 5;\nbreak;\ncase 6:/* skip all whitespace */\nbreak;\ncase 7:/* skip comments */\nbreak;\ncase 8:/* skip comments */\nbreak;\ncase 9:return 8;\nbreak;\ncase 10:return 6;\nbreak;\ncase 11:return 23;\nbreak;\ncase 12:return 34;\nbreak;\ncase 13:return 26;\nbreak;\ncase 14:return 25;\nbreak;\ncase 15:return 28;\nbreak;\ncase 16:return 30;\nbreak;\ncase 17:return 32;\nbreak;\ncase 18:return 35;\nbreak;\ncase 19:return 36;\nbreak;\ncase 20:return 37;\nbreak;\ncase 21:return 38;\nbreak;\ncase 22:return 39;\nbreak;\ncase 23:return 40;\nbreak;\ncase 24:return 41;\nbreak;\ncase 25:return 42;\nbreak;\ncase 26:return 43;\nbreak;\ncase 27:return 44;\nbreak;\ncase 28:return 45;\nbreak;\ncase 29:return 46;\nbreak;\ncase 30:return 47;\nbreak;\ncase 31:return 48;\nbreak;\ncase 32:return 59;\nbreak;\ncase 33:return 60;\nbreak;\ncase 34:return 61;\nbreak;\ncase 35:return 62;\nbreak;\ncase 36:return 63;\nbreak;\ncase 37:return 64;\nbreak;\ncase 38:return 65;\nbreak;\ncase 39:return 51;\nbreak;\ncase 40:return 53;\nbreak;\ncase 41:return 55;\nbreak;\ncase 42:return 58;\nbreak;\ncase 43:return 57;\nbreak;\ncase 44: this.begin(\"string\"); \nbreak;\ncase 45: this.popState(); \nbreak;\ncase 46: return \"qString\"; \nbreak;\ncase 47: yy_.yytext = yy_.yytext.trim(); return 66;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:(\\r?\\n)+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\\b)/i,/^(?:\\{)/i,/^(?:\\})/i,/^(?::)/i,/^(?:id\\b)/i,/^(?:text\\b)/i,/^(?:risk\\b)/i,/^(?:verifyMethod\\b)/i,/^(?:requirement\\b)/i,/^(?:functionalRequirement\\b)/i,/^(?:interfaceRequirement\\b)/i,/^(?:performanceRequirement\\b)/i,/^(?:physicalRequirement\\b)/i,/^(?:designConstraint\\b)/i,/^(?:low\\b)/i,/^(?:medium\\b)/i,/^(?:high\\b)/i,/^(?:analysis\\b)/i,/^(?:demonstration\\b)/i,/^(?:inspection\\b)/i,/^(?:test\\b)/i,/^(?:element\\b)/i,/^(?:contains\\b)/i,/^(?:copies\\b)/i,/^(?:derives\\b)/i,/^(?:satisfies\\b)/i,/^(?:verifies\\b)/i,/^(?:refines\\b)/i,/^(?:traces\\b)/i,/^(?:type\\b)/i,/^(?:docref\\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[\\w][^\\r\\n\\{\\<\\>\\-\\=]*)/i],\nconditions: {\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"unqString\":{\"rules\":[],\"inclusive\":false},\"token\":{\"rules\":[],\"inclusive\":false},\"string\":{\"rules\":[45,46],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,47],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,19],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,29],$Vd=[1,30],$Ve=[1,31],$Vf=[1,32],$Vg=[1,33],$Vh=[1,34],$Vi=[1,37],$Vj=[1,38],$Vk=[1,39],$Vl=[1,40],$Vm=[1,41],$Vn=[1,42],$Vo=[1,45],$Vp=[1,4,5,16,20,22,23,24,30,32,33,34,35,36,38,40,41,42,46,47,48,49,57,67],$Vq=[1,58],$Vr=[4,5,16,20,22,23,24,30,32,33,34,35,36,38,42,46,47,48,49,57,67],$Vs=[4,5,16,20,22,23,24,30,32,33,34,35,36,38,41,42,46,47,48,49,57,67],$Vt=[4,5,16,20,22,23,24,30,32,33,34,35,36,38,40,42,46,47,48,49,57,67],$Vu=[55,56,57],$Vv=[1,4,5,7,16,20,22,23,24,30,32,33,34,35,36,38,40,41,42,46,47,48,49,57,67];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"SPACE\":4,\"NEWLINE\":5,\"directive\":6,\"SD\":7,\"document\":8,\"line\":9,\"statement\":10,\"openDirective\":11,\"typeDirective\":12,\"closeDirective\":13,\":\":14,\"argDirective\":15,\"participant\":16,\"actor\":17,\"AS\":18,\"restOfLine\":19,\"participant_actor\":20,\"signal\":21,\"autonumber\":22,\"activate\":23,\"deactivate\":24,\"note_statement\":25,\"links_statement\":26,\"link_statement\":27,\"properties_statement\":28,\"details_statement\":29,\"title\":30,\"text2\":31,\"loop\":32,\"end\":33,\"rect\":34,\"opt\":35,\"alt\":36,\"else_sections\":37,\"par\":38,\"par_sections\":39,\"and\":40,\"else\":41,\"note\":42,\"placement\":43,\"over\":44,\"actor_pair\":45,\"links\":46,\"link\":47,\"properties\":48,\"details\":49,\"spaceList\":50,\",\":51,\"left_of\":52,\"right_of\":53,\"signaltype\":54,\"+\":55,\"-\":56,\"ACTOR\":57,\"SOLID_OPEN_ARROW\":58,\"DOTTED_OPEN_ARROW\":59,\"SOLID_ARROW\":60,\"DOTTED_ARROW\":61,\"SOLID_CROSS\":62,\"DOTTED_CROSS\":63,\"SOLID_POINT\":64,\"DOTTED_POINT\":65,\"TXT\":66,\"open_directive\":67,\"type_directive\":68,\"arg_directive\":69,\"close_directive\":70,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"SPACE\",5:\"NEWLINE\",7:\"SD\",14:\":\",16:\"participant\",18:\"AS\",19:\"restOfLine\",20:\"participant_actor\",22:\"autonumber\",23:\"activate\",24:\"deactivate\",30:\"title\",32:\"loop\",33:\"end\",34:\"rect\",35:\"opt\",36:\"alt\",38:\"par\",40:\"and\",41:\"else\",42:\"note\",44:\"over\",46:\"links\",47:\"link\",48:\"properties\",49:\"details\",51:\",\",52:\"left_of\",53:\"right_of\",55:\"+\",56:\"-\",57:\"ACTOR\",58:\"SOLID_OPEN_ARROW\",59:\"DOTTED_OPEN_ARROW\",60:\"SOLID_ARROW\",61:\"DOTTED_ARROW\",62:\"SOLID_CROSS\",63:\"DOTTED_CROSS\",64:\"SOLID_POINT\",65:\"DOTTED_POINT\",66:\"TXT\",67:\"open_directive\",68:\"type_directive\",69:\"arg_directive\",70:\"close_directive\"},\nproductions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,1],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,3],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[39,1],[39,4],[37,1],[37,4],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[50,2],[50,1],[45,3],[45,1],[43,1],[43,1],[21,5],[21,5],[21,4],[17,1],[54,1],[54,1],[54,1],[54,1],[54,1],[54,1],[54,1],[54,1],[31,1],[11,1],[12,1],[15,1],[13,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\n yy.apply($$[$0]);return $$[$0]; \nbreak;\ncase 5:\n this.$ = [] \nbreak;\ncase 6:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 7: case 8:\n this.$ = $$[$0] \nbreak;\ncase 9:\n this.$=[]; \nbreak;\ncase 12:\n$$[$0-3].type='addParticipant';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3];\nbreak;\ncase 13:\n$$[$0-1].type='addParticipant';this.$=$$[$0-1];\nbreak;\ncase 14:\n$$[$0-3].type='addActor';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3];\nbreak;\ncase 15:\n$$[$0-1].type='addActor'; this.$=$$[$0-1];\nbreak;\ncase 17:\nyy.enableSequenceNumbers()\nbreak;\ncase 18:\nthis.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]};\nbreak;\ncase 19:\nthis.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]};\nbreak;\ncase 25:\nthis.$=[{type:'setTitle', text:$$[$0-1]}]\nbreak;\ncase 26:\n\n\t\t$$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START});\n\t\t$$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 27:\n\n\t\t$$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START });\n\t\t$$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END });\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 28:\n\n\t\t$$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START});\n\t\t$$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 29:\n\n\t\t// Alt start\n\t\t$$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START});\n\t\t// Content in alt is already in $$[$0-1]\n\t\t// End\n\t\t$$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 30:\n\n\t\t// Parallel start\n\t\t$$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START});\n\t\t// Content in par is already in $$[$0-1]\n\t\t// End\n\t\t$$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 33:\n this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); \nbreak;\ncase 35:\n this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); \nbreak;\ncase 36:\n\n\t\tthis.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}];\nbreak;\ncase 37:\n\n\t\t// Coerce actor_pair into a [to, from, ...] array\n\t\t$$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2);\n\t\t$$[$0-2][0] = $$[$0-2][0].actor;\n\t\t$$[$0-2][1] = $$[$0-2][1].actor;\n\t\tthis.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}];\nbreak;\ncase 38:\n\n\t\tthis.$ = [$$[$0-1], {type:'addLinks', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 39:\n\n\t\tthis.$ = [$$[$0-1], {type:'addALink', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 40:\n\n\t\tthis.$ = [$$[$0-1], {type:'addProperties', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 41:\n\n\t\tthis.$ = [$$[$0-1], {type:'addDetails', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 44:\n this.$ = [$$[$0-2], $$[$0]]; \nbreak;\ncase 45:\n this.$ = $$[$0]; \nbreak;\ncase 46:\n this.$ = yy.PLACEMENT.LEFTOF; \nbreak;\ncase 47:\n this.$ = yy.PLACEMENT.RIGHTOF; \nbreak;\ncase 48:\n this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},\n\t {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}\n\t ]\nbreak;\ncase 49:\n this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},\n\t {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]}\n\t ]\nbreak;\ncase 50:\n this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}]\nbreak;\ncase 51:\nthis.$={ type: 'addParticipant', actor:$$[$0]}\nbreak;\ncase 52:\n this.$ = yy.LINETYPE.SOLID_OPEN; \nbreak;\ncase 53:\n this.$ = yy.LINETYPE.DOTTED_OPEN; \nbreak;\ncase 54:\n this.$ = yy.LINETYPE.SOLID; \nbreak;\ncase 55:\n this.$ = yy.LINETYPE.DOTTED; \nbreak;\ncase 56:\n this.$ = yy.LINETYPE.SOLID_CROSS; \nbreak;\ncase 57:\n this.$ = yy.LINETYPE.DOTTED_CROSS; \nbreak;\ncase 58:\n this.$ = yy.LINETYPE.SOLID_POINT; \nbreak;\ncase 59:\n this.$ = yy.LINETYPE.DOTTED_POINT; \nbreak;\ncase 60:\nthis.$ = yy.parseMessage($$[$0].trim().substring(1)) \nbreak;\ncase 61:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 62:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 63:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 64:\n yy.parseDirective('}%%', 'close_directive', 'sequence'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,67:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,67:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,67:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,67:$V3},o([1,4,5,16,20,22,23,24,30,32,34,35,36,38,42,46,47,48,49,57,67],$V4,{8:11}),{12:12,68:[1,13]},{68:[2,61]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:35,9:14,10:16,11:6,16:$V7,17:36,20:$V8,21:20,22:$V9,23:$Va,24:$Vb,25:24,26:25,27:26,28:27,29:28,30:$Vc,32:$Vd,34:$Ve,35:$Vf,36:$Vg,38:$Vh,42:$Vi,46:$Vj,47:$Vk,48:$Vl,49:$Vm,57:$Vn,67:$V3},{13:43,14:[1,44],70:$Vo},o([14,70],[2,62]),o($Vp,[2,6]),{6:35,10:46,11:6,16:$V7,17:36,20:$V8,21:20,22:$V9,23:$Va,24:$Vb,25:24,26:25,27:26,28:27,29:28,30:$Vc,32:$Vd,34:$Ve,35:$Vf,36:$Vg,38:$Vh,42:$Vi,46:$Vj,47:$Vk,48:$Vl,49:$Vm,57:$Vn,67:$V3},o($Vp,[2,8]),o($Vp,[2,9]),{17:47,57:$Vn},{17:48,57:$Vn},{5:[1,49]},o($Vp,[2,17]),{17:50,57:$Vn},{17:51,57:$Vn},{5:[1,52]},{5:[1,53]},{5:[1,54]},{5:[1,55]},{5:[1,56]},{31:57,66:$Vq},{19:[1,59]},{19:[1,60]},{19:[1,61]},{19:[1,62]},{19:[1,63]},o($Vp,[2,31]),{54:64,58:[1,65],59:[1,66],60:[1,67],61:[1,68],62:[1,69],63:[1,70],64:[1,71],65:[1,72]},{43:73,44:[1,74],52:[1,75],53:[1,76]},{17:77,57:$Vn},{17:78,57:$Vn},{17:79,57:$Vn},{17:80,57:$Vn},o([5,18,51,58,59,60,61,62,63,64,65,66],[2,51]),{5:[1,81]},{15:82,69:[1,83]},{5:[2,64]},o($Vp,[2,7]),{5:[1,85],18:[1,84]},{5:[1,87],18:[1,86]},o($Vp,[2,16]),{5:[1,88]},{5:[1,89]},o($Vp,[2,20]),o($Vp,[2,21]),o($Vp,[2,22]),o($Vp,[2,23]),o($Vp,[2,24]),{5:[1,90]},{5:[2,60]},o($Vr,$V4,{8:91}),o($Vr,$V4,{8:92}),o($Vr,$V4,{8:93}),o($Vs,$V4,{37:94,8:95}),o($Vt,$V4,{39:96,8:97}),{17:100,55:[1,98],56:[1,99],57:$Vn},o($Vu,[2,52]),o($Vu,[2,53]),o($Vu,[2,54]),o($Vu,[2,55]),o($Vu,[2,56]),o($Vu,[2,57]),o($Vu,[2,58]),o($Vu,[2,59]),{17:101,57:$Vn},{17:103,45:102,57:$Vn},{57:[2,46]},{57:[2,47]},{31:104,66:$Vq},{31:105,66:$Vq},{31:106,66:$Vq},{31:107,66:$Vq},o($Vv,[2,10]),{13:108,70:$Vo},{70:[2,63]},{19:[1,109]},o($Vp,[2,13]),{19:[1,110]},o($Vp,[2,15]),o($Vp,[2,18]),o($Vp,[2,19]),o($Vp,[2,25]),{4:$V5,5:$V6,6:35,9:14,10:16,11:6,16:$V7,17:36,20:$V8,21:20,22:$V9,23:$Va,24:$Vb,25:24,26:25,27:26,28:27,29:28,30:$Vc,32:$Vd,33:[1,111],34:$Ve,35:$Vf,36:$Vg,38:$Vh,42:$Vi,46:$Vj,47:$Vk,48:$Vl,49:$Vm,57:$Vn,67:$V3},{4:$V5,5:$V6,6:35,9:14,10:16,11:6,16:$V7,17:36,20:$V8,21:20,22:$V9,23:$Va,24:$Vb,25:24,26:25,27:26,28:27,29:28,30:$Vc,32:$Vd,33:[1,112],34:$Ve,35:$Vf,36:$Vg,38:$Vh,42:$Vi,46:$Vj,47:$Vk,48:$Vl,49:$Vm,57:$Vn,67:$V3},{4:$V5,5:$V6,6:35,9:14,10:16,11:6,16:$V7,17:36,20:$V8,21:20,22:$V9,23:$Va,24:$Vb,25:24,26:25,27:26,28:27,29:28,30:$Vc,32:$Vd,33:[1,113],34:$Ve,35:$Vf,36:$Vg,38:$Vh,42:$Vi,46:$Vj,47:$Vk,48:$Vl,49:$Vm,57:$Vn,67:$V3},{33:[1,114]},{4:$V5,5:$V6,6:35,9:14,10:16,11:6,16:$V7,17:36,20:$V8,21:20,22:$V9,23:$Va,24:$Vb,25:24,26:25,27:26,28:27,29:28,30:$Vc,32:$Vd,33:[2,34],34:$Ve,35:$Vf,36:$Vg,38:$Vh,41:[1,115],42:$Vi,46:$Vj,47:$Vk,48:$Vl,49:$Vm,57:$Vn,67:$V3},{33:[1,116]},{4:$V5,5:$V6,6:35,9:14,10:16,11:6,16:$V7,17:36,20:$V8,21:20,22:$V9,23:$Va,24:$Vb,25:24,26:25,27:26,28:27,29:28,30:$Vc,32:$Vd,33:[2,32],34:$Ve,35:$Vf,36:$Vg,38:$Vh,40:[1,117],42:$Vi,46:$Vj,47:$Vk,48:$Vl,49:$Vm,57:$Vn,67:$V3},{17:118,57:$Vn},{17:119,57:$Vn},{31:120,66:$Vq},{31:121,66:$Vq},{31:122,66:$Vq},{51:[1,123],66:[2,45]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},{5:[1,124]},{5:[1,125]},{5:[1,126]},o($Vp,[2,26]),o($Vp,[2,27]),o($Vp,[2,28]),o($Vp,[2,29]),{19:[1,127]},o($Vp,[2,30]),{19:[1,128]},{31:129,66:$Vq},{31:130,66:$Vq},{5:[2,50]},{5:[2,36]},{5:[2,37]},{17:131,57:$Vn},o($Vv,[2,11]),o($Vp,[2,12]),o($Vp,[2,14]),o($Vs,$V4,{8:95,37:132}),o($Vt,$V4,{8:97,39:133}),{5:[2,48]},{5:[2,49]},{66:[2,44]},{33:[2,35]},{33:[2,33]}],\ndefaultActions: {7:[2,61],8:[2,1],9:[2,2],10:[2,3],45:[2,64],58:[2,60],75:[2,46],76:[2,47],83:[2,63],104:[2,38],105:[2,39],106:[2,40],107:[2,41],120:[2,50],121:[2,36],122:[2,37],129:[2,48],130:[2,49],131:[2,44],132:[2,35],133:[2,33]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 67; \nbreak;\ncase 1: this.begin('type_directive'); return 68; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 14; \nbreak;\ncase 3: this.popState(); this.popState(); return 70; \nbreak;\ncase 4:return 69;\nbreak;\ncase 5:return 5;\nbreak;\ncase 6:/* skip all whitespace */\nbreak;\ncase 7:/* skip same-line whitespace */\nbreak;\ncase 8:/* skip comments */\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:/* skip comments */\nbreak;\ncase 11: this.begin('ID'); return 16; \nbreak;\ncase 12: this.begin('ID'); return 20; \nbreak;\ncase 13: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 57; \nbreak;\ncase 14: this.popState(); this.popState(); this.begin('LINE'); return 18; \nbreak;\ncase 15: this.popState(); this.popState(); return 5; \nbreak;\ncase 16: this.begin('LINE'); return 32; \nbreak;\ncase 17: this.begin('LINE'); return 34; \nbreak;\ncase 18: this.begin('LINE'); return 35; \nbreak;\ncase 19: this.begin('LINE'); return 36; \nbreak;\ncase 20: this.begin('LINE'); return 41; \nbreak;\ncase 21: this.begin('LINE'); return 38; \nbreak;\ncase 22: this.begin('LINE'); return 40; \nbreak;\ncase 23: this.popState(); return 19; \nbreak;\ncase 24:return 33;\nbreak;\ncase 25:return 52;\nbreak;\ncase 26:return 53;\nbreak;\ncase 27:return 46;\nbreak;\ncase 28:return 47;\nbreak;\ncase 29:return 48;\nbreak;\ncase 30:return 49;\nbreak;\ncase 31:return 44;\nbreak;\ncase 32:return 42;\nbreak;\ncase 33: this.begin('ID'); return 23; \nbreak;\ncase 34: this.begin('ID'); return 24; \nbreak;\ncase 35:return 30;\nbreak;\ncase 36:return 7;\nbreak;\ncase 37:return 22;\nbreak;\ncase 38:return 51;\nbreak;\ncase 39:return 5;\nbreak;\ncase 40: yy_.yytext = yy_.yytext.trim(); return 57; \nbreak;\ncase 41:return 60;\nbreak;\ncase 42:return 61;\nbreak;\ncase 43:return 58;\nbreak;\ncase 44:return 59;\nbreak;\ncase 45:return 62;\nbreak;\ncase 46:return 63;\nbreak;\ncase 47:return 64;\nbreak;\ncase 48:return 65;\nbreak;\ncase 49:return 66;\nbreak;\ncase 50:return 55;\nbreak;\ncase 51:return 56;\nbreak;\ncase 52:return 5;\nbreak;\ncase 53:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:((?!\\n)\\s)+)/i,/^(?:#[^\\n]*)/i,/^(?:%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:participant\\b)/i,/^(?:actor\\b)/i,/^(?:[^\\->:\\n,;]+?(?=((?!\\n)\\s)+as(?!\\n)\\s|[#\\n;]|$))/i,/^(?:as\\b)/i,/^(?:(?:))/i,/^(?:loop\\b)/i,/^(?:rect\\b)/i,/^(?:opt\\b)/i,/^(?:alt\\b)/i,/^(?:else\\b)/i,/^(?:par\\b)/i,/^(?:and\\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\\n;]*)/i,/^(?:end\\b)/i,/^(?:left of\\b)/i,/^(?:right of\\b)/i,/^(?:links\\b)/i,/^(?:link\\b)/i,/^(?:properties\\b)/i,/^(?:details\\b)/i,/^(?:over\\b)/i,/^(?:note\\b)/i,/^(?:activate\\b)/i,/^(?:deactivate\\b)/i,/^(?:title\\b)/i,/^(?:sequenceDiagram\\b)/i,/^(?:autonumber\\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\\+\\->:\\n,;]+((?!(-x|--x|-\\)|--\\)))[\\-]*[^\\+\\->:\\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\\)])/i,/^(?:--[\\)])/i,/^(?::(?:(?:no)?wrap)?[^#\\n;]+)/i,/^(?:\\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"open_directive\":{\"rules\":[1,8],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3,8],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4,8],\"inclusive\":false},\"ID\":{\"rules\":[7,8,13],\"inclusive\":false},\"ALIAS\":{\"rules\":[7,8,14,15],\"inclusive\":false},\"LINE\":{\"rules\":[7,8,23],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,8,9,10,11,12,16,17,18,19,20,21,22,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,30],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,32],$Vi=[1,33],$Vj=[1,34],$Vk=[1,35],$Vl=[1,31],$Vm=[1,38],$Vn=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vo=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vp=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vq=[4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"SPACE\":4,\"NL\":5,\"directive\":6,\"SD\":7,\"document\":8,\"line\":9,\"statement\":10,\"idStatement\":11,\"DESCR\":12,\"-->\":13,\"HIDE_EMPTY\":14,\"scale\":15,\"WIDTH\":16,\"COMPOSIT_STATE\":17,\"STRUCT_START\":18,\"STRUCT_STOP\":19,\"STATE_DESCR\":20,\"AS\":21,\"ID\":22,\"FORK\":23,\"JOIN\":24,\"CHOICE\":25,\"CONCURRENT\":26,\"note\":27,\"notePosition\":28,\"NOTE_TEXT\":29,\"direction\":30,\"openDirective\":31,\"typeDirective\":32,\"closeDirective\":33,\":\":34,\"argDirective\":35,\"direction_tb\":36,\"direction_bt\":37,\"direction_rl\":38,\"direction_lr\":39,\"eol\":40,\";\":41,\"EDGE_STATE\":42,\"left_of\":43,\"right_of\":44,\"open_directive\":45,\"type_directive\":46,\"arg_directive\":47,\"close_directive\":48,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"SPACE\",5:\"NL\",7:\"SD\",12:\"DESCR\",13:\"-->\",14:\"HIDE_EMPTY\",15:\"scale\",16:\"WIDTH\",17:\"COMPOSIT_STATE\",18:\"STRUCT_START\",19:\"STRUCT_STOP\",20:\"STATE_DESCR\",21:\"AS\",22:\"ID\",23:\"FORK\",24:\"JOIN\",25:\"CHOICE\",26:\"CONCURRENT\",27:\"note\",29:\"NOTE_TEXT\",34:\":\",36:\"direction_tb\",37:\"direction_bt\",38:\"direction_rl\",39:\"direction_lr\",41:\";\",42:\"EDGE_STATE\",43:\"left_of\",44:\"right_of\",45:\"open_directive\",46:\"type_directive\",47:\"arg_directive\",48:\"close_directive\"},\nproductions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[40,1],[40,1],[11,1],[11,1],[28,1],[28,1],[31,1],[32,1],[35,1],[33,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\n /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0]; \nbreak;\ncase 5:\n this.$ = [] \nbreak;\ncase 6:\n\n if($$[$0]!='nl'){\n $$[$0-1].push($$[$0]);this.$ = $$[$0-1]\n }\n // console.warn('Got document',$$[$0-1], $$[$0]);\n \nbreak;\ncase 7: case 8:\n this.$ = $$[$0] \nbreak;\ncase 9:\n this.$='nl';\nbreak;\ncase 10:\n /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''};\nbreak;\ncase 11:\n /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: yy.trimColon($$[$0])};\nbreak;\ncase 12:\n\n /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/\n this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}};\n \nbreak;\ncase 13:\n\n /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/\n this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()};\n \nbreak;\ncase 17:\n\n /* console.warn('Adding document for state without id ', $$[$0-3]);*/\n this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] }\n \nbreak;\ncase 18:\n\n var id=$$[$0];\n var description = $$[$0-2].trim();\n if($$[$0].match(':')){\n var parts = $$[$0].split(':');\n id=parts[0];\n description = [description, parts[1]];\n }\n this.$={stmt: 'state', id: id, type: 'default', description: description};\n\n \nbreak;\ncase 19:\n\n // console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]);\n this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] }\n \nbreak;\ncase 20:\n\n this.$={ stmt: 'state', id: $$[$0], type: 'fork' }\n \nbreak;\ncase 21:\n\n this.$={ stmt: 'state', id: $$[$0], type: 'join' }\n \nbreak;\ncase 22:\n\n this.$={ stmt: 'state', id: $$[$0], type: 'choice' }\n \nbreak;\ncase 23:\n\n this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' }\n \nbreak;\ncase 24:\n\n /* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/\n this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}};\n \nbreak;\ncase 30:\n yy.setDirection('TB');this.$={stmt:'dir', value:'TB'};\nbreak;\ncase 31:\n yy.setDirection('BT');this.$={stmt:'dir', value:'BT'};\nbreak;\ncase 32:\n yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'};\nbreak;\ncase 33:\n yy.setDirection('LR');this.$={stmt:'dir', value:'LR'};\nbreak;\ncase 36: case 37:\nthis.$=$$[$0];\nbreak;\ncase 40:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 41:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 42:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 43:\n yy.parseDirective('}%%', 'close_directive', 'state'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,36,37,38,39,42,45],$V4,{8:11}),{32:12,46:[1,13]},{46:[2,40]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},{33:36,34:[1,37],48:$Vm},o([34,48],[2,41]),o($Vn,[2,6]),{6:28,10:39,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,8]),o($Vn,[2,9]),o($Vn,[2,10],{12:[1,40],13:[1,41]}),o($Vn,[2,14]),{16:[1,42]},o($Vn,[2,16],{18:[1,43]}),{21:[1,44]},o($Vn,[2,20]),o($Vn,[2,21]),o($Vn,[2,22]),o($Vn,[2,23]),{28:45,29:[1,46],43:[1,47],44:[1,48]},o($Vn,[2,26]),o($Vn,[2,27]),o($Vo,[2,36]),o($Vo,[2,37]),o($Vn,[2,30]),o($Vn,[2,31]),o($Vn,[2,32]),o($Vn,[2,33]),o($Vp,[2,28]),{35:49,47:[1,50]},o($Vp,[2,43]),o($Vn,[2,7]),o($Vn,[2,11]),{11:51,22:$Vb,42:$Vl},o($Vn,[2,15]),o($Vq,$V4,{8:52}),{22:[1,53]},{22:[1,54]},{21:[1,55]},{22:[2,38]},{22:[2,39]},{33:56,48:$Vm},{48:[2,42]},o($Vn,[2,12],{12:[1,57]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,58],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,18],{18:[1,59]}),{29:[1,60]},{22:[1,61]},o($Vp,[2,29]),o($Vn,[2,13]),o($Vn,[2,17]),o($Vq,$V4,{8:62}),o($Vn,[2,24]),o($Vn,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,63],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,19])],\ndefaultActions: {7:[2,40],8:[2,1],9:[2,2],10:[2,3],47:[2,38],48:[2,39],50:[2,42]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 36;\nbreak;\ncase 1:return 37;\nbreak;\ncase 2:return 38;\nbreak;\ncase 3:return 39;\nbreak;\ncase 4: this.begin('open_directive'); return 45; \nbreak;\ncase 5: this.begin('type_directive'); return 46; \nbreak;\ncase 6: this.popState(); this.begin('arg_directive'); return 34; \nbreak;\ncase 7: this.popState(); this.popState(); return 48; \nbreak;\ncase 8:return 47;\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:/* skip comments */{ /*console.log('Crap after close');*/ }\nbreak;\ncase 11:return 5;\nbreak;\ncase 12:/* skip all whitespace */\nbreak;\ncase 13:/* skip same-line whitespace */\nbreak;\ncase 14:/* skip comments */\nbreak;\ncase 15:/* skip comments */\nbreak;\ncase 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; \nbreak;\ncase 17:return 16;\nbreak;\ncase 18:this.popState();\nbreak;\ncase 19: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE'); \nbreak;\ncase 20:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23;\nbreak;\ncase 21:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;\nbreak;\ncase 22:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;\nbreak;\ncase 23:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23;\nbreak;\ncase 24:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;\nbreak;\ncase 25:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;\nbreak;\ncase 26: return 36;\nbreak;\ncase 27: return 37;\nbreak;\ncase 28: return 38;\nbreak;\ncase 29: return 39;\nbreak;\ncase 30: /*console.log('Starting STATE_STRING zxzx');*/this.begin(\"STATE_STRING\");\nbreak;\ncase 31:this.popState();this.pushState('STATE_ID');return \"AS\";\nbreak;\ncase 32:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return \"ID\";\nbreak;\ncase 33:this.popState();\nbreak;\ncase 34: /*console.log('Long description:', yy_.yytext);*/return \"STATE_DESCR\";\nbreak;\ncase 35:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17;\nbreak;\ncase 36:this.popState();\nbreak;\ncase 37:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18;\nbreak;\ncase 38: /*console.log('Ending struct');*/ this.popState(); return 19;\nbreak;\ncase 39:/* nothing */\nbreak;\ncase 40: this.begin('NOTE'); return 27; \nbreak;\ncase 41: this.popState();this.pushState('NOTE_ID');return 43;\nbreak;\ncase 42: this.popState();this.pushState('NOTE_ID');return 44;\nbreak;\ncase 43: this.popState();this.pushState('FLOATING_NOTE');\nbreak;\ncase 44:this.popState();this.pushState('FLOATING_NOTE_ID');return \"AS\";\nbreak;\ncase 45:/**/\nbreak;\ncase 46: /*console.log('Floating note text: ', yy_.yytext);*/return \"NOTE_TEXT\";\nbreak;\ncase 47:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return \"ID\";\nbreak;\ncase 48: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22;\nbreak;\ncase 49: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29;\nbreak;\ncase 50: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29;\nbreak;\ncase 51: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; \nbreak;\ncase 52: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; \nbreak;\ncase 53: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; \nbreak;\ncase 54: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 42;\nbreak;\ncase 55: /*console.log('=>ID=',yy_.yytext);*/ return 22;\nbreak;\ncase 56: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; \nbreak;\ncase 57:return 13;\nbreak;\ncase 58:return 26;\nbreak;\ncase 59:return 5;\nbreak;\ncase 60:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:.*direction\\s+TB[^\\n]*)/i,/^(?:.*direction\\s+BT[^\\n]*)/i,/^(?:.*direction\\s+RL[^\\n]*)/i,/^(?:.*direction\\s+LR[^\\n]*)/i,/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n]+)/i,/^(?:[\\s]+)/i,/^(?:((?!\\n)\\s)+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:scale\\s+)/i,/^(?:\\d+)/i,/^(?:\\s+width\\b)/i,/^(?:state\\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\\[\\[fork\\]\\])/i,/^(?:.*\\[\\[join\\]\\])/i,/^(?:.*\\[\\[choice\\]\\])/i,/^(?:.*direction\\s+TB[^\\n]*)/i,/^(?:.*direction\\s+BT[^\\n]*)/i,/^(?:.*direction\\s+RL[^\\n]*)/i,/^(?:.*direction\\s+LR[^\\n]*)/i,/^(?:[\"])/i,/^(?:\\s*as\\s+)/i,/^(?:[^\\n\\{]*)/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[^\\n\\s\\{]+)/i,/^(?:\\n)/i,/^(?:\\{)/i,/^(?:\\})/i,/^(?:[\\n])/i,/^(?:note\\s+)/i,/^(?:left of\\b)/i,/^(?:right of\\b)/i,/^(?:\")/i,/^(?:\\s*as\\s*)/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[^\\n]*)/i,/^(?:\\s*[^:\\n\\s\\-]+)/i,/^(?:\\s*:[^:\\n;]+)/i,/^(?:[\\s\\S]*?end note\\b)/i,/^(?:stateDiagram\\s+)/i,/^(?:stateDiagram-v2\\s+)/i,/^(?:hide empty description\\b)/i,/^(?:\\[\\*\\])/i,/^(?:[^:\\n\\s\\-\\{]+)/i,/^(?:\\s*:[^:\\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"LINE\":{\"rules\":[13,14],\"inclusive\":false},\"close_directive\":{\"rules\":[13,14],\"inclusive\":false},\"arg_directive\":{\"rules\":[7,8,13,14],\"inclusive\":false},\"type_directive\":{\"rules\":[6,7,13,14],\"inclusive\":false},\"open_directive\":{\"rules\":[5,13,14],\"inclusive\":false},\"struct\":{\"rules\":[13,14,19,26,27,28,29,38,39,40,54,55,56,57,58],\"inclusive\":false},\"FLOATING_NOTE_ID\":{\"rules\":[47],\"inclusive\":false},\"FLOATING_NOTE\":{\"rules\":[44,45,46],\"inclusive\":false},\"NOTE_TEXT\":{\"rules\":[49,50],\"inclusive\":false},\"NOTE_ID\":{\"rules\":[48],\"inclusive\":false},\"NOTE\":{\"rules\":[41,42,43],\"inclusive\":false},\"SCALE\":{\"rules\":[17,18],\"inclusive\":false},\"ALIAS\":{\"rules\":[],\"inclusive\":false},\"STATE_ID\":{\"rules\":[32],\"inclusive\":false},\"STATE_STRING\":{\"rules\":[33,34],\"inclusive\":false},\"FORK_STATE\":{\"rules\":[],\"inclusive\":false},\"STATE\":{\"rules\":[13,14,20,21,22,23,24,25,30,31,35,36,37],\"inclusive\":false},\"ID\":{\"rules\":[13,14],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,2,3,4,9,10,11,12,14,15,16,19,37,40,51,52,53,54,55,56,57,59,60],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,17,18,19,21],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,21],$V7=[4,6,9,11,17,18,19,21];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"journey\":4,\"document\":5,\"EOF\":6,\"directive\":7,\"line\":8,\"SPACE\":9,\"statement\":10,\"NEWLINE\":11,\"openDirective\":12,\"typeDirective\":13,\"closeDirective\":14,\":\":15,\"argDirective\":16,\"title\":17,\"section\":18,\"taskName\":19,\"taskData\":20,\"open_directive\":21,\"type_directive\":22,\"arg_directive\":23,\"close_directive\":24,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"journey\",6:\"EOF\",9:\"SPACE\",11:\"NEWLINE\",15:\":\",17:\"title\",18:\"section\",19:\"taskName\",20:\"taskData\",21:\"open_directive\",22:\"type_directive\",23:\"arg_directive\",24:\"close_directive\"},\nproductions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n return $$[$0-1]; \nbreak;\ncase 3:\n this.$ = [] \nbreak;\ncase 4:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 5: case 6:\n this.$ = $$[$0] \nbreak;\ncase 7: case 8:\n this.$=[];\nbreak;\ncase 11:\nyy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);\nbreak;\ncase 12:\nyy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);\nbreak;\ncase 13:\nyy.addTask($$[$0-1], $$[$0]);this.$='task';\nbreak;\ncase 15:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 16:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 17:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 18:\n yy.parseDirective('}%%', 'close_directive', 'journey'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,7:3,12:4,21:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,21:$V1},{13:8,22:[1,9]},{22:[2,15]},{6:[1,10],7:18,8:11,9:[1,12],10:13,11:[1,14],12:4,17:$V3,18:$V4,19:$V5,21:$V1},{1:[2,2]},{14:19,15:[1,20],24:$V6},o([15,24],[2,16]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:18,10:22,12:4,17:$V3,18:$V4,19:$V5,21:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,12]),{20:[1,23]},o($V2,[2,14]),{11:[1,24]},{16:25,23:[1,26]},{11:[2,18]},o($V2,[2,5]),o($V2,[2,13]),o($V7,[2,9]),{14:27,24:$V6},{24:[2,17]},{11:[1,28]},o($V7,[2,10])],\ndefaultActions: {5:[2,15],7:[2,2],21:[2,18],26:[2,17]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 21; \nbreak;\ncase 1: this.begin('type_directive'); return 22; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 15; \nbreak;\ncase 3: this.popState(); this.popState(); return 24; \nbreak;\ncase 4:return 23;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */\nbreak;\ncase 7:return 11;\nbreak;\ncase 8:/* skip whitespace */\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:return 4;\nbreak;\ncase 11:return 17;\nbreak;\ncase 12:return 18;\nbreak;\ncase 13:return 19;\nbreak;\ncase 14:return 20;\nbreak;\ncase 15:return 15;\nbreak;\ncase 16:return 6;\nbreak;\ncase 17:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:journey\\b)/i,/^(?:title\\s[^#\\n;]+)/i,/^(?:section\\s[^#:\\n;]+)/i,/^(?:[^#:\\n;]+)/i,/^(?::[^#\\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,8,9,10,11,12,13,14,15,16,17],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","module.exports = require(\"@braintree/sanitize-url\");","module.exports = require(\"d3\");","module.exports = require(\"dagre\");","module.exports = require(\"dagre-d3\");","module.exports = require(\"dagre-d3/lib/label/add-html-label.js\");","module.exports = require(\"dompurify\");","module.exports = require(\"graphlib\");","module.exports = require(\"khroma\");","module.exports = require(\"moment-mini\");","module.exports = require(\"stylis\");","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(__webpack_require__.s = \"./src/mermaid.js\");\n",""],"names":["assignWithDepth","log","theme","config","defaultConfig","Object","freeze","siteConfig","configFromInitialize","directives","currentConfig","updateCurrentConfig","siteCfg","_directives","cfg","sumOfDirectives","i","length","d","sanitize","tmpConfigFromInitialize","themeVariables","getThemeVariables","setSiteConfig","conf","saveConfigFromInitilize","updateSiteConfig","getSiteConfig","setConfig","getConfig","options","keys","secure","forEach","key","debug","indexOf","addDirective","directive","fontFamily","push","reset","intersectRect","createLabel","select","evaluate","rect","parent","node","trace","id","shapeSvg","insert","attr","class","label","text","appendChild","labelText","labelStyle","undefined","bbox","getBBox","flowchart","htmlLabels","div","children","dv","getBoundingClientRect","width","height","padding","halfPadding","diff","JSON","stringify","style","rx","ry","x","y","rectBox","intersect","point","noteGroup","roundedWithTitle","classes","innerRect","append","divider","shapes","clusterElems","insertCluster","elem","shape","getClusterTitleWidth","removeChild","clear","positionCluster","info","el","applyStyle","dom","styleFn","addHtmlLabel","fo","document","createElementNS","labelClass","isNode","html","_vertexText","isTitle","vertexText","replace","s","vertexNode","svgLabel","setAttribute","rows","split","Array","isArray","j","tspan","setAttributeNS","textContent","trim","line","curveBasis","utils","edgeLabels","terminalLabels","insertEdgeLabel","edge","labelElement","edgeLabel","startLabelLeft","startLabelElement","startEdgeLabelLeft","inner","slBox","startLeft","setTerminalWidth","startLabelRight","startEdgeLabelRight","startRight","endLabelLeft","endLabelElement","endEdgeLabelLeft","endLeft","endLabelRight","endEdgeLabelRight","endRight","value","positionEdgeLabel","paths","path","updatedPath","originalPath","pos","calcLabelPosition","calcTerminalLabelPosition","arrowTypeStart","arrowTypeEnd","outsideNode","dx","Math","abs","dy","w","h","intersection","outsidePoint","insidePoint","warn","r","Q","R","q","res","_x","_y","cutPathAtIntersect","_points","boundryNode","points","lastPointOutside","isInside","inter","pointPresent","p","find","e","insertEdge","clusterDb","diagramType","graph","pointsHasChanged","tail","v","head","slice","unshift","toCluster","fromCluster","reverse","lineData","filter","Number","isNaN","curve","lineFunction","strokeClasses","thickness","pattern","svgPath","url","state","arrowMarkerAbsolute","window","location","protocol","host","pathname","search","dagre","graphlib","insertMarkers","updateNodeBounds","clearGraphlib","adjustClustersAndEdges","findNonClusterChild","sortNodesByHierarchy","insertNode","positionNode","clearNodes","setNodeElem","clearClusters","clearEdges","recursiveRender","_elem","diagramtype","parentCluster","json","write","dir","rankdir","nodes","edges","clusters","edgePaths","data","parse","clusterData","setNode","setParent","clusterNode","o","newEl","name","layout","n","type","render","markers","circle","ellipse","polygon","intersectEllipse","intersectCircle","cx","cy","px","py","det","sqrt","intersectLine","p1","p2","q1","q2","a1","a2","b1","b2","c1","c2","r1","r2","r3","r4","denom","offset","num","sameSign","module","exports","intersectNode","intersectPolygon","polyPoints","x1","y1","intersections","minX","POSITIVE_INFINITY","minY","entry","min","left","top","sort","pdx","pdy","distp","qdx","qdy","distq","sx","sy","markerArray","markerName","extension","composition","aggregation","dependency","cross","barb","decendants","parents","isDecendant","ancenstorId","edgeInCluster","clusterId","copy","newGraph","rootId","setEdge","error","removeNode","extractDecendants","concat","validate","_id","getAnchorId","externalConnections","depth","d1","d2","removeEdge","extractor","hasChildren","graphSettings","clusterGraph","Graph","multigraph","compound","setGraph","nodesep","ranksep","marginx","marginy","setDefaultEdgeLabel","sorter","result","assign","sorted","labelHelper","insertPolygonShape","note","parseMember","question","questionElem","choice","domId","map","join","hexagon","f","m","hex","rect_left_inv_arrow","lean_right","lean_left","trapezoid","inv_trapezoid","rect_right_inv_arrow","cylinder","totalWidth","totalHeight","props","propKeys","Set","borders","applyNodePropertyBorders","delete","propKey","strokeDashArray","addBorder","skipBorder","includes","rectWithTitle","innerLine","text2","flat","title","textRows","titleBox","descr","stadium","subroutine","start","forkJoin","end","innerCircle","class_box","rowPadding","lineHeight","topLine","bottomLine","maxWidth","maxHeight","labelContainer","verticalPos","hasInterface","classData","annotations","interfaceLabelText","interfaceLabel","interfaceBBox","classTitleString","classTitleLabel","classTitleBBox","classAttributes","members","str","parsedInfo","parsedText","displayText","lbl","cssStyle","classMethods","methods","diffX","fork","nodeElems","link","linkTarget","tooltip","haveCallback","decodeEntities","sanitizeText","_classes","element","themeCSS","maxTextSize","logLevel","securityLevel","startOnLoad","deterministicIds","deterministicIDSeed","diagramPadding","nodeSpacing","rankSpacing","useMaxWidth","defaultRenderer","sequence","activationWidth","diagramMarginX","diagramMarginY","actorMargin","boxMargin","boxTextMargin","noteMargin","messageMargin","messageAlign","mirrorActors","forceMenus","bottomMarginAdj","rightAngles","showSequenceNumbers","actorFontSize","actorFontFamily","actorFontWeight","noteFontSize","noteFontFamily","noteFontWeight","noteAlign","messageFontSize","messageFontFamily","messageFontWeight","wrap","wrapPadding","labelBoxWidth","labelBoxHeight","messageFont","fontSize","fontWeight","noteFont","actorFont","gantt","titleTopMargin","barHeight","barGap","topPadding","rightPadding","leftPadding","gridLineStartPadding","sectionFontSize","numberSectionStyles","axisFormat","topAxis","useWidth","journey","leftMargin","taskFontSize","taskFontFamily","taskMargin","textPlacement","actorColours","sectionFills","sectionColours","git","dividerMargin","sizeUnit","textHeight","titleShift","forkWidth","forkHeight","miniPadding","fontSizeFactor","labelHeight","edgeLengthFactor","compositTitleSize","radius","er","layoutDirection","minEntityWidth","minEntityHeight","entityPadding","stroke","fill","pie","requirement","rect_fill","text_color","rect_border_size","rect_border_color","rect_min_width","rect_min_height","rect_padding","line_height","keyify","obj","prefix","reduce","configKeys","configApi","common","mermaidAPI","MERMAID_DOM_ID_PREFIX","relations","classCounter","funs","parseDirective","statement","context","splitClassNameAndType","genericType","className","addClass","classId","cssClasses","lookUpDomId","classKeys","setupToolTips","getClass","getClasses","getRelations","addRelation","relation","id1","id2","addAnnotation","annotation","validatedClassName","addMember","member","theClass","memberString","startsWith","endsWith","substring","addMembers","cleanupLabel","substr","setCssClass","ids","match","setTooltip","setLink","linkStr","target","formatUrl","setClickEvent","functionName","functionArgs","setClickFunc","elemId","argList","item","charAt","querySelector","addEventListener","runFunc","bindFunctions","fun","lineType","LINE","DOTTED_LINE","relationType","AGGREGATION","EXTENSION","COMPOSITION","DEPENDENCY","tooltipElem","_groups","svg","selectAll","on","transition","duration","scrollX","right","scrollY","body","scrollTop","classed","direction","getDirection","setDirection","classDb","parser","svgDraw","curveLinear","interpolateToCurve","getStylesFromArray","configureSvgSize","yy","idCache","addClasses","g","vertex","cssClassStr","styles","radious","_shape","addRelations","cnt","defaultStyle","defaultLabelStyle","edgeData","arrowhead","relationTitle1","relationTitle2","getArrowMarker","type1","type2","interpolate","defaultInterpolate","arrowheadStyle","labelpos","labelType","lineBreakRegex","getGraphId","foundEntry","entries","setConf","cnf","drawOld","diagram","isMultiGraph","classDef","drawClass","drawEdge","svgBounds","vBox","draw","_label","labels","querySelectorAll","k","dim","insertBefore","firstChild","marker","getStyles","nodeBorder","classText","mainBkg","lineColor","edgeCount","getRelationType","l","labelPosition","p1_card_x","p1_card_y","p2_card_x","p2_card_y","cardinality_1_point","calcCardinalityPosition","cardinality_2_point","bounds","classInfo","isFirst","titleText2","classTitle","titleHeight","membersLine","addTspan","membersBox","methodsLine","method","classBox","rectWidth","childNodes","fieldRegEx","methodRegEx","fieldMatch","methodMatch","buildFieldDisplay","buildMethodDisplay","buildLegacyDisplay","visibility","fieldType","parseGenericTypes","fieldName","classifier","parseClassifier","err","methodName","parameters","returnType","memberText","methodStart","methodEnd","firstChar","textEl","txt","tSpan","cleanedText","DOMPurify","getRows","breakToPlaceholder","removeScript","rs","idx","sanitizeMore","level","placeholderToBreak","sanitizeTextOrArray","a","hasBreaks","test","splitBreaks","getUrl","useAbsolute","val","entities","relationships","Cardinality","ZERO_OR_ONE","ZERO_OR_MORE","ONE_OR_MORE","ONLY_ONE","Identification","NON_IDENTIFYING","IDENTIFYING","addEntity","attributes","getEntities","addAttributes","entityName","attribs","entity","attributeName","addRelationship","entA","rolA","entB","rSpec","rel","entityA","roleA","entityB","relSpec","getRelationships","setTitle","getTitle","ERMarkers","ONLY_ONE_START","ONLY_ONE_END","ZERO_OR_ONE_START","ZERO_OR_ONE_END","ONE_OR_MORE_START","ONE_OR_MORE_END","ZERO_OR_MORE_START","ZERO_OR_MORE_END","erDb","erParser","erMarkers","drawAttributes","groupNode","entityTextNode","heightPadding","widthPadding","attrFontSize","labelBBox","attributeNodes","hasKeyType","hasComment","maxTypeWidth","maxNameWidth","maxKeyWidth","maxCommentWidth","cumulativeHeight","attrNum","attrPrefix","nodeWidth","nodeHeight","typeNode","attributeType","nameNode","attributeNode","tn","nn","typeBBox","nameBBox","max","attributeKeyType","keyTypeNode","kn","keyTypeBBox","attributeComment","commentNode","cn","commentNodeBBox","bBox","spareWidth","heightOffset","attribStyle","alignY","typeRect","parseFloat","drawEntities","svgNode","firstOne","textId","textNode","entityWidth","entityHeight","rectNode","rectBBox","adjustEntities","getEdgeName","addRelationships","relationship","relCnt","drawRelationshipFromLayout","relType","cardA","cardB","len","getTotalLength","labelPoint","getPointAtLength","labelId","labelNode","directed","edgesep","firstEntity","tertiaryColor","dagreD3","addToRender","addToRenderV2","addShape","vertexCounter","vertices","subGraphs","subGraphLookup","tooltips","subCount","firstGraphFlag","version","veritceKeys","addVertex","addSingleLink","_start","_end","linktext","addLink","updateLinkInterpolate","positions","interp","updateLink","isSubstringInArray","textStyles","newStyle1","newStyle2","setClass","setClickFun","getTooltip","getVertices","getEdges","ver","setGen","addSubGraph","list","_title","uniq","prims","boolean","number","string","objs","nodeList","stmt","hasOwnProperty","apply","nl","subGraph","makeUniq","getPosForId","secCount","posCrossRef","indexNodes2","count","posCount","childPos","getDepthFirstPos","indexNodes","getSubGraphs","firstGraph","destructStartLink","_str","countChar","char","destructEndLink","dots","destructLink","_startStr","startInfo","exists","allSgs","sg","allSubgraphs","lex","flowDb","flow","addVertices","vert","svgId","classStr","parentNode","addEdges","linkIdCnt","defaultStyles","linkIdBase","linkId","linkNameStart","linkNameEnd","minlen","subG","linkNode","flowChartShapes","Render","arrows","none","normal","util","clusterRects","clusterEl","xPos","baseVal","yPos","cluster","te","classList","add","nodeTextColor","textColor","titleColor","arrowheadColor","edgeLabelBackground","clusterBkg","clusterBorder","border2","moment","sanitizeUrl","dateFormat","todayMarker","excludes","sections","tasks","currentSection","tags","inclusiveEndDates","lastOrder","taskCnt","lastTask","lastTaskID","rawTasks","setAxisFormat","getAxisFormat","setTodayMarker","getTodayMarker","setDateFormat","enableInclusiveEndDates","endDatesAreInclusive","enableTopAxis","topAxisEnabled","getDateFormat","setIncludes","toLowerCase","getIncludes","setExcludes","getExcludes","addSection","getSections","getTasks","allItemsPricessed","compileTasks","maxDepth","iterationCount","isInvalidDate","date","format","isoWeekday","checkTaskDates","task","manualEndTime","startTime","endTime","renderEndTime","fixTaskDates","toDate","invalid","getStartDate","prevTime","re","afterStatement","exec","latestEndingTask","findTaskById","dt","Date","setHours","mDate","isValid","durationToDate","durationStatement","relativeTime","getEndDate","inclusive","parseId","idStr","compileData","prevTask","dataStr","ds","getTaskTags","endTimeData","parseData","prevTaskId","startData","taskDb","addTask","rawTask","section","processed","raw","taskInfo","active","done","crit","milestone","order","addTaskOrg","newTask","description","compileTask","allProcessed","_linkStr","pushFun","open","callbackFunction","matchFound","t","regex","RegExp","shift","scaleTime","scaleLinear","interpolateHcl","axisBottom","axisTop","timeFormat","ganttDb","getElementById","parentElement","offsetWidth","taskArray","timeScale","domain","rangeRound","categories","catsUnfiltered","checkUnique","taskCompare","b","taskA","taskB","makeGant","pageWidth","pageHeight","gap","colorScale","range","drawExcludeDays","makeGrid","drawRects","vertLabels","drawToday","theArray","theGap","theTopPad","theSidePad","theBarHeight","theColorScale","enter","rectangles","toString","secNum","taskClass","startX","endX","textWidth","taskType","minTime","maxTime","excludeRanges","valueOf","clone","renderEnd","bottomXAxis","tickSize","tickFormat","call","topXAxis","numOccurances","prevGap","getCount","todayG","today","todayLine","arr","hash","prototype","getCounts","word","excludeBkgColor","sectionBkgColor","sectionBkgColor2","altSectionBkgColor","ganttFontSize","gridColor","todayLineColor","taskTextDarkColor","taskTextClickableColor","taskTextColor","taskBkgColor","taskBorderColor","taskTextOutsideColor","activeTaskBkgColor","activeTaskBorderColor","doneTaskBorderColor","doneTaskBkgColor","critBorderColor","critBkgColor","random","commits","branches","master","curBranch","seq","getId","isfastforwardable","currentCommit","otherCommit","isReachableFrom","currentSeq","otherSeq","uniqBy","fn","recordMap","create","out","setOptions","rawOptString","message","getOptions","commit","msg","branch","merge","otherBranch","checkout","commitRef","ref","parentCount","parseInt","upsert","newval","index","splice","prettyPrintCommitHistory","commitArr","c","newCommit","nextCommit","prettyPrint","getCommitsArray","getBranchesAsObjArray","branchArr","getBranches","getCommits","getCurrentBranch","getHead","db","gitGraphParser","allCommitsDict","branchNum","nodeFillColor","nodeStrokeWidth","nodeStrokeColor","lineStrokeWidth","branchOffset","branchColors","nodeRadius","nodeLabel","apiConfig","svgCreateDefs","svgDrawLine","colorIdx","color","lineGen","round","getElementCoords","coords","ctm","getCTM","xn","yn","svgDrawLineForCommits","fromId","toId","fromBbox","toBbox","lineStart","lineEnd","cloneNode","selector","renderCommitHistory","commitid","numCommits","size","branchName","renderLines","branchColor","lineDrawn","setMessage","getMessage","setInfo","inf","getInfo","infoParser","showData","setShowData","toggle","getShowData","cleanupValue","scaleOrdinal","d3pie","arc","pieData","pieParser","margin","legendRectSize","legendSpacing","sum","myGeneratedColors","pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12","dataReady","arcGenerator","innerRadius","outerRadius","toFixed","centroid","legend","horz","pieStrokeColor","pieStrokeWidth","pieOpacity","pieTitleTextSize","pieTitleTextColor","pieSectionTextColor","pieSectionTextSize","pieLegendTextColor","pieLegendTextSize","latestRequirement","requirements","latestElement","elements","RequirementType","REQUIREMENT","FUNCTIONAL_REQUIREMENT","INTERFACE_REQUIREMENT","PERFORMANCE_REQUIREMENT","PHYSICAL_REQUIREMENT","DESIGN_CONSTRAINT","RiskLevel","LOW_RISK","MED_RISK","HIGH_RISK","VerifyType","VERIFY_ANALYSIS","VERIFY_DEMONSTRATION","VERIFY_INSPECTION","VERIFY_TEST","Relationships","CONTAINS","COPIES","DERIVES","SATISFIES","VERIFIES","REFINES","TRACES","addRequirement","risk","verifyMethod","getRequirements","setNewReqId","setNewReqText","setNewReqRisk","setNewReqVerifyMethod","addElement","docRef","getElements","setNewElementType","setNewElementDocRef","src","dst","req","ReqMarkers","ARROW","insertLineEndings","containsNode","requirementDb","newRectNode","newTitleNode","txts","textStr","yPadding","linePadding","totalY","titleNode","newBodyNode","yStart","currentRow","charLimit","wrappedTxts","currentTextLen","firstPart","lastStr","addEdgeLabel","elementString","drawReqs","reqs","reqName","titleNodeInfo","bodyNode","drawElements","els","elName","relationColor","requirementBackground","requirementBorderColor","requirementBorderSize","requirementTextColor","relationLabelBackground","relationLabelColor","prevActor","actors","messages","notes","titleWrapped","sequenceNumbersEnabled","wrapEnabled","addActor","old","autoWrap","links","properties","actorCnt","rectData","nextActor","activationCount","part","LINETYPE","ACTIVE_START","from","actor","ACTIVE_END","addMessage","idFrom","idTo","answer","to","addSignal","messageType","Error","token","loc","first_line","last_line","first_column","last_column","expected","getMessages","getActors","getActor","getActorKeys","getTitleWrapped","enableSequenceNumbers","setWrap","wrapSetting","parseMessage","SOLID","DOTTED","NOTE","SOLID_CROSS","DOTTED_CROSS","SOLID_OPEN","DOTTED_OPEN","LOOP_START","LOOP_END","ALT_START","ALT_ELSE","ALT_END","OPT_START","OPT_END","PAR_START","PAR_AND","PAR_END","RECT_START","RECT_END","SOLID_POINT","DOTTED_POINT","ARROWTYPE","FILLED","OPEN","PLACEMENT","LEFTOF","RIGHTOF","OVER","addNote","placement","addLinks","actorId","sanitizedText","insertLinks","addALink","sep","addProperties","insertProperties","addDetails","innerHTML","details","getActorProperty","titleWrap","param","signalType","loopText","optText","altText","parText","drawText","fixLifeLineHeights","sequenceDb","startx","stopx","starty","stopy","sequenceItems","activations","models","getHeight","loops","it","acc","actorModel","addLoop","loopModel","msgModel","noteModel","lastActor","lastLoop","lastMessage","lastNote","init","updateVal","updateBounds","_self","updateFn","updateItemBounds","_startx","_stopx","_starty","_stopy","newActivation","actorRect","stackedSize","actorActivations","anchored","anchorElement","endActivation","lastActorActivationIdx","activation","lastIndexOf","createLoop","newLoop","endLoop","pop","addSectionToLoop","loop","sectionTitles","getVerticalPos","bumpVerticalPos","bump","getBounds","drawNote","getNoteRect","rectElem","drawRect","textObj","getTextObj","anchor","textMargin","valign","textElem","curr","drawMessage","sequenceIndex","lines","textDims","calculateTextDimensions","totalOffset","lineStarty","fromBounds","toBounds","drawActors","actorKeys","prevWidth","prevMargin","drawActor","drawActorsPopup","minMenuWidth","getRequiredPopupWidth","menuDimensions","drawPopup","activationBounds","actorObj","adjustLoopHeightForWrap","loopWidths","preMargin","postMargin","addLoopFn","heightAdjust","loopWidth","textConf","wrapLabel","maxMessageWidthPerActor","getMaxMessageWidthPerActor","calculateActorMargins","insertComputerIcon","insertDatabaseIcon","insertClockIcon","calculateLoopBounds","insertArrowHead","insertArrowCrossHead","insertArrowFilledHead","insertSequenceNumber","activeEnd","activationData","drawActivation","drawLoop","drawBackgroundRect","requiredBoxSize","box","actorLines","boxHeight","boxWidth","extraVertForTitle","isNote","isMessage","textFont","wrappedMessage","messageDimensions","messageWidth","requiredPopupWidth","labelDimensions","labelWidth","actorToMessageWidth","prop","actDims","actorKey","actorWidth","buildNoteModel","shouldWrap","textDimensions","buildMessageModel","process","fromIdx","toIdx","allBounds","boundedWidth","msgDims","stack","current","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","toAdd","enabled","stk","actorBorder","actorBkg","actorTextColor","actorLineColor","signalColor","sequenceNumberColor","signalTextColor","labelBoxBorderColor","labelBoxBkgColor","labelTextColor","loopTextColor","noteBorderColor","noteBkgColor","noteTextColor","activationBkgColor","activationBorderColor","addFunction","addPopupInteraction","popupMenuUpFunc","popupMenuDownFunc","textAttrs","displayValue","actorClass","menuWidth","linkY","linkElem","sanitizedLink","_drawMenuItemTextCandidateFunc","drawImage","imageElem","drawEmbeddedImage","popupMenu","popid","popdownMenu","popupId","pu","display","textData","prevTextHeight","textElems","yfunc","dominantBaseline","alignmentBaseline","span","drawLabel","txtObject","genPoints","cut","drawActorTypeParticipant","center","boxpluslineGroup","cssclass","iconSrc","_drawTextCandidateFunc","drawActorTypeActor","actElem","drawLoopLine","sectionHeight","lower","defs","byText","content","_setTextAttrs","byTspan","byFo","toText","fromTextAttrsDict","set","get","stateDb","drawStartState","drawDivider","drawSimpleState","stateDef","drawDescrState","descriptions","isSecond","descrLine","descrBox","addTitleAndBox","altBkg","pad","dblPad","orgBox","orgWidth","orgX","titleWidth","graphBox","doc","lineY","drawEndState","drawForkJoinState","parentId","tmp","nText","_drawLongText","_text","tHeight","textBounds","drawState","stateInfo","stateBox","titleRows","boundstmp","heightAdj","generateId","rootDoc","setRootDoc","getRootDoc","docTranslator","first","state1","state2","currentDoc","newNode","docNode","getRootDocV2","extract","_doc","addState","newDoc","states","documents","root","currentDocument","startCnt","endCnt","addDescription","des","getState","getStates","logDocuments","_id1","_id2","_descr","theState","dividerCnt","getDividerId","trimColon","nodeDb","setupNode","altFlag","getDir","nodeData","noteData","groupData","position","arrowType","setupDoc","startId","endId","defaultDir","transformationLog","renderDoc","svgWidth","getLabelWidth","edgeFreeDoc","ranker","nodeSep","sub","boxBounds","noteDef","nodeCount","svgElem","dividers","pWidth","pShift","getAttribute","transitionColor","stateLabelColor","background","labelBackgroundColor","transitionLabelColor","tertiaryTextColor","specialStateColor","innerEndBackground","compositeBackground","stateBkg","stateBorder","compositeTitleBackground","altBackground","allItemsProcessed","updateActors","tempActors","people","unique","taskData","pieces","score","peeps","peopleList","journeyDb","drawActorLegend","person","colour","circleData","drawCircle","labelData","LEFT_MARGIN","initGraphics","actorNames","actorPos","actorName","drawTasks","fills","textColours","lastSection","sectionVHeight","taskPos","sectionNumber","drawSection","taskActors","drawTask","faceColor","fillType0","fillType1","fillType2","fillType3","fillType4","fillType5","fillType6","fillType7","actor0","actor1","actor2","actor3","actor4","actor5","d3arc","drawFace","faceData","circleElement","face","smile","startAngle","PI","endAngle","sad","ambivalent","labelMargin","taskCount","graphics","interactionFunctions","func","attachFunctions","LEVELS","fatal","setLogLevel","console","bind","time","arguments","mermaid","sequenceConfig","callback","Node","ganttConfig","idGeneratior","initIdGeneratior","next","entityDecode","detectInit","svgCode","parseError","initialize","contentLoaded","compile","serialize","pkg","classRenderer","classRendererV2","classParser","erRenderer","flowRenderer","flowRendererV2","flowParser","ganttRenderer","ganttParser","gitGraphAst","gitGraphRenderer","infoDb","infoRenderer","pieDb","pieRenderer","requirementParser","requirementRenderer","sequenceParser","sequenceRenderer","stateParser","stateRenderer","stateRendererV2","journeyRenderer","journeyParser","errorRenderer","directiveSanitizer","graphInit","reinitialize","graphType","detectType","encodeEntities","innerTxt","isInt","_txt","cb","container","existingSvg","remove","userStyles","altFontFamily","stylis","rules","style1","createElement","sequenceDiagram","currentDirective","args","handleDirective","updateRendererConfigs","default","globalReset","classDiagram","stateDiagram","themes","calcThemeVariables","userOverRides","calcColors","errorBkgColor","errorTextColor","baseThemeVariables","darkThemeVariables","defaultThemeVariables","forestThemeVariables","neutralThemeVariables","base","dark","forest","neutral","darken","lighten","adjust","invert","mkBorder","Theme","darkMode","primaryColor","primaryTextColor","secondaryColor","primaryBorderColor","secondaryBorderColor","tertiaryBorderColor","secondaryTextColor","nodeBkg","defaultLinkColor","taskTextLightColor","compositeBorder","overrides","updateColors","userOverrides","calculate","rgba","secondBkg","mainContrastColor","darkTextColor","border1","labelBackground","labelColor","col","contrast","critical","curveBasisClosed","curveBasisOpen","curveLinearClosed","curveMonotoneX","curveMonotoneY","curveNatural","curveStep","curveStepAfter","curveStepBefore","d3CurveTypes","directiveWithoutOpen","anyComment","inits","detectDirective","results","commentWithoutDirectives","source","lastIndex","memoize","resolver","cache","defaultCurve","curveName","toUpperCase","arrPaths","fnName","params","distance","pow","traverseEdge","prevPoint","totalDistance","remainingDistance","vectorDistance","distanceRatio","isRelationTypePresent","initialPosition","distanceToCardinalityPoint","angle","atan2","cardinalityPosition","sin","cos","terminalMarkerSize","makeid","characters","charactersLength","floor","clobber","drawSimpleText","joinWith","words","completedLines","nextLine","wordLength","calculateTextWidth","nextLineLength","breakString","hyphenatedStrings","remainingWord","Boolean","currentWord","isLastWord","hyphenCharacter","currentLine","character","lineWidth","currentCharacter","isLastLine","hyphenatedNextLine","calculateTextHeight","fontFamilies","dims","cheight","d3Attrs","d3Elem","attrs","calculateSvgSizeAttrs","Map","deterministic","seed","now","decoder","escape","unescape","arg"],"sourceRoot":""} |