ompchamber 0.3.0 → 0.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 (240) hide show
  1. package/README.md +9 -6
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/static/css/index.5291f58223.css +2 -0
  4. package/dist/client/static/js/async/{1k.544adbf77d.js → 1k.5974df3b87.js} +2 -2
  5. package/dist/client/static/js/async/3j.357c80ff38.js +2 -0
  6. package/dist/client/static/js/async/{3y.22075aa079.js → 3y.ededeebde8.js} +5 -5
  7. package/dist/client/static/js/async/51.95bcae98af.js +2 -0
  8. package/dist/client/static/js/async/6.f034c9b528.js +1 -0
  9. package/dist/client/static/js/async/a.e05da304c8.js +10 -0
  10. package/dist/client/static/js/async/ar.1e14da5588.js +1 -0
  11. package/dist/client/static/js/async/art.62139ed479.js +2 -0
  12. package/dist/client/static/js/async/ct.b74928f7a3.js +1 -0
  13. package/dist/client/static/js/async/fw.6a51998a8e.js +6 -0
  14. package/dist/client/static/js/async/g.7a4bbd4798.js +2 -0
  15. package/dist/client/static/js/async/g.7a4bbd4798.js.LICENSE.txt +11 -0
  16. package/dist/client/static/js/async/{k.e878dd350f.js → k.7466330d1a.js} +2 -2
  17. package/dist/client/static/js/async/katex-vendor.de6a87c308.js +1 -0
  18. package/dist/client/static/js/async/kc.bbdb35b771.js +1 -0
  19. package/dist/client/static/js/async/l6.c56640c205.js +1 -0
  20. package/dist/client/static/js/async/{m.3fc017a055.js → m.4b29d34f93.js} +3 -3
  21. package/dist/client/static/js/async/{og.ae7acf03ac.js → og.634fba99ac.js} +2 -2
  22. package/dist/client/static/js/async/q.7fb4d2f374.js +21 -0
  23. package/dist/client/static/js/async/rd.cb6bf495bb.js +2 -0
  24. package/dist/client/static/js/async/rf.d626afc367.js +2 -0
  25. package/dist/client/static/js/async/s.413c2a4683.js +2 -0
  26. package/dist/client/static/js/async/s.413c2a4683.js.LICENSE.txt +6 -0
  27. package/dist/client/static/js/async/sy.d16be843a7.js +94 -0
  28. package/dist/client/static/js/async/t.cb3fcf8615.js +1 -0
  29. package/dist/client/static/js/async/ud.3065bfee31.js +2 -0
  30. package/dist/client/static/js/async/uf.46ad6209fa.js +2 -0
  31. package/dist/client/static/js/async/uf.46ad6209fa.js.LICENSE.txt +6 -0
  32. package/dist/client/static/js/async/v.7d28d3c241.js +34 -0
  33. package/dist/client/static/js/async/v0.394ed37c6b.js +2 -0
  34. package/dist/client/static/js/async/v0.394ed37c6b.js.LICENSE.txt +6 -0
  35. package/dist/client/static/js/async/vt.42416b707d.js +1 -0
  36. package/dist/client/static/js/async/vy.bbe114c4e0.js +2 -0
  37. package/dist/client/static/js/async/vy.bbe114c4e0.js.LICENSE.txt +6 -0
  38. package/dist/client/static/js/async/xw.ae67ba06fd.js +31 -0
  39. package/dist/client/static/js/async/xw.ae67ba06fd.js.LICENSE.txt +4 -0
  40. package/dist/client/static/js/async/yg.35bebd6d0c.js +149 -0
  41. package/dist/client/static/js/async/yv.2fa22f009a.js +1 -0
  42. package/dist/client/static/js/index.bf1b1fe988.js +33 -0
  43. package/dist/client/static/js/index.bf1b1fe988.js.LICENSE.txt +4 -0
  44. package/dist/client/static/js/{markdown-vendor.9da142c67b.js → markdown-vendor.71e43278b3.js} +1 -1
  45. package/dist/client/static/js/uy.5f791144ce.js +139 -0
  46. package/package.json +2 -1
  47. package/src/client/App.tsx +22 -5
  48. package/src/client/components/common/MarkdownRenderer.tsx +36 -0
  49. package/src/client/components/layout/desktop-layout/index.tsx +1 -1
  50. package/src/client/components/layout/session-sidebar/Modals.tsx +1 -1
  51. package/src/client/components/mobile/LayoutWrapper.tsx +1 -1
  52. package/src/client/components/settings/LazyModal.tsx +46 -0
  53. package/src/client/components/settings/Modal.tsx +1 -1
  54. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +43 -29
  55. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +15 -69
  56. package/src/client/components/workspace/chat-timeline/MessageList.tsx +47 -66
  57. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +60 -0
  58. package/src/client/components/workspace/chat-timeline/SubagentView.tsx +37 -21
  59. package/src/client/components/workspace/chat-timeline/ToolCallCard.tsx +22 -4
  60. package/src/client/components/workspace/chat-timeline/index.tsx +3 -6
  61. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +15 -19
  62. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +46 -0
  63. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +18 -68
  64. package/src/client/components/workspace/file-explorer/TreeItem.tsx +8 -2
  65. package/src/client/hooks/chat/omp/index.ts +9 -10
  66. package/src/client/hooks/chat/omp/revalidation-throttle.ts +6 -5
  67. package/src/client/hooks/chat/timeline/actions.ts +1 -2
  68. package/src/client/hooks/chat/timeline/index.ts +5 -0
  69. package/src/client/hooks/chat/timeline/send.ts +1 -2
  70. package/src/client/hooks/chat/timeline/session-load.ts +3 -4
  71. package/src/client/hooks/ui/syntax-ready.ts +16 -3
  72. package/src/client/main.tsx +2 -5
  73. package/src/client/stubs/elkjs.ts +37 -0
  74. package/src/client/tailwind.css +10 -0
  75. package/src/server/lib/fs/git-ignore.ts +49 -0
  76. package/src/server/lib/omp/rpc/constants.ts +10 -0
  77. package/src/server/lib/omp/rpc/lifecycle.test.ts +138 -0
  78. package/src/server/lib/omp/rpc/manager.ts +32 -4
  79. package/src/server/lib/omp/rpc/session-commands.ts +32 -9
  80. package/src/server/lib/omp/rpc/session-registry.ts +3 -2
  81. package/src/server/lib/omp/rpc/subagent-liveness.test.ts +62 -0
  82. package/src/server/lib/omp/rpc/subagent-liveness.ts +100 -0
  83. package/src/server/lib/omp/session/messages.test.ts +112 -0
  84. package/src/server/lib/omp/session/messages.ts +6 -5
  85. package/src/server/routes/agent/command.ts +34 -16
  86. package/src/server/routes/fs/read.ts +15 -7
  87. package/src/shared/lib/chat/notice-row.test.ts +89 -0
  88. package/src/shared/lib/chat/notice-row.ts +78 -0
  89. package/src/shared/lib/chat/omp/abort.ts +41 -0
  90. package/src/shared/lib/chat/timeline/omp-callbacks.test.ts +154 -0
  91. package/src/shared/lib/chat/timeline/omp-callbacks.ts +36 -7
  92. package/src/shared/lib/chat/timeline/run-footer.test.ts +84 -0
  93. package/src/shared/lib/chat/timeline/run-footer.ts +96 -0
  94. package/src/shared/lib/chat/tool-output.test.ts +91 -0
  95. package/src/shared/lib/chat/tool-output.ts +54 -0
  96. package/src/shared/lib/chat/xml-envelope.ts +158 -0
  97. package/src/shared/lib/code/highlighter-lazy.ts +106 -0
  98. package/src/shared/lib/code/highlighter.ts +31 -52
  99. package/src/shared/lib/code/syntax-highlight.test.ts +36 -1
  100. package/src/shared/lib/code/syntax-highlight.ts +17 -3
  101. package/src/shared/lib/format/time.ts +19 -0
  102. package/src/shared/lib/markdown/fira-code-fonts.css +51 -0
  103. package/src/shared/lib/markdown/katex-fonts.css +20 -0
  104. package/src/shared/lib/markdown/katex.ts +101 -0
  105. package/src/shared/lib/markdown/marked.ts +23 -14
  106. package/src/shared/lib/markdown/math.test.ts +109 -0
  107. package/src/shared/lib/markdown/mermaid.ts +6 -0
  108. package/src/shared/lib/markdown/sanitize.ts +48 -2
  109. package/src/shared/lib/omp/session/mapper.ts +11 -3
  110. package/src/shared/lib/omp/session/messages-map.ts +12 -12
  111. package/src/shared/types/chat.ts +3 -1
  112. package/src/shared/types/fs.ts +3 -0
  113. package/dist/client/static/css/g.f36aa429fa.css +0 -1
  114. package/dist/client/static/css/index.a0f07455bd.css +0 -2
  115. package/dist/client/static/css/katex-vendor.ca3a0600e8.css +0 -1
  116. package/dist/client/static/font/KaTeX_AMS-Regular.1608a09b4a.woff +0 -0
  117. package/dist/client/static/font/KaTeX_AMS-Regular.4aafdb685c.ttf +0 -0
  118. package/dist/client/static/font/KaTeX_Caligraphic-Bold.b67709187b.woff +0 -0
  119. package/dist/client/static/font/KaTeX_Caligraphic-Bold.cce5b8ecea.ttf +0 -0
  120. package/dist/client/static/font/KaTeX_Caligraphic-Regular.07ef19e7b0.ttf +0 -0
  121. package/dist/client/static/font/KaTeX_Caligraphic-Regular.dad44a7fc6.woff +0 -0
  122. package/dist/client/static/font/KaTeX_Fraktur-Bold.9f256b8593.woff +0 -0
  123. package/dist/client/static/font/KaTeX_Fraktur-Bold.b18f59e1d1.ttf +0 -0
  124. package/dist/client/static/font/KaTeX_Fraktur-Regular.7c1871215e.woff +0 -0
  125. package/dist/client/static/font/KaTeX_Fraktur-Regular.ed38e79f57.ttf +0 -0
  126. package/dist/client/static/font/KaTeX_Main-Bold.b74a1a8b2c.ttf +0 -0
  127. package/dist/client/static/font/KaTeX_Main-Bold.d181c4650d.woff +0 -0
  128. package/dist/client/static/font/KaTeX_Main-BoldItalic.70d8b0a530.ttf +0 -0
  129. package/dist/client/static/font/KaTeX_Main-BoldItalic.e3f82f9d27.woff +0 -0
  130. package/dist/client/static/font/KaTeX_Main-Italic.47373d1e51.ttf +0 -0
  131. package/dist/client/static/font/KaTeX_Main-Italic.9024d815ba.woff +0 -0
  132. package/dist/client/static/font/KaTeX_Main-Regular.7f51fe0340.woff +0 -0
  133. package/dist/client/static/font/KaTeX_Main-Regular.b7f8fe9b5f.ttf +0 -0
  134. package/dist/client/static/font/KaTeX_Math-BoldItalic.a879cf8383.ttf +0 -0
  135. package/dist/client/static/font/KaTeX_Math-BoldItalic.f1035d8d5d.woff +0 -0
  136. package/dist/client/static/font/KaTeX_Math-Italic.5295ba483a.woff +0 -0
  137. package/dist/client/static/font/KaTeX_Math-Italic.939bc64440.ttf +0 -0
  138. package/dist/client/static/font/KaTeX_SansSerif-Bold.94e1e8dc5f.ttf +0 -0
  139. package/dist/client/static/font/KaTeX_SansSerif-Bold.bf59d231c3.woff +0 -0
  140. package/dist/client/static/font/KaTeX_SansSerif-Italic.7c9bc82b17.woff +0 -0
  141. package/dist/client/static/font/KaTeX_SansSerif-Italic.b4c20c84d8.ttf +0 -0
  142. package/dist/client/static/font/KaTeX_SansSerif-Regular.740484788f.woff +0 -0
  143. package/dist/client/static/font/KaTeX_SansSerif-Regular.d4d7ba4804.ttf +0 -0
  144. package/dist/client/static/font/KaTeX_Script-Regular.0750571032.woff +0 -0
  145. package/dist/client/static/font/KaTeX_Script-Regular.fe9cbbe1a0.ttf +0 -0
  146. package/dist/client/static/font/KaTeX_Size1-Regular.e1e279cbdd.woff +0 -0
  147. package/dist/client/static/font/KaTeX_Size1-Regular.fabc004aab.ttf +0 -0
  148. package/dist/client/static/font/KaTeX_Size2-Regular.577270225e.woff +0 -0
  149. package/dist/client/static/font/KaTeX_Size2-Regular.d6b476ecd3.ttf +0 -0
  150. package/dist/client/static/font/KaTeX_Size3-Regular.9acaf01c64.woff +0 -0
  151. package/dist/client/static/font/KaTeX_Size3-Regular.a144ef5840.ttf +0 -0
  152. package/dist/client/static/font/KaTeX_Size4-Regular.7a996c9da2.woff +0 -0
  153. package/dist/client/static/font/KaTeX_Size4-Regular.fbccdabe0a.ttf +0 -0
  154. package/dist/client/static/font/KaTeX_Typewriter-Regular.6258592bdc.woff +0 -0
  155. package/dist/client/static/font/KaTeX_Typewriter-Regular.d97aaf4a1e.ttf +0 -0
  156. package/dist/client/static/font/fira-code-cyrillic-400-normal.5971438a4a.woff2 +0 -0
  157. package/dist/client/static/font/fira-code-cyrillic-400-normal.9bb7bfea9c.woff +0 -0
  158. package/dist/client/static/font/fira-code-cyrillic-500-normal.5486265b18.woff2 +0 -0
  159. package/dist/client/static/font/fira-code-cyrillic-500-normal.89f92bfb31.woff +0 -0
  160. package/dist/client/static/font/fira-code-cyrillic-600-normal.2805b497e5.woff +0 -0
  161. package/dist/client/static/font/fira-code-cyrillic-600-normal.86e0df22a3.woff2 +0 -0
  162. package/dist/client/static/font/fira-code-cyrillic-700-normal.505a88f22a.woff +0 -0
  163. package/dist/client/static/font/fira-code-cyrillic-700-normal.76f5e8d2e2.woff2 +0 -0
  164. package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.3c4b15e57d.woff2 +0 -0
  165. package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.61323debaa.woff +0 -0
  166. package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.0f34210f2a.woff2 +0 -0
  167. package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.2497cfa1aa.woff +0 -0
  168. package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.40fce94af9.woff2 +0 -0
  169. package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.6c8774b829.woff +0 -0
  170. package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.4b742eb865.woff +0 -0
  171. package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.e75eb4fccc.woff2 +0 -0
  172. package/dist/client/static/font/fira-code-greek-400-normal.bb900468b6.woff2 +0 -0
  173. package/dist/client/static/font/fira-code-greek-400-normal.be76e699ba.woff +0 -0
  174. package/dist/client/static/font/fira-code-greek-500-normal.176c9fb001.woff2 +0 -0
  175. package/dist/client/static/font/fira-code-greek-500-normal.d2c596136b.woff +0 -0
  176. package/dist/client/static/font/fira-code-greek-600-normal.490c3deed7.woff +0 -0
  177. package/dist/client/static/font/fira-code-greek-600-normal.7df14376d9.woff2 +0 -0
  178. package/dist/client/static/font/fira-code-greek-700-normal.c82b6072fc.woff2 +0 -0
  179. package/dist/client/static/font/fira-code-greek-700-normal.d5f2b2917b.woff +0 -0
  180. package/dist/client/static/font/fira-code-greek-ext-400-normal.4849a79781.woff +0 -0
  181. package/dist/client/static/font/fira-code-greek-ext-400-normal.7f5bfc4538.woff2 +0 -0
  182. package/dist/client/static/font/fira-code-greek-ext-500-normal.aaccca4075.woff2 +0 -0
  183. package/dist/client/static/font/fira-code-greek-ext-500-normal.e383181256.woff +0 -0
  184. package/dist/client/static/font/fira-code-greek-ext-600-normal.78cb4bff8e.woff +0 -0
  185. package/dist/client/static/font/fira-code-greek-ext-600-normal.d6c93d54f9.woff2 +0 -0
  186. package/dist/client/static/font/fira-code-greek-ext-700-normal.57ec7c92d9.woff +0 -0
  187. package/dist/client/static/font/fira-code-greek-ext-700-normal.8fafdae5e8.woff2 +0 -0
  188. package/dist/client/static/font/fira-code-latin-400-normal.973295532b.woff +0 -0
  189. package/dist/client/static/font/fira-code-latin-500-normal.7ae2be8fb8.woff +0 -0
  190. package/dist/client/static/font/fira-code-latin-600-normal.1dbbe5bc27.woff +0 -0
  191. package/dist/client/static/font/fira-code-latin-700-normal.497a70148b.woff +0 -0
  192. package/dist/client/static/font/fira-code-latin-ext-400-normal.9dfae29aaf.woff +0 -0
  193. package/dist/client/static/font/fira-code-latin-ext-400-normal.e534ae46e2.woff2 +0 -0
  194. package/dist/client/static/font/fira-code-latin-ext-500-normal.24c7b781b0.woff +0 -0
  195. package/dist/client/static/font/fira-code-latin-ext-500-normal.aad44ab072.woff2 +0 -0
  196. package/dist/client/static/font/fira-code-latin-ext-600-normal.7bed0f2f7e.woff +0 -0
  197. package/dist/client/static/font/fira-code-latin-ext-600-normal.c509a7c9f1.woff2 +0 -0
  198. package/dist/client/static/font/fira-code-latin-ext-700-normal.6c66c8b0a9.woff2 +0 -0
  199. package/dist/client/static/font/fira-code-latin-ext-700-normal.88f64e2822.woff +0 -0
  200. package/dist/client/static/font/fira-code-symbols2-400-normal.97d3f4b17c.woff +0 -0
  201. package/dist/client/static/font/fira-code-symbols2-500-normal.b06f1a06e4.woff +0 -0
  202. package/dist/client/static/font/fira-code-symbols2-600-normal.304b653b93.woff +0 -0
  203. package/dist/client/static/font/fira-code-symbols2-700-normal.d8ce0ad586.woff +0 -0
  204. package/dist/client/static/js/async/3j.a2fcea99be.js +0 -2
  205. package/dist/client/static/js/async/51.1938cec320.js +0 -2
  206. package/dist/client/static/js/async/6.7929428505.js +0 -1
  207. package/dist/client/static/js/async/69.a18a10882f.js +0 -1
  208. package/dist/client/static/js/async/a.bce4542392.js +0 -1
  209. package/dist/client/static/js/async/ar.9dc8b1992a.js +0 -2
  210. package/dist/client/static/js/async/bi.cbfe8eaa8e.js +0 -1
  211. package/dist/client/static/js/async/ct.38d9da8a5a.js +0 -1
  212. package/dist/client/static/js/async/fw.fb1a08b92d.js +0 -6
  213. package/dist/client/static/js/async/l6.45f3b62e15.js +0 -1
  214. package/dist/client/static/js/async/q.0b6fb9bf8d.js +0 -21
  215. package/dist/client/static/js/async/rd.b77011ab7f.js +0 -2
  216. package/dist/client/static/js/async/rf.cfbde7f744.js +0 -2
  217. package/dist/client/static/js/async/s.c7d521a8ae.js +0 -2
  218. package/dist/client/static/js/async/sy.7345abcd67.js +0 -94
  219. package/dist/client/static/js/async/t.0dcb01dfde.js +0 -1
  220. package/dist/client/static/js/async/v.5c7a4b087b.js +0 -1
  221. package/dist/client/static/js/async/vu.311f1d202c.js +0 -34
  222. package/dist/client/static/js/async/yg.9bd4e09ecb.js +0 -149
  223. package/dist/client/static/js/async/yv.593a3f7d54.js +0 -1
  224. package/dist/client/static/js/g.124fba0826.js +0 -139
  225. package/dist/client/static/js/index.907fd4670e.js +0 -68
  226. package/dist/client/static/js/katex-vendor.95e48cf65a.js +0 -1
  227. package/src/shared/lib/chat/order.ts +0 -40
  228. /package/dist/client/static/js/async/{1k.544adbf77d.js.LICENSE.txt → 1k.5974df3b87.js.LICENSE.txt} +0 -0
  229. /package/dist/client/static/js/async/{3j.a2fcea99be.js.LICENSE.txt → 3j.357c80ff38.js.LICENSE.txt} +0 -0
  230. /package/dist/client/static/js/async/{3y.22075aa079.js.LICENSE.txt → 3y.ededeebde8.js.LICENSE.txt} +0 -0
  231. /package/dist/client/static/js/async/{51.1938cec320.js.LICENSE.txt → 51.95bcae98af.js.LICENSE.txt} +0 -0
  232. /package/dist/client/static/js/async/{ar.9dc8b1992a.js.LICENSE.txt → a.e05da304c8.js.LICENSE.txt} +0 -0
  233. /package/dist/client/static/js/async/{fw.fb1a08b92d.js.LICENSE.txt → art.62139ed479.js.LICENSE.txt} +0 -0
  234. /package/dist/client/static/js/async/{m.3fc017a055.js.LICENSE.txt → fw.6a51998a8e.js.LICENSE.txt} +0 -0
  235. /package/dist/client/static/js/async/{q.0b6fb9bf8d.js.LICENSE.txt → m.4b29d34f93.js.LICENSE.txt} +0 -0
  236. /package/dist/client/static/js/async/{rf.cfbde7f744.js.LICENSE.txt → q.7fb4d2f374.js.LICENSE.txt} +0 -0
  237. /package/dist/client/static/js/async/{rd.b77011ab7f.js.LICENSE.txt → rd.cb6bf495bb.js.LICENSE.txt} +0 -0
  238. /package/dist/client/static/js/async/{s.c7d521a8ae.js.LICENSE.txt → rf.d626afc367.js.LICENSE.txt} +0 -0
  239. /package/dist/client/static/js/{index.907fd4670e.js.LICENSE.txt → async/ud.3065bfee31.js.LICENSE.txt} +0 -0
  240. /package/dist/client/static/js/{g.124fba0826.js.LICENSE.txt → uy.5f791144ce.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["vt"],{qL(e,t,n){var r=n("LC"),i=n("Gt");function o(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}function a(e,t,n,r){let i=t.x-e.x,o=t.y-e.y,a=r.x-n.x,l=r.y-n.y,s=i*l-o*a;if(0===s)return null;let d=n.x-e.x,u=n.y-e.y,h=(d*l-u*a)/s,g=(d*o-u*i)/s;return h<=1e-6||h>=1-1e-6||g<=1e-6||g>=1-1e-6?null:{point:{x:e.x+h*i,y:e.y+h*o},tA:h,tB:g}}function l(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}function s(e,t,n){if("rounded"!==e.curve)return!1;let r=e.points,i=r[t],o=r[t+1];if(!i||!o)return!1;let a=Math.hypot(o.x-i.x,o.y-i.y),l=n*a,s=t>0?f(r[t-1],i,o,5):null;if(s&&l<s.cutLen)return!0;let d=t+2<r.length?f(i,o,r[t+2],5):null;return null!==d&&a-l<d.cutLen}function d(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=o(r.points);for(let d=n+1;d<e.length;d++){let n=e[d],u=o(n.points);for(let[e,o]of i.entries())for(let[i,d]of u.entries()){let u=a(o.a,o.b,d.a,d.b);if(!u||s(r,e,u.tA)||s(n,i,u.tB))continue;let h=l(o);h!==l(d)&&h?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:u.tA,point:u.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:u.tB,point:u.point})}}}return t}function u(e){let t=Math.round(1e3*e)/1e3;return Number.isInteger(t),`${t}`}function h(e){return`${u(e.x)},${u(e.y)}`}function g(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}function p(e,t){if(e.length<2)return e.map(e=>({...e}));let n=e.map(e=>({...e})),i=t.arrowTypeStart&&r.hq[t.arrowTypeStart];if(i){let t=e[0],r=e[1],o=Math.atan2(r.y-t.y,r.x-t.x);n[0].x=t.x+i*Math.cos(o),n[0].y=t.y+i*Math.sin(o)}let o=t.arrowTypeEnd&&r.hq[t.arrowTypeEnd];if(o){let t=e.length,r=e[t-2],i=e[t-1],a=Math.atan2(i.y-r.y,i.x-r.x);n[t-1].x=i.x-o*Math.cos(a),n[t-1].y=i.y-o*Math.sin(a)}return n}function c(e,t,n,r,i){let o=e.point.x,a=e.point.y,l={x:o-t*e.r,y:a-n*e.r},s={x:o+t*e.r,y:a+n*e.r},d=[`L${h(l)}`];return"arc"===i?d.push(`A${u(e.r)},${u(e.r)} 0 0 ${r} ${h(s)}`):d.push(`M${h(s)}`),d}function f(e,t,n,r){let i=t.x-e.x,o=t.y-e.y,a=n.x-t.x,l=n.y-t.y,s=Math.hypot(i,o),d=Math.hypot(a,l);if(s<1e-5||d<1e-5)return null;let u=i/s,h=o/s,g=a/d,p=l/d,c=Math.acos(Math.max(-1,Math.min(1,u*g+h*p)));if(c<1e-5||1e-5>Math.abs(Math.PI-c))return null;let f=Math.min(r/Math.sin(c/2),s/2,d/2);return{startX:t.x-u*f,startY:t.y-h*f,endX:t.x+g*f,endY:t.y+p*f,ctrlX:t.x,ctrlY:t.y,cutLen:f}}function y(e,t,n){let r=e.points;if(r.length<2)return"";let i=p(r,e),a="rounded"===e.curve,l=o(i),s=new Map;for(let e of t){let t=l[e.segIndex];if(!t)continue;let r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=s.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*r,r:n.jumpRadius}),s.set(e.segIndex,i)}let d=[`M${h(i[0])}`];for(let e=0;e<l.length;e++){let t=l[e],r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),o=0===r?0:(t.b.x-t.a.x)/r,p=0===r?0:(t.b.y-t.a.y)/r,y=g(t),x=0;if(a&&e>0){let t=f(i[e-1],i[e],i[e+1]??i[e],5);t&&(x=t.cutLen)}let b=r,m=null;a&&e<l.length-1&&(m=f(i[e],i[e+1],i[e+2]??i[e+1],5))&&(b=r-m.cutLen);let k=.6*n.jumpRadius,E=[...s.get(e)??[]].sort((e,t)=>e.t-t.t).filter(e=>{let t=Math.min(e.d-x,b-e.d)-2;return e.r=Math.min(e.r,t),e.r>=k});for(let e=0;e<E.length-1;e++){let t=E[e+1].d-E[e].d;if(E[e].r+E[e+1].r>t){let n=t/2;E[e].r=Math.min(E[e].r,n),E[e+1].r=Math.min(E[e+1].r,n)}}for(let e of E)e.r<k||d.push(...c(e,o,p,y,n.jumpStyle));a&&m?(d.push(`L${u(m.startX)},${u(m.startY)}`),d.push(`Q${u(m.ctrlX)},${u(m.ctrlY)} ${u(m.endX)},${u(m.endY)}`)):d.push(`L${h(t.b)}`)}return d.join(" ")}function x(e){return/^[\d\s+,.LMelm-]*$/.test(e)}function b(e){return!e||"linear"===e||"rounded"===e||"step"===e||"stepBefore"===e||"stepAfter"===e}function m(e){if(!e)return null;try{let t="function"==typeof atob?atob(e):Buffer.from(e,"base64").toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&"number"==typeof e.x&&"number"==typeof e.y&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}function k(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=new Map;for(let e of t)i.set(e.id,e);let o=new Map;for(let e of r.querySelectorAll("path[data-id]")){let t=e.getAttribute("data-id");null===t||o.has(t)||o.set(t,e)}let a=[];for(let e of t){let t=o.get(e.id);if(!t)continue;let n=m(t.getAttribute("data-points"))??e.points;a.push({...e,points:n})}let l=d(a);if(0===l.length)return;let s=new Map;for(let e of l){let t=s.get(e.jumpEdgeId)??[];t.push(e),s.set(e.jumpEdgeId,t)}for(let e of a){let t=s.get(e.id);if(!t||0===t.length)continue;let r=i.get(e.id),a=r?.curve;if(void 0!==a&&!b(a))continue;let l=o.get(e.id);if(!l||void 0===a&&!x(l.getAttribute("d")??""))continue;let d=l.getAttribute("style")??"",u=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(d),h=u?Number.parseFloat(u[1]):null,g=u?Number.parseFloat(u[2]):null,p=y(e,t,n);if(l.setAttribute("d",p),null!==h&&null!==g&&"function"==typeof l.getTotalLength){let e=Math.max(0,l.getTotalLength()-h-g),t=`0 ${h} ${e} ${g}`,n=d.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,";");l.setAttribute("style",n)}}}(0,i.K)(o,"buildSegmentList"),(0,i.K)(a,"segmentIntersection"),(0,i.K)(l,"isHorizontalSeg"),(0,i.K)(s,"crossingSitsInRoundedCorner"),(0,i.K)(d,"findEdgeIntersections"),(0,i.K)(u,"fmt"),(0,i.K)(h,"pointToString"),(0,i.K)(g,"getArcSweepFlag"),(0,i.K)(p,"applyMarkerOffsets"),(0,i.K)(c,"emitJump"),(0,i.K)(f,"computeRoundedCorner"),(0,i.K)(y,"rewriteEdgePath"),(0,i.K)(x,"isStraightPath"),(0,i.K)(b,"curveSupportsLineHops"),(0,i.K)(m,"decodeDataPoints"),(0,i.K)(k,"applyLineJumpsToSvg"),n.d(t,{Z:()=>k})},Ro(e,t,n){n.r(t);var r=n("qL"),i=n("Ag"),o=n("ix"),a=n("LC");n("bQ"),n("Ut"),n("PF"),n("iV"),n("h5"),n("pK"),n("NH");var l=n("Yr");n("M4");var s=n("Gt"),d=n("El"),u=n("oh"),h=(0,s.K)((e,t,{parentById:n})=>{let r=new Set,i=e;if(e===t)return n[e]||"root";for(;i;){if(r.add(i),i===t)return i;i=n[i]}for(i=t;i;){if(r.has(i))return i;i=n[i]}return"root"},"findCommonAncestor");function g(e,{measure:t}){let n=e.config?.elk?.lineHops;if(!1===n)return;let i=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));(0,r.Z)(t.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:"gap"===n?"gap":"arc"})}(0,s.K)(g,"applyElkLineJumps");var p={},c={},f={},y={},x=10,b=(0,s.K)((e,t,n=.5)=>{let r=e.width/2,i=e.height/2,o=e.x-r,a=e.x+r,l=e.y-i,s=e.y+i,d=Math.abs(t.x-o)<=n&&t.y>=l-n&&t.y<=s+n,u=Math.abs(t.x-a)<=n&&t.y>=l-n&&t.y<=s+n,h=Math.abs(t.y-l)<=n&&t.x>=o-n&&t.x<=a+n,g=Math.abs(t.y-s)<=n&&t.x>=o-n&&t.x<=a+n;return d||u||h||g},"onBorder"),m=(0,s.K)((e,t,n)=>{let r=e.x,i=e.y,o=Math.abs(r-n.x),a=e.width/2,l=n.x<t.x?a-o:a+o,s=e.height/2,d=Math.abs(t.y-n.y),u=Math.abs(t.x-n.x);if(Math.abs(i-t.y)*a>Math.abs(r-t.x)*s){let e=n.y<t.y?t.y-s-i:i-s-t.y;l=u*e/d;let r={x:n.x<t.x?n.x+l:n.x-u+l,y:n.y<t.y?n.y+d-e:n.y-d+e};return 0===u&&(r.x=t.x),0===d&&(r.y=t.y),r}{let e=d*(l=n.x<t.x?t.x-a-r:r-a-t.x)/u,i=n.x<t.x?n.x+u-l:n.x-u+l,o=n.y<t.y?n.y+e:n.y-e;return 0===u&&(i=t.x),0===d&&(o=t.y),{x:i,y:o}}},"intersection"),k=(0,s.K)((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),o=Math.abs(t.y-r),a=e.width/2,l=e.height/2;return i>=a||o>=l},"outsideNode"),E=(0,s.K)((e,t,n=x)=>{let r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),o=e.width/2,a=e.height/2;if(1>Math.abs(r-o)||1>Math.abs(i-a)){let r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);if(o>0)return{x:e.x+r/o*(o+n),y:e.y+i/o*(o+n)}}return t},"ensureTrulyOutside"),w=(0,s.K)((e,t,n)=>{let r=1>Math.abs(t.x-e.x),i=1>Math.abs(t.y-e.y);return{x:r?t.x:t.x<e.x?e.x-e.width/4:e.x+e.width/4,y:i?t.y:n.y}},"makeInsidePoint"),M=(0,s.K)((e,t,n)=>{if(!e?.intersect)return null;let r=e.intersect(n);return!r||n.x<t.x&&r.x>t.x||n.x>t.x&&r.x<t.x||1>=Math.hypot(n.x-r.x,n.y-r.y)?null:r},"tryNodeIntersect"),K=(0,s.K)((e,t,n)=>{let r=w(e,t,n);return m(e,t,r)},"fallbackIntersection"),P=(0,s.K)((e,t,n)=>{let r=e.intersect?.(n);return!!r&&Math.hypot(n.x-t.x,n.y-t.y)<=Math.hypot(r.x-t.x,r.y-t.y)+1e-9},"insideOutline"),S=(0,s.K)((e,t,n,r)=>{if(!e?.intersect)return null;let i=r.x-n.x,o=r.y-n.y;if(0===i&&0===o||Math.abs(i)>1e-6&&Math.abs(o)>1e-6)return null;let a={x:t.x,y:t.y},l=Math.abs(i)>Math.abs(o),d=(0,s.K)(e=>l?{x:e,y:n.y}:{x:n.x,y:e},"along"),u=l?a.x:a.y,h=l?n.x:n.y;if(!P(e,a,d(u)))return null;if(P(e,a,d(h)))return{...n};for(let t=0;t<20;t++){let t=(u+h)/2;P(e,a,d(t))?u=t:h=t}return d(u)},"outlineAttachPoint"),O=(0,s.K)((e,t,n,r)=>{let i=E(t,n);return M(e,t,i)??K(t,i,r)},"computeNodeIntersection"),I=(0,s.K)((e,t,n,r=.1)=>{if(n&&0!==e.length)if("start"===t)e.length>0&&Math.abs(e[0].x-n.x)<r&&Math.abs(e[0].y-n.y)<r?e.shift():e[0]=n;else{let t=e.length-1;e.length>0&&Math.abs(e[t].x-n.x)<r&&Math.abs(e[t].y-n.y)<r?e.pop():e[t]=n}},"replaceEndpoint"),A=(0,s.K)(e=>"string"!=typeof e?0:Math.max(a.hq[e]??0,a.Nq[e]??0),"markerPathOffset"),L={arrow_open:["none","none"],arrow_cross:["none","arrow_cross"],double_arrow_cross:["arrow_cross","arrow_cross"],arrow_point:["none","arrow_point"],double_arrow_point:["arrow_point","arrow_point"],arrow_circle:["none","arrow_circle"],double_arrow_circle:["arrow_circle","arrow_circle"]},N="[top=12,left=12,bottom=12,right=12]",v={"spacing.baseValue":15,"spacing.nodeNode":15,"elk.aspectRatio":"1.6","elk.expandNodes":"true","elk.rectpacking.trybox":"true","elk.rectpacking.packing.compaction.rowHeightReevaluation":"true","elk.rectpacking.packing.compaction.iterations":10,"elk.rectpacking.whiteSpaceElimination.strategy":"EQUAL_BETWEEN_STRUCTURES","elk.rectpacking.widthApproximation.strategy":"SCANLINE"},D=["nodeSize.constraints","nodeSize.minimum","elk.algorithm","elk.aspectRatio","elk.contentAlignment","elk.expandNodes","elk.padding",...Object.keys(v)];function T(e){for(let t of D)delete e[t];e["spacing.baseValue"]=24,e["spacing.nodeNode"]=50}(0,s.K)(T,"clearContainerAlgorithmOptions");var _=new Set(["elk.layered","elk.box","elk.rectpacking","elk.stress","elk.force","elk.mrtree","elk.radial","elk.sporeOverlap"]);function R(e,t){if("string"==typeof e)return _.has(e)?e:void t?.warn(`Unknown container layout algorithm "${e}". Supported values: ${[..._].join(", ")}. Falling back to the diagram's layout algorithm.`)}function C(e){switch(e){case"LR":return"RIGHT";case"RL":return"LEFT";case"TB":case"TD":default:return"DOWN";case"BT":return"UP"}}function B(e){return(0,o.qV)(e.shape)?(e.labelData?.width??e.labels?.[0]?.width??0)+(e.padding??0):0}function $(e){return(0,o.qV)(e.shape)?{"nodeSize.constraints":"[MINIMUM_SIZE, NODE_LABELS]","nodeSize.minimum":`(${B(e)}, 0)`}:{}}function X(e,t,n,r){let i=(e.labelData?.width??0)+2*(e.padding??0),o=e.labelData?.height??0,a=Q(t?.preset),l={...$(e),"spacing.baseValue":24,"elk.layered.spacing.edgeNodeBetweenLayers":30,"elk.spacing.edgeEdge":20,"spacing.nodeNode":50,"elk.padding":"[top=24,left=24,bottom=24,right=24]","nodeLabels.placement":"[H_CENTER V_TOP, INSIDE]","elk.layered.mergeEdges":t?.mergeEdges,"elk.layered.nodePlacement.bk.fixedAlignment":t?.nodePlacementAlignment??a.alignment,"elk.layered.nodePlacement.strategy":t?.nodePlacementStrategy??a.containerPlacement,"elk.layered.cycleBreaking.strategy":t?.cycleBreakingStrategy??a.cycleBreaking,"elk.layered.nodePlacement.networkSimplex.nodeFlexibility":"PORT_POSITION","elk.spacing.portsSurrounding":N},s=R(e.metadata?.algorithm,r);if(s){let e=o+15;if(l["nodeSize.constraints"]="[MINIMUM_SIZE, NODE_LABELS]",l["nodeSize.minimum"]=`(${i}, ${e+15})`,l["elk.algorithm"]=s,l["elk.hierarchyHandling"]="SEPARATE_CHILDREN",l["elk.aspectRatio"]="2.0",l["elk.contentAlignment"]="H_CENTER V_TOP",l["elk.expandNodes"]="true",l["elk.padding"]=`[top=${e},left=15,bottom=15,right=15]`,"elk.rectpacking"===s){let e=o+10;Object.assign(l,v,{"elk.padding":`[top=${e},left=10,bottom=10,right=10]`,"nodeSize.minimum":`(${i}, ${e+10})`})}}else e.dir&&(l["elk.algorithm"]=n,l["elk.direction"]=C(e.dir),l["elk.hierarchyHandling"]="SEPARATE_CHILDREN");return Object.assign(l,y),l}function G(e,t){let n=new Set,r=new Map;for(let{id:t,parentId:n}of e){let e=r.get(n);e?e.push(t):r.set(n,[t])}for(let e of r.values()){let r=new Set(e),i=new Map(e.map(e=>[e,0])),o=new Map(e.map(e=>[e,[]])),a=[];for(let e of t){let t=null==e.source?void 0:String(e.source),n=null==e.target?void 0:String(e.target);t&&n&&t!==n&&r.has(t)&&r.has(n)&&(i.set(n,(i.get(n)??0)+1),o.get(t).push(n),o.get(n).push(t),a.push([t,n]))}let l=new Map,d=0;for(let t of e){if(l.has(t))continue;let e=[t];for(l.set(t,d);e.length>0;){let t=e.pop();for(let n of o.get(t))l.has(n)||(l.set(n,d),e.push(n))}d++}let u=Array(d).fill(!1);for(let t of e)(i.get(t)??0)===0&&(u[l.get(t)]=!0);if(!u.includes(!1))continue;let h=new Map(e.map(e=>[e,[]])),g=new Map(e.map(e=>[e,0])),p=(0,s.K)((e,t)=>{let n=new Set([e]),r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;for(let t of h.get(e))n.has(t)||(n.add(t),r.push(t))}return!1},"reaches");for(let[e,t]of a)p(t,e)||(h.get(e).push(t),g.set(t,(g.get(t)??0)+1));let c=Array(d).fill(!1);for(let t of e){let e=l.get(t);u[e]||c[e]||0!==g.get(t)||(n.add(t),c[e]=!0)}}return n}function Y(e,t){if(e.config.elk?.keepEntryNodeOnTop)for(let n of G(e.nodes,e.edges.map(e=>({source:e.start,target:e.end})))){let e=t[n];e&&(e.layoutOptions={...e.layoutOptions,"elk.layered.layering.layerConstraint":"FIRST"})}}function F(e,t){let n=z(t);return W(n),eD(e,n),{algorithm:n.algorithm}}async function H(e,t){let n=z(t),r=U(e,n),i=new u.A;n.log.info("Drawing flowchart using v4 renderer",i);let o=await eu(i,r.elkGraph,n.log);return eh(e,o,r,n.log),V(e.nodes),o}function U(e,t){let n={},r=Z(e,t.algorithm,t.rootLayoutOptions),i=e.direction??"DOWN";r.layoutOptions["elk.direction"]=C(i);let o=ee(e.nodes,t.log);return et(e.nodes,r,n,t),eo(e,r,n,t),el(e,n,o,t),es(r,n,o,t.log),Y(e,n),{elkGraph:r,nodeDb:n,parentLookupDb:o}}(0,s.K)(R,"resolveContainerAlgorithm"),(0,s.K)(C,"dir2ElkDirection"),(0,s.K)(B,"groupTitleWidth"),(0,s.K)($,"groupTitleSizeOptions"),(0,s.K)(X,"buildSubgraphLayoutOptions"),(0,s.K)(G,"findCyclicEntryNodes"),(0,s.K)(Y,"applyCyclicEntryConstraint"),(0,s.K)(F,"prepareLayoutForElk"),(0,s.K)(H,"runElkLayoutCore"),(0,s.K)(U,"buildElkGraphFromLayoutData");var j=(0,i.xY)({afterPaint:g,prepareLayout:F,measureLayout:(0,s.K)((e,t)=>(0,i.QV)(e,t,{unwrapGroupLabels:!0}),"measureLayout"),runLayoutCore:H,paintOptions:{skipIntersect:!0}});function W(e){(0,l.XV)(e.getConfig())}function V(e){let t=new Map(e.map(e=>[e.id,e]));e.sort((e,n)=>e.isGroup!==n.isGroup?e.isGroup?-1:1:e.isGroup&&n.isGroup?q(e,t)-q(n,t):0)}function q(e,t){let n=0,r=new Set,i=e.parentId;for(;i&&!r.has(i);){r.add(i);let e=t.get(i);if(!e?.isGroup)break;n++,i=e.parentId}return n}function z(e){let t=e.helpers;if(!t)throw Error("ELK layout requires Mermaid internal helpers");return{algorithm:e.preparedLayout?.algorithm??e.options?.algorithm,rootLayoutOptions:e.options?.rootLayoutOptions,common:t.common,getConfig:t.getConfig,interpolateToCurve:t.interpolateToCurve,log:t.log}}(0,s.K)(W,"syncHostConfig"),(0,s.K)(V,"orderNodesForElkPaint"),(0,s.K)(q,"getGroupDepth"),(0,s.K)(z,"getElkLayoutContext");var J={default:{layering:"NETWORK_SIMPLEX",placement:"BRANDES_KOEPF",containerPlacement:"BRANDES_KOEPF",alignment:"BALANCED",cycleBreaking:"DEPTH_FIRST"},legacy:{layering:"NETWORK_SIMPLEX",placement:"BRANDES_KOEPF",containerPlacement:"BRANDES_KOEPF",alignment:"NONE",cycleBreaking:"GREEDY"},modelOrder:{layering:"NETWORK_SIMPLEX",placement:"NETWORK_SIMPLEX",containerPlacement:"BRANDES_KOEPF",alignment:"NONE",cycleBreaking:"GREEDY_MODEL_ORDER"},depthFirst:{layering:"NETWORK_SIMPLEX",placement:"NETWORK_SIMPLEX",containerPlacement:"BRANDES_KOEPF",alignment:"NONE",cycleBreaking:"DEPTH_FIRST"}};function Q(e){return void 0!==e&&Object.hasOwn(J,e)?J[e]:J.default}function Z(e,t,n){let r=Q(e.config.elk?.preset),i={id:"root",layoutOptions:{"elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.algorithm":t,"elk.layered.nodePlacement.strategy":e.config.elk?.nodePlacementStrategy??r.placement,"elk.layered.nodePlacement.bk.fixedAlignment":e.config.elk?.nodePlacementAlignment??r.alignment,"elk.layered.mergeEdges":e.config.elk?.mergeEdges,"elk.direction":"DOWN","spacing.baseValue":40,"elk.layered.crossingMinimization.forceNodeModelOrder":e.config.elk?.forceNodeModelOrder,"elk.layered.considerModelOrder.strategy":e.config.elk?.considerModelOrder,"elk.layered.unnecessaryBendpoints":!0,"elk.layered.cycleBreaking.strategy":e.config.elk?.cycleBreakingStrategy??r.cycleBreaking,"elk.layered.layering.strategy":e.config.elk?.layeringStrategy??r.layering,"elk.layered.layering.coffmanGraham.layerBound":e.config.elk?.layeringLayerBound,"elk.layered.wrapping.multiEdge.improveCuts":!0,"elk.layered.wrapping.multiEdge.improveWrappedEdges":!0,"elk.layered.edgeRouting.selfLoopDistribution":"EQUALLY","elk.layered.mergeHierarchyEdges":!0,"elk.spacing.portsSurrounding":N},children:[],edges:[]};return"elk.rectpacking"===t&&Object.assign(i.layoutOptions,v,{"elk.contentAlignment":"H_CENTER V_TOP","elk.padding":"[top=15,left=15,bottom=15,right=15]"}),n&&Object.assign(i.layoutOptions,n),Object.assign(i.layoutOptions,p,c,f),i}function ee(e,t){let n={parentById:{},childrenById:{}},r=e.filter(e=>e.isGroup);return t.info("Subgraphs - ",r),r.forEach(t=>{e.filter(e=>e.parentId===t.id).forEach(e=>{n.parentById[e.id]=t.id,n.childrenById[t.id]??=[],n.childrenById[t.id].push(e.id)})}),n}function et(e,t,n,r,i){let o=e.filter(e=>e?.parentId===i);return r.log.info("addVertices APA12",o,i),o.forEach(i=>{en(t,e,i,n,r)}),t}function en(e,t,n,r,i){let o=er(n);e.children.push(o),r[n.id]=o,n.isGroup&&(o.children=[],et(t,o,r,i,n.id),o.labelData=ei(n,i.getConfig()))}function er(e){let t={...e};return delete t.domId,e.isGroup?t.children=[]:(t.width=e.width??0,t.height=e.height??0,e.spreadPorts&&(t.layoutOptions={...t.layoutOptions,"elk.portAlignment.default":"CENTER"})),t}function ei(e,t){let n=e.labelData;return n||(e.labelBBox?{width:e.labelBBox.width,height:Math.max(0,e.labelBBox.height-2),wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth}:{width:0,height:0,wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth})}function eo(e,t,n,r){r.log.info("abc78 DAGA edges = ",e);let i={};return e.edges.forEach(e=>{let o=e.id;i[o]=(i[o]??-1)+1,e.id=o,r.log.info("abc78 new link id to be used is",o,o,i[o]);let{source:a,target:l,sourceId:s,targetId:d}=ea(e,n);r.log.debug("abc78 source and target",a,l),t.edges.push({...e,sources:[a],targets:[l],sourceId:s,targetId:d,labels:[{width:e.width??0,height:e.height??0,orgWidth:e.width??0,orgHeight:e.height??0,text:e.label??"",layoutOptions:{"edgeLabels.inline":"true","edgeLabels.placement":"CENTER"}}]})}),t}function ea(e,t){let n=e.start,r=e.end,i=n?t[n]:void 0,o=r?t[r]:void 0;return i&&o?{source:n,target:r,sourceId:n,targetId:r}:{source:n,target:r}}function el(e,t,n,r){e.nodes.forEach(i=>{let o=t[i.id];o&&void 0!==n.childrenById[o.id]&&(o.labels=[{text:o.label,width:o?.labelData?.width??50,height:o?.labelData?.height??50}],r.log.debug("UIO node label",o?.labelData?.width,o.padding),o.layoutOptions=X(o,e.config.elk,r.algorithm,r.log),delete o.x,delete o.y,delete o.width,delete o.height)})}function es(e,t,n,r){r.debug("APA01 processing edges, count:",e.edges.length),e.edges.forEach((e,i)=>{r.debug("APA01 processing edge",i,":",e);let o=e.sources[0],a=e.targets[0];if(r.debug("APA01 source:",o,"target:",a),r.debug("APA01 nodeDb[source]:",t[o]),r.debug("APA01 nodeDb[target]:",t[a]),t[o]&&t[a]&&t[o].parentId!==t[a].parentId){let e=h(o,a,n);ed(t,o,e,r),ed(t,a,e,r)}})}function ed(e,t,n,r){let i=e[t];i&&(i.layoutOptions??={},"SEPARATE_CHILDREN"===i.layoutOptions["elk.hierarchyHandling"]&&R(i.metadata?.algorithm)&&(r.debug("Dropping explicit algorithm for node",i.id,"due to cross-boundary edges"),T(i.layoutOptions),Object.assign(i.layoutOptions,$(i))),i.layoutOptions["elk.hierarchyHandling"]="INCLUDE_CHILDREN",i.id!==n&&i.parentId&&ed(e,i.parentId,n,r))}async function eu(e,t,n){let r=globalThis.__mermaidProfiler;try{let i;r?.begin("layoutCore");try{i=await e.layout(t)}finally{r?.end()}return n.debug("APA01 after - success"),n.debug("APA01 layout result:",i),i}catch(e){throw n.error("ELK layout error:",e),e}}function eh(e,t,n,r){let i=new Map(e.nodes.map(e=>[e.id,e]));ef(t.children??[],n,i,0,0,0,r),ec(t.children??[],n,i,t),ew(e,t,n,r)}function eg(e,t=new Set){for(let n of e.children??[])t.add(n.id),eg(n,t);return t}function ep(e,t,n,r){let i=[];for(let o of e.edges??[]){let e=o.sources?.[0]??o.start,a=o.targets?.[0]??o.end,l=t.has(e)&&t.has(a),s=e===r,d=a===r;if(!l&&!s&&!d)continue;let u=eP(e,a,n.parentLookupDb,n.nodeDb);for(let e of o.sections??[])for(let t of l?[e.startPoint,...e.bendPoints??[],e.endPoint]:[s?e.startPoint:null,d?e.endPoint:null])t&&i.push({x:t.x+u.x,y:t.y+u.y})}return i}function ec(e,t,n,r={}){for(let i of e){if(!i?.isGroup)continue;let e=i.children??[];ec(e,t,n,r);let o=t.nodeDb[i.id],a=e.map(e=>t.nodeDb[e.id]).filter(e=>e?.offset&&e.width&&e.height);if(!o?.offset||0===a.length)continue;let l=ep(r,eg(i),t,i.id),s=[...a.map(e=>e.offset.posX),...a.map(e=>e.offset.posX+e.width),...l.map(e=>e.x)],d=[...a.map(e=>e.offset.posY),...a.map(e=>e.offset.posY+e.height),...l.map(e=>e.y)],u=o.offset,h=Math.max(u.posX,Math.min(...s)-24),g=Math.min(u.posX+o.width,Math.max(...s)+24),p=Math.min(u.posY+o.height,Math.max(...d)+24),c=u.posY,f=B(i),y=h,x=g-h;if(x<f){y-=(f-x)/2,x=f;let e=u.posX+o.width;y=Math.max(u.posX,Math.min(y,e-x)),x=Math.min(x,o.width)}let b=p-c;if(b<=0||x<=0)continue;o.elkOrigin??={posX:u.posX,posY:u.posY},o.offset.posX=y,o.offset.width=x,o.offset.height=b,o.width=x,o.height=b,o.x=y+x/2,o.y=c+b/2;let m=n.get(i.id);m&&(m.x=o.x,m.y=o.y,m.width=x,m.height=b)}}function ef(e,t,n,r,i,o,a){e.forEach(e=>{if(!e)return;let l=t.nodeDb[e.id]??e,s=Math.max(e.width,e.labels&&e.labels[0]?.width||0),d={posX:e.x+r,posY:e.y+i,x:r,y:i,depth:o,width:s,height:e.height};l.offset=d,l.x=d.posX+e.width/2,l.y=d.posY+e.height/2,l.width=e.width,l.height=e.height;let u=n.get(e.id);u&&(u.x=l.x,u.y=l.y,u.width=e.isGroup?Math.max(e.width,e.labelData?.width??0):e.width,u.height=e.height,u.labelData=e.labelData,u.labels=e.labels),e.isGroup?(a.debug("Id abc88 subgraph = ",e.id,e.x,e.y,e.labelData),ef(e.children??[],t,n,d.posX,d.posY,o+1,a)):a.info("Id NODE = ",e.id,e.x,e.y,r,i,`translate(${l.x}, ${l.y})`)})}function ey(e,t){let n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);return n>.01&&r<=.01?"h":r>.01&&n<=.01?"v":void 0}function ex(e){let t=eb(e)??e,n=eb([...t].reverse());return n&&(t=n.reverse()),t}function eb(e){if(e.length<5)return null;let[t,n,r,i]=e,o=ey(t,n);if(!o||ey(r,i)!==o||ey(n,r)!==("h"===o?"v":"h")||Math.hypot(n.x-t.x,n.y-t.y)>30)return null;let a="h"===o?Math.abs(r.y-n.y):Math.abs(r.x-n.x);if(a<.01||a>16||!("h"===o?Math.sign(n.x-t.x)===Math.sign(i.x-r.x):Math.sign(n.y-t.y)===Math.sign(i.y-r.y)))return null;let l=3;for(;l+1<e.length&&ey(e[l],e[l+1])===o;)l++;if(l===e.length-1)return null;let s=[...e];for(let n=2;n<=l;n++)s[n]="h"===o?{x:e[n].x,y:t.y}:{x:t.x,y:e[n].y};return s.splice(1,2),s}function em(e,t,n,r){let i=(0,s.K)((e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),"side"),o=i(n,r,e),a=i(n,r,t),l=i(e,t,n),d=i(e,t,r);return(o>0&&a<0||o<0&&a>0)&&(l>0&&d<0||l<0&&d>0)}function ek(e,t){let n=0;for(let r=0;r<e.length-1;r++)for(let i=0;i<t.length-1;i++)em(e[r],e[r+1],t[i],t[i+1])&&n++;return n}function eE(e){let t=e.map(e=>e.points??[]);for(let[n,r]of e.entries()){let e=t[n];if(e.length<5)continue;let i=ex(e);if(i===e)continue;let o=0,a=0;for(let[r,l]of t.entries())r===n||l.length<2||(o+=ek(e,l),a+=ek(i,l));a>o||(r.points=i,t[n]=i)}}function ew(e,t,n,r){let i=new Map(e.edges.map(e=>[e.id,e])),o=e.config.elk?.straightenEdges!==!1,a=new Map(e.nodes.map(e=>[e.id,e])),l=new Set;t.edges?.forEach(e=>{if(!e.sections?.length)return;let t=n.nodeDb[e.sources?.[0]??e.start],r=n.nodeDb[e.targets?.[0]??e.end];if(!t||!r)return;let i=eP(e.start??e.sourceId??e.sources?.[0],e.end??e.targetId??e.targets?.[0],n.parentLookupDb,n.nodeDb),o=e.sections[0];"rect33"!==t.shape&&eM(t,{x:o.startPoint.x+i.x,y:o.startPoint.y+i.y},a,l),"rect33"!==r.shape&&eM(r,{x:o.endPoint.x+i.x,y:o.endPoint.y+i.y},a,l)}),t.edges?.forEach(e=>{let t=i.get(e.id);if(!t)return;let o=e.sources?.[0]??e.start,a=e.targets?.[0]??e.end,l=n.nodeDb[o],d=n.nodeDb[a];if(!l||!d)return;if(!e.sections?.length){let n=(0,s.K)(e=>({x:(e.offset?.posX??e.x??0)+(e.width??0)/2,y:(e.offset?.posY??e.y??0)+(e.height??0)/2}),"centre"),i=n(l),o=n(d);l.x=i.x,l.y=i.y,d.x=o.x,d.y=o.y;let a=eS([i,o],l,d,r);t.points=a,t.curve="linear";let u=a[0],h=a[a.length-1];t.x=(u.x+h.x)/2,t.y=(u.y+h.y)/2,r.debug("APA18 no edge sections, using a straight line",e.id,t.points);return}let u=e.start??e.sourceId??o,h=e.end??e.targetId??a,g=eP(u,h,n.parentLookupDb,n.nodeDb);r.debug("APA18 offset",g,u," ==> ",h,"edge:",e,l);let p=eK(e.sections[0],g);l.x=l.offset.posX+l.width/2,l.y=l.offset.posY+l.height/2,d.x=d.offset.posX+d.width/2,d.y=d.offset.posY+d.height/2,"rect33"!==l.shape&&p.unshift({x:l.x,y:l.y}),"rect33"!==d.shape&&p.push({x:d.x,y:d.y}),t.points=eN(ev(eS(p,l,d,r),e$(d),eA(t),r),e$(l),eL(t),r),t.curve="rounded";let c=e.labels?.[0];c&&(t.x=c.x+g.x+c.width/2,t.y=c.y+g.y+c.height/2)}),o&&eE(e.edges)}function eM(e,t,n,r){let i=e.width??0,o=e.height??0,a=e.offset.posY,l=.5>=Math.abs(t.y-a)||.5>=Math.abs(t.y-(a+o));if((l?i:o)>=24||r.has(e.id))return;r.add(e.id);let s=l?t.x-(e.offset.posX+i/2):t.y-(e.offset.posY+o/2);if(.01>Math.abs(s))return;l?(e.offset.posX+=s,e.x=e.offset.posX+i/2):(e.offset.posY+=s,e.y=e.offset.posY+o/2);let d=n.get(e.id);d&&(d.x=e.offset.posX+i/2,d.y=e.offset.posY+o/2)}function eK(e,t){let n=e.startPoint,r=e.endPoint,i=(e.bendPoints?e.bendPoints:[]).map(e=>({x:e.x+t.x,y:e.y+t.y}));return[{x:n.x+t.x,y:n.y+t.y},...i,{x:r.x+t.x,y:r.y+t.y}]}function eP(e,t,n,r){let i=h(e,t,n);if(void 0===i||"root"===i)return{x:0,y:0};let o=r[i],a=o?.elkOrigin??o?.offset;return{x:a?.posX??0,y:a?.posY??0}}function eS(e,t,n,r){let i,o=Array.isArray(e)?[...e]:[],a=e$(n);r.debug("PPP cutter2: Points before cutter2:",JSON.stringify(e),"endBounds:",a,b(a,e[e.length-1]));{let e=e$(t),a=e$(n),l=!!t?.isGroup,s=!!n?.isGroup,{candidate:d,centerApprox:u}=eY(o,t,"start"),{candidate:h,centerApprox:g}=eY(o,n,"end"),p=l&&b(e,d),c=s&&b(a,h);eF(o,"start",p&&u),eF(o,"end",c&&g),l&&!p&&(p=eH(o,e,"start")),s&&!c&&(c=eH(o,a,"end")),p||c?(p||eU(o,t,e,r),c||ej(o,n,a,r),r.debug("PPP cutter2: skipping cutter2 due to on-border group endpoint(s)",{skipStart:p,skipEnd:c,startCenterApprox:u,endCenterApprox:g,startCandidate:d,endCandidate:h}),i=o):i=eV(t,n,o,r)}if(r.debug("PPP cutter2: Points after cutter2:",JSON.stringify(i)),!Array.isArray(i)||i.length<2||eO(i)){r.warn("POI cutter2: Invalid points from cutter2, falling back to prevPoints",i);let e=o.filter(e=>Number.isFinite(e?.x)&&Number.isFinite(e?.y));i=e.length>=2?e:o}return r.debug("UIO cutter2: Points after cutter2 (sanitized):",i),eI(i,r)}function eO(e){return e?.some(e=>!Number.isFinite(e?.x)||!Number.isFinite(e?.y))}function eI(e,t){let n=e.filter((e,t,n)=>{if(0===t)return!0;let r=n[t-1];return Math.abs(e.x-r.x)>1e-6||Math.abs(e.y-r.y)>1e-6});return n.length!==e.length&&t.debug("UIO cutter2: removed consecutive duplicate points",{before:e,after:n}),n}function eA(e){return A(e.arrowTypeEnd)}function eL(e){return A(e.arrowTypeStart)}function eN(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[0],o=e[1],a=Math.hypot(o.x-i.x,o.y-i.y);if(a>=Math.max(8,2*n)||!b(t,o,1))return e;let l=[i,...e.slice(2)];return r.debug("UIO cutter2: removed short start marker segment",{before:e,after:l,markerOffset:n,segmentLength:a}),l}function ev(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[e.length-1],o=e[e.length-2],a=Math.hypot(i.x-o.x,i.y-o.y);if(a>=Math.max(8,2*n)||!b(t,o,1))return e;let l=[...e.slice(0,-2),i];return r.debug("UIO cutter2: removed short end marker segment",{before:e,after:l,markerOffset:n,segmentLength:a}),l}function eD(e,t){let n=e.edges.defaultInterpolate,r=e.edges.defaultStyle,i=t.getConfig();e.edges.forEach(e=>{let o=eC(e,{defaultStyle:r,defaultInterpolate:n,confCurve:i.curve},t);Object.assign(e,o)})}function eT(e){return void 0!==e.classes?e.classes:e.start&&e.end?`flowchart-link LS_${e.start} LE_${e.end}`:void 0}function e_(e,t,n){let r="normal",i="solid",o=[],a=[];return"dotted"===e?(i="dotted",o=["fill:none","stroke-width:2px","stroke-dasharray:3"]):"thick"===e?(r="thick",o=["stroke-width: 3.5px","fill:none"]):(o=t??["fill:none"],void 0!==n&&(a=n)),{thickness:r,pattern:i,style:o,labelStyle:a}}function eR(e,t,n){return void 0!==e?e:void 0!==t?t:n}function eC(e,t,n){let r={};r.minlen=e.minlen??e.length??1,r.text=e.text??e.label,r.arrowhead=e.arrowhead??("arrow_open"===e.type?"none":"normal");let i=L[e.type??"arrow_open"]??L.arrow_open;r.arrowTypeStart=e.arrowTypeStart??i[0],r.arrowTypeEnd=e.arrowTypeEnd??i[1],r.startLabelRight=e.startLabelRight,r.endLabelLeft=e.endLabelLeft;let o=e_(e.stroke,t.defaultStyle,t.defaultLabelStyle);r.thickness=e.thickness??o.thickness,r.pattern=e.pattern??o.pattern,r.style=e.style??o.style,r.labelStyle=e.labelStyle??o.labelStyle,r.classes=eT(e),r.curve=n.interpolateToCurve(eR(e.curve??e.interpolate,t.defaultInterpolate,t.confCurve),d.lUB);let a=(r.text??"")!=="";return void 0!==e.arrowheadStyle?r.arrowheadStyle=e.arrowheadStyle:(a||void 0!==e.style)&&(r.arrowheadStyle="fill: #333"),r.labelpos=e.labelpos??(a?"c":void 0),r.labelType=e.labelType,r.label=(e.label??r.text??"").replace(n.common.lineBreakRegex,"\n"),r}function eB(e){return Math.max(e.width??0,B(e))}function e$(e){let t=e?.isGroup?eB(e):e.width;return{x:e.offset.posX+e.width/2,y:e.offset.posY+e.height/2,width:t??0,height:e.height??0,padding:e.padding}}function eX(e,t,n=1e-6){return Math.abs(e-t)<n}function eG(e,t){return eX(e.x,t.x??0)&&eX(e.y,t.y??0)}function eY(e,t,n){if(!e?.length)return{candidate:{x:t.x??0,y:t.y??0},centerApprox:!0};if("start"===n){let n=e[0],r=eG(n,t);return{candidate:r&&e.length>1?e[1]:n,centerApprox:r}}{let n=e[e.length-1],r=eG(n,t);return{candidate:r&&e.length>1?e[e.length-2]:n,centerApprox:r}}}function eF(e,t,n){n&&("start"===t?e.length>0&&e.shift():e.length>0&&e.pop())}function eH(e,t,n){let r="start"===n?1:-1,i="start"===n?0:e.length-1,o=i;for(;i>=0&&i<e.length&&!k(t,e[i]);)i+=r;if(i===o||i<0||i>=e.length)return!1;let a=e[i],l=e[i-r],s=a.x-l.x,d=a.y-l.y,u=Math.min(0===s?1/0:(t.x+Math.sign(s)*t.width/2-l.x)/s,0===d?1/0:(t.y+Math.sign(d)*t.height/2-l.y)/d),h={x:l.x+u*s,y:l.y+u*d};return"start"===n?e.splice(0,i,h):e.splice(i+1,e.length-i-1,h),!0}function eU(e,t,n,r){let i=-1;for(let[t,r]of e.entries())if(k(n,r)){i=t;break}if(-1!==i){let o=O(t,n,e[i],e[0]);I(e,"start",o),r.debug("UIO cutter2: start-only intersection applied",{startIntersection:o})}}function ej(e,t,n,r){let i=-1;for(let t=e.length-1;t>=0;t--)if(k(n,e[t])){i=t;break}if(-1!==i){let o=O(t,n,e[i],e[e.length-1]);I(e,"end",o),r.debug("UIO cutter2: end-only intersection applied",{endIntersection:o})}}function eW(e,t,n,r,i){if(e?.isGroup)return null;let o=n[r],a=n[r+i];return o&&a?S(e,t,o,a):null}function eV(e,t,n,r){let i=e$(e),o=e$(t);if(0===n.length)return[];let a=[...n],l=a[0],s=a[a.length-1];r.debug("PPP cutter2: bounds",{startBounds:i,endBounds:o}),r.debug("PPP cutter2: original points",n);let d=-1;for(let[e,t]of a.entries())-1===d&&k(i,t)&&(d=e);if(-1!==d){let t=a[d],n=eW(e,i,a,d,1)??O(e,i,t,l);r.debug("UIO cutter2: start intersection",n),I(a,"start",n)}let u=null,h=-1;for(let e=a.length-1;e>=0;e--)if(k(o,a[e])){u=a[e],h=e;break}if(!u&&a.length>1&&(u=a[a.length-2],h=a.length-2),u){let e=eW(t,o,a,h,-1)??O(t,o,u,s);r.debug("UIO cutter2: end intersection",{endIntersection:e,outsideIndexForEnd:h}),I(a,"end",e)}if(a.length>1){let e=a[a.length-1],t=a[a.length-2],n=Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2);n<2&&(r.debug("UIO cutter2: trimming tail point (too close)",{distance:n,lastPoint:e,secondLastPoint:t}),a.pop())}return r.debug("UIO cutter2: final points",a),a}(0,s.K)(Q,"resolveElkPreset"),(0,s.K)(Z,"createRootElkGraph"),(0,s.K)(ee,"addSubGraphs"),(0,s.K)(et,"addVertices"),(0,s.K)(en,"addVertex"),(0,s.K)(er,"createElkNode"),(0,s.K)(ei,"getMeasuredLabelData"),(0,s.K)(eo,"addEdgesToElkGraph"),(0,s.K)(ea,"getEdgeStartEndPoint"),(0,s.K)(el,"configureSubgraphNodes"),(0,s.K)(es,"configureCrossHierarchyEdges"),(0,s.K)(ed,"setIncludeChildrenPolicy"),(0,s.K)(eu,"runElkLayout"),(0,s.K)(eh,"applyElkLayoutResult"),(0,s.K)(eg,"collectDescendantIds"),(0,s.K)(ep,"internalEdgePoints"),(0,s.K)(ec,"evenGroupFrames"),(0,s.K)(ef,"applyElkNodePositions"),(0,s.K)(ey,"axisOf"),(0,s.K)(ex,"straightenTerminalJogs"),(0,s.K)(eb,"straightenFront"),(0,s.K)(em,"segmentsCrossStrict"),(0,s.K)(ek,"crossingCount"),(0,s.K)(eE,"straightenEdgeTerminals"),(0,s.K)(ew,"applyElkEdgeLayout"),(0,s.K)(eM,"alignDegenerateNodeToAnchor"),(0,s.K)(eK,"createEdgePointsFromSection"),(0,s.K)(eP,"calcOffset"),(0,s.K)(eS,"sanitizeElkEdgePoints"),(0,s.K)(eO,"hasInvalidPoint"),(0,s.K)(eI,"dedupeConsecutivePoints"),(0,s.K)(eA,"getEndMarkerPathOffset"),(0,s.K)(eL,"getStartMarkerPathOffset"),(0,s.K)(eN,"ensureStartMarkerSegmentLength"),(0,s.K)(ev,"ensureEndMarkerSegmentLength"),(0,s.K)(eD,"applyElkEdgeRenderData"),(0,s.K)(eT,"buildFallbackEdgeClasses"),(0,s.K)(e_,"computeStroke"),(0,s.K)(eR,"getCurve"),(0,s.K)(eC,"buildEdgeData"),(0,s.K)(eB,"getEffectiveGroupWidth"),(0,s.K)(e$,"boundsFor"),(0,s.K)(eX,"approxEq"),(0,s.K)(eG,"isCenterApprox"),(0,s.K)(eY,"getCandidateBorderPoint"),(0,s.K)(eF,"dropAutoCenterPoint"),(0,s.K)(eH,"clipGroupEndpoint"),(0,s.K)(eU,"applyStartIntersectionIfNeeded"),(0,s.K)(ej,"applyEndIntersectionIfNeeded"),(0,s.K)(eW,"attachAlongDepartureAxis"),(0,s.K)(eV,"cutter2"),n.d(t,{render:()=>j})}}]);
