@memoarchitect/architect 0.6.6 → 0.8.26

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 (93) hide show
  1. package/README.md +26 -4
  2. package/dist/assets/AiWorkspace-Z3BbnmaP.js +7 -0
  3. package/dist/assets/AnalysisWorkspace-DjaUOo7U.js +39 -0
  4. package/dist/assets/{ComplianceWizard-k98NZ2ec.js → ComplianceWizard-DKxZ1z25.js} +1 -1
  5. package/dist/assets/DSMView-DJhmrXYm.js +5 -0
  6. package/dist/assets/Dashboard-CYT7KjqU.js +1 -0
  7. package/dist/assets/DhfDashboard-DacdOtkU.js +1 -0
  8. package/dist/assets/DhfWorkbench-CIhopT8J.js +69 -0
  9. package/dist/assets/DiagramCanvas-CLE_nv7Y.js +4 -0
  10. package/dist/assets/DiagramEditor-puQuE8gB.js +4 -0
  11. package/dist/assets/DiagramToolbarControls-XMGLx08e.js +1 -0
  12. package/dist/assets/ElementDetailView-D5XvAL_i.js +2 -0
  13. package/dist/assets/ExplorerTreeRow-DUmcEsqf.js +3 -0
  14. package/dist/assets/{ImportView-CyMm-tSP.js → ImportView-9y1nhQS4.js} +1 -1
  15. package/dist/assets/{LayerGrid-DNPZYTsD.js → LayerGrid-bhFpOIbe.js} +1 -1
  16. package/dist/assets/{LayerTable-DhOq1DHo.js → LayerTable-RuswZVUI.js} +2 -2
  17. package/dist/assets/{MaxGraphCanvas-DqKU1PTY.js → MaxGraphCanvas-D3BXQK2y.js} +6 -6
  18. package/dist/assets/{ModelDiff-BbqIoesG.js → ModelDiff-Cl2dhlk3.js} +1 -1
  19. package/dist/assets/OntologyDecompositionDiagram-aONGngg4.js +1 -0
  20. package/dist/assets/{OntologyViewer-BIpJC66j.js → OntologyViewer-VOrKTRuQ.js} +2 -2
  21. package/dist/assets/{RelationshipOverlay-B9bqt4zl.js → RelationshipOverlay-B3AN-bM-.js} +1 -1
  22. package/dist/assets/{RelationshipsSection-DttMvF2i.js → RelationshipsSection-DggeGBKP.js} +1 -1
  23. package/dist/assets/{ReviewDashboard-DKoExM8K.js → ReviewDashboard--LMXZ3F4.js} +1 -1
  24. package/dist/assets/ScenarioEditor-bB4iBbgO.js +3 -0
  25. package/dist/assets/{StatisticsDashboard-B8BduIDz.js → StatisticsDashboard-iXimfU20.js} +1 -1
  26. package/dist/assets/{SysmlCodeEditor-Die2RUsz.js → SysmlCodeEditor-i0BHj3of.js} +117 -117
  27. package/dist/assets/TabularView-DnIfq-TB.js +1 -0
  28. package/dist/assets/TraceabilityMatrix-eilGn6Sr.js +3 -0
  29. package/dist/assets/UiScreensWorkspace-Cs1ivqzc.js +1 -0
  30. package/dist/assets/{WorkflowWizard-7--f9OH2.js → WorkflowWizard-C7jI6C59.js} +1 -1
  31. package/dist/assets/html2canvas.esm-QH1iLAAe.js +22 -0
  32. package/dist/assets/index-CG-gfw-s.js +4067 -0
  33. package/dist/assets/index-DXB4CKwW.css +1 -0
  34. package/dist/assets/index.es-DABt8CUc.js +18 -0
  35. package/dist/assets/jspdf.es.min-G-Vwo9yG.js +170 -0
  36. package/dist/assets/{layout-providers-Dr743WlP.js → layout-providers-BSDYNZu0.js} +1 -1
  37. package/dist/assets/notation-scene-DLZms6VR.js +1 -0
  38. package/dist/assets/purify.es-DP5U8-sc.js +3 -0
  39. package/dist/assets/{reactflow-CsCqNKB-.js → reactflow-C9OlmOYw.js} +5 -5
  40. package/dist/assets/xlsx-CkFp8p6R.js +105 -0
  41. package/dist/index.html +3 -3
  42. package/dist-standalone/index.html +5504 -0
  43. package/lib/__tests__/compiler-bundling.test.d.ts +2 -0
  44. package/lib/__tests__/compiler-bundling.test.d.ts.map +1 -0
  45. package/lib/__tests__/compiler-bundling.test.js +32 -0
  46. package/lib/__tests__/compiler-bundling.test.js.map +1 -0
  47. package/lib/__tests__/standalone-distribution.test.d.ts +2 -0
  48. package/lib/__tests__/standalone-distribution.test.d.ts.map +1 -0
  49. package/lib/__tests__/standalone-distribution.test.js +51 -0
  50. package/lib/__tests__/standalone-distribution.test.js.map +1 -0
  51. package/lib/__tests__/standard-sysml-diagrams-smoke.test.d.ts +2 -0
  52. package/lib/__tests__/standard-sysml-diagrams-smoke.test.d.ts.map +1 -0
  53. package/lib/__tests__/standard-sysml-diagrams-smoke.test.js +22 -0
  54. package/lib/__tests__/standard-sysml-diagrams-smoke.test.js.map +1 -0
  55. package/lib/__tests__/supervised-child-args.test.d.ts +2 -0
  56. package/lib/__tests__/supervised-child-args.test.d.ts.map +1 -0
  57. package/lib/__tests__/supervised-child-args.test.js +55 -0
  58. package/lib/__tests__/supervised-child-args.test.js.map +1 -0
  59. package/lib/bin/memo-architect.js +30 -4
  60. package/lib/bin/memo-architect.js.map +1 -1
  61. package/lib/commands/build.d.ts.map +1 -1
  62. package/lib/commands/build.js +15 -18
  63. package/lib/commands/build.js.map +1 -1
  64. package/lib/commands/dev.d.ts +32 -2
  65. package/lib/commands/dev.d.ts.map +1 -1
  66. package/lib/commands/dev.js +95 -8
  67. package/lib/commands/dev.js.map +1 -1
  68. package/lib/commands/example.d.ts +1 -0
  69. package/lib/commands/example.d.ts.map +1 -1
  70. package/lib/commands/example.js +2 -0
  71. package/lib/commands/example.js.map +1 -1
  72. package/lib/feature-grants.d.ts.map +1 -1
  73. package/lib/feature-grants.js +3 -1
  74. package/lib/feature-grants.js.map +1 -1
  75. package/package.json +16 -6
  76. package/dist/assets/AiWorkspace-DS79vBOT.js +0 -3
  77. package/dist/assets/AnalysisWorkspace-D_u4shRY.js +0 -39
  78. package/dist/assets/DSMView-DGheBwZ0.js +0 -1
  79. package/dist/assets/Dashboard-BRUQvUFK.js +0 -1
  80. package/dist/assets/DhfDashboard-B9V_n7kg.js +0 -1
  81. package/dist/assets/DhfSettingsPanel-B8aLsWn6.js +0 -1
  82. package/dist/assets/DhfWorkbench-TOnZkdUU.js +0 -69
  83. package/dist/assets/DiagramCanvas-B9d4aLKt.js +0 -1
  84. package/dist/assets/DiagramEditor-CJ7OG2IC.js +0 -4
  85. package/dist/assets/ElementDetailView-CDcm1rvf.js +0 -2
  86. package/dist/assets/OntologyDecompositionDiagram-DkxTe2C_.js +0 -1
  87. package/dist/assets/ScenarioEditor-JQ3huCnz.js +0 -3
  88. package/dist/assets/TabularView-BXfFSluC.js +0 -1
  89. package/dist/assets/TraceabilityMatrix-CHZHFucA.js +0 -1
  90. package/dist/assets/editor.worker-DyuDvpVp.js +0 -26
  91. package/dist/assets/index-CVW92JY7.js +0 -3280
  92. package/dist/assets/index-Y1UZTZg-.css +0 -1
  93. package/dist/assets/layout-selection-ClQ295Xc.js +0 -1
