@memoarchitect/architect 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +19 -0
  2. package/dist/assets/{AiWorkspace-DHZ6a9HJ.js → AiWorkspace-DS79vBOT.js} +1 -1
  3. package/dist/assets/AnalysisWorkspace-D_u4shRY.js +39 -0
  4. package/dist/assets/{ComplianceWizard-DWolzleI.js → ComplianceWizard-k98NZ2ec.js} +1 -1
  5. package/dist/assets/{DSMView-TdC3EADB.js → DSMView-DGheBwZ0.js} +1 -1
  6. package/dist/assets/{Dashboard-DBfAOCJv.js → Dashboard-BRUQvUFK.js} +1 -1
  7. package/dist/assets/{DhfDashboard-D9JxRAbD.js → DhfDashboard-B9V_n7kg.js} +1 -1
  8. package/dist/assets/{DhfSettingsPanel-Firov0IF.js → DhfSettingsPanel-B8aLsWn6.js} +1 -1
  9. package/dist/assets/{DhfWorkbench-BQv2WQ9o.js → DhfWorkbench-TOnZkdUU.js} +3 -3
  10. package/dist/assets/DiagramCanvas-B9d4aLKt.js +1 -0
  11. package/dist/assets/{DiagramEditor-Cp9ORYoN.js → DiagramEditor-CJ7OG2IC.js} +2 -2
  12. package/dist/assets/ElementDetailView-CDcm1rvf.js +2 -0
  13. package/dist/assets/{ImportView-33dFwj6A.js → ImportView-CyMm-tSP.js} +1 -1
  14. package/dist/assets/{LayerGrid-B3MBWswK.js → LayerGrid-DNPZYTsD.js} +1 -1
  15. package/dist/assets/{LayerTable-DyIzIt5M.js → LayerTable-DhOq1DHo.js} +1 -1
  16. package/dist/assets/{MaxGraphCanvas-BS5wYazZ.js → MaxGraphCanvas-DqKU1PTY.js} +6 -6
  17. package/dist/assets/{ModelDiff-BoFREnpg.js → ModelDiff-BbqIoesG.js} +1 -1
  18. package/dist/assets/OntologyDecompositionDiagram-DkxTe2C_.js +1 -0
  19. package/dist/assets/{OntologyViewer-CQTEg-GI.js → OntologyViewer-BIpJC66j.js} +2 -2
  20. package/dist/assets/{ReviewDashboard-BJ_smBGS.js → ReviewDashboard-DKoExM8K.js} +1 -1
  21. package/dist/assets/ScenarioEditor-JQ3huCnz.js +3 -0
  22. package/dist/assets/{StatisticsDashboard-CBYJGUPH.js → StatisticsDashboard-B8BduIDz.js} +1 -1
  23. package/dist/assets/{TabularView-BLzDtgmK.js → TabularView-BXfFSluC.js} +1 -1
  24. package/dist/assets/{TraceabilityMatrix-DbL_FkAC.js → TraceabilityMatrix-CHZHFucA.js} +1 -1
  25. package/dist/assets/{WorkflowWizard-CbkDyd1W.js → WorkflowWizard-7--f9OH2.js} +1 -1
  26. package/dist/assets/index-CVW92JY7.js +3280 -0
  27. package/dist/assets/index-Y1UZTZg-.css +1 -0
  28. package/dist/assets/layout-selection-ClQ295Xc.js +1 -0
  29. package/dist/index.html +2 -2
  30. package/lib/feature-grants.d.ts.map +1 -1
  31. package/lib/feature-grants.js +2 -2
  32. package/lib/feature-grants.js.map +1 -1
  33. package/package.json +4 -4
  34. package/dist/assets/DiagramCanvas-BfwO8YE5.js +0 -1
  35. package/dist/assets/ElementDetailView-DOrG8v7V.js +0 -2
  36. package/dist/assets/OntologyDecompositionDiagram-IG1gj1c3.js +0 -1
  37. package/dist/assets/ScenarioEditor-D06nbX4h.js +0 -3
  38. package/dist/assets/index-B8HDzVLs.css +0 -1
  39. package/dist/assets/index-D0vtjNjX.js +0 -3280
  40. package/dist/assets/layout-selection-DIQaaOIC.js +0 -1