@@ -0,0 +1,2 @@
1
+ /*! LICENSE: vy.bbe114c4e0.js.LICENSE.txt */
2
+ "use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["vy"],{Rc(e,t,r){r.d(t,{UsagePanel:()=>v});var n=r("j"),a=r("p"),i=r("n"),l=r("Mg"),s=r("hm"),o=r("TW"),c=r("H"),d=r("Go"),p=r("t3"),x=r("z"),u=r("oj");let m="usage-provider-listbox";function h(e){let{providers:t,value:r,onChange:a}=e,[i,l]=(0,c.J0)(!1),[o,h]=(0,c.J0)(""),[f,k]=(0,c.J0)(0),b=(0,c.li)(null),v=(0,c.li)(null),y=(0,c.li)(null),g=(0,c.li)([]),w=t.find(e=>e.id===r)??t[0],N=(0,c.Kr)(()=>{let e=o.trim().toLowerCase();return e?t.filter(t=>`${t.name} ${(0,s.R)(t)} ${t.hint}`.toLowerCase().includes(e)):t},[t,o]),D=()=>{let e=Math.max(0,t.findIndex(e=>e.id===r));h(""),k(e),l(!0)},Y=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];l(!1),h(""),e&&v.current?.focus()},F=e=>{a(e),Y(!0)};return(0,c.vJ)(()=>{i&&g.current[f]?.scrollIntoView({block:"nearest"})},[i,f]),(0,u.W)(b,()=>l(!1)),(0,n.FD)("div",{className:"relative min-w-0",ref:b,onKeyDown:e=>{let t=e.target===y.current;if(!i){("ArrowDown"===e.key||"Enter"===e.key||" "===e.key)&&(e.preventDefault(),D());return}switch(e.key){case"Escape":e.preventDefault(),Y(!0);break;case"ArrowDown":e.preventDefault(),k(e=>Math.max(0,Math.min(N.length-1,e+1)));break;case"ArrowUp":e.preventDefault(),k(e=>Math.max(0,e-1));break;case"Home":e.preventDefault(),k(0);break;case"End":e.preventDefault(),k(Math.max(0,N.length-1));break;case"Enter":e.preventDefault(),N[f]&&F(N[f].id);break;case" ":if(t)return;e.preventDefault(),N[f]&&F(N[f].id)}},children:[(0,n.FD)("button",{ref:v,type:"button",onClick:()=>i?Y():D(),"aria-haspopup":"listbox","aria-expanded":i,"aria-controls":m,title:"Select usage provider",className:"flex w-full min-w-0 items-center justify-between gap-2 bg-paper border border-ink/15 rounded-lg px-3 py-1.5 text-xs text-ink hover:bg-ink/5 transition-colors",children:[(0,n.FD)("span",{className:"flex min-w-0 items-baseline gap-2",children:[(0,n.Y)("span",{className:"truncate font-medium",children:w?.name??"Select provider"}),w&&(0,n.Y)("span",{className:"truncate text-[10px] text-ink/50",children:(0,s.R)(w)})]}),(0,n.Y)(d.A,{size:12,className:`flex-shrink-0 text-ink/40 transition-transform ${i?"rotate-180":""}`})]}),i&&(0,n.FD)("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[(0,n.FD)("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center gap-1.5",children:[(0,n.Y)(p.A,{size:11,className:"text-ink/40 flex-shrink-0"}),(0,n.Y)("input",{ref:y,type:"text",value:o,onChange:e=>{h(e.currentTarget.value),k(0)},placeholder:"Search providers...",title:"Search providers",className:"w-full min-w-0 bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),o&&(0,n.Y)("button",{type:"button",onClick:()=>{h(""),k(0),y.current?.focus()},title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"})]}),(0,n.Y)("div",{id:m,role:"listbox","aria-label":"Usage providers",className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:0===N.length?(0,n.Y)("div",{className:"px-3 py-2 text-ink/40 italic",children:"No providers found"}):N.map((e,t)=>(0,n.FD)("button",{ref:e=>{g.current[t]=e},type:"button",role:"option","aria-selected":e.id===r,onClick:()=>F(e.id),onMouseEnter:()=>k(t),title:e.hint,className:`w-full text-left px-3 py-2 flex items-center justify-between gap-2 transition-colors ${t===f?"bg-ink/5":"hover:bg-ink/5"}`,children:[(0,n.FD)("span",{className:"min-w-0",children:[(0,n.Y)("span",{className:"block truncate font-medium text-ink",children:e.name}),(0,n.FD)("span",{className:"block truncate text-[10px] text-ink/50",children:[(0,s.R)(e)," · ",e.hint]})]}),e.id===r&&(0,n.Y)(x.A,{size:12,className:"flex-shrink-0 text-ink"})]},e.id))})]})]})}var f=r("uY"),k=r("FL"),b=r("Af");function v(e){let{className:t="",active:r=!0}=e,{report:c,isLoading:d,error:p,reload:x}=(0,f.N)(),[u,m]=(0,k.bL)("usage.selectedProviderId","kenari");if((0,b.n)(()=>x({silent:!0}),r),p&&!c)return(0,n.FD)("div",{className:`flex h-full w-full flex-col items-center justify-center gap-2 p-8 text-center text-xs ${t}`,children:[(0,n.Y)(a.A,{size:16,className:"text-error"}),(0,n.Y)("p",{className:"text-error text-xs",children:p}),(0,n.Y)("button",{type:"button",onClick:()=>x(),className:"text-[11px] font-semibold text-ink/70 hover:text-ink underline underline-offset-2",children:"Try again"})]});if(!c)return(0,n.Y)("div",{className:`flex h-full w-full items-center justify-center text-ink/40 text-xs ${t}`,children:"Loading provider usage..."});let v=(0,s.T)(c);return(0,n.FD)("div",{className:`flex h-full w-full min-w-0 min-h-0 flex-col overflow-hidden bg-paper text-xs text-ink ${t}`,children:[(0,n.FD)("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex items-center justify-between gap-3 flex-shrink-0 min-w-0",children:[(0,n.FD)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.Y)("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Usage"}),(0,n.FD)("span",{className:"text-[11px] text-ink/50 truncate",children:["Updated ",(0,o.r6)(c.generatedAt)]}),c.isMock&&(0,n.Y)("span",{className:"text-[10px] font-mono uppercase tracking-wider bg-ink/5 border border-ink/15 rounded px-1.5 py-0.5 text-ink/60",children:"Mock"})]}),(0,n.Y)("button",{type:"button",onClick:()=>x(),disabled:d,className:"p-1.5 bg-paper border border-ink/15 rounded-md hover:bg-ink/5 text-ink/80 transition-colors disabled:opacity-50 flex-shrink-0",title:"Refresh usage",children:(0,n.Y)(i.A,{size:12,className:d?"animate-spin text-ink":""})})]}),(0,n.Y)("div",{className:"px-3.5 py-2.5 border-b border-ink/10 flex-shrink-0 min-w-0",children:(0,n.FD)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.Y)("span",{className:"text-[11px] font-semibold text-ink/60 flex-shrink-0",children:"Provider"}),(0,n.Y)(h,{providers:v,value:u,onChange:m})]})}),(0,n.FD)("div",{className:"flex-1 min-w-0 min-h-0 w-full overflow-y-auto scrollbar-overlay-container scrollbar-overlay-static p-3.5 space-y-4",children:[p&&(0,n.Y)("p",{className:"text-error text-xs",children:p}),(0,n.Y)(l.H,{providerId:u,report:c})]})]})}},SU(e,t,r){let n=(0,r("y").A)({name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]});r.d(t,{},{A:n})},Rm(e,t,r){let n=(0,r("y").A)({name:"ticket",size:24,node:[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]});r.d(t,{},{A:n})}}]);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license lucide-preact v1.47.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */