@langgraph-js/ui 5.6.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/assets/arc-Cxpt6B73.js +1 -0
  2. package/dist/assets/architectureDiagram-VXUJARFQ-DEy8uu79.js +36 -0
  3. package/dist/assets/{blockDiagram-VD42YOAC-JpCtx8Fw.js → blockDiagram-VD42YOAC-yNezEuFm.js} +4 -4
  4. package/dist/assets/{c4Diagram-YG6GDRKO-Ct0YUG6f.js → c4Diagram-YG6GDRKO-CFr-QKSf.js} +1 -1
  5. package/dist/assets/channel-ohUHNNLS.js +1 -0
  6. package/dist/assets/{chunk-4BX2VUAB-O9tuPwJ2.js → chunk-4BX2VUAB-DKYgHx9z.js} +1 -1
  7. package/dist/assets/{chunk-55IACEB6-B1LOZAa5.js → chunk-55IACEB6-Dp0pEp1k.js} +1 -1
  8. package/dist/assets/{chunk-B4BG7PRW-CHB7g7y9.js → chunk-B4BG7PRW-B9ne889x.js} +1 -1
  9. package/dist/assets/{chunk-DI55MBZ5-BZe7PkXl.js → chunk-DI55MBZ5-nz3xKTAU.js} +1 -1
  10. package/dist/assets/{chunk-FMBD7UC4-IV4Fy30-.js → chunk-FMBD7UC4-BEqW4wjD.js} +1 -1
  11. package/dist/assets/{chunk-QN33PNHL-DCcmoYki.js → chunk-QN33PNHL-DdYfOS87.js} +1 -1
  12. package/dist/assets/{chunk-QZHKN3VN-BNYpxk7b.js → chunk-QZHKN3VN--fzHnGin.js} +1 -1
  13. package/dist/assets/{chunk-TZMSLE5B-BgP3duP5.js → chunk-TZMSLE5B-wYv5WbFJ.js} +1 -1
  14. package/dist/assets/classDiagram-2ON5EDUG-DD3S7Z_T.js +1 -0
  15. package/dist/assets/classDiagram-v2-WZHVMYZB-DD3S7Z_T.js +1 -0
  16. package/dist/assets/clone-BL1RNKEm.js +1 -0
  17. package/dist/assets/{cose-bilkent-S5V4N54A-B_7kmvVh.js → cose-bilkent-S5V4N54A-Do_6LUNg.js} +1 -1
  18. package/dist/assets/{dagre-6UL2VRFP-CAxkUiea.js → dagre-6UL2VRFP-1iQhW5EH.js} +2 -2
  19. package/dist/assets/diagram-PSM6KHXK-BzAvoA1a.js +24 -0
  20. package/dist/assets/diagram-QEK2KX5R-BruzodAN.js +43 -0
  21. package/dist/assets/{diagram-S2PKOQOG-CZOKfwOI.js → diagram-S2PKOQOG-DxCLvX73.js} +1 -1
  22. package/dist/assets/{erDiagram-Q2GNP2WA-D9v3M4EU.js → erDiagram-Q2GNP2WA-VZD44fiG.js} +1 -1
  23. package/dist/assets/{flowDiagram-NV44I4VS-B9qnS72A.js → flowDiagram-NV44I4VS-BW9G6Z5Y.js} +1 -1
  24. package/dist/assets/ganttDiagram-LVOFAZNH-BE5hhtQW.js +267 -0
  25. package/dist/assets/{gitGraphDiagram-NY62KEGX-Cm36kSO3.js → gitGraphDiagram-NY62KEGX-D2xrVqfs.js} +1 -1
  26. package/dist/assets/{graph-C2p3i6RT.js → graph-BOje8BQW.js} +1 -1
  27. package/dist/assets/index-DKzqRWAz.css +1 -0
  28. package/dist/assets/{index-Cf3jkaWJ.js → index-Dyga3lv6.js} +312 -173
  29. package/dist/assets/{infoDiagram-F6ZHWCRC-DkBxmgNt.js → infoDiagram-F6ZHWCRC-DuvG7CMo.js} +1 -1
  30. package/dist/assets/isUndefined-Jm66YXc7.js +1 -0
  31. package/dist/assets/{journeyDiagram-XKPGCS4Q-CVukoP-j.js → journeyDiagram-XKPGCS4Q-DppY-OqU.js} +1 -1
  32. package/dist/assets/{kanban-definition-3W4ZIXB7-0-SbO6tS.js → kanban-definition-3W4ZIXB7-DWFZ7d_a.js} +4 -4
  33. package/dist/assets/layout-BrYg1BPZ.js +1 -0
  34. package/dist/assets/mermaid.core-Brj2E_sv.js +197 -0
  35. package/dist/assets/min-OyaaRTus.js +1 -0
  36. package/dist/assets/{mindmap-definition-VGOIOE7T-CDGdm5yw.js → mindmap-definition-VGOIOE7T-Ys6gAj49.js} +5 -5
  37. package/dist/assets/pieDiagram-ADFJNKIX-CDawS5d5.js +30 -0
  38. package/dist/assets/{quadrantDiagram-AYHSOK5B-DY0NltyG.js → quadrantDiagram-AYHSOK5B-BwaRQW9j.js} +2 -2
  39. package/dist/assets/{requirementDiagram-UZGBJVZJ-DwhwO5lc.js → requirementDiagram-UZGBJVZJ-xZhlkqne.js} +1 -1
  40. package/dist/assets/sankeyDiagram-TZEHDZUN-CNXqnJNS.js +10 -0
  41. package/dist/assets/{sequenceDiagram-WL72ISMW-CpTIKJGg.js → sequenceDiagram-WL72ISMW-DuVqNtcK.js} +1 -1
  42. package/dist/assets/stateDiagram-FKZM4ZOC-kjDVpzFt.js +1 -0
  43. package/dist/assets/stateDiagram-v2-4FDKWEC3-Bt6o2Z8q.js +1 -0
  44. package/dist/assets/{timeline-definition-IT6M3QCI-1MkGCcpM.js → timeline-definition-IT6M3QCI-BrZan_9K.js} +3 -3
  45. package/dist/assets/{treemap-KMMF4GRG-pRPfKbhX.js → treemap-KMMF4GRG-Bc2NrK0Z.js} +1 -1
  46. package/dist/assets/xychartDiagram-PRI3JC2R-Dh5NbHlS.js +7 -0
  47. package/dist/index.html +2 -2
  48. package/package.json +2 -1
  49. package/src/chat/Chat.tsx +3 -4
  50. package/src/chat/components/ErrorBoundary.tsx +23 -10
  51. package/src/chat/tools/{show_form.tsx → ask_user_to_fill_form.tsx} +147 -69
  52. package/src/chat/tools/ask_user_with_options.tsx +174 -0
  53. package/src/chat/tools/display_information_card.tsx +131 -0
  54. package/src/chat/tools/image_generation.tsx +140 -0
  55. package/src/chat/tools/index.ts +18 -6
  56. package/src/chat/tools/visualize_data_with_chart.tsx +274 -0
  57. package/src/chat/tools/wait_for_user_to_upload_file.tsx +324 -0
  58. package/dist/assets/arc-BNOCe7pe.js +0 -1
  59. package/dist/assets/architectureDiagram-VXUJARFQ-yf1p-wI_.js +0 -36
  60. package/dist/assets/channel-CizfE02g.js +0 -1
  61. package/dist/assets/classDiagram-2ON5EDUG-CFe5Iz8b.js +0 -1
  62. package/dist/assets/classDiagram-v2-WZHVMYZB-CFe5Iz8b.js +0 -1
  63. package/dist/assets/clone-C4H89Tb1.js +0 -1
  64. package/dist/assets/defaultLocale-C4B-KCzX.js +0 -1
  65. package/dist/assets/diagram-PSM6KHXK-BeM-KUrT.js +0 -24
  66. package/dist/assets/diagram-QEK2KX5R-DDl_pKlU.js +0 -43
  67. package/dist/assets/ganttDiagram-LVOFAZNH-C1Hjglog.js +0 -267
  68. package/dist/assets/index-DLwWU25h.css +0 -1
  69. package/dist/assets/init-Gi6I4Gst.js +0 -1
  70. package/dist/assets/isUndefined-DhAvAp_K.js +0 -1
  71. package/dist/assets/layout-fJUHcXGp.js +0 -1
  72. package/dist/assets/linear-RxTDErCI.js +0 -1
  73. package/dist/assets/mermaid.core-Y2zCEMvG.js +0 -197
  74. package/dist/assets/min-BGYgWBoZ.js +0 -1
  75. package/dist/assets/ordinal-Cboi1Yqb.js +0 -1
  76. package/dist/assets/pieDiagram-ADFJNKIX-EEa08coZ.js +0 -30
  77. package/dist/assets/sankeyDiagram-TZEHDZUN-awXHtkWF.js +0 -10
  78. package/dist/assets/stateDiagram-FKZM4ZOC-vNzQUjNr.js +0 -1
  79. package/dist/assets/stateDiagram-v2-4FDKWEC3-D7uk1o7q.js +0 -1
  80. package/dist/assets/xychartDiagram-PRI3JC2R-DaoAFPdZ.js +0 -7
