zidane-gui 9.3.1 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/out/main/chunks/{remote-hosts-B8_tzg_n.js → remote-hosts-CSiGJAfm.js} +1 -1
  2. package/out/main/chunks/{session-search-sql-2EUzjHAT.js → session-search-sql-D51BmAO2.js} +5 -5
  3. package/out/main/index.js +4397 -4086
  4. package/out/main/session-search-worker.js +1 -1
  5. package/out/preload/index.mjs +36 -2
  6. package/out/renderer/assets/{24BXRY42-eTlQfl4v.js → 24BXRY42-0UXaaWjY.js} +1 -1
  7. package/out/renderer/assets/{4FHPYW2L-BHx1bBmw.js → 4FHPYW2L-BWpHahlW.js} +1 -1
  8. package/out/renderer/assets/{4LWW3ZNH-D7lTurDT.js → 4LWW3ZNH-CPyJ9o9Y.js} +1 -1
  9. package/out/renderer/assets/{5XYWFMKW-e04QMbw9.js → 5XYWFMKW-ZZpHHfGa.js} +1 -1
  10. package/out/renderer/assets/{64PMEAB3-DTIFpDpU.js → 64PMEAB3-DOEnEuzl.js} +1 -1
  11. package/out/renderer/assets/{6BEWHPQE-BrYtHcZG.js → 6BEWHPQE-C2ZZckdj.js} +1 -1
  12. package/out/renderer/assets/{6PIGVMFT-CoAPPYTl.js → 6PIGVMFT-CRGq6eh3.js} +1 -1
  13. package/out/renderer/assets/{75JW6PN6-JbXPfJg4.js → 75JW6PN6-CYzAa9yx.js} +1 -1
  14. package/out/renderer/assets/{7XWI72E6-CFY3Kecs.js → 7XWI72E6-C_GZbyIF.js} +1 -1
  15. package/out/renderer/assets/{BGW36YJW-DhmSG9tb.js → BGW36YJW-BAwgTZ_z.js} +1 -1
  16. package/out/renderer/assets/{CGIZI67J-Cr9B0EmW.js → CGIZI67J-BxXITbQC.js} +1 -1
  17. package/out/renderer/assets/{CodeEditor-C6EJBlGG.js → CodeEditor-CLsAw7eu.js} +2 -2
  18. package/out/renderer/assets/{ComposerEditor-oFIdMkLB.js → ComposerEditor-BqnIn2NQ.js} +1 -1
  19. package/out/renderer/assets/{DNNCRC2E-CMqlK0W6.js → DNNCRC2E-kbsNJgPT.js} +1 -1
  20. package/out/renderer/assets/DiffsTab--BHt7StP.js +3 -0
  21. package/out/renderer/assets/{E67EBMDD-C_T2QnwF.js → E67EBMDD-BOeJkFNZ.js} +1 -1
  22. package/out/renderer/assets/{EFYWJBJK-Cbn-VZcb.js → EFYWJBJK-CFT5CQUG.js} +1 -1
  23. package/out/renderer/assets/{EXE5EH6O-SXdUe5We.js → EXE5EH6O-Cbj5xPKl.js} +1 -1
  24. package/out/renderer/assets/{EditorWorkers-bVeEZI8X.js → EditorWorkers-CXBU_HFf.js} +1 -1
  25. package/out/renderer/assets/{FilesTab-DtM2Q5R0.js → FilesTab-CZHD0eBx.js} +4 -4
  26. package/out/renderer/assets/{G6GPDDNC-XfFyRa0j.js → G6GPDDNC-Ax6dML4i.js} +1 -1
  27. package/out/renderer/assets/{G76NGGFM-Bj_m2WLJ.js → G76NGGFM-BxPXXNt_.js} +1 -1
  28. package/out/renderer/assets/{GH6G3TJC-wPRy41Zv.js → GH6G3TJC-CiCXY2r6.js} +1 -1
  29. package/out/renderer/assets/{HPNUA7RO-BhLNmX-t.js → HPNUA7RO-DiyW9VGu.js} +1 -1
  30. package/out/renderer/assets/{HQRGC5D7-dvTAT1Uv.js → HQRGC5D7-ArfvIYAC.js} +1 -1
  31. package/out/renderer/assets/{IX6Z2TVR-CzV_umYo.js → IX6Z2TVR-Df9chdw8.js} +1 -1
  32. package/out/renderer/assets/IconButtonTip-D0dQOfg6.js +1 -0
  33. package/out/renderer/assets/{J77NQRCJ-DTwwq3Ci.js → J77NQRCJ-DOWauTsf.js} +1 -1
  34. package/out/renderer/assets/{JAD36DTZ-DArKsMUT.js → JAD36DTZ-CJDdMCD5.js} +1 -1
  35. package/out/renderer/assets/{LF3NJQAX-DjYdE7YV.js → LF3NJQAX-B89ZqOpY.js} +1 -1
  36. package/out/renderer/assets/{LRZCOFJZ-C7m8fw-0.js → LRZCOFJZ-BBX_wZ5T.js} +1 -1
  37. package/out/renderer/assets/{N5NF2FGY-CqGhgjNF.js → N5NF2FGY-BoIFu-8L.js} +1 -1
  38. package/out/renderer/assets/{N7OWWQHY-BRk68LVa.js → N7OWWQHY-CloOgGu1.js} +1 -1
  39. package/out/renderer/assets/{NT5JY5WP-B1NtxJ-K.js → NT5JY5WP-BhjzefjG.js} +1 -1
  40. package/out/renderer/assets/{OT7W3RNY-CtDQ--Ld.js → OT7W3RNY-BRzBqtKB.js} +1 -1
  41. package/out/renderer/assets/{P67P66DB-LeAz_z3Z.js → P67P66DB-Dw-K1Ghu.js} +1 -1
  42. package/out/renderer/assets/{PFLLLM7K-CgODCVD8.js → PFLLLM7K-DfSPUrIT.js} +1 -1
  43. package/out/renderer/assets/{PUAMC4MJ-9REX_vGK.js → PUAMC4MJ-BnY1F2cF.js} +1 -1
  44. package/out/renderer/assets/{PVFCHRLY-CK5jTRjy.js → PVFCHRLY-BcyVPS3n.js} +1 -1
  45. package/out/renderer/assets/{PinnedSavedView-Dtdra7Gq.js → PinnedSavedView-ciRhY0cN.js} +1 -1
  46. package/out/renderer/assets/{QQW2P742-B2snHr_6.js → QQW2P742-D6aitZ24.js} +1 -1
  47. package/out/renderer/assets/{S63OEDPG-BeWWF1tc.js → S63OEDPG-Dlz1a9cD.js} +1 -1
  48. package/out/renderer/assets/{SG5TVYLW-ClCsbQ87.js → SG5TVYLW-Bu7LZZpx.js} +1 -1
  49. package/out/renderer/assets/{SavedViewArtifact-ATjDgAUF.js → SavedViewArtifact-CM9L4mc8.js} +1 -1
  50. package/out/renderer/assets/{SidebarPreviewPane-DHllX0GN.js → SidebarPreviewPane-DkOCt7Gb.js} +1 -1
  51. package/out/renderer/assets/{TranscriptViews-DD_JshFH.js → TranscriptViews-aYvP71ow.js} +1 -1
  52. package/out/renderer/assets/{UGRSUGA2-jP6nv8HL.js → UGRSUGA2-avwOtJG1.js} +1 -1
  53. package/out/renderer/assets/{V44WA6U7-Dr_tS3uH.js → V44WA6U7-DMF87Y7j.js} +1 -1
  54. package/out/renderer/assets/{V67O4WWV-BRn52u9c.js → V67O4WWV-BsDLuBDb.js} +1 -1
  55. package/out/renderer/assets/{VBUCM3YD-0sLtn_Zp.js → VBUCM3YD-C6FrRswP.js} +1 -1
  56. package/out/renderer/assets/{VINGRCPA-n98Gf7V0.js → VINGRCPA-Do3Pv3Tc.js} +1 -1
  57. package/out/renderer/assets/{ViewBlock-DdcTHRu3.js → ViewBlock-B-ppjb34.js} +3 -3
  58. package/out/renderer/assets/{ViewCharts-BAw6tExV.js → ViewCharts-jvS22ppO.js} +2 -2
  59. package/out/renderer/assets/{ViewCustom-BzwMbjqg.js → ViewCustom-yFkoy6a-.js} +1 -1
  60. package/out/renderer/assets/{ViewExtension-Ch5_33Ra.js → ViewExtension-DuHxho6W.js} +1 -1
  61. package/out/renderer/assets/{ViewInputs-BHooAs2f.js → ViewInputs-VAMDh56H.js} +1 -1
  62. package/out/renderer/assets/{ViewMcpApp-CJnOESMk.js → ViewMcpApp-CH_W9CZt.js} +1 -1
  63. package/out/renderer/assets/{ViewSessionAction-BHJv5QNb.js → ViewSessionAction-66veqRhO.js} +1 -1
  64. package/out/renderer/assets/{ViewTables-DBTupg46.js → ViewTables-CKKDcYKH.js} +1 -1
  65. package/out/renderer/assets/{WL6DNKX4-Csfp__Nw.js → WL6DNKX4-Cq-YK4Uf.js} +1 -1
  66. package/out/renderer/assets/{WQ63CJYP-oSbguA5n.js → WQ63CJYP-fjrhTSVs.js} +1 -1
  67. package/out/renderer/assets/{XOYAOB3S-DfDDKmX8.js → XOYAOB3S-CAQPI0he.js} +1 -1
  68. package/out/renderer/assets/{Y5LQLG3M-BnZ8APdi.js → Y5LQLG3M-DKntYAaW.js} +1 -1
  69. package/out/renderer/assets/{YIK6JTN6-Bunk5CDx.js → YIK6JTN6-CcjcC5JX.js} +1 -1
  70. package/out/renderer/assets/{core-BbPUgmX7.js → core-Cj89wpQh.js} +4 -4
  71. package/out/renderer/assets/{file-tabs-CFdJBYJ9.js → file-tabs-PoAgFa7v.js} +1 -1
  72. package/out/renderer/assets/{ghostty-web-Dn7o-dzQ.js → ghostty-web-DiMuvUtH.js} +1 -1
  73. package/out/renderer/assets/{highlights-eTGcn9lP.js → highlights-7WH0ppQl.js} +1 -1
  74. package/out/renderer/assets/{highlights-D4Jo_Sz0.js → highlights-DnSmFBdQ.js} +1 -1
  75. package/out/renderer/assets/index-CiuUSFeC.js +11 -0
  76. package/out/renderer/assets/kit-CD3F-f6F.js +147 -0
  77. package/out/renderer/assets/{langs-CXhlGiW6.js → langs-D5CRC9qz.js} +1 -1
  78. package/out/renderer/assets/{lazy-D3tN-GAO.js → lazy-CUmWiDAP.js} +3 -3
  79. package/out/renderer/assets/{loader-DGyfh0zB.js → loader-CPY9efuc.js} +1 -1
  80. package/out/renderer/assets/{pierre-theme-BZvsTYqQ.js → pierre-theme-BrzM0xZU.js} +3 -3
  81. package/out/renderer/assets/setting-demos-BW7cG2_G.css +1 -0
  82. package/out/renderer/assets/setting-demos-DEURBrvf.js +1 -0
  83. package/out/renderer/assets/{shiki-Wqv4XEGM.js → shiki-DFrbO9j3.js} +1 -1
  84. package/out/renderer/assets/{sidebar-layout-sK8ujsHX.js → sidebar-layout-fobokay5.js} +1 -1
  85. package/out/renderer/assets/{stream-tokenizer-C18hljKL.js → stream-tokenizer-CT1HAjvR.js} +1 -1
  86. package/out/renderer/assets/{themes-Dfx1_kFe.js → themes-Cj62ov9J.js} +1 -1
  87. package/out/renderer/assets/{useFind-BBxfQuQ2.js → useFind-Cdl0rVJO.js} +3 -3
  88. package/out/renderer/assets/{useFolderChanges-BcfSJoBT.js → useFolderChanges-C9L_NOgw.js} +2 -2
  89. package/out/renderer/assets/{view-preview-B2Rj--lZ.js → view-preview-BvCO9WZH.js} +1 -1
  90. package/out/renderer/assets/{zoom-reset-l-YVDJrI.js → zoom-reset-COqHFP45.js} +1 -1
  91. package/out/renderer/index.html +5 -5
  92. package/out/renderer/view-preview.html +6 -6
  93. package/package.json +2 -2
  94. package/out/renderer/assets/DiffsTab-D690H0Dy.js +0 -3
  95. package/out/renderer/assets/IconButtonTip-P9QUxPjA.js +0 -1
  96. package/out/renderer/assets/index-c95EBMdk.js +0 -8
  97. package/out/renderer/assets/kit-C9O_D5xC.js +0 -147
  98. package/out/renderer/assets/setting-demos-B0787McX.js +0 -1
  99. package/out/renderer/assets/setting-demos-vtrBsYTd.css +0 -1
@@ -2,7 +2,7 @@ import { DatabaseSync } from "node:sqlite";
2
2
  import { applyReaderPragmas, createSqliteDriver } from "zidane";
3
3
  import { serveWorkerRpc } from "zidane/ipc";
4
4
  import { c as collectingWhenIdle } from "./chunks/idle-collect-ZgTY7fw2.js";
5
- import { c as createSessionSearchSql, s as searchSessions } from "./chunks/session-search-sql-2EUzjHAT.js";
5
+ import { c as createSessionSearchSql, s as searchSessions } from "./chunks/session-search-sql-D51BmAO2.js";
6
6
  import "node:v8";
7
7
  import "node:vm";
8
8
  import "node:timers/promises";