@@ -1 +0,0 @@
1
- var Es=Object.defineProperty;var Cs=(t,i,n)=>i in t?Es(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n;var Vt=(t,i,n)=>Cs(t,typeof i!="symbol"?i+"":i,n);import{u as En,j as e,H as C,P as j,N as kt,a as oo,B as Cn,E as Jt,R as Is,b as Ds,c as Ns,d as As,e as Rs,i as Ts,C as Bs,f as Ms,g as Ls,M as zs}from"./reactflow-CsCqNKB-.js";import{b as $s,a as d,W as rn}from"./zustand-CrhqMOHB.js";/* empty css */import{F as N,S as ie,w as Ws,u as L,f as In,x as Os,g as Ps,D as an,y as Ve,z as _s,i as ln,A as Hs,R as dn,V as cn,C as pn}from"./index-D0vtjNjX.js";import{c as Ks,a as Vs,b as Ys,d as Us,e as Xs,f as Gs,g as qs,h as Zs,i as Qs,j as Js,k as ei,I as no,l as ti,P as wt,s as oi,u as ni,m as si,G as Yt,n as ii,o as ri,C as eo,p as ai,r as li,q as Ut,v as di,t as un,w as ci,x as pi,y as ui,B as xi,z as hi,R as gi,A as fi}from"./layout-selection-DIQaaOIC.js";import"./layout-providers-Dr743WlP.js";import"./elk-6l8mIQnQ.js";function mi(t,i,n="both",a=10){const r=t.elements[i];if(!r)return{rootId:i,rootName:"(unknown)",rootKind:"",nodes:[],edges:[]};const l=new Map,x=new Map;for(const p of t.relationships)l.has(p.sourceId)||l.set(p.sourceId,[]),l.get(p.sourceId).push(p),x.has(p.targetId)||x.set(p.targetId,[]),x.get(p.targetId).push(p);const m=new Set;m.add(i);const F=[],y=[],I=[[i,0]];for(;I.length>0;){const[p,b]=I.shift();if(b>=a)continue;const v=b+1;if(n==="downstream"||n==="both")for(const f of l.get(p)||[]){const k=f.targetId;if(y.push({fromId:p,toId:k,relType:f.type,relId:f.id}),!m.has(k)){m.add(k);const E=t.elements[k];E&&(F.push({elementId:k,name:E.name,kind:E.kind,layer:E.layer,depth:v,viaRelType:f.type,direction:"downstream"}),I.push([k,v]))}}if(n==="upstream"||n==="both")for(const f of x.get(p)||[]){const k=f.sourceId;if(y.push({fromId:k,toId:p,relType:f.type,relId:f.id}),!m.has(k)){m.add(k);const E=t.elements[k];E&&(F.push({elementId:k,name:E.name,kind:E.kind,layer:E.layer,depth:v,viaRelType:f.type,direction:"upstream"}),I.push([k,v]))}}}return F.sort((p,b)=>p.depth-b.depth||p.name.localeCompare(b.name)),{rootId:i,rootName:r.name,rootKind:r.kind,nodes:F,edges:y}}const Xe=$s(t=>({subject:null,publish:i=>t({subject:i})})),Ue=t=>Xe.getState().publish(t),Dn=t=>{var i,n;return[t.source,t.target,(i=t.data)==null?void 0:i.sourcePortId,(n=t.data)==null?void 0:n.targetPortId].filter(a=>!!a)},yi=(t,i)=>t.edgeId===i.id||Dn(i).some(n=>t.endpointIds.includes(n)),so=()=>Xe(t=>t.subject!==null),bi=t=>Xe(i=>{var n;return((n=i.subject)==null?void 0:n.endpointIds.includes(t))??!1}),Nn=(t,i)=>Xe(n=>{const a=n.subject;return a?a.edgeId===t||i.some(r=>r!==void 0&&a.endpointIds.includes(r)):!1}),Fi=t=>`.react-flow__edge[data-id="${CSS.escape(t)}"]`;function wi(){const t=Xe(a=>a.subject),i=En(a=>t?a.edges.filter(r=>yi(t,r)).map(r=>r.id).join("\0"):"");if(!t)return null;const n=i?i.split("\0").map(Fi).join(","):"";return e.jsxs("style",{children:[".react-flow__edge{opacity:0.22;transition:opacity 120ms ease}",n?`${n}{opacity:1}`:""]})}class ji{constructor(){Vt(this,"providers",[]);Vt(this,"byId",new Map)}register(i,n){const a=this.byId.get(i.descriptor.id);if(a&&a!==i)throw new Error(`Template provider already registered: ${i.descriptor.id}`);if(a)return;this.byId.set(i.descriptor.id,i);const r=n?this.providers.findIndex(l=>l.descriptor.id===n):-1;r>=0?this.providers.splice(r,0,i):this.providers.push(i)}unregister(i){const n=this.byId.get(i);return n?(this.byId.delete(i),this.providers.splice(this.providers.indexOf(n),1),!0):!1}get(i){return this.byId.get(i)}has(i){return this.byId.has(i)}list(){return this.providers.map(i=>i.descriptor)}select(i){const n=this.providers.find(a=>a.matches(i));if(!n)throw new Error("No diagram template matches this view — register a catch-all provider");return n}}const An=new ji,vi=[{descriptor:{id:"memo.template.fbs",name:"Functional Breakdown",label:"FBS",contractVersion:"1",interactive:!0,description:"Functional breakdown structure — functions per realising component."},matches:t=>t.isFBSDiagram,compute:(t,i)=>Ks(t,i.fbs)},{descriptor:{id:"memo.template.decomposition",name:"Decomposition Tree",label:"Decomposition",contractVersion:"1",interactive:!0,description:"Expandable decomposition tree over composition relationships."},matches:t=>t.isDecompDiagram&&t.layoutStyle==="decomposition",compute:(t,i)=>Vs(t,i.decomposition)},{descriptor:{id:"memo.template.containment",name:"Containment Blocks",label:"Containment",contractVersion:"1",interactive:!0,description:"Nested containment blocks over composition relationships."},matches:t=>t.isDecompDiagram,compute:(t,i)=>Ys(t,i.containment)},{descriptor:{id:"memo.template.usecase",name:"Use Case",label:"Use case",contractVersion:"1",interactive:!1,description:"Actors outside a system boundary, use cases inside (KK-7)."},matches:t=>t.diagramType==="ucd",compute:(t,i)=>Us(t,i.useCase)},{descriptor:{id:"memo.template.context",name:"System Context",label:"Context",contractVersion:"1",interactive:!1,description:"Black-box system of interest with external actors and peer systems."},matches:t=>t.diagramType==="context",compute:(t,i)=>Xs(t,i.context.systemName,i.context)},{descriptor:{id:"memo.template.interconnection",name:"Interconnection",label:"Interconnection",contractVersion:"1",interactive:!1,description:"IBD — parts with boundary ports, typed connectors, nested containment (KK-3)."},matches:t=>t.viewKind==="interconnection",compute:(t,i)=>Gs(t,i.interconnection)},{descriptor:{id:"memo.template.actionflow",name:"Action Flow",label:"Action flow",contractVersion:"1",interactive:!1,description:"Actions with parameter ports, item flows, successions, optional swimlanes (KK-4)."},matches:t=>t.viewKind==="actionflow",compute:(t,i)=>qs(t,i.actionflow)},{descriptor:{id:"memo.template.statetransition",name:"State Transition",label:"State transition",contractVersion:"1",interactive:!1,description:"Nested states with routed transition edges and trigger [guard] labels (KK-5)."},matches:t=>t.viewKind==="statetransition",compute:(t,i)=>Zs(t,i.statetransition)},{descriptor:{id:"memo.template.sequence",name:"Sequence",label:"Sequence",contractVersion:"1",interactive:!1,description:"Lifelines with chronological messages (KK-6)."},matches:t=>t.viewKind==="sequence",compute:(t,i)=>Qs(t,i.sequence)},{descriptor:{id:"memo.template.general",name:"General (structured)",label:"General",contractVersion:"1",interactive:!0,description:"General template tree/containment modes (KK-2)."},matches:t=>t.isGeneralTemplate&&t.generalMode!=="graph",compute:(t,i)=>Js(t,i.general)},{descriptor:{id:"memo.template.standard",name:"Standard Graph",label:"Standard",contractVersion:"1",interactive:!0,description:"Relationship graph with optional compartments — the catch-all."},matches:()=>!0,compute:(t,i)=>ei(t,i.standard)}];for(const t of vi)An.register(t);function Ge({color:t="#334155",size:i=38}){const n=Math.round(i*1.42);return e.jsxs("svg",{width:i,height:n,viewBox:"0 0 38 54","aria-hidden":"true",fill:"none",stroke:t,strokeWidth:"2",children:[e.jsx("circle",{cx:"19",cy:"8",r:"6",fill:"#FFFFFF"}),e.jsx("path",{d:"M19 14v18M6 23h26M19 32L8 49M19 32l11 17",strokeLinecap:"round"})]})}const io=t=>t==="Actor"||t==="User";function Si({data:t}){const i=t,{element:n,layerColor:a,isExpanded:r,hasChildren:l,childCount:x,direction:m,onToggleExpand:F,onToggleDirection:y,showDirectionButton:I,depthBgColor:p,isContainer:b}=i,v=m==="vertical"?"V":"H",f=b&&r;return e.jsxs("div",{style:{background:f?p||"#FAFAF9":"#FFFFFF",borderLeft:f?`2px solid ${a}40`:`3px solid ${a}`,borderTop:`1px solid ${f?a+"30":"#E5E5E0"}`,borderRight:`1px solid ${f?a+"30":"#E5E5E0"}`,borderBottom:`1px solid ${f?a+"30":"#E5E5E0"}`,borderRadius:3,padding:f?"0":"8px 12px",minWidth:f?void 0:"200px",boxShadow:"none",width:"100%",height:"100%",boxSizing:"border-box"},children:[e.jsx(C,{type:"target",position:j.Top,id:"top",style:gt}),e.jsx(C,{type:"source",position:j.Bottom,id:"bottom",style:gt}),e.jsx(C,{type:"target",position:j.Left,id:"left",style:gt}),e.jsx(C,{type:"source",position:j.Right,id:"right",style:gt}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:f?"8px 12px":"0"},children:[io(n.kind)&&e.jsx(Ge,{size:24,color:a}),l&&e.jsx("button",{onClick:k=>{k.stopPropagation(),F()},style:{width:"20px",height:"20px",borderRadius:2,border:`1px solid ${a}`,background:r?a+"12":"#FFFFFF",color:a,fontSize:N.md,fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,padding:0,flexShrink:0,transition:"background 200ms ease, color 200ms ease"},title:r?"Collapse":"Expand",children:r?"−":"+"}),l&&I&&e.jsx("button",{onClick:k=>{k.stopPropagation(),y()},style:{width:"20px",height:"20px",borderRadius:"4px",border:"1.5px solid #10b981",background:"transparent",color:"#10b981",fontSize:"9px",fontWeight:700,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,flexShrink:0,transition:"background 200ms ease"},title:`Direction: ${m}. Click to toggle`,children:v}),e.jsx("span",{style:{fontSize:N.md,fontWeight:600,color:f?a:"#1a1a1a",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.name})]}),!f&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"3px",paddingLeft:l?"26px":"14px"},children:[e.jsx("span",{style:{fontSize:N.badge,color:"#9CA3AF"},children:n.kind}),l&&e.jsxs("span",{style:{fontSize:"9px",color:"#6B7280",background:"#F0F0ED",padding:"1px 5px",borderRadius:2,fontWeight:600},children:[x," parts",r?"":" (collapsed)"]})]})]})}const gt={width:"8px",height:"8px",background:"#2DD4A8",border:"1.5px solid #FFFFFF",opacity:0},ki=d.memo(Si),xn={top:j.Top,bottom:j.Bottom,left:j.Left,right:j.Right},Ei={top:"bottom",bottom:"top",left:"right",right:"left"},Ci="#6B7280",Rn=t=>t?wt[t]:Ci;function Tn(t,i){if(t==="inout")return"⇄";if(!t)return"";const n=t==="in";switch(i){case"left":return n?"→":"←";case"right":return n?"←":"→";case"top":return n?"↓":"↑";default:return n?"↑":"↓"}}const Ii=104,hn=40,gn=t=>({opacity:0,width:t,height:t,top:"50%",left:"50%",transform:"translate(-50%, -50%)",border:"none",background:"transparent",pointerEvents:"none"});function Di({port:t,onMove:i}){const{getZoom:n}=oo(),a=En(p=>p.transform[2]),r=bi(t.id),l=so()&&!r,x=t.size??no,m=x+5,F=Rn(t.direction),y=t.side==="left"||t.side==="right",I={position:"absolute",fontSize:t.nested?"9.5px":"10.5px",fontWeight:r?750:t.nested?600:650,color:r?"#0F172A":t.nested?"#6B7280":"#374151",opacity:l?.45:1,transition:"color 120ms ease, opacity 120ms ease",whiteSpace:"normal",pointerEvents:"none",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,width:y?Ii:72,background:"rgba(255,255,255,0.94)",padding:"1px 3px",borderRadius:4,lineHeight:1.12,...t.side==="left"?{left:m,bottom:"50%",marginBottom:2}:t.side==="right"?{right:m,bottom:"50%",marginBottom:2,textAlign:"right"}:t.side==="top"?{top:m,left:"50%",transform:"translateX(-50%)"}:{bottom:m,left:"50%",transform:"translateX(-50%)"}};return e.jsxs("div",{className:"nodrag nopan",style:{position:"absolute",left:t.x,top:t.y,width:x,height:x,zIndex:t.nested?11:10},children:[e.jsx("div",{onPointerEnter:()=>Ue({endpointIds:[t.id]}),onPointerLeave:()=>Ue(null),onPointerDown:i?p=>{p.preventDefault(),p.stopPropagation();const b=p.clientY,v=t.y,f=E=>i(v+(E.clientY-b)/n()),k=()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",k)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",k,{once:!0})}:void 0,title:`${t.name}${t.direction?` (${t.direction})`:""}`,style:{position:"absolute",left:"50%",top:"50%",width:hn,height:hn,transform:`translate(-50%, -50%) scale(${1/Math.max(a,.1)})`,cursor:i?"grab":"default",touchAction:"none"}}),e.jsxs("div",{style:{position:"absolute",inset:0,boxSizing:"border-box",background:"#FFFFFF",border:`2px solid ${F}`,borderRadius:5,boxShadow:r?`0 0 0 4px ${F}33, 0 2px 8px rgba(15,23,42,0.24)`:"0 1px 3px rgba(15,23,42,0.18)",opacity:l?.5:1,display:"flex",alignItems:"center",justifyContent:"center",color:F,fontSize:t.nested?"10px":"12px",fontWeight:800,lineHeight:1,pointerEvents:"none",transition:"box-shadow 120ms ease, opacity 120ms ease"},children:[Tn(t.direction,t.side),e.jsx("span",{style:I,children:t.name.replace(/([a-z0-9])([A-Z])/g,"$1​$2")}),[{suffix:"",pos:xn[t.side]},{suffix:ti,pos:xn[Ei[t.side]]}].flatMap(p=>[e.jsx(C,{className:"ibd-port-anchor",type:"source",id:`${t.id}${p.suffix}`,position:p.pos,style:gn(x),isConnectable:!1},`s${p.suffix}`),e.jsx(C,{className:"ibd-port-anchor",type:"target",id:`${t.id}${p.suffix}`,position:p.pos,style:gn(x),isConnectable:!1},`t${p.suffix}`)])]})]})}function fn({side:t,direction:i}){const n=Rn(i),a=no;return e.jsx("div",{"aria-label":`implicit ${i} port`,title:`Implicit ${i} port — relationship targets the part directly`,style:{position:"absolute",top:"50%",left:t==="left"?-a/2:void 0,right:t==="right"?-a/2:void 0,transform:"translateY(-50%)",width:a,height:a,boxSizing:"border-box",background:"#FFFFFF",border:`2px solid ${n}`,borderRadius:4,boxShadow:"0 1px 3px rgba(15,23,42,0.18)",display:"flex",alignItems:"center",justifyContent:"center",color:n,fontSize:11,fontWeight:800,lineHeight:1,zIndex:4,pointerEvents:"none"},children:Tn(i,t)})}const ft={width:8,height:8,background:"#2DD4A8",border:"1.5px solid #FFFFFF",opacity:0};function mn({name:t,kind:i,nameColor:n,typeColor:a,frame:r=!1}){return e.jsxs("span",{title:`${t} : ${i}`,style:{display:"flex",flexDirection:r?"row":"column",alignItems:r?"baseline":"flex-start",gap:r?6:1,minWidth:0,overflow:"hidden",flex:1},children:[e.jsx("span",{style:{display:r?"block":"-webkit-box",width:"100%",minWidth:0,fontSize:r?N.md:N.sm,lineHeight:1.2,fontWeight:700,color:n,whiteSpace:r?"nowrap":"normal",overflow:"hidden",textOverflow:"ellipsis",WebkitBoxOrient:"vertical",WebkitLineClamp:r?void 0:2,overflowWrap:"anywhere"},children:t}),e.jsx("span",{style:{display:"block",maxWidth:"100%",fontSize:"9px",lineHeight:1.15,fontWeight:650,letterSpacing:"0.055em",textTransform:"uppercase",color:a,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r?`: ${i}`:`«${i}»`})]})}function yn({label:t,isCollapsed:i,onToggle:n,color:a,onColor:r}){return e.jsx("button",{"aria-label":i?`Expand ${t}`:`Collapse ${t}`,onClick:l=>{l.stopPropagation(),n()},style:{marginLeft:"auto",width:18,height:18,padding:0,borderRadius:3,border:r?"1px solid rgba(255,255,255,0.7)":`1px solid ${a}88`,background:r?"rgba(255,255,255,0.18)":"#FFFFFF",color:r?"#FFFFFF":a,fontSize:13,lineHeight:"15px",cursor:"pointer",fontWeight:700,flexShrink:0},children:i?"+":"−"})}function Ni({id:t,data:i,selected:n,height:a}){const r=i,{label:l,kind:x,color:m,isContainer:F,isFrame:y,ports:I,implicitIn:p,implicitOut:b,onPortMove:v,hasChildren:f,isCollapsed:k,onToggleCollapse:E}=r,[D,O]=d.useState(!1),M=n?ie.selected:y?"none":D?"0 8px 20px rgba(15,23,42,0.12)":F?"0 1px 2px rgba(15,23,42,0.05)":"0 2px 8px rgba(15,23,42,0.08)";return e.jsxs("div",{onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),style:{width:"100%",height:"100%",boxSizing:"border-box",background:"#FFFFFF",border:y?"1.5px solid #94A3B8":`1px solid ${D?m+"9A":"#CBD5E1"}`,...y?{}:{borderTop:`3px solid ${m}`},borderRadius:y?10:8,boxShadow:M,transition:"box-shadow 150ms ease, border-color 150ms ease",position:"relative"},children:[!y&&e.jsx(kt,{nodeId:t,isVisible:n,minWidth:180,minHeight:100,color:"#2563EB",lineStyle:{borderWidth:1},handleStyle:{width:10,height:10,borderRadius:2}}),e.jsx(C,{type:"target",position:j.Top,id:"top",style:ft}),e.jsx(C,{type:"source",position:j.Bottom,id:"bottom",style:ft}),e.jsx(C,{type:"target",position:j.Left,id:"left",style:ft}),e.jsx(C,{type:"source",position:j.Right,id:"right",style:ft}),y?e.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,height:38,display:"flex",alignItems:"center",gap:8,padding:"0 10px",background:"#F8FAFC",borderBottom:"1px solid #E2E8F0",borderRadius:"9px 9px 0 0"},children:[e.jsx("span",{style:{padding:"2px 6px",borderRadius:4,background:m,color:"#FFFFFF",fontSize:9,fontWeight:800,letterSpacing:"0.08em"},children:"IBD"}),e.jsx(mn,{name:l,kind:x,nameColor:"#0F172A",typeColor:"#64748B",frame:!0}),f&&E&&e.jsx(yn,{label:l,isCollapsed:k,onToggle:E,color:m})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,minHeight:58,padding:"7px 10px 6px",background:"#FFFFFF",borderBottom:f?"1px solid #E2E8F0":"none",borderRadius:"7px 7px 0 0",overflow:"hidden"},children:[io(x)&&e.jsx(Ge,{size:24,color:m}),e.jsx(mn,{name:l,kind:x,nameColor:"#0F172A",typeColor:F?m:"#64748B"}),f&&E&&e.jsx(yn,{label:l,isCollapsed:k,onToggle:E,color:m})]}),I.map(A=>e.jsx(Di,{port:A,onMove:v?K=>{const Q=A.size??no,_=(y||F?70:62)-Q/2,z=Math.max(_,(a??_+Q+18)-Q-18);v(A.id,Math.min(Math.max(K,_),z))}:void 0},A.id)),p&&e.jsx(fn,{side:"left",direction:"in"}),b&&e.jsx(fn,{side:"right",direction:"out"})]})}const Ai=d.memo(Ni);function bn(t,i){const n=t.map(r=>({...r}));let a=i;for(;n.length>=2&&a>0;){const r=n[0],l=n[1],x=Math.hypot(l.x-r.x,l.y-r.y);if(x<=a)a-=x,n.shift();else{const m=a/x;n[0]={x:r.x+(l.x-r.x)*m,y:r.y+(l.y-r.y)*m},a=0}}return n}function Ri(t,i){const n=bn(t,i);return bn([...n].reverse(),i).reverse()}const Ti=t=>t.slice(1).reduce((i,n,a)=>i+Math.hypot(n.x-t[a].x,n.y-t[a].y),0);function mt(t,i=7){if(t.length<2)return"";let n=`M ${t[0].x},${t[0].y}`;for(let r=1;r<t.length-1;r++){const l=t[r-1],x=t[r],m=t[r+1],F=Math.hypot(x.x-l.x,x.y-l.y),y=Math.hypot(m.x-x.x,m.y-x.y),I=Math.min(i,F/2,y/2),p=x.x-Math.sign(x.x-l.x)*I,b=x.y-Math.sign(x.y-l.y)*I,v=x.x+Math.sign(m.x-x.x)*I,f=x.y+Math.sign(m.y-x.y)*I;n+=` L ${p},${b} Q ${x.x},${x.y} ${v},${f}`}const a=t[t.length-1];return`${n} L ${a.x},${a.y}`}function Bi(t){let i=0,n=-1;for(let x=1;x<t.length;x++){const m=Math.abs(t[x].x-t[x-1].x)+Math.abs(t[x].y-t[x-1].y);m>n&&(n=m,i=x)}const a=t[i-1],r=t[i],l=Math.abs(r.x-a.x)>=Math.abs(r.y-a.y)?{x:0,y:-14}:{x:14,y:0};return{x:(a.x+r.x)/2+l.x,y:(a.y+r.y)/2+l.y}}function Mi(t){var k,E,D,O,M,A,K,Q,_,z,re;const{getZoom:i}=oo(),n=Nn(t.id,[t.source,t.target,(k=t.data)==null?void 0:k.sourcePortId,(E=t.data)==null?void 0:E.targetPortId]),a=so()&&!n,r=((D=t.data)==null?void 0:D.points)??[];if(r.length<2)return null;const l=String(((O=t.style)==null?void 0:O.stroke)??"#2563EB"),x=Number(((M=t.style)==null?void 0:M.strokeWidth)??2),m=n?{...t.style,strokeWidth:x+1.4}:t.style,F=((A=t.data)==null?void 0:A.labelPoint)??Bi(r),y=Math.min(28/Math.max(i(),.1),Ti(r)*.3),I=Ri(r,y),p=(K=t.data)==null?void 0:K.onRouteChange,b=(Q=t.data)==null?void 0:Q.onSelect,v=!!((_=t.data)!=null&&_.flowAnimation),f=r.length===2?[{index:1,a:r[0],b:r[1],straight:!0}]:r.slice(1).map((w,pe)=>({index:pe+1,a:r[pe],b:w,straight:!1})).filter(w=>w.index>=2&&w.index<=r.length-2);return e.jsxs(e.Fragment,{children:[n&&e.jsx("path",{d:mt(r),fill:"none",stroke:l,strokeOpacity:.22,strokeWidth:x+9,strokeLinecap:"round",pointerEvents:"none"}),e.jsx(Cn,{id:t.id,path:mt(r),style:m,markerEnd:t.markerEnd}),v&&e.jsx("path",{d:mt(r),fill:"none",stroke:String(((z=t.style)==null?void 0:z.stroke)??"#2563EB"),strokeWidth:Math.max(2,Number(((re=t.style)==null?void 0:re.strokeWidth)??2)),className:"memo-ibd-flow"}),I.length>=2&&e.jsx("path",{d:mt(I),fill:"none",stroke:"transparent",strokeWidth:18/Math.max(i(),.1),pointerEvents:"stroke",cursor:"pointer",onClick:w=>b==null?void 0:b(w)}),t.label?e.jsx(Jt,{children:e.jsx("div",{style:{position:"absolute",transform:`translate(-50%, -50%) translate(${F.x}px, ${F.y}px)`,fontSize:N.badge,fontWeight:n?700:600,color:n?"#0F172A":"#475569",background:"rgba(255,255,255,0.96)",border:`1px solid ${n?l:"#E2E8F0"}`,opacity:a?.25:1,padding:"1px 4px",borderRadius:4,pointerEvents:"none"},children:t.label})}):null,t.selected&&p?f.map(w=>{const pe=(w.a.x+w.b.x)/2,ee=(w.a.y+w.b.y)/2;return e.jsx(Jt,{children:e.jsx("div",{className:"nodrag nopan",title:"Drag connector segment",onPointerDown:U=>{U.preventDefault(),U.stopPropagation();const qe=U.clientX,Ze=U.clientY,be=Ee=>{const ne=(Ee.clientX-qe)/i(),ue=(Ee.clientY-Ze)/i();if(w.straight){if(Math.abs(ue)>=Math.abs(ne)){const se=w.a.y+ue;p([w.a,{x:w.a.x,y:se},{x:w.b.x,y:se},w.b])}else{const se=(w.a.x+w.b.x)/2+ne;p([w.a,{x:se,y:w.a.y},{x:se,y:w.b.y},w.b])}return}const G=r.map(se=>({...se}));w.a.y===w.b.y?(G[w.index-1].y=w.a.y+ue,G[w.index].y=w.b.y+ue):(G[w.index-1].x=w.a.x+ne,G[w.index].x=w.b.x+ne),p(G)},ke=()=>{window.removeEventListener("pointermove",be),window.removeEventListener("pointerup",ke)};window.addEventListener("pointermove",be),window.addEventListener("pointerup",ke,{once:!0})},style:{position:"absolute",transform:`translate(-50%, -50%) translate(${pe}px, ${ee}px)`,width:12,height:12,borderRadius:3,background:"#FFFFFF",border:"2px solid #2563EB",boxShadow:"0 1px 4px rgba(15,23,42,0.22)",cursor:w.a.y===w.b.y?"ns-resize":"ew-resize",pointerEvents:"all",touchAction:"none",zIndex:20}})},`route-${w.index}`)}):null]})}const Li=d.memo(Mi);function zi({onDrillIn:t,color:i,label:n}){return e.jsx("button",{onClick:a=>{a.stopPropagation(),t()},onDoubleClick:a=>a.stopPropagation(),className:"nodrag",title:`Open ${n} as its own diagram`,"aria-label":`Drill into ${n}`,style:{width:16,height:16,flexShrink:0,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${i}66`,borderRadius:4,background:"#FFFFFF",color:i,fontSize:10,fontWeight:700,lineHeight:1,cursor:"pointer"},children:"↳"})}function $i({data:t,selected:i}){const n=t,{nodeType:a,label:r,laneColor:l,layerColor:x,inPorts:m,outPorts:F}=n,[y,I]=d.useState(!1);if(a==="start")return e.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:"#374151",border:"2px solid #374151",boxShadow:ie.sm},children:e.jsx(C,{type:"source",position:n.flowDirection==="vertical"?j.Bottom:j.Right,style:{background:"#374151",width:6,height:6}})});if(a==="done")return e.jsxs("div",{style:{width:28,height:28,borderRadius:"50%",background:"#FFFFFF",border:"3px solid #374151",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:ie.sm},children:[e.jsx("div",{style:{width:14,height:14,borderRadius:"50%",background:"#374151"}}),e.jsx(C,{type:"target",position:n.flowDirection==="vertical"?j.Top:j.Left,style:{background:"#374151",width:6,height:6}})]});if(a==="fork"||a==="join"){const f=n.flowDirection==="vertical";return e.jsxs("div",{title:a==="fork"?"Fork — split into concurrent flows":"Join — synchronize concurrent flows",style:{width:"100%",height:"100%",background:"#374151",borderRadius:3,boxShadow:ie.sm},children:[e.jsx(C,{type:"target",position:f?j.Top:j.Left,style:{background:"#374151",width:6,height:6,border:"none"}}),e.jsx(C,{type:"source",position:f?j.Bottom:j.Right,style:{background:"#374151",width:6,height:6,border:"none"}})]})}const p=l||x||"#9CA3AF";if(n.isFrame)return e.jsxs("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",background:`${p}08`,border:`1.5px solid ${p}66`,borderRadius:10,boxShadow:i?"0 0 0 3px #2DD4A8":"none",position:"relative"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px 0"},children:[n.onToggleExpand&&e.jsx("button",{"aria-label":`Collapse ${r}`,className:"nodrag",onClick:f=>{f.stopPropagation(),n.onToggleExpand()},onDoubleClick:f=>f.stopPropagation(),style:{width:16,height:16,flexShrink:0,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${p}66`,borderRadius:4,background:"#FFFFFF",color:p,fontSize:11,fontWeight:700,lineHeight:1,cursor:"pointer"},children:"−"}),n.onDrillIn&&e.jsx(zi,{onDrillIn:n.onDrillIn,color:p,label:r}),e.jsx("span",{style:{fontSize:N.md,fontWeight:700,color:p,whiteSpace:"nowrap"},children:r}),n.allocatedTo&&e.jsxs("span",{style:{fontSize:"9px",color:"#9CA3AF",whiteSpace:"nowrap"},children:["→"," ",n.allocatedTo]})]}),e.jsx(C,{type:"target",position:n.flowDirection==="vertical"?j.Top:j.Left,style:{background:p,width:8,height:8,border:"2px solid #FFFFFF"}}),e.jsx(C,{type:"source",position:n.flowDirection==="vertical"?j.Bottom:j.Right,style:{background:p,width:8,height:8,border:"2px solid #FFFFFF"}})]});const b=18,v=Math.max(m.length*b,F.length*b,0);return e.jsxs("div",{onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),style:{background:"#FFFFFF",border:`1.5px solid ${p}`,borderRadius:3,minWidth:"140px",boxShadow:i?"0 0 0 3px #2DD4A8, 0 4px 12px rgba(45, 212, 168, 0.35)":y?`0 0 0 2px ${p}22`:"none",transition:"box-shadow 150ms ease",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"8px 14px",fontSize:N.md,fontWeight:600,color:"#1a1a1a",background:`${p}0D`,borderBottom:v>0?"1px solid #E5E5E0":"none",textAlign:"center",whiteSpace:"nowrap"},children:[r,n.hasChildren&&n.onDrillIn&&e.jsx("button",{"aria-label":`Drill into ${r}`,title:`Open ${r} as its own diagram`,className:"nodrag",onClick:f=>{f.stopPropagation(),n.onDrillIn()},onDoubleClick:f=>f.stopPropagation(),style:{float:"right",marginLeft:4,width:18,height:18,padding:0,border:`1px solid ${p}`,borderRadius:2,background:"#FFFFFF",color:p,fontSize:11,fontWeight:700,lineHeight:"16px",cursor:"pointer"},children:"↳"}),n.hasChildren&&n.onToggleExpand&&e.jsx("button",{"aria-label":n.isExpanded?`Collapse ${r}`:`Expand ${r}`,onClick:f=>{f.stopPropagation(),n.onToggleExpand()},style:{float:"right",marginLeft:8,width:18,height:18,padding:0,border:`1px solid ${p}`,borderRadius:2,background:"#FFFFFF",color:p,fontSize:13,fontWeight:700,lineHeight:"16px",cursor:"pointer"},children:n.isExpanded?"−":"+"})]}),v>0&&e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0"},children:[e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:m.map(f=>e.jsxs("div",{style:{fontSize:N.badge,color:"#6B7280",paddingLeft:"8px",display:"flex",alignItems:"center",height:`${b}px`,gap:"4px"},children:[e.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"#3498DB",flexShrink:0}}),f]},`in-${f}`))}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"2px",alignItems:"flex-end"},children:F.map(f=>e.jsxs("div",{style:{fontSize:N.badge,color:"#6B7280",paddingRight:"8px",display:"flex",alignItems:"center",height:`${b}px`,gap:"4px"},children:[f,e.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"#E67E22",flexShrink:0}})]},`out-${f}`))})]}),n.allocatedTo&&e.jsxs("div",{style:{fontSize:"9px",color:"#9CA3AF",textAlign:"center",padding:"2px 6px",borderTop:"1px solid #F3F4F6",background:"#FAFAFA"},children:["→"," ",n.allocatedTo]}),e.jsx(C,{type:"target",position:n.flowDirection==="vertical"?j.Top:j.Left,style:{background:p,width:8,height:8,border:"2px solid #FFFFFF"}}),e.jsx(C,{type:"source",position:n.flowDirection==="vertical"?j.Bottom:j.Right,style:{background:p,width:8,height:8,border:"2px solid #FFFFFF"}})]})}const Wi=d.memo($i);function Oi({data:t,selected:i}){const n=t,a=n.orientation==="column";return e.jsx("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",background:`${n.color}08`,border:i?"3px solid #2DD4A8":`1px solid ${n.color}30`,borderLeft:i?"3px solid #2DD4A8":a?`1px solid ${n.color}30`:`3px solid ${n.color}`,borderTop:i?"3px solid #2DD4A8":a?`3px solid ${n.color}`:`1px solid ${n.color}30`,borderRadius:Ws.md,pointerEvents:"auto",cursor:n.inspectElementId?"pointer":"default",display:"flex"},children:e.jsx("div",{style:{writingMode:a?"horizontal-tb":"vertical-rl",transform:a?void 0:"rotate(180deg)",padding:a?"7px 10px":"10px 6px",fontSize:N.xs,fontWeight:700,color:n.color,letterSpacing:"0.04em",textTransform:"uppercase",alignSelf:a?"flex-start":"center",width:a?"100%":void 0,textAlign:a?"center":void 0,whiteSpace:"nowrap"},children:n.label})})}const Pi=d.memo(Oi);function Fn({onDrillIn:t,color:i,label:n}){return e.jsx("button",{onClick:a=>{a.stopPropagation(),t()},onDoubleClick:a=>a.stopPropagation(),className:"nodrag",title:`Open ${n} as its own diagram`,"aria-label":`Drill into ${n}`,style:{width:16,height:16,flexShrink:0,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${i}66`,borderRadius:4,background:"#FFFFFF",color:i,fontSize:10,fontWeight:700,lineHeight:1,cursor:"pointer"},children:"↳"})}function wn({collapsed:t,onToggle:i,color:n}){return e.jsx("button",{onClick:a=>{a.stopPropagation(),i()},onDoubleClick:a=>a.stopPropagation(),className:"nodrag",title:t?"Show substates":"Hide substates","aria-label":t?"Show substates":"Hide substates",style:{width:16,height:16,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${n}66`,borderRadius:4,background:"#FFFFFF",color:n,fontSize:11,fontWeight:700,lineHeight:1,cursor:"pointer"},children:t?"+":"−"})}const yt={width:8,height:8,border:"none",background:"transparent",opacity:0};function Xt(){return e.jsxs(e.Fragment,{children:[e.jsx(C,{type:"target",position:j.Top,id:"top",style:yt}),e.jsx(C,{type:"source",position:j.Bottom,id:"bottom",style:yt}),e.jsx(C,{type:"target",position:j.Left,id:"left",style:yt}),e.jsx(C,{type:"source",position:j.Right,id:"right",style:yt})]})}function _i({data:t,selected:i}){const n=t,[a,r]=d.useState(!1);if(n.isNote)return e.jsxs("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",background:"#FFFDF5",border:`1px solid ${n.color}66`,borderRadius:4,padding:"6px 10px",boxShadow:ie.sm,display:"flex",flexDirection:"column",justifyContent:"center"},title:n.kind,children:[e.jsx(Xt,{}),e.jsx("span",{style:{fontSize:N.xs,fontWeight:600,color:"#374151",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.label}),e.jsx("span",{style:{fontSize:"8px",fontWeight:700,color:n.color,textTransform:"uppercase",letterSpacing:"0.05em"},children:n.kind})]});if(n.isContainer)return e.jsxs("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",background:n.isMachine?"transparent":`${n.color}06`,borderTop:n.isMachine?"1.5px dashed #CBD5E1":`1.5px solid ${n.color}55`,borderRight:n.isMachine?"1.5px dashed #CBD5E1":`1.5px solid ${n.color}55`,borderBottom:n.isMachine?"1.5px dashed #CBD5E1":`1.5px solid ${n.color}55`,borderLeft:n.isMachine?"1.5px dashed #CBD5E1":`1.5px solid ${n.color}55`,borderRadius:14,boxShadow:i?ie.selected:"none",position:"relative"},children:[e.jsx(Xt,{}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px 0"},children:[n.onToggleCollapse&&!n.isMachine&&e.jsx(wn,{collapsed:!1,onToggle:n.onToggleCollapse,color:n.color}),n.onDrillIn&&!n.isMachine&&e.jsx(Fn,{onDrillIn:n.onDrillIn,color:n.color,label:n.label}),e.jsx("span",{style:{fontSize:N.md,fontWeight:700,color:n.isMachine?"#334155":n.color,whiteSpace:"nowrap"},children:n.label}),e.jsx("span",{style:{fontSize:"8px",fontWeight:700,color:n.isMachine?"#94A3B8":`${n.color}AA`,textTransform:"uppercase",letterSpacing:"0.06em"},children:n.kind})]})]});const l=!!n.hasChildren;return e.jsxs("div",{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),title:l?`${n.hiddenCount??0} substate${n.hiddenCount===1?"":"s"} hidden — double-click to drill in`:void 0,style:{width:"100%",height:"100%",boxSizing:"border-box",background:"#FFFFFF",borderTop:`3px solid ${n.color}`,borderRight:`1px solid ${a?`${n.color}9A`:"#CBD5E1"}`,borderBottom:`1px solid ${a?`${n.color}9A`:"#CBD5E1"}`,borderLeft:`1px solid ${a?`${n.color}9A`:"#CBD5E1"}`,borderRadius:12,boxShadow:i?ie.selected:a?"0 8px 20px rgba(15,23,42,0.12)":ie.md,transition:"box-shadow 150ms ease, border-color 150ms ease",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,padding:"4px 12px"},children:[e.jsx(Xt,{}),e.jsx("span",{style:{fontSize:N.md,fontWeight:600,color:"#1a1a1a",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:n.label}),n.subtitle&&e.jsx("span",{style:{fontSize:"8px",fontWeight:600,color:"#9CA3AF",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:n.subtitle}),l&&e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:5},children:[n.onToggleCollapse&&e.jsx(wn,{collapsed:!0,onToggle:n.onToggleCollapse,color:n.color}),n.onDrillIn&&e.jsx(Fn,{onDrillIn:n.onDrillIn,color:n.color,label:n.label}),e.jsxs("span",{style:{fontSize:"8px",fontWeight:700,color:n.color,letterSpacing:"0.05em"},children:["⊞ ",n.hiddenCount??0]})]})]})}const Hi=d.memo(_i),to="#3498DB";function Ki({data:t}){const i=t;return e.jsxs("div",{style:{width:"100%",height:"100%",position:"relative",pointerEvents:"none"},children:[e.jsx("div",{style:{position:"absolute",top:0,left:"50%",transform:"translateX(-50%)",minWidth:140,maxWidth:"90%",padding:"10px 16px",background:"#FFFFFF",border:`1.5px solid ${to}`,borderRadius:8,boxShadow:ie.md,textAlign:"center",fontSize:N.md,fontWeight:600,color:"#1a1a1a",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.label}),e.jsx("div",{style:{position:"absolute",top:44,bottom:0,left:"50%",borderLeft:`1.5px dashed ${to}66`}})]})}const Vi=d.memo(Ki);function Yi({data:t}){const i=t;return e.jsx("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",background:"#1B3A4B06",border:"1px solid #1B3A4B22",borderRadius:10,pointerEvents:"none"},children:e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8,padding:"8px 14px"},children:[e.jsx("span",{style:{fontSize:N.sm,fontWeight:700,color:"#1B3A4B"},children:i.label}),i.scenario&&e.jsxs("span",{style:{fontSize:N.xs,color:"#6B7280"},children:["realizes ",i.scenario]})]})})}const Ui=d.memo(Yi),bt={width:6,height:6,border:"none",background:"transparent",opacity:0};function Xi({data:t,selected:i}){const n=t;return e.jsxs("div",{style:{width:14,height:14,borderRadius:"50%",background:"#FFFFFF",border:`3px solid ${to}`,boxShadow:i?ie.selected:ie.sm,position:"relative"},title:n.kind,children:[e.jsx(C,{type:"source",id:"right",position:j.Right,style:bt}),e.jsx(C,{type:"target",id:"right",position:j.Right,style:bt}),e.jsx(C,{type:"source",id:"left",position:j.Left,style:bt}),e.jsx(C,{type:"target",id:"left",position:j.Left,style:bt}),e.jsx("span",{style:{position:"absolute",top:-20,left:"50%",transform:"translateX(-50%)",fontSize:"9px",fontWeight:600,color:"#374151",whiteSpace:"nowrap",background:"#FFFFFFCC",padding:"1px 5px",borderRadius:4},children:n.label})]})}const Gi=d.memo(Xi),vt={opacity:0,width:1,height:1},qi=d.memo(function({data:i}){const n=i;return e.jsxs("div",{style:{width:"100%",height:"100%",display:"grid",placeItems:"center",textAlign:"center",padding:"12px 22px",border:`2px solid ${n.color??"#E67E22"}`,borderRadius:"50%",background:"#FFF9F2",color:"#2D3748",fontSize:13,fontWeight:600,lineHeight:1.25},children:[n.label,e.jsx(C,{type:"target",position:j.Left,style:vt}),e.jsx(C,{type:"source",position:j.Right,style:vt})]})}),Zi=d.memo(function({data:i}){const n=i,a=n.side==="right"?j.Left:j.Right;return e.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#334155",fontSize:12,fontWeight:600,textAlign:"center",gap:3},children:[e.jsx(Ge,{color:n.color??"#334155"}),e.jsx("span",{children:n.label}),e.jsx(C,{type:"source",position:a,style:vt}),e.jsx(C,{type:"target",position:a,style:vt})]})}),Qi=d.memo(function({data:i}){const n=i;return e.jsx("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",border:"1.5px solid #64748B",background:"rgba(255,255,255,0.32)",padding:"10px 14px",color:"#475569",fontSize:12,fontWeight:700},children:n.label})});d.memo(function({data:i}){const n=i;return e.jsx("div",{style:{width:"100%",textAlign:"center",color:"#64748B",fontSize:11,fontWeight:700,letterSpacing:".03em"},children:n.label})});function Ji(t,i=0){if(t.length<2)return"";if(i===0||t.length===2)return`M ${t.map(r=>`${r.x},${r.y}`).join(" L ")}`;let n=`M ${t[0].x},${t[0].y}`;for(let r=1;r<t.length-1;r++){const l=t[r-1],x=t[r],m=t[r+1],F=Math.min(i,Math.abs(x.x-l.x)/2+Math.abs(x.y-l.y)/2),y=Math.min(i,Math.abs(m.x-x.x)/2+Math.abs(m.y-x.y)/2),I={x:x.x+Math.sign(l.x-x.x)*F,y:x.y+Math.sign(l.y-x.y)*F},p={x:x.x+Math.sign(m.x-x.x)*y,y:x.y+Math.sign(m.y-x.y)*y};n+=` L ${I.x},${I.y} Q ${x.x},${x.y} ${p.x},${p.y}`}const a=t[t.length-1];return`${n} L ${a.x},${a.y}`}const er=d.memo(function(i){var b,v,f,k,E;const n=Nn(i.id,[i.source,i.target]),a=so()&&!n,r=((b=i.data)==null?void 0:b.routing)??"rounded",l=Array.isArray((v=i.data)==null?void 0:v.points)?i.data.points:[],x=l.length>=2?l:[{x:i.sourceX,y:i.sourceY},{x:i.targetX,y:i.targetY}],F=r==="straight"?`M ${i.sourceX},${i.sourceY} L ${i.targetX},${i.targetY}`:Ji(x,r==="elbow"?0:r==="rounded"?16:r==="curved"?30:42),y=((f=i.data)==null?void 0:f.labelPoint)??x[Math.floor(x.length/2)]??{x:(i.sourceX+i.targetX)/2,y:(i.sourceY+i.targetY)/2},I=String(((k=i.style)==null?void 0:k.stroke)??"#64748B"),p=Number(((E=i.style)==null?void 0:E.strokeWidth)??1.5);return e.jsxs(e.Fragment,{children:[n&&e.jsx("path",{d:F,fill:"none",stroke:I,strokeOpacity:.22,strokeWidth:p+9,strokeLinecap:"round",pointerEvents:"none"}),e.jsx(Cn,{path:F,style:n?{...i.style,strokeWidth:p+1.4}:i.style}),i.label&&e.jsx(Jt,{children:e.jsx("div",{className:"nodrag nopan",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${y.x}px,${y.y}px)`,background:"#FFFFFF",padding:"2px 5px",borderRadius:3,color:n?"#0F172A":"#334155",fontSize:12,pointerEvents:"all",fontWeight:n?700:void 0,opacity:a?.25:1},children:i.label})})]})}),Ft={opacity:0,width:1,height:1};function Bn(){return e.jsxs(e.Fragment,{children:[e.jsx(C,{type:"target",position:j.Left,style:Ft}),e.jsx(C,{type:"source",position:j.Right,style:Ft}),e.jsx(C,{type:"target",position:j.Top,style:Ft}),e.jsx(C,{type:"source",position:j.Bottom,style:Ft})]})}const tr=d.memo(function({data:i}){const n=i;return e.jsxs("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",display:"grid",placeItems:"center",padding:"14px 18px",textAlign:"center",border:"2px solid #0F766E",borderRadius:8,background:"#F0FDFA",color:"#134E4A",fontSize:15,fontWeight:700,lineHeight:1.25,boxShadow:"0 2px 7px rgba(15, 118, 110, 0.16)"},children:[e.jsxs("span",{children:[e.jsx("small",{style:{display:"block",marginBottom:5,color:"#0F766E",fontSize:10,letterSpacing:".08em"},children:"SYSTEM OF INTEREST"}),n.label]}),e.jsx(Bn,{})]})}),or=d.memo(function({data:i}){const n=i,a=n.category==="environment"?{border:"#7C3AED",fill:"#F5F3FF",text:"#4C1D95",tag:"ENVIRONMENT"}:n.category==="person"?{border:"#2563EB",fill:"#EFF6FF",text:"#1E3A8A",tag:"ACTOR"}:{border:"#64748B",fill:"#F8FAFC",text:"#334155",tag:"EXTERNAL SYSTEM"};return e.jsxs("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:3,padding:"10px 14px",textAlign:"center",border:`1.5px solid ${a.border}`,borderRadius:7,background:a.fill,color:a.text,fontSize:13,fontWeight:650,lineHeight:1.25},children:[n.category==="person"&&e.jsx(Ge,{size:26,color:a.border}),e.jsxs("span",{children:[e.jsx("small",{style:{display:"block",marginBottom:4,color:a.border,fontSize:9,letterSpacing:".07em"},children:a.tag}),n.label]}),e.jsx(Bn,{})]})}),nr=d.memo(function({data:i}){const n=i;return e.jsx("div",{style:{width:"100%",height:"100%",boxSizing:"border-box",border:"2px solid #0F766E",borderRadius:12,background:"rgba(240, 253, 250, 0.34)",padding:"12px 16px",color:"#0F766E",fontSize:12,fontWeight:750,letterSpacing:".04em"},children:n.label})}),sr=d.memo(function({id:i,data:n,selected:a}){var M;const r=n,[l,x]=d.useState(!1),[m,F]=d.useState(""),[y,I]=d.useState(!1),p=d.useRef(null),b=d.useCallback(()=>{F(r.label),x(!0),setTimeout(()=>{var A;(A=p.current)==null||A.select()},10)},[r.label]),v=d.useCallback(()=>{var K;x(!1);const A=m.trim();A&&A!==r.label&&((K=r.onInlineEdit)==null||K.call(r,i,A))},[m,r,i]),f=d.useCallback(A=>{A.key==="Enter"&&(A.preventDefault(),v()),A.key==="Escape"&&x(!1)},[v]),k=d.useCallback(A=>{var K;A.preventDefault(),(K=r.onContextMenu)==null||K.call(r,A,i)},[r,i]),E=r.bgColor??"#FFFFFF",D=r.color,O={background:D,border:"2px solid #FFFFFF",width:10,height:10,opacity:y||a?1:0,transition:"opacity 0.15s"};return e.jsxs("div",{onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),onContextMenu:k,onDoubleClick:b,style:{minWidth:120,minHeight:40,background:E,borderLeft:`3px solid ${D}`,borderRadius:8,boxShadow:a?`0 0 0 2px ${D}, 0 4px 12px ${D}44`:y?"0 4px 16px rgba(0,0,0,0.14)":"0 1px 4px rgba(0,0,0,0.08)",cursor:l?"text":"grab",position:"relative",transition:"box-shadow 0.15s",opacity:r.isNew?.7:1},children:[a&&e.jsx(kt,{minWidth:80,minHeight:36,maxWidth:600,maxHeight:400,color:D,lineStyle:{borderColor:D},handleStyle:{background:D,border:"2px solid #fff",width:10,height:10,borderRadius:2}}),e.jsxs("div",{style:{padding:"8px 12px",userSelect:"none",display:"flex",gap:8,alignItems:"center"},children:[io(r.kind)&&e.jsx(Ge,{size:26,color:D}),e.jsxs("div",{style:{minWidth:0,flex:1},children:[e.jsx("div",{style:{fontSize:"9px",fontWeight:700,color:D,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:2},children:r.kind}),l?e.jsx("input",{ref:p,value:m,onChange:A=>F(A.target.value),onBlur:v,onKeyDown:f,onClick:A=>A.stopPropagation(),autoFocus:!0,style:{fontSize:N.sm,fontWeight:500,color:"#1a1a1a",background:"transparent",border:"none",outline:"none",width:"100%",padding:0}}):e.jsx("div",{style:{fontSize:N.sm,fontWeight:500,color:"#1a1a1a",lineHeight:1.3,wordBreak:"break-word"},children:r.label||r.kind}),r.isNew&&e.jsx("div",{style:{fontSize:"9px",color:"#9CA3AF",marginTop:2},children:"saving…"})]})]}),!!((M=r.compartments)!=null&&M.length)&&e.jsx("div",{style:{borderTop:"1px solid #EDEDEA",padding:"5px 12px 7px",userSelect:"none"},children:r.compartments.map(A=>e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"baseline",fontSize:"10px",lineHeight:"15px",whiteSpace:"nowrap",overflow:"hidden"},children:[e.jsx("span",{style:{color:"#9CA3AF"},children:A.key}),e.jsx("span",{style:{color:"#4B5563",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis"},children:A.value})]},A.key))}),e.jsx(C,{type:"target",position:j.Top,style:{...O,top:-5}}),e.jsx(C,{type:"source",position:j.Bottom,style:{...O,bottom:-5},id:"bottom"}),e.jsx(C,{type:"source",position:j.Right,style:{...O,right:-5},id:"right"}),e.jsx(C,{type:"target",position:j.Left,style:{...O,left:-5}})]})});function Gt({collapsed:t,onToggleCollapse:i,elementIds:n=[]}){const a=L(b=>b.model),r=L(b=>b.selectedElementId),l=L(b=>b.inspectElement),[x,m]=d.useState(""),[F,y]=d.useState(new Set),I=d.useMemo(()=>{var k;if(!a)return[];const b=x.trim().toLowerCase(),v=new Map,f=new Set(n);for(const E of n){const D=(k=a.elements[E])==null?void 0:k.allocatedTo;D&&f.add(D)}for(const E of f){const D=a.elements[E];D&&(b&&!D.name.toLowerCase().includes(b)&&!D.kind.toLowerCase().includes(b)||(v.has(D.kind)||v.set(D.kind,[]),v.get(D.kind).push(D)))}return[...v.entries()].map(([E,D])=>({kind:E,elements:D.sort((O,M)=>O.name.localeCompare(M.name))})).sort((E,D)=>E.kind.localeCompare(D.kind))},[a,n,x]),p=b=>y(v=>{const f=new Set(v);return f.has(b)?f.delete(b):f.add(b),f});return t?e.jsxs("button",{className:"flex flex-col items-center py-2 gap-1 cursor-pointer",style:{width:36,border:0,borderRight:"1px solid #E5E5E0",background:"#FAFAF8",flexShrink:0},onClick:i,title:"Expand diagram elements","aria-label":"Expand diagram elements",children:[e.jsx("span",{style:{color:"#6B7280",fontSize:18},children:"›"}),e.jsx("span",{style:{fontSize:10,color:"#6B7280",writingMode:"vertical-rl"},children:"Diagram Elements"})]}):e.jsxs("div",{className:"flex flex-col overflow-hidden",style:{width:240,borderRight:"1px solid #E5E5E0",background:"#FAFAF8",flexShrink:0},children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",style:{borderBottom:"1px solid #E5E5E0",flexShrink:0},children:[e.jsx("span",{style:{fontSize:N.xs,fontWeight:600,color:"#374151"},children:"Diagram Elements"}),e.jsx("button",{onClick:i,title:"Collapse diagram elements","aria-label":"Collapse diagram elements",style:{background:"none",border:"none",cursor:"pointer",color:"#6B7280",fontSize:18,lineHeight:1},children:"‹"})]}),e.jsx("div",{className:"px-2 pt-2 pb-1",style:{flexShrink:0},children:e.jsx("input",{value:x,onChange:b=>m(b.target.value),placeholder:"Search elements…",className:"w-full px-2 py-1 rounded focus:outline-none",style:{fontSize:N.xs,background:"#F0F0ED",border:"1px solid #E5E5E0",color:"#374151"}})}),e.jsxs("div",{className:"flex-1 overflow-y-auto py-1",children:[I.map(b=>{var k;const v=F.has(b.kind),f=In[(k=b.elements[0])==null?void 0:k.layer]??"#6B7280";return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>p(b.kind),className:"w-full flex items-center gap-1.5 px-2 py-1",style:{background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:[e.jsx("span",{style:{fontSize:10,color:f},children:v?"▶":"▼"}),e.jsx("span",{className:"truncate",style:{fontSize:10,color:f,fontWeight:700},children:b.kind}),e.jsx("span",{style:{fontSize:9,color:"#9CA3AF",marginLeft:"auto"},children:b.elements.length})]}),!v&&b.elements.map(E=>{const D=r===E.id;return e.jsxs("button",{onClick:()=>l(E.id),className:"w-full flex items-center gap-2 px-3 py-1.5 text-left",style:{border:"none",cursor:"pointer",fontSize:N.xs,background:D?"#DDF7EF":"transparent",color:D?"#116149":"#374151",fontWeight:D?600:400},title:`Highlight ${E.name} in diagram`,children:[e.jsx("span",{style:{width:8,height:8,borderRadius:2,background:f,flexShrink:0}}),e.jsx("span",{className:"truncate flex-1",children:E.name})]},E.id)})]},b.kind)}),I.length===0&&e.jsx("div",{className:"p-3 text-center",style:{color:"#9CA3AF",fontSize:N.xs},children:x?"No matching elements":"No elements in this diagram"})]})]})}function J({label:t,icon:i,danger:n,onClick:a}){return e.jsxs("button",{onClick:a,className:"w-full flex items-center gap-2 px-3 py-1.5 text-left",style:{background:"none",border:"none",cursor:"pointer",fontSize:N.xs},onMouseEnter:r=>{r.currentTarget.style.background=n?"#FEF2F2":"#F7F7F5"},onMouseLeave:r=>{r.currentTarget.style.background="none"},children:[i&&e.jsx("span",{style:{fontSize:"12px",width:16,textAlign:"center"},children:i}),e.jsx("span",{style:{color:n?"#DC2626":"#1a1a1a"},children:t})]})}function jt(){return e.jsx("div",{style:{height:1,background:"#E5E5E0",margin:"2px 0"}})}function Mn({x:t,y:i,onClose:n,children:a}){const r=d.useRef(null);d.useEffect(()=>{const F=I=>{r.current&&!r.current.contains(I.target)&&n()},y=I=>{I.key==="Escape"&&n()};return document.addEventListener("mousedown",F),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("keydown",y)}},[n]);const l=210,x=Math.min(t,window.innerWidth-l-8),m=Math.min(i,window.innerHeight-200);return e.jsx("div",{ref:r,className:"fixed z-50 rounded-xl overflow-hidden py-1",style:{left:x,top:m,minWidth:l,background:"#FFFFFF",border:"1px solid #E5E5E0",boxShadow:"0 8px 32px rgba(0,0,0,0.14)"},children:a})}const ir=[{label:"Layer default",value:""},{label:"Mint",value:"#E8F5E9"},{label:"Sky",value:"#E3F2FD"},{label:"Amber",value:"#FFF8E1"},{label:"Rose",value:"#FFF0F0"},{label:"Lavender",value:"#F3E5F5"},{label:"Peach",value:"#FBE9E7"}];function rr({x:t,y:i,nodeId:n,nodeKind:a,onClose:r,onEditName:l,onChangeColor:x,onRemoveFromDiagram:m,onDeleteFromModel:F,onLinkRisk:y,onLinkRequirement:I,onShowProperties:p,onFocusElement:b,onShowInCatalog:v,onShowRelMatrix:f,onOpenSource:k,onViewKindInOntology:E}){const[D,O]=d.useState(!1);return e.jsxs(Mn,{x:t,y:i,onClose:r,children:[e.jsxs("div",{className:"px-3 py-1.5",style:{borderBottom:"1px solid #E5E5E0"},children:[e.jsx("div",{style:{fontSize:"10px",fontWeight:600,color:"#9CA3AF"},children:a}),e.jsx("div",{style:{fontSize:"9px",color:"#D1D5DB",fontFamily:"monospace"},children:n})]}),p&&e.jsx(J,{label:"Show Properties",icon:"ℹ",onClick:()=>{r(),p()}}),v&&e.jsx(J,{label:"Show in Catalog",icon:"☰",onClick:()=>{r(),v()}}),b&&e.jsx(J,{label:"Focus on Element",icon:"◎",onClick:()=>{r(),b()}}),f&&e.jsx(J,{label:"Show Relationship Matrix",icon:"☷",onClick:()=>{r(),f()}}),E&&e.jsx(J,{label:"View Kind in Ontology",icon:"⬡",onClick:()=>{r(),E()}}),k&&e.jsx(J,{label:"Open Source File",icon:"⟨/⟩",onClick:()=>{r(),k()}}),(p||v||b||f||E||k)&&e.jsx(jt,{}),e.jsx(J,{label:"Edit name",icon:"✏️",onClick:()=>{r(),l()}}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-1.5",style:{background:"none",border:"none",cursor:"pointer",fontSize:N.xs},onMouseEnter:M=>{O(!0),M.currentTarget.style.background="#F7F7F5"},onMouseLeave:M=>{M.currentTarget.style.background="none"},children:[e.jsx("span",{style:{fontSize:"12px",width:16,textAlign:"center"},children:"🎨"}),e.jsx("span",{style:{flex:1,textAlign:"left",color:"#1a1a1a"},children:"Change color"}),e.jsx("span",{style:{color:"#9CA3AF",fontSize:"10px"},children:"▶"})]}),D&&e.jsx("div",{className:"absolute left-full top-0 rounded-xl overflow-hidden py-1",style:{background:"#FFFFFF",border:"1px solid #E5E5E0",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",minWidth:160},onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),children:ir.map(M=>e.jsxs("button",{onClick:()=>{r(),x(M.value)},className:"w-full flex items-center gap-2.5 px-3 py-1.5",style:{background:"none",border:"none",cursor:"pointer"},onMouseEnter:A=>{A.currentTarget.style.background="#F7F7F5"},onMouseLeave:A=>{A.currentTarget.style.background="none"},children:[e.jsx("div",{style:{width:14,height:14,borderRadius:3,flexShrink:0,background:M.value||"#E5E5E0",border:"1px solid #D1D5DB"}}),e.jsx("span",{style:{fontSize:N.xs,color:"#374151"},children:M.label})]},M.value))})]}),e.jsx(jt,{}),y&&e.jsx(J,{label:"Link Risk",icon:"⚠️",onClick:()=>{r(),y()}}),I&&e.jsx(J,{label:"Link Requirement",icon:"📋",onClick:()=>{r(),I()}}),(y||I)&&e.jsx(jt,{}),e.jsx(J,{label:"Remove from diagram",icon:"↩️",onClick:()=>{r(),m()}}),e.jsx(J,{label:"Delete from model",icon:"🗑️",danger:!0,onClick:()=>{window.confirm(`Delete ${n} from the model? This cannot be undone.`)&&(r(),F())}})]})}const ar=[{label:"Auto",value:""},{label:"Red",value:"#EF4444"},{label:"Blue",value:"#3B82F6"},{label:"Green",value:"#10B981"},{label:"Orange",value:"#F59E0B"},{label:"Gray",value:"#6B7280"}];function lr({x:t,y:i,edgeId:n,relType:a,onClose:r,onChangeStyle:l,onChangeColor:x,onToggleLabel:m,onDelete:F}){return e.jsxs(Mn,{x:t,y:i,onClose:r,children:[e.jsxs("div",{className:"px-3 py-1.5",style:{borderBottom:"1px solid #E5E5E0"},children:[e.jsx("div",{style:{fontSize:"10px",fontWeight:600,color:"#9CA3AF"},children:a}),e.jsx("div",{style:{fontSize:"9px",color:"#D1D5DB",fontFamily:"monospace"},children:n})]}),e.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[e.jsx("span",{style:{fontSize:"10px",color:"#9CA3AF",minWidth:40},children:"Style"}),["solid","dashed","dotted"].map(y=>e.jsx("button",{onClick:()=>{r(),l(y)},style:{fontSize:"10px",padding:"2px 8px",border:"1px solid #E5E5E0",borderRadius:4,cursor:"pointer",background:"#F7F7F5",color:"#374151"},children:y},y))]}),e.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{style:{fontSize:"10px",color:"#9CA3AF",minWidth:40,flexShrink:0},children:"Color"}),ar.map(y=>e.jsx("button",{onClick:()=>{r(),x(y.value)},title:y.label,style:{width:16,height:16,borderRadius:"50%",background:y.value||"#E5E5E0",border:"1px solid #D1D5DB",cursor:"pointer"}},y.value))]}),e.jsx(jt,{}),e.jsx(J,{label:"Toggle label",icon:"🏷️",onClick:()=>{r(),m()}}),e.jsx(J,{label:"Delete edge",icon:"🗑️",danger:!0,onClick:()=>{r(),F()}})]})}const dr=d.memo(function({id:i,data:n,selected:a}){const r=n,l=r.color??r.layerColor??"#E67E22",x=80,m=d.useCallback(F=>{var y;F.preventDefault(),(y=r.onContextMenu)==null||y.call(r,F,i)},[r,i]);return e.jsxs("div",{style:{width:x,height:x,position:"relative"},onContextMenu:m,children:[a&&e.jsx(kt,{minWidth:60,minHeight:60}),e.jsx("svg",{width:x,height:x,style:{position:"absolute",top:0,left:0},children:e.jsx("polygon",{points:`${x/2},4 ${x-4},${x/2} ${x/2},${x-4} 4,${x/2}`,fill:r.color?r.color+"44":"#FFF8E1",stroke:l,strokeWidth:a?2.5:1.5})}),e.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:600,color:"#374151",textAlign:"center",padding:"4px 8px",pointerEvents:"none"},children:r.condition||r.label||"?"}),e.jsx(C,{type:"target",position:j.Top,style:{background:l,border:"2px solid #fff"}}),e.jsx(C,{type:"source",position:j.Right,style:{background:l,border:"2px solid #fff"},id:"right"}),e.jsx(C,{type:"source",position:j.Bottom,style:{background:l,border:"2px solid #fff"},id:"bottom"}),e.jsx(C,{type:"target",position:j.Left,style:{background:l,border:"2px solid #fff"}})]})}),cr=d.memo(function({id:i,data:n,selected:a}){const r=n,l=(r.orientation??"horizontal")==="horizontal",x=l?120:8,m=l?8:60,F=d.useCallback(y=>{var I;y.preventDefault(),(I=r.onContextMenu)==null||I.call(r,y,i)},[r,i]);return e.jsxs("div",{style:{width:x,height:m,background:"#1a1a1a",borderRadius:4,position:"relative"},title:r.nodeType==="join"?"Join (synchronization)":"Fork (parallel)",onContextMenu:F,children:[a&&e.jsx(kt,{minWidth:40,minHeight:6}),l?e.jsxs(e.Fragment,{children:[e.jsx(C,{type:"target",position:j.Left,style:{background:"#2DD4A8",border:"2px solid #fff",left:-1}}),e.jsx(C,{type:"source",position:j.Top,style:{background:"#2DD4A8",border:"2px solid #fff",top:-1},id:"top"}),e.jsx(C,{type:"source",position:j.Bottom,style:{background:"#2DD4A8",border:"2px solid #fff",bottom:-1},id:"bottom"}),e.jsx(C,{type:"source",position:j.Right,style:{background:"#2DD4A8",border:"2px solid #fff",right:-1},id:"right"})]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{type:"target",position:j.Top,style:{background:"#2DD4A8",border:"2px solid #fff",top:-1}}),e.jsx(C,{type:"source",position:j.Left,style:{background:"#2DD4A8",border:"2px solid #fff",left:-1},id:"left"}),e.jsx(C,{type:"source",position:j.Right,style:{background:"#2DD4A8",border:"2px solid #fff",right:-1},id:"right"}),e.jsx(C,{type:"source",position:j.Bottom,style:{background:"#2DD4A8",border:"2px solid #fff",bottom:-1},id:"bottom"})]})]})}),pr=d.memo(function({id:i,data:n}){const a=n,r=a.nodeType==="start",l=32,x=d.useCallback(m=>{var F;m.preventDefault(),(F=a.onContextMenu)==null||F.call(a,m,i)},[a,i]);return e.jsxs("div",{style:{width:l,height:l,position:"relative"},onContextMenu:x,children:[e.jsx("svg",{width:l,height:l,children:r?e.jsx("circle",{cx:l/2,cy:l/2,r:l/2-2,fill:"#1a1a1a"}):e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:l/2,cy:l/2,r:l/2-2,fill:"#1a1a1a"}),e.jsx("circle",{cx:l/2,cy:l/2,r:l/2-6,fill:"#FFFFFF"}),e.jsx("circle",{cx:l/2,cy:l/2,r:l/2-10,fill:"#1a1a1a"})]})}),r?e.jsx(C,{type:"source",position:j.Bottom,style:{background:"#1a1a1a",border:"2px solid #fff"}}):e.jsx(C,{type:"target",position:j.Top,style:{background:"#1a1a1a",border:"2px solid #fff"}})]})}),ur="#ECEBE6",St="#1B3A4B",ro="#5B6470",xr="0 1px 2px rgba(0,0,0,0.16), 0 0 0 0.5px rgba(0,0,0,0.05)",ye=(t,i)=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"},children:i}),H={arrowRight:({size:t=16})=>ye(t,e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M4 12h14"}),e.jsx("path",{d:"M13 6l6 6-6 6"})]})),arrowDown:({size:t=16})=>ye(t,e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M12 4v14"}),e.jsx("path",{d:"M6 13l6 6 6-6"})]})),lanes:({size:t=16})=>ye(t,e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3",y:"5",width:"18",height:"3.4",rx:"1.3"}),e.jsx("rect",{x:"3",y:"10.3",width:"18",height:"3.4",rx:"1.3"}),e.jsx("rect",{x:"3",y:"15.6",width:"18",height:"3.4",rx:"1.3"})]})),grid:({size:t=16})=>ye(t,e.jsxs(e.Fragment,{children:[e.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"2.5"}),e.jsx("path",{d:"M9.2 3.5v17M14.8 3.5v17M3.5 9.2h17M3.5 14.8h17"})]})),expand:({size:t=16})=>ye(t,e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M15 4h5v5"}),e.jsx("path",{d:"M9 20H4v-5"}),e.jsx("path",{d:"M20 4l-7 7"}),e.jsx("path",{d:"M4 20l7-7"})]})),collapse:({size:t=16})=>ye(t,e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M14 10h5"}),e.jsx("path",{d:"M19 10V5"}),e.jsx("path",{d:"M10 14H5"}),e.jsx("path",{d:"M5 14v5"}),e.jsx("path",{d:"M20 4l-6 6"}),e.jsx("path",{d:"M4 20l6-6"})]})),filter:({size:t=16})=>ye(t,e.jsx("path",{d:"M4 5h16l-6.2 7.4V19l-3.6 1.8v-8.4z"})),back:({size:t=16})=>ye(t,e.jsxs(e.Fragment,{children:[e.jsx("path",{d:"M11 5l-6 7 6 7"}),e.jsx("path",{d:"M5 12h14"})]}))};function ce(){return e.jsx("span",{"aria-hidden":"true",style:{width:1,height:18,background:"#E2E1DB",margin:"0 3px",borderRadius:1}})}function qt({options:t,value:i,onChange:n}){return e.jsx("div",{role:"tablist",style:{display:"inline-flex",alignItems:"center",gap:2,padding:2,background:ur,borderRadius:9},children:t.map(a=>{const r=a.value===i;return e.jsxs("button",{role:"tab","aria-selected":r,onClick:()=>n(a.value),title:a.title,className:"flex items-center gap-1.5 text-xs font-semibold",style:{padding:a.label?"3px 9px":"4px 7px",borderRadius:7,border:"none",cursor:"pointer",color:r?St:ro,background:r?"#FFFFFF":"transparent",boxShadow:r?xr:"none",transition:"background 140ms ease, color 140ms ease, box-shadow 140ms ease"},children:[a.icon,a.label&&e.jsx("span",{children:a.label})]},a.value)})})}function hr({children:t}){return e.jsx("div",{style:{display:"inline-flex",alignItems:"center",background:"#FFFFFF",border:"1px solid #E2E1DB",borderRadius:9,overflow:"hidden"},children:rn.Children.toArray(t).map((i,n)=>e.jsxs(rn.Fragment,{children:[n>0&&e.jsx("span",{"aria-hidden":"true",style:{width:1,alignSelf:"stretch",background:"#EDECE7"}}),i]},n))})}function oe({icon:t,label:i,onClick:n,active:a=!1,title:r,ariaExpanded:l,ariaLabel:x}){return e.jsxs("button",{onClick:n,title:r,"aria-label":x,"aria-pressed":a,"aria-expanded":l,className:"flex items-center gap-1.5 text-xs font-semibold",style:{padding:i?"5px 9px":"5px 7px",border:"none",cursor:"pointer",color:a?"#FFFFFF":ro,background:a?St:"transparent",transition:"background 140ms ease, color 140ms ease"},children:[t,i&&e.jsx("span",{children:i})]})}function Ye({icon:t,label:i,onClick:n,active:a=!1,title:r,badge:l}){return e.jsxs("button",{onClick:n,title:r,"aria-pressed":a,className:"flex items-center gap-1.5 text-xs font-semibold",style:{padding:l!=null||i!=null?"5px 9px":"5px 7px",borderRadius:9,border:`1px solid ${a?St:"#E2E1DB"}`,cursor:"pointer",color:a?"#FFFFFF":ro,background:a?St:"#FFFFFF",transition:"background 140ms ease, color 140ms ease, border-color 140ms ease"},children:[t,i!=null&&e.jsx("span",{children:i}),l!=null&&e.jsx("span",{style:{fontSize:11,fontWeight:700,lineHeight:1,padding:"2px 5px",borderRadius:6,background:a?"rgba(255,255,255,0.22)":"#F0EFEA",color:a?"#FFFFFF":"#6B7280"},children:l})]})}const jn="memo-layout-progress";if(typeof document<"u"&&!document.getElementById(jn)){const t=document.createElement("style");t.id=jn,t.textContent="@keyframes memo-layout-progress { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }",document.head.appendChild(t)}const gr={background:"#F7F7F5"},fr={padding:.08,maxZoom:2},mr={background:"#FFFFFF"},yr={hideAttribution:!0},br=[20,20],Fr=50,vn=8e3,wr=90;function jr(t,i){return new Promise((n,a)=>{const r=window.setTimeout(()=>a(new Error(`${i} layout exceeded ${vn/1e3}s`)),vn);t.then(l=>{window.clearTimeout(r),n(l)},l=>{window.clearTimeout(r),a(l)})})}function Sn(t,i){const n=new Map(t.map(p=>[p.id,p])),a=new Map,r=p=>{const b=a.get(p);if(b)return b;const v=n.get(p),f=v.parentId?r(v.parentId):{x:0,y:0},k={x:f.x+v.position.x,y:f.y+v.position.y};return a.set(p,k),k},l=p=>{var b,v;return{width:Number(p.width??((b=p.style)==null?void 0:b.width)??0),height:Number(p.height??((v=p.style)==null?void 0:v.height)??0)}},x=i.flatMap(p=>{var D,O,M,A,K,Q;const b=(_,z,re)=>{var w,pe;if(typeof z=="string"){const ee=(((pe=(w=n.get(_))==null?void 0:w.data)==null?void 0:pe.ports)??[]).find(U=>U.id===z);if(ee){const U=ee.size??20;return{x:ee.x+U/2,y:ee.y+U/2}}}return re},v=b(p.source,(D=p.data)==null?void 0:D.sourcePortId,(O=p.data)==null?void 0:O.sourceOffset),f=b(p.target,(M=p.data)==null?void 0:M.targetPortId,(A=p.data)==null?void 0:A.targetOffset);if(!v||!f||!n.has(p.source)||!n.has(p.target))return[];const k=r(p.source),E=r(p.target);return[{id:p.id,source:{x:k.x+v.x,y:k.y+v.y},target:{x:E.x+f.x,y:E.y+f.y},sourceNodeId:p.source,targetNodeId:p.target,sourceSide:(K=p.data)==null?void 0:K.sourceSide,targetSide:(Q=p.data)==null?void 0:Q.targetSide}]});if(x.length===0)return i;const m=t.filter(p=>!p.data.isFrame).map(p=>({id:p.id,...r(p.id),...l(p)})),F=new Map(x.map(p=>[p.id,p])),y=x.filter(p=>{var b,v;return!((v=(b=i.find(f=>f.id===p.id))==null?void 0:b.data)!=null&&v.manualRoute)}),I=fi(y,m);return i.map(p=>{var v;const b=F.get(p.id);if(!b)return p;if((v=p.data)!=null&&v.manualRoute){const f=[...p.data.points??[]];if(f.length>=2)return f[0]=b.source,f[f.length-1]=b.target,{...p,data:{...p.data,points:f}}}return I.has(p.id)?{...p,data:{...p.data,points:I.get(p.id)}}:p})}function vr({x:t,y:i,onConfirm:n,onCancel:a}){const[r,l]=d.useState(""),x=d.useRef(null);d.useEffect(()=>{var y;(y=x.current)==null||y.focus()},[]),d.useEffect(()=>{const y=I=>{const p=document.getElementById("quick-create-popup");p&&!p.contains(I.target)&&a()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[a]);const m=Math.min(t,window.innerWidth-220),F=Math.min(i,window.innerHeight-80);return e.jsxs("div",{id:"quick-create-popup",className:"fixed z-50 rounded-xl shadow-xl overflow-hidden",style:{left:m,top:F,width:200,background:"#FFFFFF",border:"1px solid #E5E5E0",boxShadow:"0 8px 32px rgba(0,0,0,0.14)"},children:[e.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid #E5E5E0",fontSize:N.xs,color:"#9CA3AF",fontWeight:600},children:"New Element"}),e.jsxs("div",{className:"px-2 py-2",children:[e.jsx("input",{ref:x,value:r,onChange:y=>l(y.target.value),placeholder:"Element name…",className:"w-full px-2 py-1.5 rounded focus:outline-none",style:{fontSize:N.xs,border:"1px solid #E5E5E0",background:"#F7F7F5",color:"#1a1a1a"},onKeyDown:y=>{y.key==="Enter"&&r.trim()&&(y.preventDefault(),n(r.trim())),y.key==="Escape"&&a()}}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("button",{onClick:()=>r.trim()&&n(r.trim()),style:{flex:1,fontSize:N.xs,padding:"4px 8px",background:"#2DD4A8",color:"#FFFFFF",border:"none",borderRadius:6,cursor:"pointer",fontWeight:600},children:"Create"}),e.jsx("button",{onClick:a,style:{fontSize:N.xs,padding:"4px 8px",background:"#F7F7F5",color:"#6B7280",border:"1px solid #E5E5E0",borderRadius:6,cursor:"pointer"},children:"Cancel"})]})]})]})}function Zt({color:t,glyph:i}){return e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:13,height:13,borderRadius:2,background:t+"22",border:`1.5px solid ${t}`,color:t,fontSize:9,fontWeight:800,lineHeight:1},children:i})}function kn(t,i){if(!t||!i)return[];const n=new Map;for(const x of t.relationships)eo.has(x.type)&&!n.has(x.targetId)&&n.set(x.targetId,x.sourceId);const a=[i],r=new Set(a);let l=i;for(;n.has(l);){const x=n.get(l);if(r.has(x))break;a.unshift(x),r.add(x),l=x}return a}function Qt({path:t,nameOf:i,onFocus:n,rootLabel:a}){if(t.length===0)return null;const r=t.length>1?t[t.length-2]:null;return e.jsxs(e.Fragment,{children:[e.jsx(ce,{}),e.jsx(Ye,{icon:e.jsx(H.back,{}),label:"Parent",onClick:()=>n(r),title:r?`Back to ${i(r)}`:a}),e.jsx("button",{onClick:()=>n(null),className:"px-1.5 py-0.5 text-xs font-medium rounded",style:{background:"#F7F7F5",color:"#2563EB",border:"1px solid #E5E5E0"},title:a,children:"⌂ All"}),t.map((l,x)=>{const m=x===t.length-1;return e.jsxs("span",{className:"flex items-center gap-1",style:{color:"#9CA3AF"},children:[e.jsx("span",{children:"›"}),e.jsx("button",{onClick:()=>n(l),disabled:m,className:"text-xs font-medium",style:{color:m?"#1a1a1a":"#2563EB",fontWeight:m?700:500,cursor:m?"default":"pointer"},title:m?void 0:`Focus ${i(l)}`,children:i(l)})]},l)})]})}function Sr(){var Yo,Uo,Xo,Go,qo,Zo,Qo,Jo,en;const t=L(o=>o.model),i=L(o=>o.createRelationship),n=d.useMemo(()=>Os(t),[t]),a=L(o=>o.selectedElementId),r=L(o=>o.selectedViewpointId),l=L(o=>o.selectedDiagramId),x=L(o=>o.hiddenLayers),m=L(o=>o.selectElement),F=L(o=>o.inspectElement),y=L(o=>o.inspectRelationship),I=L(o=>o.setActiveMode),p=L(o=>o.setActiveView),b=L(o=>o.setExplorerTab),v=L(o=>o.availableOntologies),f=L(o=>o.setSelectedOntologyKind),k=L(o=>o.diagramLayouts),E=L(o=>o.setNodeLayout),D=L(o=>o.mergeDiagramLayouts),O=L(o=>o.updateDiagramElementIds),{fitView:M,screenToFlowPosition:A,getViewport:K,setViewport:Q}=oo(),[_,z]=Ds([]),[re,w,pe]=Ns([]),ee=d.useRef([]),U=d.useRef([]),qe=d.useRef(t),Ze=d.useRef(l),be=d.useRef(null),ke=d.useRef(null),Ee=d.useRef(null),ne=d.useRef(0);d.useEffect(()=>{ee.current=_},[_]),d.useEffect(()=>{U.current=re},[re]);const ue=d.useCallback(o=>{ee.current=o,ke.current===null&&(ke.current=requestAnimationFrame(()=>{ke.current=null;const s=ee.current,c=Sn(s,U.current);U.current=c,z(s),w(c)}))},[z,w]),[G,se]=d.useState(!1),[ao,Ce]=d.useState(0),[lo,co]=d.useState(null),[po,Ln]=d.useState(0),[zn,Et]=d.useState(0),[Ne,Ct]=d.useState(!0),[$n,uo]=d.useState(!0),[xo,Wn]=d.useState(!0),[It,On]=d.useState("horizontal"),[Qe,ho]=d.useState("allocation"),[Dt,go]=d.useState("all"),[fo,Pn]=d.useState(!1),[ge,_n]=d.useState(new Set(["control","data","energy","material"])),[te,Ae]=d.useState(null),[fe,Je]=d.useState(null),[q,Re]=d.useState(null),[xe,et]=d.useState(null),[Te,mo]=d.useState(null),[tt,Hn]=d.useState(2),[ot,yo]=d.useState(null),Be=d.useRef([]),Nt=d.useRef([]),bo=d.useCallback(o=>{Be.current.push(o),Be.current.length>Fr&&Be.current.shift(),Nt.current=[]},[]),u=Ps(t,l),Me=u?an[u.diagramType]:null,nt=!!((Yo=u==null?void 0:u.properties)!=null&&Yo.layoutStyle),Fe=((Uo=u==null?void 0:u.properties)==null?void 0:Uo.layoutStyle)==="fbs",we=l?k[l]:void 0,je=oi(we),he=((Xo=we==null?void 0:we.canvas)==null?void 0:Xo.autoLayout)!==!1,me=((Go=we==null?void 0:we.canvas)==null?void 0:Go.flowAnimation)===!0,ae=d.useCallback(()=>{var s;if(!l)return;const o=L.getState().diagramLayouts[l]??{nodes:{},edges:{}};((s=o.canvas)==null?void 0:s.autoLayout)!==!1&&D({[l]:{...o,canvas:{...o.canvas,autoLayout:!1}}})},[l,D]);d.useEffect(()=>{if(!l||he||G||_.length===0||ao===0)return;const o=window.setTimeout(()=>{const s=L.getState().diagramLayouts[l]??{nodes:{},edges:{}},c=K(),h={nodes:Object.fromEntries(_.map(g=>[g.id,{...s.nodes[g.id]??{},x:g.position.x,y:g.position.y,...g.width?{width:g.width}:{},...g.height?{height:g.height}:{},ports:Object.fromEntries((g.data.ports??[]).map(S=>[S.id,{x:S.x,y:S.y,side:S.side}]))}])),edges:Object.fromEntries(re.map(g=>{var S,$,R,W,V,B;return[g.id,{...(()=>{var P;const{points:X,...Y}=((P=s.edges)==null?void 0:P[g.id])??{};return Y})(),...(S=g.data)!=null&&S.manualRoute&&((R=($=g.data)==null?void 0:$.points)!=null&&R.length)?{points:(W=g.data)==null?void 0:W.points,source:g.source,target:g.target,sourcePortId:(V=g.data)==null?void 0:V.sourcePortId,targetPortId:(B=g.data)==null?void 0:B.targetPortId}:{}}]})),canvas:{...s.canvas,zoom:c.zoom,pan:{x:c.x,y:c.y},autoLayout:!1}};D({[l]:h}),Ve(l,h),Ce(0)},350);return()=>window.clearTimeout(o)},[l,he,G,ao,_,re,K,D]);const T=u?u.viewKind??(Me==null?void 0:Me.viewKind)??"general":void 0,ve=T==="interconnection"?.72:.1,Le=T?cn[T]:null,Ie=T==="general"&&!nt&&!Fe,At=(u==null?void 0:u.diagramType)==="ucd",[Se,Fo]=d.useState("graph"),[Rt,wo]=d.useState("all"),[Tt,jo]=d.useState("straight"),[ze,vo]=d.useState(new Set),Kn=d.useMemo(()=>t?ni(t):0,[t]),So=d.useMemo(()=>t?si(t):[],[t]),Bt=(qo=u==null?void 0:u.properties)==null?void 0:qo.modes,Vn=d.useMemo(()=>{if(!Bt)return Yt;const o=new Set(Bt.split(",").map(c=>c.trim())),s=Yt.filter(c=>o.has(c));return s.length?s:Yt},[Bt]),[$e,ko]=d.useState(!0),Eo=d.useMemo(()=>{if(!t||!u)return[];const o=new Set(u.elementIds),s=Object.values(t.elements).filter(c=>o.has(c.id)&&c.allocatedTo).map(c=>c.allocatedTo);return ii(s,t)},[t,u]),Yn=d.useMemo(()=>{if(!t||!u)return"Activity Diagram";const o=_s(u);return an[o].fullName},[t,u]),Un=d.useMemo(()=>{if(!t||!u)return!1;const o=new Set(u.elementIds);return Object.values(t.elements).some(s=>o.has(s.id)&&!!(s.attributes.stage||s.attributes.phase))},[t,u]),st=d.useMemo(()=>{if(!t||!u||T!=="actionflow")return[];const o=(u.elementIds??[]).map(s=>t.elements[s]).filter(s=>!!s&&s.construct==="action");return ri(o,t)},[t,u,T]),[We,Xn]=d.useState("containment"),[Oe,it]=d.useState(new Set),[Co,Pe]=d.useState(new Set),[rt,Mt]=d.useState(null),[_e,Io]=d.useState("all"),[Do,No]=d.useState(!1),[Ao,He]=d.useState(new Set),[De,Lt]=d.useState(null),[zt,Ro]=d.useState("flat"),[To,Ke]=d.useState(new Set),[at,$t]=d.useState(null),[lt,Gn]=d.useState(new Map),le=d.useRef(new Map),qn=d.useMemo(()=>kn(t,rt),[t,rt]),Zn=d.useMemo(()=>kn(t,at),[t,at]),Qn=d.useMemo(()=>{var h;if(!t||!De)return[];const o=[De],s=new Set(o);let c=De;for(;c;){const g=(h=t.elements[c])==null?void 0:h.parentAction;if(!g||s.has(g)||!t.elements[g])break;o.unshift(g),s.add(g),c=g}return o},[t,De]),dt=d.useMemo(()=>{if(!t||T!=="statetransition")return[];const o=new Set;for(const s of t.relationships){if(!eo.has(s.type))continue;const c=t.elements[s.sourceId];!c||!t.elements[s.targetId]||!ai(c)||c.kind.endsWith("Machine")||o.add(c.id)}return[...o]},[t,T]),ct=d.useMemo(()=>t?[...new Set(t.relationships.filter(o=>["composes","composedof","aggregation","decomposedby"].includes(o.type.toLowerCase())).map(o=>o.sourceId))]:[],[t]);d.useEffect(()=>{var s,c;Ce(0),Fo(li(u==null?void 0:u.properties)),wo(Ut(u==null?void 0:u.properties).level??"all"),jo(Ut(u==null?void 0:u.properties).edgeStyle??"straight"),vo(new Set),ko(!0),ho("allocation"),go("all");const o=(c=(s=u==null?void 0:u.properties)==null?void 0:s.styleHint)!=null&&c.startsWith("expanded:")?u.properties.styleHint.slice(9).split(",").map(h=>h.trim()).filter(Boolean):[];it(new Set(o)),Mt(null),Io("all"),No(!1),He(new Set),Lt(null),Ro("flat"),$t(null),le.current.clear()},[l,(Zo=u==null?void 0:u.properties)==null?void 0:Zo.layoutHint,(Qo=u==null?void 0:u.properties)==null?void 0:Qo.styleHint]);const Bo=d.useRef(null);d.useEffect(()=>{if(!t)return;const o=`${l??""}|${T??""}`;if(Bo.current!==o){if(T==="statetransition"){if(dt.length===0)return;Ke(new Set(dt))}else if(T==="interconnection"){if(ct.length===0)return;Pe(new Set(ct))}Bo.current=o}},[t,l,T,dt,ct]);const Jn=d.useMemo(()=>({decompositionNode:ki,interconnectionNode:Ai,actionFlowNode:Wi,actionFlowLane:Pi,stateNode:Hi,seqLifeline:Vi,seqSection:Ui,seqOccurrence:Gi,useCase:qi,useCaseActor:Zi,useCaseBoundary:Qi,contextSystem:tr,contextExternal:or,contextBoundary:nr,diagramNode:sr,decisionNode:dr,forkNode:cr,startEndNode:pr}),[]),es=d.useMemo(()=>({interconnectionEdge:Li,useCaseEdge:er}),[]),ts=d.useCallback(o=>{var s,c;return((s=o.data)==null?void 0:s.color)||((c=o.data)==null?void 0:c.layerColor)||"#ccc"},[]),Z=d.useMemo(()=>{const o=(u==null?void 0:u.viewpointId)==="__model"?null:(u==null?void 0:u.viewpointId)||r,s=o&&(t==null?void 0:t.viewpoints),c=x.size>0,h=u!=null&&u.elementIds?new Set(u.elementIds):void 0;if(!s&&!c&&!h)return;const g=s?t.viewpoints.find(R=>R.id===o):void 0,S=g?new Set(g.visibleKinds):void 0,$=g?new Set(g.visibleLayers):void 0;return R=>x.has(R.layer)?!1:h?h.has(R.id):S&&$?S.has(R.kind)||$.has(R.layer):!0},[r,u,t==null?void 0:t.viewpoints,x]),pt=d.useMemo(()=>{if(!t||!u||u.diagramType!=="bdd")return null;const o=u.relationshipTypes??[];return o.length===0||o.every(c=>eo.has(c.charAt(0).toLowerCase()+c.slice(1)))?di(un(t,Z,u.relationshipTypes)):null},[t,u,Z]),Mo=d.useCallback(()=>{if(t)return Fe?ci(t):Ie?un(t,Z,u==null?void 0:u.relationshipTypes):pi(t)},[t,Fe,Ie,Z,u==null?void 0:u.relationshipTypes]),Wt=d.useCallback(o=>{it(s=>{const c=new Set(s);return c.has(o)?c.delete(o):c.add(o),c})},[]),Lo=d.useCallback(o=>{Pe(s=>{const c=new Set(s);return c.has(o)?c.delete(o):c.add(o),c})},[]),zo=d.useCallback(o=>{He(s=>{const c=new Set(s);return c.has(o)?c.delete(o):c.add(o),c})},[]),ut=d.useCallback(o=>{$t(o),Ke(new Set),F(null)},[F]),xt=d.useCallback(o=>{Lt(o),He(new Set),F(null)},[F]),$o=d.useCallback(o=>{Ke(s=>{const c=new Set(s);return c.has(o)?c.delete(o):c.add(o),c})},[]),Wo=d.useCallback(o=>{le.current.clear(),Gn(s=>{const c=new Map(s),h=c.get(o)||"vertical";return c.set(o,h==="vertical"?"horizontal":"vertical"),c})},[]),Ot=d.useCallback(()=>{const o=Mo();if(!o)return;const s=new Set,c=h=>{s.add(h);for(const g of o.childrenMap.get(h)||[])o.elements.has(g)&&c(g)};for(const h of o.roots)o.elements.has(h)&&c(h);it(s)},[Mo]),Pt=d.useCallback(()=>it(new Set),[]),_t=d.useCallback(()=>{le.current.clear(),Et(o=>o+1)},[]),os=d.useCallback(()=>{if(!l)return;const o=L.getState().diagramLayouts[l]??{},{pan:s,zoom:c,...h}=o.canvas??{},g={nodes:{},edges:{},canvas:{...h,autoLayout:!0}};be.current=null,D({[l]:g}),Ve(l,g),le.current.clear(),Et(S=>S+1),window.setTimeout(()=>M({padding:.08,minZoom:ve,maxZoom:2,duration:300}),250)},[l,D,M,ve]),Oo=d.useCallback(o=>o.map(s=>{if(s.type!=="diagramNode")return s;const c=t==null?void 0:t.elements[s.id];return{...s,data:{...s.data,onContextMenu:(h,g)=>{Re({x:h.clientX,y:h.clientY,nodeId:g,nodeKind:s.data.kind??""})},onInlineEdit:(h,g)=>{if(!c)return;const S={...c,name:g};ln(S)}}}}),[t]),Po=d.useCallback((o,s)=>{const c=o.map(g=>{const S=s.nodes[g.id];return S?{...g,position:{x:S.x,y:S.y},...S.width?{width:S.width}:{},...S.height?{height:S.height}:{},data:{...g.data,bgColor:S.color||void 0,...S.ports?{ports:(g.data.ports??[]).map($=>{var R;return{...$,...((R=S.ports)==null?void 0:R[$.id])??{}}})}:{}}}:g}),h=new Map(c.map(g=>[g.id,g]));return c.map(g=>{if(g.type!=="actionFlowLane")return g;const S=g.data,$=(S.memberIds??[]).map(Y=>h.get(Y)).filter(Boolean);if($.length===0)return g;const R=Math.min(...$.map(Y=>Y.position.x)),W=Math.min(...$.map(Y=>Y.position.y)),V=Math.max(...$.map(Y=>{var P;return Y.position.x+Number(Y.width??((P=Y.style)==null?void 0:P.width)??180)})),B=Math.max(...$.map(Y=>{var P;return Y.position.y+Number(Y.height??((P=Y.style)==null?void 0:P.height)??96)})),X=S.orientation==="column";return{...g,position:{x:X?R-36:R-120,y:X?W-32:W-36},style:{...g.style,width:V-R+(X?72:156),height:B-W+(X?68:72)}}})},[]),_o=d.useCallback((o,s,c)=>{ne.current=Date.now()+250,ae(),Ce(S=>S+1);const h=U.current.map(S=>{var B,X;if(!(((B=S.data)==null?void 0:B.sourcePortId)===s||((X=S.data)==null?void 0:X.targetPortId)===s))return S;const{points:R,manualRoute:W,...V}=S.data??{};return{...S,data:V}});U.current=h;const g=ee.current.map(S=>S.id!==o?S:{...S,data:{...S.data,ports:(S.data.ports??[]).map($=>$.id===s?{...$,y:c}:$)}});ue(g)},[ue,ae]),Ho=d.useCallback((o,s)=>{ne.current=Date.now()+250,ae(),Ce(c=>c+1),w(c=>{const h=c.map(g=>g.id===o?{...g,data:{...g.data,points:s,manualRoute:!0}}:g);return U.current=h,h})},[ae,w]);d.useEffect(()=>{if(!t)return;const o=qe.current!==t&&Ze.current===l;if(be.current=o?K():null,qe.current=t,Ze.current=l,T==="grid"||T==="browser"||T==="geometry")return;let s=!1;const c=({nodes:R,edges:W},V=!0)=>{if(s)return;const B=l?L.getState().diagramLayouts[l]:void 0,X=B&&Object.keys(B.nodes).length>0?Po(R,B):R,Y=W.map(P=>{var tn,on,nn;const de=(tn=B==null?void 0:B.edges)==null?void 0:tn[P.id],ht=!(de!=null&&de.source)||de.source===P.source&&de.target===P.target&&de.sourcePortId===((on=P.data)==null?void 0:on.sourcePortId)&&de.targetPortId===((nn=P.data)==null?void 0:nn.targetPortId)?de==null?void 0:de.points:void 0;return{...P,data:{...P.data,...ht!=null&&ht.length?{points:ht,manualRoute:!0}:{},flowAnimation:me,onRouteChange:Ht=>Ho(P.id,Ht),onSelect:Ht=>{Ht.stopPropagation(),!(Date.now()<ne.current)&&(w(Kt=>Kt.map(sn=>({...sn,selected:sn.id===P.id}))),t.relationships.some(Kt=>Kt.id===P.id)&&y(P.id))}}}});z(V?Oo(X):X),w(Sn(X,Y)),se(!1),Ln(P=>P+1)},h=R=>W=>{s||(console.error(`${R} layout error:`,W),se(!1),co(`${R} layout could not be completed. Try resetting the layout or reducing the visible hierarchy.`))},g=(R,W,V=!0)=>{se(!0),co(null),jr(W,R).then(B=>c(B,V)).catch(h(R))},S=()=>{const R=An.select({viewKind:T,diagramType:u==null?void 0:u.diagramType,isFBSDiagram:Fe,isDecompDiagram:nt,isGeneralTemplate:Ie,generalMode:Se,layoutStyle:We}),W={onToggleExpand:Wt,onToggleDirection:Wo},V={fbs:{expandedNodes:Oe,nodeDirections:lt,callbacks:W,layoutProviderId:je},decomposition:{expandedNodes:Oe,nodeDirections:lt,callbacks:W,positionCache:le.current},containment:{expandedNodes:Oe,callbacks:{onToggleExpand:Wt}},useCase:{viewpointFilter:void 0,systemName:u==null?void 0:u.name,...u?Ut(u.properties):{},level:Rt,edgeStyle:Tt,hiddenActorIds:ze},context:{systemName:u==null?void 0:u.name,viewpointFilter:Z,relationshipTypes:u==null?void 0:u.relationshipTypes},interconnection:{viewpointFilter:Z,relationshipTypes:u==null?void 0:u.relationshipTypes,collapsedNodes:Co,onToggleCollapse:Lo,focusId:rt??void 0,portDisplay:_e,onPortMove:_o,layoutProviderId:je},actionflow:{viewpointFilter:Z,swimlanes:$e,laneGrouping:Qe,displayLevel:Dt,expandedActionIds:Ao,onToggleAction:zo,onDrillInAction:xt,focusActionId:De??void 0,visibleFlowKinds:ge,direction:It,nesting:zt,layoutProviderId:je},statetransition:{viewpointFilter:Z,collapsedStateIds:To,onToggleCollapse:$o,onDrillIn:ut,focusStateId:at??void 0,layoutProviderId:je},sequence:{viewpointFilter:Z},general:{mode:Se,viewpointFilter:Z,expandedNodes:Oe,nodeDirections:lt,callbacks:W,positionCache:le.current,hierarchyRelationshipTypes:u==null?void 0:u.relationshipTypes,layoutProviderId:je},standard:{viewpointFilter:Z,relationshipTypes:u==null?void 0:u.relationshipTypes,compartments:Ie,layoutProviderId:je}},B=R.compute(t,V);B instanceof Promise?g(R.descriptor.label,B,R.descriptor.interactive):c(B,R.descriptor.interactive)},$=window.setTimeout(S,wr);return()=>{s=!0,window.clearTimeout($)}},[t,Z,nt,Fe,We,T,Ie,Se,$e,zn,u==null?void 0:u.relationshipTypes,u==null?void 0:u.diagramType,u==null?void 0:u.name,Rt,Tt,ze,je,Oe,Co,rt,_e,Ao,De,ge,It,Qe,Dt,zt,lt,To,at,$o,ut,xt,Wt,Lo,zo,Wo,l,Po,Oo,_o,Ho,y,K]),d.useEffect(()=>{if(po===0)return;const o=setTimeout(()=>{var h;const s=be.current;if(be.current=null,s){Q(s);return}const c=l?(h=L.getState().diagramLayouts[l])==null?void 0:h.canvas:void 0;(c==null?void 0:c.zoom)!==void 0&&c.pan?Q({x:c.pan.x,y:c.pan.y,zoom:c.zoom},{duration:300}):M({padding:.08,minZoom:ve,maxZoom:2,duration:500})},200);return()=>clearTimeout(o)},[po,l,M,ve,Q]),d.useEffect(()=>{z(o=>o.map(s=>{const c=s.type==="actionFlowLane"?s.data.inspectElementId:void 0,h=!!a&&(s.id===a||c===a);return{...s,selected:h,style:{...s.style,boxShadow:h?"0 0 0 2px #2DD4A8, 0 4px 12px rgba(45, 212, 168, 0.3)":void 0,opacity:a?h?1:.5:1}}}))},[a,z]),d.useEffect(()=>{if(!Te||!t)return;const o=mi(t,Te,"both",tt),s=new Set(o.nodes.map(c=>c.elementId));s.add(Te),z(c=>c.map(h=>({...h,style:{...h.style,opacity:s.has(h.id)?1:.08,pointerEvents:s.has(h.id)?"all":"none"}}))),w(c=>c.map(h=>({...h,style:{...h.style,opacity:s.has(h.source)&&s.has(h.target)?1:.05}})))},[Te,tt,t,z,w]),d.useEffect(()=>{if(!ot)return;const o=setTimeout(()=>yo(null),2500);return()=>clearTimeout(o)},[ot]),d.useEffect(()=>{const o=s=>{const c=s.target;if(!(c.tagName==="INPUT"||c.tagName==="TEXTAREA")){if((s.metaKey||s.ctrlKey)&&s.key==="z"&&!s.shiftKey){s.preventDefault();const h=Be.current.pop();h&&(h.undo(),Nt.current.push(h))}if((s.metaKey||s.ctrlKey)&&(s.key==="Z"||s.key==="z"&&s.shiftKey)){s.preventDefault();const h=Nt.current.pop();h&&(h.do(),Be.current.push(h))}s.key==="g"&&(s.metaKey||s.ctrlKey)&&s.shiftKey&&(s.preventDefault(),uo(h=>!h)),s.key==="0"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),M({padding:.08,minZoom:ve,maxZoom:2,duration:400}))}};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[M,ve]);const ns=d.useCallback(o=>{o.preventDefault(),o.dataTransfer.dropEffect="copy"},[]),ss=d.useCallback(o=>{o.preventDefault();const s=o.dataTransfer.getData("application/memo-kind");if(s)try{const c=JSON.parse(s),h=A({x:o.clientX,y:o.clientY});Ae({x:o.clientX,y:o.clientY,flowX:h.x,flowY:h.y,kind:c.kind,layer:c.layer,construct:c.construct})}catch{}},[A]),is=d.useCallback(o=>{const s=A({x:o.clientX,y:o.clientY});Ae({x:o.clientX,y:o.clientY,flowX:s.x,flowY:s.y})},[A]),rs=d.useCallback(o=>{if(!te||!l){Ae(null);return}const s=te.kind??"Part",c=te.layer??"logical",h=te.construct??"part",g=In[c]??"#6B7280",S=`_new_${Date.now()}`,$={id:S,type:"diagramNode",position:{x:te.flowX,y:te.flowY},data:{label:o,kind:s,layer:c,construct:h,color:g,isNew:!0,onContextMenu:(B,X)=>{Re({x:B.clientX,y:B.clientY,nodeId:X,nodeKind:s})},onInlineEdit:(B,X)=>{ln({id:S,name:X,kind:s,construct:h,layer:c})}}};z(B=>[...B,$]),Hs({name:o,kind:s,construct:h,attributes:{_layer:c}});const R=(u==null?void 0:u.elementIds)??[];O(l,[...R,S]);const W=l,V={nodes:{...(k[W]??{}).nodes??{},[S]:{x:te.flowX,y:te.flowY}},edges:(k[W]??{}).edges??{}};D({[W]:V}),Ve(W,V),Ae(null)},[te,l,u,k,D,O,z]),as=d.useCallback(()=>{Re(null),et(null)},[]),ls=d.useCallback((o,s)=>{s!=null&&s.isValid},[]),ds=d.useCallback(o=>{const{source:s,target:c}=o;if(!s||!c)return;const h=t==null?void 0:t.elements[s],g=t==null?void 0:t.elements[c];!h||!g||Je({x:window.innerWidth/2-130,y:window.innerHeight/2-160,sourceElement:h,targetElement:g})},[t]),cs=d.useCallback(async o=>{if(!fe||!l){Je(null);return}const s=fe.sourceElement.id;Je(null);const c=await i({type:o.type,sourceId:o.sourceId,targetId:o.targetId,direction:o.direction,selectedElementId:s,diagramId:l});if(!c.success){console.warn(`[MEMO] Relationship rejected: ${c.error}`);return}const h=dn[o.type]??"#6B7280",g={id:c.relationshipId??`e_${o.sourceId}_${o.targetId}_${o.type}`,source:o.sourceId,target:o.targetId,label:o.type,type:"default",style:{stroke:h,strokeWidth:2},labelStyle:{fontSize:"10px",fill:"#374151"},labelBgStyle:{fill:"#FFFFFF",fillOpacity:.9},labelBgPadding:[4,2],labelBgBorderRadius:4,markerEnd:{type:"arrowclosed",color:h}};w(S=>As(g,S))},[fe,l,w,i]),ps=d.useCallback((o,s)=>{Ee.current={id:s.id,x:s.position.x,y:s.position.y}},[]),us=d.useCallback((o,s)=>{const c=Ee.current;if(Ee.current=null,!((c==null?void 0:c.id)===s.id&&Math.hypot(s.position.x-c.x,s.position.y-c.y)>2)||(ne.current=Date.now()+250,Ce(R=>R+1),!l))return;ae();const{x:g,y:S}=s.position,$=le.current.get(s.id);if(le.current.set(s.id,{x:g,y:S}),E(l,s.id,{x:g,y:S}),$){const R=s.id,W=l;bo({do:()=>E(W,R,{x:g,y:S}),undo:()=>{E(W,R,$),z(V=>V.map(B=>B.id===R?{...B,position:$}:B))}})}},[l,E,bo,z,ae]),xs=d.useCallback(o=>{o.some(s=>s.type==="position"&&s.dragging)&&ae(),o.some(s=>s.type==="dimensions"&&s.resizing)&&(ae(),Ce(s=>s+1)),ue(Rs(o,ee.current))},[ue,ae]),hs=d.useCallback((o,s)=>{},[]),gs=d.useCallback((o,s)=>{o.preventDefault(),et({x:o.clientX,y:o.clientY,edgeId:s.id,relType:String(s.label??"edge")})},[]),fs=d.useCallback((o,s)=>{if(Date.now()<ne.current)return;const c=s.type==="actionFlowLane"?s.data.inspectElementId:void 0;!c&&(s.id.startsWith("__")||s.id.includes("__start")||s.id.includes("__done"))||(F(c??s.id),l&&p({type:"diagram",diagramId:l}))},[F,l,p]),ms=d.useCallback((o,s)=>{var c;if((c=o==null?void 0:o.stopPropagation)==null||c.call(o),T==="actionflow"){if(!Object.values((t==null?void 0:t.elements)??{}).some(g=>g.parentAction===s.id))return;xt(s.id);return}if(T==="statetransition"){const h=s.data;if(!h.hasChildren||h.isMachine){F(s.id);return}ut(s.id);return}if(T==="interconnection"){if(!!!s.data.isContainer){F(s.id);return}Mt(s.id),Pe(new Set),F(null)}},[T,t==null?void 0:t.elements,F,xt,ut]),ys=d.useCallback(()=>{m(null),y(null),Re(null),et(null),z(o=>o.map(s=>({...s,style:{...s.style,opacity:1,boxShadow:void 0}}))),w(o=>o.map(s=>s.selected?{...s,selected:!1}:s))},[m,y,z,w]),bs=d.useCallback((o,s)=>{var c;(c=o==null?void 0:o.stopPropagation)==null||c.call(o),!(Date.now()<ne.current)&&(w(h=>h.map(g=>({...g,selected:g.id===s.id}))),t!=null&&t.relationships.some(h=>h.id===s.id)?y(s.id):t!=null&&t.elements[s.id]&&F(s.id))},[t,F,y,w]),Fs=d.useCallback((o,s)=>{Ue({endpointIds:[s.id]})},[]),ws=d.useCallback((o,s)=>{Ue({edgeId:s.id,endpointIds:Dn(s)})},[]),Ko=d.useCallback(()=>Ue(null),[]),js=d.useCallback((o,s)=>{var c;l&&(E(l,o,{...((c=k[l])==null?void 0:c.nodes[o])??{x:0,y:0},color:s||void 0}),z(h=>h.map(g=>g.id===o?{...g,data:{...g.data,bgColor:s||void 0}}:g)))},[l,k,E,z]),Vo=d.useCallback(o=>{if(!l||!u)return;const s=(u.elementIds??[]).filter(c=>c!==o);O(l,s),z(c=>c.filter(h=>h.id!==o))},[l,u,O,z]),vs=d.useCallback((o,s)=>{const c=s==="dashed"?"6 3":s==="dotted"?"2 3":void 0;w(h=>h.map(g=>g.id===o?{...g,style:{...g.style,strokeDasharray:c}}:g))},[w]),Ss=d.useCallback((o,s)=>{w(c=>c.map(h=>h.id===o?{...h,style:{...h.style,stroke:s||(dn[String(h.label??"")]??"#6B7280")}}:h))},[w]),ks=d.useCallback(o=>{w(s=>s.map(c=>c.id===o?{...c,label:c.label?"":o.split("_")[3]??""}:c))},[w]);if(u&&t&&T==="grid")return e.jsx(ui,{diagram:u,model:t,viewpointFilter:Z});if(u&&t&&T==="browser")return e.jsx(xi,{diagram:u,model:t,viewpointFilter:Z});if(u&&T==="geometry"){const o=cn.geometry;return e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#F7F7F5"},children:e.jsxs("div",{className:"text-center",style:{maxWidth:"380px"},children:[e.jsx("span",{className:"inline-block px-2 py-0.5 rounded font-semibold",style:{background:o.color+"20",color:o.color,fontSize:N.badge,marginBottom:"12px"},children:o.label}),e.jsx("h3",{style:{fontSize:N.lg,fontWeight:600,color:"#374151",marginBottom:"8px"},children:u.name}),e.jsx("p",{style:{fontSize:N.md,color:"#9CA3AF",lineHeight:1.6},children:"Geometry View rendering is deferred (ADR-1-19): the ontology carries no spatial data to draw. This view is recognized and validated, but has no renderer yet."})]})})}return!u&&_.length===0&&!G?e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[!Ne&&e.jsx(Gt,{collapsed:Ne,onToggleCollapse:()=>Ct(!0)}),Ne&&e.jsx(Gt,{collapsed:!0,onToggleCollapse:()=>Ct(!1)}),e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#F7F7F5"},children:e.jsxs("div",{className:"text-center",style:{maxWidth:"320px"},children:[e.jsx("div",{style:{fontSize:"40px",marginBottom:"16px",opacity:.4},children:"📊"}),e.jsx("h3",{style:{fontSize:N.lg,fontWeight:600,color:"#374151",marginBottom:"8px"},children:"Select a Diagram"}),e.jsx("p",{style:{fontSize:N.md,color:"#9CA3AF",lineHeight:1.6},children:"Choose a diagram from the sidebar or drag elements from the palette."})]})})]}):e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx(Gt,{collapsed:Ne,onToggleCollapse:()=>Ct(!Ne),elementIds:u==null?void 0:u.elementIds,eligibleKinds:u!=null&&u.viewpointId&&(t!=null&&t.viewpoints)?new Set(((Jo=t.viewpoints.find(o=>o.id===u.viewpointId))==null?void 0:Jo.visibleKinds)??[]):void 0}),e.jsxs("div",{className:"flex-1 relative",onDragOver:ns,onDrop:ss,onDoubleClick:is,children:[u&&e.jsxs("div",{className:"absolute top-3 left-3 z-10 flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs relative",style:{background:"#FFFFFF",border:"1px solid #E5E5E0",boxShadow:"0 1px 4px rgba(0,0,0,0.06)"},children:[Le&&e.jsx("span",{className:"px-1.5 py-0.5 rounded font-semibold",style:{background:Le.color+"20",color:Le.color,fontSize:N.badge},title:`${Le.fullName}${Me?` · ${Me.fullName}`:""}`,children:T==="actionflow"?Yn:Le.label}),e.jsx("span",{className:"font-medium",style:{color:"#1a1a1a"},children:u.name}),u.auto&&e.jsx("span",{style:{color:"#9CA3AF",fontSize:"9px"},children:"auto"}),e.jsx(ce,{}),e.jsx(Ye,{icon:e.jsx(H.grid,{}),label:"Grid",active:xo,onClick:()=>{Wn(o=>{const s=!o;return uo(s),s})},title:"Show or hide the canvas grid and snapping (⌘⇧G)"}),Fe&&e.jsxs(e.Fragment,{children:[e.jsx(ce,{}),e.jsx(oe,{icon:e.jsx(H.expand,{}),onClick:Ot,title:"Expand all nodes",ariaLabel:"Expand all"}),e.jsx(oe,{icon:e.jsx(H.collapse,{}),onClick:Pt,title:"Collapse all nodes",ariaLabel:"Collapse all"})]}),T==="actionflow"&&e.jsxs(e.Fragment,{children:[e.jsx(Ye,{icon:e.jsx(H.lanes,{}),active:$e,onClick:()=>ko(o=>!o),title:"Toggle allocation swimlanes"}),$e&&Un&&e.jsx(Ye,{icon:e.jsx(H.lanes,{}),label:"Stage",active:Qe==="stage",onClick:()=>ho(o=>o==="stage"?"allocation":"stage"),title:"Group this flow by its modeled stages"}),$e&&Qe==="allocation"&&Eo.length>0&&e.jsxs("select",{"aria-label":"Display hierarchy level",title:"Display responsibility lanes at a hierarchy level; the SysML allocation is unchanged",value:Dt,onChange:o=>go(o.target.value==="all"?"all":Number(o.target.value)),className:"text-xs font-semibold rounded-lg px-2 py-1",style:{color:"#5B6470",background:"#FFFFFF",border:"1px solid #E2E1DB"},children:[e.jsx("option",{value:"all",children:"All levels"}),Eo.map(o=>e.jsxs("option",{value:o,children:["L",o]},o))]}),e.jsx(ce,{}),e.jsx("span",{style:{color:"#9CA3AF",fontSize:N.xs,fontWeight:600},children:"Steps"}),e.jsx(qt,{value:zt,onChange:Ro,options:[{value:"flat",label:"Inline",title:"Expanded steps join the parent flow in place"},{value:"nested",label:"Nested",title:"Expanded steps are drawn inside their composite action (swimlanes off)"}]}),e.jsx(ce,{}),e.jsx(qt,{value:It,onChange:On,options:[{value:"horizontal",icon:e.jsx(H.arrowRight,{}),title:"Left-to-right flow"},{value:"vertical",icon:e.jsx(H.arrowDown,{}),title:"Top-to-bottom flow"}]}),e.jsx(ce,{}),e.jsxs(hr,{children:[e.jsx(oe,{icon:e.jsx(H.expand,{}),title:"Expand all sub-actions",onClick:()=>He(new Set(Object.values((t==null?void 0:t.elements)??{}).map(o=>o.parentAction).filter(o=>!!o)))}),e.jsx(oe,{icon:e.jsx(H.collapse,{}),title:"Collapse all sub-actions",onClick:()=>He(new Set)})]}),e.jsx(ce,{}),e.jsxs("div",{style:{position:"relative"},children:[e.jsx(Ye,{icon:e.jsx(H.filter,{}),active:fo,badge:`${ge.size}/4`,onClick:()=>Pn(o=>!o),title:"Choose which modeled connection categories are visible"}),fo&&e.jsxs("div",{className:"absolute top-full right-0 mt-2 p-3 rounded-lg",style:{width:264,background:"#FFFFFF",border:"1px solid #D1D5DB",boxShadow:"0 8px 24px rgba(0,0,0,0.14)",zIndex:30},children:[e.jsx("div",{style:{color:"#1F2937",fontWeight:700,fontSize:N.xs},children:"Show connection categories"}),e.jsx("div",{style:{color:"#6B7280",fontSize:N.xs,lineHeight:1.4,marginTop:3,marginBottom:8},children:"Changes this diagram view only; the SysML model is not modified."}),["control","data","energy","material"].map(o=>{const s=ge.has(o),c=o==="control"?"#4B5563":o==="data"?"#3498DB":o==="energy"?"#D97706":"#16A34A";return e.jsxs("button",{role:"switch","aria-checked":s,onClick:()=>_n(h=>{const g=new Set(h);return g.has(o)?g.delete(o):g.add(o),g}),className:"w-full flex items-center justify-between px-1 py-1.5 rounded",style:{color:"#374151",textTransform:"capitalize"},title:`${s?"Hide":"Show"} ${o} connections`,children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{style:{width:9,height:9,borderRadius:"50%",background:c}}),o]}),e.jsx("span",{"aria-hidden":"true",style:{width:32,height:18,borderRadius:9,background:s?"#2563EB":"#D1D5DB",padding:2,transition:"background 160ms ease"},children:e.jsx("span",{style:{display:"block",width:14,height:14,borderRadius:"50%",background:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.22)",transform:s?"translateX(14px)":"translateX(0)",transition:"transform 160ms ease"}})})]},o)})]})]}),e.jsx(Qt,{path:Qn,nameOf:o=>{var s;return((s=t==null?void 0:t.elements[o])==null?void 0:s.name)??o},onFocus:Lt,rootLabel:"Back to the whole action flow"})]}),T==="interconnection"&&e.jsxs(e.Fragment,{children:[e.jsx(ce,{}),e.jsx(oe,{icon:e.jsx(H.expand,{}),onClick:()=>Pe(new Set),title:"Expand all parts",ariaLabel:"Expand all"}),e.jsx(oe,{icon:e.jsx(H.collapse,{}),onClick:()=>Pe(new Set(ct)),title:"Collapse all parts",ariaLabel:"Collapse all"}),e.jsx("span",{style:{color:"#9CA3AF",fontSize:N.xs,fontWeight:600},children:"Ports"}),e.jsx(qt,{value:_e,onChange:Io,options:[{value:"all",label:"Nested",title:"Show ports and their nested ports"},{value:"ports",label:"Top",title:"Show top-level ports only (nested connectors lift to the parent port)"},{value:"none",label:"Off",title:"Hide ports; connectors run part to part"}]}),e.jsx(Qt,{path:qn,nameOf:o=>{var s;return((s=t==null?void 0:t.elements[o])==null?void 0:s.name)??o},onFocus:Mt,rootLabel:"Back to the whole diagram"})]}),T==="statetransition"&&e.jsxs(e.Fragment,{children:[e.jsx(ce,{}),e.jsx(oe,{icon:e.jsx(H.expand,{}),onClick:()=>Ke(new Set),title:"Show all substates",ariaLabel:"Expand all substates"}),e.jsx(oe,{icon:e.jsx(H.collapse,{}),onClick:()=>Ke(new Set(dt)),title:"Fold every composite state",ariaLabel:"Collapse all substates"}),e.jsx(Qt,{path:Zn,nameOf:o=>{var s;return((s=t==null?void 0:t.elements[o])==null?void 0:s.name)??o},onFocus:$t,rootLabel:"Back to the whole machine"})]}),At&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"#E5E5E0"},children:"|"}),e.jsxs("label",{className:"flex items-center gap-1 text-xs font-semibold",style:{color:"#475569"},children:["Level",e.jsxs("select",{"aria-label":"Use case hierarchy level",value:Rt,onChange:o=>wo(o.target.value==="all"?"all":Number(o.target.value)),className:"px-1.5 py-0.5 text-xs font-medium rounded",style:{color:"#374151",background:"#FFFFFF",border:"1px solid #D1D5DB"},children:[e.jsx("option",{value:"all",children:"All levels"}),Array.from({length:Kn+1},(o,s)=>e.jsxs("option",{value:s,children:["L",s]},s))]})]}),e.jsxs("label",{className:"flex items-center gap-1 text-xs font-semibold",style:{color:"#475569"},children:["Routing",e.jsxs("select",{"aria-label":"Use case connector routing",value:Tt,onChange:o=>jo(o.target.value),className:"px-1.5 py-0.5 text-xs font-medium rounded",style:{color:"#374151",background:"#FFFFFF",border:"1px solid #D1D5DB"},children:[e.jsx("option",{value:"straight",children:"Straight"}),e.jsx("option",{value:"elbow",children:"Elbow"}),e.jsx("option",{value:"rounded",children:"Rounded"}),e.jsx("option",{value:"curved",children:"Curved"}),e.jsx("option",{value:"arc",children:"Arc"})]})]}),e.jsx("button",{onClick:os,className:"px-2 py-0.5 text-xs font-semibold rounded",style:{color:"#047857",background:"#ECFDF5",border:"1px solid #A7F3D0"},title:"Reapply the constrained hierarchy layout and obstacle-aware routes",children:"Auto arrange"}),So.length>0&&e.jsxs("details",{className:"relative",children:[e.jsxs("summary",{className:"px-2 py-0.5 text-xs font-semibold rounded cursor-pointer",style:{color:"#374151",background:"#FFFFFF",border:"1px solid #D1D5DB"},children:["Actors",ze.size?`: ${ze.size} hidden`:""]}),e.jsxs("div",{className:"absolute top-7 left-0 z-30 min-w-48 p-2 rounded shadow-lg",style:{background:"#FFFFFF",border:"1px solid #D1D5DB"},children:[e.jsx("div",{className:"mb-1 text-xs",style:{color:"#64748B"},children:"Hide related use cases"}),So.map(o=>e.jsxs("label",{className:"flex items-center gap-2 py-1 text-xs",style:{color:"#374151"},children:[e.jsx("input",{type:"checkbox",checked:ze.has(o.id),onChange:()=>vo(s=>{const c=new Set(s);return c.has(o.id)?c.delete(o.id):c.add(o.id),c})}),o.name]},o.id))]})]})]}),Ie&&!At&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"#E5E5E0"},children:"|"}),e.jsx("div",{className:"flex rounded overflow-hidden",style:{border:"1px solid #E5E5E0"},children:Vn.map(o=>e.jsx("button",{onClick:()=>{Fo(o),le.current.clear()},className:"px-2 py-0.5 text-xs font-medium capitalize",style:{background:Se===o?"#1B3A4B":"#FFFFFF",color:Se===o?"#FFFFFF":"#6B7280"},title:o==="graph"?"Relationship graph with compartments":o==="tree"?"Decomposition tree with expand/collapse":"Nested containment blocks",children:o},o))}),Se!=="graph"&&e.jsxs(e.Fragment,{children:[e.jsx(oe,{icon:e.jsx(H.expand,{}),onClick:Ot,title:"Expand all nodes",ariaLabel:"Expand all"}),e.jsx(oe,{icon:e.jsx(H.collapse,{}),onClick:Pt,title:"Collapse all nodes",ariaLabel:"Collapse all"}),Se==="tree"&&e.jsx("button",{onClick:_t,className:"px-2 py-0.5 text-xs font-medium rounded",style:{background:"#F7F7F5",color:"#374151",border:"1px solid #E5E5E0"},title:"Re-layout the tree from scratch",children:"↻ Reset"})]})]}),nt&&!Fe&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"#E5E5E0"},children:"|"}),e.jsx("div",{className:"flex rounded overflow-hidden",style:{border:"1px solid #E5E5E0"},children:["containment","decomposition"].map(o=>e.jsx("button",{onClick:()=>{Xn(o),le.current.clear()},className:"px-2 py-0.5 text-xs font-medium",style:{background:We===o?"#1B3A4B":"#FFFFFF",color:We===o?"#FFFFFF":"#6B7280"},children:o==="containment"?"Containment":"Decomposition"},o))}),e.jsx(ce,{}),e.jsx(oe,{icon:e.jsx(H.expand,{}),onClick:Ot,title:"Expand all nodes",ariaLabel:"Expand all"}),e.jsx(oe,{icon:e.jsx(H.collapse,{}),onClick:Pt,title:"Collapse all nodes",ariaLabel:"Collapse all"}),We==="decomposition"&&e.jsx("button",{onClick:_t,className:"px-2 py-0.5 text-xs font-medium rounded",style:{background:"#F7F7F5",color:"#374151",border:"1px solid #E5E5E0"},title:"Re-layout the tree from scratch",children:"↻ Reset"})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"#E5E5E0"},children:"|"}),!At&&e.jsxs("button",{"aria-pressed":he,onClick:()=>{if(he)ae();else{const o=L.getState().diagramLayouts[l],s={nodes:{},edges:{},canvas:{...o==null?void 0:o.canvas,autoLayout:!0}};D({[l]:s}),Ve(l,s),Et(c=>c+1)}},className:"px-2 py-0.5 text-xs font-semibold rounded",style:{background:he?"#ECFDF5":"#FFF7ED",color:he?"#047857":"#C2410C",border:`1px solid ${he?"#A7F3D0":"#FED7AA"}`},title:he?"Auto layout is on. Drag any item to switch it off and preserve your changes automatically.":"Auto layout is off. Your changes are saved automatically; click to discard overrides and recalculate.",children:["Auto layout: ",he?"On":"Off"]})]}),l&&T==="interconnection"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"#E5E5E0"},children:"|"}),e.jsxs("button",{"aria-pressed":me,onClick:()=>{const o=L.getState().diagramLayouts[l]??{nodes:{},edges:{}},s={...o,canvas:{...o.canvas,flowAnimation:!me}};D({[l]:s}),Ve(l,s),w(c=>c.map(h=>({...h,data:{...h.data,flowAnimation:!me}})))},className:"px-2 py-0.5 text-xs font-semibold rounded",style:{background:me?"#EFF6FF":"#F8FAFC",color:me?"#1D4ED8":"#64748B",border:`1px solid ${me?"#93C5FD":"#CBD5E1"}`},title:"Toggle animated source-to-target flow on IBD connectors",children:["Flow: ",me?"On":"Off"]}),e.jsx("button",{"aria-pressed":Do,onClick:()=>No(o=>!o),className:"px-2 py-0.5 text-xs font-medium rounded",style:{background:"#F8FAFC",color:"#475569",border:"1px solid #CBD5E1"},title:"Show or hide the IBD notation legend",children:"Legend"})]})]}),Te&&e.jsxs("div",{className:"absolute top-3 right-3 z-10 flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs",style:{background:"#1B3A4B",color:"#FFFFFF",boxShadow:"0 2px 8px rgba(0,0,0,0.18)"},children:[e.jsx("span",{style:{color:"#2DD4A8",fontWeight:700},children:"◎ Focus"}),e.jsx("span",{style:{color:"rgba(255,255,255,0.5)"},children:"Depth"}),[1,2,3].map(o=>e.jsx("button",{onClick:()=>Hn(o),style:{width:20,height:20,borderRadius:4,cursor:"pointer",background:tt===o?"#2DD4A8":"rgba(255,255,255,0.15)",color:tt===o?"#1B3A4B":"#FFFFFF",fontWeight:700,fontSize:"11px",border:"none"},children:o},o)),e.jsx("button",{onClick:()=>{mo(null),z(o=>o.map(s=>({...s,style:{...s.style,opacity:1,pointerEvents:"all"}}))),w(o=>o.map(s=>({...s,style:{...s.style,opacity:1}})))},style:{marginLeft:4,padding:"2px 8px",borderRadius:4,cursor:"pointer",background:"rgba(255,255,255,0.15)",color:"#FFFFFF",fontSize:"11px",border:"none"},children:"Exit Focus"})]}),ot&&e.jsxs("div",{className:"absolute bottom-12 left-1/2 -translate-x-1/2 z-50 px-4 py-2 rounded-lg text-xs font-mono",style:{background:"#1B3A4B",color:"#2DD4A8",boxShadow:"0 4px 16px rgba(0,0,0,0.2)",whiteSpace:"nowrap"},children:["Copied: ",ot]}),G&&e.jsx("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 z-10 px-4 py-1.5 rounded-full text-xs font-medium",style:{background:"#FFFFFF",color:"#6B7280",border:"1px solid #E5E5E0",boxShadow:"0 1px 4px rgba(0,0,0,0.06)"},children:"Computing layout…"}),lo&&!G&&e.jsxs("div",{role:"alert",className:"absolute top-3 left-1/2 -translate-x-1/2 z-20 flex items-center gap-3 px-3 py-2",style:{maxWidth:620,background:"#FFFDF7",color:"#5F4300",border:"1px solid #E7C35A",borderRadius:4,boxShadow:"0 2px 8px rgba(31,41,55,0.10)",fontSize:N.xs},children:[e.jsx("span",{children:lo}),e.jsx("button",{onClick:_t,style:{border:"1px solid #B58A12",borderRadius:3,background:"#FFFFFF",color:"#5F4300",padding:"3px 8px",fontWeight:700,whiteSpace:"nowrap"},children:"Retry"})]}),st.length>0&&!G&&e.jsxs("div",{role:"alert",className:"absolute top-16 left-1/2 -translate-x-1/2 z-20 px-3 py-2",style:{maxWidth:720,background:"#FEF2F2",color:"#991B1B",border:"1px solid #FCA5A5",borderRadius:4,boxShadow:"0 2px 8px rgba(31,41,55,0.10)",fontSize:N.xs},children:[e.jsx("span",{style:{fontWeight:700},children:"Diagram error:"})," ",st.length," floating ",st.length===1?"action has":"actions have"," no flow or succession connection:"," ",st.map((o,s)=>e.jsxs("span",{children:[s>0&&", ",e.jsx("button",{onClick:()=>F(o.id),style:{color:"#991B1B",textDecoration:"underline",fontWeight:700},children:o.name})]},o.id))]}),pt&&!G&&e.jsxs("div",{role:"alert",className:"absolute top-16 left-1/2 -translate-x-1/2 z-20 px-3 py-2",style:{maxWidth:720,background:"#FEF2F2",color:"#991B1B",border:"1px solid #FCA5A5",borderRadius:4,boxShadow:"0 2px 8px rgba(31,41,55,0.10)",fontSize:N.xs},children:[e.jsx("span",{style:{fontWeight:700},children:"BDD error:"})," ","expected one connected hierarchy, but found ",pt.rootIds.length," roots",pt.disconnectedIds.length>0&&e.jsxs(e.Fragment,{children:[" and ",pt.disconnectedIds.length," disconnected/floating elements"]}),"."]}),T==="actionflow"&&e.jsxs("div",{"aria-label":"Action flow legend",className:"absolute right-3 bottom-3 z-10 flex items-center gap-4 px-3 py-2",style:{background:"rgba(255,255,255,0.96)",border:"1px solid #D1D5DB",borderRadius:3,color:"#374151",fontSize:N.xs},children:[e.jsx("span",{style:{fontWeight:700},children:"Legend"}),ge.has("control")&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{style:{width:24,height:0,borderTop:"2px solid #4B5563"}}),"Control flow"]}),ge.has("data")&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{style:{width:24,height:0,borderTop:"2.5px solid #3498DB"}}),"Object flow"]}),ge.has("energy")&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{style:{width:24,height:0,borderTop:"2.5px solid #D97706"}}),"Energy flow"]}),ge.has("material")&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{style:{width:24,height:0,borderTop:"2.5px solid #16A34A"}}),"Material flow"]})]}),T==="interconnection"&&_.length>0&&Do&&e.jsxs("div",{"aria-label":"Interconnection legend",className:"absolute right-3 bottom-3 z-10 flex flex-col gap-1.5 px-3 py-2",style:{background:"rgba(255,255,255,0.96)",border:"1px solid #D1D5DB",borderRadius:4,color:"#374151",fontSize:N.xs},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{style:{fontWeight:700},children:"Ports"}),_e!=="none"?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Zt,{color:wt.in,glyph:"→"})," in"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Zt,{color:wt.out,glyph:"→"})," out"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Zt,{color:wt.inout,glyph:"⇄"})," inout"]}),_e==="all"&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{style:{width:9,height:9,borderRadius:2,flexShrink:0,background:"#6B728022",border:"1.5px solid #6B7280"}}),"nested"]})]}):e.jsx("span",{style:{color:"#9CA3AF"},children:"hidden"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{style:{fontWeight:700},children:"Flow"}),["data","energy","material"].map(o=>e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{style:{width:20,height:0,borderTop:`2.5px solid ${hi[o]}`}}),o]},o))]})]}),!G&&_.length===0&&u&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",style:{zIndex:1},children:u.auto&&((en=u.elementIds)==null?void 0:en.length)===0?e.jsxs("div",{className:"text-center",style:{maxWidth:420},children:[e.jsx("div",{style:{fontSize:"32px",marginBottom:8},children:"🔍"}),e.jsx("div",{style:{fontSize:N.sm,color:"#374151",fontWeight:600,marginBottom:4},children:"This view selects no elements"}),e.jsx("div",{style:{fontSize:N.xs,color:"#6B7280",lineHeight:1.6},children:"The view is auto-populated from its selectionQuery in the model. Add includeElementKinds / includeLayers to its SysML definition, or link elements to it with IncludedIn relationships."})]}):e.jsxs("div",{className:"text-center",style:{opacity:.4},children:[e.jsx("div",{style:{fontSize:"32px",marginBottom:8},children:"🖱️"}),e.jsx("div",{style:{fontSize:N.sm,color:"#6B7280"},children:"Drag from palette or double-click to create elements"})]})}),G&&e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",zIndex:20,background:`linear-gradient(90deg, ${pn.accent} 0%, ${pn.accent}80 50%, transparent 100%)`,backgroundSize:"200% 100%",animation:"memo-layout-progress 1.2s linear infinite"}}),e.jsxs(Ts,{nodes:_,edges:re,nodeTypes:Jn,edgeTypes:es,onNodesChange:xs,onEdgesChange:pe,onNodeClick:fs,onNodeDoubleClick:ms,onEdgeClick:bs,onPaneClick:ys,onNodeDragStart:ps,onNodeDragStop:us,onNodeContextMenu:hs,onEdgeContextMenu:gs,onNodeMouseEnter:Fs,onNodeMouseLeave:Ko,onEdgeMouseEnter:ws,onEdgeMouseLeave:Ko,onConnect:ds,onConnectStart:as,onConnectEnd:ls,connectionMode:Bs.Loose,defaultEdgeOptions:{interactionWidth:24},snapToGrid:$n,snapGrid:br,fitView:!0,fitViewOptions:{...fr,minZoom:ve},minZoom:.1,maxZoom:3,zoomOnScroll:!0,panOnScroll:!0,panOnScrollMode:"free",selectionOnDrag:!1,proOptions:yr,style:gr,children:[xo&&e.jsx(Ms,{color:"#C5C7C2",gap:20,size:1.5}),e.jsx(wi,{}),e.jsx(Ls,{}),_.length>20&&e.jsx(zs,{style:mr,nodeColor:ts,maskColor:"rgba(247, 247, 245, 0.7)"})]})]}),te&&e.jsx(vr,{x:te.x,y:te.y,onConfirm:rs,onCancel:()=>Ae(null)}),fe&&e.jsx(gi,{x:fe.x,y:fe.y,sourceElement:fe.sourceElement,targetElement:fe.targetElement,registries:n,onSelect:cs,onCancel:()=>Je(null)}),q&&e.jsx(rr,{x:q.x,y:q.y,nodeId:q.nodeId,nodeKind:q.nodeKind,onClose:()=>Re(null),onEditName:()=>{z(o=>o.map(s=>s.id===q.nodeId?{...s,data:{...s.data,_triggerEdit:!0}}:s))},onChangeColor:o=>js(q.nodeId,o),onRemoveFromDiagram:()=>Vo(q.nodeId),onDeleteFromModel:()=>{Vo(q.nodeId)},onShowProperties:()=>{m(q.nodeId)},onShowInCatalog:()=>{m(q.nodeId),I("catalog")},onFocusElement:()=>{mo(q.nodeId)},onShowRelMatrix:()=>{p({type:"traceability"})},onOpenSource:()=>{const o=t==null?void 0:t.elements[q.nodeId];o!=null&&o.file&&(navigator.clipboard.writeText(o.file).catch(()=>{}),yo(o.file))},onViewKindInOntology:()=>{const o=q.nodeKind;let s=null,c=null;for(const h of v){for(const g of h.layers)if(g.kinds.some(S=>S.name===o)){s=h.name,c=g.id;break}if(s)break}s&&(f(o),b("ontologies"),I("ontology"),p({type:"ontology-detail",packageName:s,layerId:c??void 0}))}}),xe&&e.jsx(lr,{x:xe.x,y:xe.y,edgeId:xe.edgeId,relType:xe.relType,onClose:()=>et(null),onChangeStyle:o=>vs(xe.edgeId,o),onChangeColor:o=>Ss(xe.edgeId,o),onToggleLabel:()=>ks(xe.edgeId),onDelete:()=>w(o=>o.filter(s=>s.id!==xe.edgeId))})]})}function Br(){return e.jsx(Is,{children:e.jsx(Sr,{})})}export{Br as DiagramCanvas};
@@ -1,2 +0,0 @@
1
- import{j as e}from"./reactflow-CsCqNKB-.js";import{a as b}from"./zustand-CrhqMOHB.js";import{u as m,h as A,C as i,F as r,f as W,E as B,P as j,p as v,q as C,r as M,t as O,v as T}from"./index-D0vtjNjX.js";const a="page",$=new Set(["Scenario","UseCase","UserActivity"]);function D(l){return l?l.split(`
2
- `).filter(s=>s.trim()).map((s,c)=>{const p=s.match(/^\d+\.\s*(.*)/);return{index:c,text:p?p[1].trim():s.trim()}}):[]}function V({element:l,layerColor:s,onSave:c}){const p=b.useMemo(()=>D(l.doc||""),[l.doc]),[y,u]=b.useState(!1);return y||p.length===0?e.jsxs("div",{children:[e.jsxs("p",{style:{fontSize:r.xs,color:i.faint,marginBottom:6,marginTop:0},children:["One step per line, numbered: ",e.jsx("code",{children:"1. User does something"})]}),e.jsx(v,{value:l.doc||"",onSave:n=>{c(n),u(!1)},density:a,multiline:!0,placeholder:"Click to add scenario steps…"})]}):e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>u(!0),style:{position:"absolute",top:0,right:0,fontSize:r.xs,color:i.muted,padding:"2px 9px",border:`1px solid ${i.border}`,borderRadius:"6px",background:i.surface,cursor:"pointer"},onMouseEnter:n=>{n.currentTarget.style.borderColor=i.accent},onMouseLeave:n=>{n.currentTarget.style.borderColor=i.border},children:"✎ Edit steps"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",paddingTop:4},children:[e.jsx("div",{style:{padding:"6px 20px",borderRadius:"999px",fontSize:r.xs,fontWeight:700,background:s,color:"#fff",letterSpacing:"0.06em",textTransform:"uppercase"},children:"Start"}),p.map((n,o)=>e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%"},children:[e.jsx(k,{color:s}),e.jsxs("div",{style:{width:"100%",maxWidth:"560px",display:"flex",alignItems:"flex-start",gap:"12px",background:i.surface,border:`1px solid ${s}30`,borderRadius:"8px",padding:"10px 14px",boxShadow:"0 1px 3px rgba(0,0,0,0.05)"},children:[e.jsx("span",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:s+"18",color:s,fontSize:r.xs,fontWeight:700},children:o+1}),e.jsx("span",{style:{fontSize:r.sm,color:i.primary,lineHeight:1.5,paddingTop:"3px"},children:n.text})]})]},o)),e.jsx(k,{color:s}),e.jsx("div",{style:{padding:"6px 20px",borderRadius:"999px",fontSize:r.xs,fontWeight:700,background:s+"20",color:s,letterSpacing:"0.06em",textTransform:"uppercase",border:`1px solid ${s}40`},children:"End"})]})]})}function k({color:l}){return e.jsx("div",{style:{width:"2px",height:"20px",background:l+"50",position:"relative"},children:e.jsx("div",{style:{position:"absolute",bottom:-5,left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:`6px solid ${l}80`}})})}function H(){var F,I,R;const l=m(t=>t.activeView),s=m(t=>t.model),c=m(t=>t.validation),p=m(t=>t.updateElementField),y=m(t=>t.updateElementAttribute),u=m(t=>t.applyEdit),n=l.type==="element-detail"?l.elementId:null,o=n&&s?s.elements[n]:null,S=b.useMemo(()=>{if(!s||!n)return{incoming:[],outgoing:[]};const t=A(s,n);return{incoming:t.filter(d=>d.targetId===n),outgoing:t.filter(d=>d.sourceId===n)}},[s,n]),h=b.useMemo(()=>!c||!n?[]:c.violations.filter(t=>t.elementId===n),[c,n]);if(!o||!n)return e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:i.surfaceAlt},children:e.jsxs("div",{className:"text-center",style:{color:i.faint},children:[e.jsx("div",{style:{fontSize:"32px",marginBottom:"12px",opacity:.5},children:"📄"}),e.jsx("p",{style:{fontSize:r.md},children:"Select an element to view details"})]})});const g=W[o.layer]||i.muted,x=(F=s==null?void 0:s.registries)==null?void 0:F.kinds.find(t=>t.name===o.kind),E=((I=x==null?void 0:x.namespace)==null?void 0:I[1])??((R=x==null?void 0:x.namespace)==null?void 0:R[0]),w=(t,d)=>{p(n,t,d),u(n)},N=(t,d)=>{y(n,t,d),u(n)},f=Object.entries(o.attributes).filter(([t])=>t!=="id"&&t!=="name"),z=$.has(o.kind);return e.jsx("div",{className:"flex-1 overflow-y-auto",style:{background:"#EEF4F7"},children:e.jsxs("div",{style:{maxWidth:"1040px",margin:"0 auto",padding:"20px 28px 48px"},children:[e.jsxs("header",{style:{background:i.surface,border:"1px solid rgba(60,60,67,0.12)",borderLeft:`4px solid ${g}`,borderRadius:"16px",padding:"14px 18px",marginBottom:16,boxShadow:"0 1px 3px rgba(15,23,42,0.05)"},children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",style:{marginBottom:8},children:[e.jsx("span",{className:"px-2 py-0.5 rounded-md font-semibold",style:{background:g+"18",color:g,fontSize:r.xs},children:o.kind}),e.jsx("span",{className:"px-2 py-0.5 rounded-md",style:{background:i.surfaceAlt,color:i.muted,fontSize:r.xs},children:o.layer}),E&&e.jsx("span",{style:{color:i.faint,fontSize:r.xs},children:E.replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase())}),o.shortId&&e.jsx("span",{style:{marginLeft:"auto",color:i.faint,fontSize:r.xs,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace"},children:o.shortId})]}),e.jsx("h1",{style:{fontSize:"24px",fontWeight:700,color:i.primary,lineHeight:1.2,margin:0},children:o.name}),e.jsx("div",{style:{marginTop:9,paddingTop:8,borderTop:`1px solid ${i.borderLight}`},children:e.jsx(B,{density:a})})]}),h.length>0&&e.jsxs("div",{className:"rounded-xl overflow-hidden",style:{border:"1px solid #FEE2E2",background:"#FEF2F2",marginBottom:20},children:[e.jsxs("div",{className:"px-4 py-2 font-semibold",style:{color:"#DC2626",fontSize:r.sm,borderBottom:"1px solid #FEE2E2"},children:[h.length," violation",h.length!==1?"s":""]}),h.map((t,d)=>e.jsxs("div",{className:"px-4 py-2 flex items-center gap-2",style:{fontSize:r.xs},children:[e.jsx("span",{style:{color:"#DC2626"},children:"✖"}),e.jsxs("span",{style:{color:i.faint},children:["[",t.ruleId,"]"]}),e.jsx("span",{style:{color:"#991B1B"},children:t.description})]},d))]}),e.jsx(j,{title:z?"Flow":"Description",density:a,collapsible:!1,children:z?e.jsx(V,{element:o,layerColor:g,onSave:t=>w("doc",t)}):e.jsx(v,{value:o.doc||"",onSave:t=>w("doc",t),density:a,multiline:!0,placeholder:"Click to add a description…"})}),e.jsxs(j,{title:"Attributes",count:f.length,density:a,collapsible:!1,children:[f.length===0&&e.jsx("p",{style:{fontSize:r.sm,color:i.faint,margin:0},children:"This element defines no attributes."}),f.length>0&&e.jsx("div",{style:{borderTop:`1px solid ${i.border}`,maxWidth:900},children:f.map(([t,d])=>e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(150px, 24%) minmax(0, 1fr)",gap:16,alignItems:"center",padding:"7px 0",borderBottom:`1px solid ${i.borderLight}`},children:[e.jsxs("div",{style:{minWidth:0},children:[e.jsx("div",{style:{color:i.secondary,fontSize:r.sm,fontWeight:600},children:t}),e.jsx("div",{style:{color:i.faint,fontSize:"10px"},children:"Editable"})]}),e.jsx(v,{value:String(d??""),onSave:L=>N(t,L),density:a,placeholder:"Add value…",compact:!0})]},t))})]}),e.jsx(C,{element:o,outgoing:S.outgoing,incoming:S.incoming,density:a}),e.jsx(j,{title:"Source",density:a,collapsible:!1,children:e.jsx("div",{style:{maxWidth:720},children:e.jsx(M,{label:"SysML source file",editability:T("file"),density:a,children:e.jsx(O,{value:o.file??"—",editability:T("file"),density:a,mono:!0})})})})]})})}export{H as ElementDetailView};
@@ -1 +0,0 @@
1
- import{j as e,H as C,P as k,R as D,a as S,i as O,f as R,g as I}from"./reactflow-CsCqNKB-.js";import{a as p}from"./zustand-CrhqMOHB.js";/* empty css */import{r as T}from"./layout-providers-Dr743WlP.js";import{f as L,u as h,I as P,J as M,K as z}from"./index-D0vtjNjX.js";import"./elk-6l8mIQnQ.js";const A={ontology:{bg:"#EFF6FF",fg:"#2563EB",border:"#BFDBFE"},profile:{bg:"#F0FDF4",fg:"#16A34A",border:"#BBF7D0"},extension:{bg:"#FFF7ED",fg:"#EA580C",border:"#FED7AA"}};function H({data:i}){const s=i,l=A[s.type]??A.ontology;return e.jsxs("div",{"data-testid":`ontology-package-node-${s.name}`,onClick:s.onClick,onDoubleClick:s.onDoubleClick,onContextMenu:s.onContextMenu,style:{background:"#FFFFFF",border:s.selected?"2px solid #2563EB":"1px solid #E5E5E0",borderRadius:"12px",padding:"16px",minWidth:"240px",maxWidth:"300px",cursor:"pointer",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",transition:"box-shadow 200ms ease, transform 200ms ease"},children:[e.jsx(C,{type:"target",position:k.Top,id:"top",style:w}),e.jsx(C,{type:"source",position:k.Bottom,id:"bottom",style:w}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"8px"},children:[e.jsx("span",{style:{padding:"1px 8px",fontSize:"10px",borderRadius:"9999px",fontWeight:600,background:l.bg,color:l.fg,border:`1px solid ${l.border}`},children:s.type}),e.jsxs("span",{style:{fontSize:"10px",color:"#9CA3AF"},children:["v",s.version]})]}),e.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#1a1a1a",marginBottom:"4px"},children:s.name}),s.description&&e.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF",marginBottom:"10px",lineHeight:"1.4"},children:s.description.length>80?s.description.slice(0,80)+"…":s.description}),e.jsx("div",{style:{display:"flex",gap:"2px",marginBottom:"8px",height:"6px",borderRadius:"3px",overflow:"hidden"},children:s.layers.slice(0,12).map(d=>{const n=L[d.id]??d.color??"#6B7280";return e.jsx("div",{style:{flex:Math.max(d.kindCount,1),background:n,borderRadius:"1px"},title:`${d.label}: ${d.kindCount} kinds`},d.id)})}),e.jsxs("div",{style:{display:"flex",gap:"12px",fontSize:"11px",color:"#6B7280"},children:[e.jsxs("span",{children:[e.jsx("strong",{style:{color:"#1B3A4B"},children:s.kindCount})," kinds"]}),e.jsxs("span",{children:[e.jsx("strong",{style:{color:"#1B3A4B"},children:s.layerCount})," layers"]})]})]})}const w={width:"8px",height:"8px",background:"#2563EB",border:"2px solid #FFFFFF",opacity:0},W=p.memo(H);function $({onClose:i}){const s=h(o=>o.availableOntologies),l=h(o=>o.ontologyInstallStatus),d=h(o=>o.setOntologyInstallStatus),[n,c]=p.useState(""),[r,g]=p.useState(null);function t(){n.trim()&&(d({installing:!0}),P(n.trim()),c(""))}function x(o){M(o),g(null)}return e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50",style:{background:"rgba(0,0,0,0.4)"},onClick:i,children:e.jsxs("div",{className:"rounded-xl shadow-2xl overflow-hidden",style:{background:"#FFFFFF",width:"520px",maxHeight:"600px",border:"1px solid #E5E5E0"},onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4",style:{borderBottom:"1px solid #E5E5E0"},children:[e.jsx("h2",{className:"text-sm font-semibold",style:{color:"#1a1a1a"},children:"Manage Ontology Library"}),e.jsx("button",{onClick:i,className:"text-sm px-2 py-0.5 rounded hover:bg-gray-100",style:{color:"#9CA3AF"},children:"x"})]}),e.jsxs("div",{className:"p-5 space-y-5 overflow-y-auto",style:{maxHeight:"480px"},children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium block mb-1.5",style:{color:"#374151"},children:"Add Ontology"}),e.jsx("p",{className:"text-xs mb-2",style:{color:"#9CA3AF"},children:"Enter a git URL (https://...git), npm package name (@memoarchitect/...), or local path."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",placeholder:"https://gitlab.com/org/my-ontology.git",value:n,onChange:o=>c(o.target.value),onKeyDown:o=>o.key==="Enter"&&t(),className:"flex-1 px-3 py-2 text-xs rounded-lg",style:{border:"1px solid #E5E7EB",background:"#F9FAFB",color:"#374151",outline:"none"},onFocus:o=>o.currentTarget.style.borderColor="#2563EB",onBlur:o=>o.currentTarget.style.borderColor="#E5E7EB",disabled:l.installing}),e.jsx("button",{onClick:t,disabled:!n.trim()||l.installing,className:"px-4 py-2 text-xs rounded-lg font-medium",style:{background:l.installing?"#9CA3AF":"#1B3A4B",color:"#FFFFFF",opacity:!n.trim()||l.installing?.5:1,cursor:!n.trim()||l.installing?"not-allowed":"pointer"},children:l.installing?"Installing...":"Install"})]}),l.error&&e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg text-xs",style:{background:"#FEF2F2",color:"#DC2626",border:"1px solid #FECACA"},children:l.error}),l.lastInstalled&&!l.error&&e.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-xs",style:{background:"#F0FDF4",color:"#16A34A",border:"1px solid #BBF7D0"},children:["Installed ",l.lastInstalled]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium block mb-2",style:{color:"#374151"},children:["Installed Packages (",s.length,")"]}),e.jsxs("div",{className:"space-y-1.5",children:[s.map(o=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg",style:{border:"1px solid #E5E5E0",background:"#FAFAF8"},children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-medium truncate",style:{color:"#1a1a1a"},children:o.name}),e.jsx("span",{className:"px-1.5 py-0.5 text-xs rounded",style:{background:o.type==="ontology"?"#EFF6FF":o.type==="profile"?"#F0FDF4":"#FFF7ED",color:o.type==="ontology"?"#2563EB":o.type==="profile"?"#16A34A":"#EA580C",fontSize:"10px"},children:o.type})]}),e.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#9CA3AF"},children:["v",o.version," · ",o.kindCount," kinds · ",o.layers.length," layers"]})]}),r===o.name?e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>x(o.name),className:"px-2 py-1 text-xs rounded",style:{background:"#DC2626",color:"#FFFFFF"},children:"Confirm"}),e.jsx("button",{onClick:()=>g(null),className:"px-2 py-1 text-xs rounded",style:{background:"#F3F4F6",color:"#374151"},children:"Cancel"})]}):e.jsx("button",{onClick:()=>g(o.name),className:"text-xs px-2 py-1 rounded hover:bg-red-50",style:{color:"#DC2626",border:"1px solid #FECACA"},children:"Remove"})]},o.name)),s.length===0&&e.jsx("div",{className:"text-center py-6 text-xs",style:{color:"#9CA3AF"},children:"No ontology packages installed"})]})]})]})]})})}const _={ontologyPackage:W},Y=260,K=180;async function V(i){const s=new Map(i.map(t=>[t.name,t])),l={id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.spacing.nodeNodeBetweenLayers":"100","elk.spacing.nodeNode":"32","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.padding":"[top=24, left=24, bottom=24, right=24]"},children:i.map(t=>({id:t.name,width:Y,height:K})),edges:i.filter(t=>t.extends&&s.has(t.extends)).map((t,x)=>({id:`e-${x}`,sources:[t.extends],targets:[t.name]}))},d=await T(l),n=new Map;for(const t of d.children??[])n.set(t.id,{x:t.x??0,y:t.y??0});const c={ontology:"#3B82F6",profile:"#10B981",extension:"#F59E0B"},r=i.map(t=>({id:t.name,type:"ontologyPackage",position:n.get(t.name)??{x:0,y:0},data:{name:t.name,type:t.type,version:t.version,description:t.description,kindCount:t.kindCount,layerCount:t.layers.length,layers:t.layers.map(x=>({id:x.id,label:x.label,color:x.color,kindCount:x.kindCount})),selected:t.selected,onClick:()=>{}}})),g=[];for(const t of i)if(t.extends&&s.has(t.extends)){const x=c[t.type]??"#94A3B8";g.push({id:`${t.extends}->${t.name}`,source:t.extends,target:t.name,type:"smoothstep",data:{edgeType:"extends"},style:{stroke:x,strokeWidth:2,strokeDasharray:"6 3"},animated:!1,label:"extends",labelStyle:{fontSize:9,fill:x,fontWeight:500},labelBgStyle:{fill:"#F7F7F5",fillOpacity:.9},labelBgPadding:[4,2],markerEnd:{type:"arrowclosed",color:x,width:14,height:14}})}return{nodes:r,edges:g}}function G(i,s){const l=new Map;for(const c of s)c.extends&&(l.has(c.extends)||l.set(c.extends,[]),l.get(c.extends).push(c.name));const d=new Set([i]),n=[i];for(;n.length;){const c=n.shift();for(const r of l.get(c)??[])d.has(r)||(d.add(r),n.push(r))}return d}function U(){const i=h(a=>a.availableOntologies),s=h(a=>a.setActiveView),l=h(a=>a.hiddenEdgeTypes),d=h(a=>a.toggleHiddenEdgeType),[n,c]=p.useState(!1),[r,g]=p.useState({nodes:[],edges:[]}),[t,x]=p.useState(null),{fitView:o}=S();p.useEffect(()=>{let a=!1;return V(i).then(u=>{a||g(u)}).catch(u=>{console.error("[OntologyDiagram] ELK layout failed:",u)}),()=>{a=!0}},[i]);const F=p.useCallback(a=>{s({type:"ontology-detail",packageName:a})},[s]),E=p.useCallback(a=>{const u=G(a,i),m=r.nodes.filter(y=>u.has(y.id));m.length!==0&&o({nodes:m.map(y=>({id:y.id})),duration:400,padding:.2})},[i,r.nodes,o]),v=p.useCallback((a,u)=>{a.preventDefault(),x({x:a.clientX,y:a.clientY,packageName:u})},[]);p.useEffect(()=>{const a=u=>{if(u.key==="Escape"){if(t){x(null);return}o({padding:.1,duration:300})}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,o]);const{nodes:N,edges:B}=p.useMemo(()=>{const a=r.nodes.map(m=>({...m,data:{...m.data,onClick:()=>E(m.id),onDoubleClick:()=>F(m.id),onContextMenu:y=>v(y,m.id)}})),u=r.edges.filter(m=>{var j;const y=(j=m.data)==null?void 0:j.edgeType;return!y||!l.has(y)});return{nodes:a,edges:u}},[r,E,F,v,l]),f=p.useRef(null);p.useEffect(()=>{if(!t)return;const a=u=>{f.current&&!f.current.contains(u.target)&&x(null)};return window.addEventListener("mousedown",a),()=>window.removeEventListener("mousedown",a)},[t]);const b=l.has("extends");return i.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#F7F7F5"},children:e.jsxs("div",{className:"text-center",style:{color:"#9CA3AF"},children:[e.jsx("div",{className:"text-3xl mb-3",children:"◉"}),e.jsx("div",{className:"text-sm font-medium mb-1",style:{color:"#374151"},children:"No ontology packages found"}),e.jsx("div",{className:"text-xs",children:"Start the dev server to load ontology packages"})]})}):e.jsxs("div",{className:"flex-1",style:{background:"#F7F7F5"},children:[e.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"#1a1a1a"},children:"Ontology Library"}),e.jsxs("p",{className:"text-xs mt-1",style:{color:"#9CA3AF"},children:[i.length," package",i.length!==1?"s":""," available. Click to zoom, double-click to open, right-click for source."]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{"data-testid":"toggle-tracing",onClick:()=>d("extends"),title:b?"Show extends tracing edges":"Hide extends tracing edges",className:"px-3 py-1.5 text-xs rounded-lg font-medium",style:b?{background:"#F0F0ED",color:"#6B7280",border:"1px solid #E5E5E0"}:{background:"#1B3A4B",color:"#2DD4A8",border:"1px solid transparent"},children:b?"Show Tracing":"Hide Tracing"}),e.jsx("button",{onClick:()=>c(!0),className:"px-3 py-1.5 text-xs rounded-lg font-medium",style:{background:"#1B3A4B",color:"#2DD4A8"},children:"+ Add Ontology"})]})]}),n&&e.jsx($,{onClose:()=>c(!1)}),e.jsx("div",{style:{flex:1,height:"calc(100% - 72px)"},children:e.jsxs(O,{nodes:N,edges:B,nodeTypes:_,fitView:!0,fitViewOptions:{padding:.1},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnDoubleClick:!1,minZoom:.2,maxZoom:2.5,proOptions:{hideAttribution:!0},children:[e.jsx(R,{color:"#E5E5E0",gap:24,size:1}),e.jsx(I,{showInteractive:!1})]})}),t&&e.jsx(Z,{menuRef:f,state:t,onClose:()=>x(null),packages:i})]})}const Z=({state:i,onClose:s,packages:l,menuRef:d})=>{const n=l.find(r=>r.name===i.packageName);function c(){if(!n)return;const r=n.rootDir?`${n.rootDir}/memo.package.yaml`:"";r?z(r):window.open(`vscode://file/${encodeURIComponent(n.name)}`),s()}return e.jsxs("div",{ref:d,style:{position:"fixed",top:i.y,left:i.x,zIndex:1e3,background:"#FFFFFF",border:"1px solid #E5E5E0",borderRadius:"8px",boxShadow:"0 6px 16px rgba(0,0,0,0.12)",padding:"4px",minWidth:"180px",fontSize:"12px"},children:[e.jsx("div",{style:{padding:"6px 10px",color:"#9CA3AF",fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.4px"},children:i.packageName}),e.jsx("button",{onClick:c,disabled:!(n!=null&&n.rootDir),style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",border:"none",background:"transparent",cursor:n!=null&&n.rootDir?"pointer":"not-allowed",color:n!=null&&n.rootDir?"#1a1a1a":"#9CA3AF",borderRadius:"4px"},onMouseEnter:r=>{n!=null&&n.rootDir&&(r.currentTarget.style.background="#F0F0ED")},onMouseLeave:r=>{r.currentTarget.style.background="transparent"},children:"Open source"})]})};function oe(){return e.jsx(D,{children:e.jsx(U,{})})}export{oe as OntologyDecompositionDiagram,oe as default};
@@ -1,3 +0,0 @@
1
- import{j as e}from"./reactflow-CsCqNKB-.js";import{a as p}from"./zustand-CrhqMOHB.js";import{u as E,h as xe,i as fe,f as R}from"./index-D0vtjNjX.js";const he=[{label:"Activity diagram",types:new Set(["act"])},{label:"Operative flow",types:new Set(["afd","ofd"])},{label:"Function flow",types:new Set(["ffd"])},{label:"Sequence diagram",types:new Set(["seq"])}];function ye(r){return he.map(v=>{const m=r.filter(b=>v.types.has(b.diagramType.toLowerCase()));return{label:v.label,items:m}}).filter(v=>v.items.length>0)}function Z(r){return r?r.split(`
2
- `).filter(m=>m.trim()).map((m,b)=>{const I=m.match(/^\d+\.\s*(.*)/);return{index:b,text:I?I[1]:m}}):[]}function ge(r){return r.map((v,m)=>`${m+1}. ${v.text}`).join(`
3
- `)}function ke(){const r=E(s=>s.model),v=E(s=>s.createRelationship),m=E(s=>s.inspectElement),b=E(s=>s.selectedElementId),I=E(s=>s.setActiveMode),ee=E(s=>s.setActiveView),[N,se]=p.useState(""),[c,y]=p.useState(null),[B,q]=p.useState(""),[T,K]=p.useState(null),[D,P]=p.useState(""),z=p.useMemo(()=>{if(!r)return[];const s=Object.values(r.elements),n=r.elements,l=(...t)=>{const i=new Set(t.map(u=>u.toLowerCase()));return r.relationships.filter(u=>i.has(u.type.toLowerCase()))},x=(t,i)=>{var u;return typeof t=="string"&&((u=t.split("::").at(-1))==null?void 0:u.trim())===i},j=s.filter(t=>t.kind.endsWith("UseCase")),w=new Set(j.map(t=>t.id)),f=new Map,S=new Set;for(const t of l("Includes")){if(!w.has(t.sourceId)||!w.has(t.targetId))continue;const i=f.get(t.sourceId)??[];i.push(t.targetId),f.set(t.sourceId,i),S.add(t.targetId)}const C=new Map,L=[],A=(t,i)=>{if(!C.has(t)){C.set(t,i),L.push(t);for(const u of f.get(t)??[])A(u,i+1)}};for(const t of j)S.has(t.id)||A(t.id,0);for(const t of j)A(t.id,0);const U=L.map(t=>n[t]).filter(t=>!!t),k=t=>!N||t.name.toLowerCase().includes(N.toLowerCase())||t.kind.toLowerCase().includes(N.toLowerCase());return U.map(t=>{var J;const i=l("Supports","supportsUseCase").filter(a=>a.targetId===t.id).map(a=>n[a.sourceId]).filter(a=>!!a&&a.kind==="OperationalWorkflow"),u=s.filter(a=>a.kind.endsWith("Scenario")).filter(a=>x(a.attributes.parentUseCase,t.id)||l("Realizes","scenarioRealizesUseCase").some(F=>F.sourceId===a.id&&F.targetId===t.id)),W=u.map(a=>s.find(F=>x(a.attributes.parentWorkflow,F.id))).filter(a=>!!a),O=[...new Map([...i,...W].map(a=>[a.id,a])).values()],G=u.map(a=>{const F=l("Composes","scenarioComprisesActivity").filter(o=>o.sourceId===a.id).map(o=>n[o.targetId]).filter(o=>!!o),de=String(a.attributes.activities??"").split(",").map(o=>{var h;return(h=o.split("::").at(-1))==null?void 0:h.trim()}).map(o=>o?n[o]:void 0).filter(o=>!!o),Q=[...new Map([...F,...de].map(o=>[o.id,o])).values()],X=l("Realizes","functionalRealizesOperative").filter(o=>o.targetId===a.id).map(o=>n[o.sourceId]).filter(o=>!!o&&o.layer==="functional"),ue=X.flatMap(o=>l("Realizes","uIRealizesFunctional").filter(h=>h.targetId===o.id).map(h=>n[h.sourceId]).filter(h=>!!h&&h.layer==="usability")),M=new Set([a.id,...Q.map(o=>o.id)]);let _=!0;for(;_;){_=!1;for(const o of s)o.parentAction&&M.has(o.parentAction)&&!M.has(o.id)&&(M.add(o.id),_=!0)}const pe=(r.diagrams??[]).filter(o=>{var h;return((h=o.elementIds)==null?void 0:h.some(me=>M.has(me)))||o.name.toLowerCase().includes(a.name.toLowerCase())});return{scenario:a,activities:Q,functionalScenarios:X,uiScenarios:ue,views:pe}}),V=O.map(a=>({workflow:a,scenarios:G.filter(({scenario:F})=>x(F.attributes.parentWorkflow,a.id))}));return{useCase:t,workflows:V,depth:C.get(t.id)??0,hasChildren:(((J=f.get(t.id))==null?void 0:J.length)??0)>0}}).filter(t=>k(t.useCase)||t.workflows.some(({workflow:i,scenarios:u})=>k(i)||u.some(({scenario:W,activities:O,functionalScenarios:G,uiScenarios:V})=>k(W)||O.some(k)||G.some(k)||V.some(k))))},[r,N]),d=b&&r?r.elements[b]:null,$=p.useMemo(()=>xe(r,b||""),[r,b]),g=p.useMemo(()=>c||(d?Z(d.doc||""):[]),[d,c]),te=p.useCallback(()=>{d&&y(Z(d.doc||""))},[d]),le=p.useCallback(()=>{if(!d||!c)return;const s=ge(c);fe({...d,doc:s}),y(null)},[d,c]),H=p.useCallback(()=>{if(!B.trim())return;const s=[...c||g,{index:g.length,text:B.trim()}];y(s),q("")},[B,c,g]),ne=p.useCallback(s=>{const n=(c||g).filter((l,x)=>x!==s);y(n)},[c,g]),Y=p.useCallback((s,n)=>{const l=[...c||g],x=s+n;x<0||x>=l.length||([l[s],l[x]]=[l[x],l[s]],y(l))},[c,g]),oe=p.useCallback((s,n)=>{const l=[...c||g];l[s]={...l[s],text:n},y(l)},[c,g]),ae=p.useMemo(()=>{if(!r||!D)return[];const s=D.toLowerCase();return Object.values(r.elements).filter(n=>n.id!==b&&n.name.toLowerCase().includes(s)).slice(0,10)},[r,D,b]),[re,ce]=p.useState(new Set),ie=s=>{ce(n=>{const l=new Set(n);return l.has(s)?l.delete(s):l.add(s),l})};return e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"w-72 flex flex-col overflow-hidden",style:{background:"#FFFFFF",borderRight:"1px solid #E5E5E0"},children:[e.jsxs("div",{className:"px-3 py-2",style:{borderBottom:"1px solid #E5E5E0"},children:[e.jsx("div",{style:{color:"#1B3A4B",fontSize:"12px",fontWeight:700,marginBottom:7},children:"Use-Case Hierarchy"}),e.jsx("input",{type:"text",placeholder:"Search "+z.length+" use cases...",value:N,onChange:s=>se(s.target.value),className:"w-full px-3 py-2 text-sm rounded-lg focus:outline-none",style:{background:"#F7F7F5",border:"1px solid #E5E5E0",color:"#1a1a1a"}})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto text-xs py-1",children:[z.map(({useCase:s,workflows:n,depth:l,hasChildren:x})=>{const j="use-case:"+s.id,w=re.has(j);return e.jsxs("div",{className:"mb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 cursor-pointer",style:{borderRadius:"6px",margin:"0 4px",marginLeft:4+l*14},onMouseEnter:f=>f.currentTarget.style.background="#F0F0ED",onMouseLeave:f=>f.currentTarget.style.background="transparent",onClick:()=>{m(s.id),y(null),ie(j)},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded flex-shrink-0",style:{backgroundColor:R.functional,borderRadius:"3px"}}),e.jsx("span",{className:"font-medium flex-1",style:{color:"#374151"},children:s.name}),e.jsx("span",{style:{color:"#9CA3AF"},children:x?"Parent use case":"Leaf use case"}),e.jsx("span",{style:{color:"#D1D5DB"},children:w?"▸":"▾"})]}),!w&&e.jsx("div",{className:"ml-5 border-l pl-2",style:{borderColor:"#E5E5E0"},children:n.map(({workflow:f,scenarios:S})=>e.jsxs("div",{className:"mb-1",children:[e.jsx("button",{onClick:()=>{m(f.id),y(null)},className:"block w-full px-2 py-1 text-left truncate rounded",style:{color:"#374151",fontWeight:600},children:f.name}),e.jsxs("div",{className:"ml-3 border-l pl-2",style:{borderColor:"#D8E2E9"},children:[S.map(({scenario:C,activities:L,functionalScenarios:A,uiScenarios:U,views:k})=>e.jsxs("div",{className:"mb-1",children:[e.jsx("button",{onClick:()=>{m(C.id),y(null)},className:"block w-full px-2 py-1 text-left truncate rounded",style:{color:"#1B3A4B",fontWeight:500},children:C.name}),e.jsxs("div",{className:"ml-3 border-l pl-2",style:{borderColor:"#E5E5E0"},children:[[["Activity diagram",L],["Function flow",A],["Interaction sequence",U]].filter(([,t])=>t.length>0).map(([t,i])=>e.jsxs("div",{children:[e.jsx("div",{className:"pt-1",style:{color:"#6B7280",fontSize:"10px"},children:t}),i.map(u=>e.jsx("button",{onClick:()=>{m(u.id),y(null)},className:"block w-full px-1 py-0.5 text-left truncate rounded",style:{color:"#4B5563"},children:u.name},u.id))]},t)),ye(k).map(t=>e.jsxs("div",{children:[e.jsx("div",{className:"pt-1",style:{color:"#6B7280",fontSize:"10px"},children:t.label}),t.items.map(i=>e.jsx("button",{onClick:()=>{I("diagram"),ee({type:"diagram",diagramId:i.id})},className:"block w-full px-1 py-0.5 text-left truncate rounded",style:{color:"#2563EB"},children:i.name},i.id))]},t.label))]})]},C.id)),S.length===0&&e.jsx("div",{className:"px-2 py-1",style:{color:"#9CA3AF",fontSize:"10px"},children:"No scenarios"})]})]},f.id))})]},s.id)}),z.length===0&&e.jsx("div",{className:"px-4 py-8 text-center",style:{color:"#9CA3AF"},children:"No use-case scenario chains found."})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:"#F7F7F5"},children:[!d&&e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"#9CA3AF"},children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{style:{fontSize:"32px",marginBottom:"8px",opacity:.5},children:"▶"}),e.jsx("div",{className:"text-sm",children:"Select a scenario to edit steps and link elements"})]})}),d&&e.jsxs("div",{className:"max-w-2xl",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold",style:{color:"#1a1a1a"},children:d.name}),e.jsx("span",{className:"px-2 py-0.5 text-xs rounded-md font-medium",style:{background:"#E67E2218",color:"#E67E22"},children:d.kind})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"#6B7280"},children:"Steps"}),!c&&e.jsx("button",{onClick:te,className:"px-2 py-0.5 text-xs rounded",style:{background:"#2DD4A815",color:"#1B3A4B",border:"1px solid #2DD4A840"},children:"Edit"}),c&&e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:le,className:"px-2 py-0.5 text-xs rounded font-medium",style:{background:"#2DD4A8",color:"#FFFFFF"},children:"Save"}),e.jsx("button",{onClick:()=>y(null),className:"px-2 py-0.5 text-xs rounded",style:{background:"#F3F4F6",color:"#6B7280"},children:"Cancel"})]})]}),e.jsx("div",{className:"space-y-1",children:g.map((s,n)=>e.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium",style:{background:"#2DD4A815",color:"#1B3A4B"},children:n+1}),c?e.jsx("input",{type:"text",value:s.text,onChange:l=>oe(n,l.target.value),className:"flex-1 text-sm px-2 py-1 rounded focus:outline-none",style:{border:"1px solid #E5E5E0",color:"#374151"}}):e.jsx("span",{className:"flex-1 text-sm",style:{color:"#374151"},children:s.text}),c&&e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx("button",{onClick:()=>Y(n,-1),className:"px-1 text-xs",style:{color:"#9CA3AF"},title:"Move up",children:"▲"}),e.jsx("button",{onClick:()=>Y(n,1),className:"px-1 text-xs",style:{color:"#9CA3AF"},title:"Move down",children:"▼"}),e.jsx("button",{onClick:()=>ne(n),className:"px-1 text-xs",style:{color:"#E74C3C"},title:"Remove",children:"✕"})]})]},n))}),c&&e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{type:"text",value:B,onChange:s=>q(s.target.value),onKeyDown:s=>s.key==="Enter"&&H(),placeholder:"Add a step...",className:"flex-1 text-sm px-3 py-2 rounded-lg focus:outline-none",style:{background:"#FFFFFF",border:"1px solid #E5E5E0",color:"#374151"}}),e.jsx("button",{onClick:H,className:"px-3 py-2 text-xs rounded-lg font-medium",style:{background:"#2DD4A815",color:"#1B3A4B",border:"1px solid #2DD4A840"},children:"+ Add"})]}),g.length===0&&!c&&e.jsx("div",{className:"text-xs p-3 rounded-lg",style:{background:"#F3F4F6",color:"#9CA3AF"},children:"No steps defined. Click Edit to add scenario steps."})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"#6B7280"},children:["Linked Elements (",$.length,")"]}),e.jsx("button",{onClick:()=>K(T===null?0:null),className:"px-2 py-0.5 text-xs rounded",style:{background:"#4A90D915",color:"#4A90D9",border:"1px solid #4A90D940"},children:T!==null?"Done":"+ Link"})]}),T!==null&&e.jsxs("div",{className:"mb-2 p-2 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #4A90D940"},children:[e.jsx("input",{type:"text",value:D,onChange:s=>P(s.target.value),placeholder:"Search elements to link...",className:"w-full text-sm px-2 py-1 rounded focus:outline-none mb-1",style:{border:"1px solid #E5E5E0",color:"#374151"}}),ae.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 text-xs rounded cursor-pointer",onMouseEnter:n=>n.currentTarget.style.background="#F0F0ED",onMouseLeave:n=>n.currentTarget.style.background="transparent",onClick:()=>{v({type:"traceTo",sourceId:d.id,targetId:s.id,direction:"outgoing",selectedElementId:d.id}),P(""),K(null)},children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:R[s.layer]||"#95A5A6"}}),e.jsx("span",{style:{color:"#374151"},children:s.name}),e.jsx("span",{style:{color:"#9CA3AF"},children:s.kind})]},s.id))]}),e.jsx("div",{className:"space-y-1",children:$.map(s=>{const n=s.sourceId===d.id?s.targetId:s.sourceId,l=r.elements[n],x=s.sourceId===d.id?"→":"←";return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-lg cursor-pointer",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},onMouseEnter:j=>j.currentTarget.style.background="#F0F0ED",onMouseLeave:j=>j.currentTarget.style.background="#FFFFFF",onClick:()=>m(n),children:[e.jsx("span",{style:{color:"#9CA3AF"},children:x}),e.jsx("span",{className:"font-medium",style:{color:"#2563EB"},children:s.type}),e.jsx("span",{style:{color:"#374151"},children:(l==null?void 0:l.name)||n}),l&&e.jsx("span",{className:"ml-auto px-1.5 py-0.5 rounded text-xs",style:{background:(R[l.layer]||"#95A5A6")+"18",color:R[l.layer]||"#95A5A6"},children:l.kind})]},s.id)})})]}),e.jsx("div",{className:"text-xs",style:{color:"#D1D5DB"},children:d.file})]})]})]})}export{ke as ScenarioEditor};
@@ -1 +0,0 @@
1
- /*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-slate-50:oklch(98.4% .003 247.858);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-7{top:calc(var(--spacing) * 7)}.top-16{top:calc(var(--spacing) * 16)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-3{right:calc(var(--spacing) * 3)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-12{bottom:calc(var(--spacing) * 12)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.left-full{left:100%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-6{margin-inline:calc(var(--spacing) * -6)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-3{margin-left:calc(var(--spacing) * 3)}.ml-5{margin-left:calc(var(--spacing) * 5)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-20{width:calc(var(--spacing) * 20)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[80px\]{min-width:80px}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.bg-slate-50{background-color:var(--color-slate-50)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2{padding-left:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.text-red-500{color:var(--color-red-500)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}:root{--color-bg:#f7f7f5;--color-surface:#fff;--color-surface-alt:#f0f0ed;--color-border:#e5e5e0;--color-border-light:#ededea;--color-text:#1a1a1a;--color-text-secondary:#6b7280;--color-text-muted:#9ca3af;--color-accent:#2dd4a8;--color-hero-from:#1b3a4b;--color-hero-to:#2d6a7a}body{background:var(--color-bg);color:var(--color-text);-webkit-font-smoothing:antialiased;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Inter,Roboto,sans-serif}#root{flex-direction:column;height:100vh;display:flex}.react-flow__controls{overflow:hidden;border:1px solid #e5e5e0!important;border-radius:12px!important;box-shadow:0 1px 3px #0000000f!important}.react-flow__controls-button{fill:#6b7280!important;background:#fff!important;border-bottom:1px solid #ededea!important}.react-flow__controls-button:hover{background:#f0f0ed!important}.react-flow__minimap{overflow:hidden;border:1px solid #e5e5e0!important;border-radius:12px!important;box-shadow:0 1px 3px #0000000f!important}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}.memo-explorer-resizer{z-index:30;cursor:col-resize;touch-action:none;outline:none;width:8px;position:absolute;top:0;bottom:0;right:-4px}.memo-explorer-resizer:after{content:"";background:0 0;width:2px;transition:background .12s;position:absolute;top:0;bottom:0;right:3px}.memo-explorer-resizer:hover:after,.memo-explorer-resizer:focus-visible:after{background:#38bdf8}.react-flow__node{transition:box-shadow .15s,opacity .15s}.ibd-interconnection-edge .react-flow__edge-interaction{pointer-events:none}@keyframes memo-ibd-flow{to{stroke-dashoffset:-30px}}.memo-ibd-flow{stroke-dasharray:8 7;pointer-events:none;animation:.7s linear infinite memo-ibd-flow}@media(prefers-reduced-motion:reduce){.memo-ibd-flow{animation:none}}.react-flow__edge path{transition:stroke-width .15s}.react-flow__edge:hover path{stroke-width:3px}.react-flow__node:hover .react-flow__handle{opacity:1!important}.react-flow__node:hover .react-flow__handle.ibd-port-anchor,.react-flow__handle.ibd-port-anchor{opacity:0!important;pointer-events:none!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}