local-operator-ui 0.36.6 → 0.36.7
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.
- package/out/main/index.js +183 -7
- package/out/renderer/assets/{_basePickBy-B0B_HryP.js → _basePickBy-Cp4-k2Ra.js} +1 -1
- package/out/renderer/assets/{_baseUniq-BC6WfZEZ.js → _baseUniq-SW_cXbV_.js} +1 -1
- package/out/renderer/assets/{agent-details-page-CIKeI8ax.js → agent-details-page-N3zxLs5x.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-NKE7fJK1.js → agent-hub-page-BlZWarvE.js} +2 -2
- package/out/renderer/assets/{agents-page-BIRTx9kB.js → agents-page-C7c-PG8v.js} +3 -3
- package/out/renderer/assets/{arc-DyL52bz_.js → arc-CH4PDipB.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-OQsI3Nan.js → architectureDiagram-IEHRJDOE-YJo8Ggxb.js} +1 -1
- package/out/renderer/assets/{arrow-up-BpuHf_sB.js → arrow-up-BB9CxXVA.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-CS1fz58m.js → blockDiagram-JOT3LUYC-rOqQnp0E.js} +1 -1
- package/out/renderer/assets/{book-open-BiI_r4jM.js → book-open-DkVxCJ61.js} +1 -1
- package/out/renderer/assets/browser-page-Dr5j9bQE.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-ja8N1ehh.js → browser-webauthn-prompt-Dna4BiM9.js} +1 -1
- package/out/renderer/assets/{building-2-Dar5h3t0.js → building-2-CavXM_-r.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-C6RZIvJP.js → c4Diagram-VJAJSXHY-DEPLadlT.js} +1 -1
- package/out/renderer/assets/channel-BUsgjri2.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-Cpn-cLXo.js → chunk-4BMEZGHF-klJwtJH4.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-S8Vffyme.js → chunk-A2AXSNBT-DRT8OSGB.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-K1GcoFUy.js → chunk-AEK57VVT-kqK_zO-a.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-CyqTe7_6.js → chunk-D6G4REZN-CJZaq5OR.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-QWUc1JND.js → chunk-RZ5BOZE2-D4tpPnZf.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-v3MFY8Qn.js → chunk-XZIHB7SX-D4Kppo6Q.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-YCOFP_Sl.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-YCOFP_Sl.js +1 -0
- package/out/renderer/assets/clone-DVoefRFN.js +1 -0
- package/out/renderer/assets/{console-mirror-BfM9Le8Y.js → console-mirror-BOyWikJU.js} +1 -1
- package/out/renderer/assets/{consoleCapture-mqMk3W7y.js → consoleCapture-Ctr4ZgwO.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-BD8ZrQRq.js → conversation-input-sync-DdFRR8Sk.js} +276 -276
- package/out/renderer/assets/{dagre-OKDRZEBW-D1-V7-Tj.js → dagre-OKDRZEBW-ZzTMDgQF.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-D7jQdHV1.js → diagram-SSKATNLV-D-OEK7di.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-DB_YZ9C8.js → diagram-VNBRO52H-CM6lMapK.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-Blv-3W3v.js → erDiagram-Q7BY3M3F-2khnybxo.js} +1 -1
- package/out/renderer/assets/{error-boundary-Bpk2r3Ma.js → error-boundary-B2fmvLyi.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-BTShSZPF.js → flowDiagram-4HSFHLVR-PmXhc4g8.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-_SXfULy-.js → ganttDiagram-APWFNJXF-DXqSjI8D.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-9E7LTj7S.js → gitGraphDiagram-7IBYFJ6S-CE0xYGI6.js} +1 -1
- package/out/renderer/assets/{graph-BhaFec28.js → graph-ydqZFY1l.js} +1 -1
- package/out/renderer/assets/{hash-CrDnkZ9w.js → hash-Dc3JifaZ.js} +1 -1
- package/out/renderer/assets/{index-Shz25Z8Y.js → index-BHi1lUGF.js} +1 -1
- package/out/renderer/assets/{index-ClCIwVJj.js → index-BoPP-Dip.js} +1 -1
- package/out/renderer/assets/{index-BuM037wD.js → index-DY17TKlm.js} +179 -179
- package/out/renderer/assets/index-Doo51Mbi.js +57 -0
- package/out/renderer/assets/{index-BgwxrPpP.css → index-JreDTE2U.css} +1 -1
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-CCsEuNFb.js → infoDiagram-PH2N3AL5-DOZ3-Qro.js} +1 -1
- package/out/renderer/assets/{installer-CJRb2tgb.js → installer-DWToCmOf.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-LXUs-hfi.js → journeyDiagram-U35MCT3I-DWis6Sd2.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-GLYV-Ku1.js → kanban-definition-NDS4AKOZ-B9e7wrf9.js} +1 -1
- package/out/renderer/assets/{layout-erSNWSH-.js → layout-CAcs3Q5o.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-CtFhdgCi.js → legacy-agents-page-DrGkO870.js} +6 -6
- package/out/renderer/assets/{library-page-C6-aUarQ.js → library-page-J-oYtewu.js} +3 -3
- package/out/renderer/assets/{mermaid.core-BGROKqtx.js → mermaid.core-BKDqOsvz.js} +5 -5
- package/out/renderer/assets/mesh-page-CHZ2qVtJ.js +1 -0
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-C1KlK3C5.js → mindmap-definition-ALO5MXBD-B8ubJP7r.js} +1 -1
- package/out/renderer/assets/{mini-Dnf6EgXd.js → mini-CSnAsFlT.js} +1 -1
- package/out/renderer/assets/{notebook-pen-CTurnI5u.js → notebook-pen-eF7NwmC0.js} +1 -1
- package/out/renderer/assets/{org-access-DTXfQgW5.js → org-access-CJDIOfTA.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-CDaexKo1.js → org-surface-gate-BFLSYyz1.js} +1 -1
- package/out/renderer/assets/{page-header-Does21Km.js → page-header-BMDtYfV0.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-DaaMC8-4.js → pieDiagram-IB7DONF6-C4Lho4yQ.js} +1 -1
- package/out/renderer/assets/{projects-page-Bw0c4vc_.js → projects-page-CNUJUnDM.js} +7 -7
- package/out/renderer/assets/{publication-validation-MxGQJEQj.js → publication-validation-5oR6aluM.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-BVFqf3uw.js → quadrantDiagram-7GDLP6J5-DauXMmcp.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-BbBjm1y3.js → radar-MK3ICKWK-_FJ6NjKi.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-BeDvFHK7.js → radient-auth-buttons-B4LrTMwy.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-luASPwgm.js → requirementDiagram-KVF5MWMF-BBMnxRwM.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-DJ-Xk1mH.js → sankeyDiagram-QLVOVGJD-ZAgJNulV.js} +1 -1
- package/out/renderer/assets/{schedules-page-D7XfeTME.js → schedules-page-BDxSAX-g.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-C9vBEHGW.js → sequenceDiagram-X6HHIX6F-ixhBbax-.js} +1 -1
- package/out/renderer/assets/{settings-page-BubJ0gmV.js → settings-page-DpSl6AZf.js} +11 -11
- package/out/renderer/assets/{smartart-DCxfy3Tv.js → smartart-CsYIjueA.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-DCbA594R.js → stateDiagram-DGXRK772-Cyo1D1sd.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-BylkQbLa.js +1 -0
- package/out/renderer/assets/{tags-input-chips-BSg2kzIn.js → tags-input-chips-DeSDZmGf.js} +1 -1
- package/out/renderer/assets/{team-bridge-page-DshgiIxJ.js → team-bridge-page-BnsNoiEd.js} +1 -1
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-AlhVX480.js → timeline-definition-BDJGKUSR-dHKNC0_-.js} +1 -1
- package/out/renderer/assets/{ui-preferences-store-CAt3Nng3.js → ui-preferences-store-CFbBU1td.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-DmirSifx.js → use-download-agent-mutation-Du8Okjj5.js} +3 -3
- package/out/renderer/assets/{use-memberships-query-fzcoT-92.js → use-memberships-query-C0ico4nv.js} +1 -1
- package/out/renderer/assets/{use-session-snapshot-DQQ3D8W6.js → use-session-snapshot-hoogT7-L.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-djayCUFZ.js → xychartDiagram-VJFVF3MP-y9FbutsK.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +7 -7
- package/out/renderer/installer.html +4 -4
- package/out/renderer/mini.html +7 -7
- package/package.json +2 -2
- package/out/renderer/assets/browser-page-CvUjgYjV.js +0 -1
- package/out/renderer/assets/channel-Ca9itbEI.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BDSTmyjZ.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BDSTmyjZ.js +0 -1
- package/out/renderer/assets/clone-OIhREtCX.js +0 -1
- package/out/renderer/assets/index-ByYW6G08.js +0 -57
- package/out/renderer/assets/mesh-page-CzSDWDfu.js +0 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-P9yjg6o0.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as Y,a as E,b as F}from"./library-page-C6-aUarQ.js";import"./index-ByYW6G08.js";import"./index-BuM037wD.js";import"./conversation-input-sync-BD8ZrQRq.js";import"./ui-preferences-store-CAt3Nng3.js";import"./error-boundary-Bpk2r3Ma.js";import"./console-mirror-BfM9Le8Y.js";import"./page-header-Does21Km.js";import"./hash-CrDnkZ9w.js";import"./tags-input-chips-BSg2kzIn.js";import"./arrow-up-BpuHf_sB.js";const B=["#4472C4","#ED7D31","#A9D18E","#FF0000","#FFC000","#5B9BD5","#70AD47","#C00000","#7030A0","#00B0F0"];function W(n,t){const c=`accent${n%6+1}`;return t[c]?"#"+t[c]:B[n%B.length]}function j(n,t=.45){const c=parseInt(n.slice(1,3),16),s=parseInt(n.slice(3,5),16),a=parseInt(n.slice(5,7),16),p=Math.round(c+(255-c)*t),M=Math.round(s+(255-s)*t),o=Math.round(a+(255-a)*t);return`rgb(${p},${M},${o})`}function G(n){const t=[];for(const c of E(n,"t")){const s=c.textContent.trim();s&&t.push(s)}return t.join(" ")}function V(n){if(!n)return[];const t=Y(n,"ptLst");if(!t)return[];const c=[];for(const s of E(t,"pt")){const a=F(s,"type","node");if(a==="parTrans"||a==="sibTrans")continue;const p=G(s);(p||a==="node")&&c.push({id:F(s,"modelId",""),type:a,text:p})}return c.filter(s=>s.text)}function z(n){if(!n)return"list";const t=Y(n,"layoutDef")||n,s=(F(t,"uniqueId","")||F(t,"defStyle","")||"").toLowerCase();return s.includes("chevron")||s.includes("arrowprocess")||s.includes("process")?"process":s.includes("cycle")||s.includes("continuouscycle")?"cycle":s.includes("hierarchy")||s.includes("orgchart")||s.includes("org")?"hierarchy":s.includes("radial")||s.includes("diverging")?"radial":s.includes("pyramid")||s.includes("invertedpyramid")?"pyramid":s.includes("funnel")?"funnel":s.includes("venn")?"venn":s.includes("matrix")?"matrix":s.includes("list")||s.includes("bullet")?"list":s.includes("relationship")||s.includes("balance")?"relationship":"list"}function $(n,t,c,s,a,p,M,o="#fff",f="center"){if(!t)return;n.save(),n.fillStyle=o,n.textAlign=f,n.textBaseline="middle";const l=t.split(" "),g=M*1.3;let h=[],r="";for(const u of l){const y=r?r+" "+u:u;n.measureText(y).width>a-4&&r?(h.push(r),r=u):r=y}r&&h.push(r);const i=Math.max(1,Math.floor(p/g));h.length>i&&(h=h.slice(0,i));const e=s-(h.length-1)*g/2;for(let u=0;u<h.length;u++)n.fillText(h[u],c,e+u*g);n.restore()}function I(n,t,c,s=14){const a=Math.floor(t/(s*.55)),p=n.split(" "),M=Math.ceil(p.join(" ").length/Math.max(a,1)),o=c/(M*1.4);return Math.max(8,Math.min(s,o))}function L(n,t,c,s,a,p,M,o){n.save(),n.beginPath(),p=Math.min(p,s/2,a/2),n.moveTo(t+p,c),n.arcTo(t+s,c,t+s,c+a,p),n.arcTo(t+s,c+a,t,c+a,p),n.arcTo(t,c+a,t,c,p),n.arcTo(t,c,t+s,c,p),n.closePath(),M&&(n.fillStyle=M,n.fill()),n.restore()}function X(n,t,c,s,a,p,M=1.5){const o=Math.atan2(a-c,s-t),f=8;n.save(),n.strokeStyle=p,n.fillStyle=p,n.lineWidth=M,n.beginPath(),n.moveTo(t,c),n.lineTo(s,a),n.stroke(),n.beginPath(),n.moveTo(s,a),n.lineTo(s-f*Math.cos(o-.4),a-f*Math.sin(o-.4)),n.lineTo(s-f*Math.cos(o+.4),a-f*Math.sin(o+.4)),n.closePath(),n.fill(),n.restore()}function J(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=a/f,g=Math.min(l*.08,10*o),h=Math.min(l*.12,18*o),r=l-h-g,i=p*.7,e=s+(p-i)/2;for(let u=0;u<f;u++){const y=W(u,M),d=c+l*u+g/2,b=u===f-1;n.save(),n.beginPath();const P=d+r+(b?0:h);n.moveTo(d,e),n.lineTo(d+r,e),b||n.lineTo(P,e+i/2),n.lineTo(d+r,e+i),n.lineTo(d,e+i),u>0&&n.lineTo(d+h,e+i/2),n.closePath(),n.fillStyle=y,n.fill(),n.restore();const m=I(t[u].text,r-h,i)*o;n.font=`${m}px sans-serif`;const T=d+(r+(u>0?h:0))/2;$(n,t[u].text,T,e+i/2,r,i,m)}}function K(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=c+a/2,g=s+p/2,h=Math.min(a,p)*.33,r=Math.min(h*.32,40*o);n.save(),n.strokeStyle="#ccc",n.lineWidth=2*o,n.setLineDash([4*o,4*o]),n.beginPath(),n.arc(l,g,h,0,Math.PI*2),n.stroke(),n.setLineDash([]),n.restore();for(let i=0;i<f;i++){const e=i/f*Math.PI*2-Math.PI/2,u=l+h*Math.cos(e),y=g+h*Math.sin(e),d=W(i,M);if(n.save(),n.beginPath(),n.arc(u,y,r,0,Math.PI*2),n.fillStyle=d,n.fill(),n.restore(),f>1){const P=(i+1)/f*Math.PI*2-Math.PI/2,m=(e+P)/2,T=l+h*Math.cos(e+.15),v=g+h*Math.sin(e+.15),k=l+h*Math.cos(P-.15),S=g+h*Math.sin(P-.15);n.save(),n.strokeStyle=d+"99",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(T,v),n.quadraticCurveTo(l+h*1.1*Math.cos(m),g+h*1.1*Math.sin(m),k,S),n.stroke(),n.restore()}const b=I(t[i].text,r*1.7,r*1.2)*o;n.font=`${b}px sans-serif`,$(n,t[i].text,u,y,r*2,r*1.8,b)}}function O(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=Math.max(l.length,1),h=p/(l.length>0?2.8:1.2),r=h*.75,i=Math.min(a*.3,160*o),e=r,u=c+(a-i)/2,y=s+(h-e)/2,d=W(0,M);L(n,u,y,i,e,6*o,d);const b=I(f.text,i-10*o,e)*o;if(n.font=`bold ${b}px sans-serif`,$(n,f.text,u+i/2,y+e/2,i-10,e,b),!l.length)return;const P=(a-20*o)/g,m=s+h*1.5,T=y+e,v=m-4*o;n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(u+i/2,T),n.lineTo(u+i/2,(T+v)/2),n.lineTo(c+10*o,(T+v)/2),n.lineTo(c+a-10*o,(T+v)/2),n.stroke(),n.restore();for(let k=0;k<l.length;k++){const S=c+P*k+8*o,R=m,A=P-16*o,H=r,N=W(k+1,M);n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(S+A/2,(T+v)/2),n.lineTo(S+A/2,R),n.stroke(),n.restore(),L(n,S,R,A,H,5*o,N);const D=I(l[k].text,A-8*o,H)*o;n.font=`${D}px sans-serif`,$(n,l[k].text,S+A/2,R+H/2,A-8,H,D)}}function Q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=c+a/2,h=s+p/2,r=Math.min(a,p)*.18,i=Math.min(a,p)*.36,e=Math.min(i*.28,38*o),u=l.length||1,y=W(0,M);n.save(),n.beginPath(),n.arc(g,h,r,0,Math.PI*2),n.fillStyle=y,n.fill(),n.restore();const d=I(f.text,r*1.6,r*1.2)*o;n.font=`bold ${d}px sans-serif`,$(n,f.text,g,h,r*2,r*2,d);for(let b=0;b<u;b++){const P=b/u*Math.PI*2-Math.PI/2,m=g+i*Math.cos(P),T=h+i*Math.sin(P),v=W(b+1,M),k=g+r*Math.cos(P),S=h+r*Math.sin(P),R=m-e*Math.cos(P),A=T-e*Math.sin(P);X(n,k,S,R,A,v+"99",1.5*o),n.save(),n.beginPath(),n.arc(m,T,e,0,Math.PI*2),n.fillStyle=v,n.fill(),n.restore();const H=I(l[b].text,e*1.7,e*1.2)*o;n.font=`${H}px sans-serif`,$(n,l[b].text,m,T,e*2,e*1.8,H)}}function U(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=(f-g)/f,r=a*h,i=c+(a-r)/2,e=s+g*l,u=W(g,M);n.save(),n.beginPath(),n.moveTo(i,e+l),n.lineTo(i+r,e+l);const y=a*((f-g-1)/f);n.lineTo(c+(a+y)/2,e),n.lineTo(c+(a-y)/2,e),n.closePath(),n.fillStyle=u,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const d=I(t[g].text,r*.6,l*.7)*o;n.font=`${d}px sans-serif`,$(n,t[g].text,c+a/2,e+l/2,r*.6,l*.7,d)}}function Z(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=1-g/f*.55,r=1-(g+1)/f*.55,i=a*h,e=a*r,u=c+(a-i)/2,y=c+(a-e)/2,d=s+g*l,b=W(g,M);n.save(),n.beginPath(),n.moveTo(u,d),n.lineTo(u+i,d),n.lineTo(y+e,d+l),n.lineTo(y,d+l),n.closePath(),n.fillStyle=b,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const P=(i+e)/2,m=I(t[g].text,P*.8,l*.7)*o;n.font=`${m}px sans-serif`,$(n,t[g].text,c+a/2,d+l/2,P*.8,l*.7,m)}}function _(n,t,c,s,a,p,M,o){if(!t.length)return;const f=Math.min(t.length,4),l=c+a/2,g=s+p/2,h=Math.min(a,p)*(f<=2?.32:.28),r=h*.65,i=[];for(let e=0;e<f;e++)i.push(e/f*Math.PI*2-Math.PI/2);for(let e=0;e<f;e++){const u=f>1?l+r*Math.cos(i[e]):l,y=f>1?g+r*Math.sin(i[e]):g,d=W(e,M);n.save(),n.globalAlpha=.55,n.beginPath(),n.arc(u,y,h,0,Math.PI*2),n.fillStyle=d,n.fill(),n.globalAlpha=1,n.strokeStyle="#fff",n.lineWidth=1.5*o,n.stroke(),n.restore();const b=f>1?l+(r+h*.45)*Math.cos(i[e]):l,P=f>1?g+(r+h*.45)*Math.sin(i[e]):g,m=I(t[e].text,h*1.2,h*.7)*o;n.font=`${m}px sans-serif`,$(n,t[e].text,b,P,h*1.2,h*.7,m,"#333")}}function w(n,t,c,s,a,p,M,o){const f=[t[0]||{text:""},t[1]||{text:""},t[2]||{text:""},t[3]||{text:""}],l=a/2,g=p/2,h=8*o;for(let r=0;r<2;r++)for(let i=0;i<2;i++){const e=r*2+i,u=c+i*l+h,y=s+r*g+h,d=l-h*2,b=g-h*2,P=W(e,M);L(n,u,y,d,b,8*o,P);const m=I(f[e].text,d-10,b)*o;n.font=`${m}px sans-serif`,$(n,f[e].text,u+d/2,y+b/2,d-10,b,m)}}function q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f,g=Math.min(l*.2,14*o),h=g*3;for(let r=0;r<f;r++){const i=s+r*l,e=i+l/2,u=W(r,M);n.save(),n.beginPath(),n.arc(c+g,e,g,0,Math.PI*2),n.fillStyle=u,n.fill(),n.restore(),L(n,c+h,i+l*.1,a-h-4*o,l*.8,4*o,u+"22");const y=I(t[r].text,a-h-20*o,l*.7)*o;n.font=`${y}px sans-serif`,n.fillStyle="#333",n.textAlign="left",n.textBaseline="middle",n.fillText(t[r].text,c+h+8*o,e)}}function C(n,t,c,s,a,p,M,o){if(t.length<2){q(n,t,c,s,a,p,M,o);return}const f=t[Math.floor(t.length/2)],l=t.slice(0,Math.floor(t.length/2)),g=t.slice(Math.floor(t.length/2)+1),h=c+a/2,r=s+p/2,i=Math.min(a*.14,p*.25),e=W(Math.floor(t.length/2),M);n.save(),n.beginPath(),n.arc(h,r,i,0,Math.PI*2),n.fillStyle=e,n.fill(),n.restore();const u=I(f.text,i*1.6,i*1.2)*o;n.font=`bold ${u}px sans-serif`,$(n,f.text,h,r,i*2,i*1.8,u);const y=p/Math.max(l.length,g.length,1),d=a*.3,b=y*.7,P=(m,T)=>{const v=T==="left"?c:c+a-d,k=T==="left"?h-i:h+i;for(let S=0;S<m.length;S++){const R=s+y*S+(y-b)/2,A=W(S+(T==="right"?l.length+1:0),M);L(n,v,R,d,b,5*o,A);const H=I(m[S].text,d-8,b)*o;n.font=`${H}px sans-serif`,$(n,m[S].text,v+d/2,R+b/2,d-8,b,H);const N=T==="left"?v+d:v;X(n,N,R+b/2,k,r,A+"88",1.5*o)}};P(l,"left"),P(g,"right")}function x(n,t,c,s,a,p,M,o){const f=t.length;if(!f)return;const l=Math.ceil(Math.sqrt(f)),g=Math.ceil(f/l),h=a/l,r=p/g,i=Math.min(h,r)*.1;for(let e=0;e<f;e++){const u=e%l,y=Math.floor(e/l),d=c+u*h+i,b=s+y*r+i,P=h-i*2,m=r-i*2,T=W(e,M);L(n,d,b,P,m,8*o,T),j(T),n.save();const v=n.createLinearGradient(d,b,d,b+m*.5);v.addColorStop(0,"rgba(255,255,255,0.18)"),v.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=v,n.beginPath(),n.roundRect?.(d,b,P,m,8*o),n.fill(),n.restore();const k=I(t[e].text,P-12*o,m)*o;n.font=`${k}px sans-serif`,$(n,t[e].text,d+P/2,b+m/2,P-12*o,m,k)}}function un(n,t,c,s,a,p,M,o,f){const l=V(t),g=z(c),h=16*f;n.save(),n.fillStyle="#f7f9fc",n.strokeStyle="#e0e4ec",n.lineWidth=1,n.beginPath(),n.roundRect?.(s,a,p,M,6*f)||n.rect(s,a,p,M),n.fill(),n.stroke();const r=s+h,i=a+h,e=p-h*2,u=M-h*2;if(!l.length){n.fillStyle="#aaa",n.font=`${12*f}px sans-serif`,n.textAlign="center",n.textBaseline="middle",n.fillText("SmartArt Diagram",s+p/2,a+M/2),n.restore();return}switch(g){case"process":J(n,l,r,i,e,u,o,f);break;case"cycle":K(n,l,r,i,e,u,o,f);break;case"hierarchy":O(n,l,r,i,e,u,o,f);break;case"radial":Q(n,l,r,i,e,u,o,f);break;case"pyramid":U(n,l,r,i,e,u,o,f);break;case"funnel":Z(n,l,r,i,e,u,o,f);break;case"venn":_(n,l,r,i,e,u,o,f);break;case"matrix":w(n,l,r,i,e,u,o,f);break;case"list":q(n,l,r,i,e,u,o,f);break;case"relationship":C(n,l,r,i,e,u,o,f);break;default:x(n,l,r,i,e,u,o,f)}n.restore()}export{un as renderSmartArt};
|
|
1
|
+
import{g as Y,a as E,b as F}from"./library-page-J-oYtewu.js";import"./index-Doo51Mbi.js";import"./index-DY17TKlm.js";import"./conversation-input-sync-DdFRR8Sk.js";import"./ui-preferences-store-CFbBU1td.js";import"./error-boundary-B2fmvLyi.js";import"./console-mirror-BOyWikJU.js";import"./page-header-BMDtYfV0.js";import"./hash-Dc3JifaZ.js";import"./tags-input-chips-DeSDZmGf.js";import"./arrow-up-BB9CxXVA.js";const B=["#4472C4","#ED7D31","#A9D18E","#FF0000","#FFC000","#5B9BD5","#70AD47","#C00000","#7030A0","#00B0F0"];function W(n,t){const c=`accent${n%6+1}`;return t[c]?"#"+t[c]:B[n%B.length]}function j(n,t=.45){const c=parseInt(n.slice(1,3),16),s=parseInt(n.slice(3,5),16),a=parseInt(n.slice(5,7),16),p=Math.round(c+(255-c)*t),M=Math.round(s+(255-s)*t),o=Math.round(a+(255-a)*t);return`rgb(${p},${M},${o})`}function G(n){const t=[];for(const c of E(n,"t")){const s=c.textContent.trim();s&&t.push(s)}return t.join(" ")}function V(n){if(!n)return[];const t=Y(n,"ptLst");if(!t)return[];const c=[];for(const s of E(t,"pt")){const a=F(s,"type","node");if(a==="parTrans"||a==="sibTrans")continue;const p=G(s);(p||a==="node")&&c.push({id:F(s,"modelId",""),type:a,text:p})}return c.filter(s=>s.text)}function z(n){if(!n)return"list";const t=Y(n,"layoutDef")||n,s=(F(t,"uniqueId","")||F(t,"defStyle","")||"").toLowerCase();return s.includes("chevron")||s.includes("arrowprocess")||s.includes("process")?"process":s.includes("cycle")||s.includes("continuouscycle")?"cycle":s.includes("hierarchy")||s.includes("orgchart")||s.includes("org")?"hierarchy":s.includes("radial")||s.includes("diverging")?"radial":s.includes("pyramid")||s.includes("invertedpyramid")?"pyramid":s.includes("funnel")?"funnel":s.includes("venn")?"venn":s.includes("matrix")?"matrix":s.includes("list")||s.includes("bullet")?"list":s.includes("relationship")||s.includes("balance")?"relationship":"list"}function $(n,t,c,s,a,p,M,o="#fff",f="center"){if(!t)return;n.save(),n.fillStyle=o,n.textAlign=f,n.textBaseline="middle";const l=t.split(" "),g=M*1.3;let h=[],r="";for(const u of l){const y=r?r+" "+u:u;n.measureText(y).width>a-4&&r?(h.push(r),r=u):r=y}r&&h.push(r);const i=Math.max(1,Math.floor(p/g));h.length>i&&(h=h.slice(0,i));const e=s-(h.length-1)*g/2;for(let u=0;u<h.length;u++)n.fillText(h[u],c,e+u*g);n.restore()}function I(n,t,c,s=14){const a=Math.floor(t/(s*.55)),p=n.split(" "),M=Math.ceil(p.join(" ").length/Math.max(a,1)),o=c/(M*1.4);return Math.max(8,Math.min(s,o))}function L(n,t,c,s,a,p,M,o){n.save(),n.beginPath(),p=Math.min(p,s/2,a/2),n.moveTo(t+p,c),n.arcTo(t+s,c,t+s,c+a,p),n.arcTo(t+s,c+a,t,c+a,p),n.arcTo(t,c+a,t,c,p),n.arcTo(t,c,t+s,c,p),n.closePath(),M&&(n.fillStyle=M,n.fill()),n.restore()}function X(n,t,c,s,a,p,M=1.5){const o=Math.atan2(a-c,s-t),f=8;n.save(),n.strokeStyle=p,n.fillStyle=p,n.lineWidth=M,n.beginPath(),n.moveTo(t,c),n.lineTo(s,a),n.stroke(),n.beginPath(),n.moveTo(s,a),n.lineTo(s-f*Math.cos(o-.4),a-f*Math.sin(o-.4)),n.lineTo(s-f*Math.cos(o+.4),a-f*Math.sin(o+.4)),n.closePath(),n.fill(),n.restore()}function J(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=a/f,g=Math.min(l*.08,10*o),h=Math.min(l*.12,18*o),r=l-h-g,i=p*.7,e=s+(p-i)/2;for(let u=0;u<f;u++){const y=W(u,M),d=c+l*u+g/2,b=u===f-1;n.save(),n.beginPath();const P=d+r+(b?0:h);n.moveTo(d,e),n.lineTo(d+r,e),b||n.lineTo(P,e+i/2),n.lineTo(d+r,e+i),n.lineTo(d,e+i),u>0&&n.lineTo(d+h,e+i/2),n.closePath(),n.fillStyle=y,n.fill(),n.restore();const m=I(t[u].text,r-h,i)*o;n.font=`${m}px sans-serif`;const T=d+(r+(u>0?h:0))/2;$(n,t[u].text,T,e+i/2,r,i,m)}}function K(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=c+a/2,g=s+p/2,h=Math.min(a,p)*.33,r=Math.min(h*.32,40*o);n.save(),n.strokeStyle="#ccc",n.lineWidth=2*o,n.setLineDash([4*o,4*o]),n.beginPath(),n.arc(l,g,h,0,Math.PI*2),n.stroke(),n.setLineDash([]),n.restore();for(let i=0;i<f;i++){const e=i/f*Math.PI*2-Math.PI/2,u=l+h*Math.cos(e),y=g+h*Math.sin(e),d=W(i,M);if(n.save(),n.beginPath(),n.arc(u,y,r,0,Math.PI*2),n.fillStyle=d,n.fill(),n.restore(),f>1){const P=(i+1)/f*Math.PI*2-Math.PI/2,m=(e+P)/2,T=l+h*Math.cos(e+.15),v=g+h*Math.sin(e+.15),k=l+h*Math.cos(P-.15),S=g+h*Math.sin(P-.15);n.save(),n.strokeStyle=d+"99",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(T,v),n.quadraticCurveTo(l+h*1.1*Math.cos(m),g+h*1.1*Math.sin(m),k,S),n.stroke(),n.restore()}const b=I(t[i].text,r*1.7,r*1.2)*o;n.font=`${b}px sans-serif`,$(n,t[i].text,u,y,r*2,r*1.8,b)}}function O(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=Math.max(l.length,1),h=p/(l.length>0?2.8:1.2),r=h*.75,i=Math.min(a*.3,160*o),e=r,u=c+(a-i)/2,y=s+(h-e)/2,d=W(0,M);L(n,u,y,i,e,6*o,d);const b=I(f.text,i-10*o,e)*o;if(n.font=`bold ${b}px sans-serif`,$(n,f.text,u+i/2,y+e/2,i-10,e,b),!l.length)return;const P=(a-20*o)/g,m=s+h*1.5,T=y+e,v=m-4*o;n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(u+i/2,T),n.lineTo(u+i/2,(T+v)/2),n.lineTo(c+10*o,(T+v)/2),n.lineTo(c+a-10*o,(T+v)/2),n.stroke(),n.restore();for(let k=0;k<l.length;k++){const S=c+P*k+8*o,R=m,A=P-16*o,H=r,N=W(k+1,M);n.save(),n.strokeStyle="#999",n.lineWidth=1.5*o,n.beginPath(),n.moveTo(S+A/2,(T+v)/2),n.lineTo(S+A/2,R),n.stroke(),n.restore(),L(n,S,R,A,H,5*o,N);const D=I(l[k].text,A-8*o,H)*o;n.font=`${D}px sans-serif`,$(n,l[k].text,S+A/2,R+H/2,A-8,H,D)}}function Q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t[0],l=t.slice(1),g=c+a/2,h=s+p/2,r=Math.min(a,p)*.18,i=Math.min(a,p)*.36,e=Math.min(i*.28,38*o),u=l.length||1,y=W(0,M);n.save(),n.beginPath(),n.arc(g,h,r,0,Math.PI*2),n.fillStyle=y,n.fill(),n.restore();const d=I(f.text,r*1.6,r*1.2)*o;n.font=`bold ${d}px sans-serif`,$(n,f.text,g,h,r*2,r*2,d);for(let b=0;b<u;b++){const P=b/u*Math.PI*2-Math.PI/2,m=g+i*Math.cos(P),T=h+i*Math.sin(P),v=W(b+1,M),k=g+r*Math.cos(P),S=h+r*Math.sin(P),R=m-e*Math.cos(P),A=T-e*Math.sin(P);X(n,k,S,R,A,v+"99",1.5*o),n.save(),n.beginPath(),n.arc(m,T,e,0,Math.PI*2),n.fillStyle=v,n.fill(),n.restore();const H=I(l[b].text,e*1.7,e*1.2)*o;n.font=`${H}px sans-serif`,$(n,l[b].text,m,T,e*2,e*1.8,H)}}function U(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=(f-g)/f,r=a*h,i=c+(a-r)/2,e=s+g*l,u=W(g,M);n.save(),n.beginPath(),n.moveTo(i,e+l),n.lineTo(i+r,e+l);const y=a*((f-g-1)/f);n.lineTo(c+(a+y)/2,e),n.lineTo(c+(a-y)/2,e),n.closePath(),n.fillStyle=u,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const d=I(t[g].text,r*.6,l*.7)*o;n.font=`${d}px sans-serif`,$(n,t[g].text,c+a/2,e+l/2,r*.6,l*.7,d)}}function Z(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f;for(let g=0;g<f;g++){const h=1-g/f*.55,r=1-(g+1)/f*.55,i=a*h,e=a*r,u=c+(a-i)/2,y=c+(a-e)/2,d=s+g*l,b=W(g,M);n.save(),n.beginPath(),n.moveTo(u,d),n.lineTo(u+i,d),n.lineTo(y+e,d+l),n.lineTo(y,d+l),n.closePath(),n.fillStyle=b,n.strokeStyle="#fff",n.lineWidth=2*o,n.fill(),n.stroke(),n.restore();const P=(i+e)/2,m=I(t[g].text,P*.8,l*.7)*o;n.font=`${m}px sans-serif`,$(n,t[g].text,c+a/2,d+l/2,P*.8,l*.7,m)}}function _(n,t,c,s,a,p,M,o){if(!t.length)return;const f=Math.min(t.length,4),l=c+a/2,g=s+p/2,h=Math.min(a,p)*(f<=2?.32:.28),r=h*.65,i=[];for(let e=0;e<f;e++)i.push(e/f*Math.PI*2-Math.PI/2);for(let e=0;e<f;e++){const u=f>1?l+r*Math.cos(i[e]):l,y=f>1?g+r*Math.sin(i[e]):g,d=W(e,M);n.save(),n.globalAlpha=.55,n.beginPath(),n.arc(u,y,h,0,Math.PI*2),n.fillStyle=d,n.fill(),n.globalAlpha=1,n.strokeStyle="#fff",n.lineWidth=1.5*o,n.stroke(),n.restore();const b=f>1?l+(r+h*.45)*Math.cos(i[e]):l,P=f>1?g+(r+h*.45)*Math.sin(i[e]):g,m=I(t[e].text,h*1.2,h*.7)*o;n.font=`${m}px sans-serif`,$(n,t[e].text,b,P,h*1.2,h*.7,m,"#333")}}function w(n,t,c,s,a,p,M,o){const f=[t[0]||{text:""},t[1]||{text:""},t[2]||{text:""},t[3]||{text:""}],l=a/2,g=p/2,h=8*o;for(let r=0;r<2;r++)for(let i=0;i<2;i++){const e=r*2+i,u=c+i*l+h,y=s+r*g+h,d=l-h*2,b=g-h*2,P=W(e,M);L(n,u,y,d,b,8*o,P);const m=I(f[e].text,d-10,b)*o;n.font=`${m}px sans-serif`,$(n,f[e].text,u+d/2,y+b/2,d-10,b,m)}}function q(n,t,c,s,a,p,M,o){if(!t.length)return;const f=t.length,l=p/f,g=Math.min(l*.2,14*o),h=g*3;for(let r=0;r<f;r++){const i=s+r*l,e=i+l/2,u=W(r,M);n.save(),n.beginPath(),n.arc(c+g,e,g,0,Math.PI*2),n.fillStyle=u,n.fill(),n.restore(),L(n,c+h,i+l*.1,a-h-4*o,l*.8,4*o,u+"22");const y=I(t[r].text,a-h-20*o,l*.7)*o;n.font=`${y}px sans-serif`,n.fillStyle="#333",n.textAlign="left",n.textBaseline="middle",n.fillText(t[r].text,c+h+8*o,e)}}function C(n,t,c,s,a,p,M,o){if(t.length<2){q(n,t,c,s,a,p,M,o);return}const f=t[Math.floor(t.length/2)],l=t.slice(0,Math.floor(t.length/2)),g=t.slice(Math.floor(t.length/2)+1),h=c+a/2,r=s+p/2,i=Math.min(a*.14,p*.25),e=W(Math.floor(t.length/2),M);n.save(),n.beginPath(),n.arc(h,r,i,0,Math.PI*2),n.fillStyle=e,n.fill(),n.restore();const u=I(f.text,i*1.6,i*1.2)*o;n.font=`bold ${u}px sans-serif`,$(n,f.text,h,r,i*2,i*1.8,u);const y=p/Math.max(l.length,g.length,1),d=a*.3,b=y*.7,P=(m,T)=>{const v=T==="left"?c:c+a-d,k=T==="left"?h-i:h+i;for(let S=0;S<m.length;S++){const R=s+y*S+(y-b)/2,A=W(S+(T==="right"?l.length+1:0),M);L(n,v,R,d,b,5*o,A);const H=I(m[S].text,d-8,b)*o;n.font=`${H}px sans-serif`,$(n,m[S].text,v+d/2,R+b/2,d-8,b,H);const N=T==="left"?v+d:v;X(n,N,R+b/2,k,r,A+"88",1.5*o)}};P(l,"left"),P(g,"right")}function x(n,t,c,s,a,p,M,o){const f=t.length;if(!f)return;const l=Math.ceil(Math.sqrt(f)),g=Math.ceil(f/l),h=a/l,r=p/g,i=Math.min(h,r)*.1;for(let e=0;e<f;e++){const u=e%l,y=Math.floor(e/l),d=c+u*h+i,b=s+y*r+i,P=h-i*2,m=r-i*2,T=W(e,M);L(n,d,b,P,m,8*o,T),j(T),n.save();const v=n.createLinearGradient(d,b,d,b+m*.5);v.addColorStop(0,"rgba(255,255,255,0.18)"),v.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=v,n.beginPath(),n.roundRect?.(d,b,P,m,8*o),n.fill(),n.restore();const k=I(t[e].text,P-12*o,m)*o;n.font=`${k}px sans-serif`,$(n,t[e].text,d+P/2,b+m/2,P-12*o,m,k)}}function un(n,t,c,s,a,p,M,o,f){const l=V(t),g=z(c),h=16*f;n.save(),n.fillStyle="#f7f9fc",n.strokeStyle="#e0e4ec",n.lineWidth=1,n.beginPath(),n.roundRect?.(s,a,p,M,6*f)||n.rect(s,a,p,M),n.fill(),n.stroke();const r=s+h,i=a+h,e=p-h*2,u=M-h*2;if(!l.length){n.fillStyle="#aaa",n.font=`${12*f}px sans-serif`,n.textAlign="center",n.textBaseline="middle",n.fillText("SmartArt Diagram",s+p/2,a+M/2),n.restore();return}switch(g){case"process":J(n,l,r,i,e,u,o,f);break;case"cycle":K(n,l,r,i,e,u,o,f);break;case"hierarchy":O(n,l,r,i,e,u,o,f);break;case"radial":Q(n,l,r,i,e,u,o,f);break;case"pyramid":U(n,l,r,i,e,u,o,f);break;case"funnel":Z(n,l,r,i,e,u,o,f);break;case"venn":_(n,l,r,i,e,u,o,f);break;case"matrix":w(n,l,r,i,e,u,o,f);break;case"list":q(n,l,r,i,e,u,o,f);break;case"relationship":C(n,l,r,i,e,u,o,f);break;default:x(n,l,r,i,e,u,o,f)}n.restore()}export{un as renderSmartArt};
|
package/out/renderer/assets/{stateDiagram-DGXRK772-DCbA594R.js → stateDiagram-DGXRK772-Cyo1D1sd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as W,a as P,S as N}from"./chunk-AEK57VVT-K1GcoFUy.js";import{_ as u,c as t,d as z,l as S,e as C,k as T,u as U}from"./mermaid.core-BGROKqtx.js";import{G as F}from"./graph-BhaFec28.js";import{l as O}from"./layout-erSNWSH-.js";import{y as J,z as X}from"./conversation-input-sync-BD8ZrQRq.js";import"./chunk-RZ5BOZE2-QWUc1JND.js";import"./index-ByYW6G08.js";import"./_baseUniq-BC6WfZEZ.js";import"./_basePickBy-B0B_HryP.js";import"./ui-preferences-store-CAt3Nng3.js";import"./error-boundary-Bpk2r3Ma.js";var L={},D=u((e,i)=>{L[e]=i},"set"),Y=u(e=>L[e],"get"),G=u(()=>Object.keys(L),"keys"),I=u(()=>G().length,"size"),$={get:Y,set:D,keys:G,size:I},j=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"),q=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"),Z=u((e,i)=>{const d=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(i.id),o=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o.width+2*t().state.padding).attr("height",o.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),K=u((e,i)=>{const d=u(function(l,B,m){const k=l.append("tspan").attr("x",2*t().state.padding).text(B);m||k.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(i.descriptions[0]).node().getBBox(),g=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",g+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(l){a||(d(x,l,s),s=!1),a=!1});const y=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+g+t().state.dividerMargin/2).attr("y2",t().state.padding+g+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),c=Math.max(p.width,n.width);return y.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",p.height+g+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Q=u((e,i,d)=>{const o=t().state.padding,n=2*t().state.padding,g=e.node().getBBox(),x=g.width,a=g.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let c=Math.max(p,x);c===x&&(c=c+n);let l;const B=e.node().getBBox();i.doc,l=a-o,p>x&&(l=(x-c)/2+o),Math.abs(a-B.x)<o&&p>x&&(l=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",l+o),p<=x&&s.attr("x",a+(c-n)/2-p/2+o),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),V=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"),tt=u((e,i)=>{let d=t().state.forkWidth,o=t().state.forkHeight;if(i.parentId){let n=d;d=o,o=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",o).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),et=u((e,i,d,o)=>{let n=0;const g=o.append("text");g.style("text-anchor","start"),g.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(T.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const y of a){const p=y.trim();if(p.length>0){const c=g.append("tspan");if(c.text(p),s===0){const l=c.node().getBBox();s+=l.height}n+=s,c.attr("x",i+t().state.noteMargin),c.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:g.node().getBBox().width,textHeight:n}},"_drawLongText"),at=u((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),o=i.append("g"),{textWidth:n,textHeight:g}=et(e,0,0,o);return d.attr("height",g+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),_=u(function(e,i){const d=i.id,o={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&j(n),i.type==="end"&&V(n),(i.type==="fork"||i.type==="join")&&tt(n,i),i.type==="note"&&at(i.note.text,n),i.type==="divider"&&q(n),i.type==="default"&&i.descriptions.length===0&&Z(n,i),i.type==="default"&&i.descriptions.length>0&&K(n,i);const g=n.node().getBBox();return o.width=g.width+2*t().state.padding,o.height=g.height+2*t().state.padding,$.set(d,o),o},"drawState"),A=0,it=u(function(e,i,d){const o=u(function(s){switch(s){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");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,g=J().x(function(s){return s.x}).y(function(s){return s.y}).curve(X),x=e.append("path").attr("d",g(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),x.attr("marker-end","url("+a+"#"+o(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:y,y:p}=U.calcLabelPosition(i.points),c=T.getRows(d.title);let l=0;const B=[];let m=0,k=0;for(let f=0;f<=c.length;f++){const h=s.append("text").attr("text-anchor","middle").text(c[f]).attr("x",y).attr("y",p+l),w=h.node().getBBox();m=Math.max(m,w.width),k=Math.min(k,w.x),S.info(w.x,y,p+l),l===0&&(l=h.node().getBBox().height,S.info("Title height",l,p)),B.push(h)}let E=l*c.length;if(c.length>1){const f=(c.length-1)*l*.5;B.forEach((h,w)=>h.attr("y",p+w*l-f)),E=l*c.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",y-m/2-t().state.padding/2).attr("y",p-E/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",E+t().state.padding),S.info(r)}A++},"drawEdge"),b,H={},rt=u(function(){},"setConf"),nt=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"),st=u(function(e,i,d,o){b=t().state;const n=t().securityLevel;let g;n==="sandbox"&&(g=z("#i"+i));const x=n==="sandbox"?z(g.nodes()[0].contentDocument.body):z("body"),a=n==="sandbox"?g.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);nt(s);const y=o.db.getRootDoc();R(y,s,void 0,!1,x,a,o);const p=b.padding,c=s.node().getBBox(),l=c.width+p*2,B=c.height+p*2,m=l*1.75;C(s,B,m,b.useMaxWidth),s.attr("viewBox",`${c.x-b.padding} ${c.y-b.padding} `+l+" "+B)},"draw"),dt=u(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),R=u((e,i,d,o,n,g,x)=>{const a=new F({compound:!0,multigraph:!0});let s,y=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){y=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),c=x.db.getRelations(),l=Object.keys(p);for(const r of l){const f=p[r];d&&(f.parentId=d);let h;if(f.doc){let w=i.append("g").attr("id",f.id).attr("class","stateGroup");h=R(f.doc,w,f.id,!o,n,g,x);{w=Q(w,f,o);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,H[f.id]={y:b.compositTitleSize}}}else h=_(i,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},v=_(i,w,a);f.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;c.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:b.labelHeight*T.getRows(r.title).length,labelpos:"c"},"id"+B)}),O(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(H[r]?H[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),g.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let k=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),it(i,a.edge(r),a.edge(r).relation))}),k=m.getBBox();const E={id:d||"root",label:d||"root",width:0,height:0};return E.width=k.width+2*b.padding,E.height=k.height+2*b.padding,S.debug("Doc rendered",E,a),E},"renderDoc"),ot={setConf:rt,draw:st},Bt={parser:P,get db(){return new N(1)},renderer:ot,styles:W,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{Bt as diagram};
|
|
1
|
+
import{s as W,a as P,S as N}from"./chunk-AEK57VVT-kqK_zO-a.js";import{_ as u,c as t,d as z,l as S,e as C,k as T,u as U}from"./mermaid.core-BKDqOsvz.js";import{G as F}from"./graph-ydqZFY1l.js";import{l as O}from"./layout-CAcs3Q5o.js";import{y as J,z as X}from"./conversation-input-sync-DdFRR8Sk.js";import"./chunk-RZ5BOZE2-D4tpPnZf.js";import"./index-Doo51Mbi.js";import"./_baseUniq-SW_cXbV_.js";import"./_basePickBy-Cp4-k2Ra.js";import"./ui-preferences-store-CFbBU1td.js";import"./error-boundary-B2fmvLyi.js";var L={},D=u((e,i)=>{L[e]=i},"set"),Y=u(e=>L[e],"get"),G=u(()=>Object.keys(L),"keys"),I=u(()=>G().length,"size"),$={get:Y,set:D,keys:G,size:I},j=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"),q=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"),Z=u((e,i)=>{const d=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(i.id),o=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o.width+2*t().state.padding).attr("height",o.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),K=u((e,i)=>{const d=u(function(l,B,m){const k=l.append("tspan").attr("x",2*t().state.padding).text(B);m||k.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(i.descriptions[0]).node().getBBox(),g=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",g+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(l){a||(d(x,l,s),s=!1),a=!1});const y=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+g+t().state.dividerMargin/2).attr("y2",t().state.padding+g+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),c=Math.max(p.width,n.width);return y.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",p.height+g+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Q=u((e,i,d)=>{const o=t().state.padding,n=2*t().state.padding,g=e.node().getBBox(),x=g.width,a=g.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let c=Math.max(p,x);c===x&&(c=c+n);let l;const B=e.node().getBBox();i.doc,l=a-o,p>x&&(l=(x-c)/2+o),Math.abs(a-B.x)<o&&p>x&&(l=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",l+o),p<=x&&s.attr("x",a+(c-n)/2-p/2+o),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),V=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"),tt=u((e,i)=>{let d=t().state.forkWidth,o=t().state.forkHeight;if(i.parentId){let n=d;d=o,o=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",o).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),et=u((e,i,d,o)=>{let n=0;const g=o.append("text");g.style("text-anchor","start"),g.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(T.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const y of a){const p=y.trim();if(p.length>0){const c=g.append("tspan");if(c.text(p),s===0){const l=c.node().getBBox();s+=l.height}n+=s,c.attr("x",i+t().state.noteMargin),c.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:g.node().getBBox().width,textHeight:n}},"_drawLongText"),at=u((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),o=i.append("g"),{textWidth:n,textHeight:g}=et(e,0,0,o);return d.attr("height",g+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),_=u(function(e,i){const d=i.id,o={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&j(n),i.type==="end"&&V(n),(i.type==="fork"||i.type==="join")&&tt(n,i),i.type==="note"&&at(i.note.text,n),i.type==="divider"&&q(n),i.type==="default"&&i.descriptions.length===0&&Z(n,i),i.type==="default"&&i.descriptions.length>0&&K(n,i);const g=n.node().getBBox();return o.width=g.width+2*t().state.padding,o.height=g.height+2*t().state.padding,$.set(d,o),o},"drawState"),A=0,it=u(function(e,i,d){const o=u(function(s){switch(s){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");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,g=J().x(function(s){return s.x}).y(function(s){return s.y}).curve(X),x=e.append("path").attr("d",g(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),x.attr("marker-end","url("+a+"#"+o(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:y,y:p}=U.calcLabelPosition(i.points),c=T.getRows(d.title);let l=0;const B=[];let m=0,k=0;for(let f=0;f<=c.length;f++){const h=s.append("text").attr("text-anchor","middle").text(c[f]).attr("x",y).attr("y",p+l),w=h.node().getBBox();m=Math.max(m,w.width),k=Math.min(k,w.x),S.info(w.x,y,p+l),l===0&&(l=h.node().getBBox().height,S.info("Title height",l,p)),B.push(h)}let E=l*c.length;if(c.length>1){const f=(c.length-1)*l*.5;B.forEach((h,w)=>h.attr("y",p+w*l-f)),E=l*c.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",y-m/2-t().state.padding/2).attr("y",p-E/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",E+t().state.padding),S.info(r)}A++},"drawEdge"),b,H={},rt=u(function(){},"setConf"),nt=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"),st=u(function(e,i,d,o){b=t().state;const n=t().securityLevel;let g;n==="sandbox"&&(g=z("#i"+i));const x=n==="sandbox"?z(g.nodes()[0].contentDocument.body):z("body"),a=n==="sandbox"?g.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);nt(s);const y=o.db.getRootDoc();R(y,s,void 0,!1,x,a,o);const p=b.padding,c=s.node().getBBox(),l=c.width+p*2,B=c.height+p*2,m=l*1.75;C(s,B,m,b.useMaxWidth),s.attr("viewBox",`${c.x-b.padding} ${c.y-b.padding} `+l+" "+B)},"draw"),dt=u(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),R=u((e,i,d,o,n,g,x)=>{const a=new F({compound:!0,multigraph:!0});let s,y=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){y=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),c=x.db.getRelations(),l=Object.keys(p);for(const r of l){const f=p[r];d&&(f.parentId=d);let h;if(f.doc){let w=i.append("g").attr("id",f.id).attr("class","stateGroup");h=R(f.doc,w,f.id,!o,n,g,x);{w=Q(w,f,o);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,H[f.id]={y:b.compositTitleSize}}}else h=_(i,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},v=_(i,w,a);f.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;c.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:b.labelHeight*T.getRows(r.title).length,labelpos:"c"},"id"+B)}),O(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(H[r]?H[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),g.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let k=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),it(i,a.edge(r),a.edge(r).relation))}),k=m.getBBox();const E={id:d||"root",label:d||"root",width:0,height:0};return E.width=k.width+2*b.padding,E.height=k.height+2*b.padding,S.debug("Doc rendered",E,a),E},"renderDoc"),ot={setConf:rt,draw:st},Bt={parser:P,get db(){return new N(1)},renderer:ot,styles:W,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{Bt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r,b as e,a,S as s}from"./chunk-AEK57VVT-kqK_zO-a.js";import{_ as i}from"./mermaid.core-BKDqOsvz.js";import"./chunk-RZ5BOZE2-D4tpPnZf.js";import"./conversation-input-sync-DdFRR8Sk.js";import"./index-Doo51Mbi.js";import"./ui-preferences-store-CFbBU1td.js";import"./error-boundary-B2fmvLyi.js";var n={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as t,c as r}from"./index-
|
|
1
|
+
import{r as o,j as t,c as r}from"./index-Doo51Mbi.js";import{L as g,B as j,X as y,a as N}from"./error-boundary-B2fmvLyi.js";import{a as v}from"./index-DY17TKlm.js";const C=({value:s,label:l,onChange:a,placeholder:p="Add tag...",disabled:i=!1,icon:x})=>{const[n,c]=o.useState(""),d=o.useRef(null),u=o.useId(),f=e=>{c(e.target.value)},m=()=>{const e=n.trim().toLowerCase();e&&!s.includes(e)&&a([...s,e]),c("")},h=e=>{e.key==="Enter"&&n.trim()?(e.preventDefault(),m()):e.key==="Backspace"&&!n&&s.length>0&&a(s.slice(0,-1))},b=e=>{a(s.filter(k=>k!==e))};return t.jsxs("div",{children:[t.jsxs(g,{htmlFor:u,className:"mb-1.5 flex items-center gap-2 text-ink-muted",children:[x,l]}),t.jsxs("div",{className:r("flex min-h-11 flex-wrap items-center gap-2 rounded-sm border border-control bg-surface p-2","has-[input:focus-visible]:outline-solid has-[input:focus-visible]:outline-2","has-[input:focus-visible]:outline-accent has-[input:focus-visible]:outline-offset-2",i&&"border-hairline bg-sunken"),children:[s.map(e=>t.jsxs(j,{className:"gap-1 pr-1 text-ink",children:[e,t.jsx("button",{type:"button","aria-label":`Remove tag ${e}`,disabled:i,onClick:()=>b(e),className:r("rounded-xs text-ink-dim","transition-colors duration-fast ease-out-quart","hover:text-danger disabled:text-ink-disabled"),children:t.jsx(y,{})})]},e)),t.jsx("input",{id:u,ref:d,type:"text",value:n,onChange:f,onKeyDown:h,placeholder:p,disabled:i,"aria-label":l,className:r("min-w-20 flex-1 bg-transparent px-1 py-0.5 outline-none","text-body-sm text-ink placeholder:text-ink-dim","disabled:text-ink-disabled disabled:placeholder:text-ink-disabled")}),n.trim()&&t.jsx(N,{variant:"ghost",size:"icon-sm","aria-label":"Add tag",disabled:i,onClick:()=>{m(),d.current?.focus()},className:"text-accent hover:text-accent",children:t.jsx(v,{})})]}),s.length===0&&!n&&t.jsx("span",{className:"mt-1 ml-1 block text-ink-dim text-meta",children:"No tags added"})]})};export{C as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as e,t,c as k}from"./index-ByYW6G08.js";import{u as ne}from"./use-memberships-query-fzcoT-92.js";import{u as P,D as re,b as le,e as de,f as ce,a as B,I as U,X as oe,h as me,i as ue,j as xe,k as pe,l as R,m as he,n as W,B as L,o as F,p as ge,q as fe,r as Y,S as Z}from"./error-boundary-Bpk2r3Ma.js";import{_ as je,$ as be,a0 as V}from"./conversation-input-sync-BD8ZrQRq.js";import"./ui-preferences-store-CAt3Nng3.js";import{a as $,o as ve,T as D,t as Ne,c as ke,v as ae,b as ee,d as se,e as te,f as ie,u as ye,g as Be,h as we,i as _e,p as Ce,j as Me,k as De,l as Se,m as ze,n as Ee,A as Te}from"./index-BuM037wD.js";import{B as Ie}from"./building-2-Dar5h3t0.js";import{H as Re}from"./hash-CrDnkZ9w.js";import"./console-mirror-BfM9Le8Y.js";const Le=({open:a,onClose:d,onCreate:u,pending:s=!1,error:l})=>{P();const[c,g]=x.useState("dm"),[f,y]=x.useState(""),[h,r]=x.useState([{account_id:"",kind:"human",display_label:"",rowId:crypto.randomUUID()}]),j=(n,v)=>{r(b=>b.map((N,m)=>m===n?{...N,...v}:N))},w=h.some(n=>n.account_id.trim()&&n.display_label.trim())&&(c==="dm"||f.trim().length>0||c==="group");return e.jsx(re,{open:a,onOpenChange:n=>{n||d()},children:e.jsxs(le,{className:"gap-4",children:[e.jsx(de,{children:t("ui.teamBridge.create.title")}),e.jsx(ce,{className:"sr-only",children:t("ui.teamBridge.page.subtitle")}),e.jsxs("fieldset",{className:"flex gap-1",children:[e.jsx("legend",{className:"sr-only",children:t("ui.teamBridge.create.title")}),["dm","group","channel"].map(n=>e.jsx(B,{type:"button",size:"sm",variant:c===n?"primary":"ghost",onClick:()=>g(n),children:t(`ui.teamBridge.kind.${n}`)},n))]}),c!=="dm"&&e.jsxs("span",{className:"flex flex-col gap-1 text-[13px] text-ink-muted",children:[t("ui.teamBridge.create.name"),e.jsx(U,{value:f,onChange:n=>y(n.target.value),"aria-label":t("ui.teamBridge.create.name"),maxLength:128})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] text-ink-muted",children:t("ui.teamBridge.create.members")}),h.map((n,v)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{value:n.account_id,onChange:b=>j(v,{account_id:b.target.value}),placeholder:t("ui.teamBridge.create.account_placeholder"),"aria-label":t("ui.teamBridge.create.member_account"),className:"flex-1"}),e.jsx(U,{value:n.display_label,onChange:b=>j(v,{display_label:b.target.value}),placeholder:t("ui.teamBridge.create.member_name"),"aria-label":t("ui.teamBridge.create.member_name"),maxLength:64,className:"flex-1"}),e.jsxs("select",{value:n.kind,onChange:b=>j(v,{kind:b.target.value}),"aria-label":t("ui.teamBridge.create.member_kind"),className:"h-8 rounded-md border border-hairline bg-surface px-1 text-[13px]",children:[e.jsx("option",{value:"human",children:t("ui.teamBridge.create.member_person")}),e.jsx("option",{value:"agent",children:t("ui.teamBridge.create.member_agent")})]}),e.jsx(B,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("ui.teamBridge.create.remove_member"),onClick:()=>r(b=>b.filter((N,m)=>m!==v)),children:e.jsx(oe,{size:14})})]},n.rowId)),e.jsxs(B,{type:"button",size:"sm",variant:"ghost",onClick:()=>r(n=>[...n,{account_id:"",kind:"human",display_label:"",rowId:crypto.randomUUID()}]),children:[e.jsx($,{size:14}),t("ui.teamBridge.create.add_member")]})]}),l&&e.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:l}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(B,{type:"button",variant:"ghost",onClick:d,children:t("ui.teamBridge.create.cancel")}),e.jsx(B,{type:"button",variant:"primary",disabled:!w||s,onClick:()=>u({kind:c,...f.trim()?{name:f.trim()}:{},visibility:c==="channel"?"tenant":"private",agentCapable:h.some(n=>n.kind==="agent"),members:h.filter(n=>n.account_id.trim()&&n.display_label.trim())}),children:t("ui.teamBridge.create.confirm")})]})]})})},Pe=({organizations:a,scope:d,onScopeChange:u,totalUnread:s,membershipsLoading:l=!1,organizationsFailed:c=!1,defaultOpen:g=!1,onRetry:f})=>{P();const y=ve(a,d),h=d===D?t("ui.teamBridge.scope.all"):y?.name??t("ui.teamBridge.scope.unknown");return e.jsxs(me,{defaultOpen:g,children:[e.jsx(ue,{asChild:!0,children:e.jsxs("button",{type:"button","aria-label":t("ui.teamBridge.scope.trigger",{name:h}),title:h,className:k("group flex h-[30px] min-w-0 flex-1 items-center gap-2 rounded-md px-2","text-left text-[13px] text-ink transition-colors duration-fast","hover:bg-row-hover data-[state=open]:bg-row-hover"),children:[e.jsx(Ie,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-muted"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:h}),e.jsx(xe,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim"})]})}),e.jsxs(pe,{align:"start",className:"w-64",children:[e.jsx(R,{children:t("ui.teamBridge.scope.label")}),e.jsxs(he,{value:d,onValueChange:r=>u(Ne(r)),children:[e.jsxs(W,{value:D,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t("ui.teamBridge.scope.all")}),s>0&&e.jsx(L,{variant:"attentionQuiet",size:"count","aria-label":t("ui.teamBridge.unread.count",{count:s}),title:t("ui.teamBridge.unread.count",{count:s}),children:F(s,99)})]}),a.length>0&&e.jsx(ge,{}),a.map(r=>e.jsxs(W,{value:r.tenantId,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name}),e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim capitalize",children:r.role}),r.unread>0&&e.jsx(L,{variant:"attentionQuiet",size:"count","aria-label":t("ui.teamBridge.unread.count",{count:r.unread}),title:t("ui.teamBridge.unread.count",{count:r.unread}),children:F(r.unread,99)})]},r.tenantId))]}),l&&e.jsx(R,{children:t("ui.teamBridge.scope.loading")}),!l&&c&&e.jsxs(e.Fragment,{children:[e.jsx(R,{children:t("ui.teamBridge.scope.error")}),f&&e.jsx(fe,{onSelect:()=>f(),children:t("ui.teamBridge.list.retry")})]}),!l&&!c&&a.length===0&&e.jsx(R,{children:t("ui.teamBridge.scope.empty")})]})]})},Oe=({conversation:a,selected:d,selfAccountId:u,organizationName:s,showOrganization:l,onSelect:c})=>{const g=P(),f=Ee(a),y=f==="hash"?Re:f==="users"?be:Te,h=se(a,u)??t("ui.teamBridge.list.untitled"),r=a.unread_count,j=a.last_message_at?qe(a.last_message_at,g):"";return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:c,"aria-current":d?"page":void 0,"data-conversation-id":a.id,"data-conversation-tenant":a.tenant_id,className:k("flex w-full items-center gap-2 rounded-md px-2 text-left","transition-colors duration-fast ease-out-quart",l?"min-h-[38px] py-1":"h-[30px]",d?"bg-row-selected text-ink":"text-ink-muted hover:bg-row-hover hover:text-ink"),children:[e.jsx(y,{size:16,"aria-hidden":"true",className:"shrink-0"}),e.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px]",children:h}),j&&!l&&e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim",children:j}),r>0&&e.jsx("span",{className:"ml-1 inline-flex shrink-0",children:e.jsx(L,{variant:"attentionQuiet",shape:"pill",size:"count","aria-label":t("ui.teamBridge.unread.count",{count:r}),children:F(r,99)})})]}),l&&e.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"truncate rounded-sm border border-control bg-elevated px-1 text-meta-sm text-ink-dim",children:s??t("ui.teamBridge.scope.unknown")}),j&&e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim",children:j})]})]})]})})};function qe(a,d){const u=Date.parse(a);if(Number.isNaN(u))return"";const s=Math.round((u-Date.now())/6e4);if(Math.abs(s)<60)return V(s,"minute",{numeric:"auto"},d);const l=Math.round(s/60);return Math.abs(l)<24?V(l,"hour",{numeric:"auto"},d):V(Math.round(l/24),"day",{numeric:"auto"},d)}const Ue=({message:a,selfAccountId:d})=>{const u=a.sender.account_id===d,s=a.sender.kind==="agent",l=new Date(a.created_at);return e.jsxs("li",{className:k("flex gap-2 px-1",u&&"flex-row-reverse text-right"),children:[e.jsx("span",{className:k("mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full",s?"bg-accent-wash text-accent":"bg-sunken text-ink-muted"),"aria-hidden":"true",children:s?e.jsx(ie,{size:14}):a.sender.display_label[0]??"?"}),e.jsxs("div",{className:k("min-w-0 max-w-[min(72ch,80%)]",u&&"items-end"),children:[e.jsxs("div",{className:k("flex items-baseline gap-2 text-[12px] text-ink-dim",u&&"justify-end"),children:[e.jsx("span",{className:"truncate font-medium text-ink-muted",children:a.sender.display_label}),s&&e.jsx(L,{variant:"accent",shape:"pill",size:"count",children:t("ui.teamBridge.member.agent")}),e.jsx("time",{dateTime:a.created_at,children:Number.isNaN(l.getTime())?"":l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),e.jsx("p",{className:k("mt-0.5 whitespace-pre-wrap break-words rounded-md text-[13px] leading-relaxed",u?"bg-accent-wash px-2.5 py-1.5 text-ink":"text-ink"),children:a.body??e.jsx("span",{className:"text-ink-dim italic",children:t("ui.teamBridge.thread.withheld")})})]})]})},Ve=({listState:a,messageState:d,conversations:u,selected:s,messages:l,organizations:c,scope:g,totalUnread:f,membershipsLoading:y=!1,organizationsFailed:h=!1,selfAccountId:r,sending:j=!1,sendFailed:w=!1,initialDraft:n="",onSelect:v,onSend:b,onNewConversation:N,onRetry:m,onScopeChange:S,onRetryMemberships:z})=>{P();const[C,T]=x.useState(n),M=x.useRef(null),p=x.useMemo(()=>ke(l),[l]),o=g===D,_=x.useMemo(()=>ae(u,g,c),[u,g,c]),O=s?ee(s,c):null,q=o&&s!==null&&O===null,I="team-bridge-create-hint",A=o;x.useEffect(()=>{M.current?.scrollIntoView({block:"end"})},[s?.id,p.length]);const E=x.useRef(null),H=()=>{const i=C.trim();if(!i||j)return;const Q=E.current?.body===i?E.current.clientRef:crypto.randomUUID(),G={body:i,clientRef:Q};E.current=G;const K=b(i,Q),X=()=>{E.current===G&&(E.current=null),T(J=>J.trim()===i?"":J)};K instanceof Promise?K.then(X).catch(()=>{}):X()};return e.jsxs("div",{"data-glass-region":"canvas",className:"flex h-full min-h-0 w-full overflow-hidden",children:[e.jsxs("aside",{"data-glass-region":"page-sidebar",className:"flex w-72 shrink-0 flex-col",children:[e.jsx("h1",{className:"sr-only",children:t("ui.teamBridge.page.title")}),e.jsxs("header",{className:"flex h-11 shrink-0 items-center gap-2 px-3",children:[e.jsx(Pe,{organizations:c,scope:g,onScopeChange:S,totalUnread:f,membershipsLoading:y,organizationsFailed:h,onRetry:z}),e.jsx(B,{size:"icon-sm",variant:"ghost","aria-label":t("ui.teamBridge.page.new_conversation"),"aria-disabled":o||void 0,"aria-describedby":A?I:void 0,className:o?"text-ink-disabled hover:bg-transparent":void 0,onClick:()=>{o||N()},children:e.jsx($,{size:16})})]}),o&&(_.length>0||a!=="ready")&&e.jsx("p",{id:I,className:"px-3 pb-2 text-[12px] text-ink-dim",children:t("ui.teamBridge.scope.create_needs_org")}),e.jsxs(Y,{className:"min-h-0 flex-1",children:[a==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Z,{size:"sm",label:t("ui.teamBridge.list.loading")})}),a==="error"&&e.jsxs("div",{className:"flex flex-col items-start gap-2 px-3 py-6",children:[e.jsx("p",{className:"text-[13px] text-ink-muted",children:t("ui.teamBridge.list.error")}),m&&e.jsx(B,{size:"sm",variant:"outline",onClick:m,children:t("ui.teamBridge.list.retry")})]}),a==="ready"&&_.length>0&&e.jsx("ul",{className:"flex flex-col gap-0.5 px-1 pb-2",children:_.map(i=>e.jsx(Oe,{conversation:i,selected:s?.id===i.id,selfAccountId:r,showOrganization:o,organizationName:o?ee(i,c):void 0,onSelect:()=>v(i.id)},i.id))})]})]}),e.jsx("section",{className:"flex min-w-0 flex-1 flex-col bg-surface",children:s===null?a==="ready"?e.jsx("div",{className:"flex flex-1 items-center justify-center px-6",children:e.jsxs("div",{className:"max-w-sm text-center",children:[e.jsx("p",{className:"font-medium text-[13px] text-ink",children:t("ui.teamBridge.list.empty.title")}),e.jsx("p",{id:o&&a==="ready"&&_.length===0?I:void 0,className:"mt-1 text-[13px] text-ink-muted",children:o&&a==="ready"&&_.length===0?t("ui.teamBridge.scope.create_needs_org"):t("ui.teamBridge.list.empty.body")}),e.jsxs(B,{size:"sm",variant:"primary",className:o?"mt-3 opacity-60":"mt-3","aria-disabled":o||void 0,"aria-describedby":A?I:void 0,onClick:()=>{o||N()},children:[e.jsx($,{size:14}),t("ui.teamBridge.page.new_conversation")]})]})}):null:e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"flex h-11 shrink-0 items-center gap-2 px-3",children:[e.jsx("h2",{className:"min-w-0 truncate font-medium text-[13px] text-ink",children:se(s,r)??t("ui.teamBridge.list.untitled")}),o&&O&&e.jsx("span",{className:"shrink-0 rounded-sm bg-elevated px-1.5 py-0.5 text-meta-sm text-ink-dim",children:O}),e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim",children:t("ui.teamBridge.member.count",{count:te(s).filter(i=>i.state==="active").length})}),e.jsx("div",{className:"ml-auto flex items-center gap-1",children:te(s).slice(0,6).map(i=>e.jsx("span",{className:k("flex size-5 items-center justify-center rounded-full text-[10px]",i.kind==="agent"?"bg-accent-wash text-accent":"bg-sunken text-ink-muted"),title:i.state==="invited"?`${i.display_label} — ${t("ui.teamBridge.member.invited")}`:i.display_label,children:i.kind==="agent"?e.jsx(ie,{size:12,"aria-hidden":"true"}):i.display_label[0]??"?"},`${i.kind}:${i.account_id}`))})]}),e.jsx(Y,{className:"min-h-0 flex-1 [&_[data-radix-scroll-area-viewport]>div]:block [&_[data-radix-scroll-area-viewport]>div]:h-full",children:e.jsxs("div",{className:"flex h-full flex-col",children:[d==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx(Z,{size:"sm",label:t("ui.teamBridge.thread.loading")})}),d==="error"&&e.jsx("p",{className:"px-4 py-8 text-[13px] text-ink-muted",children:t("ui.teamBridge.thread.error")}),q&&e.jsx("p",{className:"px-4 py-8 text-[13px] text-ink-muted",children:t("ui.teamBridge.scope.thread_unknown")}),!q&&d==="ready"&&p.length===0&&e.jsx("p",{className:"px-4 py-10 text-center text-[13px] text-ink-muted",children:t("ui.teamBridge.thread.empty")}),!q&&d==="ready"&&p.length>0&&e.jsxs("ul",{className:"mt-auto flex flex-col gap-3 px-4 py-4",children:[p.map(i=>e.jsx(Ue,{message:i,selfAccountId:r},i.id)),e.jsx("div",{ref:M})]})]})}),e.jsxs("div",{className:"shrink-0 px-3 pb-3",children:[w&&e.jsx("p",{role:"alert",className:"px-2 pb-1 text-[12px] text-danger",children:t("ui.teamBridge.composer.error")}),e.jsxs("div",{className:k("rounded-xl bg-elevated","transition-colors duration-fast ease-out-quart","has-[textarea:focus-visible]:outline-solid has-[textarea:focus-visible]:outline-2","has-[textarea:focus-visible]:outline-accent has-[textarea:focus-visible]:outline-offset-2"),children:[e.jsx("textarea",{value:C,onChange:i=>T(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),H())},rows:1,placeholder:t("ui.teamBridge.composer.placeholder"),"aria-label":t("ui.teamBridge.composer.placeholder"),className:k("block max-h-40 min-h-9 w-full resize-none bg-transparent px-3 pt-2.5 pb-1","text-[13px] text-ink placeholder:text-ink-dim","outline-none")}),e.jsxs("div",{className:"flex items-center gap-2 px-2 pb-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate pl-1 text-meta-sm text-ink-dim",children:t("ui.teamBridge.composer.hint")}),e.jsx(B,{size:"icon-sm",variant:"primary",className:"rounded-full",disabled:!C.trim()||j,"aria-label":t("ui.teamBridge.composer.send"),onClick:H,children:e.jsx(je,{size:16})})]})]})]})]})})]})},We=()=>{const[a,d]=x.useState(D),u=x.useRef(!1),s=ne(),l=ye(!0,D),c=x.useMemo(()=>Be(s.memberships,l.data?.organizations),[s.memberships,l.data]),g=we(a),y=_e().data??void 0,[h,r]=x.useState(null),[j,w]=x.useState(!1),n=g.data?.conversations??[],v=a===D,b=p=>{u.current=!0,d(p),r(null),w(!1)};x.useEffect(()=>{d(p=>Ce(c,p,u.current))},[c]);const N=x.useMemo(()=>ae(n,a,c),[n,a,c]);x.useEffect(()=>{h===null&&N.length>0&&r(N[0].id)},[N,h]);const m=N.find(p=>p.id===h)??null,S=Me(m?.id??null,m?.tenant_id),z=De(m?.id??"",m?.tenant_id),C=Se(a===D?void 0:a),T=ze(m?.id??"",m?.tenant_id);x.useEffect(()=>{z.reset()},[m?.id]);const M=S.data?.messages.reduce((p,o)=>p===void 0||o.seq>p?o.seq:p,void 0);return x.useEffect(()=>{m===null||M===void 0||M<=m.last_read_seq||T.mutate({seq:M})},[m?.id,M]),e.jsxs(e.Fragment,{children:[e.jsx(Ve,{listState:g.isPending||v&&s.isLoading?"loading":g.isError||v&&s.isError?"error":"ready",messageState:m===null?"idle":S.isPending?"loading":S.isError?"error":"ready",conversations:n,selected:m,messages:S.data?.messages??[],organizations:c,scope:a,totalUnread:l.data?.total??0,membershipsLoading:s.isLoading,organizationsFailed:s.isError,selfAccountId:y,sending:z.isPending,sendFailed:z.isError,onSelect:r,onSend:(p,o)=>{if(m!==null)return z.mutateAsync({clientRef:o,body:p})},onNewConversation:()=>w(!0),onRetry:()=>{g.refetch(),s.isError&&s.refetch()},onScopeChange:b,onRetryMemberships:()=>{s.refetch()}}),e.jsx(Le,{open:j,pending:C.isPending,error:C.isError?t("ui.teamBridge.create.error"):void 0,onClose:()=>w(!1),onCreate:p=>{C.mutate(p,{onSuccess:o=>{w(!1);const _=o;_.id&&r(_.id)}})}})]})};export{We as TeamBridgePage,Ve as TeamBridgePageView};
|
|
1
|
+
import{r as x,j as e,t,c as k}from"./index-Doo51Mbi.js";import{u as ne}from"./use-memberships-query-C0ico4nv.js";import{u as P,D as re,b as le,e as de,f as ce,a as B,I as U,X as oe,h as me,i as ue,j as xe,k as pe,l as R,m as he,n as W,B as L,o as F,p as ge,q as fe,r as Y,S as Z}from"./error-boundary-B2fmvLyi.js";import{_ as je,$ as be,a0 as V}from"./conversation-input-sync-DdFRR8Sk.js";import"./ui-preferences-store-CFbBU1td.js";import{a as $,o as ve,T as D,t as Ne,c as ke,v as ae,b as ee,d as se,e as te,f as ie,u as ye,g as Be,h as we,i as _e,p as Ce,j as Me,k as De,l as Se,m as ze,n as Ee,A as Te}from"./index-DY17TKlm.js";import{B as Ie}from"./building-2-CavXM_-r.js";import{H as Re}from"./hash-Dc3JifaZ.js";import"./console-mirror-BOyWikJU.js";const Le=({open:a,onClose:d,onCreate:u,pending:s=!1,error:l})=>{P();const[c,g]=x.useState("dm"),[f,y]=x.useState(""),[h,r]=x.useState([{account_id:"",kind:"human",display_label:"",rowId:crypto.randomUUID()}]),j=(n,v)=>{r(b=>b.map((N,m)=>m===n?{...N,...v}:N))},w=h.some(n=>n.account_id.trim()&&n.display_label.trim())&&(c==="dm"||f.trim().length>0||c==="group");return e.jsx(re,{open:a,onOpenChange:n=>{n||d()},children:e.jsxs(le,{className:"gap-4",children:[e.jsx(de,{children:t("ui.teamBridge.create.title")}),e.jsx(ce,{className:"sr-only",children:t("ui.teamBridge.page.subtitle")}),e.jsxs("fieldset",{className:"flex gap-1",children:[e.jsx("legend",{className:"sr-only",children:t("ui.teamBridge.create.title")}),["dm","group","channel"].map(n=>e.jsx(B,{type:"button",size:"sm",variant:c===n?"primary":"ghost",onClick:()=>g(n),children:t(`ui.teamBridge.kind.${n}`)},n))]}),c!=="dm"&&e.jsxs("span",{className:"flex flex-col gap-1 text-[13px] text-ink-muted",children:[t("ui.teamBridge.create.name"),e.jsx(U,{value:f,onChange:n=>y(n.target.value),"aria-label":t("ui.teamBridge.create.name"),maxLength:128})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] text-ink-muted",children:t("ui.teamBridge.create.members")}),h.map((n,v)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{value:n.account_id,onChange:b=>j(v,{account_id:b.target.value}),placeholder:t("ui.teamBridge.create.account_placeholder"),"aria-label":t("ui.teamBridge.create.member_account"),className:"flex-1"}),e.jsx(U,{value:n.display_label,onChange:b=>j(v,{display_label:b.target.value}),placeholder:t("ui.teamBridge.create.member_name"),"aria-label":t("ui.teamBridge.create.member_name"),maxLength:64,className:"flex-1"}),e.jsxs("select",{value:n.kind,onChange:b=>j(v,{kind:b.target.value}),"aria-label":t("ui.teamBridge.create.member_kind"),className:"h-8 rounded-md border border-hairline bg-surface px-1 text-[13px]",children:[e.jsx("option",{value:"human",children:t("ui.teamBridge.create.member_person")}),e.jsx("option",{value:"agent",children:t("ui.teamBridge.create.member_agent")})]}),e.jsx(B,{type:"button",size:"icon-sm",variant:"ghost","aria-label":t("ui.teamBridge.create.remove_member"),onClick:()=>r(b=>b.filter((N,m)=>m!==v)),children:e.jsx(oe,{size:14})})]},n.rowId)),e.jsxs(B,{type:"button",size:"sm",variant:"ghost",onClick:()=>r(n=>[...n,{account_id:"",kind:"human",display_label:"",rowId:crypto.randomUUID()}]),children:[e.jsx($,{size:14}),t("ui.teamBridge.create.add_member")]})]}),l&&e.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:l}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(B,{type:"button",variant:"ghost",onClick:d,children:t("ui.teamBridge.create.cancel")}),e.jsx(B,{type:"button",variant:"primary",disabled:!w||s,onClick:()=>u({kind:c,...f.trim()?{name:f.trim()}:{},visibility:c==="channel"?"tenant":"private",agentCapable:h.some(n=>n.kind==="agent"),members:h.filter(n=>n.account_id.trim()&&n.display_label.trim())}),children:t("ui.teamBridge.create.confirm")})]})]})})},Pe=({organizations:a,scope:d,onScopeChange:u,totalUnread:s,membershipsLoading:l=!1,organizationsFailed:c=!1,defaultOpen:g=!1,onRetry:f})=>{P();const y=ve(a,d),h=d===D?t("ui.teamBridge.scope.all"):y?.name??t("ui.teamBridge.scope.unknown");return e.jsxs(me,{defaultOpen:g,children:[e.jsx(ue,{asChild:!0,children:e.jsxs("button",{type:"button","aria-label":t("ui.teamBridge.scope.trigger",{name:h}),title:h,className:k("group flex h-[30px] min-w-0 flex-1 items-center gap-2 rounded-md px-2","text-left text-[13px] text-ink transition-colors duration-fast","hover:bg-row-hover data-[state=open]:bg-row-hover"),children:[e.jsx(Ie,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-muted"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:h}),e.jsx(xe,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim"})]})}),e.jsxs(pe,{align:"start",className:"w-64",children:[e.jsx(R,{children:t("ui.teamBridge.scope.label")}),e.jsxs(he,{value:d,onValueChange:r=>u(Ne(r)),children:[e.jsxs(W,{value:D,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t("ui.teamBridge.scope.all")}),s>0&&e.jsx(L,{variant:"attentionQuiet",size:"count","aria-label":t("ui.teamBridge.unread.count",{count:s}),title:t("ui.teamBridge.unread.count",{count:s}),children:F(s,99)})]}),a.length>0&&e.jsx(ge,{}),a.map(r=>e.jsxs(W,{value:r.tenantId,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:r.name}),e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim capitalize",children:r.role}),r.unread>0&&e.jsx(L,{variant:"attentionQuiet",size:"count","aria-label":t("ui.teamBridge.unread.count",{count:r.unread}),title:t("ui.teamBridge.unread.count",{count:r.unread}),children:F(r.unread,99)})]},r.tenantId))]}),l&&e.jsx(R,{children:t("ui.teamBridge.scope.loading")}),!l&&c&&e.jsxs(e.Fragment,{children:[e.jsx(R,{children:t("ui.teamBridge.scope.error")}),f&&e.jsx(fe,{onSelect:()=>f(),children:t("ui.teamBridge.list.retry")})]}),!l&&!c&&a.length===0&&e.jsx(R,{children:t("ui.teamBridge.scope.empty")})]})]})},Oe=({conversation:a,selected:d,selfAccountId:u,organizationName:s,showOrganization:l,onSelect:c})=>{const g=P(),f=Ee(a),y=f==="hash"?Re:f==="users"?be:Te,h=se(a,u)??t("ui.teamBridge.list.untitled"),r=a.unread_count,j=a.last_message_at?qe(a.last_message_at,g):"";return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:c,"aria-current":d?"page":void 0,"data-conversation-id":a.id,"data-conversation-tenant":a.tenant_id,className:k("flex w-full items-center gap-2 rounded-md px-2 text-left","transition-colors duration-fast ease-out-quart",l?"min-h-[38px] py-1":"h-[30px]",d?"bg-row-selected text-ink":"text-ink-muted hover:bg-row-hover hover:text-ink"),children:[e.jsx(y,{size:16,"aria-hidden":"true",className:"shrink-0"}),e.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px]",children:h}),j&&!l&&e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim",children:j}),r>0&&e.jsx("span",{className:"ml-1 inline-flex shrink-0",children:e.jsx(L,{variant:"attentionQuiet",shape:"pill",size:"count","aria-label":t("ui.teamBridge.unread.count",{count:r}),children:F(r,99)})})]}),l&&e.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"truncate rounded-sm border border-control bg-elevated px-1 text-meta-sm text-ink-dim",children:s??t("ui.teamBridge.scope.unknown")}),j&&e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim",children:j})]})]})]})})};function qe(a,d){const u=Date.parse(a);if(Number.isNaN(u))return"";const s=Math.round((u-Date.now())/6e4);if(Math.abs(s)<60)return V(s,"minute",{numeric:"auto"},d);const l=Math.round(s/60);return Math.abs(l)<24?V(l,"hour",{numeric:"auto"},d):V(Math.round(l/24),"day",{numeric:"auto"},d)}const Ue=({message:a,selfAccountId:d})=>{const u=a.sender.account_id===d,s=a.sender.kind==="agent",l=new Date(a.created_at);return e.jsxs("li",{className:k("flex gap-2 px-1",u&&"flex-row-reverse text-right"),children:[e.jsx("span",{className:k("mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full",s?"bg-accent-wash text-accent":"bg-sunken text-ink-muted"),"aria-hidden":"true",children:s?e.jsx(ie,{size:14}):a.sender.display_label[0]??"?"}),e.jsxs("div",{className:k("min-w-0 max-w-[min(72ch,80%)]",u&&"items-end"),children:[e.jsxs("div",{className:k("flex items-baseline gap-2 text-[12px] text-ink-dim",u&&"justify-end"),children:[e.jsx("span",{className:"truncate font-medium text-ink-muted",children:a.sender.display_label}),s&&e.jsx(L,{variant:"accent",shape:"pill",size:"count",children:t("ui.teamBridge.member.agent")}),e.jsx("time",{dateTime:a.created_at,children:Number.isNaN(l.getTime())?"":l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]}),e.jsx("p",{className:k("mt-0.5 whitespace-pre-wrap break-words rounded-md text-[13px] leading-relaxed",u?"bg-accent-wash px-2.5 py-1.5 text-ink":"text-ink"),children:a.body??e.jsx("span",{className:"text-ink-dim italic",children:t("ui.teamBridge.thread.withheld")})})]})]})},Ve=({listState:a,messageState:d,conversations:u,selected:s,messages:l,organizations:c,scope:g,totalUnread:f,membershipsLoading:y=!1,organizationsFailed:h=!1,selfAccountId:r,sending:j=!1,sendFailed:w=!1,initialDraft:n="",onSelect:v,onSend:b,onNewConversation:N,onRetry:m,onScopeChange:S,onRetryMemberships:z})=>{P();const[C,T]=x.useState(n),M=x.useRef(null),p=x.useMemo(()=>ke(l),[l]),o=g===D,_=x.useMemo(()=>ae(u,g,c),[u,g,c]),O=s?ee(s,c):null,q=o&&s!==null&&O===null,I="team-bridge-create-hint",A=o;x.useEffect(()=>{M.current?.scrollIntoView({block:"end"})},[s?.id,p.length]);const E=x.useRef(null),H=()=>{const i=C.trim();if(!i||j)return;const Q=E.current?.body===i?E.current.clientRef:crypto.randomUUID(),G={body:i,clientRef:Q};E.current=G;const K=b(i,Q),X=()=>{E.current===G&&(E.current=null),T(J=>J.trim()===i?"":J)};K instanceof Promise?K.then(X).catch(()=>{}):X()};return e.jsxs("div",{"data-glass-region":"canvas",className:"flex h-full min-h-0 w-full overflow-hidden",children:[e.jsxs("aside",{"data-glass-region":"page-sidebar",className:"flex w-72 shrink-0 flex-col",children:[e.jsx("h1",{className:"sr-only",children:t("ui.teamBridge.page.title")}),e.jsxs("header",{className:"flex h-11 shrink-0 items-center gap-2 px-3",children:[e.jsx(Pe,{organizations:c,scope:g,onScopeChange:S,totalUnread:f,membershipsLoading:y,organizationsFailed:h,onRetry:z}),e.jsx(B,{size:"icon-sm",variant:"ghost","aria-label":t("ui.teamBridge.page.new_conversation"),"aria-disabled":o||void 0,"aria-describedby":A?I:void 0,className:o?"text-ink-disabled hover:bg-transparent":void 0,onClick:()=>{o||N()},children:e.jsx($,{size:16})})]}),o&&(_.length>0||a!=="ready")&&e.jsx("p",{id:I,className:"px-3 pb-2 text-[12px] text-ink-dim",children:t("ui.teamBridge.scope.create_needs_org")}),e.jsxs(Y,{className:"min-h-0 flex-1",children:[a==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Z,{size:"sm",label:t("ui.teamBridge.list.loading")})}),a==="error"&&e.jsxs("div",{className:"flex flex-col items-start gap-2 px-3 py-6",children:[e.jsx("p",{className:"text-[13px] text-ink-muted",children:t("ui.teamBridge.list.error")}),m&&e.jsx(B,{size:"sm",variant:"outline",onClick:m,children:t("ui.teamBridge.list.retry")})]}),a==="ready"&&_.length>0&&e.jsx("ul",{className:"flex flex-col gap-0.5 px-1 pb-2",children:_.map(i=>e.jsx(Oe,{conversation:i,selected:s?.id===i.id,selfAccountId:r,showOrganization:o,organizationName:o?ee(i,c):void 0,onSelect:()=>v(i.id)},i.id))})]})]}),e.jsx("section",{className:"flex min-w-0 flex-1 flex-col bg-surface",children:s===null?a==="ready"?e.jsx("div",{className:"flex flex-1 items-center justify-center px-6",children:e.jsxs("div",{className:"max-w-sm text-center",children:[e.jsx("p",{className:"font-medium text-[13px] text-ink",children:t("ui.teamBridge.list.empty.title")}),e.jsx("p",{id:o&&a==="ready"&&_.length===0?I:void 0,className:"mt-1 text-[13px] text-ink-muted",children:o&&a==="ready"&&_.length===0?t("ui.teamBridge.scope.create_needs_org"):t("ui.teamBridge.list.empty.body")}),e.jsxs(B,{size:"sm",variant:"primary",className:o?"mt-3 opacity-60":"mt-3","aria-disabled":o||void 0,"aria-describedby":A?I:void 0,onClick:()=>{o||N()},children:[e.jsx($,{size:14}),t("ui.teamBridge.page.new_conversation")]})]})}):null:e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"flex h-11 shrink-0 items-center gap-2 px-3",children:[e.jsx("h2",{className:"min-w-0 truncate font-medium text-[13px] text-ink",children:se(s,r)??t("ui.teamBridge.list.untitled")}),o&&O&&e.jsx("span",{className:"shrink-0 rounded-sm bg-elevated px-1.5 py-0.5 text-meta-sm text-ink-dim",children:O}),e.jsx("span",{className:"shrink-0 text-meta-sm text-ink-dim",children:t("ui.teamBridge.member.count",{count:te(s).filter(i=>i.state==="active").length})}),e.jsx("div",{className:"ml-auto flex items-center gap-1",children:te(s).slice(0,6).map(i=>e.jsx("span",{className:k("flex size-5 items-center justify-center rounded-full text-[10px]",i.kind==="agent"?"bg-accent-wash text-accent":"bg-sunken text-ink-muted"),title:i.state==="invited"?`${i.display_label} — ${t("ui.teamBridge.member.invited")}`:i.display_label,children:i.kind==="agent"?e.jsx(ie,{size:12,"aria-hidden":"true"}):i.display_label[0]??"?"},`${i.kind}:${i.account_id}`))})]}),e.jsx(Y,{className:"min-h-0 flex-1 [&_[data-radix-scroll-area-viewport]>div]:block [&_[data-radix-scroll-area-viewport]>div]:h-full",children:e.jsxs("div",{className:"flex h-full flex-col",children:[d==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-10",children:e.jsx(Z,{size:"sm",label:t("ui.teamBridge.thread.loading")})}),d==="error"&&e.jsx("p",{className:"px-4 py-8 text-[13px] text-ink-muted",children:t("ui.teamBridge.thread.error")}),q&&e.jsx("p",{className:"px-4 py-8 text-[13px] text-ink-muted",children:t("ui.teamBridge.scope.thread_unknown")}),!q&&d==="ready"&&p.length===0&&e.jsx("p",{className:"px-4 py-10 text-center text-[13px] text-ink-muted",children:t("ui.teamBridge.thread.empty")}),!q&&d==="ready"&&p.length>0&&e.jsxs("ul",{className:"mt-auto flex flex-col gap-3 px-4 py-4",children:[p.map(i=>e.jsx(Ue,{message:i,selfAccountId:r},i.id)),e.jsx("div",{ref:M})]})]})}),e.jsxs("div",{className:"shrink-0 px-3 pb-3",children:[w&&e.jsx("p",{role:"alert",className:"px-2 pb-1 text-[12px] text-danger",children:t("ui.teamBridge.composer.error")}),e.jsxs("div",{className:k("rounded-xl bg-elevated","transition-colors duration-fast ease-out-quart","has-[textarea:focus-visible]:outline-solid has-[textarea:focus-visible]:outline-2","has-[textarea:focus-visible]:outline-accent has-[textarea:focus-visible]:outline-offset-2"),children:[e.jsx("textarea",{value:C,onChange:i=>T(i.target.value),onKeyDown:i=>{i.key==="Enter"&&!i.shiftKey&&!i.nativeEvent.isComposing&&(i.preventDefault(),H())},rows:1,placeholder:t("ui.teamBridge.composer.placeholder"),"aria-label":t("ui.teamBridge.composer.placeholder"),className:k("block max-h-40 min-h-9 w-full resize-none bg-transparent px-3 pt-2.5 pb-1","text-[13px] text-ink placeholder:text-ink-dim","outline-none")}),e.jsxs("div",{className:"flex items-center gap-2 px-2 pb-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate pl-1 text-meta-sm text-ink-dim",children:t("ui.teamBridge.composer.hint")}),e.jsx(B,{size:"icon-sm",variant:"primary",className:"rounded-full",disabled:!C.trim()||j,"aria-label":t("ui.teamBridge.composer.send"),onClick:H,children:e.jsx(je,{size:16})})]})]})]})]})})]})},We=()=>{const[a,d]=x.useState(D),u=x.useRef(!1),s=ne(),l=ye(!0,D),c=x.useMemo(()=>Be(s.memberships,l.data?.organizations),[s.memberships,l.data]),g=we(a),y=_e().data??void 0,[h,r]=x.useState(null),[j,w]=x.useState(!1),n=g.data?.conversations??[],v=a===D,b=p=>{u.current=!0,d(p),r(null),w(!1)};x.useEffect(()=>{d(p=>Ce(c,p,u.current))},[c]);const N=x.useMemo(()=>ae(n,a,c),[n,a,c]);x.useEffect(()=>{h===null&&N.length>0&&r(N[0].id)},[N,h]);const m=N.find(p=>p.id===h)??null,S=Me(m?.id??null,m?.tenant_id),z=De(m?.id??"",m?.tenant_id),C=Se(a===D?void 0:a),T=ze(m?.id??"",m?.tenant_id);x.useEffect(()=>{z.reset()},[m?.id]);const M=S.data?.messages.reduce((p,o)=>p===void 0||o.seq>p?o.seq:p,void 0);return x.useEffect(()=>{m===null||M===void 0||M<=m.last_read_seq||T.mutate({seq:M})},[m?.id,M]),e.jsxs(e.Fragment,{children:[e.jsx(Ve,{listState:g.isPending||v&&s.isLoading?"loading":g.isError||v&&s.isError?"error":"ready",messageState:m===null?"idle":S.isPending?"loading":S.isError?"error":"ready",conversations:n,selected:m,messages:S.data?.messages??[],organizations:c,scope:a,totalUnread:l.data?.total??0,membershipsLoading:s.isLoading,organizationsFailed:s.isError,selfAccountId:y,sending:z.isPending,sendFailed:z.isError,onSelect:r,onSend:(p,o)=>{if(m!==null)return z.mutateAsync({clientRef:o,body:p})},onNewConversation:()=>w(!0),onRetry:()=>{g.refetch(),s.isError&&s.refetch()},onScopeChange:b,onRetryMemberships:()=>{s.refetch()}}),e.jsx(Le,{open:j,pending:C.isPending,error:C.isError?t("ui.teamBridge.create.error"):void 0,onClose:()=>w(!1),onCreate:p=>{C.mutate(p,{onSuccess:o=>{w(!1);const _=o;_.id&&r(_.id)}})}})]})};export{We as TeamBridgePage,Ve as TeamBridgePageView};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as s,c as xt,l as E,d as j,V as kt,W as vt,X as _t,Y as bt,D as wt,$ as St,z as Et}from"./mermaid.core-
|
|
1
|
+
import{_ as s,c as xt,l as E,d as j,V as kt,W as vt,X as _t,Y as bt,D as wt,$ as St,z as Et}from"./mermaid.core-BKDqOsvz.js";import{d as nt}from"./arc-CH4PDipB.js";import"./conversation-input-sync-DdFRR8Sk.js";import"./index-Doo51Mbi.js";import"./ui-preferences-store-CFbBU1td.js";import"./error-boundary-B2fmvLyi.js";var Q=function(){var n=s(function(x,i,a,c){for(a=a||{},c=x.length;c--;a[x[c]]=i);return a},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],l=[1,10],r=[1,11],d=[1,12],h=[1,13],f=[1,16],m=[1,17],u={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:s(function(i,a,c,p,y,o,w){var v=o.length-1;switch(y){case 1:return o[v-1];case 2:this.$=[];break;case 3:o[v-1].push(o[v]),this.$=o[v-1];break;case 4:case 5:this.$=o[v];break;case 6:case 7:this.$=[];break;case 8:p.getCommonDb().setDiagramTitle(o[v].substr(6)),this.$=o[v].substr(6);break;case 9:this.$=o[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 12:p.addSection(o[v].substr(8)),this.$=o[v].substr(8);break;case 15:p.addTask(o[v],0,""),this.$=o[v];break;case 16:p.addEvent(o[v].substr(2)),this.$=o[v];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:l,14:r,16:d,17:h,18:14,19:15,20:f,21:m},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:l,14:r,16:d,17:h,18:14,19:15,20:f,21:m},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:s(function(i,a){if(a.recoverable)this.trace(i);else{var c=new Error(i);throw c.hash=a,c}},"parseError"),parse:s(function(i){var a=this,c=[0],p=[],y=[null],o=[],w=this.table,v="",N=0,A=0,V=2,U=1,M=o.slice.call(arguments,1),g=Object.create(this.lexer),b={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(b.yy[L]=this.yy[L]);g.setInput(i,b.yy),b.yy.lexer=g,b.yy.parser=this,typeof g.yylloc>"u"&&(g.yylloc={});var P=g.yylloc;o.push(P);var W=g.options&&g.options.ranges;typeof b.yy.parseError=="function"?this.parseError=b.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Z(T){c.length=c.length-2*T,y.length=y.length-T,o.length=o.length-T}s(Z,"popStack");function tt(){var T;return T=p.pop()||g.lex()||U,typeof T!="number"&&(T instanceof Array&&(p=T,T=p.pop()),T=a.symbols_[T]||T),T}s(tt,"lex");for(var S,C,I,J,R={},B,$,et,O;;){if(C=c[c.length-1],this.defaultActions[C]?I=this.defaultActions[C]:((S===null||typeof S>"u")&&(S=tt()),I=w[C]&&w[C][S]),typeof I>"u"||!I.length||!I[0]){var K="";O=[];for(B in w[C])this.terminals_[B]&&B>V&&O.push("'"+this.terminals_[B]+"'");g.showPosition?K="Parse error on line "+(N+1)+`:
|
|
2
2
|
`+g.showPosition()+`
|
|
3
3
|
Expecting `+O.join(", ")+", got '"+(this.terminals_[S]||S)+"'":K="Parse error on line "+(N+1)+": Unexpected "+(S==U?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(K,{text:g.match,token:this.terminals_[S]||S,line:g.yylineno,loc:P,expected:O})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+S);switch(I[0]){case 1:c.push(S),y.push(g.yytext),o.push(g.yylloc),c.push(I[1]),S=null,A=g.yyleng,v=g.yytext,N=g.yylineno,P=g.yylloc;break;case 2:if($=this.productions_[I[1]][1],R.$=y[y.length-$],R._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},W&&(R._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),J=this.performAction.apply(R,[v,A,N,b.yy,I[1],y,o].concat(M)),typeof J<"u")return J;$&&(c=c.slice(0,-1*$*2),y=y.slice(0,-1*$),o=o.slice(0,-1*$)),c.push(this.productions_[I[1]][0]),y.push(R.$),o.push(R._$),et=w[c[c.length-2]][c[c.length-1]],c.push(et);break;case 3:return!0}}return!0},"parse")},k=function(){var x={EOF:1,parseError:s(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:s(function(i,a){return this.yy=a||this.yy||{},this._input=i,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:s(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var a=i.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:s(function(i){var a=i.length,c=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var p=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),c.length-1&&(this.yylineno-=c.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:c?(c.length===p.length?this.yylloc.first_column:0)+p[p.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(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
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(i){this.unput(this.match.slice(i))},"less"),pastInput:s(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var i=this.pastInput(),a=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|