@@ -124,6 +124,26 @@ const api = {
124
124
  pauseEnvironment: (id) => ipcRenderer.invoke("sessions:pauseEnvironment", id),
125
125
  deleteEnvironment: (id) => ipcRenderer.invoke("sessions:deleteEnvironment", id),
126
126
  moveEnvironment: (id, environment, cwd, options) => ipcRenderer.invoke("sessions:moveEnvironment", id, environment, cwd, options),
127
+ teleportTargets: (id) => ipcRenderer.invoke("sessions:teleportTargets", id),
128
+ teleportPreview: (id) => ipcRenderer.invoke("sessions:teleportPreview", id),
129
+ teleport: async (id, request, options) => {
130
+ const requestId = `tp-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
131
+ const off = options?.onProgress ? subscribe("sessions:teleportProgress", (progress) => {
132
+ if (progress.requestId === requestId)
133
+ options.onProgress({ stage: progress.stage, ...progress.done !== void 0 ? { done: progress.done } : {}, ...progress.total !== void 0 ? { total: progress.total } : {} });
134
+ }) : void 0;
135
+ const stop = () => void ipcRenderer.invoke("sessions:teleportStop", requestId);
136
+ options?.signal?.addEventListener("abort", stop, { once: true });
137
+ try {
138
+ return await ipcRenderer.invoke("sessions:teleport", id, request, requestId);
139
+ } finally {
140
+ off?.();
141
+ options?.signal?.removeEventListener("abort", stop);
142
+ }
143
+ },
144
+ members: (id, method, params) => ipcRenderer.invoke("sessions:members", id, method, params),
145
+ openSessions: () => ipcRenderer.invoke("sessions:openSessions"),
146
+ onMembersTyping: (cb) => subscribe("members:typing", cb),
127
147
  environmentActions: (id) => ipcRenderer.invoke("sessions:environmentActions", id),
128
148
  runEnvironmentAction: (id, actionId) => ipcRenderer.invoke("sessions:runEnvironmentAction", id, actionId),
129
149
  generateTitle: (id) => ipcRenderer.invoke("sessions:generateTitle", id),
@@ -181,7 +201,7 @@ const api = {
181
201
  onChanged: (cb) => subscribe("settings:changed", cb)
182
202
  },
183
203
  environments: {
184
- list: (cwd, hostId) => ipcRenderer.invoke("environments:list", cwd, hostId),
204
+ list: (cwd, hostId, options) => ipcRenderer.invoke("environments:list", cwd, hostId, options),
185
205
  update: (change) => ipcRenderer.invoke("environments:update", change),
186
206
  verify: (kind) => ipcRenderer.invoke("environments:verify", kind),
187
207
  fieldChoices: (kind, key) => ipcRenderer.invoke("environments:fieldChoices", kind, key),
@@ -256,7 +276,7 @@ const api = {
256
276
  streamPortWanted = true;
257
277
  ipcRenderer.send("chat:stream-port");
258
278
  },
259
- setSubscriptions: (sessionIds) => ipcRenderer.invoke("chat:subscriptions", sessionIds),
279
+ setSubscriptions: (sessionIds, shown) => ipcRenderer.invoke("chat:subscriptions", sessionIds, shown),
260
280
  onSkillsChanged: (cb) => subscribe("skills:changed", cb),
261
281
  onSuggestionReady: (cb) => subscribe("suggestion:ready", cb)
262
282
  },
@@ -643,6 +663,17 @@ const api = {
643
663
  status: () => ipcRenderer.invoke("hosts:status"),
644
664
  list: () => ipcRenderer.invoke("hosts:list"),
645
665
  add: (input) => ipcRenderer.invoke("hosts:add", input),
666
+ signIn: async (input, onCode) => {
667
+ const listener = (_e, code) => onCode(code);
668
+ ipcRenderer.on("hosts:signInCode", listener);
669
+ try {
670
+ return await ipcRenderer.invoke("hosts:signIn", input);
671
+ } finally {
672
+ ipcRenderer.removeListener("hosts:signInCode", listener);
673
+ }
674
+ },
675
+ signInCancel: () => ipcRenderer.invoke("hosts:signInCancel"),
676
+ signInProbe: (url) => ipcRenderer.invoke("hosts:signInProbe", url),
646
677
  test: (target) => ipcRenderer.invoke("hosts:test", target),
647
678
  rename: (id, name) => ipcRenderer.invoke("hosts:rename", id, name),
648
679
  setUrl: (id, url) => ipcRenderer.invoke("hosts:setUrl", id, url),
@@ -660,6 +691,9 @@ const api = {
660
691
  tokenCreate: (hostId, name) => ipcRenderer.invoke("hosts:tokenCreate", hostId, name),
661
692
  tokenRevoke: (hostId, id) => ipcRenderer.invoke("hosts:tokenRevoke", hostId, id),
662
693
  pairBrowser: (hostId) => ipcRenderer.invoke("hosts:pairBrowser", hostId),
694
+ me: (hostId, method, params) => ipcRenderer.invoke("hosts:me", hostId, method, params),
695
+ organization: (hostId) => ipcRenderer.invoke("hosts:organization", hostId),
696
+ org: (hostId, method, params) => ipcRenderer.invoke("hosts:org", hostId, method, params),
663
697
  onTokensChanged: (cb) => subscribe("hosts:tokensChanged", cb),
664
698
  authSetApiKey: (hostId, provider, key) => ipcRenderer.invoke("hosts:authSetApiKey", hostId, provider, key),
665
699
  authRemove: (hostId, provider, account) => ipcRenderer.invoke("hosts:authRemove", hostId, provider, account),
@@ -1,2 +1,2 @@
1
- import{g,d,x}from"./7XWI72E6-CFY3Kecs.js";import{s,T}from"./G6GPDDNC-XfFyRa0j.js";import{c}from"./DKTLEL5E-CJTkVtjr.js";import{K as Kt,g as gt$1,Y as Yt$2}from"./BGW36YJW-DhmSG9tb.js";import{E as Et,y as ye,i as it$1,O as Ot,m,T as Tn,Y as Yt$1}from"./lazy-D3tN-GAO.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";function rt(e){let n=new Set;for(let a of e)for(let c2 of a.people)n.add(c2);return[...n].sort()}var ot=class{type="journey";title;accTitle;accDescr;sections=[];tasks=[];currentSection="";setDiagramTitle(n){this.title=n}setAccTitle(n){this.accTitle=n.replace(/^\s+/g,"")}setAccDescription(n){this.accDescr=n.replace(/\n\s+/g,`
1
+ import{g,d,x}from"./7XWI72E6-C_GZbyIF.js";import{s,T}from"./G6GPDDNC-Ax6dML4i.js";import{c}from"./DKTLEL5E-CJTkVtjr.js";import{K as Kt,g as gt$1,Y as Yt$2}from"./BGW36YJW-BAwgTZ_z.js";import{E as Et,y as ye,i as it$1,O as Ot,m,T as Tn,Y as Yt$1}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";function rt(e){let n=new Set;for(let a of e)for(let c2 of a.people)n.add(c2);return[...n].sort()}var ot=class{type="journey";title;accTitle;accDescr;sections=[];tasks=[];currentSection="";setDiagramTitle(n){this.title=n}setAccTitle(n){this.accTitle=n.replace(/^\s+/g,"")}setAccDescription(n){this.accDescr=n.replace(/\n\s+/g,`
2
2
  `)}addSection(n){this.currentSection=n,this.sections.push(n)}addTask(n,a){let c2=a.substring(1).split(":"),h=c2.length===1?[]:c2[1].split(",").map(o=>o.trim());this.tasks.push({task:n,score:Number(c2[0]),people:h,section:this.currentSection})}getActors(){return rt(this.tasks)}},At=["$end","EOF","INVALID","NEWLINE","journey","title","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","section","taskName","taskData",":"];function at(e,n,a){let c2=e.length,h=n;for(;h<c2;h++){let o=e.charCodeAt(h);if(o===35||o===10||o===59||a&&o===58)break}return h}function Dt(e){let n=e.length,a=[],c2=[],h=[],o={types:a,texts:c2,starts:h},t=0,i=(p,s2)=>{a.push(p),c2.push(e.slice(t,s2)),h.push(t),t=s2};for(;t=g(e,t),!(t>=n);){let p=e.charCodeAt(t),s2=t+1;if(p===10){for(;e.charCodeAt(s2)===10;)s2++;i(3,s2);continue}if(d(e,t,"journey")&&!Et(e.charCodeAt(t+7))){i(4,t+7);continue}if(d(e,t,"title")){for(s2=t+5;e.charCodeAt(s2)!==10&&ye(e.charCodeAt(s2));)s2++;if(s2===n||e.charCodeAt(s2)===10){t=s2;continue}let u=e.charCodeAt(t+5);if(u!==13&&ye(u)&&(s2=at(e,t+6,!1),s2>t+6)){i(5,s2);continue}}if(s2=x(e,t,o,6),s2!==t){t=s2;continue}if(d(e,t,"section")&&ye(e.charCodeAt(t+7))&&(s2=at(e,t+8,!0),s2>t+8)){i(11,s2);continue}p===58?(s2=at(e,t+1,!1),i(s2>t+1?13:14,s2>t+1?s2:t+1)):p===59?i(2,t+1):i(12,at(e,t+1,!0))}return(h.length===0||h[h.length-1]<n)&&i(1,n),i(0,n),o}var Ft="'EOF', 'SPACE', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'section', 'taskName'";function jt(e,n){let{types:a,texts:c2,starts:h}=Dt(e),o=(t,i)=>{let p=a[t]===0?"1":At[a[t]];throw it$1("journey",e,h[t],`Expecting ${i}, got '${p}'`)};a[0]!==4&&o(0,"'journey'");for(let t=1;;t++){let i=c2[t];switch(a[t]){case 3:break;case 5:n.setDiagramTitle(i.substring(6));break;case 6:n.setAccTitle(c2[++t].trim());break;case 8:n.setAccDescription(c2[++t].trim());break;case 10:n.setAccDescription(i.trim());break;case 11:n.addSection(i.substring(8));break;case 12:a[++t]!==13&&o(t,"'taskData'"),n.addTask(i,c2[t]);break;case 1:return;default:o(t,Ft)}}}var it=10,L=8,Rt=124,Pt=200,ct=12,Jt=6,pt=24,gt=26,R=11,k=5,Bt=13,Vt=20,Gt='<circle cx="-3.6" cy="-2.8" r="1.3"/><circle cx="3.6" cy="-2.8" r="1.3"/>',Ut={happy:"M-5,2A6,6 0 0 0 5,2",neutral:"M-4.5,4.5H4.5",sad:"M-5,6.5A6,6 0 0 1 5,6.5"};function St(e,n,a){return`<g class="pele-face pele-face-${a}" transform="translate(${m(e)},${m(n)})"><circle r="${R}" fill="var(--_bg)" stroke="var(--_l)"/><g fill="var(--_l)">${Gt}</g><path d="${Ut[a]}" fill="none" stroke="var(--_l)" stroke-linecap="round"/></g>`}function Lt(e,n,a){return c(a,c2=>Xt(e,n,a,c2))}function Xt(e,n,a,c2){let h=a.fontSize??16,o=Math.round(h*.875),t=Math.round(h*.75),i=a.measurer??Ot(a.fontFamily,a.fontFamilyMono),p=a.padding??8;if(c2)return Yt(e,a);let s$1=e.tasks,u=s$1.length,T$1=rt(s$1).filter(l=>l!==""),b=new Map;T$1.forEach((l,y)=>b.set(l,y));let x2=Rt,D=s$1.map(l=>s(l.task,i,o,x2)),O=0;for(let l of D)O=Math.max(O,l.width);O>x2&&(x2=Math.min(Math.ceil(O),Pt),D=s$1.map(l=>T(l.task,i,o,x2)));let H=x2+2*it,m$1=H+ct,v=u>0?u*m$1-ct:0,E=Math.round(o*1.5),P=Math.max(v,240),j=[],J=0,_=0,M=0;for(let l of T$1){let y=T(l,i,o,P-2*k-6),w=2*k+6+y.width;M>0&&M+w>P&&(M=0,_+=4);let G=M>0?j[j.length-1].y:_,U=Math.max(y.height,E);j.push({name:l,label:y,x:M,y:G,h:U}),M+=w,J=Math.max(J,M),_=Math.max(_,G+U),M+=Vt}let C=u>0?pt+v:0,d2=T(e.title,i,h,Math.max(C,320),1),B=d2.height>0?d2.height+16:0,lt=Math.max(C,d2.width,u>0?pt+J:0),z=p+(lt-C)/2+pt,Y=p+B,yt=[],I=0;for(let l=0;l<u;){let y=l+1;for(;y<u&&s$1[y].section===s$1[l].section;)y++;let w;s$1[l].section!==""&&(w=T(s$1[l].section,i,o,(y-l)*m$1-ct-2*it,1),I=Math.max(I,Math.max(w.height,E)+2*Jt)),yt.push({start:l,count:y-l,label:w}),l=y}let K=E;for(let l of D)K=Math.max(K,l.height);let Tt=T$1.length>0?2*k+6:0,q=K+Tt+2*L,V=Y+(I>0?I+Jt:0),ht=V+q+R+16,Ot$1=ht+4*gt,Ct=z+v,F="",Q=Y;if(u>0){let l="",y="";for(let f=5;f>=1;f--){let $=ht+(5-f)*gt;l+=`M${m(z-6)},${m($)}H${m(Ct)}`,y+=`<text x="${m(z-12)}" y="${m($+t*.35)}">${f}</text>`}F+=`<path class="pele-grid" d="${l}" fill="none" stroke="var(--_a)"/><g class="pele-scale" font-size="${t}" text-anchor="end" fill="var(--_m)">${y}</g>`;let w="",G="",U="",xt=[];s$1.forEach((f,$)=>{let S=z+$*m$1,g2=S+H/2,W=f.score,Ht=Number.isNaN(W)?3:Math.min(5,Math.max(1,W)),dt=ht+(5-Ht)*gt;w+=`${$===0?"M":"L"}${m(g2)},${m(dt)}`,G+=`M${m(g2)},${m(V+q)}V${m(dt-R)}`,U+=St(g2,dt,W>3?"happy":W<3?"sad":"neutral");let Mt="",ut=f.people.filter(Z=>Z!==""),zt=Math.min(Bt,(H-2*it-2*k)/Math.max(ut.length-1,1));ut.forEach((Z,It)=>{Mt+=`<circle class="pele-actor" cx="${m(g2+(It-(ut.length-1)/2)*zt)}" cy="${m(V+q-L-k)}" r="${k}" fill="${Kt(b.get(Z)??0)}" stroke="var(--_s)"><title>${Tn(Z)}</title></circle>`}),xt.push(`<g class="pele-node pele-task" data-id="${Tn(f.task.trim())}"><rect x="${m(S)}" y="${m(V)}" width="${m(H)}" height="${m(q)}" fill="var(--_s)" stroke="var(--_b)"${gt$1}/>`+Yt$1(D[$],g2,V+L+K/2,` font-size="${o}"`)+Mt+"</g>")}),F+=`<path class="pele-stems" d="${G}" fill="none" stroke="var(--_b)" stroke-dasharray="2 3"/>`+(u>1?`<path class="pele-edge" d="${w}" fill="none" stroke="var(--_l)" stroke-linejoin="round"/>`:"")+U;for(let f of yt){let $=xt.slice(f.start,f.start+f.count).join("");if(!f.label){F+=$;continue}let S=z+f.start*m$1,g2=f.count*m$1-ct;F+=`<g class="pele-cluster pele-section" data-id="${Tn(s$1[f.start].section.trim())}"><rect x="${m(S)}" y="${m(Y)}" width="${m(g2)}" height="${m(I)}" fill="var(--_a)"${gt$1}/>`+Yt$1(f.label,S+g2/2,Y+I/2,` font-size="${o}" font-weight="var(--_hw)"`)+$+"</g>"}if(Q=Ot$1+R,j.length>0){let f=z+(v-J)/2,$=Q+16,S="";for(let g2 of j){let W=$+g2.y+g2.h/2;S+=`<g class="pele-legend-item" data-id="${Tn(g2.name)}"><circle cx="${m(f+g2.x+k)}" cy="${m(W)}" r="${k}" fill="${Kt(b.get(g2.name)??0)}"/>`+Yt$1(g2.label,f+g2.x+2*k+6+g2.label.width/2,W,"")+"</g>"}F+=`<g class="pele-legend" font-size="${o}">${S}</g>`,Q=$+_}}let bt=Math.ceil(lt+2*p),$t=Math.ceil(Math.max(Q,p)+p),Wt=Yt$1(d2,p+lt/2,p+d2.height/2,' class="pele-title" font-weight="var(--_tw)"')+F;return{svg:Yt$2("journey",bt,$t,h,a,e,Wt),width:bt,height:$t,links:[]}}function Yt(e,n){let a=n.fontSize??16,c2=Math.round(a*.875),h=n.measurer??Ot(n.fontFamily,n.fontFamilyMono),o=n.padding??8,t=Math.max(140,(n.maxWidth??320)-2*o),i=T(e.title,h,a,t,1),p=rt(e.tasks).filter(m2=>m2!==""),s2=new Map(p.map((m2,v)=>[m2,v])),u=o+(i.height?i.height+16:0),T$1,b="",x2=i.width;e.tasks.forEach((m$1,v)=>{if(m$1.section!==T$1){T$1=m$1.section;let d2=T(T$1,h,a,t-16,1);d2.height&&(b+=Yt$1(d2,o+8+d2.width/2,u+d2.height/2,' class="pele-cluster-label" font-weight="var(--_hw)"'),x2=Math.max(x2,d2.width+16),u+=d2.height+8)}let E=T(m$1.task,h,c2,t-72),P=m$1.people.filter(d2=>d2!=="").map(d2=>({name:d2,label:T(d2,h,c2,t-44)})),j=Math.max(E.height,42),J=2*L+j;for(let d2 of P)J+=Math.max(16,d2.label.height)+4;let _=Math.max(t,E.width+72);b+=`<g class="pele-node pele-journey-step" data-id="${v}"><rect x="${m(o)}" y="${m(u)}" width="${m(_)}" height="${m(J)}" fill="var(--_s)" stroke="var(--_b)"${gt$1}/>`,b+=Yt$1(E,o+it+E.width/2,u+L+E.height/2,' class="pele-label"');let M=o+_-28;b+=St(M,u+L+R,m$1.score>3?"happy":m$1.score<3?"sad":"neutral"),Number.isNaN(m$1.score)||(b+=`<text class="pele-journey-score" x="${m(M)}" y="${m(u+L+2*R+c2)}" font-size="${c2}" text-anchor="middle">${m(Math.min(5,Math.max(1,m$1.score)))}</text>`);let C=u+L+j+4;for(let d2 of P){let B=Math.max(16,d2.label.height);b+=`<circle class="pele-actor" cx="${m(o+16)}" cy="${m(C+B/2)}" r="${k}" fill="${Kt(s2.get(d2.name))}"/>`+Yt$1(d2.label,o+28+d2.label.width/2,C+B/2,` class="pele-journey-actor" font-size="${c2}"`),C+=B+4}b+="</g>",u+=J,v+1<e.tasks.length&&(b+=`<path class="pele-edge" d="M${m(o+_/2)},${m(u)}v16" fill="none" stroke="var(--_l)"/>`),u+=16,x2=Math.max(x2,_)});let D=Math.ceil(x2+2*o),O=Math.ceil(Math.max(o+i.height,u-(e.tasks.length?16:0))+o),H=Yt$1(i,D/2,o+i.height/2,' class="pele-title" font-weight="var(--_tw)"')+b;return{svg:Yt$2("journey",D,O,a,n,e,H),width:D,height:O,links:[]}}var ge={type:"journey",parse(e,n,a){let c2=new ot;return c2.title=a,jt(e,c2),c2},render:Lt};export{ge as journey};
@@ -1,2 +1,2 @@
1
- import{s}from"./5THPTBWS-BahUBl-u.js";import{l,h}from"./DKTLEL5E-CJTkVtjr.js";import{x,D,M,$,U,B,z,v}from"./EXE5EH6O-SXdUe5We.js";import{I as It,F as Ft,K as Kt,C as Ct,D as Dt,Y as Yt$1,N as Nt}from"./BGW36YJW-DhmSG9tb.js";import{O as Ot,b as me,T as Tn,m,F as Ft$1,G as Gt,S,Y as Yt}from"./lazy-D3tN-GAO.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";function Ye(s2){let e=[],t=[];for(let r of s2){let a=r.type==="Leaf",n={name:r.name,children:a?void 0:[]};for(n.classSelector=r.classSelector,r.cssCompiledStyles&&(n.cssCompiledStyles=r.cssCompiledStyles),a&&r.value!==void 0&&(n.value=r.value);t.length>0&&t[t.length-1].level>=r.level;)t.pop();t.length===0?e.push(n):t[t.length-1].node.children.push(n),a||t.push({node:n,level:r.level})}return e}function Fe(s2,e){let t=new Map;for(let a of s2.TreemapRows){if(a.$type!=="ClassDefStatement")continue;let n=t.get(a.className);n||t.set(a.className,n=[]);let l2=(a.styleText??"").replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",");for(let f of l2.split(";"))n.push(f)}let r=[];for(let a of s2.TreemapRows){if(a.$type!=="TreemapRow")continue;let n=a.item,l2=n.classSelector?t.get(n.classSelector):void 0;r.push({level:a.indent??0,name:n.name,type:n.$type,value:n.$type==="Leaf"?n.value:void 0,classSelector:n.classSelector,cssCompiledStyles:l2&&l2.length>0?l2:void 0})}return{type:"treemap",title:s2.title||e,accTitle:s2.accTitle?s2.accTitle.replace(/^\s+/g,""):void 0,accDescr:s2.accDescr?s2.accDescr.replace(/\n\s+/g,`
1
+ import{s}from"./5THPTBWS-BahUBl-u.js";import{l,h}from"./DKTLEL5E-CJTkVtjr.js";import{x,D,M,$,U,B,z,v}from"./EXE5EH6O-Cbj5xPKl.js";import{I as It,F as Ft,K as Kt,C as Ct,D as Dt,Y as Yt$1,N as Nt}from"./BGW36YJW-BAwgTZ_z.js";import{O as Ot,b as me,T as Tn,m,F as Ft$1,G as Gt,S,Y as Yt}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";function Ye(s2){let e=[],t=[];for(let r of s2){let a=r.type==="Leaf",n={name:r.name,children:a?void 0:[]};for(n.classSelector=r.classSelector,r.cssCompiledStyles&&(n.cssCompiledStyles=r.cssCompiledStyles),a&&r.value!==void 0&&(n.value=r.value);t.length>0&&t[t.length-1].level>=r.level;)t.pop();t.length===0?e.push(n):t[t.length-1].node.children.push(n),a||t.push({node:n,level:r.level})}return e}function Fe(s2,e){let t=new Map;for(let a of s2.TreemapRows){if(a.$type!=="ClassDefStatement")continue;let n=t.get(a.className);n||t.set(a.className,n=[]);let l2=(a.styleText??"").replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",");for(let f of l2.split(";"))n.push(f)}let r=[];for(let a of s2.TreemapRows){if(a.$type!=="TreemapRow")continue;let n=a.item,l2=n.classSelector?t.get(n.classSelector):void 0;r.push({level:a.indent??0,name:n.name,type:n.$type,value:n.$type==="Leaf"?n.value:void 0,classSelector:n.classSelector,cssCompiledStyles:l2&&l2.length>0?l2:void 0})}return{type:"treemap",title:s2.title||e,accTitle:s2.accTitle?s2.accTitle.replace(/^\s+/g,""):void 0,accDescr:s2.accDescr?s2.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0,roots:Ye(r),classes:t}}var Le=[M,$,v(String.raw`\w`),{name:"TREEMAP_KEYWORD",pattern:/treemap-beta|treemap/y},{name:"CLASS_DEF",pattern:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/y},{name:"STYLE_SEPARATOR",pattern:/:::/y},{name:"SEPARATOR",pattern:/:/y},{name:"COMMA",pattern:/,/y},{name:"INDENTATION",pattern:/[ \t]{1,}/y},{name:"WS",pattern:/[ \t]+/y,hidden:!0},{name:"ML_COMMENT",pattern:/\%\%[^\n]*/y,hidden:!0},{name:"NL",pattern:/\r?\n/y,hidden:!0},{name:"ID2",pattern:/[a-zA-Z_][a-zA-Z0-9_]*/y},{name:"NUMBER2",pattern:/[0-9_\.\,]+/y},{name:"STRING2",pattern:/"[^"]*"|'[^']*'/y}],qe=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/;function Ie(s2){let e=new x(D(s2,Le,"treemap"),Le,"treemap"),t=e.kinds,r={$type:"Treemap",TreemapRows:[]},a=()=>e.accept(5)?e.expect(12):void 0;for(e.expect(3);e.kind!==-1;){let n=e.kind;if(n===0){r.accDescr=U(e.take());continue}if(n===1){r.accTitle=B(e.take());continue}if(n===2){r.title=z(e.take());continue}n!==8&&n!==14&&n!==4&&e.fail("a node, a class definition, or a title");let l2=n===8?e.take().length:void 0;if(e.kind===4){let u=qe.exec(e.take()),o={$type:"ClassDefStatement",className:u[1]};u[2]&&(o.styleText=u[2]),l2!==void 0&&(o.indent=l2),r.TreemapRows.push(o);continue}let f=e.expect(14).slice(1,-1),i=t[e.i]===8?e.i+1:e.i,p;t[i]===6||t[i]===7?(e.i=i+1,e.accept(8),p={$type:"Leaf",name:f,value:parseFloat(e.expect(13).replace(/,/g,""))}):p={$type:"Section",name:f};let m2=a();m2!==void 0&&(p.classSelector=m2);let y={$type:"TreemapRow",item:p};l2!==void 0&&(y.indent=l2),r.TreemapRows.push(y)}return r}var Oe=/^(?:.?[<>=^])?([-+( ])?(\$)?0?\d*(,)?(?:\.(\d+))?(~)?([a-zA-Z%])?$/;function Pe(s2){let e="";for(let t=s2.length;t>0;t-=3)e=s2.slice(Math.max(0,t-3),t)+(e?","+e:"");return e}function je(s2){let e=Oe.exec(s2==="$0,0"?"$,":s2)??Oe.exec(","),t=e[1]==="+",r=e[3]!==void 0,a=e[4]===void 0?void 0:Math.min(Number(e[4]),20),n=e[6]??"";return l2=>{let f=Math.abs(l2),i,p="";if(n==="f"?i=f.toFixed(a??6):n==="%"?(i=(f*100).toFixed(a??6),p="%"):n==="d"?i=Math.round(f).toFixed(0):n==="e"?i=f.toExponential(a??6):i=String(Number(f.toPrecision(Math.max(1,a??12)))),e[5]&&i.includes(".")&&!i.includes("e")&&(i=i.replace(/\.?0+$/,"")),r&&!i.includes("e")){let m2=i.indexOf(".");i=m2===-1?Pe(i):Pe(i.slice(0,m2))+i.slice(m2)}return(l2<0?"-":t?"+":"")+(e[2]??"")+i+p}}function He(s2,e,t){let r=s2.children===void 0&&Number.isFinite(s2.value)&&s2.value>0?s2.value:0;return{node:s2,parent:e,series:t,value:r,children:[],headed:!1,header:0,x:0,y:0,w:0,h:0}}var W=(s2,e,t)=>s2>=e?Math.min(s2,t):e;function Ge(s2,e,t,r,a,n,l2){let f=e,i=0;for(;i<s2.length;){let p=a*n/f,m2=Math.min(a,n),y=s2[i].value*p,u=y,o=Math.max(m2*m2*u/(y*y),y*y/(m2*m2*u)),h2=i+1;for(;h2<s2.length;){let T=s2[h2].value*p,g=y+T,d=Math.max(m2*m2*u/(g*g),g*g/(m2*m2*T));if(d>o)break;o=d,y=g,h2++}let $2=y/m2,b=0;for(let T=i;T<h2;T++){let g=s2[T],d=T===h2-1?m2-b:g.value*p/$2,v2=a>=n?t:t+b,w=a>=n?r+b:r,_=a>=n?$2:d,F=a>=n?d:$2,j=Math.round(v2+_-l2/2)>Math.round(v2+l2/2)?l2/2:0,c=Math.round(w+F-l2/2)>Math.round(w+l2/2)?l2/2:0;g.x=Math.round(v2+j),g.y=Math.round(w+c),g.w=Math.round(v2+_-j)-g.x,g.h=Math.round(w+F-c)-g.y,b+=d,f-=g.value}a>=n?(t+=$2,a-=$2):(r+=$2,n-=$2),i=h2}}function Ve(s2,e,t,r){let a=s2.map((u,o)=>He(u,void 0,o)),n=a.slice();for(let u=0;u<n.length;u++){let o=n[u];for(let h2 of o.node.children??[]){let $2=He(h2,o,o.series);o.children.push($2),n.push($2)}}for(let u=n.length-1;u>=0;u--){let o=n[u];o.parent&&(o.parent.value+=o.value)}let{gap:l2,header:f,short:i,side:p}=r,m2=[],y=(u,o,h2,$2,b)=>{let T=u.filter(d=>d.value>0).sort((d,v2)=>v2.value-d.value),g=0;for(let d of T)g+=d.value;if(!(T.length===0||!Number.isFinite(g))){$2=Math.max(0,$2),b=Math.max(0,b),$2>0&&b>0&&Ge(T,g,o-l2/2,h2-l2/2,$2+l2,b+l2,l2);for(let d of T){let v2=W(d.x,o,o+$2),w=W(d.y,h2,h2+b);d.w=W(d.x+d.w,v2,o+$2)-v2,d.h=W(d.y+d.h,w,h2+b)-w,d.x=v2,d.y=w,m2.push(d)}}};y(a,0,0,e,t);for(let u=0;u<m2.length;u++){let o=m2[u];if(o.children.length===0)continue;let h2=o.h-f-p>=12?f:i;o.headed=o.w>Math.max(24,2*p)&&o.h-h2-p>=8,o.header=o.headed?h2:0,o.headed?y(o.children,o.x+p,o.y+h2,o.w-2*p,o.h-h2-p):y(o.children,o.x,o.y,o.w,o.h)}return m2}var re=28,Ue=18,oe=6,k=1.25,We=s2=>S(me(s2).trim()).trim();function Je(s2){let e=0,t=s2.slice();for(;t.length>0;){let r=t.pop();r.children!==void 0?t.push(...r.children):Number.isFinite(r.value)&&r.value>0&&e++}return e}function Ze(s2,e){let t=Math.min(e.w,e.h)/4;return t<4?Nt(s2).replace("rx:var(--_r)",`rx:min(var(--_r),${m(t)}px)`):Nt(s2)}function Z(s2,e,t,r,a){let n=s2.treemap?.[e];return typeof n=="number"&&n>=r?Math.min(n,a):t}function Ke(s$1,e,t){let r=t.fontSize??16,a=Math.round(r*.875),n=Math.round(r*.75),l$1=Math.round(r*.5625),f=t.measurer??Ot(t.fontFamily,t.fontFamilyMono),i=e.treemap??{},p=t.padding??Z(e,"diagramPadding",8,0,2e3),m$1=Math.round(l(t,Z(e,"nodeWidth",64,1,400)*10,200,2*p)),y=Math.round(Z(e,"nodeHeight",40,1,400)*10),u=i.showValues!==!1,o=je(typeof i.valueFormat=="string"?i.valueFormat:","),h$1=Math.min(1,Math.max(0,Math.log10(m$1*y/Math.max(1,Je(s$1.roots))/800))),$2=Ve(s$1.roots,m$1,y,{gap:Z(e,"padding",Math.round(2+2*h$1),0,200),header:re,short:Ue,side:Math.round(3+3*h$1)}),b=It(s$1.title,!1,f,r,h(t),1),T=b.height>0?b.height+8:0,g=p+Math.max(0,(b.width-m$1)/2),d=p+T,v2="",w="";for(let c of $2){let N=c.node,S$1=Ft(N.cssCompiledStyles??[]),ae=Kt(c.series),L=g+c.x,H=d+c.y,K=me(N.name).trim(),B2=u?o(c.value):"",ie=`data-id="${Tn(N.name)}">`,Y=We(N.name),le=Y===""?[]:[Y];for(let M2=c.parent;M2!==void 0&&!M2.headed;M2=M2.parent){let R=We(M2.node.name);R!==""&&le.unshift(R)}let q=le.join(" › "),ce=M2=>q===""||M2===K&&q===Y?"":`<title>${q}</title>`,me$1=`<rect x="${m(L)}" y="${m(H)}" width="${m(c.w)}" height="${m(c.h)}" fill="${ae}"`,C=S$1.fontSize,V=(S$1.bold?1:0)|(S$1.italic?2:0),I=Ct(S$1.shape)?Ft$1(S$1):Gt(c.series);if(N.children!==void 0){let M2="",R;if(c.headed){let P=c.header<re,D2=C??(P?n:a),U2=C??n,J=c.w-2*oe-4,Q=B2?f.width(B2,U2,V):0,fe=!P&&Q>0&&J-Q-12>=3*D2,X=D2*k<c.header?s(K,fe?J-Q-12:J,D2,D2,f,V|1):void 0,he=H+c.header/2+1;R=X?.text,X&&(M2+=`<text x="${m(L+oe+2)}" y="${m(he+D2*.35)}" font-weight="var(--_hw)"${P?` font-size="${D2}"`:""}${I}${S$1.text}>${S(X.text)}</text>`),fe&&U2*k<=re&&(M2+=`<text class="pele-value" x="${m(L+c.w-oe-2)}" y="${m(he+U2*.35)}" font-size="${n}" text-anchor="end"${I||' fill="var(--_m)"'}${S$1.text}>${S(B2)}</text>`)}let E=/[";]fill:/.test(S$1.shape)?"":' fill-opacity="0.12"',O=c.headed?`${me$1}${Ze(`${E} stroke="${ae}"${S$1.shape}`,c)}/>`:`<rect x="${m(L)}" y="${m(H)}" width="${m(c.w)}" height="${m(c.h)}" fill="none"/>`;v2+=`<g class="pele-node pele-section${Dt(N.classSelector??"")}" ${ie}${ce(R)}${O}${M2}</g>`;continue}let G="",de=c.w-8,pe=C??l$1,ue=C===void 0?Math.min(r,Math.floor((c.h-4)/k)):C*k<=c.h-4?C:0,A=ue>=pe?s(K,de,ue,pe,f,V):void 0;if(A){let M2=m(L+c.w/2),R=H+c.h/2,E=C??Math.max(l$1,Math.round(A.size*.8)),O=(A.size+E)*k;if(B2&&O<=c.h-4&&f.width(B2,E,V)<=de){let P=R-O/2+A.size*k/2,D2=R+O/2-E*k/2;G=`<text x="${M2}" y="${m(P+A.size*.35)}" font-size="${m(A.size)}"${I}${S$1.text}>${S(A.text)}</text><text class="pele-value" x="${M2}" y="${m(D2+E*.35)}" font-size="${m(E)}"${I}${S$1.text}>${S(B2)}</text>`}else G=`<text x="${M2}" y="${m(R+A.size*.35)}" font-size="${m(A.size)}"${I}${S$1.text}>${S(A.text)}</text>`}w+=`<g class="pele-node pele-leaf${Dt(N.classSelector??"")}" ${ie}${ce(A?.text)}${me$1}${Ze(S$1.shape,c)}/>${G}</g>`}let _=Math.ceil(Math.max(m$1,b.width)+2*p),F=Math.ceil(y+T+2*p),j=Yt(b,_/2,p+b.height/2,' class="pele-title" font-weight="var(--_tw)"')+(v2?`<g class="pele-sections" font-size="${a}">${v2}</g>`:"")+(w?`<g class="pele-leaves" text-anchor="middle" fill="var(--_bg)">${w}</g>`:"");return{svg:Yt$1("treemap",_,F,r,t,s$1,j),width:_,height:F,links:[]}}var bt={type:"treemap",parse:(s2,e,t)=>Fe(Ie(s2),t),render:Ke};export{bt as treemap};
@@ -1 +1 @@
1
- import{Y as Yt,m}from"./lazy-D3tN-GAO.js";function x(e,t){for(let n=0;n<t.length;n+=3){let o=Math.round(t[n+1]),s=e.get(o);s?s.push(t[n]):e.set(o,[t[n]])}}function h(e,t,n,o){if(t===0)return e.x;let s=e.y-e.h/2,r=e.x-e.w/2,i=t/2,l=[r+o-6+i,e.x,r+e.w-o+6-i],u=n.get(Math.round(s));if(u===void 0)return l[0];let m2=l[0],f=-1;for(let p of l){let a=1/0;for(let b of u)b>r&&b<r+e.w&&(a=Math.min(a,Math.abs(b-p)-i));if(a>=6)return p;a>f+.5&&(f=a,m2=p)}return m2}function y(e,t,n,o){let s=t>0?o.get(Math.round(e.y-e.h/2)):void 0;if(s===void 0)return!1;let r=e.x-e.w/2;for(let i of s)if(i>r&&i<r+e.w&&Math.abs(i-n)<t/2+4)return!0;return!1}function C(e,t,n,o,s,r,i,l){let u=1;for(let f=r[i].parent;f>=0&&u<8;f=r[f].parent)u++;let m$1=`color-mix(in srgb,var(--_a) ${m(100*(1-.5**u))}%,var(--_bg))`;return`<g class="pele-cluster-title" data-id="${s}">`+Yt(e,t,n,` fill="none" stroke="${m$1}" stroke-width="5" stroke-linejoin="round"`,l)+Yt(e,t,n,o,l)+"</g>"}export{C,h,x,y};
1
+ import{Y as Yt,m}from"./lazy-CUmWiDAP.js";function x(e,t){for(let n=0;n<t.length;n+=3){let o=Math.round(t[n+1]),s=e.get(o);s?s.push(t[n]):e.set(o,[t[n]])}}function h(e,t,n,o){if(t===0)return e.x;let s=e.y-e.h/2,r=e.x-e.w/2,i=t/2,l=[r+o-6+i,e.x,r+e.w-o+6-i],u=n.get(Math.round(s));if(u===void 0)return l[0];let m2=l[0],f=-1;for(let p of l){let a=1/0;for(let b of u)b>r&&b<r+e.w&&(a=Math.min(a,Math.abs(b-p)-i));if(a>=6)return p;a>f+.5&&(f=a,m2=p)}return m2}function y(e,t,n,o){let s=t>0?o.get(Math.round(e.y-e.h/2)):void 0;if(s===void 0)return!1;let r=e.x-e.w/2;for(let i of s)if(i>r&&i<r+e.w&&Math.abs(i-n)<t/2+4)return!0;return!1}function C(e,t,n,o,s,r,i,l){let u=1;for(let f=r[i].parent;f>=0&&u<8;f=r[f].parent)u++;let m$1=`color-mix(in srgb,var(--_a) ${m(100*(1-.5**u))}%,var(--_bg))`;return`<g class="pele-cluster-title" data-id="${s}">`+Yt(e,t,n,` fill="none" stroke="${m$1}" stroke-width="5" stroke-linejoin="round"`,l)+Yt(e,t,n,o,l)+"</g>"}export{C,h,x,y};
@@ -1,4 +1,4 @@
1
- import{j as je$1,z as ze$1,q as qe}from"./VBUCM3YD-0sLtn_Zp.js";import{g}from"./NT5JY5WP-B1NtxJ-K.js";import{m,c}from"./DKTLEL5E-CJTkVtjr.js";import{e as ee$1,c as ce}from"./EFYWJBJK-Cbn-VZcb.js";import{F as Ft,I as It,N as Nt,D as Dt,Y as Yt$1,L as Lt,k as kt,T as Tt}from"./BGW36YJW-DhmSG9tb.js";import{R,O as Ot,F as Ft$1,m as m$1,Y as Yt,T as Tn,i as it$1,h as Yn,L as Le,S,j as jn,E as Et$1,y as ye,x as xt}from"./lazy-D3tN-GAO.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";var W={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},te={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},j={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},$={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},Ze=1e6,ee=class{type="requirement";direction="TB";requirements=new Map;elements=new Map;relations=[];classes=new Map;title;accTitle;accDescr;newId="";newText="";newRisk="";newVerifyMethod="";newElementType="";newDocRef="";styleCopies=0;copy(n,i){if(this.styleCopies+=i.length,this.styleCopies>Ze)throw new R("Requirement diagram applies too many style declarations.","limit",{type:"requirement"});for(let o of i)n.push(o)}setDirection(n){this.direction=n}addRequirement(n,i){let o=this.requirements.get(n);return o===void 0&&(o={name:n,type:i,requirementId:this.newId,text:this.newText,risk:this.newRisk,verifyMethod:this.newVerifyMethod,cssStyles:[],classes:["default"]},this.requirements.set(n,o)),this.newId=this.newText=this.newRisk=this.newVerifyMethod="",o}setNewReqId(n){this.newId=n}setNewReqText(n){this.newText=n}setNewReqRisk(n){this.newRisk=n}setNewReqVerifyMethod(n){this.newVerifyMethod=n}addElement(n){let i=this.elements.get(n);return i===void 0&&(i={name:n,type:this.newElementType,docRef:this.newDocRef,cssStyles:[],classes:["default"]},this.elements.set(n,i)),this.newElementType=this.newDocRef="",i}setNewElementType(n){this.newElementType=n}setNewElementDocRef(n){this.newDocRef=n}addRelationship(n,i,o){this.relations.push({type:n,src:i,dst:o})}node(n){return this.requirements.get(n)??this.elements.get(n)}setCssStyle(n,i){for(let o of n){let r=this.node(o);if(!i||!r)return;for(let t of i)this.copy(r.cssStyles,t.includes(",")?t.split(","):[t])}}setClass(n,i){for(let o of n){let r=this.node(o);if(r)for(let t of i){r.classes.push(t);let l=this.classes.get(t)?.styles;l&&this.copy(r.cssStyles,l)}}}defineClass(n,i){for(let o of n){let r=this.classes.get(o);r===void 0&&(r={id:o,styles:[],textStyles:[]},this.classes.set(o,r));for(let l of i)l.includes("color")&&r.textStyles.push(l.replace("fill","bgFill")),r.styles.push(l);let t=i.flatMap(l=>l.split(","));for(let l of this.requirements.values())l.classes.includes(o)&&this.copy(l.cssStyles,t);for(let l of this.elements.values())l.classes.includes(o)&&this.copy(l.cssStyles,t)}}setAccTitle(n){this.accTitle=n.replace(/^\s+/g,"")}setAccDescription(n){this.accDescr=n.replace(/\n\s+/g,`
1
+ import{j as je$1,z as ze$1,q as qe}from"./VBUCM3YD-C6FrRswP.js";import{g}from"./NT5JY5WP-BhjzefjG.js";import{m,c}from"./DKTLEL5E-CJTkVtjr.js";import{e as ee$1,c as ce}from"./EFYWJBJK-CFT5CQUG.js";import{F as Ft,I as It,N as Nt,D as Dt,Y as Yt$1,L as Lt,k as kt,T as Tt}from"./BGW36YJW-BAwgTZ_z.js";import{R,O as Ot,F as Ft$1,m as m$1,Y as Yt,T as Tn,i as it$1,h as Yn,L as Le,S,j as jn,E as Et$1,y as ye,x as xt}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var W={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},te={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},j={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},$={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},Ze=1e6,ee=class{type="requirement";direction="TB";requirements=new Map;elements=new Map;relations=[];classes=new Map;title;accTitle;accDescr;newId="";newText="";newRisk="";newVerifyMethod="";newElementType="";newDocRef="";styleCopies=0;copy(n,i){if(this.styleCopies+=i.length,this.styleCopies>Ze)throw new R("Requirement diagram applies too many style declarations.","limit",{type:"requirement"});for(let o of i)n.push(o)}setDirection(n){this.direction=n}addRequirement(n,i){let o=this.requirements.get(n);return o===void 0&&(o={name:n,type:i,requirementId:this.newId,text:this.newText,risk:this.newRisk,verifyMethod:this.newVerifyMethod,cssStyles:[],classes:["default"]},this.requirements.set(n,o)),this.newId=this.newText=this.newRisk=this.newVerifyMethod="",o}setNewReqId(n){this.newId=n}setNewReqText(n){this.newText=n}setNewReqRisk(n){this.newRisk=n}setNewReqVerifyMethod(n){this.newVerifyMethod=n}addElement(n){let i=this.elements.get(n);return i===void 0&&(i={name:n,type:this.newElementType,docRef:this.newDocRef,cssStyles:[],classes:["default"]},this.elements.set(n,i)),this.newElementType=this.newDocRef="",i}setNewElementType(n){this.newElementType=n}setNewElementDocRef(n){this.newDocRef=n}addRelationship(n,i,o){this.relations.push({type:n,src:i,dst:o})}node(n){return this.requirements.get(n)??this.elements.get(n)}setCssStyle(n,i){for(let o of n){let r=this.node(o);if(!i||!r)return;for(let t of i)this.copy(r.cssStyles,t.includes(",")?t.split(","):[t])}}setClass(n,i){for(let o of n){let r=this.node(o);if(r)for(let t of i){r.classes.push(t);let l=this.classes.get(t)?.styles;l&&this.copy(r.cssStyles,l)}}}defineClass(n,i){for(let o of n){let r=this.classes.get(o);r===void 0&&(r={id:o,styles:[],textStyles:[]},this.classes.set(o,r));for(let l of i)l.includes("color")&&r.textStyles.push(l.replace("fill","bgFill")),r.styles.push(l);let t=i.flatMap(l=>l.split(","));for(let l of this.requirements.values())l.classes.includes(o)&&this.copy(l.cssStyles,t);for(let l of this.elements.values())l.classes.includes(o)&&this.copy(l.cssStyles,t)}}setAccTitle(n){this.accTitle=n.replace(/^\s+/g,"")}setAccDescription(n){this.accDescr=n.replace(/\n\s+/g,`
2
2
  `)}},de=["$end","INVALID","title","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","direction_tb","direction_bt","direction_rl","direction_lr","NEWLINE","EOF","RD","STRUCT_START","STRUCT_STOP","STYLE_SEPARATOR","COLONSEP","ID","TEXT","RISK","VERIFYMTHD","REQUIREMENT","FUNCTIONAL_REQUIREMENT","INTERFACE_REQUIREMENT","PERFORMANCE_REQUIREMENT","PHYSICAL_REQUIREMENT","DESIGN_CONSTRAINT","LOW_RISK","MED_RISK","HIGH_RISK","VERIFY_ANALYSIS","VERIFY_DEMONSTRATION","VERIFY_INSPECTION","VERIFY_TEST","ELEMENT","CONTAINS","COPIES","DERIVES","SATISFIES","VERIFIES","REFINES","TRACES","TYPE","DOCREF","STYLE","CLASSDEF","CLASS","ALPHA","COLON","SEMICOLON","PERCENT","MINUS","BRKT","END_ARROW_L","END_ARROW_R","LINE","qString","unqString","COMMA"],Ue=new Map([["requirementdiagram",14],["id",19],["text",20],["risk",21],["verifymethod",22],["requirement",23],["functionalrequirement",24],["interfacerequirement",25],["performancerequirement",26],["physicalrequirement",27],["designconstraint",28],["low",29],["medium",30],["high",31],["analysis",32],["demonstration",33],["inspection",34],["test",35],["element",36],["contains",37],["copies",38],["derives",39],["satisfies",40],["verifies",41],["refines",42],["traces",43],["type",44],["docref",45],["style",46],["classdef",47],["class",48]]),tt=/accTitle\s*:\s*/iy,nt=/accDescr\s*:\s*/iy,st=/accDescr\s*\{\s*/iy,ne=/direction\s+(?:(TB)|(BT)|(RL)|LR)/gi,Re=/[\n\r\u2028\u2029]/g,it=22,Ve=new Uint8Array(128);for(let s of`:,\r
3
3
  {<>-=`)Ve[s.charCodeAt(0)]=1;function He(s){let n=s.length,i=[],o=[],r=[],t=[],l=0,e=0,h=[[],[],[],[]],I=[[],[],[],[]],f=[0,0,0,0],p=!1,T=-1;ne.lastIndex=0;for(let c2=ne.exec(s);c2!==null;c2=ne.exec(s)){let S2=c2[1]!==void 0?0:c2[2]!==void 0?1:c2[3]!==void 0?2:3;h[S2].push(c2.index),I[S2].push(ne.lastIndex),p=!0}let E=(c2,S2,d)=>{i.push(c2),o.push(s.slice(S2,d)),r.push(S2),e=d},y=c2=>{t.push(l),l=c2},b=()=>{t.length>0&&(l=t.pop())},k=(c2,S2)=>(c2.lastIndex=S2,c2.test(s)?c2.lastIndex:-1),a=c2=>{let S2=s.indexOf(`
4
4
  `,c2);return S2===-1?n:S2},u=()=>{if(T<e){Re.lastIndex=e,T=Re.test(s)?Re.lastIndex-1:n;for(let c2=0;c2<4;c2++){let S2=h[c2],d=f[c2];for(;d<S2.length&&S2[d]<=T;)d++;f[c2]=d}}for(let c2=0;c2<4;c2++){let S2=f[c2]-1;if(S2>=0&&h[c2][S2]>=e)return E(8+c2,e,a(I[c2][S2])),!0}return!1},N=c2=>{let S2=c2|32;if(S2===116&&s.slice(e+1,e+5).toLowerCase()==="itle"&&ye(s.charCodeAt(e+5))){let d=e+6;for(;d<n;){let L=s.charCodeAt(d);if(L===35||L===10||L===59)break;d++}if(d>e+6)return E(2,e,d),!0}if(S2===97&&(s.charCodeAt(e+1)|32)===99&&(s.charCodeAt(e+2)|32)===99){let d;if((d=k(tt,e))>=0)return y(3),E(3,e,d),!0;if((d=k(nt,e))>=0)return y(4),E(5,e,d),!0;if((d=k(st,e))>=0)return y(5),e=d,!0}if(p&&!xt(c2)&&u())return!0;if(c2===10||c2===13&&s.charCodeAt(e+1)===10){let d=e;for(;d<n;){let L=s.charCodeAt(d);if(L===10)d++;else if(L===13&&s.charCodeAt(d+1)===10)d+=2;else break}return E(12,e,d),!0}if(ye(c2)){for(e++;e<n&&ye(s.charCodeAt(e));)e++;return!0}if(c2===35||c2===37)return e=a(e),!0;if(Et$1(c2)){let d=e+1;for(;d<n&&Et$1(s.charCodeAt(d));)d++;if(d-e<=it){let L=Ue.get(s.slice(e,d).toLowerCase());if(L!==void 0)return(L===46||L===47||L===48)&&y(2),E(L,e,d),!0}for(;d<n;){let L=s.charCodeAt(d);if(L<128&&Ve[L]===1)break;d++}return i.push(59),o.push(s.slice(e,d).trim()),r.push(e),e=d,!0}switch(c2){case 123:return E(15,e,e+1),!0;case 125:return E(16,e,e+1),!0;case 58:return s.charCodeAt(e+1)===58&&s.charCodeAt(e+2)===58?E(17,e,e+3):E(18,e,e+1),!0;case 60:return s.charCodeAt(e+1)!==45?!1:(E(55,e,e+2),!0);case 45:return s.charCodeAt(e+1)===62?E(56,e,e+2):E(57,e,e+1),!0;case 34:return y(1),e++,!0;case 44:return E(60,e,e+1),!0}return!1},q=c2=>{if(Et$1(c2)){let S2=e+1;for(;S2<n&&Et$1(s.charCodeAt(S2));)S2++;return E(49,e,S2),!0}switch(c2){case 58:return E(50,e,e+1),!0;case 59:return E(51,e,e+1),!0;case 37:return E(52,e,e+1),!0;case 45:return E(53,e,e+1),!0;case 35:return E(54,e,e+1),!0;case 32:return e++,!0;case 34:return y(1),e++,!0;case 10:return b(),e++,!0;case 44:return E(60,e,e+1),!0}return!1};for(;e<n;){let c2=s.charCodeAt(e),S2=!0;switch(l){case 0:S2=N(c2);break;case 2:S2=q(c2);break;case 1:if(c2===34)b(),e++;else{let d=s.indexOf('"',e);E(58,e,d===-1?n:d)}break;case 3:b(),E(4,e,a(e));break;case 4:b(),E(6,e,a(e));break;case 5:if(c2===125)b(),e++;else{let d=s.indexOf("}",e);E(7,e,d===-1?n:d)}break}if(!S2)return i.push(1),o.push(""),r.push(e),{types:i,texts:o,starts:r}}let x=l===0?13:l===1?58:l===3?4:l===4?6:l===5?7:-1;return x!==-1&&E(x,n,n),E(0,n,n),{types:i,texts:o,starts:r}}var rt=[W.REQUIREMENT,W.FUNCTIONAL_REQUIREMENT,W.INTERFACE_REQUIREMENT,W.PERFORMANCE_REQUIREMENT,W.PHYSICAL_REQUIREMENT,W.DESIGN_CONSTRAINT,te.LOW_RISK,te.MED_RISK,te.HIGH_RISK,j.VERIFY_ANALYSIS,j.VERIFY_DEMONSTRATION,j.VERIFY_INSPECTION,j.VERIFY_TEST,"",$.CONTAINS,$.COPIES,$.DERIVES,$.SATISFIES,$.VERIFIES,$.REFINES,$.TRACES];function We(s){return s===49||s===50||s===54||s===53||s===51}function Ge(s,n){let{types:i,texts:o,starts:r}=He(s),t=0,l=[],e=[],h=(a,u=a,...N)=>{let q=i[t];if(q===1)throw it$1("requirement",s,r[t],"",!0);for(let c2=u;c2>=a;c2--)N.unshift(c2);let x=N.map(c2=>`'${de[c2]}'`).join(", ");throw it$1("requirement",s,r[t],`Expecting ${x}, got '${de[q]}'`)},I=a=>(i[t]!==a&&h(a),o[t++]),f=(a,u)=>{let N=i[t];return(N<a||N>u)&&h(a,u),t++,rt[N-23]},p=()=>{let a=i[t];return a!==59&&a!==58&&h(58,59),o[t++]},T=()=>{let a=i[t];if(a===3)t++,n.setAccTitle(I(4).trim());else if(a===5)t++,n.setAccDescription(I(6).trim());else if(a===7)n.setAccDescription(o[t++].trim());else return!1;return!0},E=()=>{let a=[];for(;;){let u=i[t];if(u!==49&&u!==59&&u!==58&&h(58,59,49),a.push(o[t++]),i[t]!==60)return a;t++}},y=()=>{let a=[];for(;;){We(i[t])||h(49,51,53,54);let u=o[t++];for(;We(i[t]);)u+=o[t++];if(a.push(u),i[t]!==60)return a;t++}},b=()=>{let a;return i[t]===17?(t++,a=E(),I(15)):i[t]===15?t++:h(15,15,17),I(12),a},k=a=>{for(l.length=0,e.length=0;;){let u=i[t];if(u===16){t++;break}if(u===12){t++;continue}(a?u<19||u>22:u!==44&&u!==45)&&(a&&h(19,22,12,16),h(44,45,12,16)),t++,I(18),e.push(u===21?f(29,31):u===22?f(32,35):p()),l.push(u),I(12)}for(let u=l.length-1;u>=0;u--){let N=e[u];switch(l[u]){case 19:n.setNewReqId(N);break;case 20:n.setNewReqText(N);break;case 21:n.setNewReqRisk(N);break;case 22:n.setNewReqVerifyMethod(N);break;case 44:n.setNewElementType(N);break;default:n.setNewElementDocRef(N)}}};for(;T();)i[t]===12&&t++;for(i[t]!==14&&h(14,14,3,5,7),t++,I(12);;){let a=i[t];if(a===13)return;if(a===12)t++;else{if(T())continue;if(a>=8&&a<=11)t++,n.setDirection(a===8?"TB":a===9?"BT":a===10?"RL":"LR");else if(a>=23&&a<=28){let u=f(23,28),N=p(),q=b();k(!0),n.addRequirement(N,u),q&&n.setClass([N],q)}else if(a===36){t++;let u=p(),N=b();k(!1),n.addElement(u),N&&n.setClass([u],N)}else if(a===46){t++;let u=E();n.setCssStyle(u,y())}else if(a===47){t++;let u=E();n.defineClass(u,y())}else if(a===48){t++;let u=E();n.setClass(u,E())}else if(a===59||a===58){let u=o[t++],N=i[t];if(N===17)t++,n.setClass([u],E());else if(N===55||N===57){t++;let q=f(37,43);I(N===57?56:57);let x=p();N===57?n.addRelationship(q,u,x):n.addRelationship(q,x,u)}else h(17,17,55,57)}else h(12,13,3,5,7,8,9,10,11,23,24,25,26,27,28,36,47,48,46,59,58)}}}function Ke(s){let n=[];for(let r of s.requirements.values())n.push({id:r.name,requirement:r,element:void 0,cssStyles:r.cssStyles,cssClasses:r.classes.join(" ")});for(let r of s.elements.values())n.push({id:r.name,requirement:void 0,element:r,cssStyles:r.cssStyles,cssClasses:r.classes.join(" ")});let i=r=>s.requirements.has(r)||s.elements.has(r)?r:void 0,o=s.relations.map((r,t)=>({id:`${r.src}-${r.dst}-${t}`,start:i(r.src),end:i(r.dst),type:r.type,contains:r.type===$.CONTAINS}));return{nodes:n,edges:o,direction:s.direction}}var ot=40,ct=16,lt=56,se=14,X=10,fe=2,Qe=12,at=120,Et=280,ut=240,he=26,Xe=6,ze=9,ie=4.5,dt=28,Rt=14;function re(s,n,i){if(n===0||s.lines.length===0)return s;let o=0,r=[],t=s.lines.map(l=>{let e=0,h=l.map(I=>{let f=I.style|n,p=I.icon!==void 0||I.math?I.width:i.width(I.text,s.size,f);return e+=p,{...I,style:f,width:p}});return r.push(e),e>o&&(o=e),h});return{...s,lines:t,widths:r,width:o}}function Be(s,n,i,o){let r=Yn(s),t="",l="";for(let e=0;e<s.lines.length;e++){let h=s.lines[e],I=i+Lt(s,e);if(kt(h)){l+=Yt(Tt(s,e),n+s.widths[e]/2,I,o);continue}let f=I+s.size*.35,p=!0;for(let T of h)T.icon!==void 0||T.text===""||(t+=`<tspan${p?` x="${m$1(n)}" y="${m$1(f)}"`:""}${Le(T.style&~r)}>${S(T.text)}</tspan>`,p=!1)}return(t===""?"":`<text${jn(o,r)} text-anchor="start" xml:space="preserve">${t}</text>`)+l}function ft(s,n,i,o){let r=Xe,t=s-i*r,l=n-o*r;return`<circle class="pele-marker" cx="${m$1(t)}" cy="${m$1(l)}" r="${r}"/><path class="pele-marker" d="M${m$1(t-i*r)},${m$1(l-o*r)}L${m$1(t+i*r)},${m$1(l+o*r)}M${m$1(t+o*r)},${m$1(l-i*r)}L${m$1(t-o*r)},${m$1(l+i*r)}"/>`}function ht(s,n,i,o){let r=s-i*ze,t=n-o*ze;return`<path class="pele-marker" d="M${m$1(r-o*ie)},${m$1(t+i*ie)}L${m$1(s)},${m$1(n)}L${m$1(r+o*ie)},${m$1(t-i*ie)}" stroke-linejoin="round"/>`}function St(s,n,i){let o=new Map;for(let r of n){let t=r.route;if(!(r.src===r.dst||t.length<6))for(let l of[0,t.length-3]){let e=l===0?r.src:r.dst,h=s[e],I=t[l]-h.x,f=t[l+1]-h.y,p=l===0?3:l-3,T;if(Math.abs(Math.abs(f)-h.h/2)<.5)T=f<0?0:2;else if(Math.abs(Math.abs(I)-h.w/2)<.5)T=I<0?3:1;else continue;let E=e*4+T,y={route:t,at:l,toward:t[T%2===0?p:p+1]},b=o.get(E);b?b.push(y):o.set(E,[y])}}for(let[r,t]of o){if(t.length<2)continue;let l=r>>2,e=r%2===1,h=(e?i[l].h:i[l].w)-2*Rt,I=Math.max(0,Math.min(dt,h/(t.length-1)));t.sort((f,p)=>f.toward-p.toward);for(let f=0;f<t.length;f++){let p=(f-(t.length-1)/2)*I;e?t[f].route[t[f].at+1]=s[l].y+p:t[f].route[t[f].at]=s[l].x+p}}}function Je(s,n,i){return m(s.direction)?c(i,o=>je(s,n,i,o)):je(s,n,i,!1)}function je(s,n,i,o){let r=Ke(s),t=i.fontSize??16,l=Math.round(t*.875),e=i.measurer??Ot(i.fontFamily,i.fontFamilyMono),h=i.padding??8,I=new Map,f=[],p=[];for(let _ of r.nodes){let R2=Ft(_.cssStyles),O=(R2.bold?1:0)|(R2.italic?2:0),F=R2.fontSize??t,D=R2.fontSize??l,A=_.requirement,Y=_.element,v=re(It(`«${A?A.type:"Element"}»`,!1,e,D,4e3),O,e),g2=re(It(_.id,!0,e,F,Et),O|1,e),C=A?[["ID",A.requirementId],["Text",A.text],["Risk",A.risk],["Verification",A.verifyMethod]]:[["Type",Y.type],["Doc Ref",Y.docRef]],w=[],P=0,U=0,M=0;for(let[J,Q]of C){if(!Q)continue;let le=re(It(J,!1,e,D,4e3),O,e),ae=re(It(Q,!0,e,D,ut),O,e),me=Math.max(le.height,ae.height);w.push({key:le,value:ae,height:me}),P=Math.max(P,le.width),U=Math.max(U,ae.width),M+=me+fe}w.length>0&&(M+=2*X-fe);let V=2*X+v.height+g2.height,H=Math.max(at,Math.max(v.width,g2.width)+2*se,w.length>0?P+Qe+U+2*se:0);I.has(_.id)||I.set(_.id,f.length);let K=ze$1(H,V+M);K.seq=f.length,f.push({node:_,style:R2,kind:v,name:g2,rows:w,keyWidth:P,headHeight:V,w:H,h:V+M}),p.push(K)}let T=o?"TB":qe(r.direction),E=T==="LR"||T==="RL",y=[],b=[],k=[];for(let _ of r.edges){let R2=_.start===void 0?void 0:I.get(_.start),O=_.end===void 0?void 0:I.get(_.end);if(R2===void 0||O===void 0)continue;let F=It(`«${_.type}»`,!1,e,l,4e3);R2===O&&(E?p[R2].h+=2*(he+F.height+8):p[R2].w+=2*(he+F.width+12)),k.push(_),b.push(F),y.push({src:R2,dst:O,minlen:1,labelW:F.width+12,labelH:F.height+4,route:[],labelX:0,labelY:0})}let a=je$1(p,y,T,{nodeSep:ot,edgeSep:ct,rankSep:lt,portSep:20});St(p,y,f);let u=g(s.title,e,t,4e3),N=u.height>0?u.height+12:0,q=Math.max(a.width,u.width),x=h+(q-a.width)/2,c2=h+N,S2=Math.ceil(q+2*h),d=Math.ceil(a.height+N+2*h),L="";for(let _=0;_<f.length;_++){let R2=f[_],{w:O,h:F,style:D}=R2,A=Ft$1(D),Y=A||' fill="var(--_m)"',v=-O/2,g2=-F/2,C=`<rect x="${m$1(v)}" y="${m$1(g2)}" width="${m$1(O)}" height="${m$1(F)}" fill="var(--_s)" stroke="var(--_b)"${Nt(D.shape)}/>`+Yt(R2.kind,0,g2+X+R2.kind.height/2,` class="pele-stereotype" font-size="${R2.kind.size}"${Y}${D.text}`)+Yt(R2.name,0,g2+X+R2.kind.height+R2.name.height/2,` class="pele-label" font-size="${R2.name.size}" font-weight="var(--_hw)"${A}${D.text}`);if(R2.rows.length>0){let w=g2+R2.headHeight;C+=`<path class="pele-divider" d="M${m$1(v)},${m$1(w)}H${m$1(-v)}" stroke="var(--_b)"${D.line}/>`;let P=w+X,U="";for(let M of R2.rows)U+=Be(M.key,v+se,P,` class="pele-field"${Y}${D.text}`)+Be(M.value,v+se+R2.keyWidth+Qe,P,` class="pele-value"${A}${D.text}`),P+=M.height+fe;C+=`<g class="pele-fields" font-size="${R2.rows[0].key.size}">${U}</g>`}L+=`<g class="pele-node ${R2.node.requirement?"pele-requirement":"pele-element"}${Dt(R2.node.cssClasses.replace(/^default\s?/,""))}" data-id="${Tn(R2.node.id)}" transform="translate(${m$1(p[_].x+x)},${m$1(p[_].y+c2)})">${C}</g>`}let oe="",ce$1="",Se=new Map;for(let _=0;_<y.length;_++){let R2=y[_],O=k[_],F=b[_],D=O.contains?2*Xe:0,A,Y=R2.labelX+x,v=R2.labelY+c2;if(R2.src===R2.dst){let g2=f[R2.src],C=p[R2.src].x+x,w=p[R2.src].y+c2,P=Se.get(R2.src)??0;Se.set(R2.src,P+1);let U=(E?g2.w:g2.h)/2,M=Math.min(U-4,12+P*6),V=he+P*8,H=(J,Q)=>E?`${m$1(C+Q)},${m$1(w+g2.h/2+J)}`:`${m$1(C+g2.w/2+J)},${m$1(w+Q)}`,K=V/.75;A={d:`M${H(D,-M)}C${H(K,-M)} ${H(K,M)} ${H(0,M)}`,sx:E?C-M:C+g2.w/2,sy:E?w+g2.h/2:w-M,sdx:E?0:-1,sdy:E?-1:0,ex:E?C+M:C+g2.w/2,ey:E?w+g2.h/2:w+M,edx:E?0:-1,edy:E?-1:0},E?(Y=C,v=w+g2.h/2+V+4+R2.labelH/2):(Y=C+g2.w/2+V+4+R2.labelW/2,v=w)}else{let g2=R2.route.slice();for(let C=0;C<g2.length;C+=3)g2[C]+=x,g2[C+1]+=c2;A=ee$1(g2,void 0,D,0)}oe+=`<g class="pele-edge pele-relationship-${O.contains?"contains":"arrow"}" data-id="${Tn(O.id)}"><path d="${A.d}"${O.contains?"":' stroke-dasharray="5 4"'}/>`+(O.contains?ft(A.sx,A.sy,A.sdx,A.sdy):ht(A.ex,A.ey,A.edx,A.edy))+"</g>",ce$1+=ce(O.id,F,Y,v,"")}return{svg:Yt$1("requirement",S2,d,t,i,s,Yt(u,S2/2,h+u.height/2,' class="pele-title" font-weight="var(--_tw)"')+(oe?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${oe}</g>`:"")+(ce$1?`<g class="pele-edge-labels" font-size="${l}" fill="var(--_m)">${ce$1}</g>`:"")+`<g class="pele-nodes">${L}</g>`),width:S2,height:d,links:[]}}var Qt={type:"requirement",math:!0,parse(s,n,i){let o=new ee;return i&&(o.title=i),Ge(s,o),o},render:Je};export{Qt as requirement};
@@ -1,4 +1,4 @@
1
- import{x}from"./4LWW3ZNH-D7lTurDT.js";import{q as qe$1,z as ze$1,j as je$1,H as He$1}from"./VBUCM3YD-0sLtn_Zp.js";import{g}from"./NT5JY5WP-B1NtxJ-K.js";import{m,c as c$1}from"./DKTLEL5E-CJTkVtjr.js";import{e as ee$1,a as Xn$1,Y as Yn$1,q as qn$1,r as re$1,c as ce$1,b as ae,d as cn$1,_ as _n$1}from"./EFYWJBJK-Cbn-VZcb.js";import{F as Ft,D as Dt,N as Nt$1,Y as Yt$1,I as It$1,C as Ct$1,L as Lt,T as Tt$1}from"./BGW36YJW-DhmSG9tb.js";import{O as Ot$1,T as Tn$1,F as Ft$1,P as Pt,m as m$1,Y as Yt,S,p as bt$1,w as wt,l as yt$1,q as kt,R,s as st,r as ae$1}from"./lazy-D3tN-GAO.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";var lt="EOF USECASE ACTOR SYSTEM_BOUNDARY END DIRECTION TD TB BT LR RL NOTE FOR JSON CLASS_DEF CLASS STYLE INCLUDE EXTEND TRUE FALSE IDENTIFIER NUMBER AT COMMA COLON HASH_COLOR CSS_IDENTIFIER CSS_ESCAPED_COMMA DASH DOT PERCENT CSS_PUNCTUATION LABEL_PUNCTUATION LABEL_SYMBOL PLAIN_STRING MARKDOWN_STRING UNCLOSED_MARKDOWN_STRING COMMENT NEWLINE ACC_DESCR_BLOCK ACC_TITLE_LINE ACC_DESCR_LINE JSON_DECLARATION_START JSON_OBJECT_LITERAL UNCLOSED_JSON_OBJECT_LITERAL GENERALIZATION DEPENDENCY_ARROW STEREOTYPE_START STEREOTYPE_END STEREOTYPE_TEXT UNCLOSED_STEREOTYPE_TEXT CLASS_SEPARATOR FORWARD_SOLID BACKWARD_SOLID FORWARD_CIRCLE BACKWARD_CIRCLE FORWARD_CROSS BACKWARD_CROSS MARKERLESS_SOLID METADATA_START LBRACE RBRACE LBRACKET RBRACKET LPAREN RPAREN".split(" "),Ne=1,pn=2,oe=new Uint8Array(128);for(let e=48;e<=57;e++)oe[e]=Ne;for(let e=65;e<=90;e++)oe[e]=oe[e+32]=Ne;oe[95]=Ne;for(let e of"!#$&*+/=?^|~")oe[e.charCodeAt(0)]=pn;var ln=[0,12,5,14,3,9,2,2,2,2,2,4,3,4,8,5,5,7,6,4,5];function Ge(e){return e<128&&(oe[e]&Ne)!==0}function ct(e,n,a){for(let r=0;r<a.length;r++)if((e.charCodeAt(n+r)|32)!==a.charCodeAt(r))return!1;return!0}function ss(e,n,a){switch(a){case 97:return e.startsWith("actor",n)?2:0;case 115:return e.startsWith("systemBoundary",n)?3:e.startsWith("style",n)?16:0;case 101:return e.startsWith("end",n)?4:ct(e,n,"extend")?18:0;case 69:return ct(e,n,"extend")?18:0;case 100:return e.startsWith("direction",n)?5:0;case 84:return e.startsWith("TD",n)?6:e.startsWith("TB",n)?7:0;case 66:return e.startsWith("BT",n)?8:0;case 76:return e.startsWith("LR",n)?9:0;case 82:return e.startsWith("RL",n)?10:0;case 110:return e.startsWith("note",n)?11:0;case 102:return e.startsWith("for",n)?12:e.startsWith("false",n)?20:0;case 106:return e.startsWith("json",n)?13:0;case 99:return e.startsWith("classDef",n)?14:e.startsWith("class",n)?15:0;case 105:case 73:return ct(e,n,"include")?17:0;case 116:return e.startsWith("true",n)?19:0;case 117:return e.startsWith("usecase-beta",n)?1:0;default:return 0}}function ce(e,n){[e,n]=ae$1(e,n);let a=1,r=0;for(let o=0;o<n;o++){let s=e.charCodeAt(o);s!==10&&s!==13||(s===13&&o+1<n&&e.charCodeAt(o+1)===10&&o++,a++,r=o+1)}return[a,n-r+1]}function je(e,n,a){let[r,o]=ce(e,n);return`line ${r}, column ${o} [${ae$1(e,n)[1]},${ae$1(e,a)[1]})`}function dn(e,n,a){for(let r=n+1;r<e.length;r++){let o=e.charCodeAt(r);if(o===a)return r+1;if(o===10||o===13)return-1}return-1}function as(e,n){let a=e.charCodeAt(n);return a!==34&&a!==39?!0:a===34&&e.charCodeAt(n+1)===96||dn(e,n,a)!==-1}function cn(e,n,a){let[r,o]=ce(e,n),[s,u]=[ae$1(e,n)[1],ae$1(e,n+a)[1]];return new R(`Error lexing usecase diagram: unexpected character: ->${e.charAt(n)}<- at offset: ${s}, skipped ${u-s} characters. at line ${r}, column ${o} [${s},${u})`,"syntax",{type:"usecase",line:r,column:o})}function un(e){let n=[],a=[],r=[],o=e.length,s=0,u=!0,y=!1;for(;s<o;){let h=e.charCodeAt(s);if(h===32||h===9){s++;continue}let f,d=s+1,C=!1;if(h<128&&(oe[h]&Ne)!==0){if(f=0,h===97&&u&&e.startsWith("acc",s)){let l=e.startsWith("Descr",s+3);if(l||e.startsWith("Title",s+3)){let A=s+8;for(;bt$1(e.charCodeAt(A));)A++;let L=e.charCodeAt(A);if(L===58)for(f=l?42:41,d=A+1;d<o&&e.charCodeAt(d)!==10&&e.charCodeAt(d)!==13;)d++;else if(L===123&&l&&!y){let I=e.indexOf("}",A+1);I===-1?y=!0:(f=40,d=I+1)}}}else if(h===106&&e.startsWith("json",s)&&bt$1(e.charCodeAt(s+4))){let l=s+5;for(;bt$1(e.charCodeAt(l));)l++;let A=l;for(;Ge(e.charCodeAt(l));)l++;if(l>A){for(;bt$1(e.charCodeAt(l));)l++;if(e.charCodeAt(l)===64){for(l++;bt$1(e.charCodeAt(l));)l++;if(e.charCodeAt(l)===123){n.push(43),a.push(s),r.push(l),s=l;let L=0,I=!1,w=!1,T=l;for(;T<o;T++){let k=e.charCodeAt(T);if(I)w?w=!1:k===92?w=!0:k===34&&(I=!1);else if(k===34)I=!0;else if(k===123)L++;else if(k===125&&--L===0)break}n.push(T<o?44:45),a.push(l),s=T<o?T+1:o,r.push(s),u=!1;continue}}}}if(f===0){for(;d<o&&Ge(e.charCodeAt(d));)d++;let l=ss(e,s,h);if(l!==0)l===1||d-s===ln[l]?(f=l,d=s+ln[l]):f=21;else if((h===111||h===120)&&e.charCodeAt(s+1)===45&&e.charCodeAt(s+2)===45)f=h===111?56:58,d=s+3;else if(wt(h)){let A=s+1;for(;wt(e.charCodeAt(A));)A++;if(e.charCodeAt(A)===46&&wt(e.charCodeAt(A+1))){for(f=22,d=A+2;wt(e.charCodeAt(d));)d++;for(;yt$1(e.charCodeAt(d));)d++}else f=21}else for(f=21;e.charCodeAt(d)===45&&Ge(e.charCodeAt(d+1));)for(f=27,d+=2;Ge(e.charCodeAt(d));)d++}}else if(h===10)f=39,C=!0;else if(h===13)f=39,C=!0,e.charCodeAt(d)===10&&d++;else if(h===34||h===39){if(h===34&&e.charCodeAt(s+1)===96){let l=e.indexOf('`"',s+2);f=l===-1?37:36,d=l===-1?o:l+2}else if(f=35,d=dn(e,s,h),d===-1){let l=s+1;for(;l<o&&!as(e,l);)l++;throw cn(e,s,l-s)}}else if(h===37)if(u&&e.charCodeAt(d)===37)for(f=38;d<o&&e.charCodeAt(d)!==10&&e.charCodeAt(d)!==13;)d++;else f=31;else if(h===45)if(e.charCodeAt(d)!==45)f=29;else{for(;e.charCodeAt(d)===45;)d++;let l=e.charCodeAt(d),A=d-s===2;A&&l===124&&e.charCodeAt(d+1)===62?(f=46,d+=2):l===62?(f=53,d++):A&&(l===111||l===120)?(f=l===111?55:57,d++):f=59}else if(h===46){let l=e.charCodeAt(d);if(l===46&&e.charCodeAt(d+1)===62)f=47,d+=2;else if(wt(l)){for(f=22;wt(e.charCodeAt(d));)d++;for(;yt$1(e.charCodeAt(d));)d++}else f=30}else if(h===60)if(e.charCodeAt(d)===60){if(n.push(48),a.push(s),r.push(s+2),u=!1,s+=2,s>=o)break;if(e.charCodeAt(s)===62&&e.charCodeAt(s+1)===62)f=49,d=s+2;else{let l=s,A=!1;for(;l<o;l++){let L=e.charCodeAt(l);if(L===10||L===13)break;if(L===62&&e.charCodeAt(l+1)===62){A=!0;break}}if(A&&e.slice(s,l).trim()!=="")n.push(50),a.push(s),r.push(l),f=49,s=l,d=l+2;else{for(;l<o&&e.charCodeAt(l)!==10&&e.charCodeAt(l)!==13;)l++;if(l===s){for(;l<o&&(e.charCodeAt(l)===10||e.charCodeAt(l)===13);)l++;throw cn(e,s,l-s)}f=51,d=l}}}else if(e.charCodeAt(d)===45&&e.charCodeAt(d+1)===45)for(f=54,d+=2;e.charCodeAt(d)===45;)d++;else f=33;else if(h===58)e.charCodeAt(d)===58&&e.charCodeAt(d+1)===58?(f=52,d+=2):f=25;else if(h===64)e.charCodeAt(d)===123?(f=60,d++):f=23;else if(h===123)f=61;else if(h===125)f=62;else if(h===91)f=63;else if(h===93)f=64;else if(h===40)f=65;else if(h===41)f=66;else if(h===44)f=24;else if(h===35){for(;kt(e.charCodeAt(d));)d++;f=d>s+1?26:32}else if(h===92)e.charCodeAt(d)===44?(f=28,d++):f=33;else if(h<127&&h>32)f=(oe[h]&pn)!==0?32:33;else for(f=34;d<o;){let l=e.charCodeAt(d);if(l>=32&&l<127||l===9||l===10||l===13)break;d++}n.push(f),a.push(s),r.push(d),s=d,u=C}for(let h=0;h<3;h++)n.push(0),a.push(o),r.push(o);return{types:n,starts:a,ends:r}}function fn(){return{type:"usecase",actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,direction:"LR",title:void 0,accTitle:"",accDescr:"",accDescription:"",source:"",headerSpan:[0,0],statements:[]}}function hn(){return{elements:[],boundaries:[],jsons:[],relationships:[],notes:[],metadata:[],classes:[],styles:[],classDefs:[],direction:void 0,accTitle:"",accDescription:""}}function pt(e,n){if(n.length===0)return;let a=new Set(e);for(let r of n)a.has(r)||(a.add(r),e.push(r))}function os(e){let n=new Set(["actor","usecase","boundary","edge"]);for(let{key:a,value:r}of e)if(a==="icon")n.clear(),n.add("actor");else if(a==="animate"||a==="animation")n.clear(),n.add("edge");else if(a==="type")n.clear(),r==="rect"||r==="package"?n.add("boundary"):(r==="normal"||r==="hollow"||r==="awesome")&&n.add("actor");else if(a==="business")n.delete("boundary"),n.delete("edge");else return;return n.size===1?[...n][0]:void 0}function yn(e,n,a,r,o){let s=fn(),{actors:u,useCases:y,systemBoundaries:h}=s,f=new Map,d=new Map,C=new Map,l=new Map,A=new Map,L=t=>je(e,t[0],t[1]),I=(t,i)=>{let[p,S2]=ce(e,i[0]);return new R(t,"semantic",{type:"usecase",line:p,column:S2})},w=(t,i)=>{throw I(`${t} at ${L(i)}`,i)},T=(t,i,p,S2,R2)=>{let O=g2=>g2===void 0?"":` (label "${g2}")`;throw I(`${t} at ${L(i)}${O(S2)}; previous declaration at ${L(p)}${O(R2)}`,i)},k=(t,i,p)=>w(`Metadata property '${p.key}' is invalid for ${i} '${t}'`,p.keySpan),X=(t,i)=>{let p=A.get(t);(p===void 0||i<p)&&A.set(t,i)},ne=t=>[...t].sort((i,p)=>(A.get(i.id)??0)-(A.get(p.id)??0)),fe=(t,i)=>{f.set(t.id,{kind:i,span:t.span,generated:t.generated,label:t.label.text})},Ae=(t,i)=>{let p=f.get(t.id);if(!p)return;let S2=t.generated?t.label.text:void 0,R2=p.generated?p.label:void 0;p.kind!==i&&T(`ID '${t.id}' is declared as both ${p.kind} and ${i}`,t.span,p.span,S2,R2),(p.generated||t.generated)&&T(`Generated ID '${t.id}' collides with another declaration`,t.span,p.span,S2,R2)},xe=(t,i,p)=>{let S2=f.get(t);S2&&T(`ID '${t}' is declared more than once (${S2.kind} and ${i})`,p,S2.span,void 0,S2.generated?S2.label:void 0),f.set(t,{kind:i,span:p,generated:!1})},st2=(t,i,p)=>{let{key:S2,value:R2}=i,O=g2=>{!p&&g2!==void 0&&g2!==R2&&T(`Actor '${t.id}' has conflicting ${S2} metadata`,i.keySpan,t.span)};S2==="type"&&(R2==="normal"||R2==="hollow"||R2==="awesome")?(O(t.actorType),t.actorType=R2):S2==="icon"&&typeof R2=="string"?(O(t.icon),t.icon=R2):S2==="business"&&typeof R2=="boolean"?(O(t.business),t.business=R2):k(t.id,"actor",i)},ie=(t,i,p)=>{for(let S2 of i??[])t.kind==="actor"?st2(t,S2,p):S2.key==="business"&&typeof S2.value=="boolean"?(!p&&t.business!==void 0&&t.business!==S2.value&&T(`Use case '${t.id}' has conflicting business metadata`,S2.keySpan,t.span),t.business=S2.value):k(t.id,"usecase",S2)},he=t=>{let i;if(t.kind==="actor"){y.delete(t.id);let p={id:t.id,label:t.label.text,labelType:t.label.type,business:t.business??!1,classes:[...t.classes],type:t.icon?"icon":t.actorType??"normal",styles:u.get(t.id)?.styles??[]};t.icon&&(p.icon=t.icon),u.set(t.id,p),i=p}else u.delete(t.id),i={id:t.id,label:t.label.text,labelType:t.label.type,business:t.business??!1,classes:[...t.classes],shape:t.shape??"ellipse",styles:y.get(t.id)?.styles??[]},y.set(t.id,i);t.stereotype&&(i.stereotype=t.stereotype),t.parent?.id&&(i.parentId=t.parent.id)},ke=t=>{Ae(t,t.kind);let i=t.parent?.id?t.parent:void 0,p=d.get(t.id);if(!p){let S2={kind:t.kind,id:t.id,label:t.label,span:t.span,generated:t.generated,classes:[...t.classes],parent:i,shape:t.shape,stereotype:t.stereotype,stereotypeSpan:t.stereotype?t.span:void 0};ie(S2,t.metadata,!1),d.set(t.id,S2),fe(t,t.kind);return}(p.label.text!==t.label.text||p.label.type!==t.label.type)&&T(`ID '${t.id}' has conflicting labels`,t.span,p.span),t.shape&&p.shape&&t.shape!==p.shape&&T(`Use case '${t.id}' has conflicting shapes`,t.span,p.span),i&&p.parent?.id&&i.id!==p.parent.id&&T(`Element '${t.id}' belongs to more than one system boundary`,i.span,p.parent.span),t.stereotype&&p.stereotype&&t.stereotype!==p.stereotype&&T(`Element '${t.id}' has conflicting stereotypes`,t.span,p.stereotypeSpan??p.span),p.shape??=t.shape,p.parent??=t.parent,p.stereotype??=t.stereotype,p.stereotypeSpan??=t.stereotype?t.span:void 0,pt(p.classes,t.classes),ie(p,t.metadata,!1)},be=t=>{Ae(t,"boundary");let i=C.get(t.id);if(i){(i.label.text!==t.label.text||i.label.type!==t.label.type)&&T(`Boundary '${t.id}' has conflicting titles`,t.span,i.span),pt(i.classes,t.classes);return}C.set(t.id,{...t,classes:[...t.classes],members:[]}),fe(t,"boundary")},me=t=>{t.classed&&!t.declares&&w(`Relationship endpoint '${t.id}' uses ::: without declaring the node`,t.span);let i=f.get(t.id);return i?i.kind:(d.set(t.id,{...t,kind:"usecase",shape:"ellipse",classes:[]}),fe(t,"usecase"),X(t.id,t.span[0]),"usecase")},Re=(t,i)=>{let p=f.get(t)?.kind;return(p==="actor"?u.get(t):p==="usecase"?y.get(t):p==="boundary"?h.get(t):p==="json"?s.jsonNodes.get(t):l.get(t))??w(`Class/style target '${t}' is unresolved or anonymous`,i)},se=[];for(let{source:t,target:i}of n.relationships)X(t.id,t.span[0]),X(i.id,i.span[0]);for(let t of n.elements)X(t.id,t.span[0]),se.push({offset:t.span[0],run:()=>ke(t)});for(let t of n.boundaries)X(t.id,t.span[0]),se.push({offset:t.span[0],run:()=>be(t)});for(let t of n.jsons)X(t.id,t.span[0]),se.push({offset:t.span[0],run:()=>xe(t.id,"json",t.span)});for(let{id:t,idSpan:i}of n.relationships)t&&i&&se.push({offset:i[0],run:()=>xe(t,"edge",i)});se.sort((t,i)=>t.offset-i.offset);for(let t of se)t.run();for(let t of ne(d.values()))he(t);for(let t of ne(C.values()))h.set(t.id,{id:t.id,label:t.label.text,labelType:t.label.type,type:"rect",members:[],classes:[],styles:[]});for(let t of ne(n.jsons))s.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]});let Ce=0;for(let t of n.relationships){let{source:i,target:p,type:S2}=t,R2=me(i),O=me(p),g2=$=>$==="actor"||$==="usecase"||$==="json";g2(R2)||T(`Relationship source '${i.id}' cannot be ${R2}`,i.span,f.get(i.id).span),g2(O)||T(`Relationship target '${p.id}' cannot be ${O}`,p.span,f.get(p.id).span),(S2==="include"||S2==="extend")&&(R2!=="usecase"||O!=="usecase")&&w(`${S2} relationship requires use-case endpoints`,t.span),S2==="generalization"&&(R2==="json"||R2!==O)&&w("Generalization requires actor-to-actor or use-case-to-use-case endpoints",t.span),S2==="association"&&(R2==="json"||O==="json")&&t.arrowType>2&&w(`JSON relationship '${i.id}' to '${p.id}' permits only point, reversed-point, or markerless solid association`,t.span);let m2=t.id??`edge-${Ce++}`,N={id:m2,explicitId:!!t.id,source:i.id,target:p.id,type:S2,arrowType:t.arrowType,minlen:t.minlen,classes:[],styles:[],animate:!1};t.label&&(N.label=t.label.text,N.labelType=t.label.type),s.relationships.push(N),l.set(m2,N)}let Oe=new Map(u),We=new Map(y);u.clear(),y.clear();for(let t of ne(d.values())){let i=Oe.get(t.id),p=We.get(t.id);i?u.set(t.id,i):p?y.set(t.id,p):he(t)}for(let{target:t,span:i,properties:p,statement:S2}of n.metadata){let R2=f.get(t);if(!R2){let N=os(p);return w(`Metadata target '${t}' is unresolved${N?` (metadata implies ${N})`:""}`,i)}let O=R2.kind;O==="actor"||O==="usecase"?ie(d.get(t),p,!0):O==="edge"&&(S2.kind="edgeMetadata",S2.edges=[{id:t,span:S2.span,idSpan:i,metadata:S2.metadata}],delete S2.nodes);let g2=C.get(t),m2=l.get(t);for(let N of O==="actor"||O==="usecase"?[]:p){let{key:$,value:_}=N;O==="boundary"&&g2&&$==="type"&&(_==="rect"||_==="package")?g2.type=_:O==="edge"&&m2&&$==="animate"&&typeof _=="boolean"?m2.animate=_:O==="edge"&&m2&&$==="animation"&&(_==="fast"||_==="slow")?(m2.animation=_,m2.animate=!0):k(t,O,N)}}for(let t of s.relationships)t.animation&&(t.animate=!0);for(let t of d.values())t.kind==="actor"?(t.icon&&t.actorType&&t.actorType!=="normal"&&w(`Actor '${t.id}' cannot combine icon with type '${t.actorType}'`,t.span),t.business&&(t.icon||t.actorType==="awesome")&&w(`Business actor '${t.id}' must use normal or hollow geometry`,t.span)):t.shape==="rect"&&t.business&&w(`Rectangular use case '${t.id}' cannot be a business use case`,t.span),he(t);for(let t of[...n.elements].sort((i,p)=>i.span[0]-p.span[0])){if(!t.parent?.id)continue;let i=C.get(t.parent.id).members;i.includes(t.id)||i.push(t.id)}for(let t of C.values()){let i=h.get(t.id);i.type=t.type??"rect",i.members=t.members,i.classes=[...t.classes]}let Lt2=0;for(let t of n.notes){let i=f.get(t.target);if(!i)return w(`Note target '${t.target}' is unresolved`,t.span);i.kind!=="actor"&&i.kind!=="usecase"&&T(`Note target '${t.target}' must be an actor or use case, not ${i.kind}`,t.span,i.span);let p=`note-${Lt2++}`;s.notes.set(p,{id:p,target:t.target,label:t.label.text,labelType:t.label.type})}for(let t of n.classDefs)for(let i of t.ids)s.classDefs.set(i,{id:i,styles:[...t.styles]});for(let t of n.classes)for(let i of t.targets)pt(Re(i.id,i.span).classes,t.classes);for(let t of n.styles)Re(t.target,t.span).styles.push(...t.styles);return s.direction=n.direction??s.direction,s.title=o,s.accTitle=n.accTitle,s.accDescription=n.accDescription,s.accDescr=n.accDescription.replace(/\n\s+/g,`
1
+ import{x}from"./4LWW3ZNH-CPyJ9o9Y.js";import{q as qe$1,z as ze$1,j as je$1,H as He$1}from"./VBUCM3YD-C6FrRswP.js";import{g}from"./NT5JY5WP-BhjzefjG.js";import{m,c as c$1}from"./DKTLEL5E-CJTkVtjr.js";import{e as ee$1,a as Xn$1,Y as Yn$1,q as qn$1,r as re$1,c as ce$1,b as ae,d as cn$1,_ as _n$1}from"./EFYWJBJK-CFT5CQUG.js";import{F as Ft,D as Dt,N as Nt$1,Y as Yt$1,I as It$1,C as Ct$1,L as Lt,T as Tt$1}from"./BGW36YJW-BAwgTZ_z.js";import{O as Ot$1,T as Tn$1,F as Ft$1,P as Pt,m as m$1,Y as Yt,S,p as bt$1,w as wt,l as yt$1,q as kt,R,s as st,r as ae$1}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var lt="EOF USECASE ACTOR SYSTEM_BOUNDARY END DIRECTION TD TB BT LR RL NOTE FOR JSON CLASS_DEF CLASS STYLE INCLUDE EXTEND TRUE FALSE IDENTIFIER NUMBER AT COMMA COLON HASH_COLOR CSS_IDENTIFIER CSS_ESCAPED_COMMA DASH DOT PERCENT CSS_PUNCTUATION LABEL_PUNCTUATION LABEL_SYMBOL PLAIN_STRING MARKDOWN_STRING UNCLOSED_MARKDOWN_STRING COMMENT NEWLINE ACC_DESCR_BLOCK ACC_TITLE_LINE ACC_DESCR_LINE JSON_DECLARATION_START JSON_OBJECT_LITERAL UNCLOSED_JSON_OBJECT_LITERAL GENERALIZATION DEPENDENCY_ARROW STEREOTYPE_START STEREOTYPE_END STEREOTYPE_TEXT UNCLOSED_STEREOTYPE_TEXT CLASS_SEPARATOR FORWARD_SOLID BACKWARD_SOLID FORWARD_CIRCLE BACKWARD_CIRCLE FORWARD_CROSS BACKWARD_CROSS MARKERLESS_SOLID METADATA_START LBRACE RBRACE LBRACKET RBRACKET LPAREN RPAREN".split(" "),Ne=1,pn=2,oe=new Uint8Array(128);for(let e=48;e<=57;e++)oe[e]=Ne;for(let e=65;e<=90;e++)oe[e]=oe[e+32]=Ne;oe[95]=Ne;for(let e of"!#$&*+/=?^|~")oe[e.charCodeAt(0)]=pn;var ln=[0,12,5,14,3,9,2,2,2,2,2,4,3,4,8,5,5,7,6,4,5];function Ge(e){return e<128&&(oe[e]&Ne)!==0}function ct(e,n,a){for(let r=0;r<a.length;r++)if((e.charCodeAt(n+r)|32)!==a.charCodeAt(r))return!1;return!0}function ss(e,n,a){switch(a){case 97:return e.startsWith("actor",n)?2:0;case 115:return e.startsWith("systemBoundary",n)?3:e.startsWith("style",n)?16:0;case 101:return e.startsWith("end",n)?4:ct(e,n,"extend")?18:0;case 69:return ct(e,n,"extend")?18:0;case 100:return e.startsWith("direction",n)?5:0;case 84:return e.startsWith("TD",n)?6:e.startsWith("TB",n)?7:0;case 66:return e.startsWith("BT",n)?8:0;case 76:return e.startsWith("LR",n)?9:0;case 82:return e.startsWith("RL",n)?10:0;case 110:return e.startsWith("note",n)?11:0;case 102:return e.startsWith("for",n)?12:e.startsWith("false",n)?20:0;case 106:return e.startsWith("json",n)?13:0;case 99:return e.startsWith("classDef",n)?14:e.startsWith("class",n)?15:0;case 105:case 73:return ct(e,n,"include")?17:0;case 116:return e.startsWith("true",n)?19:0;case 117:return e.startsWith("usecase-beta",n)?1:0;default:return 0}}function ce(e,n){[e,n]=ae$1(e,n);let a=1,r=0;for(let o=0;o<n;o++){let s=e.charCodeAt(o);s!==10&&s!==13||(s===13&&o+1<n&&e.charCodeAt(o+1)===10&&o++,a++,r=o+1)}return[a,n-r+1]}function je(e,n,a){let[r,o]=ce(e,n);return`line ${r}, column ${o} [${ae$1(e,n)[1]},${ae$1(e,a)[1]})`}function dn(e,n,a){for(let r=n+1;r<e.length;r++){let o=e.charCodeAt(r);if(o===a)return r+1;if(o===10||o===13)return-1}return-1}function as(e,n){let a=e.charCodeAt(n);return a!==34&&a!==39?!0:a===34&&e.charCodeAt(n+1)===96||dn(e,n,a)!==-1}function cn(e,n,a){let[r,o]=ce(e,n),[s,u]=[ae$1(e,n)[1],ae$1(e,n+a)[1]];return new R(`Error lexing usecase diagram: unexpected character: ->${e.charAt(n)}<- at offset: ${s}, skipped ${u-s} characters. at line ${r}, column ${o} [${s},${u})`,"syntax",{type:"usecase",line:r,column:o})}function un(e){let n=[],a=[],r=[],o=e.length,s=0,u=!0,y=!1;for(;s<o;){let h=e.charCodeAt(s);if(h===32||h===9){s++;continue}let f,d=s+1,C=!1;if(h<128&&(oe[h]&Ne)!==0){if(f=0,h===97&&u&&e.startsWith("acc",s)){let l=e.startsWith("Descr",s+3);if(l||e.startsWith("Title",s+3)){let A=s+8;for(;bt$1(e.charCodeAt(A));)A++;let L=e.charCodeAt(A);if(L===58)for(f=l?42:41,d=A+1;d<o&&e.charCodeAt(d)!==10&&e.charCodeAt(d)!==13;)d++;else if(L===123&&l&&!y){let I=e.indexOf("}",A+1);I===-1?y=!0:(f=40,d=I+1)}}}else if(h===106&&e.startsWith("json",s)&&bt$1(e.charCodeAt(s+4))){let l=s+5;for(;bt$1(e.charCodeAt(l));)l++;let A=l;for(;Ge(e.charCodeAt(l));)l++;if(l>A){for(;bt$1(e.charCodeAt(l));)l++;if(e.charCodeAt(l)===64){for(l++;bt$1(e.charCodeAt(l));)l++;if(e.charCodeAt(l)===123){n.push(43),a.push(s),r.push(l),s=l;let L=0,I=!1,w=!1,T=l;for(;T<o;T++){let k=e.charCodeAt(T);if(I)w?w=!1:k===92?w=!0:k===34&&(I=!1);else if(k===34)I=!0;else if(k===123)L++;else if(k===125&&--L===0)break}n.push(T<o?44:45),a.push(l),s=T<o?T+1:o,r.push(s),u=!1;continue}}}}if(f===0){for(;d<o&&Ge(e.charCodeAt(d));)d++;let l=ss(e,s,h);if(l!==0)l===1||d-s===ln[l]?(f=l,d=s+ln[l]):f=21;else if((h===111||h===120)&&e.charCodeAt(s+1)===45&&e.charCodeAt(s+2)===45)f=h===111?56:58,d=s+3;else if(wt(h)){let A=s+1;for(;wt(e.charCodeAt(A));)A++;if(e.charCodeAt(A)===46&&wt(e.charCodeAt(A+1))){for(f=22,d=A+2;wt(e.charCodeAt(d));)d++;for(;yt$1(e.charCodeAt(d));)d++}else f=21}else for(f=21;e.charCodeAt(d)===45&&Ge(e.charCodeAt(d+1));)for(f=27,d+=2;Ge(e.charCodeAt(d));)d++}}else if(h===10)f=39,C=!0;else if(h===13)f=39,C=!0,e.charCodeAt(d)===10&&d++;else if(h===34||h===39){if(h===34&&e.charCodeAt(s+1)===96){let l=e.indexOf('`"',s+2);f=l===-1?37:36,d=l===-1?o:l+2}else if(f=35,d=dn(e,s,h),d===-1){let l=s+1;for(;l<o&&!as(e,l);)l++;throw cn(e,s,l-s)}}else if(h===37)if(u&&e.charCodeAt(d)===37)for(f=38;d<o&&e.charCodeAt(d)!==10&&e.charCodeAt(d)!==13;)d++;else f=31;else if(h===45)if(e.charCodeAt(d)!==45)f=29;else{for(;e.charCodeAt(d)===45;)d++;let l=e.charCodeAt(d),A=d-s===2;A&&l===124&&e.charCodeAt(d+1)===62?(f=46,d+=2):l===62?(f=53,d++):A&&(l===111||l===120)?(f=l===111?55:57,d++):f=59}else if(h===46){let l=e.charCodeAt(d);if(l===46&&e.charCodeAt(d+1)===62)f=47,d+=2;else if(wt(l)){for(f=22;wt(e.charCodeAt(d));)d++;for(;yt$1(e.charCodeAt(d));)d++}else f=30}else if(h===60)if(e.charCodeAt(d)===60){if(n.push(48),a.push(s),r.push(s+2),u=!1,s+=2,s>=o)break;if(e.charCodeAt(s)===62&&e.charCodeAt(s+1)===62)f=49,d=s+2;else{let l=s,A=!1;for(;l<o;l++){let L=e.charCodeAt(l);if(L===10||L===13)break;if(L===62&&e.charCodeAt(l+1)===62){A=!0;break}}if(A&&e.slice(s,l).trim()!=="")n.push(50),a.push(s),r.push(l),f=49,s=l,d=l+2;else{for(;l<o&&e.charCodeAt(l)!==10&&e.charCodeAt(l)!==13;)l++;if(l===s){for(;l<o&&(e.charCodeAt(l)===10||e.charCodeAt(l)===13);)l++;throw cn(e,s,l-s)}f=51,d=l}}}else if(e.charCodeAt(d)===45&&e.charCodeAt(d+1)===45)for(f=54,d+=2;e.charCodeAt(d)===45;)d++;else f=33;else if(h===58)e.charCodeAt(d)===58&&e.charCodeAt(d+1)===58?(f=52,d+=2):f=25;else if(h===64)e.charCodeAt(d)===123?(f=60,d++):f=23;else if(h===123)f=61;else if(h===125)f=62;else if(h===91)f=63;else if(h===93)f=64;else if(h===40)f=65;else if(h===41)f=66;else if(h===44)f=24;else if(h===35){for(;kt(e.charCodeAt(d));)d++;f=d>s+1?26:32}else if(h===92)e.charCodeAt(d)===44?(f=28,d++):f=33;else if(h<127&&h>32)f=(oe[h]&pn)!==0?32:33;else for(f=34;d<o;){let l=e.charCodeAt(d);if(l>=32&&l<127||l===9||l===10||l===13)break;d++}n.push(f),a.push(s),r.push(d),s=d,u=C}for(let h=0;h<3;h++)n.push(0),a.push(o),r.push(o);return{types:n,starts:a,ends:r}}function fn(){return{type:"usecase",actors:new Map,useCases:new Map,systemBoundaries:new Map,relationships:[],notes:new Map,jsonNodes:new Map,classDefs:new Map,direction:"LR",title:void 0,accTitle:"",accDescr:"",accDescription:"",source:"",headerSpan:[0,0],statements:[]}}function hn(){return{elements:[],boundaries:[],jsons:[],relationships:[],notes:[],metadata:[],classes:[],styles:[],classDefs:[],direction:void 0,accTitle:"",accDescription:""}}function pt(e,n){if(n.length===0)return;let a=new Set(e);for(let r of n)a.has(r)||(a.add(r),e.push(r))}function os(e){let n=new Set(["actor","usecase","boundary","edge"]);for(let{key:a,value:r}of e)if(a==="icon")n.clear(),n.add("actor");else if(a==="animate"||a==="animation")n.clear(),n.add("edge");else if(a==="type")n.clear(),r==="rect"||r==="package"?n.add("boundary"):(r==="normal"||r==="hollow"||r==="awesome")&&n.add("actor");else if(a==="business")n.delete("boundary"),n.delete("edge");else return;return n.size===1?[...n][0]:void 0}function yn(e,n,a,r,o){let s=fn(),{actors:u,useCases:y,systemBoundaries:h}=s,f=new Map,d=new Map,C=new Map,l=new Map,A=new Map,L=t=>je(e,t[0],t[1]),I=(t,i)=>{let[p,S2]=ce(e,i[0]);return new R(t,"semantic",{type:"usecase",line:p,column:S2})},w=(t,i)=>{throw I(`${t} at ${L(i)}`,i)},T=(t,i,p,S2,R2)=>{let O=g2=>g2===void 0?"":` (label "${g2}")`;throw I(`${t} at ${L(i)}${O(S2)}; previous declaration at ${L(p)}${O(R2)}`,i)},k=(t,i,p)=>w(`Metadata property '${p.key}' is invalid for ${i} '${t}'`,p.keySpan),X=(t,i)=>{let p=A.get(t);(p===void 0||i<p)&&A.set(t,i)},ne=t=>[...t].sort((i,p)=>(A.get(i.id)??0)-(A.get(p.id)??0)),fe=(t,i)=>{f.set(t.id,{kind:i,span:t.span,generated:t.generated,label:t.label.text})},Ae=(t,i)=>{let p=f.get(t.id);if(!p)return;let S2=t.generated?t.label.text:void 0,R2=p.generated?p.label:void 0;p.kind!==i&&T(`ID '${t.id}' is declared as both ${p.kind} and ${i}`,t.span,p.span,S2,R2),(p.generated||t.generated)&&T(`Generated ID '${t.id}' collides with another declaration`,t.span,p.span,S2,R2)},xe=(t,i,p)=>{let S2=f.get(t);S2&&T(`ID '${t}' is declared more than once (${S2.kind} and ${i})`,p,S2.span,void 0,S2.generated?S2.label:void 0),f.set(t,{kind:i,span:p,generated:!1})},st2=(t,i,p)=>{let{key:S2,value:R2}=i,O=g2=>{!p&&g2!==void 0&&g2!==R2&&T(`Actor '${t.id}' has conflicting ${S2} metadata`,i.keySpan,t.span)};S2==="type"&&(R2==="normal"||R2==="hollow"||R2==="awesome")?(O(t.actorType),t.actorType=R2):S2==="icon"&&typeof R2=="string"?(O(t.icon),t.icon=R2):S2==="business"&&typeof R2=="boolean"?(O(t.business),t.business=R2):k(t.id,"actor",i)},ie=(t,i,p)=>{for(let S2 of i??[])t.kind==="actor"?st2(t,S2,p):S2.key==="business"&&typeof S2.value=="boolean"?(!p&&t.business!==void 0&&t.business!==S2.value&&T(`Use case '${t.id}' has conflicting business metadata`,S2.keySpan,t.span),t.business=S2.value):k(t.id,"usecase",S2)},he=t=>{let i;if(t.kind==="actor"){y.delete(t.id);let p={id:t.id,label:t.label.text,labelType:t.label.type,business:t.business??!1,classes:[...t.classes],type:t.icon?"icon":t.actorType??"normal",styles:u.get(t.id)?.styles??[]};t.icon&&(p.icon=t.icon),u.set(t.id,p),i=p}else u.delete(t.id),i={id:t.id,label:t.label.text,labelType:t.label.type,business:t.business??!1,classes:[...t.classes],shape:t.shape??"ellipse",styles:y.get(t.id)?.styles??[]},y.set(t.id,i);t.stereotype&&(i.stereotype=t.stereotype),t.parent?.id&&(i.parentId=t.parent.id)},ke=t=>{Ae(t,t.kind);let i=t.parent?.id?t.parent:void 0,p=d.get(t.id);if(!p){let S2={kind:t.kind,id:t.id,label:t.label,span:t.span,generated:t.generated,classes:[...t.classes],parent:i,shape:t.shape,stereotype:t.stereotype,stereotypeSpan:t.stereotype?t.span:void 0};ie(S2,t.metadata,!1),d.set(t.id,S2),fe(t,t.kind);return}(p.label.text!==t.label.text||p.label.type!==t.label.type)&&T(`ID '${t.id}' has conflicting labels`,t.span,p.span),t.shape&&p.shape&&t.shape!==p.shape&&T(`Use case '${t.id}' has conflicting shapes`,t.span,p.span),i&&p.parent?.id&&i.id!==p.parent.id&&T(`Element '${t.id}' belongs to more than one system boundary`,i.span,p.parent.span),t.stereotype&&p.stereotype&&t.stereotype!==p.stereotype&&T(`Element '${t.id}' has conflicting stereotypes`,t.span,p.stereotypeSpan??p.span),p.shape??=t.shape,p.parent??=t.parent,p.stereotype??=t.stereotype,p.stereotypeSpan??=t.stereotype?t.span:void 0,pt(p.classes,t.classes),ie(p,t.metadata,!1)},be=t=>{Ae(t,"boundary");let i=C.get(t.id);if(i){(i.label.text!==t.label.text||i.label.type!==t.label.type)&&T(`Boundary '${t.id}' has conflicting titles`,t.span,i.span),pt(i.classes,t.classes);return}C.set(t.id,{...t,classes:[...t.classes],members:[]}),fe(t,"boundary")},me=t=>{t.classed&&!t.declares&&w(`Relationship endpoint '${t.id}' uses ::: without declaring the node`,t.span);let i=f.get(t.id);return i?i.kind:(d.set(t.id,{...t,kind:"usecase",shape:"ellipse",classes:[]}),fe(t,"usecase"),X(t.id,t.span[0]),"usecase")},Re=(t,i)=>{let p=f.get(t)?.kind;return(p==="actor"?u.get(t):p==="usecase"?y.get(t):p==="boundary"?h.get(t):p==="json"?s.jsonNodes.get(t):l.get(t))??w(`Class/style target '${t}' is unresolved or anonymous`,i)},se=[];for(let{source:t,target:i}of n.relationships)X(t.id,t.span[0]),X(i.id,i.span[0]);for(let t of n.elements)X(t.id,t.span[0]),se.push({offset:t.span[0],run:()=>ke(t)});for(let t of n.boundaries)X(t.id,t.span[0]),se.push({offset:t.span[0],run:()=>be(t)});for(let t of n.jsons)X(t.id,t.span[0]),se.push({offset:t.span[0],run:()=>xe(t.id,"json",t.span)});for(let{id:t,idSpan:i}of n.relationships)t&&i&&se.push({offset:i[0],run:()=>xe(t,"edge",i)});se.sort((t,i)=>t.offset-i.offset);for(let t of se)t.run();for(let t of ne(d.values()))he(t);for(let t of ne(C.values()))h.set(t.id,{id:t.id,label:t.label.text,labelType:t.label.type,type:"rect",members:[],classes:[],styles:[]});for(let t of ne(n.jsons))s.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]});let Ce=0;for(let t of n.relationships){let{source:i,target:p,type:S2}=t,R2=me(i),O=me(p),g2=$=>$==="actor"||$==="usecase"||$==="json";g2(R2)||T(`Relationship source '${i.id}' cannot be ${R2}`,i.span,f.get(i.id).span),g2(O)||T(`Relationship target '${p.id}' cannot be ${O}`,p.span,f.get(p.id).span),(S2==="include"||S2==="extend")&&(R2!=="usecase"||O!=="usecase")&&w(`${S2} relationship requires use-case endpoints`,t.span),S2==="generalization"&&(R2==="json"||R2!==O)&&w("Generalization requires actor-to-actor or use-case-to-use-case endpoints",t.span),S2==="association"&&(R2==="json"||O==="json")&&t.arrowType>2&&w(`JSON relationship '${i.id}' to '${p.id}' permits only point, reversed-point, or markerless solid association`,t.span);let m2=t.id??`edge-${Ce++}`,N={id:m2,explicitId:!!t.id,source:i.id,target:p.id,type:S2,arrowType:t.arrowType,minlen:t.minlen,classes:[],styles:[],animate:!1};t.label&&(N.label=t.label.text,N.labelType=t.label.type),s.relationships.push(N),l.set(m2,N)}let Oe=new Map(u),We=new Map(y);u.clear(),y.clear();for(let t of ne(d.values())){let i=Oe.get(t.id),p=We.get(t.id);i?u.set(t.id,i):p?y.set(t.id,p):he(t)}for(let{target:t,span:i,properties:p,statement:S2}of n.metadata){let R2=f.get(t);if(!R2){let N=os(p);return w(`Metadata target '${t}' is unresolved${N?` (metadata implies ${N})`:""}`,i)}let O=R2.kind;O==="actor"||O==="usecase"?ie(d.get(t),p,!0):O==="edge"&&(S2.kind="edgeMetadata",S2.edges=[{id:t,span:S2.span,idSpan:i,metadata:S2.metadata}],delete S2.nodes);let g2=C.get(t),m2=l.get(t);for(let N of O==="actor"||O==="usecase"?[]:p){let{key:$,value:_}=N;O==="boundary"&&g2&&$==="type"&&(_==="rect"||_==="package")?g2.type=_:O==="edge"&&m2&&$==="animate"&&typeof _=="boolean"?m2.animate=_:O==="edge"&&m2&&$==="animation"&&(_==="fast"||_==="slow")?(m2.animation=_,m2.animate=!0):k(t,O,N)}}for(let t of s.relationships)t.animation&&(t.animate=!0);for(let t of d.values())t.kind==="actor"?(t.icon&&t.actorType&&t.actorType!=="normal"&&w(`Actor '${t.id}' cannot combine icon with type '${t.actorType}'`,t.span),t.business&&(t.icon||t.actorType==="awesome")&&w(`Business actor '${t.id}' must use normal or hollow geometry`,t.span)):t.shape==="rect"&&t.business&&w(`Rectangular use case '${t.id}' cannot be a business use case`,t.span),he(t);for(let t of[...n.elements].sort((i,p)=>i.span[0]-p.span[0])){if(!t.parent?.id)continue;let i=C.get(t.parent.id).members;i.includes(t.id)||i.push(t.id)}for(let t of C.values()){let i=h.get(t.id);i.type=t.type??"rect",i.members=t.members,i.classes=[...t.classes]}let Lt2=0;for(let t of n.notes){let i=f.get(t.target);if(!i)return w(`Note target '${t.target}' is unresolved`,t.span);i.kind!=="actor"&&i.kind!=="usecase"&&T(`Note target '${t.target}' must be an actor or use case, not ${i.kind}`,t.span,i.span);let p=`note-${Lt2++}`;s.notes.set(p,{id:p,target:t.target,label:t.label.text,labelType:t.label.type})}for(let t of n.classDefs)for(let i of t.ids)s.classDefs.set(i,{id:i,styles:[...t.styles]});for(let t of n.classes)for(let i of t.targets)pt(Re(i.id,i.span).classes,t.classes);for(let t of n.styles)Re(t.target,t.span).styles.push(...t.styles);return s.direction=n.direction??s.direction,s.title=o,s.accTitle=n.accTitle,s.accDescription=n.accDescription,s.accDescr=n.accDescription.replace(/\n\s+/g,`
2
2
  `),s.source=e,s.headerSpan=a,s.statements=r,s}var j=class extends Error{constructor(a){super("Invalid JSON token"),this.offset=a}offset};function En(e){let n=new Map,a=[],r=[],o=e.length,s=0,u="",y=0,h=()=>{for(;s<o;){let l=e.charCodeAt(s);if(l!==32&&l!==9&&l!==10&&l!==13)return;s++}},f=l=>{s++;let A="";for(;s<o;){let L=s,I=e[s++];if(I==='"')return A;if(I.charCodeAt(0)<32)throw new j(L);if(I!=="\\"){l&&(A+=I);continue}let w=s,T=e[s++],k;if(T==='"'||T==="\\"||T==="/")k=T;else if(T==="b")k="\b";else if(T==="f")k="\f";else if(T==="n")k=`
3
3
  `;else if(T==="r")k="\r";else if(T==="t")k=" ";else if(T==="u"){let X=e.slice(s,s+4);if(!/^[\dA-Fa-f]{4}$/.test(X))throw new j(s);k=String.fromCharCode(parseInt(X,16)),s+=4}else throw new j(w);l&&(A+=k)}throw new j(s)},d=l=>{for(let A=0;A<l.length;A++)if(e[s+A]!==l[A])throw new j(s+A);s+=l.length},C=()=>{if(e.charCodeAt(s)===45&&s++,e.charCodeAt(s)===48)s++;else if(wt(e.charCodeAt(s)))for(;wt(e.charCodeAt(s));)s++;else throw new j(s);if(e.charCodeAt(s)===46){if(s++,!wt(e.charCodeAt(s)))throw new j(s);for(;wt(e.charCodeAt(s));)s++}if((e.charCodeAt(s)|32)===101){if(s++,(e.charCodeAt(s)===43||e.charCodeAt(s)===45)&&s++,!wt(e.charCodeAt(s)))throw new j(s);for(;wt(e.charCodeAt(s));)s++}};for(h();;)if(y===0){h();let l=e.charCodeAt(s);if(y=2,l===123){s++;let A=[];n.set(u,A),a.push(u),h(),e.charCodeAt(s)===125?s++:(r.push({object:!0,pointer:u,keys:A,ranges:new Map,key:"",from:0,index:0}),y=1)}else if(l===91)s++,h(),e.charCodeAt(s)===93?s++:(r.push({object:!1,pointer:u,keys:[],ranges:new Map,key:"",from:0,index:0}),u+="/0",y=0);else if(l===34)f(!1);else if(l===116)d("true");else if(l===102)d("false");else if(l===110)d("null");else if(l===45||wt(l))C();else throw new j(s)}else if(y===1){let l=r[r.length-1];if(e.charCodeAt(s)!==34)throw new j(s);let A=f(!0),L=l.ranges.get(A);if(L===void 0)l.keys.push(A);else for(let I=L[0];I<L[1];I++)n.delete(a[I]);if(l.key=A,l.from=a.length,h(),e.charCodeAt(s)!==58)throw new j(s);s++,u=`${l.pointer}/${A.replaceAll("~","~0").replaceAll("/","~1")}`,y=0}else{let l=r[r.length-1];if(l===void 0)break;l.object?l.ranges.set(l.key,[l.from,a.length]):l.index++,h();let A=e.charCodeAt(s);if(A===(l.object?125:93))s++,r.pop();else{if(A!==44)throw new j(s);s++,h(),u=`${l.pointer}/${l.index}`,y=l.object?1:0}}if(h(),s!==o)throw new j(s);return n}function dt(e,n,a,r){let o=Math.min(Math.max(n,0),e.length);for(let s=0;s<o;s++){let u=e.charCodeAt(s);u===13?(a++,r=1):u===10?(s===0||e.charCodeAt(s-1)!==13)&&(a++,r=1):r++}return[a,r]}function rs(e,n,a,r){let o=/\bposition (\d+)\b/.exec(e);if(o)return dt(n,parseInt(o[1],10),a,r);let s=/\bline (\d+) column (\d+)\b/.exec(e);if(s){let u=parseInt(s[1],10),y=parseInt(s[2],10);return[a+u-1,u===1?r+y-1:y]}if(/unexpected end|end of json input/i.test(e))return dt(n,n.length,a,r)}function Sn(e,n,a){return new R(`${e} (line ${n}, column ${a})`,"syntax",{type:"usecase",line:n,column:a})}function gn(e,n){let a;try{a=JSON.parse(e)}catch(r){let o=r instanceof Error?r.message:String(r),s=st(e);if(s!==e)try{JSON.parse(s)}catch(f){f instanceof Error&&(o=f.message)}let[u,y]=n(),h=rs(o,s,u,y);if(!h){let f=0;try{En(s)}catch(d){d instanceof j&&(f=d.offset)}h=dt(s,f,u,y)}throw Sn(`Invalid JSON: ${o}`,h[0],h[1])}if(typeof a!="object"||a===null||Array.isArray(a)){let[r,o]=n();throw Sn("JSON value must have an object root",r,o)}return{value:a,propertyOrder:En(e)}}var Nn=1,Et=2,ht=4,In=8,Ln=16,Dn=32,_n=64,Xe="DEPENDENCY_ARROW|GENERALIZATION|FORWARD_SOLID|BACKWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|BACKWARD_CIRCLE|FORWARD_CROSS|BACKWARD_CROSS",ze="IDENTIFIER|PLAIN_STRING|MARKDOWN_STRING",is="PLAIN_STRING|MARKDOWN_STRING|LABEL_TEXT",wn="ACC_TITLE_LINE|ACC_DESCR_LINE|ACC_DESCR_BLOCK|DIRECTION|ACTOR|SYSTEM_BOUNDARY|NOTE|JSON_DECLARATION_START|CLASS_DEF|CLASS|STYLE",$n="WORD|PLAIN_STRING|NUMBER|HASH_COLOR|CSS_IDENTIFIER|CSS_ESCAPED_COMMA|DASH|DOT|PERCENT|CSS_PUNCTUATION|COLON|LPAREN|RPAREN|LBRACKET|RBRACKET|LBRACE|RBRACE|AT|MARKERLESS_SOLID",te=new Uint8Array(67);function ue(e,n){for(let a of e.split("|"))if(a==="WORD")for(let r=1;r<=21;r++)te[r]|=n;else te[lt.indexOf(a)]|=n}ue(`NEWLINE|COMMENT|${wn}|${ze}`,Nn);ue(`IDENTIFIER|${Xe}`,Et);ue($n,ht);ue(`STEREOTYPE_START|CLASS_SEPARATOR|IDENTIFIER|${Xe}|NEWLINE|EOF`,In);ue(`NEWLINE|COMMENT|ACTOR|${ze}`,Ln);ue("FORWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|FORWARD_CROSS",Dn);ue("NEWLINE|IDENTIFIER|PLAIN_STRING|RBRACE",_n);var ls=new Set(["allowmixing","newpage","package","rectangle","skinparam"]),Y="",b=[],G=[],H=[],c=0,Mn=0,K,He,Ye=[],xn=0,kn=0;function B(e){return Y.slice(G[e],H[e])}function q(e){return[G[e],H[e]]}function qe(e){let[n,a]=ce(Y,G[c]);throw new R(`Error parsing usecase diagram: ${e} at ${je(Y,G[c],H[c])}`,"syntax",{type:"usecase",line:n,column:a})}function Wn(e){qe(`Expecting token of type --> ${e} <-- but found --> '${B(c)}' <--`)}function v(e){return b[c]!==e&&Wn(lt[e]),c++}function Q(e){let n=e.split("|").map((a,r)=>` ${r+1}. [${a}]`);qe(`Expecting: one of these possible Token sequences:
4
4
  ${n.join(`
@@ -1,2 +1,2 @@
1
- import{g,d,h,x}from"./7XWI72E6-CFY3Kecs.js";import{s,T}from"./G6GPDDNC-XfFyRa0j.js";import{c}from"./DKTLEL5E-CJTkVtjr.js";import{d as cn,T as Tt}from"./EFYWJBJK-Cbn-VZcb.js";import{Y as Yt$1,K as Kt,N as Nt}from"./BGW36YJW-DhmSG9tb.js";import{R,O as Ot,m,Y as Yt,E as Et,y as ye,i as it,T as Tn,G as Gt}from"./lazy-D3tN-GAO.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";var U=class{type="timeline";title;accTitle;accDescr;direction="LR";sections=[];periods=[];currentSection="";getCommonDb(){return this}setDiagramTitle(o){this.title=o}setAccTitle(o){this.accTitle=o.replace(/^\s+/g,"")}setAccDescription(o){this.accDescr=o.replace(/\n\s+/g,`
1
+ import{g,d,h,x}from"./7XWI72E6-C_GZbyIF.js";import{s,T}from"./G6GPDDNC-Ax6dML4i.js";import{c}from"./DKTLEL5E-CJTkVtjr.js";import{d as cn,T as Tt}from"./EFYWJBJK-CFT5CQUG.js";import{Y as Yt$1,K as Kt,N as Nt}from"./BGW36YJW-BAwgTZ_z.js";import{R,O as Ot,m,Y as Yt,E as Et,y as ye,i as it,T as Tn,G as Gt}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var U=class{type="timeline";title;accTitle;accDescr;direction="LR";sections=[];periods=[];currentSection="";getCommonDb(){return this}setDiagramTitle(o){this.title=o}setAccTitle(o){this.accTitle=o.replace(/^\s+/g,"")}setAccDescription(o){this.accDescr=o.replace(/\n\s+/g,`
2
2
  `)}setDirection(o){this.direction=o}addSection(o){this.currentSection=o,this.sections.push(o)}addTask(o,c2,d2){this.periods.push({text:o,events:d2?[d2]:[],section:this.currentSection,sectionIndex:this.sections.length-1})}addEvent(o){let c2=this.periods[this.periods.length-1];if(!c2)throw new R("An event needs a time period before it.","semantic",{type:"timeline"});c2.events.push(o)}},qe=["$end","EOF","INVALID","NEWLINE","timeline","timeline_lr","timeline_td","title","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","section","period","event"];function Je(n){let o=n.length,c2=[],d$1=[],u=[],v={types:c2,texts:d$1,starts:u},i=0,r=(b,t)=>{c2.push(b),d$1.push(n.slice(i,t)),u.push(i),i=t};for(;i=g(n,i),!(i>=o);){let b=n.charCodeAt(i),t=i+1;if(b===10){for(;n.charCodeAt(t)===10;)t++;r(3,t);continue}if(d(n,i,"timeline")){for(t=i+8;n.charCodeAt(t)===32||n.charCodeAt(t)===9;)t++;let g2=d(n,t,"lr");if(t>i+8&&(g2||d(n,t,"td"))&&!Et(n.charCodeAt(t+2))){r(g2?5:6,t+2);continue}if(!Et(n.charCodeAt(i+8))){r(4,i+8);continue}}if(d(n,i,"title")){for(t=i+5;n.charCodeAt(t)!==10&&ye(n.charCodeAt(t));)t++;if(t===o||n.charCodeAt(t)===10){i=t;continue}let g2=n.charCodeAt(i+5);if(g2!==13&&ye(g2)){r(7,h(n,i+6));continue}}if(t=x(n,i,v,8),t!==i){i=t;continue}if(d(n,i,"section")&&ye(n.charCodeAt(i+7))){for(t=i+8;t<o&&n.charCodeAt(t)!==58&&n.charCodeAt(t)!==10;)t++;if(t>i+8){r(13,t);continue}}if(b!==58){t=i+1;for(let g2=n.charCodeAt(t);t<o&&g2!==35&&g2!==58&&g2!==10;g2=n.charCodeAt(++t));r(14,t);continue}if(ye(n.charCodeAt(i+1))){for(t=i+2;t<o;t++){let g2=n.charCodeAt(t);if(g2===10||g2===58&&ye(n.charCodeAt(t+1)))break}if(t>i+2){r(15,t);continue}}r(2,i+1)}return(u.length===0||u[u.length-1]<o)&&r(1,o),r(0,o),v}var st="'EOF', 'SPACE', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'section', 'period', 'event'";function Qe(n,o){let{types:c2,texts:d2,starts:u}=Je(n),v=(r,b)=>{let t=c2[r]===0?"1":qe[c2[r]];throw it("timeline",n,u[r],`Expecting ${b}, got '${t}'`)},i=c2[0];i!==4&&i!==5&&i!==6&&v(0,"'timeline', 'timeline_lr', 'timeline_td'"),i!==4&&o.setDirection(i===5?"LR":"TD");for(let r=1;;r++){let b=d2[r];switch(c2[r]){case 3:break;case 7:o.getCommonDb().setDiagramTitle(b.substring(6));break;case 8:o.getCommonDb().setAccTitle(d2[++r].trim());break;case 10:o.getCommonDb().setAccDescription(d2[++r].trim());break;case 12:o.getCommonDb().setAccDescription(b.trim());break;case 13:o.addSection(b.substring(8));break;case 14:o.addTask(b,0,"");break;case 15:o.addEvent(b.substring(2));break;case 1:return;default:v(r,st)}}}var Z=12,Ue=8,rt=152,ct=216,lt=264,L=20,P=20,ee=14,K=8,be=8,te=12,at=' fill="var(--_bg)"',Ze=' fill="none" stroke="var(--_b)"';function _e(n,o,c2,d2,u){return`<rect x="${m(n)}" y="${m(o)}" width="${m(c2)}" height="${m(d2)}"${Nt(u)}/>`}function tt(n,o,c$1){return n.direction==="TD"?et(n,o,c$1,!0):c(c$1,d2=>et(n,o,c$1,d2))}function et(n,o,c2,d2){let u=c2.fontSize??16,v=Math.round(u*.875),i=c2.measurer??Ot(c2.fontFamily,c2.fontFamilyMono),r=c2.padding??8,b=o.timeline?.disableMulticolor!==!0,t=n.periods,g2=n.sections.length>0,T$1=n.sections.map((e,s2)=>({section:s2,periods:[]})),ne={section:-1,periods:[]};t.forEach((e,s2)=>(T$1[e.sectionIndex]??ne).periods.push(s2)),ne.periods.length>0&&T$1.unshift(ne);let ie=d2&&c2.maxWidth!==void 0&&c2.maxWidth>0?c2.maxWidth-2*r:1/0,xe=P+ee*2+4*Z,q=Math.min(rt,Math.max(80,Math.round((ie-xe)*.38))),ve=Math.min(lt,Math.max(110,ie-xe-q)),N=q,oe=()=>d2?ve:N,H=t.map(e=>s(e.text,i,u,N)),E=t.map(e=>e.events.map(s$1=>s(s$1,i,v,oe()))),w=0;for(let e of H)w=Math.max(w,e.width);if(!d2)for(let e of E)for(let s2 of e)w=Math.max(w,s2.width);let Me=w>N;if(d2)for(let e of E)for(let s2 of e)Me||=s2.width>ve;Me&&(N=Math.min(Math.max(Math.ceil(w),q),ie===1/0?ct:q),H=t.map(e=>T(e.text,i,u,N)),E=t.map(e=>e.events.map(s2=>T(s2,i,v,oe()))));let nt=Math.round(u*1.5),D=N+2*Z,se=oe()+2*Z,J=e=>Math.max(e.height,nt)+2*Ue,re=e=>Math.max(e.height,Math.round(v*1.5))+2*Ue,Ee=(e,s2)=>e.section>=0?e.section:g2?void 0:b?s2:0,$e=(e,s2)=>{let m2=Ee(e,s2);return m2===void 0?"var(--_m)":Kt(m2)},Ae=e=>(e===void 0?"":Gt(e))||at,Te=!1;for(let e of E)e.length>0&&(Te=!0);let ce=0;for(let e of T$1)ce+=Math.max(e.periods.length,1);let F=D+L,V=t.length>0,I=d2?D+(Te?P+ee*2+se:V?P+te:0):ce>0?ce*F-L+(V?te+Tt:0):0,X=T(n.title,i,u,Math.max(I,320),1),it2=X.height>0?X.height+16:0,De=Math.max(I,X.width),C=r+(De-I)/2,j=r+it2,Ce=(e,s2)=>T(n.sections[e.section],i,u,s2-2*Z,1),ye2=(e,s2,m2,f,l,h2)=>_e(m2,f,l,h2,` fill="${Kt(e.section)}"`)+Yt(s2,m2+l/2,f+h2/2,' font-weight="var(--_hw)"'+Ae(e.section)),ke=(e,s2,m2,f,l,h2)=>_e(f,l,D,h2,` fill="${m2}"`)+Yt(H[e],f+D/2,l+h2/2,Ae(Ee(s2,e))),Le=(e,s2,m2,f,l)=>'<g class="pele-node pele-event">'+_e(m2,f,se,l,` fill="${s2}" fill-opacity="0.16"`)+Yt(e,m2+se/2,f+l/2,` font-size="${v}"`)+"</g>",Ne=(e,s2,m$1)=>`<circle class="pele-dot" cx="${m(e)}" cy="${m(s2)}" r="4" fill="${m$1}" stroke="var(--_bg)" stroke-width="2"/>`,we=e=>e.section>=0?`<g class="pele-cluster pele-section" data-id="${Tn(n.sections[e.section].trim())}">`:"",Ie=e=>`<g class="pele-node pele-period" data-id="${Tn(t[e].text.trim())}">`,_="",le;if(d2){let e=C+D+P,s2=e+ee,m$1=s2+ee,f=j;for(let l of T$1){if(_+=we(l),l.section>=0){let h2=Ce(l,I),M=J(h2);_+=ye2(l,h2,C,f,I,M),f+=M+be+4}for(let h2 of l.periods){let M=$e(l,h2),A=J(H[h2]),p=E[h2].length>0?re(E[h2][0]):A,x2=f+Math.max(A,p)/2,O=`M${m(C+D)},${m(x2)}H${m(e)}`,S="",y=x2-p/2,$=x2;for(let Q of E[h2]){let k=re(Q);$=y+k/2,O+=`M${m(s2)},${m($)}H${m(m$1)}`,S+=Le(Q,M,m$1,y,k),y+=k+K}S&&(O+=`M${m(e)},${m(x2)}H${m(s2)}V${m($)}`),_+=Ie(h2)+ke(h2,l,M,C,x2-A/2,A)+`<path class="pele-edge" d="${O}"${Ze}/>`+Ne(e,x2,M)+S+"</g>",f=Math.max(x2+A/2,y-K)+L}l.periods.length===0&&(f+=L-be-4),l.section>=0&&(_+="</g>")}if(T$1.length>0&&(f-=L),V){let l=f+te+Tt;_=`<path class="pele-axis" d="M${m(e)},${m(j)}V${m(l-Tt+1)}" fill="none" stroke="var(--_l)"/>`+cn("arrow_point",e,l,0,1,"var(--_l)")+_,f=l}le=f+r}else{let e=0,s2=T$1.map(p=>{if(p.section<0)return;let x2=Ce(p,Math.max(p.periods.length,1)*F-L);return e=Math.max(e,J(x2)),x2}),m$1=0;for(let p of H)m$1=Math.max(m$1,J(p));let f=j+(g2?e+be:0),l=f+m$1+(m$1>0?P:0),h2=l+P,M=V?l+te:j+e,A=0;if(T$1.forEach((p,x2)=>{let O=Math.max(p.periods.length,1),S=C+A*F;_+=we(p);let y=s2[x2];y&&(_+=ye2(p,y,S,j,O*F-L,e)),p.periods.forEach(($,Q)=>{let k=$e(p,$),de=S+Q*F,me=de+D/2,Se=`M${m(me)},${m(f+m$1)}V${m(E[$].length>0?h2:l)}`,We="",W=h2;for(let Re of E[$]){let Ge=re(Re);W>h2&&(Se+=`M${m(me)},${m(W-K)}V${m(W)}`),We+=Le(Re,k,de,W,Ge),W+=Ge+K}M=Math.max(M,W-K),_+=Ie($)+ke($,p,k,de,f,m$1)+`<path class="pele-edge" d="${Se}"${Ze}/>`+Ne(me,l,k)+We+"</g>"}),p.section>=0&&(_+="</g>"),A+=O}),V){let p=C+I;_=`<path class="pele-axis" d="M${m(C)},${m(l)}H${m(p-Tt+1)}" fill="none" stroke="var(--_l)"/>`+cn("arrow_point",p,l,1,0,"var(--_l)")+_}le=M+r}let ae=Math.ceil(De+2*r),Oe=Math.ceil(Math.max(le,r*2)),ot=Yt(X,ae/2,r+X.height/2,' class="pele-title" font-weight="var(--_tw)"')+_;return{svg:Yt$1("timeline",ae,Oe,u,c2,n,ot),width:ae,height:Oe,links:[]}}var wt={type:"timeline",parse(n,o,c2){let d2=new U;return d2.title=c2,Qe(n,d2),d2},render:tt};export{wt as timeline};
@@ -1 +1 @@
1
- import{N as Nt}from"./BGW36YJW-DhmSG9tb.js";import{m as m$1}from"./lazy-D3tN-GAO.js";var o=18,i=12,f=12,p=(n,t,e)=>(e?t:n)-2*f,x=n=>(t,e,s)=>s?0:t-2*n(e)-2*f;function H(n,t,e){let s=Math.min(1,Math.abs(n)/t);return e*(1-Math.sqrt(1-s*s))}var m=(n,t,e,s)=>e&1?H(s,t/2,n/2):H(s,n/2,t/2),y=(n,t,e)=>(e?t:n)*.6,q=(n,t,e,s)=>e&1?0:H(s,n/2,Math.min(12,Math.max(6,n/14))),h=(n,t)=>()=>({w:n,h:t,dy:0});function V(n,t,e){let s=Math.max(1.6*n+40,80),$=(t+10)/(1-(n+8)/s),a=$/2-10-t/2;return{w:s,h:$,dy:e?-a:a}}function M(n,t){return`<path d="${n}"${t}/>`}var w=(n,t,e)=>e&1?t/8:0,g=(n,t)=>({w:Math.max(n+2*o,2*o+12),h:t+2*i,dy:0});function l(n,t){let e="";for(let s=0;s<n.length;s+=2)e+=(s?" ":"")+m$1(n[s])+","+m$1(n[s+1]);return`<polygon points="${e}"${t}/>`}function u(n,t,e,s=""){return`<rect x="${m$1(-n/2)}" y="${m$1(-t/2)}" width="${m$1(n)}" height="${m$1(t)}"${s}${e}/>`}var Z={rect:{size:g,span:p,draw:(n,t,e)=>u(n,t,Nt(e))},rounded:{size:g,span:p,draw:(n,t,e)=>u(n,t,e,` rx="${m$1(Math.min(12,t/2))}"`)},stadium:{inset:(n,t,e,s)=>e&1?H(s,t/2,t/2):0,span:(n,t,e)=>e?t*.6:n-t,size:(n,t)=>{let e=t+2*i;return{w:n+e*.5+2*o-8,h:e,dy:0}},draw:(n,t,e)=>u(n,t,e,` rx="${m$1(t/2)}"`)},"fr-rect":{span:p,size:(n,t)=>({w:n+2*o+16,h:t+2*i,dy:0}),draw:(n,t,e,s)=>{let $=n/2-8;return u(n,t,Nt(e))+`<path d="M${m$1(-$)},${m$1(-t/2)}V${m$1(t/2)}M${m$1($)},${m$1(-t/2)}V${m$1(t/2)}" fill="none"${s}/>`}},cyl:{inset:q,span:(n,t,e)=>e?t-2*f-12:n*.6,size:(n,t)=>{let e=Math.max(n+2*o,56),s=Math.min(12,Math.max(6,e/14));return{w:e,h:t+2*i+2*s,dy:s/2}},draw:(n,t,e,s)=>{let $=n/2,a=Math.min(12,Math.max(6,n/14)),c=-t/2+a,d=t/2-a;return`<path d="M${m$1(-$)},${m$1(c)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1($)},${m$1(c)}V${m$1(d)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1(-$)},${m$1(d)}Z"${e}/><path d="M${m$1(-$)},${m$1(c)}A${m$1($)},${m$1(a)} 0 0 0 ${m$1($)},${m$1(c)}" fill="none"${s}/>`}},circle:{inset:m,span:y,size:(n,t)=>{let e=Math.max(Math.sqrt(n*n+t*t)+16,44);return{w:e,h:e,dy:0}},draw:(n,t,e)=>`<circle r="${m$1(n/2)}"${e}/>`},"dbl-circ":{inset:m,span:y,size:(n,t)=>{let e=Math.max(Math.sqrt(n*n+t*t)+26,54);return{w:e,h:e,dy:0}},draw:(n,t,e,s)=>`<circle r="${m$1(n/2)}"${e}/><circle r="${m$1(n/2-5)}" fill="none"${s}/>`},ellipse:{inset:m,span:y,size:(n,t)=>({w:n*1.3+2*o,h:t*1.2+2*i,dy:0}),draw:(n,t,e)=>`<ellipse rx="${m$1(n/2)}" ry="${m$1(t/2)}"${e}/>`},diam:{inset:(n,t,e,s)=>e&1?Math.abs(s)*n/t:Math.abs(s)*t/n,span:(n,t,e)=>(e?t:n)*.6,size:(n,t)=>{let e=n+16,s=t+8;return{w:e+1.6*s,h:e/1.6+s,dy:0}},draw:(n,t,e)=>l([0,-t/2,n/2,0,0,t/2,-n/2,0],e)},hex:{inset:(n,t,e,s)=>e&1?Math.abs(s)/2:0,span:(n,t,e)=>e?t*.5:n-t/2-f,size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2+s,-t/2,n/2-s,-t/2,n/2,0,n/2-s,t/2,-n/2+s,t/2,-n/2,0],e)}},odd:{inset:(n,t,e)=>e===3?t/4:0,span:x(()=>0),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/4,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2,-t/2,n/2,-t/2,n/2,t/2,-n/2,t/2,-n/2+s,0],e)}},"lean-r":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2+s,-t/2,n/2,-t/2,n/2-s,t/2,-n/2,t/2],e)}},"lean-l":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2,-t/2,n/2-s,-t/2,n/2,t/2,-n/2+s,t/2],e)}},"trap-b":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2+s,-t/2,n/2-s,-t/2,n/2,t/2,-n/2,t/2],e)}},"trap-t":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2,-t/2,n/2,-t/2,n/2-s,t/2,-n/2+s,t/2],e)}},text:{bare:!0,span:p,size:(n,t)=>({w:n+8,h:t+8,dy:0}),draw:(n,t)=>u(n,t,' fill="none" stroke="none"')},"sm-circ":{noLabel:!0,inset:m,span:y,size:h(14,14),draw:(n,t,e)=>`<circle r="${m$1(n/2)}"${e}/>`},"f-circ":{noLabel:!0,inset:m,span:y,size:h(14,14),draw:(n,t,e,s)=>`<circle r="${m$1(n/2)}" fill="var(--_l)"${s}/>`},"fr-circ":{noLabel:!0,inset:m,span:y,size:h(18,18),draw:(n,t,e,s)=>`<circle r="${m$1(n/2)}"${e}/><circle r="${m$1(n/2-4)}" fill="var(--_l)"${s}/>`},fork:{noLabel:!0,span:(n,t,e)=>(e?t:n)-8,size:h(72,8),draw:(n,t,e,s)=>u(n,t,` fill="var(--_l)"${s}`,' rx="2"')},"notch-rect":{size:g,span:p,draw:(n,t,e)=>l([-n/2+10,-t/2,n/2,-t/2,n/2,t/2,-n/2,t/2,-n/2,-t/2+10],e)},"lin-rect":{span:p,size:(n,t)=>({w:n+2*o+8,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2+8)},${m$1(-t/2)}V${m$1(t/2)}" fill="none"${s}/>`},"div-rect":{span:p,size:(n,t)=>({w:n+2*o,h:t+2*i+8,dy:4}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2)},${m$1(-t/2+8)}H${m$1(n/2)}" fill="none"${s}/>`},"win-pane":{span:p,size:(n,t)=>({w:n+2*o+8,h:t+2*i+8,dy:4}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2+8)},${m$1(-t/2)}V${m$1(t/2)}M${m$1(-n/2)},${m$1(-t/2+8)}H${m$1(n/2)}" fill="none"${s}/>`},tri:{inset:(n,t,e)=>e&1?n/4:0,size:(n,t)=>V(n,t,!1),draw:(n,t,e)=>l([0,-t/2,n/2,t/2,-n/2,t/2],e)},"flip-tri":{inset:(n,t,e)=>e&1?n/4:0,size:(n,t)=>V(n,t,!0),draw:(n,t,e)=>l([-n/2,-t/2,n/2,-t/2,0,t/2],e)},"sl-rect":{inset:(n,t,e)=>e===0?5:0,size:(n,t)=>({w:n+2*o,h:t+2*i+10,dy:5}),draw:(n,t,e)=>l([-n/2,-t/2+10,n/2,-t/2,n/2,t/2,-n/2,t/2],e)},"notch-pent":{span:p,size:(n,t)=>({w:n+2*o,h:t+2*i,dy:0}),draw:(n,t,e)=>l([-n/2+10,-t/2,n/2-10,-t/2,n/2,-t/2+10,n/2,t/2,-n/2,t/2,-n/2,-t/2+10],e)},hourglass:{noLabel:!0,inset:(n,t,e)=>e&1?n/2:0,size:h(32,40),draw:(n,t,e)=>l([-n/2,-t/2,n/2,-t/2,-n/2,t/2,n/2,t/2],e)},delay:{size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/4,h:e,dy:0}},draw:(n,t,e)=>{let s=t/2;return`<path d="M${m$1(-n/2)},${m$1(-s)}H${m$1(n/2-s)}A${m$1(s)},${m$1(s)} 0 0 1 ${m$1(n/2-s)},${m$1(s)}H${m$1(-n/2)}Z"${e}/>`}},"h-cyl":{size:(n,t)=>{let e=t+2*i,s=Math.min(12,e/4);return{w:n+2*o+2*s,h:e,dy:0}},draw:(n,t,e,s)=>{let $=t/2,a=Math.min(12,t/4),c=-n/2+a,d=n/2-a;return`<path d="M${m$1(c)},${m$1(-$)}H${m$1(d)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(d)},${m$1($)}H${m$1(c)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(c)},${m$1(-$)}Z"${e}/><path d="M${m$1(d)},${m$1(-$)}A${m$1(a)},${m$1($)} 0 0 0 ${m$1(d)},${m$1($)}" fill="none"${s}/>`}},"cross-circ":{noLabel:!0,inset:m,span:y,size:h(44,44),draw:(n,t,e,s)=>{let $=n/2,a=$*Math.SQRT1_2;return`<circle r="${m$1($)}"${e}/><path d="M${m$1(-a)},${m$1(-a)}L${m$1(a)},${m$1(a)}M${m$1(a)},${m$1(-a)}L${m$1(-a)},${m$1(a)}" fill="none"${s}/>`}},"st-rect":{span:(n,t,e)=>(e?t:n)-2*f-8,size:(n,t)=>({w:n+2*o+8,h:t+2*i+8,dy:4}),draw:(n,t,e)=>{let s=n-8,$=t-8,a="";for(let c=0;c<3;c++){let d=-n/2+(2-c)*4,_=-t/2+c*4;a+=`<rect x="${m$1(d)}" y="${m$1(_)}" width="${m$1(s)}" height="${m$1($)}"${Nt(e)}/>`}return a}},doc:{inset:(n,t,e)=>e===2?10:0,size:(n,t)=>({w:n+2*o,h:t+2*i+10,dy:-5}),draw:(n,t,e)=>A(n,t,e)},flag:{inset:(n,t,e)=>e&1?0:8,size:(n,t)=>({w:n+2*o,h:t+2*i+16,dy:0}),draw:(n,t,e)=>{let s=n/2,$=t/2-8,a=n/4;return`<path d="M${m$1(-s)},${m$1(-$)}q${m$1(a)},-10 ${m$1(2*a)},0t${m$1(2*a)},0V${m$1($)}q${m$1(-a)},10 ${m$1(-2*a)},0t${m$1(-2*a)},0Z"${e}/>`}},datastore:{size:g,span:p,draw:(n,t,e,s)=>u(n,t,e.replace('stroke="var(--_b)"','stroke="none"'))+`<path d="M${m$1(-n/2)},${m$1(-t/2)}H${m$1(n/2)}M${m$1(-n/2)},${m$1(t/2)}H${m$1(n/2)}" fill="none"${s}/>`},folder:{size:(n,t)=>({w:Math.max(n+2*o,64),h:t+2*i+8,dy:4}),draw:(n,t,e)=>{let s=n/2,$=t/2,a=Math.min(n*.4,48);return M(`M${m$1(-s)},${m$1(-$)}H${m$1(-s+a)}L${m$1(-s+a+8)},${m$1(-$+8)}H${m$1(s)}V${m$1($)}H${m$1(-s)}Z`,e)}},bucket:{size:(n,t)=>({w:n+2*o+20,h:t+2*i+10,dy:3}),inset:(n,t,e)=>e&1?t/12:0,draw:(n,t,e,s)=>{let $=n/2,a=t/2,c=5,d=t/6;return M(`M${m$1(-$)},${m$1(-a+c)}A${m$1($)},${m$1(c)} 0 0 1 ${m$1($)},${m$1(-a+c)}L${m$1($-d)},${m$1(a-c)}A${m$1($-d)},${m$1(c)} 0 0 1 ${m$1(-$+d)},${m$1(a-c)}Z`,e)+`<path d="M${m$1(-$)},${m$1(-a+c)}A${m$1($)},${m$1(c)} 0 0 0 ${m$1($)},${m$1(-a+c)}" fill="none"${s}/>`}},console:{span:p,size:(n,t)=>({w:Math.max(n+2*o,72),h:t+2*i+12,dy:6}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2)},${m$1(-t/2+12)}H${m$1(n/2)}M${m$1(-n/2+7)},${m$1(-t/2+4)}l3,2.5l-3,2.5M${m$1(-n/2+13)},${m$1(-t/2+9)}h4" fill="none"${s}/>`},browser:{span:p,size:(n,t)=>({w:Math.max(n+2*o,72),h:t+2*i+12,dy:6}),draw:(n,t,e,s)=>{let $="";for(let a=0;a<3;a++)$+=`<circle cx="${m$1(-n/2+8+a*7)}" cy="${m$1(-t/2+6)}" r="1.5" fill="none"${s}/>`;return u(n,t,Nt(e))+`<path d="M${m$1(-n/2)},${m$1(-t/2+12)}H${m$1(n/2)}" fill="none"${s}/>`+$}},person:{size:(n,t)=>({w:Math.max(n+2*o,56),h:t+2*i+26,dy:13}),draw:(n,t,e)=>{let s=-t/2;return`<rect x="${m$1(-n/2)}" y="${m$1(s+26)}" width="${m$1(n)}" height="${m$1(t-26)}" rx="12"${e}/><circle cy="${m$1(s+14)}" r="13"${e}/>`}},bang:{size:(n,t)=>({w:n+2*o+28,h:t+2*i+24,dy:0}),inset:()=>3,draw:(n,t,e)=>{let $=[];for(let a=0;a<28;a++){let c=Math.PI*a/14-Math.PI/2,d=a%2===0?1:.82;$.push(Math.cos(c)*(n/2)*d,Math.sin(c)*(t/2)*d)}return l($,e)}},cloud:{size:(n,t)=>({w:n+2*o+32,h:t+2*i+24,dy:0}),inset:(n,t,e)=>e&1?2:1,draw:(n,t,e)=>{let s=n/2,$=t/2,a=$*.55;return M(`M${m$1(-s+a)},${m$1($)}A${m$1(a)},${m$1(a)} 0 0 1 ${m$1(-s+a*.6)},${m$1(-$*.1)}A${m$1(s*.42)},${m$1($*.7)} 0 0 1 ${m$1(-s*.1)},${m$1(-$*.72)}A${m$1(s*.4)},${m$1($*.62)} 0 0 1 ${m$1(s*.62)},${m$1(-$*.42)}A${m$1(a*1.05)},${m$1(a*1.05)} 0 0 1 ${m$1(s-a)},${m$1($)}Z`,e)}},brace:{bare:!0,size:(n,t)=>({w:n+2*o+12,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,' fill="none" stroke="none"')+S(-n/2+12,t,-1,s)},"brace-r":{bare:!0,size:(n,t)=>({w:n+2*o+12,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,' fill="none" stroke="none"')+S(n/2-12,t,1,s)},braces:{bare:!0,size:(n,t)=>({w:n+2*o+24,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,' fill="none" stroke="none"')+S(-n/2+12,t,-1,s)+S(n/2-12,t,1,s)},bolt:{noLabel:!0,size:h(36,56),inset:(n,t,e)=>e&1?n/4:0,draw:(n,t,e)=>l([n*.15,-t/2,-n/2,t*.08,-n*.05,t*.08,-n*.15,t/2,n/2,-t*.08,n*.05,-t*.08],e)},"lin-cyl":{inset:q,span:(n,t,e)=>e?t-2*f-20:n*.6,size:(n,t)=>{let e=Math.max(n+2*o,56),s=Math.min(12,Math.max(6,e/14));return{w:e,h:t+2*i+2*s+8,dy:s/2+4}},draw:(n,t,e,s)=>{let $=n/2,a=Math.min(12,Math.max(6,n/14)),c=-t/2+a,d=t/2-a,_=k=>`M${m$1(-$)},${m$1(k)}A${m$1($)},${m$1(a)} 0 0 0 ${m$1($)},${m$1(k)}`;return M(`M${m$1(-$)},${m$1(c)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1($)},${m$1(c)}V${m$1(d)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1(-$)},${m$1(d)}Z`,e)+`<path d="${_(c)}${_(c+8)}" fill="none"${s}/>`}},"curv-trap":{size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e*.6,h:e,dy:0}},draw:(n,t,e)=>{let s=n/2,$=t/2,a=t*.3;return M(`M${m$1(-s+a)},${m$1(-$)}H${m$1(s-a)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(s-a)},${m$1($)}H${m$1(-s+a)}L${m$1(-s)},0Z`,e)}},docs:{size:(n,t)=>({w:n+2*o+8,h:t+2*i+18,dy:-1}),inset:(n,t,e)=>e===2?10:0,draw:(n,t,e)=>{let s="";for(let $=0;$<3;$++)s+=`<g transform="translate(${(1-$)*4},${($-1)*4})">${A(n-8,t-8,e)}</g>`;return s}},"bow-rect":{size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e*.4,h:e,dy:0}},inset:(n,t,e)=>e===1?t*.2:0,draw:(n,t,e)=>{let s=n/2,$=t/2,a=t*.2;return M(`M${m$1(-s+a)},${m$1(-$)}H${m$1(s)}A${m$1(a)},${m$1($)} 0 0 0 ${m$1(s)},${m$1($)}H${m$1(-s+a)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(-s+a)},${m$1(-$)}Z`,e)}},"tag-rect":{size:g,span:p,draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(n/2-12)},${m$1(t/2)}L${m$1(n/2)},${m$1(t/2-12)}" fill="none"${s}/>`},"tag-doc":{size:(n,t)=>({w:n+2*o,h:t+2*i+10,dy:-5}),inset:(n,t,e)=>e===2?10:0,draw:(n,t,e,s)=>A(n,t,e)+`<path d="M${m$1(n/2-12)},${m$1(t/2-14)}L${m$1(n/2)},${m$1(t/2-26)}" fill="none"${s}/>`},"lin-doc":{size:(n,t)=>({w:n+2*o+8,h:t+2*i+10,dy:-5}),inset:(n,t,e)=>e===2?10:0,draw:(n,t,e,s)=>A(n,t,e)+`<path d="M${m$1(-n/2+8)},${m$1(-t/2)}V${m$1(t/2-6)}" fill="none"${s}/>`},collapsedGroup:{size:(n,t)=>({w:n+2*o+8,h:t+2*i+8,dy:-2}),draw:(n,t,e)=>`<rect x="${m$1(-n/2+6)}" y="${m$1(-t/2+8)}" width="${m$1(n-12)}" height="${m$1(t-8)}"${Nt(e)}/><rect x="${m$1(-n/2)}" y="${m$1(-t/2)}" width="${m$1(n)}" height="${m$1(t-4)}"${Nt(e)}/>`}};function S(n,t,e,s){let $=t/2,a=6*e;return`<path d="M${m$1(n)},${m$1(-$)}q${m$1(a)},0 ${m$1(a)},6V-6q0,6 ${m$1(a)},6q${m$1(-a)},0 ${m$1(-a)},6V${m$1($-6)}q0,6 ${m$1(-a)},6" fill="none"${s}/>`}function A(n,t,e){let s=n/2,$=-t/2,a=t/2-10,c=n/4;return`<path d="M${m$1(-s)},${m$1($)}H${m$1(s)}V${m$1(a)}q${m$1(-c)},-12 ${m$1(-2*c)},0t${m$1(-2*c)},0Z"${e}/>`}var L=Z.rect,z=new Map(Object.entries(Z));function P(n,t,e){return(z.get(n)??L).size(t,e)}function R(n,t,e,s,$){return(z.get(n)??L).draw(t,e,s,$)}function I(n,t,e,s,$=0){return z.get(n)?.inset?.(t,e,s,$)??0}function E(n,t,e,s){return Math.max(0,z.get(n)?.span?.(t,e,s)??0)}function j(n){return z.get(n)?.noLabel!==!0}function B(n){return(z.get(n)??L).bare!==!0}function D(n,t,e){let s=n[t]-e.x,$=n[t+1]-e.y;return Math.abs(Math.abs($)-e.h/2)<.5?$<0?0:2:Math.abs(Math.abs(s)-e.w/2)<.5?s<0?3:1:-1}function F(n,t,e,s){if(s.isGroup)return;let $=D(n,t,s);if($===0||$===2){let a=I(e.shape,e.w,e.h,$,n[t]-s.x)+(s.h-e.h)/2;n[t+1]+=$===0?a:-a}else if($>=0){let a=I(e.shape,e.w,e.h,$,n[t+1]-s.y)+(s.w-e.w)/2;n[t]+=$===3?a:-a}}export{B,D,E,F,I,P,R,i,j,o};
1
+ import{N as Nt}from"./BGW36YJW-BAwgTZ_z.js";import{m as m$1}from"./lazy-CUmWiDAP.js";var o=18,i=12,f=12,p=(n,t,e)=>(e?t:n)-2*f,x=n=>(t,e,s)=>s?0:t-2*n(e)-2*f;function H(n,t,e){let s=Math.min(1,Math.abs(n)/t);return e*(1-Math.sqrt(1-s*s))}var m=(n,t,e,s)=>e&1?H(s,t/2,n/2):H(s,n/2,t/2),y=(n,t,e)=>(e?t:n)*.6,q=(n,t,e,s)=>e&1?0:H(s,n/2,Math.min(12,Math.max(6,n/14))),h=(n,t)=>()=>({w:n,h:t,dy:0});function V(n,t,e){let s=Math.max(1.6*n+40,80),$=(t+10)/(1-(n+8)/s),a=$/2-10-t/2;return{w:s,h:$,dy:e?-a:a}}function M(n,t){return`<path d="${n}"${t}/>`}var w=(n,t,e)=>e&1?t/8:0,g=(n,t)=>({w:Math.max(n+2*o,2*o+12),h:t+2*i,dy:0});function l(n,t){let e="";for(let s=0;s<n.length;s+=2)e+=(s?" ":"")+m$1(n[s])+","+m$1(n[s+1]);return`<polygon points="${e}"${t}/>`}function u(n,t,e,s=""){return`<rect x="${m$1(-n/2)}" y="${m$1(-t/2)}" width="${m$1(n)}" height="${m$1(t)}"${s}${e}/>`}var Z={rect:{size:g,span:p,draw:(n,t,e)=>u(n,t,Nt(e))},rounded:{size:g,span:p,draw:(n,t,e)=>u(n,t,e,` rx="${m$1(Math.min(12,t/2))}"`)},stadium:{inset:(n,t,e,s)=>e&1?H(s,t/2,t/2):0,span:(n,t,e)=>e?t*.6:n-t,size:(n,t)=>{let e=t+2*i;return{w:n+e*.5+2*o-8,h:e,dy:0}},draw:(n,t,e)=>u(n,t,e,` rx="${m$1(t/2)}"`)},"fr-rect":{span:p,size:(n,t)=>({w:n+2*o+16,h:t+2*i,dy:0}),draw:(n,t,e,s)=>{let $=n/2-8;return u(n,t,Nt(e))+`<path d="M${m$1(-$)},${m$1(-t/2)}V${m$1(t/2)}M${m$1($)},${m$1(-t/2)}V${m$1(t/2)}" fill="none"${s}/>`}},cyl:{inset:q,span:(n,t,e)=>e?t-2*f-12:n*.6,size:(n,t)=>{let e=Math.max(n+2*o,56),s=Math.min(12,Math.max(6,e/14));return{w:e,h:t+2*i+2*s,dy:s/2}},draw:(n,t,e,s)=>{let $=n/2,a=Math.min(12,Math.max(6,n/14)),c=-t/2+a,d=t/2-a;return`<path d="M${m$1(-$)},${m$1(c)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1($)},${m$1(c)}V${m$1(d)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1(-$)},${m$1(d)}Z"${e}/><path d="M${m$1(-$)},${m$1(c)}A${m$1($)},${m$1(a)} 0 0 0 ${m$1($)},${m$1(c)}" fill="none"${s}/>`}},circle:{inset:m,span:y,size:(n,t)=>{let e=Math.max(Math.sqrt(n*n+t*t)+16,44);return{w:e,h:e,dy:0}},draw:(n,t,e)=>`<circle r="${m$1(n/2)}"${e}/>`},"dbl-circ":{inset:m,span:y,size:(n,t)=>{let e=Math.max(Math.sqrt(n*n+t*t)+26,54);return{w:e,h:e,dy:0}},draw:(n,t,e,s)=>`<circle r="${m$1(n/2)}"${e}/><circle r="${m$1(n/2-5)}" fill="none"${s}/>`},ellipse:{inset:m,span:y,size:(n,t)=>({w:n*1.3+2*o,h:t*1.2+2*i,dy:0}),draw:(n,t,e)=>`<ellipse rx="${m$1(n/2)}" ry="${m$1(t/2)}"${e}/>`},diam:{inset:(n,t,e,s)=>e&1?Math.abs(s)*n/t:Math.abs(s)*t/n,span:(n,t,e)=>(e?t:n)*.6,size:(n,t)=>{let e=n+16,s=t+8;return{w:e+1.6*s,h:e/1.6+s,dy:0}},draw:(n,t,e)=>l([0,-t/2,n/2,0,0,t/2,-n/2,0],e)},hex:{inset:(n,t,e,s)=>e&1?Math.abs(s)/2:0,span:(n,t,e)=>e?t*.5:n-t/2-f,size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2+s,-t/2,n/2-s,-t/2,n/2,0,n/2-s,t/2,-n/2+s,t/2,-n/2,0],e)}},odd:{inset:(n,t,e)=>e===3?t/4:0,span:x(()=>0),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/4,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2,-t/2,n/2,-t/2,n/2,t/2,-n/2,t/2,-n/2+s,0],e)}},"lean-r":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2+s,-t/2,n/2,-t/2,n/2-s,t/2,-n/2,t/2],e)}},"lean-l":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2,-t/2,n/2-s,-t/2,n/2,t/2,-n/2+s,t/2],e)}},"trap-b":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2+s,-t/2,n/2-s,-t/2,n/2,t/2,-n/2,t/2],e)}},"trap-t":{inset:w,span:x(n=>n/4),size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/2,h:e,dy:0}},draw:(n,t,e)=>{let s=t/4;return l([-n/2,-t/2,n/2,-t/2,n/2-s,t/2,-n/2+s,t/2],e)}},text:{bare:!0,span:p,size:(n,t)=>({w:n+8,h:t+8,dy:0}),draw:(n,t)=>u(n,t,' fill="none" stroke="none"')},"sm-circ":{noLabel:!0,inset:m,span:y,size:h(14,14),draw:(n,t,e)=>`<circle r="${m$1(n/2)}"${e}/>`},"f-circ":{noLabel:!0,inset:m,span:y,size:h(14,14),draw:(n,t,e,s)=>`<circle r="${m$1(n/2)}" fill="var(--_l)"${s}/>`},"fr-circ":{noLabel:!0,inset:m,span:y,size:h(18,18),draw:(n,t,e,s)=>`<circle r="${m$1(n/2)}"${e}/><circle r="${m$1(n/2-4)}" fill="var(--_l)"${s}/>`},fork:{noLabel:!0,span:(n,t,e)=>(e?t:n)-8,size:h(72,8),draw:(n,t,e,s)=>u(n,t,` fill="var(--_l)"${s}`,' rx="2"')},"notch-rect":{size:g,span:p,draw:(n,t,e)=>l([-n/2+10,-t/2,n/2,-t/2,n/2,t/2,-n/2,t/2,-n/2,-t/2+10],e)},"lin-rect":{span:p,size:(n,t)=>({w:n+2*o+8,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2+8)},${m$1(-t/2)}V${m$1(t/2)}" fill="none"${s}/>`},"div-rect":{span:p,size:(n,t)=>({w:n+2*o,h:t+2*i+8,dy:4}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2)},${m$1(-t/2+8)}H${m$1(n/2)}" fill="none"${s}/>`},"win-pane":{span:p,size:(n,t)=>({w:n+2*o+8,h:t+2*i+8,dy:4}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2+8)},${m$1(-t/2)}V${m$1(t/2)}M${m$1(-n/2)},${m$1(-t/2+8)}H${m$1(n/2)}" fill="none"${s}/>`},tri:{inset:(n,t,e)=>e&1?n/4:0,size:(n,t)=>V(n,t,!1),draw:(n,t,e)=>l([0,-t/2,n/2,t/2,-n/2,t/2],e)},"flip-tri":{inset:(n,t,e)=>e&1?n/4:0,size:(n,t)=>V(n,t,!0),draw:(n,t,e)=>l([-n/2,-t/2,n/2,-t/2,0,t/2],e)},"sl-rect":{inset:(n,t,e)=>e===0?5:0,size:(n,t)=>({w:n+2*o,h:t+2*i+10,dy:5}),draw:(n,t,e)=>l([-n/2,-t/2+10,n/2,-t/2,n/2,t/2,-n/2,t/2],e)},"notch-pent":{span:p,size:(n,t)=>({w:n+2*o,h:t+2*i,dy:0}),draw:(n,t,e)=>l([-n/2+10,-t/2,n/2-10,-t/2,n/2,-t/2+10,n/2,t/2,-n/2,t/2,-n/2,-t/2+10],e)},hourglass:{noLabel:!0,inset:(n,t,e)=>e&1?n/2:0,size:h(32,40),draw:(n,t,e)=>l([-n/2,-t/2,n/2,-t/2,-n/2,t/2,n/2,t/2],e)},delay:{size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e/4,h:e,dy:0}},draw:(n,t,e)=>{let s=t/2;return`<path d="M${m$1(-n/2)},${m$1(-s)}H${m$1(n/2-s)}A${m$1(s)},${m$1(s)} 0 0 1 ${m$1(n/2-s)},${m$1(s)}H${m$1(-n/2)}Z"${e}/>`}},"h-cyl":{size:(n,t)=>{let e=t+2*i,s=Math.min(12,e/4);return{w:n+2*o+2*s,h:e,dy:0}},draw:(n,t,e,s)=>{let $=t/2,a=Math.min(12,t/4),c=-n/2+a,d=n/2-a;return`<path d="M${m$1(c)},${m$1(-$)}H${m$1(d)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(d)},${m$1($)}H${m$1(c)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(c)},${m$1(-$)}Z"${e}/><path d="M${m$1(d)},${m$1(-$)}A${m$1(a)},${m$1($)} 0 0 0 ${m$1(d)},${m$1($)}" fill="none"${s}/>`}},"cross-circ":{noLabel:!0,inset:m,span:y,size:h(44,44),draw:(n,t,e,s)=>{let $=n/2,a=$*Math.SQRT1_2;return`<circle r="${m$1($)}"${e}/><path d="M${m$1(-a)},${m$1(-a)}L${m$1(a)},${m$1(a)}M${m$1(a)},${m$1(-a)}L${m$1(-a)},${m$1(a)}" fill="none"${s}/>`}},"st-rect":{span:(n,t,e)=>(e?t:n)-2*f-8,size:(n,t)=>({w:n+2*o+8,h:t+2*i+8,dy:4}),draw:(n,t,e)=>{let s=n-8,$=t-8,a="";for(let c=0;c<3;c++){let d=-n/2+(2-c)*4,_=-t/2+c*4;a+=`<rect x="${m$1(d)}" y="${m$1(_)}" width="${m$1(s)}" height="${m$1($)}"${Nt(e)}/>`}return a}},doc:{inset:(n,t,e)=>e===2?10:0,size:(n,t)=>({w:n+2*o,h:t+2*i+10,dy:-5}),draw:(n,t,e)=>A(n,t,e)},flag:{inset:(n,t,e)=>e&1?0:8,size:(n,t)=>({w:n+2*o,h:t+2*i+16,dy:0}),draw:(n,t,e)=>{let s=n/2,$=t/2-8,a=n/4;return`<path d="M${m$1(-s)},${m$1(-$)}q${m$1(a)},-10 ${m$1(2*a)},0t${m$1(2*a)},0V${m$1($)}q${m$1(-a)},10 ${m$1(-2*a)},0t${m$1(-2*a)},0Z"${e}/>`}},datastore:{size:g,span:p,draw:(n,t,e,s)=>u(n,t,e.replace('stroke="var(--_b)"','stroke="none"'))+`<path d="M${m$1(-n/2)},${m$1(-t/2)}H${m$1(n/2)}M${m$1(-n/2)},${m$1(t/2)}H${m$1(n/2)}" fill="none"${s}/>`},folder:{size:(n,t)=>({w:Math.max(n+2*o,64),h:t+2*i+8,dy:4}),draw:(n,t,e)=>{let s=n/2,$=t/2,a=Math.min(n*.4,48);return M(`M${m$1(-s)},${m$1(-$)}H${m$1(-s+a)}L${m$1(-s+a+8)},${m$1(-$+8)}H${m$1(s)}V${m$1($)}H${m$1(-s)}Z`,e)}},bucket:{size:(n,t)=>({w:n+2*o+20,h:t+2*i+10,dy:3}),inset:(n,t,e)=>e&1?t/12:0,draw:(n,t,e,s)=>{let $=n/2,a=t/2,c=5,d=t/6;return M(`M${m$1(-$)},${m$1(-a+c)}A${m$1($)},${m$1(c)} 0 0 1 ${m$1($)},${m$1(-a+c)}L${m$1($-d)},${m$1(a-c)}A${m$1($-d)},${m$1(c)} 0 0 1 ${m$1(-$+d)},${m$1(a-c)}Z`,e)+`<path d="M${m$1(-$)},${m$1(-a+c)}A${m$1($)},${m$1(c)} 0 0 0 ${m$1($)},${m$1(-a+c)}" fill="none"${s}/>`}},console:{span:p,size:(n,t)=>({w:Math.max(n+2*o,72),h:t+2*i+12,dy:6}),draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(-n/2)},${m$1(-t/2+12)}H${m$1(n/2)}M${m$1(-n/2+7)},${m$1(-t/2+4)}l3,2.5l-3,2.5M${m$1(-n/2+13)},${m$1(-t/2+9)}h4" fill="none"${s}/>`},browser:{span:p,size:(n,t)=>({w:Math.max(n+2*o,72),h:t+2*i+12,dy:6}),draw:(n,t,e,s)=>{let $="";for(let a=0;a<3;a++)$+=`<circle cx="${m$1(-n/2+8+a*7)}" cy="${m$1(-t/2+6)}" r="1.5" fill="none"${s}/>`;return u(n,t,Nt(e))+`<path d="M${m$1(-n/2)},${m$1(-t/2+12)}H${m$1(n/2)}" fill="none"${s}/>`+$}},person:{size:(n,t)=>({w:Math.max(n+2*o,56),h:t+2*i+26,dy:13}),draw:(n,t,e)=>{let s=-t/2;return`<rect x="${m$1(-n/2)}" y="${m$1(s+26)}" width="${m$1(n)}" height="${m$1(t-26)}" rx="12"${e}/><circle cy="${m$1(s+14)}" r="13"${e}/>`}},bang:{size:(n,t)=>({w:n+2*o+28,h:t+2*i+24,dy:0}),inset:()=>3,draw:(n,t,e)=>{let $=[];for(let a=0;a<28;a++){let c=Math.PI*a/14-Math.PI/2,d=a%2===0?1:.82;$.push(Math.cos(c)*(n/2)*d,Math.sin(c)*(t/2)*d)}return l($,e)}},cloud:{size:(n,t)=>({w:n+2*o+32,h:t+2*i+24,dy:0}),inset:(n,t,e)=>e&1?2:1,draw:(n,t,e)=>{let s=n/2,$=t/2,a=$*.55;return M(`M${m$1(-s+a)},${m$1($)}A${m$1(a)},${m$1(a)} 0 0 1 ${m$1(-s+a*.6)},${m$1(-$*.1)}A${m$1(s*.42)},${m$1($*.7)} 0 0 1 ${m$1(-s*.1)},${m$1(-$*.72)}A${m$1(s*.4)},${m$1($*.62)} 0 0 1 ${m$1(s*.62)},${m$1(-$*.42)}A${m$1(a*1.05)},${m$1(a*1.05)} 0 0 1 ${m$1(s-a)},${m$1($)}Z`,e)}},brace:{bare:!0,size:(n,t)=>({w:n+2*o+12,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,' fill="none" stroke="none"')+S(-n/2+12,t,-1,s)},"brace-r":{bare:!0,size:(n,t)=>({w:n+2*o+12,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,' fill="none" stroke="none"')+S(n/2-12,t,1,s)},braces:{bare:!0,size:(n,t)=>({w:n+2*o+24,h:t+2*i,dy:0}),draw:(n,t,e,s)=>u(n,t,' fill="none" stroke="none"')+S(-n/2+12,t,-1,s)+S(n/2-12,t,1,s)},bolt:{noLabel:!0,size:h(36,56),inset:(n,t,e)=>e&1?n/4:0,draw:(n,t,e)=>l([n*.15,-t/2,-n/2,t*.08,-n*.05,t*.08,-n*.15,t/2,n/2,-t*.08,n*.05,-t*.08],e)},"lin-cyl":{inset:q,span:(n,t,e)=>e?t-2*f-20:n*.6,size:(n,t)=>{let e=Math.max(n+2*o,56),s=Math.min(12,Math.max(6,e/14));return{w:e,h:t+2*i+2*s+8,dy:s/2+4}},draw:(n,t,e,s)=>{let $=n/2,a=Math.min(12,Math.max(6,n/14)),c=-t/2+a,d=t/2-a,_=k=>`M${m$1(-$)},${m$1(k)}A${m$1($)},${m$1(a)} 0 0 0 ${m$1($)},${m$1(k)}`;return M(`M${m$1(-$)},${m$1(c)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1($)},${m$1(c)}V${m$1(d)}A${m$1($)},${m$1(a)} 0 0 1 ${m$1(-$)},${m$1(d)}Z`,e)+`<path d="${_(c)}${_(c+8)}" fill="none"${s}/>`}},"curv-trap":{size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e*.6,h:e,dy:0}},draw:(n,t,e)=>{let s=n/2,$=t/2,a=t*.3;return M(`M${m$1(-s+a)},${m$1(-$)}H${m$1(s-a)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(s-a)},${m$1($)}H${m$1(-s+a)}L${m$1(-s)},0Z`,e)}},docs:{size:(n,t)=>({w:n+2*o+8,h:t+2*i+18,dy:-1}),inset:(n,t,e)=>e===2?10:0,draw:(n,t,e)=>{let s="";for(let $=0;$<3;$++)s+=`<g transform="translate(${(1-$)*4},${($-1)*4})">${A(n-8,t-8,e)}</g>`;return s}},"bow-rect":{size:(n,t)=>{let e=t+2*i;return{w:n+2*o+e*.4,h:e,dy:0}},inset:(n,t,e)=>e===1?t*.2:0,draw:(n,t,e)=>{let s=n/2,$=t/2,a=t*.2;return M(`M${m$1(-s+a)},${m$1(-$)}H${m$1(s)}A${m$1(a)},${m$1($)} 0 0 0 ${m$1(s)},${m$1($)}H${m$1(-s+a)}A${m$1(a)},${m$1($)} 0 0 1 ${m$1(-s+a)},${m$1(-$)}Z`,e)}},"tag-rect":{size:g,span:p,draw:(n,t,e,s)=>u(n,t,Nt(e))+`<path d="M${m$1(n/2-12)},${m$1(t/2)}L${m$1(n/2)},${m$1(t/2-12)}" fill="none"${s}/>`},"tag-doc":{size:(n,t)=>({w:n+2*o,h:t+2*i+10,dy:-5}),inset:(n,t,e)=>e===2?10:0,draw:(n,t,e,s)=>A(n,t,e)+`<path d="M${m$1(n/2-12)},${m$1(t/2-14)}L${m$1(n/2)},${m$1(t/2-26)}" fill="none"${s}/>`},"lin-doc":{size:(n,t)=>({w:n+2*o+8,h:t+2*i+10,dy:-5}),inset:(n,t,e)=>e===2?10:0,draw:(n,t,e,s)=>A(n,t,e)+`<path d="M${m$1(-n/2+8)},${m$1(-t/2)}V${m$1(t/2-6)}" fill="none"${s}/>`},collapsedGroup:{size:(n,t)=>({w:n+2*o+8,h:t+2*i+8,dy:-2}),draw:(n,t,e)=>`<rect x="${m$1(-n/2+6)}" y="${m$1(-t/2+8)}" width="${m$1(n-12)}" height="${m$1(t-8)}"${Nt(e)}/><rect x="${m$1(-n/2)}" y="${m$1(-t/2)}" width="${m$1(n)}" height="${m$1(t-4)}"${Nt(e)}/>`}};function S(n,t,e,s){let $=t/2,a=6*e;return`<path d="M${m$1(n)},${m$1(-$)}q${m$1(a)},0 ${m$1(a)},6V-6q0,6 ${m$1(a)},6q${m$1(-a)},0 ${m$1(-a)},6V${m$1($-6)}q0,6 ${m$1(-a)},6" fill="none"${s}/>`}function A(n,t,e){let s=n/2,$=-t/2,a=t/2-10,c=n/4;return`<path d="M${m$1(-s)},${m$1($)}H${m$1(s)}V${m$1(a)}q${m$1(-c)},-12 ${m$1(-2*c)},0t${m$1(-2*c)},0Z"${e}/>`}var L=Z.rect,z=new Map(Object.entries(Z));function P(n,t,e){return(z.get(n)??L).size(t,e)}function R(n,t,e,s,$){return(z.get(n)??L).draw(t,e,s,$)}function I(n,t,e,s,$=0){return z.get(n)?.inset?.(t,e,s,$)??0}function E(n,t,e,s){return Math.max(0,z.get(n)?.span?.(t,e,s)??0)}function j(n){return z.get(n)?.noLabel!==!0}function B(n){return(z.get(n)??L).bare!==!0}function D(n,t,e){let s=n[t]-e.x,$=n[t+1]-e.y;return Math.abs(Math.abs($)-e.h/2)<.5?$<0?0:2:Math.abs(Math.abs(s)-e.w/2)<.5?s<0?3:1:-1}function F(n,t,e,s){if(s.isGroup)return;let $=D(n,t,s);if($===0||$===2){let a=I(e.shape,e.w,e.h,$,n[t]-s.x)+(s.h-e.h)/2;n[t+1]+=$===0?a:-a}else if($>=0){let a=I(e.shape,e.w,e.h,$,n[t+1]-s.y)+(s.w-e.w)/2;n[t]+=$===3?a:-a}}export{B,D,E,F,I,P,R,i,j,o};
@@ -1,2 +1,2 @@
1
- import{p as pt}from"./BGW36YJW-DhmSG9tb.js";import{h as Yn,j as jn,Y as Yt,L as Le,S,m}from"./lazy-D3tN-GAO.js";var b=/\s/;function A(e,a,d,g,l=0){let r=[];for(let h of e.split(`
1
+ import{p as pt}from"./BGW36YJW-BAwgTZ_z.js";import{h as Yn,j as jn,Y as Yt,L as Le,S,m}from"./lazy-CUmWiDAP.js";var b=/\s/;function A(e,a,d,g,l=0){let r=[];for(let h of e.split(`
2
2
  `)){let n=Array.from(h);n.length===0&&r.push("");let t=0;for(;t<n.length;){let f=u=>a.width(n.slice(t,t+u).join(""),d,l)<=g,i=1;for(;i<n.length-t&&f(i);)i=Math.min(n.length-t,i*2);let m2=1;for(;m2<i;){let u=Math.ceil((m2+i)/2);f(u)?m2=u:i=u-1}let p=m2,w=t+p<n.length;if(w&&!b.test(n[t+p])){for(let u=p-1;u>0;u--)if(b.test(n[t+u])){p=u+1;break}}let x=n.slice(t,t+p).join("");for(r.push(w&&x.trimEnd()||x),t+=p;w&&t<n.length&&b.test(n[t]);)t++}}e===""&&(r.length=0);let c=r.map(h=>a.width(h,d,l)),s=0;for(let h of c)s=Math.max(s,h);let o=Math.round(d*1.5);return{lines:r.map((h,n)=>[{text:h,style:l,width:c[n]}]),widths:c,width:s,height:r.length*o,size:d,lineHeight:o}}function T(e,a,d){if(e.width<=d)return e;let g=[],l=[];for(let s=0;s<e.lines.length;s++){if(e.widths[s]<=d){g.push(e.lines[s]),l.push(e.widths[s]);continue}let o=[],h=0,n=()=>{g.push(o),l.push(h),o=[],h=0};for(let t of e.lines[s]){if(t.icon!==void 0||t.math){o.length&&h+t.width>d&&n(),o.push(t),h+=t.width;continue}for(let f of Array.from(t.text)){let i=o[o.length-1],m2=i&&i.icon===void 0&&i.math===void 0&&i.style===t.style,w=a.width(m2?i.text+f:f,e.size,t.style)-(m2?i.width:0);o.length&&h+w>d&&(n(),i=void 0,w=a.width(f,e.size,t.style)),i&&i.icon===void 0&&i.math===void 0&&i.style===t.style?(i.text+=f,i.width+=w):o.push({text:f,style:t.style,width:w}),h+=w}}(o.length||!e.lines[s].length)&&n()}let r=0;for(let s of l)r=Math.max(r,s);let c={...e,lines:g,widths:l,width:r,height:g.length*e.lineHeight};return e.heights?pt(c):c}function E(e,a,d,g){let l=Yn(e),r="<text"+jn(g,l),c="";for(let s=0;s<e.lines.length;s++){let o=e.lines[s],h=d+(s+.5)*e.lineHeight;if(o.some(t=>t.icon!==void 0)){let t=e.widths[s];c+=Yt({...e,lines:[o],widths:[t],height:e.lineHeight},a+t/2,h,g);continue}let n="";for(let t of o){let f=Le(t.style&~l);n+=f?`<tspan${f}>${S(t.text)}</tspan>`:S(t.text)}n!==""&&(c+=`${r} x="${m(a)}" y="${m(h+e.size*.35)}" text-anchor="start" xml:space="preserve">${n}</text>`)}return c}export{A,E,T};
@@ -1,2 +1,2 @@
1
- import{y as ye}from"./lazy-D3tN-GAO.js";function h(e,r){let t=e.indexOf(`
1
+ import{y as ye}from"./lazy-CUmWiDAP.js";function h(e,r){let t=e.indexOf(`
2
2
  `,r);return t===-1?e.length:t}function d(e,r,t){for(let n=0;n<t.length;n++)if((e.charCodeAt(r+n)|32)!==t.charCodeAt(n))return!1;return!0}function g(e,r){let t=e.length,n=r;for(;n<t;){let u=e.charCodeAt(n);if(u===37&&e.charCodeAt(n+1)!==123)n=h(e,n);else{if(u===10)return n;if(ye(u))do n++;while(n<t&&ye(e.charCodeAt(n)));else if(u===35)n=h(e,n);else return n}}return n}function c(e,r){let t=r;for(;ye(e.charCodeAt(t));)t++;return t}function x(e,r,t,n){let u=d(e,r,"accdescr");if(!u&&!d(e,r,"acctitle"))return r;let a=e.length,i=c(e,r+8),m=e.charCodeAt(i),s=(o,b,f)=>{t.types.push(o),t.texts.push(e.slice(b,f)),t.starts.push(b)};if(m===58){i=c(e,i+1);let o=h(e,i);return s(u?n+2:n,r,i),s(u?n+3:n+1,i,o),o}if(!u||m!==123)return r;for(i=c(e,i+1);e.charCodeAt(i)!==125;){let o=e.indexOf("}",i);if(o===-1&&(o=a),s(n+4,i,o),i===a)return a;i=o}return i+1}export{d,g,h,x};
@@ -1,4 +1,4 @@
1
- import{S,T as Tn,H as Ht,_ as _t$1,c as at$1,b as me,d as dt$1,g as gt$1}from"./lazy-D3tN-GAO.js";var W=1.5,D=1.3,V=/<br\s*\/?>|\\n|\n/gi,C=/<\/?([a-zA-Z][\w-]*)(?:\s[^<>]*)?\/?>/y,N=/(fa[bklrs]?):fa-([\w-]+)/g,Z=/[<\\\n*_]|fa[bklrs]?:fa-/,Q=new Map([["b",1],["strong",1],["i",2],["em",2],["cite",2],["dfn",2],["var",2],["code",4],["kbd",4],["samp",4],["tt",4],["sub",8],["sup",16],["u",32],["ins",32]]),z=24,tt=new Set("a abbr address article aside audio b bdi bdo big blockquote body br button caption center cite code col colgroup data dd del details dfn dialog div dl dt em embed fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins kbd label legend li link main map mark meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr".split(" ")),k="\\u2e80-\\u9fff\\uf900-\\ufaff\\uff00-\\uff60",P="、。,.:;!?)]}」』】〕〉》〙〗ー…‥・ゝゞぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮ,.:;!?)\\]}",et="([{「『【〔〈《〘〖([{",nt=new RegExp(`[${k}]`),E="\\u200b\\u00ad",it=new RegExp(`[${E}]`),st=new RegExp(`\\s*(?:[${et}]*[${k}][${P}]*|[^\\s${k}${E}]+[${E}]*[${P}]*|[${E}]+)\\s*|\\s+`,"g"),K=57344,ot=6400,rt=/\$\$(.+?)\$\$/g,U=/[\ue000-\uf8ff]/,lt=/([\ue000-\uf8ff])/,$,ct={lines:[],widths:[],width:0,height:0,size:0,lineHeight:0};function ft(t){let e=t.split(`
1
+ import{S,T as Tn,H as Ht,_ as _t$1,c as at$1,b as me,d as dt$1,g as gt$1}from"./lazy-CUmWiDAP.js";var W=1.5,D=1.3,V=/<br\s*\/?>|\\n|\n/gi,C=/<\/?([a-zA-Z][\w-]*)(?:\s[^<>]*)?\/?>/y,N=/(fa[bklrs]?):fa-([\w-]+)/g,Z=/[<\\\n*_]|fa[bklrs]?:fa-/,Q=new Map([["b",1],["strong",1],["i",2],["em",2],["cite",2],["dfn",2],["var",2],["code",4],["kbd",4],["samp",4],["tt",4],["sub",8],["sup",16],["u",32],["ins",32]]),z=24,tt=new Set("a abbr address article aside audio b bdi bdo big blockquote body br button caption center cite code col colgroup data dd del details dfn dialog div dl dt em embed fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins kbd label legend li link main map mark meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr".split(" ")),k="\\u2e80-\\u9fff\\uf900-\\ufaff\\uff00-\\uff60",P="、。,.:;!?)]}」』】〕〉》〙〗ー…‥・ゝゞぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮ,.:;!?)\\]}",et="([{「『【〔〈《〘〖([{",nt=new RegExp(`[${k}]`),E="\\u200b\\u00ad",it=new RegExp(`[${E}]`),st=new RegExp(`\\s*(?:[${et}]*[${k}][${P}]*|[^\\s${k}${E}]+[${E}]*[${P}]*|[${E}]+)\\s*|\\s+`,"g"),K=57344,ot=6400,rt=/\$\$(.+?)\$\$/g,U=/[\ue000-\uf8ff]/,lt=/([\ue000-\uf8ff])/,$,ct={lines:[],widths:[],width:0,height:0,size:0,lineHeight:0};function ft(t){let e=t.split(`
2
2
  `),s=1/0;for(let i of e){if(i.trim()==="")continue;let n=i.length-i.trimStart().length;n<s&&(s=n)}return s===1/0||s===0?t:e.map(i=>i.slice(Math.min(s,i.length-i.trimStart().length))).join(`
3
3
  `)}function _(t){return t!==void 0&&t.icon===void 0&&t.math===void 0}function R(t,e,s){if(e!==""){if($!==void 0&&U.test(e)){let i=$,n=e.split(lt);for(let c=0;c<n.length;c++){if(c%2===0){n[c]!==""&&I(t,n[c],s);continue}let d=n[c].charCodeAt(0)-K,r=i.math[d];r?t.push({text:"",style:s,math:r,width:r.width}):I(t,`$$${i.tex[d]}$$`,s)}return}I(t,e,s)}}function I(t,e,s){let i=me(e),n=t[t.length-1];_(n)&&n.style===s?n.text+=i:t.push({text:i,style:s,width:0})}function at(t,e,s){if(!e.includes(":fa-")){R(t,e,s);return}let i=0;N.lastIndex=0;let n;for(;(n=N.exec(e))!==null;){let c=`${n[1]}:fa-${n[2]}`;if(R(t,e.slice(i,n.index),s),i=n.index+n[0].length,at$1(c)!=="")t.push({text:"",style:s,icon:c,width:0});else if(e[i]===" ")i++;else if(i===e.length){let d=t[t.length-1];_(d)&&(d.text=d.text.trimEnd())}}R(t,e.slice(i),s)}function dt(t,e,s,i,n){let c=n.style,d=0,r="",l=0,o=e.length,f=()=>{at(t,r,c|(n.shifts[n.shifts.length-1]??0)),r=""};for(;l<o;){let h=e[l];if(h==="<"){C.lastIndex=l;let u=C.exec(e);if(u&&u.index===l){let p=u[1].toLowerCase(),m=e[l+1]==="/",a=Q.get(p)??0;if(a&z){f();let g=n.shifts.lastIndexOf(a);m?g!==-1&&n.shifts.splice(g,1):n.shifts.push(a)}else a&&(f(),n.style=m?n.style&~a|i&a:n.style|a,c=m?c&~a|i&a:c|a);if(a||tt.has(p)){l+=u[0].length;continue}}}else if(s&&(h==="*"||h==="_")){let u=e[l+1]===h,p=u?1:2,m=u?2:1,a=(d&p)===0,g=l>0?e[l-1]:" ",x=l+m<o?e[l+m]:" ",S2=a&&x.trim()!==""&&e.indexOf(u?h+h:h,l+m)!==-1,b=!a&&g.trim()!=="",y=h==="_"&&/\w/.test(g)&&/\w/.test(x);if((S2||b)&&!y){f(),d=S2?d|p:d&~p,c=S2?c|p:c&~p|i&p,l+=m;continue}}r+=h,l++}f()}function ht(t,e,s){let i=0;for(let n of t)n.width=n.icon!==void 0?s*1.25:n.math?n.math.width:e.width(n.text,s,n.style),i+=n.width;return i}function j(t,e,s,i,n,c){let d=[],r=0,l=(o=!1)=>{let f=d[d.length-1];if(_(f)){let h=f.text.trimEnd();if(o&&f.text.endsWith("­")&&(h=h.slice(0,-1)+"-"),h!==f.text){f.text=h;let u=e.width(h,s,f.style);r+=u-f.width,f.width=u}}n.push(d),c.push(r),d=[],r=0};for(let o of t){if(o.icon!==void 0||o.math){let a=o.math?o.math.width:s*1.25;r>0&&r+a>i&&l(),d.push({...o,width:a}),r+=a;continue}let f=o.text.match(st)??[],h=o.text.includes("­"),u=h?f.length:0,p=new Float64Array(u),m=new Float64Array(u+1);for(let a=u-1;a>=0;a--){let g=f[a].endsWith("­"),x=f[a].trimEnd();p[a]=e.width(g?x.slice(0,-1):x,s,o.style),m[a]=g?a===u-1?o===t[t.length-1]?p[a]:1/0:p[a]+m[a+1]:p[a]}for(let a=0;a<f.length;a++){let g=f[a],x=h?p[a]:e.width(g.trimEnd(),s,o.style),S2=!h||!g.endsWith("­")?r+x<=i:r+e.width(g.slice(0,-1)+"-",s,o.style)<=i||r+m[a]<=i;r>0&&!S2&&(l(g.trimStart()===g),g=g.trimStart());let b=d[d.length-1];if(_(b)&&b.style===o.style){if(b.text+=g,x>0||g.trimEnd()!==g){let y=b.width;b.width=e.width(b.text,s,b.style),r+=b.width-y}}else{let y=e.width(g,s,o.style);d.push({text:g,style:o.style,width:y}),r+=y}}}(d.length>0||n.length===0)&&l()}function It(t,e,s,i,n,c=0){if(t===void 0||t==="")return ct;let d=Math.round(i*W);if(dt$1()&&t.includes("$$")&&!U.test(t)){let r={tex:[],math:[]},l=t.replace(rt,(o,f)=>r.tex.length===ot?o:(r.tex.push(f),String.fromCharCode(K+r.tex.length-1)));if(r.tex.length>0){for(let o of r.tex)r.math.push(gt$1(me(o),i));return F(l,e,s,i,n,c,d,r)}}if(!Z.test(t)&&!t.includes("&")&&!t.includes("fl")){let r=t.trim(),l=s.width(r,i,c);if(l<=n||!(r.includes(" ")||nt.test(r)||it.test(r)))return{lines:[[{text:r,style:c,width:l}]],widths:[l],width:l,height:d,size:i,lineHeight:d};let o=[],f=[];j([{text:r,style:c,width:l}],s,i,n,o,f);let h=0;for(let p of f)p>h&&(h=p);let u=o.length>1?Math.round(i*D):d;return{lines:o,widths:f,width:h,height:o.length*u,size:i,lineHeight:u}}return F(t,e,s,i,n,c,d)}function F(t,e,s,i,n,c,d,r){let l=$;$=r;try{let o=ut(t,e,s,i,n,c,d);return r?pt(o):o}finally{$=l}}function ut(t,e,s,i,n,c,d){let r=e?ft(t.replace(/\r\n?/g,`
4
4
  `)).trim():t.trim(),l=[],o=[],f=0,h={style:c,shifts:[]};for(let p of r.split(V)){let m=[];dt(m,p.trim(),e,c,h);let a=ht(m,s,i);a>n?j(m,s,i,n,l,o):(l.push(m),o.push(a))}for(let p of o)p>f&&(f=p);let u=l.length>1?Math.round(i*D):d;return{lines:l,widths:o,width:f,height:l.length*u,size:i,lineHeight:u}}function pt(t){let e;for(let i=0;i<t.lines.length;i++){let n=t.lineHeight;for(let c of t.lines[i])c.math&&(n=Math.max(n,Math.ceil(c.math.height+t.size/4)));n!==t.lineHeight&&e===void 0&&(e=t.lines.map(()=>t.lineHeight)),e&&(e[i]=n)}if(e===void 0)return t.heights===void 0?t:{...t,heights:void 0,height:t.lines.length*t.lineHeight};let s=0;for(let i of e)s+=i;return{...t,heights:e,height:s}}function kt(t){for(let e of t)if(e.math)return!0;return!1}function Lt(t,e){let s=t.heights;if(!s)return(e+.5)*t.lineHeight;let i=0;for(let n=0;n<e;n++)i+=s[n];return i+s[e]/2}function Tt(t,e){let s=t.widths[e],i=t.heights?t.heights[e]:t.lineHeight,n={lines:[t.lines[e]],widths:[s],width:s,height:i,size:t.size,lineHeight:t.lineHeight};return i!==t.lineHeight&&(n.heights=[i]),n}var q="--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg)",Ot="var(--_fm)",X="var(--pele-radius,4px)",gt=' style="rx:var(--_r)"',mt=/[";]fill:/,Ct=t=>mt.test(t);function Nt(t){let e=t.indexOf(' style="');return e<0?t+gt:`${t.slice(0,e+8)}rx:var(--_r);${t.slice(e+8)}`}var Pt="var(--pele-critical,#e45756)",G=String.raw`(?:"[^"'\\\n<>{}();:@]*"|'[^"'\\\n<>{}();:@]*'|[\p{L}\p{N}_-][\p{L}\p{N}_ .-]*)`,bt=new RegExp(String.raw`^\s*${G}(?:\s*,\s*${G})*\s*$`,"u");function B(t,e){return t&&bt.test(t)?t:e}function J(t,e,s){return`;--_fm:var(--pele-font-mono,${B(s,"monospace")});font:${t}px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,${B(e,"sans-serif")})`}var xt=new Set(["fill","fill-opacity","stroke","stroke-width","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","opacity","rx","ry"]),wt=new Set(["color","font-size","font-family","font-weight","font-style","text-decoration","letter-spacing","word-spacing","opacity"]),yt=/url\s*\(|expression\s*\(|javascript:|[<>{};\\]|@import|image-set|\/\*/i,Y={shape:"",line:"",text:"",stroke:void 0,bold:!1,italic:!1,fontSize:void 0};function Ft(t){if(t.length===0)return Y;let e=new Map,s=new Map;for(let o of t){let f=o.indexOf(":");if(f<=0)continue;let h=o.slice(0,f).trim().toLowerCase(),u=o.slice(f+1).replace(/!important/gi,"").trim();u===""||yt.test(u)||_t$1.test(u)||(xt.has(h)&&e.set(h,u),wt.has(h)&&s.set(h==="color"?"fill":h,u))}if(e.size===0&&s.size===0)return Y;let i="",n="";for(let[o,f]of e)i+=`${o}:${f};`,o!=="fill"&&o!=="fill-opacity"&&(n+=`${o}:${f};`);let c="";for(let[o,f]of s)c+=`${o}:${f};`;let d=s.get("font-weight"),r=s.get("font-size"),l=r&&/^[\d.]+(px)?$/.test(r)?parseFloat(r):void 0;return{shape:i?` style="${S(i)}"`:"",line:n?` style="${S(n)}"`:"",text:c?` style="${S(c)}"`:"",stroke:e.get("stroke"),bold:d==="bold"||d==="bolder"||Number(d)>=600,italic:s.get("font-style")==="italic",fontSize:l!==void 0&&l>0&&l<=200?l:void 0}}var St=/[^\w-]+/g;function Dt(t){let e=t.replace(St," ").trim();return e===""?"":" "+e}var $t=["#4c78a8","#f58518","#54a24b","#e45756","#72b7b2","#eeca3b","#b279a2","#9d755d"];function Kt(t){let e=(t%8+8)%8;return`var(--pele-series-${e+1},${$t[e]})`}var Et=[["tw","title"],["hw","heading"],["w","bold"]],_t=/var\(--_(r|tw|hw|w)\)/g;function Yt(t,e,s,i,n,c,d){let r=S(n.idPrefix??"pele"),l="",o="";c.accTitle&&(l+=`<title id="${r}-title">${Tn(c.accTitle)}</title>`,o+=` aria-labelledby="${r}-title"`),c.accDescr&&(l+=`<desc id="${r}-desc">${Tn(c.accDescr)}</desc>`,o+=` aria-describedby="${r}-desc"`);let f=n.responsive===!1?"":"max-width:100%;height:auto;",h=new Set;for(let[,p]of d.matchAll(_t))if(h.add(p),h.size===4)break;let u=h.has("r")?`;--_r:${X}`:"";for(let[p,m]of Et)h.has(p)&&(u+=`;--_${p}:var(--pele-${m}-weight,bold)`);return`<svg xmlns="http://www.w3.org/2000/svg" class="pele pele-${t}" viewBox="0 0 ${e} ${s}" width="${e}" height="${s}" style="${f}${q}${u}${S(J(i,n.fontFamily,n.fontFamilyMono))}${Ht()}" fill="var(--_fg)" role="graphics-document document" aria-roledescription="${t}"${o}>`+l+d+"</svg>"}export{Ct as C,Dt as D,Ft as F,It as I,Kt as K,Lt as L,Nt as N,Ot as O,Pt as P,Tt as T,Yt as Y,gt as g,kt as k,pt as p};
@@ -1,2 +1,2 @@
1
- import{f,h}from"./DKTLEL5E-CJTkVtjr.js";import{x,D,M,$,L,V,W,G,O,P as P$1,H,j,z,B,U,Y}from"./EXE5EH6O-SXdUe5We.js";import{I as It,K as Kt,Y as Yt$1}from"./BGW36YJW-DhmSG9tb.js";import{R,O as Ot,T as Tn,m,G as Gt,Y as Yt}from"./lazy-D3tN-GAO.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";function Ie(i,e){let t=new Map;for(let{label:n,value:c}of i.sections){if(c<0)throw new R(`"${n}" has invalid value: ${c}. Negative values are not allowed in pie charts. All slice values must be >= 0.`,"semantic",{type:"pie"});t.has(n)||t.set(n,c)}return{type:"pie",title:i.title||e,accTitle:i.accTitle?i.accTitle.replace(/^\s+/g,""):void 0,accDescr:i.accDescr?i.accDescr.replace(/\n\s+/g,`
1
+ import{f,h}from"./DKTLEL5E-CJTkVtjr.js";import{x,D,M,$,L,V,W,G,O,P as P$1,H,j,z,B,U,Y}from"./EXE5EH6O-Cbj5xPKl.js";import{I as It,K as Kt,Y as Yt$1}from"./BGW36YJW-BAwgTZ_z.js";import{R,O as Ot,T as Tn,m,G as Gt,Y as Yt}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";function Ie(i,e){let t=new Map;for(let{label:n,value:c}of i.sections){if(c<0)throw new R(`"${n}" has invalid value: ${c}. Negative values are not allowed in pie charts. All slice values must be >= 0.`,"semantic",{type:"pie"});t.has(n)||t.set(n,c)}return{type:"pie",title:i.title||e,accTitle:i.accTitle?i.accTitle.replace(/^\s+/g,""):void 0,accDescr:i.accDescr?i.accDescr.replace(/\n\s+/g,`
2
2
  `):void 0,showData:i.showData,sections:t}}function Se(i,e){let t=e;for(let n=i.charCodeAt(t);n>=48&&n<=57;n=i.charCodeAt(t))t++;return t}function Fe(){let i=0,e=0,t=-1;return(n,c)=>{let a=n.charCodeAt(c)===45?c+1:c;if((a<i||a>=e)&&(i=a,e=Se(n,a),t=-1,e>a&&n.charCodeAt(e)===46)){let r=Se(n,e+1),f2=r-e-1;f2>0&&n.charCodeAt(r)!==46?t=r:f2>1&&(t=r-1)}return e===a?-1:t>=0?t:n.charCodeAt(a)===48?n.charCodeAt(a+1)===46?-1:a+1:n.charCodeAt(e)!==46?e:e-1>a?e-1:-1}}var Re=[Y("showData"),Y("pie"),{name:":",pattern:":"},{name:"NUMBER_PIE",pattern:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/y,scanner:Fe,first:"-0123456789"},M,$,L,V,W,G,O,P$1,H];function Le(i){let e=new x(D(i,Re,"pie"),Re,"pie"),t={$type:"Pie",showData:!1,sections:[]},n=()=>{if(e.kind!==-1)for(e.kind!==8&&e.fail("a line break or the end of input");e.kind===8;)e.i++};for(;e.kind===8;)e.i++;for(e.expect(1),t.showData=e.accept(0);e.kind!==-1;)switch(e.kind){case 8:e.i++;break;case 4:t.accDescr=U(e.take()),n();break;case 5:t.accTitle=B(e.take()),n();break;case 6:t.title=z(e.take()),n();break;case 7:{let c=j(e.take());e.expect(2);let a=Number(e.expect(3));t.sections.push({$type:"PieSection",label:c,value:a}),n();break}default:e.fail("a section, a title, or a line break")}return t}var He=120,I=12,J=26,Q=32,_e=28;function X(i,e){return i.pie?.[e]}function P(i,e){return`${m(Math.sin(i)*e)},${m(-Math.cos(i)*e)}`}function Ve(i,e,t,n){if(e-i>=Math.PI*2-1e-9){let a=(r,f2)=>`M0,${m(-r)}A${m(r)},${m(r)} 0 1 ${f2} 0,${m(r)}A${m(r)},${m(r)} 0 1 ${f2} 0,${m(-r)}Z`;return a(t,1)+(n>0?a(n,0):"")}let c=e-i>Math.PI?1:0;return n<=0?`M0,0L${P(i,t)}A${m(t)},${m(t)} 0 ${c} 1 ${P(e,t)}Z`:`M${P(i,t)}A${m(t)},${m(t)} 0 ${c} 1 ${P(e,t)}L${P(e,n)}A${m(n)},${m(n)} 0 ${c} 0 ${P(i,n)}Z`}function Ne(i,e,t){return f(t,He*2,140,(n,c)=>Ge(i,e,t,n/2,c))}function Ge(i,e,t,n,c){let a=t.fontSize??16,r=Math.round(a*.875),f2=t.measurer??Ot(t.fontFamily,t.fontFamilyMono),g=t.padding??8,S=X(e,"textPosition"),ee=typeof S=="number"&&S>=0&&S<=1?S:.75,R2=X(e,"donutHole"),Oe=typeof R2=="number"&&R2>0&&R2<=.9?R2*n:0,W2=String(X(e,"legendPosition")??"right"),h$1=c&&(W2==="left"||W2==="right")?"bottom":W2,x2=[...i.sections],j2=0;for(let[,s]of x2)j2+=s;let L2=x2.map(([s,l])=>It(i.showData?`${s} [${l}]`:s,!1,f2,r,4e3)),d=0;for(let s of L2)d=Math.max(d,s.width);d+=L2.length>0?I+8:0;let $2=L2.length*J,k=It(i.title,!1,f2,a,h(t),1),te=k.height>0?k.height+16:0,ne=x2.map(([,s])=>{let l=j2>0?s/j2:0;return l*100>=1&&(l*100).toFixed(0)!=="0"?l:0}),ie=ne.map(s=>s===0||s>=.5?!1:2*n*ee*Math.sin(s*Math.PI)<f2.width((s*100).toFixed(0)+"%",r,0)+6),We=ie.includes(!0)?_e:0,b=h$1==="left"||h$1==="right"||h$1==="center"?h$1:"",oe=h$1==="top"||h$1==="bottom",p=(n+We)*2,m$1=p,w=p;b==="left"||b==="right"?(m$1+=d>0?Q+d:0,w=Math.max(w,$2)):oe&&(m$1=Math.max(m$1,d),w+=$2>0?20+$2:0),m$1=Math.max(m$1,k.width);let A=g+(b==="left"?d+Q+p/2:b==="right"?p/2:m$1/2),D2=g+te,_=D2+(h$1==="top"?$2+20+p/2:oe?p/2:w/2),N="",z2="",F="",O2=0,C=n+_e/2,re=[],je=(s,l,u)=>re.every(y=>Math.abs(s-y.x)>=(u+y.width)/2+2||Math.abs(l-y.y)>=r+2);x2.forEach(([s],l)=>{let u=ne[l];if(u===0)return;let y=O2+u*Math.PI*2;N+=`<path class="pele-slice" data-id="${Tn(s)}" d="${Ve(O2,y,n,Oe)}" fill="${Kt(l)}"/>`;let G2=(O2+y)/2,U2=(u*100).toFixed(0)+"%";if(ie[l]){let T=f2.width(U2,r,0),v=G2;for(let le=0;le<360&&!je(Math.sin(v)*C,-Math.cos(v)*C,T);le++)v+=2/C;let ae=Math.sin(v)*C,ce=-Math.cos(v)*C;re.push({x:ae,y:ce,width:T}),F+=`<text x="${m(ae)}" y="${m(ce+r*.35)}">${U2}</text>`}else{let T=n*ee;z2+=`<text x="${m(Math.sin(G2)*T)}" y="${m(-Math.cos(G2)*T+r*.35)}"${Gt(l)}>${U2}</text>`}O2=y}),N===""&&(N=`<circle class="pele-slice" r="${n}" fill="none" stroke="var(--_b)"/>`);let H2="",M2,E;b==="right"?(M2=A+p/2+Q,E=D2+(w-$2)/2):b==="left"?(M2=g,E=D2+(w-$2)/2):b==="center"?(M2=A-d/2,E=_-$2/2):(M2=g+(m$1-d)/2,E=h$1==="top"?D2:D2+p+20),L2.forEach((s,l)=>{let u=E+l*J+J/2;H2+=`<g class="pele-legend-item" data-id="${Tn(x2[l][0])}"><rect x="${m(M2)}" y="${m(u-I/2)}" width="${I}" height="${I}" rx="2" fill="${Kt(l)}"/>`+Yt(s,M2+I+8+s.width/2,u,"")+"</g>"});let V2=Math.ceil(m$1+2*g),se=Math.ceil(w+te+2*g),ze=Yt(k,V2/2,g+k.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g class="pele-slices" transform="translate(${m(A)},${m(_)})" stroke="var(--_bg)" stroke-width="1" stroke-linejoin="round">${N}</g>`+(z2?`<g class="pele-slice-labels" transform="translate(${m(A)},${m(_)})" font-size="${r}" text-anchor="middle" fill="var(--_bg)">${z2}</g>`:"")+(F?`<g class="pele-slice-labels" transform="translate(${m(A)},${m(_)})" font-size="${r}" text-anchor="middle">${F}</g>`:"")+(H2?`<g class="pele-legend" font-size="${r}">${H2}</g>`:"");return{svg:Yt$1("pie",V2,se,a,t,i,ze),width:V2,height:se,links:[]}}var at={type:"pie",parse:(i,e,t)=>Ie(Le(i),t),render:Ne};export{at as pie};