1import{s as A,a as G,S as N}from"./chunk-IMKFNOWR-C60q1UDx.js";import{_ as u,c as t,j as M,l as S,d as W,R as P,k as z,O as U,z as C}from"./index-BlZn7qac.js";import{l as D}from"./layout-Bk-YmKVw.js";import{l as F,k as I}from"./step-8NeZA7B6.js";import"./chunk-XXDRQBXY-DnUdXRr9.js";import"./chunk-POPQ4Y6H-CltN_Lva.js";import"./chunk-F27PBJKO-kMrTmr2c.js";import"./index-BIHwndtW.js";import"./vendor-BlJ90GWG.js";import"./pdf-Ba4Lif-1.js";import"./charts-i6LaAsIH.js";import"./percentages-BXMCSKIN-Cq5B4VIS.js";import"./editor-BRCHtXTl.js";import"./tslib.es6-e8gerPB4.js";import"./extends-bgAsqIvs.js";import"./index-BG0I9Q8t.js";import"./SaveVersionModal-DA91XIgu.js";import"./schemas-Zv2IiRs2.js";import"./download-BF9SZSEK.js";import"./useDebounce-DdJ7lloX.js";import"./SearchInput-DSeNCzLI.js";import"./MentionText-De_tsI-V.js";import"./taskService-CfX4rWGN.js";import"./formDataHelpers-Crv8bcly.js";import"./validators-DRPEAPaw.js";import"./defaultAvatar-Dp2BcoS8.js";(function(){try{var e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};e.SENTRY_RELEASE={id:"0d78e8d78eda4804299eff0767f9df5613e65c75"};var a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="6e5ceadc-44f6-4741-8d31-4baadceeb70b",e._sentryDebugIdIdentifier="sentry-dbid-6e5ceadc-44f6-4741-8d31-4baadceeb70b")}catch(s){}})();var O=u(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),J=u(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),X=u((e,a)=>{const s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(a.id),c=s.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),s},"drawSimpleState"),Y=u((e,a)=>{const s=u(function(o,b,y){const E=o.append("tspan").attr("x",2*t().state.padding).text(b);y||E.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(a.descriptions[0]).node().getBBox(),l=n.height,h=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let i=!0,d=!0;a.descriptions.forEach(function(o){i||(s(h,o,d),d=!1),i=!1});const w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=h.node().getBBox(),g=Math.max(x.width,n.width);return w.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=u((e,a,s)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),h=l.width,i=l.x,d=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(a.id),x=d.node().getBBox().width+n;let g=Math.max(x,h);g===h&&(g=g+n);let o;const b=e.node().getBBox();a.doc,o=i-c,x>h&&(o=(h-g)/2+c),Math.abs(i-b.x)<c&&x>h&&(o=i-(x-h)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",s?"alt-composit":"composit").attr("width",g).attr("height",b.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),d.attr("x",o+c),x<=h&&d.attr("x",i+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",b.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),j=u(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),q=u((e,a)=>{let s=t().state.forkWidth,c=t().state.forkHeight;if(a.parentId){let n=s;s=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",s).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=u((e,a,s,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let h=e.replace(/\r\n/g,"<br/>");h=h.replace(/\n/g,"<br/>");const i=h.split(z.lineBreakRegex);let d=1.25*t().state.noteMargin;for(const w of i){const x=w.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),d===0){const o=g.node().getBBox();d+=o.height}
1n+=d,g.attr("x",a+t().state.noteMargin),g.attr("y",s+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=u((e,a)=>{a.attr("class","state-note");const s=a.append("rect").attr("x",0).attr("y",t().state.padding),c=a.append("g"),{textWidth:n,textHeight:l}=Z(e,0,0,c);return s.attr("height",l+2*t().state.noteMargin),s.attr("width",n+t().state.noteMargin*2),s},"drawNote"),L=u(function(e,a){const s=a.id,c={id:s,label:a.id,width:0,height:0},n=e.append("g").attr("id",s).attr("class","stateGroup");a.type==="start"&&O(n),a.type==="end"&&j(n),(a.type==="fork"||a.type==="join")&&q(n,a),a.type==="note"&&K(a.note.text,n),a.type==="divider"&&J(n),a.type==="default"&&a.descriptions.length===0&&X(n,a),a.type==="default"&&a.descriptions.length>0&&Y(n,a);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),_=0,Q=u(function(e,a,s){const c=u(function(d){switch(d){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");a.points=a.points.filter(d=>!Number.isNaN(d.y));const n=a.points,l=F().x(function(d){return d.x}).y(function(d){return d.y}).curve(I),h=e.append("path").attr("d",l(n)).attr("id","edge"+_).attr("class","transition");let i="";if(t().state.arrowMarkerAbsolute&&(i=U(!0)),h.attr("marker-end","url("+i+"#"+c(N.relationType.DEPENDENCY)+"End)"),s.title!==void 0){const d=e.append("g").attr("class","stateLabel"),{x:w,y:x}=C.calcLabelPosition(a.points),g=z.getRows(s.title);let o=0;const b=[];let y=0,E=0;for(let f=0;f<=g.length;f++){const p=d.append("text").attr("text-anchor","middle").text(g[f]).attr("x",w).attr("y",x+o),m=p.node().getBBox();y=Math.max(y,m.width),E=Math.min(E,m.x),S.info(m.x,w,x+o),o===0&&(o=p.node().getBBox().height,S.info("Title height",o,x)),b.push(p)}let k=o*g.length;if(g.length>1){const f=(g.length-1)*o*.5;b.forEach((p,m)=>p.attr("y",x+m*o-f)),k=o*g.length}const r=d.node().getBBox();d.insert("rect",":first-child").attr("class","box").attr("x",w-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}_++},"drawEdge"),B,H={},V=u(function(){},"setConf"),tt=u(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=u(function(e,a,s,c){B=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=M("#i"+a));const h=n==="sandbox"?M(l.nodes()[0].contentDocument.body):M("body"),i=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const d=h.select(`[id='${a}']`);tt(d);const w=c.db.getRootDoc(),x=d.append("g").attr("id",a+"-root");R(w,x,void 0,!1,h,i,c);const g=B.padding,o=d.node().getBBox(),b=o.width+g*2,y=o.height+g*2,E=b*1.75;W(d,y,E,B.useMaxWidth),d.attr("viewBox",`${o.x-B.padding} ${o.y-B.padding} `+b+" "+y)},"draw"),at=u(e=>e?e.length*B.fontSizeFactor:1,"getLabelWidth"),R=u((e,a,s,c,n,l,h)=>{const i=new P({compound:!0,multigraph:!0});let d,w=!0;for(d=0;d<e.length;d++)if(e[d].stmt==="relation"){w=!1;break}s?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:w?1:B.edgeLengthFactor,nodeSep:w?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:w?1:B.edgeLengthFactor,nodeSep:w?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}});const x=h.db.getStates(),g=h.db.getRelations(),o=Object.keys(x);for(const r of o){const f=x[r];s&&(f.parentId=s);let p;if(f.doc){let m=a.append("g").attr("id",f.id).attr("class","stateGroup");p=R(f.doc,m,f.id,!c,n,l,h);{m=$(m,f,c);let v=m.node().getBBox();p.width=v.width,p.height=v.height+B.padding/2,H[f.id]={y:B.compositTitleSize}}}else p=L(a,f,i);if(f.note){const m={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},v=L(a,m,i);f.note.position==="left of"?(i.setNode(p.id+"-note",v),i.setNode(p.id,p)):(i.setNode(p.id,p),i.setNode(p.id+"-note",v)),i.setParent(p.id,p.id+"-group"),i.setParent(p.id+"-note",p.id+"-group")}else i.setNode(p.id,p)}S.debug("Count=",i.nodeCount(),i);let b=0;g.forEach(function(r){b++,S.debug("Setting edge",r),i.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:B.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+b)}),D(i),S.debug("Graph after layout",i.nodes());const y=a.node();
1i.nodes().forEach(function(r){r!==void 0&&i.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(i.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(i.node(r).x-i.node(r).width/2)+","+(i.node(r).y+(H[r]?H[r].y:0)-i.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",i.node(r).x-i.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(p=>{const m=p.parentElement;let v=0,T=0;m&&(m.parentElement&&(v=m.parentElement.getBBox().width),T=parseInt(m.getAttribute("data-x-shift"),10),Number.isNaN(T)&&(T=0)),p.setAttribute("x1",0-T+8),p.setAttribute("x2",v-T-8)})):S.debug("No Node "+r+": "+JSON.stringify(i.node(r)))});let E=y.getBBox();i.edges().forEach(function(r){r!==void 0&&i.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(i.edge(r))),Q(a,i.edge(r),i.edge(r).relation))}),E=y.getBBox();const k={id:s||"root",label:s||"root",width:0,height:0};return k.width=E.width+2*B.padding,k.height=E.height+2*B.padding,S.debug("Doc rendered",k,i),k},"renderDoc"),it={setConf:V,draw:et},zt={parser:G,get db(){return new N(1)},renderer:it,styles:A,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{zt as diagram};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.