@@ -0,0 +1,69 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CG-gfw-s.js","assets/reactflow-C9OlmOYw.js","assets/zustand-CrhqMOHB.js","assets/index-DXB4CKwW.css"])))=>i.map(i=>d[i]);
2
+ import{u as $,p as te,M as oe,_ as ne}from"./index-CG-gfw-s.js";import{j as e}from"./reactflow-C9OlmOYw.js";import{a as f}from"./zustand-CrhqMOHB.js";const re=/<div class="memo-doc-diagram" data-diagram-id="([^"]*)"><\/div>/;function m(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function U(t,r){const n=t.split(`
3
+ `).map(o=>o.trim()).filter(Boolean);return n.length===0?`<tr><td colspan="4" style="color:#9CA3AF;font-style:italic">No ${r.toLowerCase()}s defined</td></tr>`:n.map(o=>{const[s="",a=""]=o.split("|").map(u=>u.trim());return`<tr><td>${m(s)}</td><td>${m(a||r)}</td><td style="color:#9CA3AF">—</td><td style="color:#9CA3AF">—</td></tr>`}).join("")}function ie(t){const r=t.authors.trim().length>0,n=t.approvers.trim().length>0,o="<thead><tr><th>Name</th><th>Role</th><th>Signature</th><th>Date</th></tr></thead>";return`
4
+ <h2>Authors</h2>
5
+ <table>${o}<tbody>${U(t.authors,"Author")}</tbody></table>
6
+ ${r?"":'<p style="font-size:11px;color:#dc2626">⚠ No authors set — open Document Properties to add authors.</p>'}
7
+ <h2>Approvers</h2>
8
+ <table>${o}<tbody>${U(t.approvers,"Approver")}</tbody></table>
9
+ ${n?"":'<p style="font-size:11px;color:#dc2626">⚠ No approvers set — open Document Properties to add approvers.</p>'}`}function se(t){const r=[],n=/^(#{2,4})\s+(.+)$/gm;let o;for(;(o=n.exec(t))!==null;){const s=(o[1].length-2)*18;r.push(`<div style="margin-left:${s}px">${m(o[2].trim())}</div>`)}return r.length===0?"":`<h2>Table of Contents</h2><div class="memo-doc-toc">${r.join("")}</div>`}function le(t,r,n,o,s){t=t.replace(/\{\{include:shared\/snippets\/approval-block\.md\}\}/g,()=>ie(o)),t=t.replace(/\{\{include:([^}]+)\}\}/g,(l,d)=>`<span class="directive-placeholder">[Snippet: ${m(d)} — rendered on export]</span>`);const a={company:n.company,product:n.product,device_type:n.deviceType,version:n.version,phase:n.phase};t=t.replace(/\{\{project\.([^}]+)\}\}/g,(l,d)=>{const x=a[d];return x&&x.trim()?m(x):`<span class="directive-error">⚠ {{project.${m(d)}}} — not set</span>`}),t=t.replace(/\{\{ref:([^.}]+)(?:\.(\w+))?\}\}/g,(l,d,x)=>{if(!r)return`<code>${m(d)}</code>`;const p=r.elements[d];return p?m(!x||x==="name"?p.name:String(p[x]??p.name)):`<em>[${m(d)} not found]</em>`}),t=t.replace(/\{\{diagram:([^}]+)\}\}/g,(l,d)=>s.diagrams==="note"?`<p><strong>[Diagram: ${m(d.trim())}]</strong> <em>— view in MEMO Architect</em></p>`:`<div class="memo-doc-diagram" data-diagram-id="${m(d.trim())}"></div>`),t=t.replace(/\{\{toc\}\}/g,()=>s.resolveToc?se(t):'<span class="directive-placeholder">[TOC — generated on export]</span>'),t=t.replace(/\{\{glossary\}\}/g,'<span class="directive-placeholder">[Glossary — generated on export]</span>'),t=t.replace(/\{\{[^}]+\}\}/g,l=>`<span class="directive-placeholder">${m(l)}</span>`);const u=[];for(const l of t.matchAll(/<!--[\s\S]*?-->/g))u.push([l.index,l.index+l[0].length]);return t=t.replace(/```memo-query\r?\n([\s\S]*?)```/g,(l,d,x)=>{if(u.some(([h,C])=>x>=h&&x<C))return l;const p=d.split(`
10
+ `).filter(Boolean),j=h=>(p.find(C=>C.startsWith(h))??"").replace(h,"").trim(),c=j("kind:")||"?",k=j("display:")||"table",y=j("empty:").replace(/^['"]|['"]$/g,"")||"No results found.",b=j("label:")||c;if(!r)return`<div class="query-preview">⟳ <em>memo-query: ${m(c)} (${m(k)})</em></div>`;const w=c.startsWith("[")||c.startsWith("-")?c.replace(/[\[\]]/g,"").split(/[,\n]/).map(h=>h.replace("-","").trim()).filter(Boolean):[c];if(j("select:")==="relationships"){const h=(r.relationships??[]).filter(S=>c==="?"||w.includes(S.type));if(h.length===0)return`<div class="query-preview empty"><em>${m(y)}</em></div>`;if(k==="count")return`<div class="query-preview count"><strong>${h.length}</strong><span>${m(b)}</span></div>`;const C=["source","type","target"],R=C.map(S=>`<th>${S}</th>`).join(""),q=S=>{var i;return((i=r.elements[S])==null?void 0:i.name)??S},v=h.slice(0,10).map(S=>`<tr>${[q(S.sourceId),S.type,q(S.targetId)].map(A=>`<td>${m(String(A))}</td>`).join("")}</tr>`).join(""),T=h.length>10?`<tr><td colspan="${C.length}" style="color:#9CA3AF;font-size:11px">…and ${h.length-10} more</td></tr>`:"";return`<div class="query-preview"><table><thead><tr>${R}</tr></thead><tbody>${v}${T}</tbody></table></div>`}const g=Object.values(r.elements).filter(h=>w.includes(h.kind));if(g.length===0)return`<div class="query-preview empty"><em>${m(y)}</em></div>`;if(k==="count")return`<div class="query-preview count"><strong>${g.length}</strong><span>${m(b)}</span></div>`;const B=["name","kind","layer"],F=B.map(h=>`<th>${h}</th>`).join(""),M=g.slice(0,10).map(h=>`<tr>${B.map(R=>`<td>${m(String(h[R]??"—"))}</td>`).join("")}</tr>`).join(""),z=g.length>10?`<tr><td colspan="${B.length}" style="color:#9CA3AF;font-size:11px">…and ${g.length-10} more</td></tr>`:"";return`<div class="query-preview"><table><thead><tr>${F}</tr></thead><tbody>${M}${z}</tbody></table></div>`}),t=t.replace(/```memo-script\r?\n([\s\S]*?)```/g,'<div class="query-preview script"><em>memo-script — executed on export</em></div>'),t}function D(t){return t.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/_([^_]+)_/g,"<em>$1</em>").replace(/`([^`]+)`/g,(r,n)=>`<code>${m(n)}</code>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>')}const V=/^\|\s*:?-{2,}.*\|$/;function ae(t){const r=[],n=t.split(/\r?\n/);let o=0,s=[];const a=()=>{s.length>0&&(r.push(`<p>${D(s.join(" "))}</p>`),s=[])};for(;o<n.length;){const u=n[o],l=u.trim();if(l===""){a(),o++;continue}if(l.startsWith("<")){a(),r.push(u),o++;continue}if(l.match(/^```(\w[\w-]*)?/)){a();const c=[];for(o++;o<n.length&&!n[o].trim().startsWith("```");)c.push(n[o]),o++;o++,r.push(`<pre><code>${m(c.join(`
11
+ `))}</code></pre>`);continue}const x=l.match(/^(#{1,6})\s+(.+)$/);if(x){a();const c=x[1].length;r.push(`<h${c}>${D(x[2])}</h${c}>`),o++;continue}if(/^(-{3,}|\*{3,})$/.test(l)){a(),r.push("<hr>"),o++;continue}if(l.startsWith("> ")||l===">"){a();const c=[];for(;o<n.length&&(n[o].trim().startsWith("> ")||n[o].trim()===">");)c.push(n[o].trim().replace(/^>\s?/,"")),o++;r.push(`<blockquote>${D(c.join(" "))}</blockquote>`);continue}if(l.startsWith("|")&&l.endsWith("|")){a();const c=[];for(;o<n.length&&n[o].trim().startsWith("|")&&n[o].trim().endsWith("|");)c.push(n[o].trim()),o++;const k=g=>g.slice(1,-1).split("|").map(B=>B.trim()),y=c.length>1&&V.test(c[1]),b=y?c.slice(2):c;let w="<table>";y&&(w+=`<thead><tr>${k(c[0]).map(g=>`<th>${D(g)}</th>`).join("")}</tr></thead>`),w+=`<tbody>${b.filter(g=>!V.test(g)).map(g=>`<tr>${k(g).map(B=>`<td>${D(B)}</td>`).join("")}</tr>`).join("")}</tbody></table>`,r.push(w);continue}const p=/^[-*]\s+/.test(l),j=/^\d+\.\s+/.test(l);if(p||j){a();const c=p?"ul":"ol",k=p?/^[-*]\s+/:/^\d+\.\s+/,y=[];for(;o<n.length;){const b=n[o].trim();if(k.test(b))y.push(b.replace(k,"")),o++;else if(b!==""&&/^\s{2,}/.test(n[o])&&y.length>0)y[y.length-1]+=` ${b}`,o++;else break}r.push(`<${c}>${y.map(b=>`<li>${D(b)}</li>`).join("")}</${c}>`);continue}s.push(l),o++}return a(),r.join(`
12
+ `)}function Q(t,r,n,o,s={}){const a=t.replace(/^---[\s\S]*?---\r?\n/,""),u=le(a,r,n,o,s);return ae(u)}const de="#2DD4A8";function X(t){const r=t.primaryColor||"#1B3A4B",n=de,o=t.compactMode?.9:1,s=a=>`${Math.round(a*o)}px`;return`
13
+ .memo-doc{font-size:${s(14)};line-height:1.7;color:#1B3A4B;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
14
+ .memo-doc h1{font-size:${s(22)};font-weight:700;color:${r};border-bottom:2px solid ${n};padding-bottom:8px;margin:0 0 20px}
15
+ .memo-doc h2{font-size:${s(17)};font-weight:700;color:${r};margin:28px 0 12px}
16
+ .memo-doc h3{font-size:${s(14)};font-weight:600;color:#374151;margin:20px 0 8px}
17
+ .memo-doc h4{font-size:${s(13)};font-weight:600;color:#6B7280;margin:12px 0 6px}
18
+ .memo-doc h5,.memo-doc h6{font-size:${s(12)};font-weight:600;color:#6B7280;margin:10px 0 5px}
19
+ .memo-doc p{margin:8px 0}
20
+ .memo-doc ul,.memo-doc ol{margin:8px 0;padding-left:24px}
21
+ .memo-doc li{margin:3px 0}
22
+ .memo-doc table{border-collapse:collapse;width:100%;margin:12px 0;font-size:${s(12)}}
23
+ .memo-doc th,.memo-doc td{border:1px solid #e5e7eb;padding:6px 10px;text-align:left;vertical-align:top}
24
+ .memo-doc th{background:#f3f4f6;font-weight:600}
25
+ .memo-doc code{background:#f3f4f6;padding:1px 5px;border-radius:3px;font-family:monospace;font-size:${s(12)}}
26
+ .memo-doc pre{background:#1e293b;color:#e2e8f0;padding:14px;border-radius:6px;overflow-x:auto}
27
+ .memo-doc pre code{background:none;color:inherit;padding:0}
28
+ .memo-doc blockquote{border-left:3px solid ${n};margin:12px 0;padding:6px 14px;background:#f0fdf9;font-style:italic;color:#374151}
29
+ .memo-doc hr{border:none;border-top:1px solid #e5e7eb;margin:24px 0}
30
+ .memo-doc a{color:${r};text-decoration:underline}
31
+ .memo-doc .directive-placeholder{color:#8B5CF6;font-style:normal;font-size:${s(12)};background:#F5F3FF;padding:1px 5px;border-radius:3px;display:inline-block}
32
+ .memo-doc .directive-error{color:#DC2626;font-size:${s(12)};background:#FEF2F2;border:1px solid #FECACA;padding:1px 6px;border-radius:3px;display:inline-block;font-family:monospace}
33
+ .memo-doc .query-preview{background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;padding:10px 14px;margin:10px 0;font-size:${s(12)}}
34
+ .memo-doc .query-preview.empty{color:#9CA3AF}
35
+ .memo-doc .query-preview.count{display:flex;align-items:baseline;gap:6px}
36
+ .memo-doc .query-preview.count strong{font-size:${s(24)};color:#2563eb;font-weight:700}
37
+ .memo-doc .query-preview.count span{font-size:${s(13)};color:#6B7280}
38
+ .memo-doc .query-preview.script{color:#7c3aed;font-style:italic}
39
+ @media print {
40
+ .memo-doc{font-size:11pt;color:#000}
41
+ .memo-doc .query-preview{border:1px solid #ccc;background:#fff}
42
+ .memo-doc .directive-placeholder,.memo-doc .directive-error{background:#fff;border:1px dashed #999;color:#555}
43
+ .memo-doc h2{break-after:avoid}
44
+ .memo-doc table{break-inside:avoid}
45
+ }`}const ce=`
46
+ body{margin:0;padding:40px;background:#fff}
47
+ .memo-doc{max-width:800px;margin:0 auto}
48
+ @media print{body{padding:0}}
49
+ `,pe=`
50
+ @page WordSection1{size:8.5in 11.0in;margin:1.0in;mso-header-margin:0.5in;mso-footer-margin:0.5in;mso-footer:f1}
51
+ div.WordSection1{page:WordSection1}
52
+ p.MsoFooter{font-size:9pt;color:#6B7280}
53
+ `;function P(t,r){return`<!--[if supportFields]><span style="mso-element:field-begin"></span><span> ${t} </span><span style="mso-element:field-separator"></span><![endif]-->${r}<!--[if supportFields]><span style="mso-element:field-end"></span><![endif]-->`}const ue=`<h2>Table of Contents</h2><p>${P('TOC \\o "1-3" \\h \\z \\u','<span style="color:#6B7280"><i>Right-click here and choose "Update Field" (or press F9) to generate the table of contents.</i></span>')}</p>`,me=`<div style="mso-element:footer" id="f1"><p class="MsoFooter" align="center" style="text-align:center">Page ${P("PAGE","1")} of ${P("NUMPAGES","1")}</p></div>`;function H(t,r,n,o={}){let s=Q(t.content,r,n,t,{resolveToc:!0,diagrams:"note"});o.word&&(s=s.replace(/<h2>Table of Contents<\/h2><div class="memo-doc-toc">[\s\S]*?<\/div>/,ue));const a=o.word?`<div class="WordSection1"><div class="memo-doc">${s}</div></div>
54
+ ${me}`:`<div class="memo-doc">${s}</div>`;return`<!DOCTYPE html>
55
+ <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word">
56
+ <head>
57
+ <meta charset="utf-8">
58
+ <title>${G(t.id)} — ${G(t.title)}</title>
59
+ ${o.word?'<meta name="ProgId" content="Word.Document"><!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View></w:WordDocument></xml><![endif]-->':""}
60
+ <style>${X(n)}${ce}${o.word?pe:""}</style>
61
+ </head>
62
+ <body>${a}</body>
63
+ </html>`}function G(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function L(t,r,n){const o=new Blob([r],{type:n}),s=URL.createObjectURL(o),a=document.createElement("a");a.href=s,a.download=t,a.click(),URL.revokeObjectURL(s)}function he(t,r,n){L(`${t.id}.html`,H(t,r,n),"text/html;charset=utf-8")}function xe(t,r,n){L(`${t.id}.doc`,H(t,r,n,{word:!0}),"application/msword")}function fe(t){L(`${t.id}.md`,t.content,"text/markdown;charset=utf-8")}function ge(t,r,n){const o=window.open("","_blank");o&&(o.document.write(H(t,r,n)),o.document.close(),o.setTimeout(()=>{o.focus(),o.print()},150))}const Y=f.lazy(()=>ne(()=>import("./index-CG-gfw-s.js").then(t=>t.a0),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.DhfSettingsPanel}))),K=[{id:"q-hazards",label:"Hazard Table",description:"All hazards in the risk layer",category:"query",code:'```memo-query\nkind: Hazard\ndisplay: table\ncolumns: name, layer, doc\nsort: name\nempty: "No hazards defined."\n```'},{id:"q-hazardous-situations",label:"Hazardous Situations",description:"All hazardous situations",category:"query",code:"```memo-query\nkind: HazardousSituation\ndisplay: table\ncolumns: name, layer, doc\nsort: name\n```"},{id:"q-risk-controls",label:"Risk Controls",description:"All risk control measures",category:"query",code:"```memo-query\nkind: RiskControlMeasure\ndisplay: table\ncolumns: name, layer, doc\nsort: name\n```"},{id:"q-requirements",label:"Requirements",description:"All system requirements",category:"query",code:"```memo-query\nkind: Requirement\ndisplay: table\ncolumns: name, layer, doc\nsort: name\n```"},{id:"q-soup",label:"SOUP List",description:"All SOUP components",category:"query",code:"```memo-query\nkind: SOUPComponent\ndisplay: table\ncolumns: name, layer, doc\n```"},{id:"q-sw-items",label:"Software Items",description:"All software items",category:"query",code:"```memo-query\nkind: SoftwareElement\ndisplay: table\ncolumns: name, layer, doc\n```"},{id:"q-test-cases",label:"Test Cases",description:"All test cases",category:"query",code:"```memo-query\nkind: TestCase\ndisplay: table\ncolumns: name, layer, doc\n```"},{id:"q-hazard-count",label:"Hazard Count (metric)",description:"Metric badge with hazard count",category:"query",code:"```memo-query\nkind: Hazard\ndisplay: count\nlabel: Total hazards\n```"},{id:"s-unmitigated",label:"Unmitigated Hazards",description:"Hazards without risk controls",category:"script",code:"```memo-script\nconst hazards = query({ kind: 'Hazard' });\nconst unmitigated = hazards.filter(h => h.mitigatedBy?.length === 0);\nif (unmitigated.length === 0) return 'All hazards have associated risk controls.';\nreturn table(unmitigated, ['name', 'layer', 'doc']);\n```"},{id:"s-coverage",label:"Requirements Coverage",description:"Requirements with/without test cases",category:"script",code:"```memo-script\nconst reqs = query({ kind: 'Requirement' });\nconst covered = reqs.filter(r => r.verifiedBy?.length > 0);\nreturn count(covered, `covered of ${reqs.length} requirements`);\n```"},{id:"i-doc-header",label:"Document Control Header",description:"Standard doc control table",category:"include",code:"{{include:shared/snippets/document-control-header.md}}"},{id:"i-approval",label:"Approval Block",description:"Reviewer/approver signature table",category:"include",code:"{{include:shared/snippets/approval-block.md}}"},{id:"i-revision",label:"Revision History",description:"Revision history table",category:"include",code:"{{include:shared/snippets/revision-history-table.md}}"},{id:"i-references",label:"References Section",description:"Normative references block",category:"include",code:"{{include:shared/snippets/references-section.md}}"},{id:"d-toc",label:"Table of Contents",description:"Auto-generated TOC (on export)",category:"directive",code:"{{toc}}"},{id:"d-glossary",label:"Glossary",description:"Auto-generated glossary (on export)",category:"directive",code:"{{glossary}}"}],Z={query:"#2563eb",script:"#7c3aed",include:"#0891b2",directive:"#6B7280"},ee={query:"Query",script:"Script",include:"Snippet",directive:"Directive"};function $e(){const t=$(i=>i.model),r=$(i=>i.activeView),n=$(i=>i.dhfDocuments),o=$(i=>i.updateDhfDocumentContent),s=$(i=>i.updateDhfDocumentMeta),a=$(i=>i.llmAvailable),u=$(i=>i.registerLlmRequest),l=$(i=>i.dhfSettings),[d,x]=f.useState("split"),p=f.useRef(null),[j,c]=f.useState(!1),[k,y]=f.useState(null),[b,w]=f.useState(!1),[g,B]=f.useState(!1),[F,M]=f.useState(!1),[z,h]=f.useState("all"),C=f.useCallback(async(i,A)=>{c(!0),y(null);const W=`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`,_=A.split("/").pop()??A;try{const E=await new Promise((O,I)=>{u(W,O,I),te(W,_),setTimeout(()=>I(new Error("Request timed out after 120 seconds.")),12e4)});o(i,E.markdown)}catch(E){y((E==null?void 0:E.message)??"Unknown error")}finally{c(!1)}},[u,o]),R=f.useCallback(i=>{if(!p.current)return;const A=p.current,W=A.selectionStart,_=A.selectionEnd,E=`
64
+
65
+ ${i.code}
66
+
67
+ `,O=A.value.slice(0,W)+E+A.value.slice(_),I=r.type==="dhf-document"?r.docId:null;I&&o(I,O),requestAnimationFrame(()=>{A.focus();const N=W+E.length;A.setSelectionRange(N,N)})},[r,o]),q=r.type==="dhf-document"?r.docId:null,v=q?n.find(i=>i.id===q):null,T=f.useMemo(()=>{const i=[];return l.company||i.push("company"),l.product||i.push("product"),i},[l]);if(!v)return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",background:"#F7F7F5",color:"#9CA3AF",gap:"12px"},children:[e.jsx(oe,{size:190}),e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:600,color:"#6B7280",marginBottom:"6px"},children:"No document selected"}),e.jsxs("div",{style:{fontSize:"12px",color:"#9CA3AF",maxWidth:"280px",lineHeight:"1.6"},children:["Use ",e.jsx("strong",{children:"+ New Document"})," in the explorer to create one, then click it to open."]})]}),e.jsxs("button",{onClick:()=>w(!0),style:{marginTop:"8px",padding:"7px 16px",borderRadius:"6px",border:"1px solid #E5E7EB",background:"#fff",fontSize:"12px",color:"#6B7280",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"},children:[e.jsx(J,{size:13})," DHF Settings"]})]}),b&&e.jsx(f.Suspense,{fallback:null,children:e.jsx(Y,{onClose:()=>w(!1)})})]});const S=z==="all"?K:K.filter(i=>i.category===z);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"#fff",overflow:"hidden"},children:[e.jsxs("div",{style:{height:"40px",display:"flex",alignItems:"center",gap:"6px",padding:"0 12px",borderBottom:"1px solid #e5e7eb",background:"#fff",flexShrink:0},children:[e.jsxs("div",{style:{flex:1,display:"flex",alignItems:"baseline",gap:"8px"},children:[e.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:"#6B7280",fontFamily:"monospace"},children:v.id}),e.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"#1B3A4B"},children:v.title})]}),e.jsxs("button",{onClick:()=>M(i=>!i),title:"Document properties (authors, approvers)",style:{padding:"3px 10px",borderRadius:"6px",border:"1px solid",borderColor:F?"#6366F1":"#E5E7EB",background:F?"#EEF2FF":"#fff",color:F?"#4338CA":"#6B7280",fontSize:"11px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:[e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Authors"]}),e.jsxs("button",{onClick:()=>B(i=>!i),title:"Scriptlets & snippets library",style:{padding:"3px 10px",borderRadius:"6px",border:"1px solid",borderColor:g?"#2DD4A8":"#E5E7EB",background:g?"#F0FDF9":"#fff",color:g?"#065F46":"#6B7280",fontSize:"11px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:[e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]}),"Snippets"]}),e.jsxs("button",{onClick:()=>C(v.id,v.templateId),disabled:!a||j,title:a?"Use AI to draft empty sections from model data":"Set ANTHROPIC_API_KEY or OPENAI_API_KEY to enable AI drafting",style:{padding:"3px 10px",borderRadius:"6px",border:"none",background:a?"#2DD4A815":"#f3f4f6",color:a?"#065F46":"#9CA3AF",fontSize:"11px",fontWeight:600,cursor:a&&!j?"pointer":"not-allowed",display:"flex",alignItems:"center",gap:"4px",opacity:j?.6:1},children:[e.jsx("span",{children:"✦"}),j?"Drafting…":"Draft with AI"]}),e.jsx(ye,{doc:v,model:t,settings:l}),e.jsx("div",{style:{display:"flex",gap:"2px",background:"#f3f4f6",borderRadius:"6px",padding:"2px"},children:["edit","split","preview"].map(i=>e.jsx("button",{onClick:()=>x(i),style:{padding:"3px 10px",borderRadius:"4px",border:"none",fontSize:"11px",fontWeight:500,cursor:"pointer",background:d===i?"#fff":"transparent",color:d===i?"#1B3A4B":"#6B7280",boxShadow:d===i?"0 1px 2px rgba(0,0,0,0.08)":"none"},children:i.charAt(0).toUpperCase()+i.slice(1)},i))}),e.jsx("button",{onClick:()=>w(!0),title:"DHF global settings",style:{padding:"4px",borderRadius:"6px",border:"1px solid #E5E7EB",background:"#fff",cursor:"pointer",color:"#6B7280",display:"flex",alignItems:"center"},children:e.jsx(J,{size:14})})]}),k&&e.jsxs("div",{style:{padding:"6px 16px",background:"#fef2f2",borderBottom:"1px solid #fecaca",fontSize:"12px",color:"#dc2626",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[e.jsxs("span",{children:["AI draft failed: ",k]}),e.jsx("button",{onClick:()=>y(null),style:{background:"none",border:"none",color:"#dc2626",cursor:"pointer",fontSize:"14px"},children:"✕"})]}),T.length>0&&e.jsxs("div",{style:{padding:"5px 16px",background:"#FFFBEB",borderBottom:"1px solid #FDE68A",fontSize:"11px",color:"#92400E",display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e.jsxs("span",{children:["Project settings incomplete — ",e.jsx("strong",{children:T.join(", ")})," not set. ",e.jsx("code",{style:{background:"#FEF3C7",padding:"0 3px",borderRadius:"2px"},children:"{{project.*}}"})," will show as errors in preview."]}),e.jsx("button",{onClick:()=>w(!0),style:{background:"none",border:"none",color:"#92400E",cursor:"pointer",fontWeight:700,fontSize:"11px",padding:0,textDecoration:"underline"},children:"Configure"})]}),F&&e.jsx(be,{doc:v,onUpdate:i=>s(v.id,i)}),e.jsxs("div",{style:{flex:1,display:"flex",overflow:"hidden"},children:[(d==="edit"||d==="split")&&e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",borderRight:d==="split"?"1px solid #e5e7eb":"none"},children:e.jsx("textarea",{ref:p,value:v.content,onChange:i=>o(v.id,i.target.value),spellCheck:!1,style:{flex:1,padding:"20px",fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace",fontSize:"13px",lineHeight:"1.7",border:"none",outline:"none",resize:"none",background:"#fafafa",color:"#1B3A4B",tabSize:2},placeholder:"Start writing your DHF document here..."})}),(d==="preview"||d==="split")&&e.jsx("div",{style:{flex:1,overflowY:"auto",padding:"20px 32px",background:"#fff"},children:e.jsx(je,{content:v.content,model:t,settings:l,doc:v})}),g&&e.jsxs("div",{style:{width:"260px",borderLeft:"1px solid #E5E7EB",display:"flex",flexDirection:"column",background:"#FAFAFA",flexShrink:0,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"10px 12px",borderBottom:"1px solid #E5E7EB",flexShrink:0},children:[e.jsx("div",{style:{fontSize:"12px",fontWeight:700,color:"#1B3A4B",marginBottom:"8px"},children:"Scriptlets & Snippets"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:["all","query","script","include","directive"].map(i=>e.jsx("button",{onClick:()=>h(i),style:{padding:"2px 8px",borderRadius:"10px",border:"none",fontSize:"10px",fontWeight:600,cursor:"pointer",background:z===i?i==="all"?"#1B3A4B":Z[i]:"#E5E7EB",color:z===i?"#fff":"#6B7280"},children:i==="all"?"All":ee[i]},i))})]}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"8px"},children:[S.map(i=>e.jsx(ve,{snippet:i,onInsert:()=>R(i)},i.id)),e.jsxs("div",{style:{fontSize:"11px",color:"#9CA3AF",padding:"8px 4px",lineHeight:"1.5"},children:["Custom scriptlets can be added to ",e.jsx("code",{style:{background:"#E5E7EB",padding:"1px 3px",borderRadius:"2px"},children:"shared/snippets/"}),"."]})]})]})]})]}),b&&e.jsx(f.Suspense,{fallback:null,children:e.jsx(Y,{onClose:()=>w(!1)})})]})}function ye({doc:t,model:r,settings:n}){const[o,s]=f.useState(!1),a=[{label:"Word (.doc)",hint:"Opens in Word / Pages",run:()=>xe(t,r,n)},{label:"PDF",hint:"Via the print dialog",run:()=>ge(t,r,n)},{label:"HTML",hint:"Standalone web page",run:()=>he(t,r,n)},{label:"Markdown",hint:"Raw document source",run:()=>fe(t)}];return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("button",{onClick:()=>s(u=>!u),title:"Export this document",style:{padding:"3px 10px",borderRadius:"6px",border:"1px solid",borderColor:o?"#1B3A4B":"#E5E7EB",background:o?"#F1F5F9":"#fff",color:"#1B3A4B",fontSize:"11px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:[e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export"]}),o&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"fixed",inset:0,zIndex:9997},onClick:()=>s(!1)}),e.jsx("div",{style:{position:"absolute",top:"28px",right:0,zIndex:9998,background:"#fff",borderRadius:"8px",border:"1px solid #E5E7EB",boxShadow:"0 8px 24px rgba(0,0,0,0.12)",padding:"4px 0",minWidth:"200px"},children:a.map(u=>e.jsxs("button",{onClick:()=>{s(!1),u.run()},style:{display:"flex",flexDirection:"column",width:"100%",padding:"7px 14px",background:"none",border:"none",textAlign:"left",cursor:"pointer"},onMouseEnter:l=>l.currentTarget.style.background="#F3F4F6",onMouseLeave:l=>l.currentTarget.style.background="none",children:[e.jsx("span",{style:{fontSize:"12px",fontWeight:600,color:"#1B3A4B"},children:u.label}),e.jsx("span",{style:{fontSize:"10px",color:"#9CA3AF"},children:u.hint})]},u.label))})]})]})}function be({doc:t,onUpdate:r}){return e.jsxs("div",{style:{borderBottom:"1px solid #E5E7EB",background:"#F9FAFB",padding:"10px 16px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",flexShrink:0},children:[e.jsxs("div",{children:[e.jsxs("label",{style:{fontSize:"10px",fontWeight:700,color:"#6B7280",textTransform:"uppercase",letterSpacing:"0.05em",display:"block",marginBottom:"4px"},children:["Authors ",e.jsx("span",{style:{color:"#9CA3AF",textTransform:"none",fontWeight:400},children:"(Name | Role, one per line)"})]}),e.jsx("textarea",{value:t.authors,onChange:n=>r({authors:n.target.value}),placeholder:`Jane Smith | Lead Engineer
68
+ Bob Jones | Quality Assurance`,rows:3,style:{width:"100%",padding:"6px 8px",border:"1px solid #D1D5DB",borderRadius:"5px",fontSize:"12px",color:"#1B3A4B",resize:"none",fontFamily:"inherit",background:"#fff",outline:"none",boxSizing:"border-box",lineHeight:"1.5"}})]}),e.jsxs("div",{children:[e.jsxs("label",{style:{fontSize:"10px",fontWeight:700,color:"#6B7280",textTransform:"uppercase",letterSpacing:"0.05em",display:"block",marginBottom:"4px"},children:["Approvers ",e.jsx("span",{style:{color:"#9CA3AF",textTransform:"none",fontWeight:400},children:"(Name | Role, one per line)"})]}),e.jsx("textarea",{value:t.approvers,onChange:n=>r({approvers:n.target.value}),placeholder:`Alice Brown | Regulatory Affairs
69
+ Dr. Carol White | Clinical Safety`,rows:3,style:{width:"100%",padding:"6px 8px",border:"1px solid #D1D5DB",borderRadius:"5px",fontSize:"12px",color:"#1B3A4B",resize:"none",fontFamily:"inherit",background:"#fff",outline:"none",boxSizing:"border-box",lineHeight:"1.5"}})]}),e.jsxs("div",{style:{gridColumn:"1 / -1",fontSize:"11px",color:"#9CA3AF",marginTop:"-4px"},children:["These populate ",e.jsx("code",{style:{background:"#E5E7EB",padding:"0 3px",borderRadius:"2px"},children:"{{include:shared/snippets/approval-block.md}}"})," in the preview and exported document."]})]})}function ve({snippet:t,onInsert:r}){const[n,o]=f.useState(!1),s=Z[t.category];return e.jsxs("div",{onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{padding:"8px 10px",borderRadius:"6px",marginBottom:"4px",border:`1px solid ${n?s+"60":"#E5E7EB"}`,background:n?s+"08":"#fff",cursor:"default"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"2px"},children:[e.jsx("span",{style:{fontSize:"9px",fontWeight:700,padding:"1px 5px",borderRadius:"3px",background:s+"18",color:s},children:ee[t.category]}),e.jsx("span",{style:{fontSize:"12px",fontWeight:600,color:"#1B3A4B",flex:1},children:t.label})]}),e.jsx("div",{style:{fontSize:"11px",color:"#6B7280",marginBottom:"6px",lineHeight:"1.4"},children:t.description}),e.jsx("button",{onClick:r,style:{padding:"3px 10px",borderRadius:"4px",border:"none",background:s,color:"#fff",fontSize:"10px",fontWeight:600,cursor:"pointer",opacity:n?1:.7},children:"Insert"})]})}function J({size:t}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function je({content:t,model:r,settings:n,doc:o}){const s=f.useMemo(()=>Q(t,r,n,o),[t,r,n,o]),a=f.useMemo(()=>X(n),[n]),u=f.useMemo(()=>s.split(new RegExp(re,"g")),[s]);return e.jsxs("div",{className:"memo-doc",children:[e.jsx("style",{children:a}),u.map((l,d)=>d%2===0?e.jsx("div",{dangerouslySetInnerHTML:{__html:l}},d):e.jsx(ke,{diagramRef:l,model:r},d))]})}function ke({diagramRef:t,model:r}){var x;const n=$(p=>p.setActiveView),o=$(p=>p.selectDiagram),s=p=>p.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/view$/,""),a=s(t),u=(r==null?void 0:r.diagrams)??[],l=u.find(p=>p.id===t)??u.find(p=>s(p.id)===a||s(p.name)===a)??u.find(p=>a.length>=6&&(s(p.name).includes(a)||s(p.id).includes(a)));if(!l)return e.jsxs("div",{style:{margin:"10px 0",padding:"10px 14px",borderRadius:"6px",border:"1px dashed #FCA5A5",background:"#FEF2F2",fontSize:"12px",color:"#DC2626"},children:["⚠ Diagram ",e.jsx("code",{style:{background:"#FEE2E2",padding:"0 4px",borderRadius:"3px"},children:t})," not found in the model — check the id in ",e.jsx("code",{style:{background:"#FEE2E2",padding:"0 4px",borderRadius:"3px"},children:"{{diagram:…}}"}),"."]});const d=()=>{o(l.id),n({type:"diagram",diagramId:l.id})};return e.jsx("div",{style:{margin:"10px 0",borderRadius:"8px",border:"1px solid #E2E8F0",background:"#F8FAFC",overflow:"hidden"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px"},children:[e.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",stroke:"#2DD4A8",strokeWidth:"1.8",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"5",rx:"1"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1"}),e.jsx("rect",{x:"8.5",y:"16",width:"7",height:"5",rx:"1"}),e.jsx("path",{d:"M6.5 8v4h11V8M12 12v4"})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#1B3A4B"},children:l.name}),e.jsxs("div",{style:{fontSize:"11px",color:"#6B7280"},children:[l.viewKind||l.diagramType,(x=l.elementIds)!=null&&x.length?` · ${l.elementIds.length} elements`:""]})]}),e.jsx("button",{onClick:d,style:{padding:"5px 12px",borderRadius:"6px",border:"none",background:"#1B3A4B",color:"#fff",fontSize:"11px",fontWeight:600,cursor:"pointer"},children:"Open diagram →"})]})})}export{$e as DhfWorkbench};