@@ -0,0 +1,267 @@
1
+ import{_ as l,g as ze,s as Oe,q as Pe,p as Ne,a as Re,b as Be,c as ut,d as He,an as Z,l as Et,j as qe,i as Ge,y as Xe,u as Ue}from"./mermaid.core-Brj2E_sv.js";import{T as ge,U as Ze,V as pe,W as ve,X as be,Y as Lt,Z as je,J as Gt,s as bt,_ as $e,$ as Qe,a0 as Ke,n as Je,a1 as ne,a2 as ie,a3 as tr,a4 as er,a5 as rr,a6 as nr,a7 as ir,a8 as ar,a9 as sr,aa as ae,ab as se,ac as oe,ad as ce,ae as le}from"./index-Dyga3lv6.js";const or=Math.PI/180,cr=180/Math.PI,Mt=18,xe=.96422,Te=1,we=.82521,_e=4/29,dt=6/29,De=3*dt*dt,lr=dt*dt*dt;function Ce(t){if(t instanceof et)return new et(t.l,t.a,t.b,t.opacity);if(t instanceof nt)return Se(t);t instanceof ge||(t=Ze(t));var e=zt(t.r),r=zt(t.g),n=zt(t.b),a=Yt((.2225045*e+.7168786*r+.0606169*n)/Te),h,u;return e===r&&r===n?h=u=a:(h=Yt((.4360747*e+.3850649*r+.1430804*n)/xe),u=Yt((.0139322*e+.0971045*r+.7141733*n)/we)),new et(116*a-16,500*(h-a),200*(a-u),t.opacity)}function ur(t,e,r,n){return arguments.length===1?Ce(t):new et(t,e,r,n??1)}function et(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}pe(et,ur,ve(be,{brighter(t){return new et(this.l+Mt*(t??1),this.a,this.b,this.opacity)},darker(t){return new et(this.l-Mt*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return e=xe*Wt(e),t=Te*Wt(t),r=we*Wt(r),new ge(Vt(3.1338561*e-1.6168667*t-.4906146*r),Vt(-.9787684*e+1.9161415*t+.033454*r),Vt(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function Yt(t){return t>lr?Math.pow(t,1/3):t/De+_e}function Wt(t){return t>dt?t*t*t:De*(t-_e)}function Vt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function zt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function dr(t){if(t instanceof nt)return new nt(t.h,t.c,t.l,t.opacity);if(t instanceof et||(t=Ce(t)),t.a===0&&t.b===0)return new nt(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*cr;return new nt(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Pt(t,e,r,n){return arguments.length===1?dr(t):new nt(t,e,r,n??1)}function nt(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function Se(t){if(isNaN(t.h))return new et(t.l,0,0,t.opacity);var e=t.h*or;return new et(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}pe(nt,Pt,ve(be,{brighter(t){return new nt(this.h,this.c,this.l+Mt*(t??1),this.opacity)},darker(t){return new nt(this.h,this.c,this.l-Mt*(t??1),this.opacity)},rgb(){return Se(this).rgb()}}));function fr(t){return function(e,r){var n=t((e=Pt(e)).h,(r=Pt(r)).h),a=Lt(e.c,r.c),h=Lt(e.l,r.l),u=Lt(e.opacity,r.opacity);return function(w){return e.h=n(w),e.c=a(w),e.l=h(w),e.opacity=u(w),e+""}}}const hr=fr(je);function mr(t){return t}var Tt=1,Ot=2,Nt=3,xt=4,ue=1e-6;function kr(t){return"translate("+t+",0)"}function yr(t){return"translate(0,"+t+")"}function gr(t){return e=>+t(e)}function pr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function vr(){return!this.__axis}function Ee(t,e){var r=[],n=null,a=null,h=6,u=6,w=3,E=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Tt||t===xt?-1:1,p=t===xt||t===Ot?"x":"y",F=t===Tt||t===Nt?kr:yr;function C(b){var q=n??(e.ticks?e.ticks.apply(e,r):e.domain()),A=a??(e.tickFormat?e.tickFormat.apply(e,r):mr),x=Math.max(h,0)+w,M=e.range(),L=+M[0]+E,Y=+M[M.length-1]+E,R=(e.bandwidth?pr:gr)(e.copy(),E),N=b.selection?b.selection():b,G=N.selectAll(".domain").data([null]),O=N.selectAll(".tick").data(q,e).order(),g=O.exit(),_=O.enter().append("g").attr("class","tick"),T=O.select("line"),v=O.select("text");G=G.merge(G.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),O=O.merge(_),T=T.merge(_.append("line").attr("stroke","currentColor").attr(p+"2",S*h)),v=v.merge(_.append("text").attr("fill","currentColor").attr(p,S*x).attr("dy",t===Tt?"0em":t===Nt?"0.71em":"0.32em")),b!==N&&(G=G.transition(b),O=O.transition(b),T=T.transition(b),v=v.transition(b),g=g.transition(b).attr("opacity",ue).attr("transform",function(m){return isFinite(m=R(m))?F(m+E):this.getAttribute("transform")}),_.attr("opacity",ue).attr("transform",function(m){var D=this.parentNode.__axis;return F((D&&isFinite(D=D(m))?D:R(m))+E)})),g.remove(),G.attr("d",t===xt||t===Ot?u?"M"+S*u+","+L+"H"+E+"V"+Y+"H"+S*u:"M"+E+","+L+"V"+Y:u?"M"+L+","+S*u+"V"+E+"H"+Y+"V"+S*u:"M"+L+","+E+"H"+Y),O.attr("opacity",1).attr("transform",function(m){return F(R(m)+E)}),T.attr(p+"2",S*h),v.attr(p,S*x).text(A),N.filter(vr).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Ot?"start":t===xt?"end":"middle"),N.each(function(){this.__axis=R})}return C.scale=function(b){return arguments.length?(e=b,C):e},C.ticks=function(){return r=Array.from(arguments),C},C.tickArguments=function(b){return arguments.length?(r=b==null?[]:Array.from(b),C):r.slice()},C.tickValues=function(b){return arguments.length?(n=b==null?null:Array.from(b),C):n&&n.slice()},C.tickFormat=function(b){return arguments.length?(a=b,C):a},C.tickSize=function(b){return arguments.length?(h=u=+b,C):h},C.tickSizeInner=function(b){return arguments.length?(h=+b,C):h},C.tickSizeOuter=function(b){return arguments.length?(u=+b,C):u},C.tickPadding=function(b){return arguments.length?(w=+b,C):w},C.offset=function(b){return arguments.length?(E=+b,C):E},C}function br(t){return Ee(Tt,t)}function xr(t){return Ee(Nt,t)}var wt={exports:{}},Tr=wt.exports,de;function wr(){return de||(de=1,function(t,e){(function(r,n){t.exports=n()})(Tr,function(){var r="day";return function(n,a,h){var u=function(S){return S.add(4-S.isoWeekday(),r)},w=a.prototype;w.isoWeekYear=function(){return u(this).year()},w.isoWeek=function(S){if(!this.$utils().u(S))return this.add(7*(S-this.isoWeek()),r);var p,F,C,b,q=u(this),A=(p=this.isoWeekYear(),F=this.$u,C=(F?h.utc:h)().year(p).startOf("year"),b=4-C.isoWeekday(),C.isoWeekday()>4&&(b+=7),C.add(b,r));return q.diff(A,"week")+1},w.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var E=w.startOf;w.startOf=function(S,p){var F=this.$utils(),C=!!F.u(p)||p;return F.p(S)==="isoweek"?C?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):E.bind(this)(S,p)}}})}(wt)),wt.exports}var _r=wr();const Dr=Gt(_r);var _t={exports:{}},Cr=_t.exports,fe;function Sr(){return fe||(fe=1,function(t,e){(function(r,n){t.exports=n()})(Cr,function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,h=/\d\d/,u=/\d\d?/,w=/\d*[^-_:/,()\s\d]+/,E={},S=function(x){return(x=+x)+(x>68?1900:2e3)},p=function(x){return function(M){this[x]=+M}},F=[/[+-]\d\d:?(\d\d)?|Z/,function(x){(this.zone||(this.zone={})).offset=function(M){if(!M||M==="Z")return 0;var L=M.match(/([+-]|\d\d)/g),Y=60*L[1]+(+L[2]||0);return Y===0?0:L[0]==="+"?-Y:Y}(x)}],C=function(x){var M=E[x];return M&&(M.indexOf?M:M.s.concat(M.f))},b=function(x,M){var L,Y=E.meridiem;if(Y){for(var R=1;R<=24;R+=1)if(x.indexOf(Y(R,0,M))>-1){L=R>12;break}}else L=x===(M?"pm":"PM");return L},q={A:[w,function(x){this.afternoon=b(x,!1)}],a:[w,function(x){this.afternoon=b(x,!0)}],Q:[a,function(x){this.month=3*(x-1)+1}],S:[a,function(x){this.milliseconds=100*+x}],SS:[h,function(x){this.milliseconds=10*+x}],SSS:[/\d{3}/,function(x){this.milliseconds=+x}],s:[u,p("seconds")],ss:[u,p("seconds")],m:[u,p("minutes")],mm:[u,p("minutes")],H:[u,p("hours")],h:[u,p("hours")],HH:[u,p("hours")],hh:[u,p("hours")],D:[u,p("day")],DD:[h,p("day")],Do:[w,function(x){var M=E.ordinal,L=x.match(/\d+/);if(this.day=L[0],M)for(var Y=1;Y<=31;Y+=1)M(Y).replace(/\[|\]/g,"")===x&&(this.day=Y)}],w:[u,p("week")],ww:[h,p("week")],M:[u,p("month")],MM:[h,p("month")],MMM:[w,function(x){var M=C("months"),L=(C("monthsShort")||M.map(function(Y){return Y.slice(0,3)})).indexOf(x)+1;if(L<1)throw new Error;this.month=L%12||L}],MMMM:[w,function(x){var M=C("months").indexOf(x)+1;if(M<1)throw new Error;this.month=M%12||M}],Y:[/[+-]?\d+/,p("year")],YY:[h,function(x){this.year=S(x)}],YYYY:[/\d{4}/,p("year")],Z:F,ZZ:F};function A(x){var M,L;M=x,L=E&&E.formats;for(var Y=(x=M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(T,v,m){var D=m&&m.toUpperCase();return v||L[m]||r[m]||L[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,f,k){return f||k.slice(1)})})).match(n),R=Y.length,N=0;N<R;N+=1){var G=Y[N],O=q[G],g=O&&O[0],_=O&&O[1];Y[N]=_?{regex:g,parser:_}:G.replace(/^\[|\]$/g,"")}return function(T){for(var v={},m=0,D=0;m<R;m+=1){var c=Y[m];if(typeof c=="string")D+=c.length;else{var f=c.regex,k=c.parser,d=T.slice(D),y=f.exec(d)[0];k.call(v,y),T=T.replace(y,"")}}return function(s){var o=s.afternoon;if(o!==void 0){var i=s.hours;o?i<12&&(s.hours+=12):i===12&&(s.hours=0),delete s.afternoon}}(v),v}}return function(x,M,L){L.p.customParseFormat=!0,x&&x.parseTwoDigitYear&&(S=x.parseTwoDigitYear);var Y=M.prototype,R=Y.parse;Y.parse=function(N){var G=N.date,O=N.utc,g=N.args;this.$u=O;var _=g[1];if(typeof _=="string"){var T=g[2]===!0,v=g[3]===!0,m=T||v,D=g[2];v&&(D=g[2]),E=this.$locale(),!T&&D&&(E=L.Ls[D]),this.$d=function(d,y,s,o){try{if(["x","X"].indexOf(y)>-1)return new Date((y==="X"?1e3:1)*d);var i=A(y)(d),W=i.year,I=i.month,V=i.day,X=i.hours,z=i.minutes,P=i.seconds,Q=i.milliseconds,ot=i.zone,ct=i.week,mt=new Date,kt=V||(W||I?1:mt.getDate()),lt=W||mt.getFullYear(),B=0;W&&!I||(B=I>0?I-1:mt.getMonth());var $,U=X||0,at=z||0,K=P||0,it=Q||0;return ot?new Date(Date.UTC(lt,B,kt,U,at,K,it+60*ot.offset*1e3)):s?new Date(Date.UTC(lt,B,kt,U,at,K,it)):($=new Date(lt,B,kt,U,at,K,it),ct&&($=o($).week(ct).toDate()),$)}catch{return new Date("")}}(G,_,O,L),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),m&&G!=this.format(_)&&(this.$d=new Date("")),E={}}else if(_ instanceof Array)for(var c=_.length,f=1;f<=c;f+=1){g[1]=_[f-1];var k=L.apply(this,g);if(k.isValid()){this.$d=k.$d,this.$L=k.$L,this.init();break}f===c&&(this.$d=new Date(""))}else R.call(this,N)}}})}(_t)),_t.exports}var Er=Sr();const Mr=Gt(Er);var Dt={exports:{}},Ar=Dt.exports,he;function Ir(){return he||(he=1,function(t,e){(function(r,n){t.exports=n()})(Ar,function(){return function(r,n){var a=n.prototype,h=a.format;a.format=function(u){var w=this,E=this.$locale();if(!this.isValid())return h.bind(this)(u);var S=this.$utils(),p=(u||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(F){switch(F){case"Q":return Math.ceil((w.$M+1)/3);case"Do":return E.ordinal(w.$D);case"gggg":return w.weekYear();case"GGGG":return w.isoWeekYear();case"wo":return E.ordinal(w.week(),"W");case"w":case"ww":return S.s(w.week(),F==="w"?1:2,"0");case"W":case"WW":return S.s(w.isoWeek(),F==="W"?1:2,"0");case"k":case"kk":return S.s(String(w.$H===0?24:w.$H),F==="k"?1:2,"0");case"X":return Math.floor(w.$d.getTime()/1e3);case"x":return w.$d.getTime();case"z":return"["+w.offsetName()+"]";case"zzz":return"["+w.offsetName("long")+"]";default:return F}});return h.bind(this)(p)}}})}(Dt)),Dt.exports}var Fr=Ir();const Lr=Gt(Fr);var Rt=function(){var t=l(function(D,c,f,k){for(f=f||{},k=D.length;k--;f[D[k]]=c);return f},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],r=[1,26],n=[1,27],a=[1,28],h=[1,29],u=[1,30],w=[1,31],E=[1,32],S=[1,33],p=[1,34],F=[1,9],C=[1,10],b=[1,11],q=[1,12],A=[1,13],x=[1,14],M=[1,15],L=[1,16],Y=[1,19],R=[1,20],N=[1,21],G=[1,22],O=[1,23],g=[1,25],_=[1,35],T={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:l(function(c,f,k,d,y,s,o){var i=s.length-1;switch(y){case 1:return s[i-1];case 2:this.$=[];break;case 3:s[i-1].push(s[i]),this.$=s[i-1];break;case 4:case 5:this.$=s[i];break;case 6:case 7:this.$=[];break;case 8:d.setWeekday("monday");break;case 9:d.setWeekday("tuesday");break;case 10:d.setWeekday("wednesday");break;case 11:d.setWeekday("thursday");break;case 12:d.setWeekday("friday");break;case 13:d.setWeekday("saturday");break;case 14:d.setWeekday("sunday");break;case 15:d.setWeekend("friday");break;case 16:d.setWeekend("saturday");break;case 17:d.setDateFormat(s[i].substr(11)),this.$=s[i].substr(11);break;case 18:d.enableInclusiveEndDates(),this.$=s[i].substr(18);break;case 19:d.TopAxis(),this.$=s[i].substr(8);break;case 20:d.setAxisFormat(s[i].substr(11)),this.$=s[i].substr(11);break;case 21:d.setTickInterval(s[i].substr(13)),this.$=s[i].substr(13);break;case 22:d.setExcludes(s[i].substr(9)),this.$=s[i].substr(9);break;case 23:d.setIncludes(s[i].substr(9)),this.$=s[i].substr(9);break;case 24:d.setTodayMarker(s[i].substr(12)),this.$=s[i].substr(12);break;case 27:d.setDiagramTitle(s[i].substr(6)),this.$=s[i].substr(6);break;case 28:this.$=s[i].trim(),d.setAccTitle(this.$);break;case 29:case 30:this.$=s[i].trim(),d.setAccDescription(this.$);break;case 31:d.addSection(s[i].substr(8)),this.$=s[i].substr(8);break;case 33:d.addTask(s[i-1],s[i]),this.$="task";break;case 34:this.$=s[i-1],d.setClickEvent(s[i-1],s[i],null);break;case 35:this.$=s[i-2],d.setClickEvent(s[i-2],s[i-1],s[i]);break;case 36:this.$=s[i-2],d.setClickEvent(s[i-2],s[i-1],null),d.setLink(s[i-2],s[i]);break;case 37:this.$=s[i-3],d.setClickEvent(s[i-3],s[i-2],s[i-1]),d.setLink(s[i-3],s[i]);break;case 38:this.$=s[i-2],d.setClickEvent(s[i-2],s[i],null),d.setLink(s[i-2],s[i-1]);break;case 39:this.$=s[i-3],d.setClickEvent(s[i-3],s[i-1],s[i]),d.setLink(s[i-3],s[i-2]);break;case 40:this.$=s[i-1],d.setLink(s[i-1],s[i]);break;case 41:case 47:this.$=s[i-1]+" "+s[i];break;case 42:case 43:case 45:this.$=s[i-2]+" "+s[i-1]+" "+s[i];break;case 44:case 46:this.$=s[i-3]+" "+s[i-2]+" "+s[i-1]+" "+s[i];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:r,13:n,14:a,15:h,16:u,17:w,18:E,19:18,20:S,21:p,22:F,23:C,24:b,25:q,26:A,27:x,28:M,29:L,30:Y,31:R,33:N,35:G,36:O,37:24,38:g,40:_},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:r,13:n,14:a,15:h,16:u,17:w,18:E,19:18,20:S,21:p,22:F,23:C,24:b,25:q,26:A,27:x,28:M,29:L,30:Y,31:R,33:N,35:G,36:O,37:24,38:g,40:_},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:l(function(c,f){if(f.recoverable)this.trace(c);else{var k=new Error(c);throw k.hash=f,k}},"parseError"),parse:l(function(c){var f=this,k=[0],d=[],y=[null],s=[],o=this.table,i="",W=0,I=0,V=2,X=1,z=s.slice.call(arguments,1),P=Object.create(this.lexer),Q={yy:{}};for(var ot in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ot)&&(Q.yy[ot]=this.yy[ot]);P.setInput(c,Q.yy),Q.yy.lexer=P,Q.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var ct=P.yylloc;s.push(ct);var mt=P.options&&P.options.ranges;typeof Q.yy.parseError=="function"?this.parseError=Q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function kt(j){k.length=k.length-2*j,y.length=y.length-j,s.length=s.length-j}l(kt,"popStack");function lt(){var j;return j=d.pop()||P.lex()||X,typeof j!="number"&&(j instanceof Array&&(d=j,j=d.pop()),j=f.symbols_[j]||j),j}l(lt,"lex");for(var B,$,U,at,K={},it,J,re,vt;;){if($=k[k.length-1],this.defaultActions[$]?U=this.defaultActions[$]:((B===null||typeof B>"u")&&(B=lt()),U=o[$]&&o[$][B]),typeof U>"u"||!U.length||!U[0]){var Ft="";vt=[];for(it in o[$])this.terminals_[it]&&it>V&&vt.push("'"+this.terminals_[it]+"'");P.showPosition?Ft="Parse error on line "+(W+1)+`:
2
+ `+P.showPosition()+`
3
+ Expecting `+vt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ft="Parse error on line "+(W+1)+": Unexpected "+(B==X?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ft,{text:P.match,token:this.terminals_[B]||B,line:P.yylineno,loc:ct,expected:vt})}if(U[0]instanceof Array&&U.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+B);switch(U[0]){case 1:k.push(B),y.push(P.yytext),s.push(P.yylloc),k.push(U[1]),B=null,I=P.yyleng,i=P.yytext,W=P.yylineno,ct=P.yylloc;break;case 2:if(J=this.productions_[U[1]][1],K.$=y[y.length-J],K._$={first_line:s[s.length-(J||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(J||1)].first_column,last_column:s[s.length-1].last_column},mt&&(K._$.range=[s[s.length-(J||1)].range[0],s[s.length-1].range[1]]),at=this.performAction.apply(K,[i,I,W,Q.yy,U[1],y,s].concat(z)),typeof at<"u")return at;J&&(k=k.slice(0,-1*J*2),y=y.slice(0,-1*J),s=s.slice(0,-1*J)),k.push(this.productions_[U[1]][0]),y.push(K.$),s.push(K._$),re=o[k[k.length-2]][k[k.length-1]],k.push(re);break;case 3:return!0}}return!0},"parse")},v=function(){var D={EOF:1,parseError:l(function(f,k){if(this.yy.parser)this.yy.parser.parseError(f,k);else throw new Error(f)},"parseError"),setInput:l(function(c,f){return this.yy=f||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var f=c.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:l(function(c){var f=c.length,k=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),k.length-1&&(this.yylineno-=k.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:k?(k.length===d.length?this.yylloc.first_column:0)+d[d.length-k.length].length-k[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(c){this.unput(this.match.slice(c))},"less"),pastInput:l(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var c=this.pastInput(),f=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
5
+ `+f+"^"},"showPosition"),test_match:l(function(c,f){var k,d,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),d=c[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(c[0].length),this.matched+=c[0],k=this.performAction.call(this,this.yy,this,f,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),k)return k;if(this._backtrack){for(var s in y)this[s]=y[s];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,f,k,d;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),s=0;s<y.length;s++)if(k=this._input.match(this.rules[y[s]]),k&&(!f||k[0].length>f[0].length)){if(f=k,d=s,this.options.backtrack_lexer){if(c=this.test_match(k,y[s]),c!==!1)return c;if(this._backtrack){f=!1;continue}else return!1}else if(!this.options.flex)break}return f?(c=this.test_match(f,y[d]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var f=this.next();return f||this.lex()},"lex"),begin:l(function(f){this.conditionStack.push(f)},"begin"),popState:l(function(){var f=this.conditionStack.length-1;return f>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:l(function(f){return f=this.conditionStack.length-1-Math.abs(f||0),f>=0?this.conditionStack[f]:"INITIAL"},"topState"),pushState:l(function(f){this.begin(f)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(f,k,d,y){switch(d){case 0:return this.begin("open_directive"),"open_directive";case 1:return this.begin("acc_title"),31;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),33;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:break;case 9:break;case 10:break;case 11:return 10;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState(),this.begin("callbackargs");break;case 20:return 41;case 21:this.popState();break;case 22:return 42;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;case 26:return 4;case 27:return 22;case 28:return 23;case 29:return 24;case 30:return 25;case 31:return 26;case 32:return 28;case 33:return 27;case 34:return 29;case 35:return 12;case 36:return 13;case 37:return 14;case 38:return 15;case 39:return 16;case 40:return 17;case 41:return 18;case 42:return 20;case 43:return 21;case 44:return"date";case 45:return 30;case 46:return"accDescription";case 47:return 36;case 48:return 38;case 49:return 39;case 50:return":";case 51:return 6;case 52:return"INVALID"}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/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,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},callbackargs:{rules:[21,22],inclusive:!1},callbackname:{rules:[18,19,20],inclusive:!1},href:{rules:[15,16],inclusive:!1},click:{rules:[24,25],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,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],inclusive:!0}}};return D}();T.lexer=v;function m(){this.yy={}}return l(m,"Parser"),m.prototype=T,T.Parser=m,new m}();Rt.parser=Rt;var Yr=Rt;Z.extend(Dr);Z.extend(Mr);Z.extend(Lr);var me={friday:5,saturday:6},tt="",Xt="",Ut=void 0,Zt="",yt=[],gt=[],jt=new Map,$t=[],At=[],ht="",Qt="",Me=["active","done","crit","milestone","vert"],Kt=[],pt=!1,Jt=!1,te="sunday",It="saturday",Bt=0,Wr=l(function(){$t=[],At=[],ht="",Kt=[],Ct=0,qt=void 0,St=void 0,H=[],tt="",Xt="",Qt="",Ut=void 0,Zt="",yt=[],gt=[],pt=!1,Jt=!1,Bt=0,jt=new Map,Xe(),te="sunday",It="saturday"},"clear"),Vr=l(function(t){Xt=t},"setAxisFormat"),zr=l(function(){return Xt},"getAxisFormat"),Or=l(function(t){Ut=t},"setTickInterval"),Pr=l(function(){return Ut},"getTickInterval"),Nr=l(function(t){Zt=t},"setTodayMarker"),Rr=l(function(){return Zt},"getTodayMarker"),Br=l(function(t){tt=t},"setDateFormat"),Hr=l(function(){pt=!0},"enableInclusiveEndDates"),qr=l(function(){return pt},"endDatesAreInclusive"),Gr=l(function(){Jt=!0},"enableTopAxis"),Xr=l(function(){return Jt},"topAxisEnabled"),Ur=l(function(t){Qt=t},"setDisplayMode"),Zr=l(function(){return Qt},"getDisplayMode"),jr=l(function(){return tt},"getDateFormat"),$r=l(function(t){yt=t.toLowerCase().split(/[\s,]+/)},"setIncludes"),Qr=l(function(){return yt},"getIncludes"),Kr=l(function(t){gt=t.toLowerCase().split(/[\s,]+/)},"setExcludes"),Jr=l(function(){return gt},"getExcludes"),tn=l(function(){return jt},"getLinks"),en=l(function(t){ht=t,$t.push(t)},"addSection"),rn=l(function(){return $t},"getSections"),nn=l(function(){let t=ke();const e=10;let r=0;for(;!t&&r<e;)t=ke(),r++;return At=H,At},"getTasks"),Ae=l(function(t,e,r,n){const a=t.format(e.trim()),h=t.format("YYYY-MM-DD");return n.includes(a)||n.includes(h)?!1:r.includes("weekends")&&(t.isoWeekday()===me[It]||t.isoWeekday()===me[It]+1)||r.includes(t.format("dddd").toLowerCase())?!0:r.includes(a)||r.includes(h)},"isInvalidDate"),an=l(function(t){te=t},"setWeekday"),sn=l(function(){return te},"getWeekday"),on=l(function(t){It=t},"setWeekend"),Ie=l(function(t,e,r,n){if(!r.length||t.manualEndTime)return;let a;t.startTime instanceof Date?a=Z(t.startTime):a=Z(t.startTime,e,!0),a=a.add(1,"d");let h;t.endTime instanceof Date?h=Z(t.endTime):h=Z(t.endTime,e,!0);const[u,w]=cn(a,h,e,r,n);t.endTime=u.toDate(),t.renderEndTime=w},"checkTaskDates"),cn=l(function(t,e,r,n,a){let h=!1,u=null;for(;t<=e;)h||(u=e.toDate()),h=Ae(t,r,n,a),h&&(e=e.add(1,"d")),t=t.add(1,"d");return[e,u]},"fixTaskDates"),Ht=l(function(t,e,r){if(r=r.trim(),(e.trim()==="x"||e.trim()==="X")&&/^\d+$/.test(r))return new Date(Number(r));const a=/^after\s+(?<ids>[\d\w- ]+)/.exec(r);if(a!==null){let u=null;for(const E of a.groups.ids.split(" ")){let S=st(E);S!==void 0&&(!u||S.endTime>u.endTime)&&(u=S)}if(u)return u.endTime;const w=new Date;return w.setHours(0,0,0,0),w}let h=Z(r,e.trim(),!0);if(h.isValid())return h.toDate();{Et.debug("Invalid date:"+r),Et.debug("With date format:"+e.trim());const u=new Date(r);if(u===void 0||isNaN(u.getTime())||u.getFullYear()<-1e4||u.getFullYear()>1e4)throw new Error("Invalid date:"+r);return u}},"getStartDate"),Fe=l(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),Le=l(function(t,e,r,n=!1){r=r.trim();const h=/^until\s+(?<ids>[\d\w- ]+)/.exec(r);if(h!==null){let p=null;for(const C of h.groups.ids.split(" ")){let b=st(C);b!==void 0&&(!p||b.startTime<p.startTime)&&(p=b)}if(p)return p.startTime;const F=new Date;return F.setHours(0,0,0,0),F}let u=Z(r,e.trim(),!0);if(u.isValid())return n&&(u=u.add(1,"d")),u.toDate();let w=Z(t);const[E,S]=Fe(r);if(!Number.isNaN(E)){const p=w.add(E,S);p.isValid()&&(w=p)}return w.toDate()},"getEndDate"),Ct=0,ft=l(function(t){return t===void 0?(Ct=Ct+1,"task"+Ct):t},"parseId"),ln=l(function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),a={};ee(n,a,Me);for(let u=0;u<n.length;u++)n[u]=n[u].trim();let h="";switch(n.length){case 1:a.id=ft(),a.startTime=t.endTime,h=n[0];break;case 2:a.id=ft(),a.startTime=Ht(void 0,tt,n[0]),h=n[1];break;case 3:a.id=ft(n[0]),a.startTime=Ht(void 0,tt,n[1]),h=n[2];break}return h&&(a.endTime=Le(a.startTime,tt,h,pt),a.manualEndTime=Z(h,"YYYY-MM-DD",!0).isValid(),Ie(a,tt,gt,yt)),a},"compileData"),un=l(function(t,e){let r;e.substr(0,1)===":"?r=e.substr(1,e.length):r=e;const n=r.split(","),a={};ee(n,a,Me);for(let h=0;h<n.length;h++)n[h]=n[h].trim();switch(n.length){case 1:a.id=ft(),a.startTime={type:"prevTaskEnd",id:t},a.endTime={data:n[0]};break;case 2:a.id=ft(),a.startTime={type:"getStartDate",startData:n[0]},a.endTime={data:n[1]};break;case 3:a.id=ft(n[0]),a.startTime={type:"getStartDate",startData:n[1]},a.endTime={data:n[2]};break}return a},"parseData"),qt,St,H=[],Ye={},dn=l(function(t,e){const r={section:ht,type:ht,processed:!1,manualEndTime:!1,renderEndTime:null,raw:{data:e},task:t,classes:[]},n=un(St,e);r.raw.startTime=n.startTime,r.raw.endTime=n.endTime,r.id=n.id,r.prevTaskId=St,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.vert=n.vert,r.order=Bt,Bt++;const a=H.push(r);St=r.id,Ye[r.id]=a-1},"addTask"),st=l(function(t){const e=Ye[t];return H[e]},"findTaskById"),fn=l(function(t,e){const r={section:ht,type:ht,description:t,task:t,classes:[]},n=ln(qt,e);r.startTime=n.startTime,r.endTime=n.endTime,r.id=n.id,r.active=n.active,r.done=n.done,r.crit=n.crit,r.milestone=n.milestone,r.vert=n.vert,qt=r,At.push(r)},"addTaskOrg"),ke=l(function(){const t=l(function(r){const n=H[r];let a="";switch(H[r].raw.startTime.type){case"prevTaskEnd":{const h=st(n.prevTaskId);n.startTime=h.endTime;break}case"getStartDate":a=Ht(void 0,tt,H[r].raw.startTime.startData),a&&(H[r].startTime=a);break}return H[r].startTime&&(H[r].endTime=Le(H[r].startTime,tt,H[r].raw.endTime.data,pt),H[r].endTime&&(H[r].processed=!0,H[r].manualEndTime=Z(H[r].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),Ie(H[r],tt,gt,yt))),H[r].processed},"compileTask");let e=!0;for(const[r,n]of H.entries())t(r),e=e&&n.processed;return e},"compileTasks"),hn=l(function(t,e){let r=e;ut().securityLevel!=="loose"&&(r=Ge.sanitizeUrl(e)),t.split(",").forEach(function(n){st(n)!==void 0&&(Ve(n,()=>{window.open(r,"_self")}),jt.set(n,r))}),We(t,"clickable")},"setLink"),We=l(function(t,e){t.split(",").forEach(function(r){let n=st(r);n!==void 0&&n.classes.push(e)})},"setClass"),mn=l(function(t,e,r){if(ut().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let h=0;h<n.length;h++){let u=n[h].trim();u.startsWith('"')&&u.endsWith('"')&&(u=u.substr(1,u.length-2)),n[h]=u}}n.length===0&&n.push(t),st(t)!==void 0&&Ve(t,()=>{Ue.runFunc(e,...n)})},"setClickFun"),Ve=l(function(t,e){Kt.push(function(){const r=document.querySelector(`[id="${t}"]`);r!==null&&r.addEventListener("click",function(){e()})},function(){const r=document.querySelector(`[id="${t}-text"]`);r!==null&&r.addEventListener("click",function(){e()})})},"pushFun"),kn=l(function(t,e,r){t.split(",").forEach(function(n){mn(n,e,r)}),We(t,"clickable")},"setClickEvent"),yn=l(function(t){Kt.forEach(function(e){e(t)})},"bindFunctions"),gn={getConfig:l(()=>ut().gantt,"getConfig"),clear:Wr,setDateFormat:Br,getDateFormat:jr,enableInclusiveEndDates:Hr,endDatesAreInclusive:qr,enableTopAxis:Gr,topAxisEnabled:Xr,setAxisFormat:Vr,getAxisFormat:zr,setTickInterval:Or,getTickInterval:Pr,setTodayMarker:Nr,getTodayMarker:Rr,setAccTitle:Be,getAccTitle:Re,setDiagramTitle:Ne,getDiagramTitle:Pe,setDisplayMode:Ur,getDisplayMode:Zr,setAccDescription:Oe,getAccDescription:ze,addSection:en,getSections:rn,getTasks:nn,addTask:dn,findTaskById:st,addTaskOrg:fn,setIncludes:$r,getIncludes:Qr,setExcludes:Kr,getExcludes:Jr,setClickEvent:kn,setLink:hn,getLinks:tn,bindFunctions:yn,parseDuration:Fe,isInvalidDate:Ae,setWeekday:an,getWeekday:sn,setWeekend:on};function ee(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(a){const h="^\\s*"+a+"\\s*$",u=new RegExp(h);t[0].match(u)&&(e[a]=!0,t.shift(1),n=!0)})}l(ee,"getTaskTags");var pn=l(function(){Et.debug("Something is calling, setConf, remove the call")},"setConf"),ye={monday:sr,tuesday:ar,wednesday:ir,thursday:nr,friday:rr,saturday:er,sunday:tr},vn=l((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((h,u)=>h.startTime-u.startTime||h.order-u.order),a=0;for(const h of n)for(let u=0;u<r.length;u++)if(h.startTime>=r[u]){r[u]=h.endTime,h.order=u+e,u>a&&(a=u);break}return a},"getMaxIntersections"),rt,bn=l(function(t,e,r,n){const a=ut().gantt,h=ut().securityLevel;let u;h==="sandbox"&&(u=bt("#i"+e));const w=h==="sandbox"?bt(u.nodes()[0].contentDocument.body):bt("body"),E=h==="sandbox"?u.nodes()[0].contentDocument:document,S=E.getElementById(e);rt=S.parentElement.offsetWidth,rt===void 0&&(rt=1200),a.useWidth!==void 0&&(rt=a.useWidth);const p=n.db.getTasks();let F=[];for(const g of p)F.push(g.type);F=O(F);const C={};let b=2*a.topPadding;if(n.db.getDisplayMode()==="compact"||a.displayMode==="compact"){const g={};for(const T of p)g[T.section]===void 0?g[T.section]=[T]:g[T.section].push(T);let _=0;for(const T of Object.keys(g)){const v=vn(g[T],_)+1;_+=v,b+=v*(a.barHeight+a.barGap),C[T]=v}}else{b+=p.length*(a.barHeight+a.barGap);for(const g of F)C[g]=p.filter(_=>_.type===g).length}S.setAttribute("viewBox","0 0 "+rt+" "+b);const q=w.select(`[id="${e}"]`),A=$e().domain([Qe(p,function(g){return g.startTime}),Ke(p,function(g){return g.endTime})]).rangeRound([0,rt-a.leftPadding-a.rightPadding]);function x(g,_){const T=g.startTime,v=_.startTime;let m=0;return T>v?m=1:T<v&&(m=-1),m}l(x,"taskCompare"),p.sort(x),M(p,rt,b),He(q,b,rt,a.useMaxWidth),q.append("text").text(n.db.getDiagramTitle()).attr("x",rt/2).attr("y",a.titleTopMargin).attr("class","titleText");function M(g,_,T){const v=a.barHeight,m=v+a.barGap,D=a.topPadding,c=a.leftPadding,f=Je().domain([0,F.length]).range(["#00B9FA","#F95002"]).interpolate(hr);Y(m,D,c,_,T,g,n.db.getExcludes(),n.db.getIncludes()),R(c,D,_,T),L(g,m,D,c,v,f,_),N(m,D),G(c,D,_,T)}l(M,"makeGantt");function L(g,_,T,v,m,D,c){g.sort((o,i)=>o.vert===i.vert?0:o.vert?1:-1);const k=[...new Set(g.map(o=>o.order))].map(o=>g.find(i=>i.order===o));q.append("g").selectAll("rect").data(k).enter().append("rect").attr("x",0).attr("y",function(o,i){return i=o.order,i*_+T-2}).attr("width",function(){return c-a.rightPadding/2}).attr("height",_).attr("class",function(o){for(const[i,W]of F.entries())if(o.type===W)return"section section"+i%a.numberSectionStyles;return"section section0"}).enter();const d=q.append("g").selectAll("rect").data(g).enter(),y=n.db.getLinks();if(d.append("rect").attr("id",function(o){return o.id}).attr("rx",3).attr("ry",3).attr("x",function(o){return o.milestone?A(o.startTime)+v+.5*(A(o.endTime)-A(o.startTime))-.5*m:A(o.startTime)+v}).attr("y",function(o,i){return i=o.order,o.vert?a.gridLineStartPadding:i*_+T}).attr("width",function(o){return o.milestone?m:o.vert?.08*m:A(o.renderEndTime||o.endTime)-A(o.startTime)}).attr("height",function(o){return o.vert?p.length*(a.barHeight+a.barGap)+a.barHeight*2:m}).attr("transform-origin",function(o,i){return i=o.order,(A(o.startTime)+v+.5*(A(o.endTime)-A(o.startTime))).toString()+"px "+(i*_+T+.5*m).toString()+"px"}).attr("class",function(o){const i="task";let W="";o.classes.length>0&&(W=o.classes.join(" "));let I=0;for(const[X,z]of F.entries())o.type===z&&(I=X%a.numberSectionStyles);let V="";return o.active?o.crit?V+=" activeCrit":V=" active":o.done?o.crit?V=" doneCrit":V=" done":o.crit&&(V+=" crit"),V.length===0&&(V=" task"),o.milestone&&(V=" milestone "+V),o.vert&&(V=" vert "+V),V+=I,V+=" "+W,i+V}),d.append("text").attr("id",function(o){return o.id+"-text"}).text(function(o){return o.task}).attr("font-size",a.fontSize).attr("x",function(o){let i=A(o.startTime),W=A(o.renderEndTime||o.endTime);if(o.milestone&&(i+=.5*(A(o.endTime)-A(o.startTime))-.5*m,W=i+m),o.vert)return A(o.startTime)+v;const I=this.getBBox().width;return I>W-i?W+I+1.5*a.leftPadding>c?i+v-5:W+v+5:(W-i)/2+i+v}).attr("y",function(o,i){return o.vert?a.gridLineStartPadding+p.length*(a.barHeight+a.barGap)+60:(i=o.order,i*_+a.barHeight/2+(a.fontSize/2-2)+T)}).attr("text-height",m).attr("class",function(o){const i=A(o.startTime);let W=A(o.endTime);o.milestone&&(W=i+m);const I=this.getBBox().width;let V="";o.classes.length>0&&(V=o.classes.join(" "));let X=0;for(const[P,Q]of F.entries())o.type===Q&&(X=P%a.numberSectionStyles);let z="";return o.active&&(o.crit?z="activeCritText"+X:z="activeText"+X),o.done?o.crit?z=z+" doneCritText"+X:z=z+" doneText"+X:o.crit&&(z=z+" critText"+X),o.milestone&&(z+=" milestoneText"),o.vert&&(z+=" vertText"),I>W-i?W+I+1.5*a.leftPadding>c?V+" taskTextOutsideLeft taskTextOutside"+X+" "+z:V+" taskTextOutsideRight taskTextOutside"+X+" "+z+" width-"+I:V+" taskText taskText"+X+" "+z+" width-"+I}),ut().securityLevel==="sandbox"){let o;o=bt("#i"+e);const i=o.nodes()[0].contentDocument;d.filter(function(W){return y.has(W.id)}).each(function(W){var I=i.querySelector("#"+W.id),V=i.querySelector("#"+W.id+"-text");const X=I.parentNode;var z=i.createElement("a");z.setAttribute("xlink:href",y.get(W.id)),z.setAttribute("target","_top"),X.appendChild(z),z.appendChild(I),z.appendChild(V)})}}l(L,"drawRects");function Y(g,_,T,v,m,D,c,f){if(c.length===0&&f.length===0)return;let k,d;for(const{startTime:I,endTime:V}of D)(k===void 0||I<k)&&(k=I),(d===void 0||V>d)&&(d=V);if(!k||!d)return;if(Z(d).diff(Z(k),"year")>5){Et.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const y=n.db.getDateFormat(),s=[];let o=null,i=Z(k);for(;i.valueOf()<=d;)n.db.isInvalidDate(i,y,c,f)?o?o.end=i:o={start:i,end:i}:o&&(s.push(o),o=null),i=i.add(1,"d");q.append("g").selectAll("rect").data(s).enter().append("rect").attr("id",I=>"exclude-"+I.start.format("YYYY-MM-DD")).attr("x",I=>A(I.start.startOf("day"))+T).attr("y",a.gridLineStartPadding).attr("width",I=>A(I.end.endOf("day"))-A(I.start.startOf("day"))).attr("height",m-_-a.gridLineStartPadding).attr("transform-origin",function(I,V){return(A(I.start)+T+.5*(A(I.end)-A(I.start))).toString()+"px "+(V*g+.5*m).toString()+"px"}).attr("class","exclude-range")}l(Y,"drawExcludeDays");function R(g,_,T,v){const m=n.db.getDateFormat(),D=n.db.getAxisFormat();let c;D?c=D:m==="D"?c="%d":c=a.axisFormat??"%Y-%m-%d";let f=xr(A).tickSize(-v+_+a.gridLineStartPadding).tickFormat(ne(c));const d=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(n.db.getTickInterval()||a.tickInterval);if(d!==null){const y=d[1],s=d[2],o=n.db.getWeekday()||a.weekday;switch(s){case"millisecond":f.ticks(le.every(y));break;case"second":f.ticks(ce.every(y));break;case"minute":f.ticks(oe.every(y));break;case"hour":f.ticks(se.every(y));break;case"day":f.ticks(ae.every(y));break;case"week":f.ticks(ye[o].every(y));break;case"month":f.ticks(ie.every(y));break}}if(q.append("g").attr("class","grid").attr("transform","translate("+g+", "+(v-50)+")").call(f).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em"),n.db.topAxisEnabled()||a.topAxis){let y=br(A).tickSize(-v+_+a.gridLineStartPadding).tickFormat(ne(c));if(d!==null){const s=d[1],o=d[2],i=n.db.getWeekday()||a.weekday;switch(o){case"millisecond":y.ticks(le.every(s));break;case"second":y.ticks(ce.every(s));break;case"minute":y.ticks(oe.every(s));break;case"hour":y.ticks(se.every(s));break;case"day":y.ticks(ae.every(s));break;case"week":y.ticks(ye[i].every(s));break;case"month":y.ticks(ie.every(s));break}}q.append("g").attr("class","grid").attr("transform","translate("+g+", "+_+")").call(y).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}l(R,"makeGrid");function N(g,_){let T=0;const v=Object.keys(C).map(m=>[m,C[m]]);q.append("g").selectAll("text").data(v).enter().append(function(m){const D=m[0].split(qe.lineBreakRegex),c=-(D.length-1)/2,f=E.createElementNS("http://www.w3.org/2000/svg","text");f.setAttribute("dy",c+"em");for(const[k,d]of D.entries()){const y=E.createElementNS("http://www.w3.org/2000/svg","tspan");y.setAttribute("alignment-baseline","central"),y.setAttribute("x","10"),k>0&&y.setAttribute("dy","1em"),y.textContent=d,f.appendChild(y)}return f}).attr("x",10).attr("y",function(m,D){if(D>0)for(let c=0;c<D;c++)return T+=v[D-1][1],m[1]*g/2+T*g+_;else return m[1]*g/2+_}).attr("font-size",a.sectionFontSize).attr("class",function(m){for(const[D,c]of F.entries())if(m[0]===c)return"sectionTitle sectionTitle"+D%a.numberSectionStyles;return"sectionTitle"})}l(N,"vertLabels");function G(g,_,T,v){const m=n.db.getTodayMarker();if(m==="off")return;const D=q.append("g").attr("class","today"),c=new Date,f=D.append("line");f.attr("x1",A(c)+g).attr("x2",A(c)+g).attr("y1",a.titleTopMargin).attr("y2",v-a.titleTopMargin).attr("class","today"),m!==""&&f.attr("style",m.replace(/,/g,";"))}l(G,"drawToday");function O(g){const _={},T=[];for(let v=0,m=g.length;v<m;++v)Object.prototype.hasOwnProperty.call(_,g[v])||(_[g[v]]=!0,T.push(g[v]));return T}l(O,"checkUnique")},"draw"),xn={setConf:pn,draw:bn},Tn=l(t=>`
7
+ .mermaid-main-font {
8
+ font-family: ${t.fontFamily};
9
+ }
10
+
11
+ .exclude-range {
12
+ fill: ${t.excludeBkgColor};
13
+ }
14
+
15
+ .section {
16
+ stroke: none;
17
+ opacity: 0.2;
18
+ }
19
+
20
+ .section0 {
21
+ fill: ${t.sectionBkgColor};
22
+ }
23
+
24
+ .section2 {
25
+ fill: ${t.sectionBkgColor2};
26
+ }
27
+
28
+ .section1,
29
+ .section3 {
30
+ fill: ${t.altSectionBkgColor};
31
+ opacity: 0.2;
32
+ }
33
+
34
+ .sectionTitle0 {
35
+ fill: ${t.titleColor};
36
+ }
37
+
38
+ .sectionTitle1 {
39
+ fill: ${t.titleColor};
40
+ }
41
+
42
+ .sectionTitle2 {
43
+ fill: ${t.titleColor};
44
+ }
45
+
46
+ .sectionTitle3 {
47
+ fill: ${t.titleColor};
48
+ }
49
+
50
+ .sectionTitle {
51
+ text-anchor: start;
52
+ font-family: ${t.fontFamily};
53
+ }
54
+
55
+
56
+ /* Grid and axis */
57
+
58
+ .grid .tick {
59
+ stroke: ${t.gridColor};
60
+ opacity: 0.8;
61
+ shape-rendering: crispEdges;
62
+ }
63
+
64
+ .grid .tick text {
65
+ font-family: ${t.fontFamily};
66
+ fill: ${t.textColor};
67
+ }
68
+
69
+ .grid path {
70
+ stroke-width: 0;
71
+ }
72
+
73
+
74
+ /* Today line */
75
+
76
+ .today {
77
+ fill: none;
78
+ stroke: ${t.todayLineColor};
79
+ stroke-width: 2px;
80
+ }
81
+
82
+
83
+ /* Task styling */
84
+
85
+ /* Default task */
86
+
87
+ .task {
88
+ stroke-width: 2;
89
+ }
90
+
91
+ .taskText {
92
+ text-anchor: middle;
93
+ font-family: ${t.fontFamily};
94
+ }
95
+
96
+ .taskTextOutsideRight {
97
+ fill: ${t.taskTextDarkColor};
98
+ text-anchor: start;
99
+ font-family: ${t.fontFamily};
100
+ }
101
+
102
+ .taskTextOutsideLeft {
103
+ fill: ${t.taskTextDarkColor};
104
+ text-anchor: end;
105
+ }
106
+
107
+
108
+ /* Special case clickable */
109
+
110
+ .task.clickable {
111
+ cursor: pointer;
112
+ }
113
+
114
+ .taskText.clickable {
115
+ cursor: pointer;
116
+ fill: ${t.taskTextClickableColor} !important;
117
+ font-weight: bold;
118
+ }
119
+
120
+ .taskTextOutsideLeft.clickable {
121
+ cursor: pointer;
122
+ fill: ${t.taskTextClickableColor} !important;
123
+ font-weight: bold;
124
+ }
125
+
126
+ .taskTextOutsideRight.clickable {
127
+ cursor: pointer;
128
+ fill: ${t.taskTextClickableColor} !important;
129
+ font-weight: bold;
130
+ }
131
+
132
+
133
+ /* Specific task settings for the sections*/
134
+
135
+ .taskText0,
136
+ .taskText1,
137
+ .taskText2,
138
+ .taskText3 {
139
+ fill: ${t.taskTextColor};
140
+ }
141
+
142
+ .task0,
143
+ .task1,
144
+ .task2,
145
+ .task3 {
146
+ fill: ${t.taskBkgColor};
147
+ stroke: ${t.taskBorderColor};
148
+ }
149
+
150
+ .taskTextOutside0,
151
+ .taskTextOutside2
152
+ {
153
+ fill: ${t.taskTextOutsideColor};
154
+ }
155
+
156
+ .taskTextOutside1,
157
+ .taskTextOutside3 {
158
+ fill: ${t.taskTextOutsideColor};
159
+ }
160
+
161
+
162
+ /* Active task */
163
+
164
+ .active0,
165
+ .active1,
166
+ .active2,
167
+ .active3 {
168
+ fill: ${t.activeTaskBkgColor};
169
+ stroke: ${t.activeTaskBorderColor};
170
+ }
171
+
172
+ .activeText0,
173
+ .activeText1,
174
+ .activeText2,
175
+ .activeText3 {
176
+ fill: ${t.taskTextDarkColor} !important;
177
+ }
178
+
179
+
180
+ /* Completed task */
181
+
182
+ .done0,
183
+ .done1,
184
+ .done2,
185
+ .done3 {
186
+ stroke: ${t.doneTaskBorderColor};
187
+ fill: ${t.doneTaskBkgColor};
188
+ stroke-width: 2;
189
+ }
190
+
191
+ .doneText0,
192
+ .doneText1,
193
+ .doneText2,
194
+ .doneText3 {
195
+ fill: ${t.taskTextDarkColor} !important;
196
+ }
197
+
198
+
199
+ /* Tasks on the critical line */
200
+
201
+ .crit0,
202
+ .crit1,
203
+ .crit2,
204
+ .crit3 {
205
+ stroke: ${t.critBorderColor};
206
+ fill: ${t.critBkgColor};
207
+ stroke-width: 2;
208
+ }
209
+
210
+ .activeCrit0,
211
+ .activeCrit1,
212
+ .activeCrit2,
213
+ .activeCrit3 {
214
+ stroke: ${t.critBorderColor};
215
+ fill: ${t.activeTaskBkgColor};
216
+ stroke-width: 2;
217
+ }
218
+
219
+ .doneCrit0,
220
+ .doneCrit1,
221
+ .doneCrit2,
222
+ .doneCrit3 {
223
+ stroke: ${t.critBorderColor};
224
+ fill: ${t.doneTaskBkgColor};
225
+ stroke-width: 2;
226
+ cursor: pointer;
227
+ shape-rendering: crispEdges;
228
+ }
229
+
230
+ .milestone {
231
+ transform: rotate(45deg) scale(0.8,0.8);
232
+ }
233
+
234
+ .milestoneText {
235
+ font-style: italic;
236
+ }
237
+ .doneCritText0,
238
+ .doneCritText1,
239
+ .doneCritText2,
240
+ .doneCritText3 {
241
+ fill: ${t.taskTextDarkColor} !important;
242
+ }
243
+
244
+ .vert {
245
+ stroke: ${t.vertLineColor};
246
+ }
247
+
248
+ .vertText {
249
+ font-size: 15px;
250
+ text-anchor: middle;
251
+ fill: ${t.vertLineColor} !important;
252
+ }
253
+
254
+ .activeCritText0,
255
+ .activeCritText1,
256
+ .activeCritText2,
257
+ .activeCritText3 {
258
+ fill: ${t.taskTextDarkColor} !important;
259
+ }
260
+
261
+ .titleText {
262
+ text-anchor: middle;
263
+ font-size: 18px;
264
+ fill: ${t.titleColor||t.textColor};
265
+ font-family: ${t.fontFamily};
266
+ }
267
+ `,"getStyles"),wn=Tn,Cn={parser:Yr,db:gn,renderer:xn,styles:wn};export{Cn as diagram};
@@ -1,4 +1,4 @@
1
- import{p as Z}from"./chunk-4BX2VUAB-O9tuPwJ2.js";import{I as F}from"./chunk-QZHKN3VN-BNYpxk7b.js";import{_ as h,q as U,p as rr,s as er,g as tr,a as ar,b as nr,l as m,c as sr,u as or,D as cr,y as ir,j as B,E as dr,F as hr,G as lr,H as $r}from"./mermaid.core-Y2zCEMvG.js";import{p as fr}from"./treemap-KMMF4GRG-pRPfKbhX.js";import{s as gr}from"./index-Cf3jkaWJ.js";import"./min-BGYgWBoZ.js";import"./isUndefined-DhAvAp_K.js";import"./clone-C4H89Tb1.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},yr=lr.gitGraph,z=h(()=>dr({...yr,...hr().gitGraph}),"getConfig"),i=new F(()=>{const t=z(),r=t.mainBranchName,a=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:a}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function j(){return $r({length:7})}h(j,"getID");function N(t,r){const a=Object.create(null);return t.reduce((s,e)=>{const n=r(e);return a[n]||(a[n]=!0,s.push(e)),s},[])}h(N,"uniqBy");var xr=h(function(t){i.records.direction=t},"setDirection"),pr=h(function(t){m.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{i.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),ur=h(function(){return i.records.options},"getOptions"),br=h(function(t){let r=t.msg,a=t.id;const s=t.type;let e=t.tags;m.info("commit",r,a,s,e),m.debug("Entering commit:",r,a,s,e);const n=z();a=B.sanitizeText(a,n),r=B.sanitizeText(r,n),e=e==null?void 0:e.map(o=>B.sanitizeText(o,n));const c={id:a||i.records.seq+"-"+j(),message:r,seq:i.records.seq++,type:s??p.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=c,m.info("main branch",n.mainBranchName),i.records.commits.has(c.id)&&m.warn(`Commit ID ${c.id} already exists`),i.records.commits.set(c.id,c),i.records.branches.set(i.records.currBranch,c.id),m.debug("in pushCommit "+c.id)},"commit"),mr=h(function(t){let r=t.name;const a=t.order;if(r=B.sanitizeText(r,z()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:a}),_(r),m.debug("in createBranch")},"branch"),wr=h(t=>{let r=t.branch,a=t.id;const s=t.type,e=t.tags,n=z();r=B.sanitizeText(r,n),a&&(a=B.sanitizeText(a,n));const c=i.records.branches.get(i.records.currBranch),o=i.records.branches.get(r),$=c?i.records.commits.get(c):void 0,l=o?i.records.commits.get(o):void 0;if($&&l&&$.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const d=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if($===void 0||!$){const d=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},d}if(!i.records.branches.has(r)){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},d}if(l===void 0||!l){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},d}if($===l){const d=new Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(a&&i.records.commits.has(a)){const d=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw d.hash={text:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${s} ${e==null?void 0:e.join(" ")}`]},d}const f=o||"",g={id:a||`${i.records.seq}-${j()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,f],branch:i.records.currBranch,type:p.MERGE,customType:s,customId:!!a,tags:e??[]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),m.debug(i.records.branches),m.debug("in mergeBranch")},"merge"),vr=h(function(t){let r=t.id,a=t.targetId,s=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,a,s);const n=z();if(r=B.sanitizeText(r,n),a=B.sanitizeText(a,n),s=s==null?void 0:s.map($=>B.sanitizeText($,n)),e=B.sanitizeText(e,n),!r||!i.records.commits.has(r)){const $=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw $.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},$}const c=i.records.commits.get(r);if(c===void 0||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(c.parents)&&c.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=c.branch;if(c.type===p.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!i.records.commits.has(a)){if(o===i.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const $=i.records.branches.get(i.records.currBranch);if($===void 0||!$){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const l=i.records.commits.get($);if(l===void 0||!l){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const f={id:i.records.seq+"-"+j(),message:`cherry-picked ${c==null?void 0:c.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,c.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${c.id}${c.type===p.MERGE?`|parent:${e}`:""}`]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),m.debug(i.records.branches),m.debug("in cherryPick")}},"cherryPick"),_=h(function(t){if(t=B.sanitizeText(t,z()),i.records.branches.has(t)){i.records.currBranch=t;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function D(t,r,a){const s=t.indexOf(r);s===-1?t.push(a):t.splice(s,1,a)}h(D,"upsert");function A(t){const r=t.reduce((e,n)=>e.seq>n.seq?e:n,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const s=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&s.push(e);if(m.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=i.records.commits.get(r.parents[0]);D(t,r,e),r.parents[1]&&t.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=i.records.commits.get(r.parents[0]);D(t,r,e)}}t=N(t,e=>e.id),A(t)}h(A,"prettyPrintCommitHistory");var Cr=h(function(){m.debug(i.records.commits);const t=V()[0];A([t])},"prettyPrint"),Er=h(function(){i.reset(),ir()},"clear"),Br=h(function(){return[...i.records.branchConfig.values()].map((r,a)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${a}`)}).sort((r,a)=>(r.order??0)-(a.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),kr=h(function(){return i.records.branches},"getBranches"),Lr=h(function(){return i.records.commits},"getCommits"),V=h(function(){const t=[...i.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,a)=>r.seq-a.seq),t},"getCommitsArray"),Tr=h(function(){return i.records.currBranch},"getCurrentBranch"),Mr=h(function(){return i.records.direction},"getDirection"),Rr=h(function(){return i.records.head},"getHead"),X={commitType:p,getConfig:z,setDirection:xr,setOptions:pr,getOptions:ur,commit:br,branch:mr,merge:wr,cherryPick:vr,checkout:_,prettyPrint:Cr,clear:Er,getBranchesAsObjArray:Br,getBranches:kr,getCommits:Lr,getCommitsArray:V,getCurrentBranch:Tr,getDirection:Mr,getHead:Rr,setAccTitle:nr,getAccTitle:ar,getAccDescription:tr,setAccDescription:er,setDiagramTitle:rr,getDiagramTitle:U},Ir=h((t,r)=>{Z(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)qr(a,r)},"populate"),qr=h((t,r)=>{const s={Commit:h(e=>r.commit(Or(e)),"Commit"),Branch:h(e=>r.branch(zr(e)),"Branch"),Merge:h(e=>r.merge(Gr(e)),"Merge"),Checkout:h(e=>r.checkout(Hr(e)),"Checkout"),CherryPicking:h(e=>r.cherryPick(Pr(e)),"CherryPicking")}[t.$type];s?s(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Or=h(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?p[t.type]:p.NORMAL,tags:t.tags??void 0}),"parseCommit"),zr=h(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=h(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?p[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Hr=h(t=>t.branch,"parseCheckout"),Pr=h(t=>{var a;return{id:t.id,targetId:"",tags:((a=t.tags)==null?void 0:a.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Wr={parse:h(async t=>{const r=await fr("gitGraph",t);m.debug(r),Ir(r,X)},"parse")},S=sr(),b=S==null?void 0:S.gitGraph,R=10,I=40,k=4,L=2,O=8,C=new Map,E=new Map,P=30,G=new Map,W=[],M=0,x="LR",jr=h(()=>{C.clear(),E.clear(),G.clear(),M=0,W=[],x="LR"},"clear"),J=h(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(s=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=s.trim(),r.appendChild(e)}),r},"drawText"),Q=h(t=>{let r,a,s;return x==="BT"?(a=h((e,n)=>e<=n,"comparisonFunc"),s=1/0):(a=h((e,n)=>e>=n,"comparisonFunc"),s=0),t.forEach(e=>{var c,o;const n=x==="TB"||x=="BT"?(c=E.get(e))==null?void 0:c.y:(o=E.get(e))==null?void 0:o.x;n!==void 0&&a(n,s)&&(r=e,s=n)}),r},"findClosestParent"),Sr=h(t=>{let r="",a=1/0;return t.forEach(s=>{const e=E.get(s).y;e<=a&&(r=s,a=e)}),r||void 0},"findClosestParentBT"),Dr=h((t,r,a)=>{let s=a,e=a;const n=[];t.forEach(c=>{const o=r.get(c);if(!o)throw new Error(`Commit not found for key ${c}`);o.parents.length?(s=Yr(o),e=Math.max(s,e)):n.push(o),Kr(o,s)}),s=e,n.forEach(c=>{Nr(c,s,a)}),t.forEach(c=>{const o=r.get(c);if(o!=null&&o.parents.length){const $=Sr(o.parents);s=E.get($).y-I,s<=e&&(e=s);const l=C.get(o.branch).pos,f=s-R;E.set(o.id,{x:l,y:f})}})},"setParallelBTPos"),Ar=h(t=>{var s;const r=Q(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(s=E.get(r))==null?void 0:s.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Yr=h(t=>Ar(t)+I,"calculateCommitPosition"),Kr=h((t,r)=>{const a=C.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const s=a.pos,e=r+R;return E.set(t.id,{x:s,y:e}),{x:s,y:e}},"setCommitPosition"),Nr=h((t,r,a)=>{const s=C.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,n=s.pos;E.set(t.id,{x:n,y:e})},"setRootPosition"),_r=h((t,r,a,s,e,n)=>{if(n===p.HIGHLIGHT)t.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%O} ${s}-outer`),t.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%O} ${s}-inner`);else if(n===p.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${s}`),t.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${s}`),t.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${s}`),t.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${s}`),t.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${s}`);else{const c=t.append("circle");if(c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",r.type===p.MERGE?9:10),c.attr("class",`commit ${r.id} commit${e%O}`),n===p.MERGE){const o=t.append("circle");o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",6),o.attr("class",`commit ${s} ${r.id} commit${e%O}`)}n===p.REVERSE&&t.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${s} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Vr=h((t,r,a,s)=>{var e;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&(b!=null&&b.showCommitLabel)){const n=t.append("g"),c=n.insert("rect").attr("class","commit-label-bkg"),o=n.append("text").attr("x",s).attr("y",a.y+25).attr("class","commit-label").text(r.id),$=(e=o.node())==null?void 0:e.getBBox();if($&&(c.attr("x",a.posWithOffset-$.width/2-L).attr("y",a.y+13.5).attr("width",$.width+2*L).attr("height",$.height+2*L),x==="TB"||x==="BT"?(c.attr("x",a.x-($.width+4*k+5)).attr("y",a.y-12),o.attr("x",a.x-($.width+4*k)).attr("y",a.y+$.height-12)):o.attr("x",a.posWithOffset-$.width/2),b.rotateCommitLabel))if(x==="TB"||x==="BT")o.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const l=-7.5-($.width+10)/25*9.5,f=10+$.width/25*8.5;n.attr("transform","translate("+l+", "+f+") rotate(-45, "+s+", "+a.y+")")}}},"drawCommitLabel"),Xr=h((t,r,a,s)=>{var e;if(r.tags.length>0){let n=0,c=0,o=0;const $=[];for(const l of r.tags.reverse()){const f=t.insert("polygon"),g=t.append("circle"),d=t.append("text").attr("y",a.y-16-n).attr("class","tag-label").text(l),y=(e=d.node())==null?void 0:e.getBBox();if(!y)throw new Error("Tag bbox not found");c=Math.max(c,y.width),o=Math.max(o,y.height),d.attr("x",a.posWithOffset-y.width/2),$.push({tag:d,hole:g,rect:f,yOffset:n}),n+=20}for(const{tag:l,hole:f,rect:g,yOffset:d}of $){const y=o/2,u=a.y-19.2-d;if(g.attr("class","tag-label-bkg").attr("points",`
1
+ import{p as Z}from"./chunk-4BX2VUAB-DKYgHx9z.js";import{I as F}from"./chunk-QZHKN3VN--fzHnGin.js";import{_ as h,q as U,p as rr,s as er,g as tr,a as ar,b as nr,l as m,c as sr,u as or,D as cr,y as ir,j as B,E as dr,F as hr,G as lr,H as $r}from"./mermaid.core-Brj2E_sv.js";import{p as fr}from"./treemap-KMMF4GRG-Bc2NrK0Z.js";import{s as gr}from"./index-Dyga3lv6.js";import"./min-OyaaRTus.js";import"./isUndefined-Jm66YXc7.js";import"./clone-BL1RNKEm.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},yr=lr.gitGraph,z=h(()=>dr({...yr,...hr().gitGraph}),"getConfig"),i=new F(()=>{const t=z(),r=t.mainBranchName,a=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:a}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function j(){return $r({length:7})}h(j,"getID");function N(t,r){const a=Object.create(null);return t.reduce((s,e)=>{const n=r(e);return a[n]||(a[n]=!0,s.push(e)),s},[])}h(N,"uniqBy");var xr=h(function(t){i.records.direction=t},"setDirection"),pr=h(function(t){m.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{i.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),ur=h(function(){return i.records.options},"getOptions"),br=h(function(t){let r=t.msg,a=t.id;const s=t.type;let e=t.tags;m.info("commit",r,a,s,e),m.debug("Entering commit:",r,a,s,e);const n=z();a=B.sanitizeText(a,n),r=B.sanitizeText(r,n),e=e==null?void 0:e.map(o=>B.sanitizeText(o,n));const c={id:a||i.records.seq+"-"+j(),message:r,seq:i.records.seq++,type:s??p.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=c,m.info("main branch",n.mainBranchName),i.records.commits.has(c.id)&&m.warn(`Commit ID ${c.id} already exists`),i.records.commits.set(c.id,c),i.records.branches.set(i.records.currBranch,c.id),m.debug("in pushCommit "+c.id)},"commit"),mr=h(function(t){let r=t.name;const a=t.order;if(r=B.sanitizeText(r,z()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:a}),_(r),m.debug("in createBranch")},"branch"),wr=h(t=>{let r=t.branch,a=t.id;const s=t.type,e=t.tags,n=z();r=B.sanitizeText(r,n),a&&(a=B.sanitizeText(a,n));const c=i.records.branches.get(i.records.currBranch),o=i.records.branches.get(r),$=c?i.records.commits.get(c):void 0,l=o?i.records.commits.get(o):void 0;if($&&l&&$.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const d=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if($===void 0||!$){const d=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},d}if(!i.records.branches.has(r)){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},d}if(l===void 0||!l){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},d}if($===l){const d=new Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(a&&i.records.commits.has(a)){const d=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw d.hash={text:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${s} ${e==null?void 0:e.join(" ")}`]},d}const f=o||"",g={id:a||`${i.records.seq}-${j()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,f],branch:i.records.currBranch,type:p.MERGE,customType:s,customId:!!a,tags:e??[]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),m.debug(i.records.branches),m.debug("in mergeBranch")},"merge"),vr=h(function(t){let r=t.id,a=t.targetId,s=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,a,s);const n=z();if(r=B.sanitizeText(r,n),a=B.sanitizeText(a,n),s=s==null?void 0:s.map($=>B.sanitizeText($,n)),e=B.sanitizeText(e,n),!r||!i.records.commits.has(r)){const $=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw $.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},$}const c=i.records.commits.get(r);if(c===void 0||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(c.parents)&&c.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=c.branch;if(c.type===p.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!i.records.commits.has(a)){if(o===i.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const $=i.records.branches.get(i.records.currBranch);if($===void 0||!$){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const l=i.records.commits.get($);if(l===void 0||!l){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const f={id:i.records.seq+"-"+j(),message:`cherry-picked ${c==null?void 0:c.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,c.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${c.id}${c.type===p.MERGE?`|parent:${e}`:""}`]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),m.debug(i.records.branches),m.debug("in cherryPick")}},"cherryPick"),_=h(function(t){if(t=B.sanitizeText(t,z()),i.records.branches.has(t)){i.records.currBranch=t;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function D(t,r,a){const s=t.indexOf(r);s===-1?t.push(a):t.splice(s,1,a)}h(D,"upsert");function A(t){const r=t.reduce((e,n)=>e.seq>n.seq?e:n,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const s=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&s.push(e);if(m.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=i.records.commits.get(r.parents[0]);D(t,r,e),r.parents[1]&&t.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=i.records.commits.get(r.parents[0]);D(t,r,e)}}t=N(t,e=>e.id),A(t)}h(A,"prettyPrintCommitHistory");var Cr=h(function(){m.debug(i.records.commits);const t=V()[0];A([t])},"prettyPrint"),Er=h(function(){i.reset(),ir()},"clear"),Br=h(function(){return[...i.records.branchConfig.values()].map((r,a)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${a}`)}).sort((r,a)=>(r.order??0)-(a.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),kr=h(function(){return i.records.branches},"getBranches"),Lr=h(function(){return i.records.commits},"getCommits"),V=h(function(){const t=[...i.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,a)=>r.seq-a.seq),t},"getCommitsArray"),Tr=h(function(){return i.records.currBranch},"getCurrentBranch"),Mr=h(function(){return i.records.direction},"getDirection"),Rr=h(function(){return i.records.head},"getHead"),X={commitType:p,getConfig:z,setDirection:xr,setOptions:pr,getOptions:ur,commit:br,branch:mr,merge:wr,cherryPick:vr,checkout:_,prettyPrint:Cr,clear:Er,getBranchesAsObjArray:Br,getBranches:kr,getCommits:Lr,getCommitsArray:V,getCurrentBranch:Tr,getDirection:Mr,getHead:Rr,setAccTitle:nr,getAccTitle:ar,getAccDescription:tr,setAccDescription:er,setDiagramTitle:rr,getDiagramTitle:U},Ir=h((t,r)=>{Z(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)qr(a,r)},"populate"),qr=h((t,r)=>{const s={Commit:h(e=>r.commit(Or(e)),"Commit"),Branch:h(e=>r.branch(zr(e)),"Branch"),Merge:h(e=>r.merge(Gr(e)),"Merge"),Checkout:h(e=>r.checkout(Hr(e)),"Checkout"),CherryPicking:h(e=>r.cherryPick(Pr(e)),"CherryPicking")}[t.$type];s?s(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Or=h(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?p[t.type]:p.NORMAL,tags:t.tags??void 0}),"parseCommit"),zr=h(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=h(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?p[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Hr=h(t=>t.branch,"parseCheckout"),Pr=h(t=>{var a;return{id:t.id,targetId:"",tags:((a=t.tags)==null?void 0:a.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Wr={parse:h(async t=>{const r=await fr("gitGraph",t);m.debug(r),Ir(r,X)},"parse")},S=sr(),b=S==null?void 0:S.gitGraph,R=10,I=40,k=4,L=2,O=8,C=new Map,E=new Map,P=30,G=new Map,W=[],M=0,x="LR",jr=h(()=>{C.clear(),E.clear(),G.clear(),M=0,W=[],x="LR"},"clear"),J=h(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(s=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=s.trim(),r.appendChild(e)}),r},"drawText"),Q=h(t=>{let r,a,s;return x==="BT"?(a=h((e,n)=>e<=n,"comparisonFunc"),s=1/0):(a=h((e,n)=>e>=n,"comparisonFunc"),s=0),t.forEach(e=>{var c,o;const n=x==="TB"||x=="BT"?(c=E.get(e))==null?void 0:c.y:(o=E.get(e))==null?void 0:o.x;n!==void 0&&a(n,s)&&(r=e,s=n)}),r},"findClosestParent"),Sr=h(t=>{let r="",a=1/0;return t.forEach(s=>{const e=E.get(s).y;e<=a&&(r=s,a=e)}),r||void 0},"findClosestParentBT"),Dr=h((t,r,a)=>{let s=a,e=a;const n=[];t.forEach(c=>{const o=r.get(c);if(!o)throw new Error(`Commit not found for key ${c}`);o.parents.length?(s=Yr(o),e=Math.max(s,e)):n.push(o),Kr(o,s)}),s=e,n.forEach(c=>{Nr(c,s,a)}),t.forEach(c=>{const o=r.get(c);if(o!=null&&o.parents.length){const $=Sr(o.parents);s=E.get($).y-I,s<=e&&(e=s);const l=C.get(o.branch).pos,f=s-R;E.set(o.id,{x:l,y:f})}})},"setParallelBTPos"),Ar=h(t=>{var s;const r=Q(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(s=E.get(r))==null?void 0:s.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Yr=h(t=>Ar(t)+I,"calculateCommitPosition"),Kr=h((t,r)=>{const a=C.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const s=a.pos,e=r+R;return E.set(t.id,{x:s,y:e}),{x:s,y:e}},"setCommitPosition"),Nr=h((t,r,a)=>{const s=C.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,n=s.pos;E.set(t.id,{x:n,y:e})},"setRootPosition"),_r=h((t,r,a,s,e,n)=>{if(n===p.HIGHLIGHT)t.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%O} ${s}-outer`),t.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%O} ${s}-inner`);else if(n===p.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${s}`),t.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${s}`),t.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${s}`),t.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${s}`),t.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${s}`);else{const c=t.append("circle");if(c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",r.type===p.MERGE?9:10),c.attr("class",`commit ${r.id} commit${e%O}`),n===p.MERGE){const o=t.append("circle");o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",6),o.attr("class",`commit ${s} ${r.id} commit${e%O}`)}n===p.REVERSE&&t.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${s} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Vr=h((t,r,a,s)=>{var e;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&(b!=null&&b.showCommitLabel)){const n=t.append("g"),c=n.insert("rect").attr("class","commit-label-bkg"),o=n.append("text").attr("x",s).attr("y",a.y+25).attr("class","commit-label").text(r.id),$=(e=o.node())==null?void 0:e.getBBox();if($&&(c.attr("x",a.posWithOffset-$.width/2-L).attr("y",a.y+13.5).attr("width",$.width+2*L).attr("height",$.height+2*L),x==="TB"||x==="BT"?(c.attr("x",a.x-($.width+4*k+5)).attr("y",a.y-12),o.attr("x",a.x-($.width+4*k)).attr("y",a.y+$.height-12)):o.attr("x",a.posWithOffset-$.width/2),b.rotateCommitLabel))if(x==="TB"||x==="BT")o.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const l=-7.5-($.width+10)/25*9.5,f=10+$.width/25*8.5;n.attr("transform","translate("+l+", "+f+") rotate(-45, "+s+", "+a.y+")")}}},"drawCommitLabel"),Xr=h((t,r,a,s)=>{var e;if(r.tags.length>0){let n=0,c=0,o=0;const $=[];for(const l of r.tags.reverse()){const f=t.insert("polygon"),g=t.append("circle"),d=t.append("text").attr("y",a.y-16-n).attr("class","tag-label").text(l),y=(e=d.node())==null?void 0:e.getBBox();if(!y)throw new Error("Tag bbox not found");c=Math.max(c,y.width),o=Math.max(o,y.height),d.attr("x",a.posWithOffset-y.width/2),$.push({tag:d,hole:g,rect:f,yOffset:n}),n+=20}for(const{tag:l,hole:f,rect:g,yOffset:d}of $){const y=o/2,u=a.y-19.2-d;if(g.attr("class","tag-label-bkg").attr("points",`
2
2
  ${s-c/2-k/2},${u+L}
3
3
  ${s-c/2-k/2},${u-L}
4
4
  ${a.posWithOffset-c/2-k},${u-y-L}
@@ -1 +1 @@
1
- import{c as f,i as b,k as _,f as d,u as L,r as j,a as E}from"./index-Cf3jkaWJ.js";import{f as g,i as l,v as p}from"./isUndefined-DhAvAp_K.js";var v="\0",a="\0",O="";class N{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=f(void 0),this._defaultEdgeLabelFn=f(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[a]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return b(e)||(e=f(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return _(this._nodes)}sources(){var e=this;return g(this.nodes(),function(t){return E(e._in[t])})}sinks(){var e=this;return g(this.nodes(),function(t){return E(e._out[t])})}setNodes(e,t){var s=arguments,i=this;return d(e,function(r){s.length>1?i.setNode(r,t):i.setNode(r)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],d(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),d(_(this._in[e]),t),delete this._in[e],delete this._preds[e],d(_(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(l(t))t=a;else{t+="";for(var s=t;!l(s);s=this.parent(s))if(s===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}}children(e){if(l(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return _(t)}else{if(e===a)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return _(t)}successors(e){var t=this._sucs[e];if(t)return _(t)}neighbors(e){var t=this.predecessors(e);if(t)return L(t,this.successors(e))}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var s=this;d(this._nodes,function(n,h){e(h)&&t.setNode(h,n)}),d(this._edgeObjs,function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,s.edge(n))});var i={};function r(n){var h=s.parent(n);return h===void 0||t.hasNode(h)?(i[n]=h,h):h in i?i[h]:r(h)}return this._isCompound&&d(t.nodes(),function(n){t.setParent(n,r(n))}),t}setDefaultEdgeLabel(e){return b(e)||(e=f(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return p(this._edgeObjs)}setPath(e,t){var s=this,i=arguments;return j(e,function(r,n){return i.length>1?s.setEdge(r,n,t):s.setEdge(r,n),n}),this}setEdge(){var e,t,s,i,r=!1,n=arguments[0];typeof n=="object"&&n!==null&&"v"in n?(e=n.v,t=n.w,s=n.name,arguments.length===2&&(i=arguments[1],r=!0)):(e=n,t=arguments[1],s=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),e=""+e,t=""+t,l(s)||(s=""+s);var h=c(this._isDirected,e,t,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,h))return r&&(this._edgeLabels[h]=i),this;if(!l(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[h]=r?i:this._defaultEdgeLabelFn(e,t,s);var u=P(this._isDirected,e,t,s);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[h]=u,C(this._preds[t],e),C(this._sucs[e],t),this._in[t][h]=u,this._out[e][h]=u,this._edgeCount++,this}edge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s);return this._edgeLabels[i]}hasEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s),r=this._edgeObjs[i];return r&&(e=r.v,t=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],y(this._preds[t],e),y(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,t){var s=this._in[e];if(s){var i=p(s);return t?g(i,function(r){return r.v===t}):i}}outEdges(e,t){var s=this._out[e];if(s){var i=p(s);return t?g(i,function(r){return r.w===t}):i}}nodeEdges(e,t){var s=this.inEdges(e,t);if(s)return s.concat(this.outEdges(e,t))}}N.prototype._nodeCount=0;N.prototype._edgeCount=0;function C(o,e){o[e]?o[e]++:o[e]=1}function y(o,e){--o[e]||delete o[e]}function c(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}return i+O+r+O+(l(s)?v:s)}function P(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}var h={v:i,w:r};return s&&(h.name=s),h}function m(o,e){return c(o,e.v,e.w,e.name)}export{N as G};
1
+ import{u as f,v as b,x as _,y as d,z as L,A as v,B as E}from"./index-Dyga3lv6.js";import{f as g,i as l,v as p}from"./isUndefined-Jm66YXc7.js";var j="\0",u="\0",O="";class N{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=f(void 0),this._defaultEdgeLabelFn=f(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[u]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return b(e)||(e=f(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return _(this._nodes)}sources(){var e=this;return g(this.nodes(),function(t){return E(e._in[t])})}sinks(){var e=this;return g(this.nodes(),function(t){return E(e._out[t])})}setNodes(e,t){var s=arguments,i=this;return d(e,function(r){s.length>1?i.setNode(r,t):i.setNode(r)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=u,this._children[e]={},this._children[u][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],d(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),d(_(this._in[e]),t),delete this._in[e],delete this._preds[e],d(_(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(l(t))t=u;else{t+="";for(var s=t;!l(s);s=this.parent(s))if(s===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==u)return t}}children(e){if(l(e)&&(e=u),this._isCompound){var t=this._children[e];if(t)return _(t)}else{if(e===u)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return _(t)}successors(e){var t=this._sucs[e];if(t)return _(t)}neighbors(e){var t=this.predecessors(e);if(t)return L(t,this.successors(e))}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var s=this;d(this._nodes,function(n,h){e(h)&&t.setNode(h,n)}),d(this._edgeObjs,function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,s.edge(n))});var i={};function r(n){var h=s.parent(n);return h===void 0||t.hasNode(h)?(i[n]=h,h):h in i?i[h]:r(h)}return this._isCompound&&d(t.nodes(),function(n){t.setParent(n,r(n))}),t}setDefaultEdgeLabel(e){return b(e)||(e=f(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return p(this._edgeObjs)}setPath(e,t){var s=this,i=arguments;return v(e,function(r,n){return i.length>1?s.setEdge(r,n,t):s.setEdge(r,n),n}),this}setEdge(){var e,t,s,i,r=!1,n=arguments[0];typeof n=="object"&&n!==null&&"v"in n?(e=n.v,t=n.w,s=n.name,arguments.length===2&&(i=arguments[1],r=!0)):(e=n,t=arguments[1],s=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),e=""+e,t=""+t,l(s)||(s=""+s);var h=c(this._isDirected,e,t,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,h))return r&&(this._edgeLabels[h]=i),this;if(!l(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[h]=r?i:this._defaultEdgeLabelFn(e,t,s);var a=P(this._isDirected,e,t,s);return e=a.v,t=a.w,Object.freeze(a),this._edgeObjs[h]=a,y(this._preds[t],e),y(this._sucs[e],t),this._in[t][h]=a,this._out[e][h]=a,this._edgeCount++,this}edge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s);return this._edgeLabels[i]}hasEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s),r=this._edgeObjs[i];return r&&(e=r.v,t=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],C(this._preds[t],e),C(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,t){var s=this._in[e];if(s){var i=p(s);return t?g(i,function(r){return r.v===t}):i}}outEdges(e,t){var s=this._out[e];if(s){var i=p(s);return t?g(i,function(r){return r.w===t}):i}}nodeEdges(e,t){var s=this.inEdges(e,t);if(s)return s.concat(this.outEdges(e,t))}}N.prototype._nodeCount=0;N.prototype._edgeCount=0;function y(o,e){o[e]?o[e]++:o[e]=1}function C(o,e){--o[e]||delete o[e]}function c(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}return i+O+r+O+(l(s)?j:s)}function P(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}var h={v:i,w:r};return s&&(h.name=s),h}function m(o,e){return c(o,e.v,e.w,e.name)}export{N as G};