@thxgg/steward 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Bc2V3wPK.js → B2ow85x_.js} +2 -2
  3. package/.output/public/_nuxt/{U78rMDmo.js → B6CbIr08.js} +1 -1
  4. package/.output/public/_nuxt/{BknRrWsw.js → BLQAF8wp.js} +1 -1
  5. package/.output/public/_nuxt/BXuwtOqb.js +1 -0
  6. package/.output/public/_nuxt/CAMiEhze.js +1 -0
  7. package/.output/public/_nuxt/{BRQ9Cxaw.js → CIBCqZF5.js} +1 -1
  8. package/.output/public/_nuxt/Ce0-nlm9.js +1 -0
  9. package/.output/public/_nuxt/{T11EuTtn.js → ConzneVY.js} +1 -1
  10. package/.output/public/_nuxt/D0qxz_Pn.js +1310 -0
  11. package/.output/public/_nuxt/D3PDtLSF.js +3 -0
  12. package/.output/public/_nuxt/{C73kduX-.js → DdKC0UAK.js} +1 -1
  13. package/.output/public/_nuxt/Detail.BGdvrJGh.css +1 -0
  14. package/.output/public/_nuxt/{C53_p0K1.js → Dkh9ic1y.js} +1 -1
  15. package/.output/public/_nuxt/LEjJTR7-.js +1 -0
  16. package/.output/public/_nuxt/{BTmXUZ_s.js → UqZfMfrZ.js} +1 -1
  17. package/.output/public/_nuxt/builds/latest.json +1 -1
  18. package/.output/public/_nuxt/builds/meta/25438e34-19a2-421d-aede-53fd18f1ccd4.json +1 -0
  19. package/.output/public/_nuxt/dckrK0oj.js +1 -0
  20. package/.output/public/_nuxt/entry.DT4p6_uW.css +1 -0
  21. package/.output/public/_nuxt/pIWeVmPw.js +1 -0
  22. package/.output/public/_nuxt/xrHaPo1U.js +60 -0
  23. package/.output/server/chunks/build/{Detail-DMMUwTWr.mjs → Detail-rpcemNXe.mjs} +674 -481
  24. package/.output/server/chunks/build/Detail-rpcemNXe.mjs.map +1 -0
  25. package/.output/server/chunks/build/DiffViewer-styles.B1FB5NJj.mjs +8 -0
  26. package/.output/server/chunks/build/DiffViewer-styles.B1FB5NJj.mjs.map +1 -0
  27. package/.output/server/chunks/build/{_prd_-ByugK4Yi.mjs → _prd_-CeibvZOH.mjs} +67 -233
  28. package/.output/server/chunks/build/_prd_-CeibvZOH.mjs.map +1 -0
  29. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  30. package/.output/server/chunks/build/{default-BKKgG7HJ.mjs → default-iq8SaDDN.mjs} +3 -3
  31. package/.output/server/chunks/build/default-iq8SaDDN.mjs.map +1 -0
  32. package/.output/server/chunks/build/{error-404-Bf6kdO80.mjs → error-404-DFale9A5.mjs} +2 -2
  33. package/.output/server/chunks/build/error-404-DFale9A5.mjs.map +1 -0
  34. package/.output/server/chunks/build/{index-DE1tjHAd.mjs → index-Po00RvHm.mjs} +2 -2
  35. package/.output/server/chunks/build/index-Po00RvHm.mjs.map +1 -0
  36. package/.output/server/chunks/build/{nuxt-link-SvT1nf8Z.mjs → nuxt-link-B4oWFn7n.mjs} +2 -2
  37. package/.output/server/chunks/build/nuxt-link-B4oWFn7n.mjs.map +1 -0
  38. package/.output/server/chunks/build/{repo-graph-DzT45gSB.mjs → repo-graph-BQVFpA-w.mjs} +5 -4
  39. package/.output/server/chunks/build/repo-graph-BQVFpA-w.mjs.map +1 -0
  40. package/.output/server/chunks/build/server.mjs +7 -7
  41. package/.output/server/chunks/build/styles.mjs +4 -5
  42. package/.output/server/chunks/build/{usePrd-hXZOmvAv.mjs → usePrd-Bb6jlnNZ.mjs} +2 -2
  43. package/.output/server/chunks/build/usePrd-Bb6jlnNZ.mjs.map +1 -0
  44. package/.output/server/chunks/nitro/nitro.mjs +663 -660
  45. package/.output/server/node_modules/@pierre/diffs/dist/components/File.js +324 -0
  46. package/.output/server/node_modules/@pierre/diffs/dist/components/FileDiff.js +395 -0
  47. package/.output/server/node_modules/@pierre/diffs/dist/components/FileStream.js +161 -0
  48. package/.output/server/node_modules/@pierre/diffs/dist/components/web-components.js +25 -0
  49. package/.output/server/node_modules/@pierre/diffs/dist/constants.js +23 -0
  50. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.js +11 -0
  51. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.js +20 -0
  52. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/cleanUpResolvedLanguages.js +11 -0
  53. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/constants.js +8 -0
  54. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.js +16 -0
  55. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.js +11 -0
  56. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.js +11 -0
  57. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.js +30 -0
  58. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.js +25 -0
  59. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.js +71 -0
  60. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.js +12 -0
  61. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.js +24 -0
  62. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/cleanUpResolvedThemes.js +11 -0
  63. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/constants.js +9 -0
  64. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.js +11 -0
  65. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.js +16 -0
  66. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.js +11 -0
  67. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomCSSVariableTheme.js +18 -0
  68. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.js +14 -0
  69. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.js +35 -0
  70. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.js +21 -0
  71. package/.output/server/node_modules/@pierre/diffs/dist/index.js +84 -0
  72. package/.output/server/node_modules/@pierre/diffs/dist/managers/LineSelectionManager.js +282 -0
  73. package/.output/server/node_modules/@pierre/diffs/dist/managers/MouseEventManager.js +244 -0
  74. package/.output/server/node_modules/@pierre/diffs/dist/managers/ResizeManager.js +132 -0
  75. package/.output/server/node_modules/@pierre/diffs/dist/managers/ScrollSyncManager.js +62 -0
  76. package/.output/server/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.js +32 -0
  77. package/.output/server/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +655 -0
  78. package/.output/server/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +243 -0
  79. package/.output/server/node_modules/@pierre/diffs/dist/shiki-stream/stream.js +32 -0
  80. package/.output/server/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.js +71 -0
  81. package/.output/server/node_modules/@pierre/diffs/dist/sprite.js +55 -0
  82. package/.output/server/node_modules/@pierre/diffs/dist/style.js +6 -0
  83. package/.output/server/node_modules/@pierre/diffs/dist/themes/pierre-dark.js +1328 -0
  84. package/.output/server/node_modules/@pierre/diffs/dist/themes/pierre-light.js +1328 -0
  85. package/.output/server/node_modules/@pierre/diffs/dist/utils/areFilesEqual.js +8 -0
  86. package/.output/server/node_modules/@pierre/diffs/dist/utils/areObjectsEqual.js +18 -0
  87. package/.output/server/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.js +12 -0
  88. package/.output/server/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.js +8 -0
  89. package/.output/server/node_modules/@pierre/diffs/dist/utils/areThemesEqual.js +9 -0
  90. package/.output/server/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js +8 -0
  91. package/.output/server/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.js +21 -0
  92. package/.output/server/node_modules/@pierre/diffs/dist/utils/createAnnotationWrapperNode.js +12 -0
  93. package/.output/server/node_modules/@pierre/diffs/dist/utils/createCodeNode.js +12 -0
  94. package/.output/server/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.js +16 -0
  95. package/.output/server/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.js +84 -0
  96. package/.output/server/node_modules/@pierre/diffs/dist/utils/createHoverContentNode.js +15 -0
  97. package/.output/server/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.js +24 -0
  98. package/.output/server/node_modules/@pierre/diffs/dist/utils/createPreElement.js +28 -0
  99. package/.output/server/node_modules/@pierre/diffs/dist/utils/createRowNodes.js +20 -0
  100. package/.output/server/node_modules/@pierre/diffs/dist/utils/createSeparator.js +69 -0
  101. package/.output/server/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js +13 -0
  102. package/.output/server/node_modules/@pierre/diffs/dist/utils/createStyleElement.js +19 -0
  103. package/.output/server/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.js +56 -0
  104. package/.output/server/node_modules/@pierre/diffs/dist/utils/createUnsafeCSSStyleNode.js +12 -0
  105. package/.output/server/node_modules/@pierre/diffs/dist/utils/cssWrappers.js +21 -0
  106. package/.output/server/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.js +82 -0
  107. package/.output/server/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.js +8 -0
  108. package/.output/server/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js +343 -0
  109. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js +13 -0
  110. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.js +40 -0
  111. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.js +8 -0
  112. package/.output/server/node_modules/@pierre/diffs/dist/utils/getIconForType.js +15 -0
  113. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.js +8 -0
  114. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineEndingType.js +11 -0
  115. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineNodes.js +15 -0
  116. package/.output/server/node_modules/@pierre/diffs/dist/utils/getSingularPatch.js +20 -0
  117. package/.output/server/node_modules/@pierre/diffs/dist/utils/getThemes.js +16 -0
  118. package/.output/server/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.js +10 -0
  119. package/.output/server/node_modules/@pierre/diffs/dist/utils/hast_utils.js +42 -0
  120. package/.output/server/node_modules/@pierre/diffs/dist/utils/isWorkerContext.js +8 -0
  121. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.js +34 -0
  122. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +23 -0
  123. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseLineType.js +17 -0
  124. package/.output/server/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +211 -0
  125. package/.output/server/node_modules/@pierre/diffs/dist/utils/prerenderHTMLIfNecessary.js +10 -0
  126. package/.output/server/node_modules/@pierre/diffs/dist/utils/processLine.js +42 -0
  127. package/.output/server/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js +339 -0
  128. package/.output/server/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js +52 -0
  129. package/.output/server/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.js +11 -0
  130. package/.output/server/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js +29 -0
  131. package/.output/server/node_modules/@pierre/diffs/package.json +89 -0
  132. package/.output/server/node_modules/@shikijs/transformers/dist/index.mjs +831 -0
  133. package/.output/server/node_modules/@shikijs/transformers/package.json +37 -0
  134. package/.output/server/node_modules/diff/libesm/convert/dmp.js +21 -0
  135. package/.output/server/node_modules/diff/libesm/convert/xml.js +31 -0
  136. package/.output/server/node_modules/diff/libesm/diff/array.js +16 -0
  137. package/.output/server/node_modules/diff/libesm/diff/base.js +253 -0
  138. package/.output/server/node_modules/diff/libesm/diff/character.js +7 -0
  139. package/.output/server/node_modules/diff/libesm/diff/css.js +10 -0
  140. package/.output/server/node_modules/diff/libesm/diff/json.js +78 -0
  141. package/.output/server/node_modules/diff/libesm/diff/line.js +65 -0
  142. package/.output/server/node_modules/diff/libesm/diff/sentence.js +43 -0
  143. package/.output/server/node_modules/diff/libesm/diff/word.js +296 -0
  144. package/.output/server/node_modules/diff/libesm/index.js +30 -0
  145. package/.output/server/node_modules/diff/libesm/package.json +1 -0
  146. package/.output/server/node_modules/diff/libesm/patch/apply.js +257 -0
  147. package/.output/server/node_modules/diff/libesm/patch/create.js +228 -0
  148. package/.output/server/node_modules/diff/libesm/patch/line-endings.js +44 -0
  149. package/.output/server/node_modules/diff/libesm/patch/parse.js +147 -0
  150. package/.output/server/node_modules/diff/libesm/patch/reverse.js +23 -0
  151. package/.output/server/node_modules/diff/libesm/util/distance-iterator.js +37 -0
  152. package/.output/server/node_modules/diff/libesm/util/params.js +14 -0
  153. package/.output/server/node_modules/diff/libesm/util/string.js +128 -0
  154. package/.output/server/node_modules/diff/package.json +132 -0
  155. package/.output/server/package.json +4 -1
  156. package/dist/server/utils/git.js +8 -6
  157. package/package.json +2 -1
  158. package/.output/public/_nuxt/6tINjQEd.js +0 -141
  159. package/.output/public/_nuxt/B2mIQf5X.js +0 -3
  160. package/.output/public/_nuxt/C0BBSDJ7.js +0 -1
  161. package/.output/public/_nuxt/CN46Bgts.js +0 -1
  162. package/.output/public/_nuxt/CTJgb0zb.js +0 -1
  163. package/.output/public/_nuxt/Cce168lk.js +0 -30
  164. package/.output/public/_nuxt/CyVSeLw5.js +0 -1
  165. package/.output/public/_nuxt/Detail.CYc96mGf.css +0 -1
  166. package/.output/public/_nuxt/ZNypZshD.js +0 -13
  167. package/.output/public/_nuxt/builds/meta/9ce7f1bc-d5e2-47bf-8026-f4910c257b2e.json +0 -1
  168. package/.output/public/_nuxt/entry.Bw0CE6Iz.css +0 -1
  169. package/.output/public/_nuxt/pYJYAY-W.js +0 -60
  170. package/.output/server/chunks/build/Detail-DMMUwTWr.mjs.map +0 -1
  171. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-d2dQvARr.mjs +0 -4
  172. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-d2dQvARr.mjs.map +0 -1
  173. package/.output/server/chunks/build/DiffViewer-styles-2.mjs-X6QKNjM0.mjs +0 -4
  174. package/.output/server/chunks/build/DiffViewer-styles-2.mjs-X6QKNjM0.mjs.map +0 -1
  175. package/.output/server/chunks/build/DiffViewer-styles.0AbHFl6N.mjs +0 -8
  176. package/.output/server/chunks/build/DiffViewer-styles.0AbHFl6N.mjs.map +0 -1
  177. package/.output/server/chunks/build/DiffViewer-styles.BDwAqkTk.mjs +0 -8
  178. package/.output/server/chunks/build/DiffViewer-styles.BDwAqkTk.mjs.map +0 -1
  179. package/.output/server/chunks/build/DiffViewer-styles.DRJh5Ui4.mjs +0 -10
  180. package/.output/server/chunks/build/DiffViewer-styles.DRJh5Ui4.mjs.map +0 -1
  181. package/.output/server/chunks/build/_prd_-ByugK4Yi.mjs.map +0 -1
  182. package/.output/server/chunks/build/default-BKKgG7HJ.mjs.map +0 -1
  183. package/.output/server/chunks/build/error-404-Bf6kdO80.mjs.map +0 -1
  184. package/.output/server/chunks/build/index-DE1tjHAd.mjs.map +0 -1
  185. package/.output/server/chunks/build/nuxt-link-SvT1nf8Z.mjs.map +0 -1
  186. package/.output/server/chunks/build/repo-graph-DzT45gSB.mjs.map +0 -1
  187. package/.output/server/chunks/build/usePrd-hXZOmvAv.mjs.map +0 -1
@@ -1,30 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./6tINjQEd.js","./ZNypZshD.js","./Bc2V3wPK.js","./entry.Bw0CE6Iz.css"])))=>i.map(i=>d[i]);
2
- import{c as Te,f as Sa,t as Ca,g as Na,h as $a,P as uo,i as Ma,j as Gi,d as Pa,k as Ir,l as Ta,B as xt,r as ji,e as Yi,b as Oa,F as Ia}from"./CN46Bgts.js";import{N as Ho,q as ce,z as je,s as ne,g as ve,y as be,O as Wi,o as Y,x as we,w as fe,l as S,c as ee,L as He,k as _e,P as cr,Q as dn,R as Rt,C as dt,b as oe,E as Be,S as Da,J as co,K as fo,v as Xi,d as Se,t as he,p as Aa,I as qe,T as za,U as Ra,A as dr,i as nn,V as Ui,H as Ae,W as Ba,a as K,F as Me,r as Ge,B as pt,D as Ki,X as La,n as ge,Y as $e,Z as on,_ as Xt,$ as Ce,a0 as Ee,a1 as Va,m as fr,a2 as Fa,a3 as Ha,a4 as qt,a5 as qa,a6 as Zi,a7 as Ga,a8 as ja,a9 as Ya,aa as Wa,ab as Xa}from"./Bc2V3wPK.js";import{c as ho,b as Ze,V as Ua,D as Ka,e as Za,d as hr,P as Ja,T as Qa,a as el,f as Ut,L as qo,C as Yn,G as tl,g as nl,R as Dr,K as ol,S as rl,h as il,B as Vn,i as sl,j as al,k as ll,l as ul,m as cl,n as dl,o as fl,p as hl,q as pl}from"./B2mIQf5X.js";import{A as Ar}from"./C53_p0K1.js";import{_ as gl}from"./DlAUqK2U.js";import{_ as vl}from"./CTJgb0zb.js";const ml=Te("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const yl=Te("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const Wn=Te("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const fn=Te("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Ji=Te("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const wl=Te("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const _l=Te("diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const bl=Te("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const xl=Te("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);const El=Te("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);const kl=Te("file-exclamation-point",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Sl=Te("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const Cl=Te("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);const Nl=Te("file-x",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);const $l=Te("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);const Ml=Te("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);const Pl=Te("link-2-off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);const Tl=Te("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const Ol=Te("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const Il=Te("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const Dl=Te("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Al=Te("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const zl=Te("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);function Rl(e,t){const n=Sa(!1,300);Ca(()=>{n.value=!1});const o=ce(null),r=Na();function i(){o.value=null,n.value=!1}function s(a,l){const c=a.currentTarget,u={x:a.clientX,y:a.clientY},d=Bl(u,c.getBoundingClientRect()),h=Ll(u,d,1),f=Vl(l.getBoundingClientRect()),y=Hl([...h,...f]);o.value=y,n.value=!0}return Ho(a=>{if(e.value&&t.value){const l=u=>s(u,t.value),c=u=>s(u,e.value);e.value.addEventListener("pointerleave",l),t.value.addEventListener("pointerleave",c),a(()=>{e.value?.removeEventListener("pointerleave",l),t.value?.removeEventListener("pointerleave",c)})}}),Ho(a=>{if(o.value){const l=c=>{if(!o.value||!(c.target instanceof Element))return;const u=c.target,d={x:c.clientX,y:c.clientY},h=e.value?.contains(u)||t.value?.contains(u),f=!Fl(d,o.value),y=!!u.closest("[data-grace-area-trigger]");h?i():(f||y)&&(i(),r.trigger())};e.value?.ownerDocument.addEventListener("pointermove",l),a(()=>e.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function Bl(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Ll(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Vl(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Fl(e,t){const{x:n,y:o}=e;let r=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>o!=u>o&&n<(c-a)*(o-l)/(u-l)+a&&(r=!r)}return r}function Hl(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),ql(t)}function ql(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(r.y-s.y)>=(i.y-s.y)*(r.x-s.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}function Gl(e){const t=ce(),n=ne(()=>t.value?.width??0),o=ne(()=>t.value?.height??0);return je(()=>{const r=$a(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;l=d.inlineSize,c=d.blockSize}else l=r.offsetWidth,c=r.offsetHeight;t.value={width:l,height:c}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else t.value=void 0}),{width:n,height:o}}const[Qi,jl]=ho("PopperRoot");var Yl=ve({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=ce();return jl({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>be(n.$slots,"default")}}),Wl=Yl,Xl=ve({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:o}=Ze(),r=Qi();return Wi(()=>{r.onAnchorChange(t.reference??o.value)}),(i,s)=>(Y(),we(S(uo),{ref:S(n),as:i.as,"as-child":i.asChild},{default:fe(()=>[be(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),Ul=Xl;const Kl={key:0,d:"M0 0L6 6L12 0"},Zl={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var Jl=ve({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return Ze(),(n,o)=>(Y(),we(S(uo),He(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 12 6",preserveAspectRatio:n.asChild?void 0:"none"}),{default:fe(()=>[be(n.$slots,"default",{},()=>[n.rounded?(Y(),ee("path",Zl)):(Y(),ee("path",Kl))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Ql=Jl;function eu(e){return e!==null}function tu(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=Go(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+l/2;let y="",E="";return c==="bottom"?(y=s?d:`${h}px`,E=`${-l}px`):c==="top"?(y=s?d:`${h}px`,E=`${o.floating.height+l}px`):c==="right"?(y=`${-l}px`,E=s?d:`${f}px`):c==="left"&&(y=`${o.floating.width+l}px`,E=s?d:`${f}px`),{data:{x:y,y:E}}}}}function Go(e){const[t,n="center"]=e.split("-");return[t,n]}const nu=["top","right","bottom","left"],Et=Math.min,Le=Math.max,Xn=Math.round,Mn=Math.floor,rt=e=>({x:e,y:e}),ou={left:"right",right:"left",bottom:"top",top:"bottom"},ru={start:"end",end:"start"};function jo(e,t,n){return Le(e,Et(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function vt(e){return e.split("-")[0]}function rn(e){return e.split("-")[1]}function pr(e){return e==="x"?"y":"x"}function gr(e){return e==="y"?"height":"width"}const iu=new Set(["top","bottom"]);function ot(e){return iu.has(vt(e))?"y":"x"}function vr(e){return pr(ot(e))}function su(e,t,n){n===void 0&&(n=!1);const o=rn(e),r=vr(e),i=gr(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Un(s)),[s,Un(s)]}function au(e){const t=Un(e);return[Yo(e),t,Yo(t)]}function Yo(e){return e.replace(/start|end/g,t=>ru[t])}const zr=["left","right"],Rr=["right","left"],lu=["top","bottom"],uu=["bottom","top"];function cu(e,t,n){switch(e){case"top":case"bottom":return n?t?Rr:zr:t?zr:Rr;case"left":case"right":return t?lu:uu;default:return[]}}function du(e,t,n,o){const r=rn(e);let i=cu(vt(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Yo)))),i}function Un(e){return e.replace(/left|right|bottom|top/g,t=>ou[t])}function fu(e){return{top:0,right:0,bottom:0,left:0,...e}}function es(e){return typeof e!="number"?fu(e):{top:e,right:e,bottom:e,left:e}}function Kn(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Br(e,t,n){let{reference:o,floating:r}=e;const i=ot(t),s=vr(t),a=gr(s),l=vt(t),c=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[a]/2-r[a]/2;let f;switch(l){case"top":f={x:u,y:o.y-r.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-r.width,y:d};break;default:f={x:o.x,y:o.y}}switch(rn(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1);break}return f}async function hu(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=gt(t,e),y=es(f),m=a[h?d==="floating"?"reference":"floating":d],x=Kn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,p=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),g=await(i.isElement==null?void 0:i.isElement(p))?await(i.getScale==null?void 0:i.getScale(p))||{x:1,y:1}:{x:1,y:1},M=Kn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:p,strategy:l}):w);return{top:(x.top-M.top+y.top)/g.y,bottom:(M.bottom-x.bottom+y.bottom)/g.y,left:(x.left-M.left+y.left)/g.x,right:(M.right-x.right+y.right)/g.x}}const pu=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=Br(c,o,l),h=o,f={},y=0;for(let m=0;m<a.length;m++){var E;const{name:x,fn:w}=a[m],{x:p,y:g,data:M,reset:R}=await w({x:u,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:f,rects:c,platform:{...s,detectOverflow:(E=s.detectOverflow)!=null?E:hu},elements:{reference:e,floating:t}});u=p??u,d=g??d,f={...f,[x]:{...f[x],...M}},R&&y<=50&&(y++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(c=R.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:u,y:d}=Br(c,h,l)),m=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:f}},gu=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=gt(e,t)||{};if(c==null)return{};const d=es(u),h={x:n,y:o},f=vr(r),y=gr(f),E=await s.getDimensions(c),m=f==="y",x=m?"top":"left",w=m?"bottom":"right",p=m?"clientHeight":"clientWidth",g=i.reference[y]+i.reference[f]-h[f]-i.floating[y],M=h[f]-i.reference[f],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let F=R?R[p]:0;(!F||!await(s.isElement==null?void 0:s.isElement(R)))&&(F=a.floating[p]||i.floating[y]);const H=g/2-M/2,J=F/2-E[y]/2-1,A=Et(d[x],J),z=Et(d[w],J),k=A,V=F-E[y]-z,v=F/2-E[y]/2+H,$=jo(k,v,V),_=!l.arrow&&rn(r)!=null&&v!==$&&i.reference[y]/2-(v<k?A:z)-E[y]/2<0,C=_?v<k?v-k:v-V:0;return{[f]:h[f]+C,data:{[f]:$,centerOffset:v-$-C,..._&&{alignmentOffset:C}},reset:_}}}),vu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:E=!0,...m}=gt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=vt(r),w=ot(a),p=vt(a)===a,g=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=h||(p||!E?[Un(a)]:au(a)),R=y!=="none";!h&&R&&M.push(...du(a,E,y,g));const F=[a,...M],H=await l.detectOverflow(t,m),J=[];let A=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&J.push(H[x]),d){const v=su(r,s,g);J.push(H[v[0]],H[v[1]])}if(A=[...A,{placement:r,overflows:J}],!J.every(v=>v<=0)){var z,k;const v=(((z=i.flip)==null?void 0:z.index)||0)+1,$=F[v];if($&&(!(d==="alignment"?w!==ot($):!1)||A.every(N=>ot(N.placement)===w?N.overflows[0]>0:!0)))return{data:{index:v,overflows:A},reset:{placement:$}};let _=(k=A.filter(C=>C.overflows[0]<=0).sort((C,N)=>C.overflows[1]-N.overflows[1])[0])==null?void 0:k.placement;if(!_)switch(f){case"bestFit":{var V;const C=(V=A.filter(N=>{if(R){const O=ot(N.placement);return O===w||O==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(O=>O>0).reduce((O,L)=>O+L,0)]).sort((N,O)=>N[1]-O[1])[0])==null?void 0:V[0];C&&(_=C);break}case"initialPlacement":_=a;break}if(r!==_)return{reset:{placement:_}}}return{}}}};function Lr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vr(e){return nu.some(t=>e[t]>=0)}const mu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=gt(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),a=Lr(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Vr(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=Lr(s,n.floating);return{data:{escapedOffsets:a,escaped:Vr(a)}}}default:return{}}}}},ts=new Set(["left","top"]);async function yu(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=vt(n),a=rn(n),l=ot(n)==="y",c=ts.has(s)?-1:1,u=i&&l?-1:1,d=gt(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(f=a==="end"?y*-1:y),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const wu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await yu(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},_u=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:w,y:p}=x;return{x:w,y:p}}},...c}=gt(e,t),u={x:n,y:o},d=await i.detectOverflow(t,c),h=ot(vt(r)),f=pr(h);let y=u[f],E=u[h];if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",p=y+d[x],g=y-d[w];y=jo(p,y,g)}if(a){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",p=E+d[x],g=E-d[w];E=jo(p,E,g)}const m=l.fn({...t,[f]:y,[h]:E});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[f]:s,[h]:a}}}}}},bu=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=gt(e,t),u={x:n,y:o},d=ot(r),h=pr(d);let f=u[h],y=u[d];const E=gt(a,t),m=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(l){const p=h==="y"?"height":"width",g=i.reference[h]-i.floating[p]+m.mainAxis,M=i.reference[h]+i.reference[p]-m.mainAxis;f<g?f=g:f>M&&(f=M)}if(c){var x,w;const p=h==="y"?"width":"height",g=ts.has(vt(r)),M=i.reference[d]-i.floating[p]+(g&&((x=s.offset)==null?void 0:x[d])||0)+(g?0:m.crossAxis),R=i.reference[d]+i.reference[p]+(g?0:((w=s.offset)==null?void 0:w[d])||0)-(g?m.crossAxis:0);y<M?y=M:y>R&&(y=R)}return{[h]:f,[d]:y}}}},xu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=gt(e,t),u=await s.detectOverflow(t,c),d=vt(r),h=rn(r),f=ot(r)==="y",{width:y,height:E}=i.floating;let m,x;d==="top"||d==="bottom"?(m=d,x=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,m=h==="end"?"top":"bottom");const w=E-u.top-u.bottom,p=y-u.left-u.right,g=Et(E-u[m],w),M=Et(y-u[x],p),R=!t.middlewareData.shift;let F=g,H=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=p),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(F=w),R&&!h){const A=Le(u.left,0),z=Le(u.right,0),k=Le(u.top,0),V=Le(u.bottom,0);f?H=y-2*(A!==0||z!==0?A+z:Le(u.left,u.right)):F=E-2*(k!==0||V!==0?k+V:Le(u.top,u.bottom))}await l({...t,availableWidth:H,availableHeight:F});const J=await s.getDimensions(a.floating);return y!==J.width||E!==J.height?{reset:{rects:!0}}:{}}}};function po(){return typeof window<"u"}function zt(e){return mr(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function at(e){var t;return(t=(mr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mr(e){return po()?e instanceof Node||e instanceof Ve(e).Node:!1}function Xe(e){return po()?e instanceof Element||e instanceof Ve(e).Element:!1}function st(e){return po()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function Fr(e){return!po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}const Eu=new Set(["inline","contents"]);function Sn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ue(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Eu.has(r)}const ku=new Set(["table","td","th"]);function Su(e){return ku.has(zt(e))}const Cu=[":popover-open",":modal"];function go(e){return Cu.some(t=>{try{return e.matches(t)}catch{return!1}})}const Nu=["transform","translate","scale","rotate","perspective"],$u=["transform","translate","scale","rotate","perspective","filter"],Mu=["paint","layout","strict","content"];function yr(e){const t=wr(),n=Xe(e)?Ue(e):e;return Nu.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$u.some(o=>(n.willChange||"").includes(o))||Mu.some(o=>(n.contain||"").includes(o))}function Pu(e){let t=kt(e);for(;st(t)&&!Kt(t);){if(yr(t))return t;if(go(t))return null;t=kt(t)}return null}function wr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Tu=new Set(["html","body","#document"]);function Kt(e){return Tu.has(zt(e))}function Ue(e){return Ve(e).getComputedStyle(e)}function vo(e){return Xe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(zt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fr(e)&&e.host||at(e);return Fr(t)?t.host:t}function ns(e){const t=kt(e);return Kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&Sn(t)?t:ns(t)}function vn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=ns(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Ve(r);if(i){const a=Wo(s);return t.concat(s,s.visualViewport||[],Sn(r)?r:[],a&&n?vn(a):[])}return t.concat(r,vn(r,[],n))}function Wo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function os(e){const t=Ue(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=st(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Xn(n)!==i||Xn(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function _r(e){return Xe(e)?e:e.contextElement}function Gt(e){const t=_r(e);if(!st(t))return rt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=os(t);let s=(i?Xn(n.width):n.width)/o,a=(i?Xn(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Ou=rt(0);function rs(e){const t=Ve(e);return!wr()||!t.visualViewport?Ou:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Iu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function Ot(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=_r(e);let s=rt(1);t&&(o?Xe(o)&&(s=Gt(o)):s=Gt(e));const a=Iu(i,n,o)?rs(i):rt(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const h=Ve(i),f=o&&Xe(o)?Ve(o):o;let y=h,E=Wo(y);for(;E&&o&&f!==y;){const m=Gt(E),x=E.getBoundingClientRect(),w=Ue(E),p=x.left+(E.clientLeft+parseFloat(w.paddingLeft))*m.x,g=x.top+(E.clientTop+parseFloat(w.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=p,c+=g,y=Ve(E),E=Wo(y)}}return Kn({width:u,height:d,x:l,y:c})}function mo(e,t){const n=vo(e).scrollLeft;return t?t.left+n:Ot(at(e)).left+n}function is(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Du(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=at(o),a=t?go(t.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=rt(1);const u=rt(0),d=st(o);if((d||!d&&!i)&&((zt(o)!=="body"||Sn(s))&&(l=vo(o)),st(o))){const f=Ot(o);c=Gt(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const h=s&&!d&&!i?is(s,l):rt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function Au(e){return Array.from(e.getClientRects())}function zu(e){const t=at(e),n=vo(e),o=e.ownerDocument.body,r=Le(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Le(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+mo(e);const a=-n.scrollTop;return Ue(o).direction==="rtl"&&(s+=Le(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const Hr=25;function Ru(e,t){const n=Ve(e),o=at(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const u=wr();(!u||u&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=mo(o);if(c<=0){const u=o.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(o.clientWidth-d.clientWidth-f);y<=Hr&&(i-=y)}else c<=Hr&&(i+=c);return{width:i,height:s,x:a,y:l}}const Bu=new Set(["absolute","fixed"]);function Lu(e,t){const n=Ot(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=st(e)?Gt(e):rt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=r*i.x,c=o*i.y;return{width:s,height:a,x:l,y:c}}function qr(e,t,n){let o;if(t==="viewport")o=Ru(e,n);else if(t==="document")o=zu(at(e));else if(Xe(t))o=Lu(t,n);else{const r=rs(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Kn(o)}function ss(e,t){const n=kt(e);return n===t||!Xe(n)||Kt(n)?!1:Ue(n).position==="fixed"||ss(n,t)}function Vu(e,t){const n=t.get(e);if(n)return n;let o=vn(e,[],!1).filter(a=>Xe(a)&&zt(a)!=="body"),r=null;const i=Ue(e).position==="fixed";let s=i?kt(e):e;for(;Xe(s)&&!Kt(s);){const a=Ue(s),l=yr(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&Bu.has(r.position)||Sn(s)&&!l&&ss(e,s))?o=o.filter(u=>u!==s):r=a,s=kt(s)}return t.set(e,o),o}function Fu(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?go(t)?[]:Vu(t,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=qr(t,u,r);return c.top=Le(d.top,c.top),c.right=Et(d.right,c.right),c.bottom=Et(d.bottom,c.bottom),c.left=Le(d.left,c.left),c},qr(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Hu(e){const{width:t,height:n}=os(e);return{width:t,height:n}}function qu(e,t,n){const o=st(t),r=at(t),i=n==="fixed",s=Ot(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=rt(0);function c(){l.x=mo(r)}if(o||!o&&!i)if((zt(t)!=="body"||Sn(r))&&(a=vo(t)),o){const f=Ot(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else r&&c();i&&!o&&r&&c();const u=r&&!o&&!i?is(r,a):rt(0),d=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function Po(e){return Ue(e).position==="static"}function Gr(e,t){if(!st(e)||Ue(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return at(e)===n&&(n=n.ownerDocument.body),n}function as(e,t){const n=Ve(e);if(go(e))return n;if(!st(e)){let r=kt(e);for(;r&&!Kt(r);){if(Xe(r)&&!Po(r))return r;r=kt(r)}return n}let o=Gr(e,t);for(;o&&Su(o)&&Po(o);)o=Gr(o,t);return o&&Kt(o)&&Po(o)&&!yr(o)?n:o||Pu(e)||n}const Gu=async function(e){const t=this.getOffsetParent||as,n=this.getDimensions,o=await n(e.floating);return{reference:qu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ju(e){return Ue(e).direction==="rtl"}const Yu={convertOffsetParentRelativeRectToViewportRelativeRect:Du,getDocumentElement:at,getClippingRect:Fu,getOffsetParent:as,getElementRects:Gu,getClientRects:Au,getDimensions:Hu,getScale:Gt,isElement:Xe,isRTL:ju};function ls(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wu(e,t){let n=null,o;const r=at(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(a||t(),!h||!f)return;const y=Mn(d),E=Mn(r.clientWidth-(u+h)),m=Mn(r.clientHeight-(d+f)),x=Mn(u),p={rootMargin:-y+"px "+-E+"px "+-m+"px "+-x+"px",threshold:Le(0,Et(1,l))||1};let g=!0;function M(R){const F=R[0].intersectionRatio;if(F!==l){if(!g)return s();F?s(!1,F):o=setTimeout(()=>{s(!1,1e-7)},1e3)}F===1&&!ls(c,e.getBoundingClientRect())&&s(),g=!1}try{n=new IntersectionObserver(M,{...p,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,p)}n.observe(e)}return s(!0),i}function Xu(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=_r(e),u=r||i?[...c?vn(c):[],...vn(t)]:[];u.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const d=c&&a?Wu(c,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var p;(p=f)==null||p.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let y,E=l?Ot(e):null;l&&m();function m(){const x=Ot(e);E&&!ls(E,x)&&n(),E=x,y=requestAnimationFrame(m)}return n(),()=>{var x;u.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d?.(),(x=f)==null||x.disconnect(),f=null,l&&cancelAnimationFrame(y)}}const Uu=wu,Ku=_u,jr=vu,Zu=xu,Ju=mu,Qu=gu,ec=bu,tc=(e,t,n)=>{const o=new Map,r={platform:Yu,...n},i={...r.platform,_c:o};return pu(e,t,{...r,platform:i})};function nc(e){return e!=null&&typeof e=="object"&&"$el"in e}function Xo(e){if(nc(e)){const t=e.$el;return mr(t)&&zt(t)==="#comment"?null:t}return e}function Ft(e){return typeof e=="function"?e():S(e)}function oc(e){return{name:"arrow",options:e,fn(t){const n=Xo(Ft(e.element));return n==null?{}:Qu({element:n,padding:e.padding}).fn(t)}}}function us(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yr(e,t){const n=us(e);return Math.round(t*n)/n}function rc(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=ne(()=>{var F;return(F=Ft(n.open))!=null?F:!0}),i=ne(()=>Ft(n.middleware)),s=ne(()=>{var F;return(F=Ft(n.placement))!=null?F:"bottom"}),a=ne(()=>{var F;return(F=Ft(n.strategy))!=null?F:"absolute"}),l=ne(()=>{var F;return(F=Ft(n.transform))!=null?F:!0}),c=ne(()=>Xo(e.value)),u=ne(()=>Xo(t.value)),d=ce(0),h=ce(0),f=ce(a.value),y=ce(s.value),E=dt({}),m=ce(!1),x=ne(()=>{const F={position:f.value,left:"0",top:"0"};if(!u.value)return F;const H=Yr(u.value,d.value),J=Yr(u.value,h.value);return l.value?{...F,transform:"translate("+H+"px, "+J+"px)",...us(u.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:H+"px",top:J+"px"}});let w;function p(){if(c.value==null||u.value==null)return;const F=r.value;tc(c.value,u.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(H=>{d.value=H.x,h.value=H.y,f.value=H.strategy,y.value=H.placement,E.value=H.middlewareData,m.value=F!==!1})}function g(){typeof w=="function"&&(w(),w=void 0)}function M(){if(g(),o===void 0){p();return}if(c.value!=null&&u.value!=null){w=o(c.value,u.value,p);return}}function R(){r.value||(m.value=!1)}return _e([i,s,a,r],p,{flush:"sync"}),_e([c,u],M,{flush:"sync"}),_e(r,R,{flush:"sync"}),cr()&&dn(g),{x:Rt(d),y:Rt(h),strategy:Rt(f),placement:Rt(y),middlewareData:Rt(E),isPositioned:Rt(m),floatingStyles:x,update:p}}const ic={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[sc,ac]=ho("PopperContent");var lc=ve({inheritAttrs:!1,__name:"PopperContent",props:Da({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...ic}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=Qi(),{forwardRef:i,currentElement:s}=Ze(),a=ce(),l=ce(),{width:c,height:u}=Gl(l),d=ne(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),h=ne(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=ne(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),y=ne(()=>({padding:h.value,boundary:f.value.filter(eu),altBoundary:f.value.length>0})),E=ne(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),m=Ma(()=>[Uu({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&jr({...y.value,...E.value}),n.avoidCollisions&&Ku({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?ec():void 0,...y.value}),!n.prioritizePosition&&n.avoidCollisions&&jr({...y.value,...E.value}),Zu({...y.value,apply:({elements:k,rects:V,availableWidth:v,availableHeight:$})=>{const{width:_,height:C}=V.reference,N=k.floating.style;N.setProperty("--reka-popper-available-width",`${v}px`),N.setProperty("--reka-popper-available-height",`${$}px`),N.setProperty("--reka-popper-anchor-width",`${_}px`),N.setProperty("--reka-popper-anchor-height",`${C}px`)}}),l.value&&oc({element:l.value,padding:n.arrowPadding}),tu({arrowWidth:c.value,arrowHeight:u.value}),n.hideWhenDetached&&Ju({strategy:"referenceHidden",...y.value})]),x=ne(()=>n.reference??r.anchor.value),{floatingStyles:w,placement:p,isPositioned:g,middlewareData:M}=rc(x,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...k)=>Xu(...k,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:m}),R=ne(()=>Go(p.value)[0]),F=ne(()=>Go(p.value)[1]);Wi(()=>{g.value&&o("placed")});const H=ne(()=>{const k=M.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&k}),J=ce("");Ho(()=>{s.value&&(J.value=window.getComputedStyle(s.value).zIndex)});const A=ne(()=>M.value.arrow?.x??0),z=ne(()=>M.value.arrow?.y??0);return ac({placedSide:R,onArrowChange:k=>l.value=k,arrowX:A,arrowY:z,shouldHideArrow:H}),(k,V)=>(Y(),ee("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:Be({...S(w),transform:S(g)?S(w).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J.value,"--reka-popper-transform-origin":[S(M).transformOrigin?.x,S(M).transformOrigin?.y].join(" "),...S(M).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[oe(S(uo),He({ref:S(i)},k.$attrs,{"as-child":n.asChild,as:k.as,"data-side":R.value,"data-align":F.value,style:{animation:S(g)?void 0:"none"}}),{default:fe(()=>[be(k.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),uc=lc;const cc={top:"bottom",right:"left",bottom:"top",left:"right"};var dc=ve({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const{forwardRef:t}=Ze(),n=sc(),o=ne(()=>cc[n.placedSide.value]);return(r,i)=>(Y(),ee("span",{ref:s=>{S(n).onArrowChange(s)},style:Be({position:"absolute",left:S(n).arrowX?.value?`${S(n).arrowX?.value}px`:void 0,top:S(n).arrowY?.value?`${S(n).arrowY?.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[S(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[S(n).placedSide.value],visibility:S(n).shouldHideArrow.value?"hidden":void 0})},[oe(Ql,He(r.$attrs,{ref:S(t),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:fe(()=>[be(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),fc=dc,hc=ve({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return Ze(),(n,o)=>(Y(),we(S(fc),co(fo(t)),{default:fe(()=>[be(n.$slots,"default")]),_:3},16))}}),pc=hc;const[br,gc]=ho("TooltipProvider");var vc=ve({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:s,disabled:a}=Xi(t);Ze();const l=ce(!0),c=ce(!1),{start:u,stop:d}=Gi(()=>{l.value=!0},o,{immediate:!1});return gc({isOpenDelayed:l,delayDuration:n,onOpen(){d(),l.value=!1},onClose(){u()},isPointerInTransitRef:c,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:s}),(h,f)=>be(h.$slots,"default")}}),mc=vc;const cs="tooltip.open",[yo,yc]=ho("TooltipRoot");var wc=ve({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;Ze();const r=br(),i=ne(()=>n.disableHoverableContent??r.disableHoverableContent.value),s=ne(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=ne(()=>n.disabled??r.disabled.value),l=ne(()=>n.delayDuration??r.delayDuration.value),c=ne(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),u=Pa(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});_e(u,p=>{r.onClose&&(p?(r.onOpen(),document.dispatchEvent(new CustomEvent(cs))):r.onClose())});const d=ce(!1),h=ce(),f=ne(()=>u.value?d.value?"delayed-open":"instant-open":"closed"),{start:y,stop:E}=Gi(()=>{d.value=!0,u.value=!0},l,{immediate:!1});function m(){E(),d.value=!1,u.value=!0}function x(){E(),u.value=!1}function w(){y()}return yc({contentId:"",open:u,stateAttribute:f,trigger:h,onTriggerChange(p){h.value=p},onTriggerEnter(){r.isOpenDelayed.value?w():m()},onTriggerLeave(){i.value?x():E()},onOpen:m,onClose:x,disableHoverableContent:i,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:c}),(p,g)=>(Y(),we(S(Wl),null,{default:fe(()=>[be(p.$slots,"default",{open:S(u)})]),_:3}))}}),_c=wc,bc=ve({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=yo(),{forwardRef:i,currentElement:s}=Ze(),a=ne(()=>n.ariaLabel||s.value?.textContent),l=ne(()=>{const{ariaLabel:c,...u}=n;return u});return je(()=>{Ir(window,"scroll",c=>{c.target?.contains(r.trigger.value)&&r.onClose()}),Ir(window,cs,r.onClose)}),(c,u)=>(Y(),we(S(Ka),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=d=>o("escapeKeyDown",d)),onPointerDownOutside:u[1]||(u[1]=d=>{S(r).disableClosingTrigger.value&&S(r).trigger.value?.contains(d.target)&&d.preventDefault(),o("pointerDownOutside",d)}),onFocusOutside:u[2]||(u[2]=Aa(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=d=>S(r).onClose())},{default:fe(()=>[oe(S(uc),He({ref:S(i),"data-state":S(r).stateAttribute.value},{...c.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:fe(()=>[be(c.$slots,"default"),oe(S(Ua),{id:S(r).contentId,role:"tooltip"},{default:fe(()=>[Se(he(a.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),ds=bc,xc=ve({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){const n=Za(e),{forwardRef:o,currentElement:r}=Ze(),{trigger:i,onClose:s}=yo(),a=br(),{isPointerInTransit:l,onPointerExit:c}=Rl(i,r);return a.isPointerInTransitRef=l,c(()=>{s()}),(u,d)=>(Y(),we(ds,He({ref:S(o)},S(n)),{default:fe(()=>[be(u.$slots,"default")]),_:3},16))}}),Ec=xc,kc=ve({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=yo(),i=hr(n,o),{forwardRef:s}=Ze();return(a,l)=>(Y(),we(S(Ja),{present:a.forceMount||S(r).open.value},{default:fe(()=>[(Y(),we(qe(S(r).disableHoverableContent.value?ds:Ec),He({ref:S(s)},S(i)),{default:fe(()=>[be(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Sc=kc,Cc=ve({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,o)=>(Y(),we(S(Qa),co(fo(t)),{default:fe(()=>[be(n.$slots,"default")]),_:3},16))}}),Nc=Cc,$c=ve({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=yo(),o=br();n.contentId||=el(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:i}=Ze(),s=ce(!1),a=ce(!1),l=ne(()=>n.disabled.value?{}:{click:E,focus:f,pointermove:d,pointerleave:h,pointerdown:u,blur:y});je(()=>{n.onTriggerChange(i.value)});function c(){setTimeout(()=>{s.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),s.value=!0,document.addEventListener("pointerup",c,{once:!0})}function d(m){m.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function h(){n.onTriggerLeave(),a.value=!1}function f(m){s.value||n.ignoreNonKeyboardFocus.value&&!m.target.matches?.(":focus-visible")||n.onOpen()}function y(){n.onClose()}function E(){n.disableClosingTrigger.value||n.onClose()}return(m,x)=>(Y(),we(S(Ul),{"as-child":"",reference:m.reference},{default:fe(()=>[oe(S(uo),He({ref:S(r),"aria-describedby":S(n).open.value?S(n).contentId:void 0,"data-state":S(n).stateAttribute.value,as:m.as,"as-child":t.asChild,"data-grace-area-trigger":""},za(l.value)),{default:fe(()=>[be(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Mc=$c,Ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ke=Ne((e,t)=>{var n=Object.defineProperty,o=(V,v,$)=>v in V?n(V,v,{enumerable:!0,configurable:!0,writable:!0,value:$}):V[v]=$,r=(V,v)=>()=>(v||V((v={exports:{}}).exports,v),v.exports),i=(V,v,$)=>o(V,typeof v!="symbol"?v+"":v,$),s=r((V,v)=>{var $="\0",_="\0",C="",N=class{constructor(I){i(this,"_isDirected",!0),i(this,"_isMultigraph",!1),i(this,"_isCompound",!1),i(this,"_label"),i(this,"_defaultNodeLabelFn",()=>{}),i(this,"_defaultEdgeLabelFn",()=>{}),i(this,"_nodes",{}),i(this,"_in",{}),i(this,"_preds",{}),i(this,"_out",{}),i(this,"_sucs",{}),i(this,"_edgeObjs",{}),i(this,"_edgeLabels",{}),i(this,"_nodeCount",0),i(this,"_edgeCount",0),i(this,"_parent"),i(this,"_children"),I&&(this._isDirected=Object.hasOwn(I,"directed")?I.directed:!0,this._isMultigraph=Object.hasOwn(I,"multigraph")?I.multigraph:!1,this._isCompound=Object.hasOwn(I,"compound")?I.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[_]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(I){return this._label=I,this}graph(){return this._label}setDefaultNodeLabel(I){return this._defaultNodeLabelFn=I,typeof I!="function"&&(this._defaultNodeLabelFn=()=>I),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var I=this;return this.nodes().filter(b=>Object.keys(I._in[b]).length===0)}sinks(){var I=this;return this.nodes().filter(b=>Object.keys(I._out[b]).length===0)}setNodes(I,b){var P=arguments,D=this;return I.forEach(function(j){P.length>1?D.setNode(j,b):D.setNode(j)}),this}setNode(I,b){return Object.hasOwn(this._nodes,I)?(arguments.length>1&&(this._nodes[I]=b),this):(this._nodes[I]=arguments.length>1?b:this._defaultNodeLabelFn(I),this._isCompound&&(this._parent[I]=_,this._children[I]={},this._children[_][I]=!0),this._in[I]={},this._preds[I]={},this._out[I]={},this._sucs[I]={},++this._nodeCount,this)}node(I){return this._nodes[I]}hasNode(I){return Object.hasOwn(this._nodes,I)}removeNode(I){var b=this;if(Object.hasOwn(this._nodes,I)){var P=D=>b.removeEdge(b._edgeObjs[D]);delete this._nodes[I],this._isCompound&&(this._removeFromParentsChildList(I),delete this._parent[I],this.children(I).forEach(function(D){b.setParent(D)}),delete this._children[I]),Object.keys(this._in[I]).forEach(P),delete this._in[I],delete this._preds[I],Object.keys(this._out[I]).forEach(P),delete this._out[I],delete this._sucs[I],--this._nodeCount}return this}setParent(I,b){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(b===void 0)b=_;else{b+="";for(var P=b;P!==void 0;P=this.parent(P))if(P===I)throw new Error("Setting "+b+" as parent of "+I+" would create a cycle");this.setNode(b)}return this.setNode(I),this._removeFromParentsChildList(I),this._parent[I]=b,this._children[b][I]=!0,this}_removeFromParentsChildList(I){delete this._children[this._parent[I]][I]}parent(I){if(this._isCompound){var b=this._parent[I];if(b!==_)return b}}children(I=_){if(this._isCompound){var b=this._children[I];if(b)return Object.keys(b)}else{if(I===_)return this.nodes();if(this.hasNode(I))return[]}}predecessors(I){var b=this._preds[I];if(b)return Object.keys(b)}successors(I){var b=this._sucs[I];if(b)return Object.keys(b)}neighbors(I){var b=this.predecessors(I);if(b){let D=new Set(b);for(var P of this.successors(I))D.add(P);return Array.from(D.values())}}isLeaf(I){var b;return this.isDirected()?b=this.successors(I):b=this.neighbors(I),b.length===0}filterNodes(I){var b=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});b.setGraph(this.graph());var P=this;Object.entries(this._nodes).forEach(function([Q,te]){I(Q)&&b.setNode(Q,te)}),Object.values(this._edgeObjs).forEach(function(Q){b.hasNode(Q.v)&&b.hasNode(Q.w)&&b.setEdge(Q,P.edge(Q))});var D={};function j(Q){var te=P.parent(Q);return te===void 0||b.hasNode(te)?(D[Q]=te,te):te in D?D[te]:j(te)}return this._isCompound&&b.nodes().forEach(Q=>b.setParent(Q,j(Q))),b}setDefaultEdgeLabel(I){return this._defaultEdgeLabelFn=I,typeof I!="function"&&(this._defaultEdgeLabelFn=()=>I),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(I,b){var P=this,D=arguments;return I.reduce(function(j,Q){return D.length>1?P.setEdge(j,Q,b):P.setEdge(j,Q),Q}),this}setEdge(){var I,b,P,D,j=!1,Q=arguments[0];typeof Q=="object"&&Q!==null&&"v"in Q?(I=Q.v,b=Q.w,P=Q.name,arguments.length===2&&(D=arguments[1],j=!0)):(I=Q,b=arguments[1],P=arguments[3],arguments.length>2&&(D=arguments[2],j=!0)),I=""+I,b=""+b,P!==void 0&&(P=""+P);var te=q(this._isDirected,I,b,P);if(Object.hasOwn(this._edgeLabels,te))return j&&(this._edgeLabels[te]=D),this;if(P!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(I),this.setNode(b),this._edgeLabels[te]=j?D:this._defaultEdgeLabelFn(I,b,P);var re=X(this._isDirected,I,b,P);return I=re.v,b=re.w,Object.freeze(re),this._edgeObjs[te]=re,O(this._preds[b],I),O(this._sucs[I],b),this._in[b][te]=re,this._out[I][te]=re,this._edgeCount++,this}edge(I,b,P){var D=arguments.length===1?Z(this._isDirected,arguments[0]):q(this._isDirected,I,b,P);return this._edgeLabels[D]}edgeAsObj(){let I=this.edge(...arguments);return typeof I!="object"?{label:I}:I}hasEdge(I,b,P){var D=arguments.length===1?Z(this._isDirected,arguments[0]):q(this._isDirected,I,b,P);return Object.hasOwn(this._edgeLabels,D)}removeEdge(I,b,P){var D=arguments.length===1?Z(this._isDirected,arguments[0]):q(this._isDirected,I,b,P),j=this._edgeObjs[D];return j&&(I=j.v,b=j.w,delete this._edgeLabels[D],delete this._edgeObjs[D],L(this._preds[b],I),L(this._sucs[I],b),delete this._in[b][D],delete this._out[I][D],this._edgeCount--),this}inEdges(I,b){return this.isDirected()?this.filterEdges(this._in[I],I,b):this.nodeEdges(I,b)}outEdges(I,b){return this.isDirected()?this.filterEdges(this._out[I],I,b):this.nodeEdges(I,b)}nodeEdges(I,b){if(I in this._nodes)return this.filterEdges({...this._in[I],...this._out[I]},I,b)}filterEdges(I,b,P){if(I){var D=Object.values(I);return P?D.filter(function(j){return j.v===b&&j.w===P||j.v===P&&j.w===b}):D}}};function O(I,b){I[b]?I[b]++:I[b]=1}function L(I,b){--I[b]||delete I[b]}function q(I,b,P,D){var j=""+b,Q=""+P;if(!I&&j>Q){var te=j;j=Q,Q=te}return j+C+Q+C+(D===void 0?$:D)}function X(I,b,P,D){var j=""+b,Q=""+P;if(!I&&j>Q){var te=j;j=Q,Q=te}var re={v:j,w:Q};return D&&(re.name=D),re}function Z(I,b){return q(I,b.v,b.w,b.name)}v.exports=N}),a=r((V,v)=>{v.exports="3.0.2"}),l=r((V,v)=>{v.exports={Graph:s(),version:a()}}),c=r((V,v)=>{var $=s();v.exports={write:_,read:O};function _(L){var q={options:{directed:L.isDirected(),multigraph:L.isMultigraph(),compound:L.isCompound()},nodes:C(L),edges:N(L)};return L.graph()!==void 0&&(q.value=structuredClone(L.graph())),q}function C(L){return L.nodes().map(function(q){var X=L.node(q),Z=L.parent(q),I={v:q};return X!==void 0&&(I.value=X),Z!==void 0&&(I.parent=Z),I})}function N(L){return L.edges().map(function(q){var X=L.edge(q),Z={v:q.v,w:q.w};return q.name!==void 0&&(Z.name=q.name),X!==void 0&&(Z.value=X),Z})}function O(L){var q=new $(L.options).setGraph(L.value);return L.nodes.forEach(function(X){q.setNode(X.v,X.value),X.parent&&q.setParent(X.v,X.parent)}),L.edges.forEach(function(X){q.setEdge({v:X.v,w:X.w,name:X.name},X.value)}),q}}),u=r((V,v)=>{v.exports=_;var $=()=>1;function _(N,O,L,q){return C(N,String(O),L||$,q||function(X){return N.outEdges(X)})}function C(N,O,L,q){var X={},Z=!0,I=0,b=N.nodes(),P=function(te){var re=L(te);X[te.v].distance+re<X[te.w].distance&&(X[te.w]={distance:X[te.v].distance+re,predecessor:te.v},Z=!0)},D=function(){b.forEach(function(te){q(te).forEach(function(re){var ie=re.v===te?re.v:re.w,me=ie===re.v?re.w:re.v;P({v:ie,w:me})})})};b.forEach(function(te){var re=te===O?0:Number.POSITIVE_INFINITY;X[te]={distance:re}});for(var j=b.length,Q=1;Q<j&&(Z=!1,I++,D(),!!Z);Q++);if(I===j-1&&(Z=!1,D(),Z))throw new Error("The graph contains a negative weight cycle");return X}}),d=r((V,v)=>{v.exports=$;function $(_){var C={},N=[],O;function L(q){Object.hasOwn(C,q)||(C[q]=!0,O.push(q),_.successors(q).forEach(L),_.predecessors(q).forEach(L))}return _.nodes().forEach(function(q){O=[],L(q),O.length&&N.push(O)}),N}}),h=r((V,v)=>{var $=class{constructor(){i(this,"_arr",[]),i(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(_){return _.key})}has(_){return Object.hasOwn(this._keyIndices,_)}priority(_){var C=this._keyIndices[_];if(C!==void 0)return this._arr[C].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(_,C){var N=this._keyIndices;if(_=String(_),!Object.hasOwn(N,_)){var O=this._arr,L=O.length;return N[_]=L,O.push({key:_,priority:C}),this._decrease(L),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var _=this._arr.pop();return delete this._keyIndices[_.key],this._heapify(0),_.key}decrease(_,C){var N=this._keyIndices[_];if(C>this._arr[N].priority)throw new Error("New priority is greater than current priority. Key: "+_+" Old: "+this._arr[N].priority+" New: "+C);this._arr[N].priority=C,this._decrease(N)}_heapify(_){var C=this._arr,N=2*_,O=N+1,L=_;N<C.length&&(L=C[N].priority<C[L].priority?N:L,O<C.length&&(L=C[O].priority<C[L].priority?O:L),L!==_&&(this._swap(_,L),this._heapify(L)))}_decrease(_){for(var C=this._arr,N=C[_].priority,O;_!==0&&(O=_>>1,!(C[O].priority<N));)this._swap(_,O),_=O}_swap(_,C){var N=this._arr,O=this._keyIndices,L=N[_],q=N[C];N[_]=q,N[C]=L,O[q.key]=_,O[L.key]=C}};v.exports=$}),f=r((V,v)=>{var $=h();v.exports=C;var _=()=>1;function C(O,L,q,X){var Z=function(I){return O.outEdges(I)};return N(O,String(L),q||_,X||Z)}function N(O,L,q,X){var Z={},I=new $,b,P,D=function(j){var Q=j.v!==b?j.v:j.w,te=Z[Q],re=q(j),ie=P.distance+re;if(re<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+j+" Weight: "+re);ie<te.distance&&(te.distance=ie,te.predecessor=b,I.decrease(Q,ie))};for(O.nodes().forEach(function(j){var Q=j===L?0:Number.POSITIVE_INFINITY;Z[j]={distance:Q},I.add(j,Q)});I.size()>0&&(b=I.removeMin(),P=Z[b],P.distance!==Number.POSITIVE_INFINITY);)X(b).forEach(D);return Z}}),y=r((V,v)=>{var $=f();v.exports=_;function _(C,N,O){return C.nodes().reduce(function(L,q){return L[q]=$(C,q,N,O),L},{})}}),E=r((V,v)=>{v.exports=$;function $(C,N,O){if(C[N].predecessor!==void 0)throw new Error("Invalid source vertex");if(C[O].predecessor===void 0&&O!==N)throw new Error("Invalid destination vertex");return{weight:C[O].distance,path:_(C,N,O)}}function _(C,N,O){for(var L=[],q=O;q!==N;)L.push(q),q=C[q].predecessor;return L.push(N),L.reverse()}}),m=r((V,v)=>{v.exports=$;function $(_){var C=0,N=[],O={},L=[];function q(X){var Z=O[X]={onStack:!0,lowlink:C,index:C++};if(N.push(X),_.successors(X).forEach(function(P){Object.hasOwn(O,P)?O[P].onStack&&(Z.lowlink=Math.min(Z.lowlink,O[P].index)):(q(P),Z.lowlink=Math.min(Z.lowlink,O[P].lowlink))}),Z.lowlink===Z.index){var I=[],b;do b=N.pop(),O[b].onStack=!1,I.push(b);while(X!==b);L.push(I)}}return _.nodes().forEach(function(X){Object.hasOwn(O,X)||q(X)}),L}}),x=r((V,v)=>{var $=m();v.exports=_;function _(C){return $(C).filter(function(N){return N.length>1||N.length===1&&C.hasEdge(N[0],N[0])})}}),w=r((V,v)=>{v.exports=_;var $=()=>1;function _(N,O,L){return C(N,O||$,L||function(q){return N.outEdges(q)})}function C(N,O,L){var q={},X=N.nodes();return X.forEach(function(Z){q[Z]={},q[Z][Z]={distance:0},X.forEach(function(I){Z!==I&&(q[Z][I]={distance:Number.POSITIVE_INFINITY})}),L(Z).forEach(function(I){var b=I.v===Z?I.w:I.v,P=O(I);q[Z][b]={distance:P,predecessor:Z}})}),X.forEach(function(Z){var I=q[Z];X.forEach(function(b){var P=q[b];X.forEach(function(D){var j=P[Z],Q=I[D],te=P[D],re=j.distance+Q.distance;re<te.distance&&(te.distance=re,te.predecessor=Q.predecessor)})})}),q}}),p=r((V,v)=>{function $(C){var N={},O={},L=[];function q(X){if(Object.hasOwn(O,X))throw new _;Object.hasOwn(N,X)||(O[X]=!0,N[X]=!0,C.predecessors(X).forEach(q),delete O[X],L.push(X))}if(C.sinks().forEach(q),Object.keys(N).length!==C.nodeCount())throw new _;return L}var _=class extends Error{constructor(){super(...arguments)}};v.exports=$,$.CycleException=_}),g=r((V,v)=>{var $=p();v.exports=_;function _(C){try{$(C)}catch(N){if(N instanceof $.CycleException)return!1;throw N}return!0}}),M=r((V,v)=>{v.exports=$;function $(C,N,O,L,q){Array.isArray(N)||(N=[N]);var X=(C.isDirected()?C.successors:C.neighbors).bind(C),Z={};return N.forEach(function(I){if(!C.hasNode(I))throw new Error("Graph does not have node: "+I);q=_(C,I,O==="post",Z,X,L,q)}),q}function _(C,N,O,L,q,X,Z){return Object.hasOwn(L,N)||(L[N]=!0,O||(Z=X(Z,N)),q(N).forEach(function(I){Z=_(C,I,O,L,q,X,Z)}),O&&(Z=X(Z,N))),Z}}),R=r((V,v)=>{var $=M();v.exports=_;function _(C,N,O){return $(C,N,O,function(L,q){return L.push(q),L},[])}}),F=r((V,v)=>{var $=R();v.exports=_;function _(C,N){return $(C,N,"post")}}),H=r((V,v)=>{var $=R();v.exports=_;function _(C,N){return $(C,N,"pre")}}),J=r((V,v)=>{var $=s(),_=h();v.exports=C;function C(N,O){var L=new $,q={},X=new _,Z;function I(P){var D=P.v===Z?P.w:P.v,j=X.priority(D);if(j!==void 0){var Q=O(P);Q<j&&(q[D]=Z,X.decrease(D,Q))}}if(N.nodeCount()===0)return L;N.nodes().forEach(function(P){X.add(P,Number.POSITIVE_INFINITY),L.setNode(P)}),X.decrease(N.nodes()[0],0);for(var b=!1;X.size()>0;){if(Z=X.removeMin(),Object.hasOwn(q,Z))L.setEdge(Z,q[Z]);else{if(b)throw new Error("Input graph is not connected: "+N);b=!0}N.nodeEdges(Z).forEach(I)}return L}}),A=r((V,v)=>{var $=f(),_=u();v.exports=C;function C(O,L,q,X){return N(O,L,q,X||function(Z){return O.outEdges(Z)})}function N(O,L,q,X){if(q===void 0)return $(O,L,q,X);for(var Z=!1,I=O.nodes(),b=0;b<I.length;b++){for(var P=X(I[b]),D=0;D<P.length;D++){var j=P[D],Q=j.v===I[b]?j.v:j.w,te=Q===j.v?j.w:j.v;q({v:Q,w:te})<0&&(Z=!0)}if(Z)return _(O,L,q,X)}return $(O,L,q,X)}}),z=r((V,v)=>{v.exports={bellmanFord:u(),components:d(),dijkstra:f(),dijkstraAll:y(),extractPath:E(),findCycles:x(),floydWarshall:w(),isAcyclic:g(),postorder:F(),preorder:H(),prim:J(),shortestPaths:A(),reduce:M(),tarjan:m(),topsort:p()}}),k=l();t.exports={Graph:k.Graph,json:c(),alg:z(),version:k.version}}),Pc=Ne((e,t)=>{var n=class{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,s=i._prev;if(s!==i)return o(s),s}enqueue(i){let s=this._sentinel;i._prev&&i._next&&o(i),i._next=s._next,s._next._prev=i,s._next=i,i._prev=s}toString(){let i=[],s=this._sentinel,a=s._prev;for(;a!==s;)i.push(JSON.stringify(a,r)),a=a._prev;return"["+i.join(", ")+"]"}};function o(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function r(i,s){if(i!=="_next"&&i!=="_prev")return s}t.exports=n}),Tc=Ne((e,t)=>{var n=Ke().Graph,o=Pc();t.exports=i;var r=()=>1;function i(d,h){if(d.nodeCount()<=1)return[];let f=l(d,h||r);return s(f.graph,f.buckets,f.zeroIdx).flatMap(y=>d.outEdges(y.v,y.w))}function s(d,h,f){let y=[],E=h[h.length-1],m=h[0],x;for(;d.nodeCount();){for(;x=m.dequeue();)a(d,h,f,x);for(;x=E.dequeue();)a(d,h,f,x);if(d.nodeCount()){for(let w=h.length-2;w>0;--w)if(x=h[w].dequeue(),x){y=y.concat(a(d,h,f,x,!0));break}}}return y}function a(d,h,f,y,E){let m=E?[]:void 0;return d.inEdges(y.v).forEach(x=>{let w=d.edge(x),p=d.node(x.v);E&&m.push({v:x.v,w:x.w}),p.out-=w,c(h,f,p)}),d.outEdges(y.v).forEach(x=>{let w=d.edge(x),p=x.w,g=d.node(p);g.in-=w,c(h,f,g)}),d.removeNode(y.v),m}function l(d,h){let f=new n,y=0,E=0;d.nodes().forEach(w=>{f.setNode(w,{v:w,in:0,out:0})}),d.edges().forEach(w=>{let p=f.edge(w.v,w.w)||0,g=h(w),M=p+g;f.setEdge(w.v,w.w,M),E=Math.max(E,f.node(w.v).out+=g),y=Math.max(y,f.node(w.w).in+=g)});let m=u(E+y+3).map(()=>new o),x=y+1;return f.nodes().forEach(w=>{c(m,x,f.node(w))}),{graph:f,buckets:m,zeroIdx:x}}function c(d,h,f){f.out?f.in?d[f.out-f.in+h].enqueue(f):d[d.length-1].enqueue(f):d[0].enqueue(f)}function u(d){let h=[];for(let f=0;f<d;f++)h.push(f);return h}}),De=Ne((e,t)=>{var n=Ke().Graph;t.exports={addBorderNode:h,addDummyNode:o,applyWithChunking:E,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:l,mapValues:H,maxRank:m,normalizeRanks:u,notime:p,partition:x,pick:F,predecessorWeights:a,range:R,removeEmptyRanks:d,simplify:r,successorWeights:s,time:w,uniqueId:M,zipObject:J};function o(A,z,k,V){for(var v=V;A.hasNode(v);)v=M(V);return k.dummy=z,A.setNode(v,k),v}function r(A){let z=new n().setGraph(A.graph());return A.nodes().forEach(k=>z.setNode(k,A.node(k))),A.edges().forEach(k=>{let V=z.edge(k.v,k.w)||{weight:0,minlen:1},v=A.edge(k);z.setEdge(k.v,k.w,{weight:V.weight+v.weight,minlen:Math.max(V.minlen,v.minlen)})}),z}function i(A){let z=new n({multigraph:A.isMultigraph()}).setGraph(A.graph());return A.nodes().forEach(k=>{A.children(k).length||z.setNode(k,A.node(k))}),A.edges().forEach(k=>{z.setEdge(k,A.edge(k))}),z}function s(A){let z=A.nodes().map(k=>{let V={};return A.outEdges(k).forEach(v=>{V[v.w]=(V[v.w]||0)+A.edge(v).weight}),V});return J(A.nodes(),z)}function a(A){let z=A.nodes().map(k=>{let V={};return A.inEdges(k).forEach(v=>{V[v.v]=(V[v.v]||0)+A.edge(v).weight}),V});return J(A.nodes(),z)}function l(A,z){let k=A.x,V=A.y,v=z.x-k,$=z.y-V,_=A.width/2,C=A.height/2;if(!v&&!$)throw new Error("Not possible to find intersection inside of the rectangle");let N,O;return Math.abs($)*_>Math.abs(v)*C?($<0&&(C=-C),N=C*v/$,O=C):(v<0&&(_=-_),N=_,O=_*$/v),{x:k+N,y:V+O}}function c(A){let z=R(m(A)+1).map(()=>[]);return A.nodes().forEach(k=>{let V=A.node(k),v=V.rank;v!==void 0&&(z[v][V.order]=k)}),z}function u(A){let z=A.nodes().map(V=>{let v=A.node(V).rank;return v===void 0?Number.MAX_VALUE:v}),k=E(Math.min,z);A.nodes().forEach(V=>{let v=A.node(V);Object.hasOwn(v,"rank")&&(v.rank-=k)})}function d(A){let z=A.nodes().map(_=>A.node(_).rank).filter(_=>_!==void 0),k=E(Math.min,z),V=[];A.nodes().forEach(_=>{let C=A.node(_).rank-k;V[C]||(V[C]=[]),V[C].push(_)});let v=0,$=A.graph().nodeRankFactor;Array.from(V).forEach((_,C)=>{_===void 0&&C%$!==0?--v:_!==void 0&&v&&_.forEach(N=>A.node(N).rank+=v)})}function h(A,z,k,V){let v={width:0,height:0};return arguments.length>=4&&(v.rank=k,v.order=V),o(A,"border",v,z)}function f(A,z=y){let k=[];for(let V=0;V<A.length;V+=z){let v=A.slice(V,V+z);k.push(v)}return k}var y=65535;function E(A,z){if(z.length>y){let k=f(z);return A.apply(null,k.map(V=>A.apply(null,V)))}else return A.apply(null,z)}function m(A){let z=A.nodes().map(k=>{let V=A.node(k).rank;return V===void 0?Number.MIN_VALUE:V});return E(Math.max,z)}function x(A,z){let k={lhs:[],rhs:[]};return A.forEach(V=>{z(V)?k.lhs.push(V):k.rhs.push(V)}),k}function w(A,z){let k=Date.now();try{return z()}finally{console.log(A+" time: "+(Date.now()-k)+"ms")}}function p(A,z){return z()}var g=0;function M(A){var z=++g;return A+(""+z)}function R(A,z,k=1){z==null&&(z=A,A=0);let V=$=>$<z;k<0&&(V=$=>z<$);let v=[];for(let $=A;V($);$+=k)v.push($);return v}function F(A,z){let k={};for(let V of z)A[V]!==void 0&&(k[V]=A[V]);return k}function H(A,z){let k=z;return typeof z=="string"&&(k=V=>V[z]),Object.entries(A).reduce((V,[v,$])=>(V[v]=k($,v),V),{})}function J(A,z){return A.reduce((k,V,v)=>(k[V]=z[v],k),{})}}),Oc=Ne((e,t)=>{var n=Tc(),o=De().uniqueId;t.exports={run:r,undo:s};function r(a){(a.graph().acyclicer==="greedy"?n(a,l(a)):i(a)).forEach(c=>{let u=a.edge(c);a.removeEdge(c),u.forwardName=c.name,u.reversed=!0,a.setEdge(c.w,c.v,u,o("rev"))});function l(c){return u=>c.edge(u).weight}}function i(a){let l=[],c={},u={};function d(h){Object.hasOwn(u,h)||(u[h]=!0,c[h]=!0,a.outEdges(h).forEach(f=>{Object.hasOwn(c,f.w)?l.push(f):d(f.w)}),delete c[h])}return a.nodes().forEach(d),l}function s(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let u=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,u)}})}}),Ic=Ne((e,t)=>{var n=De();t.exports={run:o,undo:i};function o(s){s.graph().dummyChains=[],s.edges().forEach(a=>r(s,a))}function r(s,a){let l=a.v,c=s.node(l).rank,u=a.w,d=s.node(u).rank,h=a.name,f=s.edge(a),y=f.labelRank;if(d===c+1)return;s.removeEdge(a);let E,m,x;for(x=0,++c;c<d;++x,++c)f.points=[],m={width:0,height:0,edgeLabel:f,edgeObj:a,rank:c},E=n.addDummyNode(s,"edge",m,"_d"),c===y&&(m.width=f.width,m.height=f.height,m.dummy="edge-label",m.labelpos=f.labelpos),s.setEdge(l,E,{weight:f.weight},h),x===0&&s.graph().dummyChains.push(E),l=E;s.setEdge(l,u,{weight:f.weight},h)}function i(s){s.graph().dummyChains.forEach(a=>{let l=s.node(a),c=l.edgeLabel,u;for(s.setEdge(l.edgeObj,c);l.dummy;)u=s.successors(a)[0],s.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=u,l=s.node(a)})}}),Zn=Ne((e,t)=>{var{applyWithChunking:n}=De();t.exports={longestPath:o,slack:r};function o(i){var s={};function a(l){var c=i.node(l);if(Object.hasOwn(s,l))return c.rank;s[l]=!0;let u=i.outEdges(l).map(h=>h==null?Number.POSITIVE_INFINITY:a(h.w)-i.edge(h).minlen);var d=n(Math.min,u);return d===Number.POSITIVE_INFINITY&&(d=0),c.rank=d}i.sources().forEach(a)}function r(i,s){return i.node(s.w).rank-i.node(s.v).rank-i.edge(s).minlen}}),fs=Ne((e,t)=>{var n=Ke().Graph,o=Zn().slack;t.exports=r;function r(l){var c=new n({directed:!1}),u=l.nodes()[0],d=l.nodeCount();c.setNode(u,{});for(var h,f;i(c,l)<d;)h=s(c,l),f=c.hasNode(h.v)?o(l,h):-o(l,h),a(c,l,f);return c}function i(l,c){function u(d){c.nodeEdges(d).forEach(h=>{var f=h.v,y=d===f?h.w:f;!l.hasNode(y)&&!o(c,h)&&(l.setNode(y,{}),l.setEdge(d,y,{}),u(y))})}return l.nodes().forEach(u),l.nodeCount()}function s(l,c){return c.edges().reduce((u,d)=>{let h=Number.POSITIVE_INFINITY;return l.hasNode(d.v)!==l.hasNode(d.w)&&(h=o(c,d)),h<u[0]?[h,d]:u},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,u){l.nodes().forEach(d=>c.node(d).rank+=u)}}),Dc=Ne((e,t)=>{var n=fs(),o=Zn().slack,r=Zn().longestPath,i=Ke().alg.preorder,s=Ke().alg.postorder,a=De().simplify;t.exports=l,l.initLowLimValues=h,l.initCutValues=c,l.calcCutValue=d,l.leaveEdge=y,l.enterEdge=E,l.exchangeEdges=m;function l(g){g=a(g),r(g);var M=n(g);h(M),c(M,g);for(var R,F;R=y(M);)F=E(M,g,R),m(M,g,R,F)}function c(g,M){var R=s(g,g.nodes());R=R.slice(0,R.length-1),R.forEach(F=>u(g,M,F))}function u(g,M,R){var F=g.node(R),H=F.parent;g.edge(R,H).cutvalue=d(g,M,R)}function d(g,M,R){var F=g.node(R),H=F.parent,J=!0,A=M.edge(R,H),z=0;return A||(J=!1,A=M.edge(H,R)),z=A.weight,M.nodeEdges(R).forEach(k=>{var V=k.v===R,v=V?k.w:k.v;if(v!==H){var $=V===J,_=M.edge(k).weight;if(z+=$?_:-_,w(g,R,v)){var C=g.edge(R,v).cutvalue;z+=$?-C:C}}}),z}function h(g,M){arguments.length<2&&(M=g.nodes()[0]),f(g,{},1,M)}function f(g,M,R,F,H){var J=R,A=g.node(F);return M[F]=!0,g.neighbors(F).forEach(z=>{Object.hasOwn(M,z)||(R=f(g,M,R,z,F))}),A.low=J,A.lim=R++,H?A.parent=H:delete A.parent,R}function y(g){return g.edges().find(M=>g.edge(M).cutvalue<0)}function E(g,M,R){var F=R.v,H=R.w;M.hasEdge(F,H)||(F=R.w,H=R.v);var J=g.node(F),A=g.node(H),z=J,k=!1;J.lim>A.lim&&(z=A,k=!0);var V=M.edges().filter(v=>k===p(g,g.node(v.v),z)&&k!==p(g,g.node(v.w),z));return V.reduce((v,$)=>o(M,$)<o(M,v)?$:v)}function m(g,M,R,F){var H=R.v,J=R.w;g.removeEdge(H,J),g.setEdge(F.v,F.w,{}),h(g),c(g,M),x(g,M)}function x(g,M){var R=g.nodes().find(H=>!M.node(H).parent),F=i(g,R);F=F.slice(1),F.forEach(H=>{var J=g.node(H).parent,A=M.edge(H,J),z=!1;A||(A=M.edge(J,H),z=!0),M.node(H).rank=M.node(J).rank+(z?A.minlen:-A.minlen)})}function w(g,M,R){return g.hasEdge(M,R)}function p(g,M,R){return R.low<=M.lim&&M.lim<=R.lim}}),Ac=Ne((e,t)=>{var n=Zn(),o=n.longestPath,r=fs(),i=Dc();t.exports=s;function s(u){var d=u.graph().ranker;if(d instanceof Function)return d(u);switch(u.graph().ranker){case"network-simplex":c(u);break;case"tight-tree":l(u);break;case"longest-path":a(u);break;case"none":break;default:c(u)}}var a=o;function l(u){o(u),r(u)}function c(u){i(u)}}),zc=Ne((e,t)=>{t.exports=n;function n(i){let s=r(i);i.graph().dummyChains.forEach(a=>{let l=i.node(a),c=l.edgeObj,u=o(i,s,c.v,c.w),d=u.path,h=u.lca,f=0,y=d[f],E=!0;for(;a!==c.w;){if(l=i.node(a),E){for(;(y=d[f])!==h&&i.node(y).maxRank<l.rank;)f++;y===h&&(E=!1)}if(!E){for(;f<d.length-1&&i.node(y=d[f+1]).minRank<=l.rank;)f++;y=d[f]}i.setParent(a,y),a=i.successors(a)[0]}})}function o(i,s,a,l){let c=[],u=[],d=Math.min(s[a].low,s[l].low),h=Math.max(s[a].lim,s[l].lim),f,y;f=a;do f=i.parent(f),c.push(f);while(f&&(s[f].low>d||h>s[f].lim));for(y=f,f=l;(f=i.parent(f))!==y;)u.push(f);return{path:c.concat(u.reverse()),lca:y}}function r(i){let s={},a=0;function l(c){let u=a;i.children(c).forEach(l),s[c]={low:u,lim:a++}}return i.children().forEach(l),s}}),Rc=Ne((e,t)=>{var n=De();t.exports={run:o,cleanup:a};function o(l){let c=n.addDummyNode(l,"root",{},"_root"),u=i(l),d=Object.values(u),h=n.applyWithChunking(Math.max,d)-1,f=2*h+1;l.graph().nestingRoot=c,l.edges().forEach(E=>l.edge(E).minlen*=f);let y=s(l)+1;l.children().forEach(E=>r(l,c,f,y,h,u,E)),l.graph().nodeRankFactor=f}function r(l,c,u,d,h,f,y){let E=l.children(y);if(!E.length){y!==c&&l.setEdge(c,y,{weight:0,minlen:u});return}let m=n.addBorderNode(l,"_bt"),x=n.addBorderNode(l,"_bb"),w=l.node(y);l.setParent(m,y),w.borderTop=m,l.setParent(x,y),w.borderBottom=x,E.forEach(p=>{r(l,c,u,d,h,f,p);let g=l.node(p),M=g.borderTop?g.borderTop:p,R=g.borderBottom?g.borderBottom:p,F=g.borderTop?d:2*d,H=M!==R?1:h-f[y]+1;l.setEdge(m,M,{weight:F,minlen:H,nestingEdge:!0}),l.setEdge(R,x,{weight:F,minlen:H,nestingEdge:!0})}),l.parent(y)||l.setEdge(c,m,{weight:0,minlen:h+f[y]})}function i(l){var c={};function u(d,h){var f=l.children(d);f&&f.length&&f.forEach(y=>u(y,h+1)),c[d]=h}return l.children().forEach(d=>u(d,1)),c}function s(l){return l.edges().reduce((c,u)=>c+l.edge(u).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(u=>{var d=l.edge(u);d.nestingEdge&&l.removeEdge(u)})}}),Bc=Ne((e,t)=>{var n=De();t.exports=o;function o(i){function s(a){let l=i.children(a),c=i.node(a);if(l.length&&l.forEach(s),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let u=c.minRank,d=c.maxRank+1;u<d;++u)r(i,"borderLeft","_bl",a,c,u),r(i,"borderRight","_br",a,c,u)}}i.children().forEach(s)}function r(i,s,a,l,c,u){let d={width:0,height:0,rank:u,borderType:s},h=c[s][u-1],f=n.addDummyNode(i,"border",d,a);c[s][u]=f,i.setParent(f,l),h&&i.setEdge(h,f,{weight:1})}}),Lc=Ne((e,t)=>{t.exports={adjust:n,undo:o};function n(u){let d=u.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&r(u)}function o(u){let d=u.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(u),(d==="lr"||d==="rl")&&(l(u),r(u))}function r(u){u.nodes().forEach(d=>i(u.node(d))),u.edges().forEach(d=>i(u.edge(d)))}function i(u){let d=u.width;u.width=u.height,u.height=d}function s(u){u.nodes().forEach(d=>a(u.node(d))),u.edges().forEach(d=>{let h=u.edge(d);h.points.forEach(a),Object.hasOwn(h,"y")&&a(h)})}function a(u){u.y=-u.y}function l(u){u.nodes().forEach(d=>c(u.node(d))),u.edges().forEach(d=>{let h=u.edge(d);h.points.forEach(c),Object.hasOwn(h,"x")&&c(h)})}function c(u){let d=u.x;u.x=u.y,u.y=d}}),Vc=Ne((e,t)=>{var n=De();t.exports=o;function o(r){let i={},s=r.nodes().filter(d=>!r.children(d).length),a=s.map(d=>r.node(d).rank),l=n.applyWithChunking(Math.max,a),c=n.range(l+1).map(()=>[]);function u(d){if(i[d])return;i[d]=!0;let h=r.node(d);c[h.rank].push(d),r.successors(d).forEach(u)}return s.sort((d,h)=>r.node(d).rank-r.node(h).rank).forEach(u),c}}),Fc=Ne((e,t)=>{var n=De().zipObject;t.exports=o;function o(i,s){let a=0;for(let l=1;l<s.length;++l)a+=r(i,s[l-1],s[l]);return a}function r(i,s,a){let l=n(a,a.map((y,E)=>E)),c=s.flatMap(y=>i.outEdges(y).map(E=>({pos:l[E.w],weight:i.edge(E).weight})).sort((E,m)=>E.pos-m.pos)),u=1;for(;u<a.length;)u<<=1;let d=2*u-1;u-=1;let h=new Array(d).fill(0),f=0;return c.forEach(y=>{let E=y.pos+u;h[E]+=y.weight;let m=0;for(;E>0;)E%2&&(m+=h[E+1]),E=E-1>>1,h[E]+=y.weight;f+=y.weight*m}),f}}),Hc=Ne((e,t)=>{t.exports=n;function n(o,r=[]){return r.map(i=>{let s=o.inEdges(i);if(s.length){let a=s.reduce((l,c)=>{let u=o.edge(c),d=o.node(c.v);return{sum:l.sum+u.weight*d.order,weight:l.weight+u.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}}),qc=Ne((e,t)=>{var n=De();t.exports=o;function o(s,a){let l={};s.forEach((u,d)=>{let h=l[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:d};u.barycenter!==void 0&&(h.barycenter=u.barycenter,h.weight=u.weight)}),a.edges().forEach(u=>{let d=l[u.v],h=l[u.w];d!==void 0&&h!==void 0&&(h.indegree++,d.out.push(l[u.w]))});let c=Object.values(l).filter(u=>!u.indegree);return r(c)}function r(s){let a=[];function l(u){return d=>{d.merged||(d.barycenter===void 0||u.barycenter===void 0||d.barycenter>=u.barycenter)&&i(u,d)}}function c(u){return d=>{d.in.push(u),--d.indegree===0&&s.push(d)}}for(;s.length;){let u=s.pop();a.push(u),u.in.reverse().forEach(l(u)),u.out.forEach(c(u))}return a.filter(u=>!u.merged).map(u=>n.pick(u,["vs","i","barycenter","weight"]))}function i(s,a){let l=0,c=0;s.weight&&(l+=s.barycenter*s.weight,c+=s.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),s.vs=a.vs.concat(s.vs),s.barycenter=l/c,s.weight=c,s.i=Math.min(a.i,s.i),a.merged=!0}}),Gc=Ne((e,t)=>{var n=De();t.exports=o;function o(s,a){let l=n.partition(s,m=>Object.hasOwn(m,"barycenter")),c=l.lhs,u=l.rhs.sort((m,x)=>x.i-m.i),d=[],h=0,f=0,y=0;c.sort(i(!!a)),y=r(d,u,y),c.forEach(m=>{y+=m.vs.length,d.push(m.vs),h+=m.barycenter*m.weight,f+=m.weight,y=r(d,u,y)});let E={vs:d.flat(!0)};return f&&(E.barycenter=h/f,E.weight=f),E}function r(s,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),s.push(c.vs),l++;return l}function i(s){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:s?l.i-a.i:a.i-l.i}}),jc=Ne((e,t)=>{var n=Hc(),o=qc(),r=Gc();t.exports=i;function i(l,c,u,d){let h=l.children(c),f=l.node(c),y=f?f.borderLeft:void 0,E=f?f.borderRight:void 0,m={};y&&(h=h.filter(g=>g!==y&&g!==E));let x=n(l,h);x.forEach(g=>{if(l.children(g.v).length){let M=i(l,g.v,u,d);m[g.v]=M,Object.hasOwn(M,"barycenter")&&a(g,M)}});let w=o(x,u);s(w,m);let p=r(w,d);if(y&&(p.vs=[y,p.vs,E].flat(!0),l.predecessors(y).length)){let g=l.node(l.predecessors(y)[0]),M=l.node(l.predecessors(E)[0]);Object.hasOwn(p,"barycenter")||(p.barycenter=0,p.weight=0),p.barycenter=(p.barycenter*p.weight+g.order+M.order)/(p.weight+2),p.weight+=2}return p}function s(l,c){l.forEach(u=>{u.vs=u.vs.flatMap(d=>c[d]?c[d].vs:d)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}}),Yc=Ne((e,t)=>{var n=Ke().Graph,o=De();t.exports=r;function r(s,a,l,c){c||(c=s.nodes());let u=i(s),d=new n({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(h=>s.node(h));return c.forEach(h=>{let f=s.node(h),y=s.parent(h);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(d.setNode(h),d.setParent(h,y||u),s[l](h).forEach(E=>{let m=E.v===h?E.w:E.v,x=d.edge(m,h),w=x!==void 0?x.weight:0;d.setEdge(m,h,{weight:s.edge(E).weight+w})}),Object.hasOwn(f,"minRank")&&d.setNode(h,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),d}function i(s){for(var a;s.hasNode(a=o.uniqueId("_root")););return a}}),Wc=Ne((e,t)=>{t.exports=n;function n(o,r,i){let s={},a;i.forEach(l=>{let c=o.parent(l),u,d;for(;c;){if(u=o.parent(c),u?(d=s[u],s[u]=c):(d=a,a=c),d&&d!==c){r.setEdge(d,c);return}c=u}})}}),Xc=Ne((e,t)=>{var n=Vc(),o=Fc(),r=jc(),i=Yc(),s=Wc(),a=Ke().Graph,l=De();t.exports=c;function c(f,y={}){if(typeof y.customOrder=="function"){y.customOrder(f,c);return}let E=l.maxRank(f),m=u(f,l.range(1,E+1),"inEdges"),x=u(f,l.range(E-1,-1,-1),"outEdges"),w=n(f);if(h(f,w),y.disableOptimalOrderHeuristic)return;let p=Number.POSITIVE_INFINITY,g,M=y.constraints||[];for(let R=0,F=0;F<4;++R,++F){d(R%2?m:x,R%4>=2,M),w=l.buildLayerMatrix(f);let H=o(f,w);H<p?(F=0,g=Object.assign({},w),p=H):H===p&&(g=structuredClone(w))}h(f,g)}function u(f,y,E){let m=new Map,x=(w,p)=>{m.has(w)||m.set(w,[]),m.get(w).push(p)};for(let w of f.nodes()){let p=f.node(w);if(typeof p.rank=="number"&&x(p.rank,w),typeof p.minRank=="number"&&typeof p.maxRank=="number")for(let g=p.minRank;g<=p.maxRank;g++)g!==p.rank&&x(g,w)}return y.map(function(w){return i(f,w,E,m.get(w)||[])})}function d(f,y,E){let m=new a;f.forEach(function(x){E.forEach(g=>m.setEdge(g.left,g.right));let w=x.graph().root,p=r(x,w,m,y);p.vs.forEach((g,M)=>x.node(g).order=M),s(x,m,p.vs)})}function h(f,y){Object.values(y).forEach(E=>E.forEach((m,x)=>f.node(m).order=x))}}),Uc=Ne((e,t)=>{var n=Ke().Graph,o=De();t.exports={positionX:E,findType1Conflicts:r,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:y};function r(w,p){let g={};function M(R,F){let H=0,J=0,A=R.length,z=F[F.length-1];return F.forEach((k,V)=>{let v=s(w,k),$=v?w.node(v).order:A;(v||k===z)&&(F.slice(J,V+1).forEach(_=>{w.predecessors(_).forEach(C=>{let N=w.node(C),O=N.order;(O<H||$<O)&&!(N.dummy&&w.node(_).dummy)&&a(g,C,_)})}),J=V+1,H=$)}),F}return p.length&&p.reduce(M),g}function i(w,p){let g={};function M(F,H,J,A,z){let k;o.range(H,J).forEach(V=>{k=F[V],w.node(k).dummy&&w.predecessors(k).forEach(v=>{let $=w.node(v);$.dummy&&($.order<A||$.order>z)&&a(g,v,k)})})}function R(F,H){let J=-1,A,z=0;return H.forEach((k,V)=>{if(w.node(k).dummy==="border"){let v=w.predecessors(k);v.length&&(A=w.node(v[0]).order,M(H,z,V,J,A),z=V,J=A)}M(H,z,H.length,A,F.length)}),H}return p.length&&p.reduce(R),g}function s(w,p){if(w.node(p).dummy)return w.predecessors(p).find(g=>w.node(g).dummy)}function a(w,p,g){if(p>g){let R=p;p=g,g=R}let M=w[p];M||(w[p]=M={}),M[g]=!0}function l(w,p,g){if(p>g){let M=p;p=g,g=M}return!!w[p]&&Object.hasOwn(w[p],g)}function c(w,p,g,M){let R={},F={},H={};return p.forEach(J=>{J.forEach((A,z)=>{R[A]=A,F[A]=A,H[A]=z})}),p.forEach(J=>{let A=-1;J.forEach(z=>{let k=M(z);if(k.length){k=k.sort((v,$)=>H[v]-H[$]);let V=(k.length-1)/2;for(let v=Math.floor(V),$=Math.ceil(V);v<=$;++v){let _=k[v];F[z]===z&&A<H[_]&&!l(g,z,_)&&(F[_]=z,F[z]=R[z]=R[_],A=H[_])}}})}),{root:R,align:F}}function u(w,p,g,M,R){let F={},H=d(w,p,g,R),J=R?"borderLeft":"borderRight";function A(V,v){let $=H.nodes().slice(),_={},C=$.pop();for(;C;){if(_[C])V(C);else{_[C]=!0,$.push(C);for(let N of v(C))$.push(N)}C=$.pop()}}function z(V){F[V]=H.inEdges(V).reduce((v,$)=>Math.max(v,F[$.v]+H.edge($)),0)}function k(V){let v=H.outEdges(V).reduce((_,C)=>Math.min(_,F[C.w]-H.edge(C)),Number.POSITIVE_INFINITY),$=w.node(V);v!==Number.POSITIVE_INFINITY&&$.borderType!==J&&(F[V]=Math.max(F[V],v))}return A(z,H.predecessors.bind(H)),A(k,H.successors.bind(H)),Object.keys(M).forEach(V=>F[V]=F[g[V]]),F}function d(w,p,g,M){let R=new n,F=w.graph(),H=m(F.nodesep,F.edgesep,M);return p.forEach(J=>{let A;J.forEach(z=>{let k=g[z];if(R.setNode(k),A){var V=g[A],v=R.edge(V,k);R.setEdge(V,k,Math.max(H(w,z,A),v||0))}A=z})}),R}function h(w,p){return Object.values(p).reduce((g,M)=>{let R=Number.NEGATIVE_INFINITY,F=Number.POSITIVE_INFINITY;Object.entries(M).forEach(([J,A])=>{let z=x(w,J)/2;R=Math.max(A+z,R),F=Math.min(A-z,F)});let H=R-F;return H<g[0]&&(g=[H,M]),g},[Number.POSITIVE_INFINITY,null])[1]}function f(w,p){let g=Object.values(p),M=o.applyWithChunking(Math.min,g),R=o.applyWithChunking(Math.max,g);["u","d"].forEach(F=>{["l","r"].forEach(H=>{let J=F+H,A=w[J];if(A===p)return;let z=Object.values(A),k=M-o.applyWithChunking(Math.min,z);H!=="l"&&(k=R-o.applyWithChunking(Math.max,z)),k&&(w[J]=o.mapValues(A,V=>V+k))})})}function y(w,p){return o.mapValues(w.ul,(g,M)=>{if(p)return w[p.toLowerCase()][M];{let R=Object.values(w).map(F=>F[M]).sort((F,H)=>F-H);return(R[1]+R[2])/2}})}function E(w){let p=o.buildLayerMatrix(w),g=Object.assign(r(w,p),i(w,p)),M={},R;["u","d"].forEach(H=>{R=H==="u"?p:Object.values(p).reverse(),["l","r"].forEach(J=>{J==="r"&&(R=R.map(V=>Object.values(V).reverse()));let A=(H==="u"?w.predecessors:w.successors).bind(w),z=c(w,R,g,A),k=u(w,R,z.root,z.align,J==="r");J==="r"&&(k=o.mapValues(k,V=>-V)),M[H+J]=k})});let F=h(w,M);return f(M,F),y(M,w.graph().align)}function m(w,p,g){return(M,R,F)=>{let H=M.node(R),J=M.node(F),A=0,z;if(A+=H.width/2,Object.hasOwn(H,"labelpos"))switch(H.labelpos.toLowerCase()){case"l":z=-H.width/2;break;case"r":z=H.width/2;break}if(z&&(A+=g?z:-z),z=0,A+=(H.dummy?p:w)/2,A+=(J.dummy?p:w)/2,A+=J.width/2,Object.hasOwn(J,"labelpos"))switch(J.labelpos.toLowerCase()){case"l":z=J.width/2;break;case"r":z=-J.width/2;break}return z&&(A+=g?z:-z),z=0,A}}function x(w,p){return w.node(p).width}}),Kc=Ne((e,t)=>{var n=De(),o=Uc().positionX;t.exports=r;function r(s){s=n.asNonCompoundGraph(s),i(s),Object.entries(o(s)).forEach(([a,l])=>s.node(a).x=l)}function i(s){let a=n.buildLayerMatrix(s),l=s.graph().ranksep,c=s.graph().rankalign,u=0;a.forEach(d=>{let h=d.reduce((f,y)=>{let E=s.node(y).height;return f>E?f:E},0);d.forEach(f=>{let y=s.node(f);c==="top"?y.y=u+y.height/2:c==="bottom"?y.y=u+h-y.height/2:y.y=u+h/2}),u+=h+l})}}),Zc=Ne((e,t)=>{var n=Oc(),o=Ic(),r=Ac(),i=De().normalizeRanks,s=zc(),a=De().removeEmptyRanks,l=Rc(),c=Bc(),u=Lc(),d=Xc(),h=Kc(),f=De(),y=Ke().Graph;t.exports=E;function E(b,P={}){let D=P.debugTiming?f.time:f.notime;return D("layout",()=>{let j=D(" buildLayoutGraph",()=>A(b));return D(" runLayout",()=>m(j,D,P)),D(" updateInputGraph",()=>x(b,j)),j})}function m(b,P,D){P(" makeSpaceForEdgeLabels",()=>z(b)),P(" removeSelfEdges",()=>L(b)),P(" acyclic",()=>n.run(b)),P(" nestingGraph.run",()=>l.run(b)),P(" rank",()=>r(f.asNonCompoundGraph(b))),P(" injectEdgeLabelProxies",()=>k(b)),P(" removeEmptyRanks",()=>a(b)),P(" nestingGraph.cleanup",()=>l.cleanup(b)),P(" normalizeRanks",()=>i(b)),P(" assignRankMinMax",()=>V(b)),P(" removeEdgeLabelProxies",()=>v(b)),P(" normalize.run",()=>o.run(b)),P(" parentDummyChains",()=>s(b)),P(" addBorderSegments",()=>c(b)),P(" order",()=>d(b,D)),P(" insertSelfEdges",()=>q(b)),P(" adjustCoordinateSystem",()=>u.adjust(b)),P(" position",()=>h(b)),P(" positionSelfEdges",()=>X(b)),P(" removeBorderNodes",()=>O(b)),P(" normalize.undo",()=>o.undo(b)),P(" fixupEdgeLabelCoords",()=>C(b)),P(" undoCoordinateSystem",()=>u.undo(b)),P(" translateGraph",()=>$(b)),P(" assignNodeIntersects",()=>_(b)),P(" reversePoints",()=>N(b)),P(" acyclic.undo",()=>n.undo(b))}function x(b,P){b.nodes().forEach(D=>{let j=b.node(D),Q=P.node(D);j&&(j.x=Q.x,j.y=Q.y,j.order=Q.order,j.rank=Q.rank,P.children(D).length&&(j.width=Q.width,j.height=Q.height))}),b.edges().forEach(D=>{let j=b.edge(D),Q=P.edge(D);j.points=Q.points,Object.hasOwn(Q,"x")&&(j.x=Q.x,j.y=Q.y)}),b.graph().width=P.graph().width,b.graph().height=P.graph().height}var w=["nodesep","edgesep","ranksep","marginx","marginy"],p={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},g=["acyclicer","ranker","rankdir","align","rankalign"],M=["width","height","rank"],R={width:0,height:0},F=["minlen","weight","width","height","labeloffset"],H={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},J=["labelpos"];function A(b){let P=new y({multigraph:!0,compound:!0}),D=I(b.graph());return P.setGraph(Object.assign({},p,Z(D,w),f.pick(D,g))),b.nodes().forEach(j=>{let Q=I(b.node(j)),te=Z(Q,M);Object.keys(R).forEach(re=>{te[re]===void 0&&(te[re]=R[re])}),P.setNode(j,te),P.setParent(j,b.parent(j))}),b.edges().forEach(j=>{let Q=I(b.edge(j));P.setEdge(j,Object.assign({},H,Z(Q,F),f.pick(Q,J)))}),P}function z(b){let P=b.graph();P.ranksep/=2,b.edges().forEach(D=>{let j=b.edge(D);j.minlen*=2,j.labelpos.toLowerCase()!=="c"&&(P.rankdir==="TB"||P.rankdir==="BT"?j.width+=j.labeloffset:j.height+=j.labeloffset)})}function k(b){b.edges().forEach(P=>{let D=b.edge(P);if(D.width&&D.height){let j=b.node(P.v),Q={rank:(b.node(P.w).rank-j.rank)/2+j.rank,e:P};f.addDummyNode(b,"edge-proxy",Q,"_ep")}})}function V(b){let P=0;b.nodes().forEach(D=>{let j=b.node(D);j.borderTop&&(j.minRank=b.node(j.borderTop).rank,j.maxRank=b.node(j.borderBottom).rank,P=Math.max(P,j.maxRank))}),b.graph().maxRank=P}function v(b){b.nodes().forEach(P=>{let D=b.node(P);D.dummy==="edge-proxy"&&(b.edge(D.e).labelRank=D.rank,b.removeNode(P))})}function $(b){let P=Number.POSITIVE_INFINITY,D=0,j=Number.POSITIVE_INFINITY,Q=0,te=b.graph(),re=te.marginx||0,ie=te.marginy||0;function me(B){let T=B.x,G=B.y,U=B.width,W=B.height;P=Math.min(P,T-U/2),D=Math.max(D,T+U/2),j=Math.min(j,G-W/2),Q=Math.max(Q,G+W/2)}b.nodes().forEach(B=>me(b.node(B))),b.edges().forEach(B=>{let T=b.edge(B);Object.hasOwn(T,"x")&&me(T)}),P-=re,j-=ie,b.nodes().forEach(B=>{let T=b.node(B);T.x-=P,T.y-=j}),b.edges().forEach(B=>{let T=b.edge(B);T.points.forEach(G=>{G.x-=P,G.y-=j}),Object.hasOwn(T,"x")&&(T.x-=P),Object.hasOwn(T,"y")&&(T.y-=j)}),te.width=D-P+re,te.height=Q-j+ie}function _(b){b.edges().forEach(P=>{let D=b.edge(P),j=b.node(P.v),Q=b.node(P.w),te,re;D.points?(te=D.points[0],re=D.points[D.points.length-1]):(D.points=[],te=Q,re=j),D.points.unshift(f.intersectRect(j,te)),D.points.push(f.intersectRect(Q,re))})}function C(b){b.edges().forEach(P=>{let D=b.edge(P);if(Object.hasOwn(D,"x"))switch((D.labelpos==="l"||D.labelpos==="r")&&(D.width-=D.labeloffset),D.labelpos){case"l":D.x-=D.width/2+D.labeloffset;break;case"r":D.x+=D.width/2+D.labeloffset;break}})}function N(b){b.edges().forEach(P=>{let D=b.edge(P);D.reversed&&D.points.reverse()})}function O(b){b.nodes().forEach(P=>{if(b.children(P).length){let D=b.node(P),j=b.node(D.borderTop),Q=b.node(D.borderBottom),te=b.node(D.borderLeft[D.borderLeft.length-1]),re=b.node(D.borderRight[D.borderRight.length-1]);D.width=Math.abs(re.x-te.x),D.height=Math.abs(Q.y-j.y),D.x=te.x+D.width/2,D.y=j.y+D.height/2}}),b.nodes().forEach(P=>{b.node(P).dummy==="border"&&b.removeNode(P)})}function L(b){b.edges().forEach(P=>{if(P.v===P.w){var D=b.node(P.v);D.selfEdges||(D.selfEdges=[]),D.selfEdges.push({e:P,label:b.edge(P)}),b.removeEdge(P)}})}function q(b){var P=f.buildLayerMatrix(b);P.forEach(D=>{var j=0;D.forEach((Q,te)=>{var re=b.node(Q);re.order=te+j,(re.selfEdges||[]).forEach(ie=>{f.addDummyNode(b,"selfedge",{width:ie.label.width,height:ie.label.height,rank:re.rank,order:te+ ++j,e:ie.e,label:ie.label},"_se")}),delete re.selfEdges})})}function X(b){b.nodes().forEach(P=>{var D=b.node(P);if(D.dummy==="selfedge"){var j=b.node(D.e.v),Q=j.x+j.width/2,te=j.y,re=D.x-Q,ie=j.height/2;b.setEdge(D.e,D.label),b.removeNode(P),D.label.points=[{x:Q+2*re/3,y:te-ie},{x:Q+5*re/6,y:te-ie},{x:Q+re,y:te},{x:Q+5*re/6,y:te+ie},{x:Q+2*re/3,y:te+ie}],D.label.x=D.x,D.label.y=D.y}})}function Z(b,P){return f.mapValues(f.pick(b,P),Number)}function I(b){var P={};return b&&Object.entries(b).forEach(([D,j])=>{typeof D=="string"&&(D=D.toLowerCase()),P[D]=j}),P}}),Jc=Ne((e,t)=>{var n=De(),o=Ke().Graph;t.exports={debugOrdering:r};function r(i){let s=n.buildLayerMatrix(i),a=new o({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+i.node(l).rank)}),i.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),s.forEach((l,c)=>{let u="layer"+c;a.setNode(u,{rank:"same"}),l.reduce((d,h)=>(a.setEdge(d,h,{style:"invis"}),h))}),a}}),Qc=Ne((e,t)=>{t.exports="2.0.4"}),ed=Ne((e,t)=>{t.exports={graphlib:Ke(),layout:Zc(),debug:Jc(),util:{time:De().time,notime:De().notime},version:Qc()}});const Wr=ed();function mn(e){return cr()?(dn(e),!0):!1}function ct(e){return typeof e=="function"?e():S(e)}const td=typeof window<"u"&&typeof document<"u",nd=e=>typeof e<"u",od=Object.prototype.toString,rd=e=>od.call(e)==="[object Object]",id=()=>{};function sd(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}const hs=e=>e();function ad(e=hs){const t=ce(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:Ha(t),pause:n,resume:o,eventFilter:r}}function Xr(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function ld(e,t,n={}){const{eventFilter:o=hs,...r}=n;return _e(e,sd(o,t),r)}function Bt(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:s,resume:a,isActive:l}=ad(o);return{stop:ld(e,t,{...r,eventFilter:i}),pause:s,resume:a,isActive:l}}function ud(e,t={}){if(!fr(e))return Xi(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Fa(()=>({get(){return e.value[o]},set(r){var i;if((i=ct(t.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=r,e.value=a}else{const a={...e.value,[o]:r};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=r}}));return n}function Uo(e,t=!1){function n(d,{flush:h="sync",deep:f=!1,timeout:y,throwOnTimeout:E}={}){let m=null;const w=[new Promise(p=>{m=_e(e,g=>{d(g)!==t&&(m?.(),p(g))},{flush:h,deep:f,immediate:!0})})];return y!=null&&w.push(Xr(y,E).then(()=>ct(e)).finally(()=>m?.())),Promise.race(w)}function o(d,h){if(!fr(d))return n(g=>g===d,h);const{flush:f="sync",deep:y=!1,timeout:E,throwOnTimeout:m}=h??{};let x=null;const p=[new Promise(g=>{x=_e([e,d],([M,R])=>{t!==(M===R)&&(x?.(),g(M))},{flush:f,deep:y,immediate:!0})})];return E!=null&&p.push(Xr(E,m).then(()=>ct(e)).finally(()=>(x?.(),ct(e)))),Promise.race(p)}function r(d){return n(h=>!!h,d)}function i(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,h){return n(f=>{const y=Array.from(f);return y.includes(d)||y.includes(ct(d))},h)}function c(d){return u(1,d)}function u(d=1,h){let f=-1;return n(()=>(f+=1,f>=d),h)}return Array.isArray(ct(e))?{toMatch:n,toContains:l,changed:c,changedTimes:u,get not(){return Uo(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:r,toBeNull:i,toBeNaN:a,toBeUndefined:s,changed:c,changedTimes:u,get not(){return Uo(e,!t)}}}function Ko(e){return Uo(e)}function cd(e){var t;const n=ct(e);return(t=n?.$el)!=null?t:n}const ps=td?window:void 0;function gs(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=ps):[t,n,o,r]=e,!t)return id;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},a=(u,d,h,f)=>(u.addEventListener(d,h,f),()=>u.removeEventListener(d,h,f)),l=_e(()=>[cd(t),ct(r)],([u,d])=>{if(s(),!u)return;const h=rd(d)?{...d}:d;i.push(...n.flatMap(f=>o.map(y=>a(u,f,y,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return mn(c),c}function dd(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Ur(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:r=ps,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=dd(t);return gs(r,i,u=>{u.repeat&&ct(a)||l(u)&&n(u)},s)}function fd(e){return JSON.parse(JSON.stringify(e))}function To(e,t,n,o={}){var r,i,s;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:d,shouldEmit:h}=o,f=on(),y=n||f?.emit||((r=f?.$emit)==null?void 0:r.bind(f))||((s=(i=f?.proxy)==null?void 0:i.$emit)==null?void 0:s.bind(f?.proxy));let E=c;t||(t="modelValue"),E=E||`update:${t.toString()}`;const m=p=>a?typeof a=="function"?a(p):fd(p):p,x=()=>nd(e[t])?m(e[t]):d,w=p=>{h?h(p)&&y(E,p):y(E,p)};if(l){const p=x(),g=ce(p);let M=!1;return _e(()=>e[t],R=>{M||(M=!0,g.value=m(R),pt(()=>M=!1))}),_e(g,R=>{!M&&(R!==e[t]||u)&&w(R)},{deep:u}),g}else return ne({get(){return x()},set(p){w(p)}})}var hd={value:()=>{}};function wo(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Fn(n)}function Fn(e){this._=e}function pd(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Fn.prototype=wo.prototype={constructor:Fn,on:function(e,t){var n=this._,o=pd(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=gd(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Kr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Kr(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function gd(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Kr(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=hd,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Zo="http://www.w3.org/1999/xhtml";const Zr={svg:"http://www.w3.org/2000/svg",xhtml:Zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function _o(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Zr.hasOwnProperty(t)?{space:Zr[t],local:e}:e}function vd(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Zo&&t.documentElement.namespaceURI===Zo?t.createElement(e):t.createElementNS(n,e)}}function md(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vs(e){var t=_o(e);return(t.local?md:vd)(t)}function yd(){}function xr(e){return e==null?yd:function(){return this.querySelector(e)}}function wd(e){typeof e!="function"&&(e=xr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new Fe(o,this._parents)}function _d(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bd(){return[]}function ms(e){return e==null?bd:function(){return this.querySelectorAll(e)}}function xd(e){return function(){return _d(e.apply(this,arguments))}}function Ed(e){typeof e=="function"?e=xd(e):e=ms(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new Fe(o,r)}function ys(e){return function(){return this.matches(e)}}function ws(e){return function(t){return t.matches(e)}}var kd=Array.prototype.find;function Sd(e){return function(){return kd.call(this.children,e)}}function Cd(){return this.firstElementChild}function Nd(e){return this.select(e==null?Cd:Sd(typeof e=="function"?e:ws(e)))}var $d=Array.prototype.filter;function Md(){return Array.from(this.children)}function Pd(e){return function(){return $d.call(this.children,e)}}function Td(e){return this.selectAll(e==null?Md:Pd(typeof e=="function"?e:ws(e)))}function Od(e){typeof e!="function"&&(e=ys(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Fe(o,this._parents)}function _s(e){return new Array(e.length)}function Id(){return new Fe(this._enter||this._groups.map(_s),this._parents)}function Jn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Jn.prototype={constructor:Jn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Dd(e){return function(){return e}}function Ad(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Jn(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function zd(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,d=i.length,h=new Array(u),f;for(a=0;a<u;++a)(l=t[a])&&(h[a]=f=s.call(l,l.__data__,a,t)+"",c.has(f)?r[a]=l:c.set(f,l));for(a=0;a<d;++a)f=s.call(e,i[a],a,i)+"",(l=c.get(f))?(o[a]=l,l.__data__=i[a],c.delete(f)):n[a]=new Jn(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(h[a])===l&&(r[a]=l)}function Rd(e){return e.__data__}function Bd(e,t){if(!arguments.length)return Array.from(this,Rd);var n=t?zd:Ad,o=this._parents,r=this._groups;typeof e!="function"&&(e=Dd(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],h=d.length,f=Ld(e.call(u,u&&u.__data__,c,o)),y=f.length,E=a[c]=new Array(y),m=s[c]=new Array(y),x=l[c]=new Array(h);n(u,d,E,m,x,f,t);for(var w=0,p=0,g,M;w<y;++w)if(g=E[w]){for(w>=p&&(p=w+1);!(M=m[p])&&++p<y;);g._next=M||null}}return s=new Fe(s,o),s._enter=a,s._exit=l,s}function Ld(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Vd(){return new Fe(this._exit||this._groups.map(_s),this._parents)}function Fd(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Hd(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,h=a[l]=new Array(d),f,y=0;y<d;++y)(f=c[y]||u[y])&&(h[y]=f);for(;l<r;++l)a[l]=n[l];return new Fe(a,this._parents)}function qd(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Gd(e){e||(e=jd);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new Fe(r,this._parents).order()}function jd(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Yd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Wd(){return Array.from(this)}function Xd(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Ud(){let e=0;for(const t of this)++e;return e}function Kd(){return!this.node()}function Zd(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Jd(e){return function(){this.removeAttribute(e)}}function Qd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ef(e,t){return function(){this.setAttribute(e,t)}}function tf(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function nf(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function of(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function rf(e,t){var n=_o(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Qd:Jd:typeof t=="function"?n.local?of:nf:n.local?tf:ef)(n,t))}function bs(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function sf(e){return function(){this.style.removeProperty(e)}}function af(e,t,n){return function(){this.style.setProperty(e,t,n)}}function lf(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function uf(e,t,n){return arguments.length>1?this.each((t==null?sf:typeof t=="function"?lf:af)(e,t,n??"")):Zt(this.node(),e)}function Zt(e,t){return e.style.getPropertyValue(t)||bs(e).getComputedStyle(e,null).getPropertyValue(t)}function cf(e){return function(){delete this[e]}}function df(e,t){return function(){this[e]=t}}function ff(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function hf(e,t){return arguments.length>1?this.each((t==null?cf:typeof t=="function"?ff:df)(e,t)):this.node()[e]}function xs(e){return e.trim().split(/^|\s+/)}function Er(e){return e.classList||new Es(e)}function Es(e){this._node=e,this._names=xs(e.getAttribute("class")||"")}Es.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ks(e,t){for(var n=Er(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Ss(e,t){for(var n=Er(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function pf(e){return function(){ks(this,e)}}function gf(e){return function(){Ss(this,e)}}function vf(e,t){return function(){(t.apply(this,arguments)?ks:Ss)(this,e)}}function mf(e,t){var n=xs(e+"");if(arguments.length<2){for(var o=Er(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?vf:t?pf:gf)(n,t))}function yf(){this.textContent=""}function wf(e){return function(){this.textContent=e}}function _f(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function bf(e){return arguments.length?this.each(e==null?yf:(typeof e=="function"?_f:wf)(e)):this.node().textContent}function xf(){this.innerHTML=""}function Ef(e){return function(){this.innerHTML=e}}function kf(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Sf(e){return arguments.length?this.each(e==null?xf:(typeof e=="function"?kf:Ef)(e)):this.node().innerHTML}function Cf(){this.nextSibling&&this.parentNode.appendChild(this)}function Nf(){return this.each(Cf)}function $f(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Mf(){return this.each($f)}function Pf(e){var t=typeof e=="function"?e:vs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Tf(){return null}function Of(e,t){var n=typeof e=="function"?e:vs(e),o=t==null?Tf:typeof t=="function"?t:xr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function If(){var e=this.parentNode;e&&e.removeChild(this)}function Df(){return this.each(If)}function Af(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function zf(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Rf(e){return this.select(e?zf:Af)}function Bf(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Lf(e){return function(t){e.call(this,t,this.__data__)}}function Vf(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ff(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function Hf(e,t,n){return function(){var o=this.__on,r,i=Lf(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function qf(e,t,n){var o=Vf(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Hf:Ff,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Cs(e,t,n){var o=bs(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Gf(e,t){return function(){return Cs(this,e,t)}}function jf(e,t){return function(){return Cs(this,e,t.apply(this,arguments))}}function Yf(e,t){return this.each((typeof t=="function"?jf:Gf)(e,t))}function*Wf(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var Ns=[null];function Fe(e,t){this._groups=e,this._parents=t}function Cn(){return new Fe([[document.documentElement]],Ns)}function Xf(){return this}Fe.prototype=Cn.prototype={constructor:Fe,select:wd,selectAll:Ed,selectChild:Nd,selectChildren:Td,filter:Od,data:Bd,enter:Id,exit:Vd,join:Fd,merge:Hd,selection:Xf,order:qd,sort:Gd,call:Yd,nodes:Wd,node:Xd,size:Ud,empty:Kd,each:Zd,attr:rf,style:uf,property:hf,classed:mf,text:bf,html:Sf,raise:Nf,lower:Mf,append:Pf,insert:Of,remove:Df,clone:Rf,datum:Bf,on:qf,dispatch:Yf,[Symbol.iterator]:Wf};function Ye(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],Ns)}function Uf(e){let t;for(;t=e.sourceEvent;)e=t;return e}function et(e,t){if(e=Uf(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Kf={passive:!1},yn={capture:!0,passive:!1};function Oo(e){e.stopImmediatePropagation()}function jt(e){e.preventDefault(),e.stopImmediatePropagation()}function $s(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",jt,yn);"onselectstart"in t?n.on("selectstart.drag",jt,yn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ms(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",jt,yn),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Pn=e=>()=>e;function Jo(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Jo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Zf(e){return!e.ctrlKey&&!e.button}function Jf(){return this.parentNode}function Qf(e,t){return t??{x:e.x,y:e.y}}function eh(){return navigator.maxTouchPoints||"ontouchstart"in this}function th(){var e=Zf,t=Jf,n=Qf,o=eh,r={},i=wo("start","drag","end"),s=0,a,l,c,u,d=0;function h(g){g.on("mousedown.drag",f).filter(o).on("touchstart.drag",m).on("touchmove.drag",x,Kf).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(g,M){if(!(u||!e.call(this,g,M))){var R=p(this,t.call(this,g,M),g,M,"mouse");R&&(Ye(g.view).on("mousemove.drag",y,yn).on("mouseup.drag",E,yn),$s(g.view),Oo(g),c=!1,a=g.clientX,l=g.clientY,R("start",g))}}function y(g){if(jt(g),!c){var M=g.clientX-a,R=g.clientY-l;c=M*M+R*R>d}r.mouse("drag",g)}function E(g){Ye(g.view).on("mousemove.drag mouseup.drag",null),Ms(g.view,c),jt(g),r.mouse("end",g)}function m(g,M){if(e.call(this,g,M)){var R=g.changedTouches,F=t.call(this,g,M),H=R.length,J,A;for(J=0;J<H;++J)(A=p(this,F,g,M,R[J].identifier,R[J]))&&(Oo(g),A("start",g,R[J]))}}function x(g){var M=g.changedTouches,R=M.length,F,H;for(F=0;F<R;++F)(H=r[M[F].identifier])&&(jt(g),H("drag",g,M[F]))}function w(g){var M=g.changedTouches,R=M.length,F,H;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),F=0;F<R;++F)(H=r[M[F].identifier])&&(Oo(g),H("end",g,M[F]))}function p(g,M,R,F,H,J){var A=i.copy(),z=et(J||R,M),k,V,v;if((v=n.call(g,new Jo("beforestart",{sourceEvent:R,target:h,identifier:H,active:s,x:z[0],y:z[1],dx:0,dy:0,dispatch:A}),F))!=null)return k=v.x-z[0]||0,V=v.y-z[1]||0,function $(_,C,N){var O=z,L;switch(_){case"start":r[H]=$,L=s++;break;case"end":delete r[H],--s;case"drag":z=et(N||C,M),L=s;break}A.call(_,g,new Jo(_,{sourceEvent:C,subject:v,target:h,identifier:H,active:L,x:z[0]+k,y:z[1]+V,dx:z[0]-O[0],dy:z[1]-O[1],dispatch:A}),F)}}return h.filter=function(g){return arguments.length?(e=typeof g=="function"?g:Pn(!!g),h):e},h.container=function(g){return arguments.length?(t=typeof g=="function"?g:Pn(g),h):t},h.subject=function(g){return arguments.length?(n=typeof g=="function"?g:Pn(g),h):n},h.touchable=function(g){return arguments.length?(o=typeof g=="function"?g:Pn(!!g),h):o},h.on=function(){var g=i.on.apply(i,arguments);return g===i?h:g},h.clickDistance=function(g){return arguments.length?(d=(g=+g)*g,h):Math.sqrt(d)},h}function kr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ps(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Nn(){}var wn=.7,Qn=1/wn,Yt="\\s*([+-]?\\d+)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nh=/^#([0-9a-f]{3,8})$/,oh=new RegExp(`^rgb\\(${Yt},${Yt},${Yt}\\)$`),rh=new RegExp(`^rgb\\(${it},${it},${it}\\)$`),ih=new RegExp(`^rgba\\(${Yt},${Yt},${Yt},${_n}\\)$`),sh=new RegExp(`^rgba\\(${it},${it},${it},${_n}\\)$`),ah=new RegExp(`^hsl\\(${_n},${it},${it}\\)$`),lh=new RegExp(`^hsla\\(${_n},${it},${it},${_n}\\)$`),Jr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};kr(Nn,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Qr,formatHex:Qr,formatHex8:uh,formatHsl:ch,formatRgb:ei,toString:ei});function Qr(){return this.rgb().formatHex()}function uh(){return this.rgb().formatHex8()}function ch(){return Ts(this).formatHsl()}function ei(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=nh.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ti(t):n===3?new Re(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=oh.exec(e))?new Re(t[1],t[2],t[3],1):(t=rh.exec(e))?new Re(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ih.exec(e))?Tn(t[1],t[2],t[3],t[4]):(t=sh.exec(e))?Tn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ah.exec(e))?ri(t[1],t[2]/100,t[3]/100,1):(t=lh.exec(e))?ri(t[1],t[2]/100,t[3]/100,t[4]):Jr.hasOwnProperty(e)?ti(Jr[e]):e==="transparent"?new Re(NaN,NaN,NaN,0):null}function ti(e){return new Re(e>>16&255,e>>8&255,e&255,1)}function Tn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Re(e,t,n,o)}function dh(e){return e instanceof Nn||(e=It(e)),e?(e=e.rgb(),new Re(e.r,e.g,e.b,e.opacity)):new Re}function Qo(e,t,n,o){return arguments.length===1?dh(e):new Re(e,t,n,o??1)}function Re(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}kr(Re,Qo,Ps(Nn,{brighter(e){return e=e==null?Qn:Math.pow(Qn,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Re(Pt(this.r),Pt(this.g),Pt(this.b),eo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ni,formatHex:ni,formatHex8:fh,formatRgb:oi,toString:oi}));function ni(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}`}function fh(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}${Mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function oi(){const e=eo(this.opacity);return`${e===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${e===1?")":`, ${e})`}`}function eo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mt(e){return e=Pt(e),(e<16?"0":"")+e.toString(16)}function ri(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new We(e,t,n,o)}function Ts(e){if(e instanceof We)return new We(e.h,e.s,e.l,e.opacity);if(e instanceof Nn||(e=It(e)),!e)return new We;if(e instanceof We)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new We(s,a,l,e.opacity)}function hh(e,t,n,o){return arguments.length===1?Ts(e):new We(e,t,n,o??1)}function We(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}kr(We,hh,Ps(Nn,{brighter(e){return e=e==null?Qn:Math.pow(Qn,e),new We(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new We(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Re(Io(e>=240?e-240:e+120,r,o),Io(e,r,o),Io(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new We(ii(this.h),On(this.s),On(this.l),eo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=eo(this.opacity);return`${e===1?"hsl(":"hsla("}${ii(this.h)}, ${On(this.s)*100}%, ${On(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ii(e){return e=(e||0)%360,e<0?e+360:e}function On(e){return Math.max(0,Math.min(1,e||0))}function Io(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Sr=e=>()=>e;function ph(e,t){return function(n){return e+n*t}}function gh(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function vh(e){return(e=+e)==1?Os:function(t,n){return n-t?gh(t,n,e):Sr(isNaN(t)?n:t)}}function Os(e,t){var n=t-e;return n?ph(e,n):Sr(isNaN(e)?t:e)}const to=(function e(t){var n=vh(t);function o(r,i){var s=n((r=Qo(r)).r,(i=Qo(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=Os(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=e,o})(1);function mh(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function yh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wh(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=hn(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function _h(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bh(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=hn(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var er=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Do=new RegExp(er.source,"g");function xh(e){return function(){return e}}function Eh(e){return function(t){return e(t)+""}}function Is(e,t){var n=er.lastIndex=Do.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=er.exec(e))&&(r=Do.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:tt(o,r)})),n=Do.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Eh(l[0].x):xh(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function hn(e,t){var n=typeof t,o;return t==null||n==="boolean"?Sr(t):(n==="number"?tt:n==="string"?(o=It(t))?(t=o,to):Is:t instanceof It?to:t instanceof Date?_h:yh(t)?mh:Array.isArray(t)?wh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bh:tt)(e,t)}var si=180/Math.PI,tr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ds(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*si,skewX:Math.atan(l)*si,scaleX:s,scaleY:a}}var In;function kh(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?tr:Ds(t.a,t.b,t.c,t.d,t.e,t.f)}function Sh(e){return e==null||(In||(In=document.createElementNS("http://www.w3.org/2000/svg","g")),In.setAttribute("transform",e),!(e=In.transform.baseVal.consolidate()))?tr:(e=e.matrix,Ds(e.a,e.b,e.c,e.d,e.e,e.f))}function As(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,h,f,y){if(c!==d||u!==h){var E=f.push("translate(",null,t,null,n);y.push({i:E-4,x:tt(c,d)},{i:E-2,x:tt(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function s(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(r(d)+"rotate(",null,o)-2,x:tt(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,h){c!==u?h.push({i:d.push(r(d)+"skewX(",null,o)-2,x:tt(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,h,f,y){if(c!==d||u!==h){var E=f.push(r(f)+"scale(",null,",",null,")");y.push({i:E-4,x:tt(c,d)},{i:E-2,x:tt(u,h)})}else(d!==1||h!==1)&&f.push(r(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,h),s(c.rotate,u.rotate,d,h),a(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var y=-1,E=h.length,m;++y<E;)d[(m=h[y]).i]=m.x(f);return d.join("")}}}var Ch=As(kh,"px, ","px)","deg)"),Nh=As(Sh,", ",")",")"),$h=1e-12;function ai(e){return((e=Math.exp(e))+1/e)/2}function Mh(e){return((e=Math.exp(e))-1/e)/2}function Ph(e){return((e=Math.exp(2*e))-1)/(e+1)}const Hn=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],d=s[1],h=s[2],f=u-a,y=d-l,E=f*f+y*y,m,x;if(E<$h)x=Math.log(h/c)/t,m=function(F){return[a+F*f,l+F*y,c*Math.exp(t*F*x)]};else{var w=Math.sqrt(E),p=(h*h-c*c+o*E)/(2*c*n*w),g=(h*h-c*c-o*E)/(2*h*n*w),M=Math.log(Math.sqrt(p*p+1)-p),R=Math.log(Math.sqrt(g*g+1)-g);x=(R-M)/t,m=function(F){var H=F*x,J=ai(M),A=c/(n*w)*(J*Ph(t*H+M)-Mh(M));return[a+A*f,l+A*y,c*J/ai(t*H+M)]}}return m.duration=x*1e3*t/Math.SQRT2,m}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);var Jt=0,ln=0,sn=0,zs=1e3,no,un,oo=0,Dt=0,bo=0,bn=typeof performance=="object"&&performance.now?performance:Date,Rs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Cr(){return Dt||(Rs(Th),Dt=bn.now()+bo)}function Th(){Dt=0}function ro(){this._call=this._time=this._next=null}ro.prototype=Bs.prototype={constructor:ro,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Cr():+n)+(t==null?0:+t),!this._next&&un!==this&&(un?un._next=this:no=this,un=this),this._call=e,this._time=n,nr()},stop:function(){this._call&&(this._call=null,this._time=1/0,nr())}};function Bs(e,t,n){var o=new ro;return o.restart(e,t,n),o}function Oh(){Cr(),++Jt;for(var e=no,t;e;)(t=Dt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Jt}function li(){Dt=(oo=bn.now())+bo,Jt=ln=0;try{Oh()}finally{Jt=0,Dh(),Dt=0}}function Ih(){var e=bn.now(),t=e-oo;t>zs&&(bo-=t,oo=e)}function Dh(){for(var e,t=no,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:no=n);un=e,nr(o)}function nr(e){if(!Jt){ln&&(ln=clearTimeout(ln));var t=e-Dt;t>24?(e<1/0&&(ln=setTimeout(li,e-bn.now()-bo)),sn&&(sn=clearInterval(sn))):(sn||(oo=bn.now(),sn=setInterval(Ih,zs)),Jt=1,Rs(li))}}function ui(e,t,n){var o=new ro;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Ah=wo("start","end","cancel","interrupt"),zh=[],Ls=0,ci=1,or=2,qn=3,di=4,rr=5,Gn=6;function xo(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Rh(e,n,{name:t,index:o,group:r,on:Ah,tween:zh,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ls})}function Nr(e,t){var n=Je(e,t);if(n.state>Ls)throw new Error("too late; already scheduled");return n}function lt(e,t){var n=Je(e,t);if(n.state>qn)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Rh(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Bs(i,0,n.time);function i(c){n.state=ci,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,h,f;if(n.state!==ci)return l();for(u in o)if(f=o[u],f.name===n.name){if(f.state===qn)return ui(s);f.state===di?(f.state=Gn,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[u]):+u<t&&(f.state=Gn,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[u])}if(ui(function(){n.state===qn&&(n.state=di,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=or,n.on.call("start",e,e.__data__,n.index,n.group),n.state===or){for(n.state=qn,r=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++d]=f);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=rr,1),d=-1,h=r.length;++d<h;)r[d].call(e,u);n.state===rr&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Gn,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function jn(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>or&&o.state<rr,o.state=Gn,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function Bh(e){return this.each(function(){jn(this,e)})}function Lh(e,t){var n,o;return function(){var r=lt(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Vh(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=lt(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Fh(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Je(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?Lh:Vh)(n,e,t))}function $r(e,t,n){var o=e._id;return e.each(function(){var r=lt(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Je(r,o).value[t]}}function Vs(e,t){var n;return(typeof t=="number"?tt:t instanceof It?to:(n=It(t))?(t=n,to):Is)(e,t)}function Hh(e){return function(){this.removeAttribute(e)}}function qh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gh(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function jh(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function Yh(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Wh(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Xh(e,t){var n=_o(e),o=n==="transform"?Nh:Vs;return this.attrTween(e,typeof t=="function"?(n.local?Wh:Yh)(n,o,$r(this,"attr."+e,t)):t==null?(n.local?qh:Hh)(n):(n.local?jh:Gh)(n,o,t))}function Uh(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Kh(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Zh(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Kh(e,i)),n}return r._value=t,r}function Jh(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Uh(e,i)),n}return r._value=t,r}function Qh(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=_o(e);return this.tween(n,(o.local?Zh:Jh)(o,t))}function ep(e,t){return function(){Nr(this,e).delay=+t.apply(this,arguments)}}function tp(e,t){return t=+t,function(){Nr(this,e).delay=t}}function np(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ep:tp)(t,e)):Je(this.node(),t).delay}function op(e,t){return function(){lt(this,e).duration=+t.apply(this,arguments)}}function rp(e,t){return t=+t,function(){lt(this,e).duration=t}}function ip(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?op:rp)(t,e)):Je(this.node(),t).duration}function sp(e,t){if(typeof t!="function")throw new Error;return function(){lt(this,e).ease=t}}function ap(e){var t=this._id;return arguments.length?this.each(sp(t,e)):Je(this.node(),t).ease}function lp(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;lt(this,e).ease=n}}function up(e){if(typeof e!="function")throw new Error;return this.each(lp(this._id,e))}function cp(e){typeof e!="function"&&(e=ys(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new mt(o,this._parents,this._name,this._id)}function dp(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,d=s[a]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;a<o;++a)s[a]=t[a];return new mt(s,this._parents,this._name,this._id)}function fp(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function hp(e,t,n){var o,r,i=fp(t)?Nr:lt;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function pp(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(hp(n,e,t))}function gp(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function vp(){return this.on("end.remove",gp(this._id))}function mp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xr(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,h=0;h<l;++h)(u=a[h])&&(d=e.call(u,u.__data__,h,a))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,xo(c[h],t,n,h,c,Je(u,n)));return new mt(i,this._parents,t,n)}function yp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ms(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,y=Je(u,n),E=0,m=h.length;E<m;++E)(f=h[E])&&xo(f,t,n,E,h,y);i.push(h),s.push(u)}return new mt(i,s,t,n)}var wp=Cn.prototype.constructor;function _p(){return new wp(this._groups,this._parents)}function bp(e,t){var n,o,r;return function(){var i=Zt(this,e),s=(this.style.removeProperty(e),Zt(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Fs(e){return function(){this.style.removeProperty(e)}}function xp(e,t,n){var o,r=n+"",i;return function(){var s=Zt(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Ep(e,t,n){var o,r,i;return function(){var s=Zt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Zt(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function kp(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=lt(this,e),c=l.on,u=l.value[i]==null?a||(a=Fs(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Sp(e,t,n){var o=(e+="")=="transform"?Ch:Vs;return t==null?this.styleTween(e,bp(e,o)).on("end.style."+e,Fs(e)):typeof t=="function"?this.styleTween(e,Ep(e,o,$r(this,"style."+e,t))).each(kp(this._id,e)):this.styleTween(e,xp(e,o,t),n).on("end.style."+e,null)}function Cp(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Np(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Cp(e,s,n)),o}return i._value=t,i}function $p(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Np(e,t,n??""))}function Mp(e){return function(){this.textContent=e}}function Pp(e){return function(){var t=e(this);this.textContent=t??""}}function Tp(e){return this.tween("text",typeof e=="function"?Pp($r(this,"text",e)):Mp(e==null?"":e+""))}function Op(e){return function(t){this.textContent=e.call(this,t)}}function Ip(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Op(r)),t}return o._value=e,o}function Dp(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ip(e))}function Ap(){for(var e=this._name,t=this._id,n=Hs(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Je(l,t);xo(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new mt(o,this._parents,e,n)}function zp(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=lt(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var Rp=0;function mt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Hs(){return++Rp}var ut=Cn.prototype;mt.prototype={constructor:mt,select:mp,selectAll:yp,selectChild:ut.selectChild,selectChildren:ut.selectChildren,filter:cp,merge:dp,selection:_p,transition:Ap,call:ut.call,nodes:ut.nodes,node:ut.node,size:ut.size,empty:ut.empty,each:ut.each,on:pp,attr:Xh,attrTween:Qh,style:Sp,styleTween:$p,text:Tp,textTween:Dp,remove:vp,tween:Fh,delay:np,duration:ip,ease:ap,easeVarying:up,end:zp,[Symbol.iterator]:ut[Symbol.iterator]};function Bp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Lp={time:null,delay:0,duration:250,ease:Bp};function Vp(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Fp(e){var t,n;e instanceof mt?(t=e._id,e=e._name):(t=Hs(),(n=Lp).time=Cr(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&xo(l,e,t,c,s,n||Vp(l,t));return new mt(o,this._parents,e,t)}Cn.prototype.interrupt=Bh;Cn.prototype.transition=Fp;const Dn=e=>()=>e;function Hp(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function ft(e,t,n){this.k=e,this.x=t,this.y=n}ft.prototype={constructor:ft,scale:function(e){return e===1?this:new ft(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ft(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Qt=new ft(1,0,0);ft.prototype;function Ao(e){e.stopImmediatePropagation()}function an(e){e.preventDefault(),e.stopImmediatePropagation()}function qp(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Gp(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function fi(){return this.__zoom||Qt}function jp(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yp(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wp(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Xp(){var e=qp,t=Gp,n=Wp,o=jp,r=Yp,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Hn,c=wo("start","zoom","end"),u,d,h,f=500,y=150,E=0,m=10;function x(v){v.property("__zoom",fi).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",J).on("dblclick.zoom",A).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(v,$,_,C){var N=v.selection?v.selection():v;N.property("__zoom",fi),v!==N?M(v,$,_,C):N.interrupt().each(function(){R(this,arguments).event(C).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},x.scaleBy=function(v,$,_,C){x.scaleTo(v,function(){var N=this.__zoom.k,O=typeof $=="function"?$.apply(this,arguments):$;return N*O},_,C)},x.scaleTo=function(v,$,_,C){x.transform(v,function(){var N=t.apply(this,arguments),O=this.__zoom,L=_==null?g(N):typeof _=="function"?_.apply(this,arguments):_,q=O.invert(L),X=typeof $=="function"?$.apply(this,arguments):$;return n(p(w(O,X),L,q),N,s)},_,C)},x.translateBy=function(v,$,_,C){x.transform(v,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),s)},null,C)},x.translateTo=function(v,$,_,C,N){x.transform(v,function(){var O=t.apply(this,arguments),L=this.__zoom,q=C==null?g(O):typeof C=="function"?C.apply(this,arguments):C;return n(Qt.translate(q[0],q[1]).scale(L.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof _=="function"?-_.apply(this,arguments):-_),O,s)},C,N)};function w(v,$){return $=Math.max(i[0],Math.min(i[1],$)),$===v.k?v:new ft($,v.x,v.y)}function p(v,$,_){var C=$[0]-_[0]*v.k,N=$[1]-_[1]*v.k;return C===v.x&&N===v.y?v:new ft(v.k,C,N)}function g(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function M(v,$,_,C){v.on("start.zoom",function(){R(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(C).end()}).tween("zoom",function(){var N=this,O=arguments,L=R(N,O).event(C),q=t.apply(N,O),X=_==null?g(q):typeof _=="function"?_.apply(N,O):_,Z=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),I=N.__zoom,b=typeof $=="function"?$.apply(N,O):$,P=l(I.invert(X).concat(Z/I.k),b.invert(X).concat(Z/b.k));return function(D){if(D===1)D=b;else{var j=P(D),Q=Z/j[2];D=new ft(Q,X[0]-j[0]*Q,X[1]-j[1]*Q)}L.zoom(null,D)}})}function R(v,$,_){return!_&&v.__zooming||new F(v,$)}function F(v,$){this.that=v,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(v,$),this.taps=0}F.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,$){return this.mouse&&v!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var $=Ye(this.that).datum();c.call(v,this.that,new Hp(v,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),$)}};function H(v,...$){if(!e.apply(this,arguments))return;var _=R(this,$).event(v),C=this.__zoom,N=Math.max(i[0],Math.min(i[1],C.k*Math.pow(2,o.apply(this,arguments)))),O=et(v);if(_.wheel)(_.mouse[0][0]!==O[0]||_.mouse[0][1]!==O[1])&&(_.mouse[1]=C.invert(_.mouse[0]=O)),clearTimeout(_.wheel);else{if(C.k===N)return;_.mouse=[O,C.invert(O)],jn(this),_.start()}an(v),_.wheel=setTimeout(L,y),_.zoom("mouse",n(p(w(C,N),_.mouse[0],_.mouse[1]),_.extent,s));function L(){_.wheel=null,_.end()}}function J(v,...$){if(h||!e.apply(this,arguments))return;var _=v.currentTarget,C=R(this,$,!0).event(v),N=Ye(v.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",Z,!0),O=et(v,_),L=v.clientX,q=v.clientY;$s(v.view),Ao(v),C.mouse=[O,this.__zoom.invert(O)],jn(this),C.start();function X(I){if(an(I),!C.moved){var b=I.clientX-L,P=I.clientY-q;C.moved=b*b+P*P>E}C.event(I).zoom("mouse",n(p(C.that.__zoom,C.mouse[0]=et(I,_),C.mouse[1]),C.extent,s))}function Z(I){N.on("mousemove.zoom mouseup.zoom",null),Ms(I.view,C.moved),an(I),C.event(I).end()}}function A(v,...$){if(e.apply(this,arguments)){var _=this.__zoom,C=et(v.changedTouches?v.changedTouches[0]:v,this),N=_.invert(C),O=_.k*(v.shiftKey?.5:2),L=n(p(w(_,O),C,N),t.apply(this,$),s);an(v),a>0?Ye(this).transition().duration(a).call(M,L,C,v):Ye(this).call(x.transform,L,C,v)}}function z(v,...$){if(e.apply(this,arguments)){var _=v.touches,C=_.length,N=R(this,$,v.changedTouches.length===C).event(v),O,L,q,X;for(Ao(v),L=0;L<C;++L)q=_[L],X=et(q,this),X=[X,this.__zoom.invert(X),q.identifier],N.touch0?!N.touch1&&N.touch0[2]!==X[2]&&(N.touch1=X,N.taps=0):(N.touch0=X,O=!0,N.taps=1+!!u);u&&(u=clearTimeout(u)),O&&(N.taps<2&&(d=X[0],u=setTimeout(function(){u=null},f)),jn(this),N.start())}}function k(v,...$){if(this.__zooming){var _=R(this,$).event(v),C=v.changedTouches,N=C.length,O,L,q,X;for(an(v),O=0;O<N;++O)L=C[O],q=et(L,this),_.touch0&&_.touch0[2]===L.identifier?_.touch0[0]=q:_.touch1&&_.touch1[2]===L.identifier&&(_.touch1[0]=q);if(L=_.that.__zoom,_.touch1){var Z=_.touch0[0],I=_.touch0[1],b=_.touch1[0],P=_.touch1[1],D=(D=b[0]-Z[0])*D+(D=b[1]-Z[1])*D,j=(j=P[0]-I[0])*j+(j=P[1]-I[1])*j;L=w(L,Math.sqrt(D/j)),q=[(Z[0]+b[0])/2,(Z[1]+b[1])/2],X=[(I[0]+P[0])/2,(I[1]+P[1])/2]}else if(_.touch0)q=_.touch0[0],X=_.touch0[1];else return;_.zoom("touch",n(p(L,q,X),_.extent,s))}}function V(v,...$){if(this.__zooming){var _=R(this,$).event(v),C=v.changedTouches,N=C.length,O,L;for(Ao(v),h&&clearTimeout(h),h=setTimeout(function(){h=null},f),O=0;O<N;++O)L=C[O],_.touch0&&_.touch0[2]===L.identifier?delete _.touch0:_.touch1&&_.touch1[2]===L.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(L=et(L,this),Math.hypot(d[0]-L[0],d[1]-L[1])<m)){var q=Ye(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return x.wheelDelta=function(v){return arguments.length?(o=typeof v=="function"?v:Dn(+v),x):o},x.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Dn(!!v),x):e},x.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Dn(!!v),x):r},x.extent=function(v){return arguments.length?(t=typeof v=="function"?v:Dn([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),x):t},x.scaleExtent=function(v){return arguments.length?(i[0]=+v[0],i[1]=+v[1],x):[i[0],i[1]]},x.translateExtent=function(v){return arguments.length?(s[0][0]=+v[0][0],s[1][0]=+v[1][0],s[0][1]=+v[0][1],s[1][1]=+v[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(v){return arguments.length?(n=v,x):n},x.duration=function(v){return arguments.length?(a=+v,x):a},x.interpolate=function(v){return arguments.length?(l=v,x):l},x.on=function(){var v=c.on.apply(c,arguments);return v===c?x:v},x.clickDistance=function(v){return arguments.length?(E=(v=+v)*v,x):Math.sqrt(E)},x.tapDistance=function(v){return arguments.length?(m=+v,x):m},x}var ue=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ue||{}),Mr=(e=>(e.Partial="partial",e.Full="full",e))(Mr||{}),Nt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Nt||{}),St=(e=>(e.Strict="strict",e.Loose="loose",e))(St||{}),io=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(io||{}),pn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(pn||{}),qs=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(qs||{});const Up=["INPUT","SELECT","TEXTAREA"],Kp=typeof document<"u"?document:null;function ir(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,r=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,i=typeof o?.closest=="function"?o.closest(".nokey"):null;return Up.includes(o?.nodeName)||r||!!i}function Zp(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function hi(e,t,n,o){const r=t.replace("+",`
3
- `).replace(`
4
-
5
- `,`
6
- +`).split(`
7
- `).map(s=>s.trim().toLowerCase());if(r.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const i=r.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===r[a]);return o&&n.delete(e.toLowerCase()),i}function Jp(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Qp(n.code,e);return Array.isArray(e)?e.some(r=>hi(n[o],r,t,n.type==="keyup")):hi(n[o],e,t,n.type==="keyup")}}function Qp(e,t){return t.includes(e)?"code":"key"}function gn(e,t){const n=ne(()=>Ee(t?.target)??Kp),o=dt(Ee(e)===!0);let r=!1;const i=new Set;let s=l(Ee(e));_e(()=>Ee(e),(c,u)=>{typeof u=="boolean"&&typeof c!="boolean"&&a(),s=l(c)},{immediate:!0}),gs(["blur","contextmenu"],a),Ur((...c)=>s(...c),c=>{var u,d;const h=Ee(t?.actInsideInputWithModifier)??!0,f=Ee(t?.preventDefault)??!1;if(r=Zp(c),(!r||r&&!h)&&ir(c))return;const E=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target,m=E?.nodeName==="BUTTON"||E?.nodeName==="A";!f&&(r||!m)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Ur((...c)=>s(...c),c=>{const u=Ee(t?.actInsideInputWithModifier)??!0;if(o.value){if((!r||r&&!u)&&ir(c))return;r=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){r=!1,i.clear(),o.value=Ee(e)===!0}function l(c){return c===null?(a(),()=>!1):typeof c=="boolean"?(a(),o.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?Jp(c,i):c}return o}const Gs="vue-flow__node-desc",js="vue-flow__edge-desc",eg="vue-flow__aria-live",Ys=["Enter"," ","Escape"],Wt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function so(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function ao(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Eo(e){return{width:e.offsetWidth,height:e.offsetHeight}}function At(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Ws(e,t){return{x:At(e.x,t[0][0],t[1][0]),y:At(e.y,t[0][1],t[1][1])}}function pi(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Ct(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Tt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Ct(e)}function cn(e){return Tt(e)&&"computedPosition"in e}function An(e){return!Number.isNaN(e)&&Number.isFinite(e)}function tg(e){return An(e.width)&&An(e.height)&&An(e.x)&&An(e.y)}function ng(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:qt({width:0,height:0}),computedPosition:qt({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Oe(e.data)?e.data:{},events:qt(Oe(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Xs(e,t,n){var o,r;const i={id:e.id.toString(),type:e.type??t?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(r=e.targetHandle)==null?void 0:r.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:Oe(e.data)?e.data:{},events:qt(Oe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function Us(e,t,n,o){const r=typeof e=="string"?e:e.id,i=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===r&&i.add(a[o]);return t.filter(a=>i.has(a.id))}function og(...e){if(e.length===3){const[i,s,a]=e;return Us(i,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Ct(i)&&i.source===o).map(i=>n.find(s=>Tt(s)&&s.id===i.target))}function rg(...e){if(e.length===3){const[i,s,a]=e;return Us(i,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(i=>Ct(i)&&i.target===o).map(i=>n.find(s=>Tt(s)&&s.id===i.source))}function Ks({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function ig(e,t){return t.some(n=>Ct(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function xn({x:e,y:t},{x:n,y:o,zoom:r}){return{x:e*r+n,y:t*r+o}}function En({x:e,y:t},{x:n,y:o,zoom:r},i=!1,s=[1,1]){const a={x:(e-n)/r,y:(t-o)/r};return i?ko(a,s):a}function sg(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Zs({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function ag({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Js(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=sg(t,Zs({...o.computedPosition,...o.dimensions}))}return ag(t)}function Qs(e,t,n={x:0,y:0,zoom:1},o=!1,r=!1){const i={...En(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:l,selectable:c=!0,hidden:u=!1}=a,d=l.width??a.width??null,h=l.height??a.height??null;if(r&&!c||u)continue;const f=ao(i,so(a)),y=d===null||h===null,E=o&&f>0,m=(d??0)*(h??0);(y||E||f>=m||a.dragging)&&s.push(a)}return s}function ea(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function Lt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return $n(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function lg(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Lt(e,n),r=Lt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Lt(e.top??e.y??0,n),r=Lt(e.bottom??e.y??0,n),i=Lt(e.left??e.x??0,t),s=Lt(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ug(e,t,n,o,r,i){const{x:s,y:a}=xn(e,{x:t,y:n,zoom:o}),{x:l,y:c}=xn({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),u=r-l,d=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(d)}}function gi(e,t,n,o,r,i=.1){const s=lg(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=At(c,o,r),d=e.x+e.width/2,h=e.y+e.height/2,f=t/2-d*u,y=n/2-h*u,E=ug(e,f,y,u,t,n),m={left:Math.min(E.left-s.left,0),top:Math.min(E.top-s.top,0),right:Math.min(E.right-s.right,0),bottom:Math.min(E.bottom-s.bottom,0)};return{x:f-m.left+m.right,y:y-m.top+m.bottom,zoom:u}}function cg(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function ta(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:ta(n,t):!1}function kn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function vi(e){const t=e.ctrlKey&&lo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function mi(e,t,n){return e<t?At(Math.abs(e-t),1,t)/t:e>n?-At(Math.abs(e-n),1,t)/t:0}function na(e,t,n=15,o=40){const r=mi(e.x,o,t.width-o)*n,i=mi(e.y,o,t.height-o)*n;return[r,i]}function zo(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let r={};if(typeof t.style=="function"?r={...t.style(t)}:t.style&&(r={...t.style}),r.width=r.width??`${t.dimensions.width}px`,r.height=r.height??`${t.dimensions.height}px`,n>0)if(typeof r.width=="string"){const i=Number(r.width.replace("px",""));r.width=`${i+n}px`}else r.width+=n;if(o>0)if(typeof r.height=="string"){const i=Number(r.height.replace("px",""));r.height=`${i+o}px`}else r.height+=o;if(e.position.x<0){const i=Math.abs(e.position.x);if(t.position.x=t.position.x-i,typeof r.width=="string"){const s=Number(r.width.replace("px",""));r.width=`${s+i}px`}else r.width+=i;e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);if(t.position.y=t.position.y-i,typeof r.height=="string"){const s=Number(r.height.replace("px",""));r.height=`${s+i}px`}else r.height+=i;e.position.y=0}t.dimensions.width=Number(r.width.toString().replace("px","")),t.dimensions.height=Number(r.height.toString().replace("px","")),typeof t.style=="function"?t.style=i=>{const s=t.style;return{...s(i),...r}}:t.style={...t.style,...r}}}}function yi(e,t){var n,o;const r=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of r)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const i=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(cn(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&cn(l)&&zo(s,l)}break;case"dimensions":if(cn(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(s.style={...s.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`}),typeof a.resizing<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&cn(l)&&(!!l.dimensions.width&&!!l.dimensions.height?zo(s,l):pt(()=>{zo(s,l)}))}break}return t}function _t(e,t){return{id:e,type:"select",selected:t}}function wi(e){return{item:e,type:"add"}}function _i(e){return{id:e,type:"remove"}}function bi(e,t,n,o,r){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:r||null,type:"remove"}}function bt(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(_t(i.id,s)))}return o}const xi=()=>{};function se(e){const t=new Set;let n=xi,o=()=>!1;const r=()=>t.size>0||o(),i=h=>{n=h},s=()=>{n=xi},a=h=>{o=h},l=()=>{o=()=>!1},c=h=>{t.delete(h)};return{on:h=>{t.add(h);const f=()=>c(h);return mn(f),{off:f}},off:c,trigger:h=>{const f=[n];return r()?f.push(...t):e&&f.push(e),Promise.allSettled(f.map(y=>y(h)))},hasListeners:r,listeners:t,setEmitter:i,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function Ei(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function dg(e,t,n,o){var r,i;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!ta(l,e))&&(l.draggable||t&&typeof l.draggable>"u")&&e.get(a)&&s.set(a,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((r=l.computedPosition)==null?void 0:r.x)||0,y:n.y-((i=l.computedPosition)==null?void 0:i.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:{...l.dimensions},expandParent:l.expandParent});return Array.from(s.values())}function Ro({id:e,dragItems:t,findNode:n}){const o=[];for(const r of t){const i=n(r.id);i&&o.push(i)}return[e?o.find(r=>r.id===e):o[0],o]}function oa(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function fg(e,t,n){const[o,r,i,s]=typeof e!="string"?oa(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-r,n.computedPosition.y+n.dimensions.height-i]]:!1}function hg(e,t,n,o){let r=e.extent||n;if((r==="parent"||!Array.isArray(r)&&r?.range==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const i=fg(r,e,o);i&&(r=i)}else t(new ze(Ie.NODE_EXTENT_INVALID,e.id)),r=n;else if(Array.isArray(r)){const i=o?.computedPosition.x||0,s=o?.computedPosition.y||0;r=[[r[0][0]+i,r[0][1]+s],[r[1][0]+i,r[1][1]+s]]}else if(r!=="parent"&&r?.range&&Array.isArray(r.range)){const[i,s,a,l]=oa(r.padding),c=o?.computedPosition.x||0,u=o?.computedPosition.y||0;r=[[r.range[0][0]+c+l,r.range[0][1]+u+i],[r.range[1][0]+c-s,r.range[1][1]+u-a]]}return r==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:r}function pg({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Pr(e,t,n,o,r){const i=pg(e.dimensions,hg(e,n,o,r)),s=Ws(t,i);return{position:{x:s.x-(r?.computedPosition.x||0),y:s.y-(r?.computedPosition.y||0)},computedPosition:s}}function en(e,t,n=ue.Left,o=!1){const r=(t?.x??0)+e.computedPosition.x,i=(t?.y??0)+e.computedPosition.y,{width:s,height:a}=t??yg(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case ue.Top:return{x:r+s/2,y:i};case ue.Right:return{x:r+s,y:i+a/2};case ue.Bottom:return{x:r+s/2,y:i+a};case ue.Left:return{x:r,y:i+a/2}}}function ki(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function gg({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:i,width:s,height:a,viewport:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Zs({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),h=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*h)>0}function vg(e,t,n=!1){const o=typeof e.zIndex=="number";let r=o?e.zIndex:0;const i=t(e.source),s=t(e.target);return!i||!s?0:(n&&(r=o?e.zIndex:Math.max(i.computedPosition.z||0,s.computedPosition.z||0)),r)}var Ie=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Ie||{});const Si={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
8
- Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
9
- Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
10
- Node: ${e}
11
- Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
12
- Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
13
- Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
14
- Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
15
- Edge: ${e}
16
- Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
17
- Edge: ${e}
18
- Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
19
- Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
20
- Edge: ${e}
21
- Source: ${t}
22
- Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
23
- Edge: ${e}
24
- Source: ${t}
25
- Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
26
- Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
27
- Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class ze extends Error{constructor(t,...n){var o;super((o=Si[t])==null?void 0:o.call(Si,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Tr(e){return"clientX"in e}function mg(e){return"sourceEvent"in e}function nt(e,t){const n=Tr(e);let o,r;return n?(o=e.clientX,r=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,r=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,r=e.changedTouches[0].clientY):(o=0,r=0),{x:o-(t?.left??0),y:r-(t?.top??0)}}const lo=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function yg(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function ko(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const wg=()=>!0;function Bo(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function _g(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ao(r,so(i))>0&&o.push(i);return o}const bg=250;function xg(e,t,n,o){var r,i;let s=[],a=Number.POSITIVE_INFINITY;const l=_g(e,n,t+bg);for(const c of l){const u=[...((r=c.handleBounds)==null?void 0:r.source)??[],...((i=c.handleBounds)==null?void 0:i.target)??[]];for(const d of u){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:f}=en(c,d,d.position,!0),y=Math.sqrt((h-e.x)**2+(f-e.y)**2);y>t||(y<a?(s=[{...d,x:h,y:f}],a=y):y===a&&s.push({...d,x:h,y:f}))}}if(!s.length)return null;if(s.length>1){const c=o.type==="source"?"target":"source";return s.find(u=>u.type===c)??s[0]}return s[0]}function Ci(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=wg},u,d,h,f){const y=i==="target",E=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:m,y:x}=nt(e),w=s.elementFromPoint(m,x),p=w?.classList.contains(`${a}-flow__handle`)?w:E,g={handleDomNode:p,isValid:!1,connection:null,toHandle:null};if(p){const M=ra(void 0,p),R=p.getAttribute("data-nodeid"),F=p.getAttribute("data-handleid"),H=p.classList.contains("connectable"),J=p.classList.contains("connectableend");if(!R||!M)return g;const A={source:y?R:o,sourceHandle:y?F:r,target:y?o:R,targetHandle:y?r:F};g.connection=A;const k=H&&J&&(n===St.Strict?y&&M==="source"||!y&&M==="target":R!==o||F!==r);g.isValid=k&&c(A,{nodes:d,edges:u,sourceNode:h(A.source),targetNode:h(A.target)}),g.toHandle=ia(R,M,F,f,n,!0)}return g}function ra(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Eg(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function kg(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function ia(e,t,n,o,r,i=!1){var s,a,l;const c=o.get(e);if(!c)return null;const u=r===St.Strict?(s=c.handleBounds)==null?void 0:s[t]:[...((a=c.handleBounds)==null?void 0:a.source)??[],...((l=c.handleBounds)==null?void 0:l.target)??[]],d=(n?u?.find(h=>h.id===n):u?.[0])??null;return d&&i?{...d,...en(c,d,d.position,!0)}:d}const sr={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top},Sg=["production","prod"];function $n(e,...t){sa()&&console.warn(`[Vue Flow]: ${e}`,...t)}function sa(){return!Sg.includes("production")}function Ni(e,t,n,o,r){const i=t.querySelectorAll(`.vue-flow__handle.${e}`);return i?.length?Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Eo(s)}}):null}function ar(e,t,n,o,r,i=!1,s){r.value=!1,e.selected?(i||e.selected&&t)&&(o([e]),pt(()=>{s.blur()})):n([e])}function Oe(e){return typeof S(e)<"u"}function Cg(e,t,n,o){if(!e||!e.source||!e.target)return n(new ze(Ie.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let r;return Ct(e)?r=e:r={...e,id:Ks(e)},r=Xs(r,void 0,o),ig(r,t)?!1:r}function Ng(e,t,n,o,r){if(!t.source||!t.target)return r(new ze(Ie.EDGE_INVALID,e.id)),!1;if(!n)return r(new ze(Ie.EDGE_NOT_FOUND,e.id)),!1;const{id:i,...s}=e;return{...s,id:o?Ks(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function $i(e,t,n){const o={},r=[];for(let i=0;i<e.length;++i){const s=e[i];if(!Tt(s)){n(new ze(Ie.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const a=ng(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),r[i]=a}for(const i of r){const s=t(i.parentNode)||r.find(a=>a.id===i.parentNode);i.parentNode&&!s&&n(new ze(Ie.NODE_MISSING_PARENT,i.id,i.parentNode)),(i.parentNode||o[i.id])&&(o[i.id]&&(i.isParent=!0),s&&(s.isParent=!0))}return r}function Mi(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function Lo(e,t,n){e.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Mi("source",l,u,e,r,s),Mi("target",l,c,e,i,a)}}function Pi(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Vo(e,t,n,o,r,i,s,a){const l=[];for(const c of e){const u=Ct(c)?c:Cg(c,a,r,i);if(!u)continue;const d=n(u.source),h=n(u.target);if(!d||!h){r(new ze(Ie.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!d){r(new ze(Ie.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!h){r(new ze(Ie.EDGE_TARGET_MISSING,u.id,u.target));continue}if(t&&!t(u,{edges:a,nodes:s,sourceNode:d,targetNode:h})){r(new ze(Ie.EDGE_INVALID,u.id));continue}const f=o(u.id);l.push({...Xs(u,f,i),sourceNode:d,targetNode:h})}return l}const Ti=Symbol("vueFlow"),aa=Symbol("nodeId"),la=Symbol("nodeRef"),$g=Symbol("edgeId"),Mg=Symbol("edgeRef"),So=Symbol("slots");function ua(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:r,nodeLookup:i,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:c,autoPanSpeed:u,nodesDraggable:d,panBy:h,findNode:f,multiSelectionActive:y,nodesSelectionActive:E,selectNodesOnDrag:m,removeSelectedElements:x,addSelectedNodes:w,updateNodePositions:p,emits:g}=Pe(),{onStart:M,onDrag:R,onStop:F,onClick:H,el:J,disabled:A,id:z,selectable:k,dragHandle:V}=e,v=dt(!1);let $=[],_,C=null,N={x:void 0,y:void 0},O={x:0,y:0},L=null,q=!1,X=!1,Z=0,I=!1;const b=Og(),P=({x:ie,y:me})=>{N={x:ie,y:me};let B=!1;if($=$.map(T=>{const G={x:ie-T.distance.x,y:me-T.distance.y},{computedPosition:U}=Pr(T,n.value?ko(G,o.value):G,g.error,s.value,T.parentNode?f(T.parentNode):void 0);return B=B||T.position.x!==U.x||T.position.y!==U.y,T.position=U,T}),X=X||B,!!B&&(p($,!0,!0),v.value=!0,L)){const[T,G]=Ro({id:z,dragItems:$,findNode:f});R({event:L,node:T,nodes:G})}},D=()=>{if(!C)return;const[ie,me]=na(O,C,u.value);if(ie!==0||me!==0){const B={x:(N.x??0)-ie/l.value.zoom,y:(N.y??0)-me/l.value.zoom};h({x:ie,y:me})&&P(B)}Z=requestAnimationFrame(D)},j=(ie,me)=>{q=!0;const B=f(z);!m.value&&!y.value&&B&&(B.selected||x()),B&&Ee(k)&&m.value&&ar(B,y.value,w,x,E,!1,me);const T=b(ie.sourceEvent);if(N=T,$=dg(i.value,d.value,T,z),$.length){const[G,U]=Ro({id:z,dragItems:$,findNode:f});M({event:ie.sourceEvent,node:G,nodes:U})}},Q=(ie,me)=>{var B;ie.sourceEvent.type==="touchmove"&&ie.sourceEvent.touches.length>1||(X=!1,a.value===0&&j(ie,me),N=b(ie.sourceEvent),C=((B=t.value)==null?void 0:B.getBoundingClientRect())||null,O=nt(ie.sourceEvent,C))},te=(ie,me)=>{const B=b(ie.sourceEvent);if(!I&&q&&c.value&&(I=!0,D()),!q){const T=B.xSnapped-(N.x??0),G=B.ySnapped-(N.y??0);Math.sqrt(T*T+G*G)>a.value&&j(ie,me)}(N.x!==B.xSnapped||N.y!==B.ySnapped)&&$.length&&q&&(L=ie.sourceEvent,O=nt(ie.sourceEvent,C),P(B))},re=ie=>{let me=!1;if(!q&&!v.value&&!y.value){const B=ie.sourceEvent,T=b(B),G=T.xSnapped-(N.x??0),U=T.ySnapped-(N.y??0),W=Math.sqrt(G*G+U*U);W!==0&&W<=a.value&&(H?.(B),me=!0)}if($.length&&!me){X&&(p($,!1,!1),X=!1);const[B,T]=Ro({id:z,dragItems:$,findNode:f});F({event:ie.sourceEvent,node:B,nodes:T})}$=[],v.value=!1,I=!1,q=!1,N={x:void 0,y:void 0},cancelAnimationFrame(Z)};return _e([()=>Ee(A),J],([ie,me],B,T)=>{if(me){const G=Ye(me);ie||(_=th().on("start",U=>Q(U,me)).on("drag",U=>te(U,me)).on("end",U=>re(U)).filter(U=>{const W=U.target,ae=Ee(V);return!U.button&&(!r.value||!Ei(W,`.${r.value}`,me)&&(!ae||Ei(W,ae,me)))}),G.call(_)),T(()=>{G.on(".drag",null),_&&(_.on("start",null),_.on("drag",null),_.on("end",null))})}}),v}function Pg(){return{doubleClick:se(),click:se(),mouseEnter:se(),mouseMove:se(),mouseLeave:se(),contextMenu:se(),updateStart:se(),update:se(),updateEnd:se()}}function Tg(e,t){const n=Pg();return n.doubleClick.on(o=>{var r,i;t.edgeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.edgeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.edgeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.edgeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.edgeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.edgeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.updateStart.on(o=>{var r,i;t.edgeUpdateStart(o),(i=(r=e.events)==null?void 0:r.updateStart)==null||i.call(r,o)}),n.update.on(o=>{var r,i;t.edgeUpdate(o),(i=(r=e.events)==null?void 0:r.update)==null||i.call(r,o)}),n.updateEnd.on(o=>{var r,i;t.edgeUpdateEnd(o),(i=(r=e.events)==null?void 0:r.updateEnd)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function Og(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=Pe();return r=>{var i;const s=((i=o.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},a=mg(r)?r.sourceEvent:r,{x:l,y:c}=nt(a,s),u=En({x:l,y:c},e.value),{x:d,y:h}=n.value?ko(u,t.value):u;return{xSnapped:d,ySnapped:h,...u}}}function zn(){return!0}function ca({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:r,onEdgeUpdate:i,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:c,connectionRadius:u,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:f,autoPanOnConnect:y,autoPanSpeed:E,findNode:m,panBy:x,startConnection:w,updateConnection:p,endConnection:g,emits:M,viewport:R,edges:F,nodes:H,isValidConnection:J,nodeLookup:A}=Pe();let z=null,k=!1,V=null;function v(_){var C;const N=Ee(n)==="target",O=Tr(_),L=pi(_.target),q=_.currentTarget;if(q&&(O&&_.button===0||!O)){let X=function(de){B=nt(de,re),P=xg(En(B,R.value,!1,[1,1]),u.value,A.value,U),T||(G(),T=!0);const ye=Ci(de,{handle:P,connectionMode:c.value,fromNodeId:Ee(t),fromHandleId:Ee(e),fromType:N?"target":"source",isValidConnection:b,doc:L,lib:"vue",flowId:a,nodeLookup:A.value},F.value,H.value,m,A.value);V=ye.handleDomNode,z=ye.connection,k=kg(!!P,ye.isValid);const xe={...pe,isValid:k,to:ye.toHandle&&k?xn({x:ye.toHandle.x,y:ye.toHandle.y},R.value):B,toHandle:ye.toHandle,toPosition:k&&ye.toHandle?ye.toHandle.position:sr[U.position],toNode:ye.toHandle?A.value.get(ye.toHandle.nodeId):null};if(k&&P&&pe?.toHandle&&xe.toHandle&&pe.toHandle.type===xe.toHandle.type&&pe.toHandle.nodeId===xe.toHandle.nodeId&&pe.toHandle.id===xe.toHandle.id&&pe.to.x===xe.to.x&&pe.to.y===xe.to.y)return;const ke=P??ye.toHandle;if(p(ke&&k?xn({x:ke.x,y:ke.y},R.value):B,ke,Eg(!!ke,k)),pe=xe,!P&&!k&&!V)return Bo(me);z&&z.source!==z.target&&V&&(Bo(me),me=V,V.classList.add("connecting","vue-flow__handle-connecting"),V.classList.toggle("valid",!!k),V.classList.toggle("vue-flow__handle-valid",!!k))},Z=function(de){"touches"in de&&de.touches.length>0||((P||V)&&z&&k&&(i?i(de,z):M.connect(z)),M.connectEnd(de),r&&s?.(de),Bo(me),cancelAnimationFrame(D),g(de),T=!1,k=!1,z=null,V=null,L.removeEventListener("mousemove",X),L.removeEventListener("mouseup",Z),L.removeEventListener("touchmove",X),L.removeEventListener("touchend",Z))};const I=m(Ee(t));let b=Ee(o)||J.value||zn;!b&&I&&(b=(N?I.isValidSourcePos:I.isValidTargetPos)||zn);let P,D=0;const{x:j,y:Q}=nt(_),te=ra(Ee(r),q),re=(C=l.value)==null?void 0:C.getBoundingClientRect();if(!re||!te)return;const ie=ia(Ee(t),te,Ee(e),A.value,c.value);if(!ie)return;let me,B=nt(_,re),T=!1;const G=()=>{if(!y.value)return;const[de,ye]=na(B,re,E.value);x({x:de,y:ye}),D=requestAnimationFrame(G)},U={...ie,nodeId:Ee(t),type:te,position:ie.position},W=A.value.get(Ee(t)),le={inProgress:!0,isValid:null,from:en(W,U,ue.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:W,to:B,toHandle:null,toPosition:sr[U.position],toNode:null};w({nodeId:Ee(t),id:Ee(e),type:te,position:q?.getAttribute("data-handlepos")||ue.Top,...B},{x:j-re.left,y:Q-re.top}),M.connectStart({event:_,nodeId:Ee(t),handleId:Ee(e),handleType:te});let pe=le;L.addEventListener("mousemove",X),L.addEventListener("mouseup",Z),L.addEventListener("touchmove",X),L.addEventListener("touchend",Z)}}function $(_){var C,N;if(!d.value)return;const O=Ee(n)==="target";if(!h.value){M.clickConnectStart({event:_,nodeId:Ee(t),handleId:Ee(e)}),w({nodeId:Ee(t),type:Ee(n),id:Ee(e),position:ue.Top,...nt(_)},void 0,!0);return}let L=Ee(o)||J.value||zn;const q=m(Ee(t));if(!L&&q&&(L=(O?q.isValidSourcePos:q.isValidTargetPos)||zn),q&&(typeof q.connectable>"u"?f.value:q.connectable)===!1)return;const X=pi(_.target),Z=Ci(_,{handle:{nodeId:Ee(t),id:Ee(e),type:Ee(n),position:ue.Top,...nt(_)},connectionMode:c.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:L,doc:X,lib:"vue",flowId:a,nodeLookup:A.value},F.value,H.value,m,A.value),I=((C=Z.connection)==null?void 0:C.source)===((N=Z.connection)==null?void 0:N.target);Z.isValid&&Z.connection&&!I&&M.connect(Z.connection),M.clickConnectEnd(_),g(_,!0)}return{handlePointerDown:v,handleClick:$}}function Ig(){return nn(aa,"")}function da(e){const t=e??Ig()??"",n=nn(la,ce(null)),{findNode:o,edges:r,emits:i}=Pe(),s=o(t);return s||i.error(new ze(Ie.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:ne(()=>o(s.parentNode)),connectedEdges:ne(()=>ea([s],r.value))}}function Dg(){return{doubleClick:se(),click:se(),mouseEnter:se(),mouseMove:se(),mouseLeave:se(),contextMenu:se(),dragStart:se(),drag:se(),dragStop:se()}}function Ag(e,t){const n=Dg();return n.doubleClick.on(o=>{var r,i;t.nodeDoubleClick(o),(i=(r=e.events)==null?void 0:r.doubleClick)==null||i.call(r,o)}),n.click.on(o=>{var r,i;t.nodeClick(o),(i=(r=e.events)==null?void 0:r.click)==null||i.call(r,o)}),n.mouseEnter.on(o=>{var r,i;t.nodeMouseEnter(o),(i=(r=e.events)==null?void 0:r.mouseEnter)==null||i.call(r,o)}),n.mouseMove.on(o=>{var r,i;t.nodeMouseMove(o),(i=(r=e.events)==null?void 0:r.mouseMove)==null||i.call(r,o)}),n.mouseLeave.on(o=>{var r,i;t.nodeMouseLeave(o),(i=(r=e.events)==null?void 0:r.mouseLeave)==null||i.call(r,o)}),n.contextMenu.on(o=>{var r,i;t.nodeContextMenu(o),(i=(r=e.events)==null?void 0:r.contextMenu)==null||i.call(r,o)}),n.dragStart.on(o=>{var r,i;t.nodeDragStart(o),(i=(r=e.events)==null?void 0:r.dragStart)==null||i.call(r,o)}),n.drag.on(o=>{var r,i;t.nodeDrag(o),(i=(r=e.events)==null?void 0:r.drag)==null||i.call(r,o)}),n.dragStop.on(o=>{var r,i;t.nodeDragStop(o),(i=(r=e.events)==null?void 0:r.dragStop)==null||i.call(r,o)}),Object.entries(n).reduce((o,[r,i])=>(o.emit[r]=i.trigger,o.on[r]=i.on,o),{emit:{},on:{}})}function fa(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:i,nodesDraggable:s,emits:a}=Pe();return(l,c=!1)=>{const u=i.value?r.value[0]:5,d=i.value?r.value[1]:5,h=c?4:1,f=l.x*u*h,y=l.y*d*h,E=[];for(const m of e.value)if(m.draggable||s&&typeof m.draggable>"u"){const x={x:m.computedPosition.x+f,y:m.computedPosition.y+y},{position:w}=Pr(m,x,a.error,t.value,m.parentNode?o(m.parentNode):void 0);E.push({id:m.id,position:w,from:m.position,distance:{x:l.x,y:l.y},dimensions:m.dimensions})}n(E,!0,!1)}}const Rn=.1,zg=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function wt(){return $n("Viewport not initialized yet."),Promise.resolve(!1)}const Rg={zoomIn:wt,zoomOut:wt,zoomTo:wt,fitView:wt,setCenter:wt,fitBounds:wt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:wt,setTransform:wt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Bg(e){function t(o,r){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(r?.interpolate==="linear"?hn:Hn).scaleBy(Fo(e.d3Selection,r?.duration,r?.ease,()=>{i(!0)}),o):i(!1)})}function n(o,r,i,s){return new Promise(a=>{var l;const{x:c,y:u}=Ws({x:-o,y:-r},e.translateExtent),d=Qt.translate(-c,-u).scale(i);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate(s?.interpolate==="linear"?hn:Hn).transform(Fo(e.d3Selection,s?.duration,s?.ease,()=>{a(!0)}),d):a(!1)})}return ne(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:r=>t(1.2,r),zoomOut:r=>t(1/1.2,r),zoomTo:(r,i)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(i?.interpolate==="linear"?hn:Hn).scaleTo(Fo(e.d3Selection,i?.duration,i?.ease,()=>{s(!0)}),r):s(!1)}),setViewport:(r,i)=>n(r.x,r.y,r.zoom,i),setTransform:(r,i)=>n(r.x,r.y,r.zoom,i),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(r={padding:Rn,includeHiddenNodes:!1,duration:0})=>{var i,s;const a=[];for(const h of e.nodes)h.dimensions.width&&h.dimensions.height&&(r?.includeHiddenNodes||!h.hidden)&&(!((i=r.nodes)!=null&&i.length)||(s=r.nodes)!=null&&s.length&&r.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=Js(a),{x:c,y:u,zoom:d}=gi(l,e.dimensions.width,e.dimensions.height,r.minZoom??e.minZoom,r.maxZoom??e.maxZoom,r.padding??Rn);return n(c,u,d,r)},setCenter:(r,i,s)=>{const a=typeof s?.zoom<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-r*a,c=e.dimensions.height/2-i*a;return n(l,c,a,s)},fitBounds:(r,i={padding:Rn})=>{const{x:s,y:a,zoom:l}=gi(r,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??Rn);return n(s,a,l,i)},project:r=>En(r,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x-i,y:r.y-s};return En(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:r=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:r.x+i,y:r.y+s};return xn(a,e.viewport)}return{x:0,y:0}}}:Rg)}function Fo(e,t=0,n=zg,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function Lg(e,t,n){const o=Ui(!0);return o.run(()=>{const r=()=>{o.run(()=>{let E,m,x=!!(n.nodes.value.length||n.edges.value.length);E=Bt([e.modelValue,()=>{var w,p;return(p=(w=e.modelValue)==null?void 0:w.value)==null?void 0:p.length}],([w])=>{w&&Array.isArray(w)&&(m?.pause(),n.setElements(w),!m&&!x&&w.length?x=!0:m?.resume())}),m=Bt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([w,p])=>{var g;(g=e.modelValue)!=null&&g.value&&Array.isArray(e.modelValue.value)&&(E?.pause(),e.modelValue.value=[...w,...p],pt(()=>{E?.resume()}))},{immediate:x}),dn(()=>{E?.stop(),m?.stop()})})},i=()=>{o.run(()=>{let E,m,x=!!n.nodes.value.length;E=Bt([e.nodes,()=>{var w,p;return(p=(w=e.nodes)==null?void 0:w.value)==null?void 0:p.length}],([w])=>{w&&Array.isArray(w)&&(m?.pause(),n.setNodes(w),!m&&!x&&w.length?x=!0:m?.resume())}),m=Bt([n.nodes,()=>n.nodes.value.length],([w])=>{var p;(p=e.nodes)!=null&&p.value&&Array.isArray(e.nodes.value)&&(E?.pause(),e.nodes.value=[...w],pt(()=>{E?.resume()}))},{immediate:x}),dn(()=>{E?.stop(),m?.stop()})})},s=()=>{o.run(()=>{let E,m,x=!!n.edges.value.length;E=Bt([e.edges,()=>{var w,p;return(p=(w=e.edges)==null?void 0:w.value)==null?void 0:p.length}],([w])=>{w&&Array.isArray(w)&&(m?.pause(),n.setEdges(w),!m&&!x&&w.length?x=!0:m?.resume())}),m=Bt([n.edges,()=>n.edges.value.length],([w])=>{var p;(p=e.edges)!=null&&p.value&&Array.isArray(e.edges.value)&&(E?.pause(),e.edges.value=[...w],pt(()=>{E?.resume()}))},{immediate:x}),dn(()=>{E?.stop(),m?.stop()})})},a=()=>{o.run(()=>{_e(()=>t.maxZoom,()=>{t.maxZoom&&Oe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{_e(()=>t.minZoom,()=>{t.minZoom&&Oe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{_e(()=>t.translateExtent,()=>{t.translateExtent&&Oe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},u=()=>{o.run(()=>{_e(()=>t.nodeExtent,()=>{t.nodeExtent&&Oe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{_e(()=>t.applyDefault,()=>{Oe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const E=async m=>{let x=m;typeof t.autoConnect=="function"&&(x=await t.autoConnect(m)),x!==!1&&n.addEdges([x])};_e(()=>t.autoConnect,()=>{Oe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),_e(n.autoConnect,(m,x,w)=>{m?n.onConnect(E):n.hooks.value.connect.off(E),w(()=>{n.hooks.value.connect.off(E)})},{immediate:!0})})},f=()=>{const E=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const m of Object.keys(t)){const x=m;if(!E.includes(x)){const w=$e(()=>t[x]),p=n[x];fr(p)&&o.run(()=>{_e(w,g=>{Oe(g)&&(p.value=g)},{immediate:!0})})}}};r(),i(),s(),l(),a(),c(),u(),d(),h(),f()}),()=>o.stop()}function Vg(){return{edgesChange:se(),nodesChange:se(),nodeDoubleClick:se(),nodeClick:se(),nodeMouseEnter:se(),nodeMouseMove:se(),nodeMouseLeave:se(),nodeContextMenu:se(),nodeDragStart:se(),nodeDrag:se(),nodeDragStop:se(),nodesInitialized:se(),miniMapNodeClick:se(),miniMapNodeDoubleClick:se(),miniMapNodeMouseEnter:se(),miniMapNodeMouseMove:se(),miniMapNodeMouseLeave:se(),connect:se(),connectStart:se(),connectEnd:se(),clickConnectStart:se(),clickConnectEnd:se(),paneReady:se(),init:se(),move:se(),moveStart:se(),moveEnd:se(),selectionDragStart:se(),selectionDrag:se(),selectionDragStop:se(),selectionContextMenu:se(),selectionStart:se(),selectionEnd:se(),viewportChangeStart:se(),viewportChange:se(),viewportChangeEnd:se(),paneScroll:se(),paneClick:se(),paneContextMenu:se(),paneMouseEnter:se(),paneMouseMove:se(),paneMouseLeave:se(),edgeContextMenu:se(),edgeMouseEnter:se(),edgeMouseMove:se(),edgeMouseLeave:se(),edgeDoubleClick:se(),edgeClick:se(),edgeUpdateStart:se(),edgeUpdate:se(),edgeUpdateEnd:se(),updateNodeInternals:se(),error:se(e=>$n(e.message))}}function Fg(e,t){const n=on();Ba(()=>{for(const[r,i]of Object.entries(t.value)){const s=a=>{e(r,a)};i.setEmitter(s),mn(i.removeEmitter),i.setHasEmitListeners(()=>o(r)),mn(i.removeHasEmitListeners)}});function o(r){var i;const s=Hg(r);return!!((i=n?.vnode.props)==null?void 0:i[s])}}function Hg(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function ha(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Mr.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:pn.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Nt.Bezier,style:{}},connectionMode:St.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:lo()?"Meta":"Control",zoomActivationKeyCode:lo()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Vg(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const qg=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Gg(e,t,n){const o=Bg(e),r=B=>{const T=B??[];e.hooks.updateNodeInternals.trigger(T)},i=B=>rg(B,e.nodes,e.edges),s=B=>og(B,e.nodes,e.edges),a=B=>ea(B,e.edges),l=({id:B,type:T,nodeId:G})=>{var U;const W=B?`-${T}-${B}`:`-${T}`;return Array.from(((U=e.connectionLookup.get(`${G}${W}`))==null?void 0:U.values())??[])},c=B=>{if(B)return t.value.get(B)},u=B=>{if(B)return n.value.get(B)},d=(B,T,G)=>{var U,W;const ae=[];for(const le of B){const pe={id:le.id,type:"position",dragging:G,from:le.from};if(T&&(pe.position=le.position,le.parentNode)){const de=c(le.parentNode);pe.position={x:pe.position.x-(((U=de?.computedPosition)==null?void 0:U.x)??0),y:pe.position.y-(((W=de?.computedPosition)==null?void 0:W.y)??0)}}ae.push(pe)}ae?.length&&e.hooks.nodesChange.trigger(ae)},h=B=>{if(!e.vueFlowRef)return;const T=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!T)return;const G=window.getComputedStyle(T),{m22:U}=new window.DOMMatrixReadOnly(G.transform),W=[];for(const ae of B){const le=ae,pe=c(le.id);if(pe){const de=Eo(le.nodeElement);if(!!(de.width&&de.height&&(pe.dimensions.width!==de.width||pe.dimensions.height!==de.height||le.forceUpdate))){const xe=le.nodeElement.getBoundingClientRect();pe.dimensions=de,pe.handleBounds.source=Ni("source",le.nodeElement,xe,U,pe.id),pe.handleBounds.target=Ni("target",le.nodeElement,xe,U,pe.id),W.push({id:pe.id,type:"dimensions",dimensions:de})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),W.length&&e.hooks.nodesChange.trigger(W)},f=(B,T)=>{const G=new Set,U=new Set;for(const le of B)Tt(le)?G.add(le.id):Ct(le)&&U.add(le.id);const W=bt(t.value,G,!0),ae=bt(n.value,U);if(e.multiSelectionActive){for(const le of G)W.push(_t(le,T));for(const le of U)ae.push(_t(le,T))}W.length&&e.hooks.nodesChange.trigger(W),ae.length&&e.hooks.edgesChange.trigger(ae)},y=B=>{if(e.multiSelectionActive){const T=B.map(G=>_t(G.id,!0));e.hooks.nodesChange.trigger(T);return}e.hooks.nodesChange.trigger(bt(t.value,new Set(B.map(T=>T.id)),!0)),e.hooks.edgesChange.trigger(bt(n.value))},E=B=>{if(e.multiSelectionActive){const T=B.map(G=>_t(G.id,!0));e.hooks.edgesChange.trigger(T);return}e.hooks.edgesChange.trigger(bt(n.value,new Set(B.map(T=>T.id)))),e.hooks.nodesChange.trigger(bt(t.value,new Set,!0))},m=B=>{f(B,!0)},x=B=>{const G=(B||e.nodes).map(U=>(U.selected=!1,_t(U.id,!1)));e.hooks.nodesChange.trigger(G)},w=B=>{const G=(B||e.edges).map(U=>(U.selected=!1,_t(U.id,!1)));e.hooks.edgesChange.trigger(G)},p=B=>{if(!B||!B.length)return f([],!1);const T=B.reduce((G,U)=>{const W=_t(U.id,!1);return Tt(U)?G.nodes.push(W):G.edges.push(W),G},{nodes:[],edges:[]});T.nodes.length&&e.hooks.nodesChange.trigger(T.nodes),T.edges.length&&e.hooks.edgesChange.trigger(T.edges)},g=B=>{var T;(T=e.d3Zoom)==null||T.scaleExtent([B,e.maxZoom]),e.minZoom=B},M=B=>{var T;(T=e.d3Zoom)==null||T.scaleExtent([e.minZoom,B]),e.maxZoom=B},R=B=>{var T;(T=e.d3Zoom)==null||T.translateExtent(B),e.translateExtent=B},F=B=>{e.nodeExtent=B,r()},H=B=>{var T;(T=e.d3Zoom)==null||T.clickDistance(B)},J=B=>{e.nodesDraggable=B,e.nodesConnectable=B,e.elementsSelectable=B},A=B=>{const T=B instanceof Function?B(e.nodes):B;!e.initialized&&!T.length||(e.nodes=$i(T,c,e.hooks.error.trigger))},z=B=>{const T=B instanceof Function?B(e.edges):B;if(!e.initialized&&!T.length)return;const G=Vo(T,e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Lo(e.connectionLookup,n.value,G),e.edges=G},k=B=>{const T=B instanceof Function?B([...e.nodes,...e.edges]):B;!e.initialized&&!T.length||(A(T.filter(Tt)),z(T.filter(Ct)))},V=B=>{let T=B instanceof Function?B(e.nodes):B;T=Array.isArray(T)?T:[T];const G=$i(T,c,e.hooks.error.trigger),U=[];for(const W of G)U.push(wi(W));U.length&&e.hooks.nodesChange.trigger(U)},v=B=>{let T=B instanceof Function?B(e.edges):B;T=Array.isArray(T)?T:[T];const G=Vo(T,e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),U=[];for(const W of G)U.push(wi(W));U.length&&e.hooks.edgesChange.trigger(U)},$=(B,T=!0,G=!1)=>{const U=B instanceof Function?B(e.nodes):B,W=Array.isArray(U)?U:[U],ae=[],le=[];function pe(ye){const xe=a(ye);for(const ke of xe)(!Oe(ke.deletable)||ke.deletable)&&le.push(bi(ke.id,ke.source,ke.target,ke.sourceHandle,ke.targetHandle))}function de(ye){const xe=[];for(const ke of e.nodes)ke.parentNode===ye&&xe.push(ke);if(xe.length){for(const ke of xe)ae.push(_i(ke.id));T&&pe(xe);for(const ke of xe)de(ke.id)}}for(const ye of W){const xe=typeof ye=="string"?c(ye):ye;xe&&(Oe(xe.deletable)&&!xe.deletable||(ae.push(_i(xe.id)),T&&pe([xe]),G&&de(xe.id)))}le.length&&e.hooks.edgesChange.trigger(le),ae.length&&e.hooks.nodesChange.trigger(ae)},_=B=>{const T=B instanceof Function?B(e.edges):B,G=Array.isArray(T)?T:[T],U=[];for(const W of G){const ae=typeof W=="string"?u(W):W;ae&&(Oe(ae.deletable)&&!ae.deletable||U.push(bi(typeof W=="string"?W:W.id,ae.source,ae.target,ae.sourceHandle,ae.targetHandle)))}e.hooks.edgesChange.trigger(U)},C=(B,T,G=!0)=>{const U=u(B.id);if(!U)return!1;const W=e.edges.indexOf(U),ae=Ng(B,T,U,G,e.hooks.error.trigger);if(ae){const[le]=Vo([ae],e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((pe,de)=>de===W?le:pe),Lo(e.connectionLookup,n.value,[le]),le}return!1},N=(B,T,G={replace:!1})=>{const U=u(B);if(!U)return;const W=typeof T=="function"?T(U):T;U.data=G.replace?W:{...U.data,...W}},O=B=>yi(B,e.nodes),L=B=>{const T=yi(B,e.edges);return Lo(e.connectionLookup,n.value,T),T},q=(B,T,G={replace:!1})=>{const U=c(B);if(!U)return;const W=typeof T=="function"?T(U):T;G.replace?e.nodes.splice(e.nodes.indexOf(U),1,W):Object.assign(U,W)},X=(B,T,G={replace:!1})=>{const U=c(B);if(!U)return;const W=typeof T=="function"?T(U):T;U.data=G.replace?W:{...U.data,...W}},Z=(B,T,G=!1)=>{G?e.connectionClickStartHandle=B:e.connectionStartHandle=B,e.connectionEndHandle=null,e.connectionStatus=null,T&&(e.connectionPosition=T)},I=(B,T=null,G=null)=>{e.connectionStartHandle&&(e.connectionPosition=B,e.connectionEndHandle=T,e.connectionStatus=G)},b=(B,T)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,T?e.connectionClickStartHandle=null:e.connectionStartHandle=null},P=B=>{const T=tg(B),G=T?null:cn(B)?B:c(B.id);return!T&&!G?[null,null,T]:[T?B:so(G),G,T]},D=(B,T=!0,G=e.nodes)=>{const[U,W,ae]=P(B);if(!U)return[];const le=[];for(const pe of G||e.nodes){if(!ae&&(pe.id===W.id||!pe.computedPosition))continue;const de=so(pe),ye=ao(de,U);(T&&ye>0||ye>=de.width*de.height||ye>=Number(U.width)*Number(U.height))&&le.push(pe)}return le},j=(B,T,G=!0)=>{const[U]=P(B);if(!U)return!1;const W=ao(U,T);return G&&W>0||W>=Number(U.width)*Number(U.height)},Q=B=>{const{viewport:T,dimensions:G,d3Zoom:U,d3Selection:W,translateExtent:ae}=e;if(!U||!W||!B.x&&!B.y)return!1;const le=Qt.translate(T.x+B.x,T.y+B.y).scale(T.zoom),pe=[[0,0],[G.width,G.height]],de=U.constrain()(le,pe,ae),ye=e.viewport.x!==de.x||e.viewport.y!==de.y||e.viewport.zoom!==de.k;return U.transform(W,de),ye},te=B=>{const T=B instanceof Function?B(e):B,G=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Oe(T.defaultEdgeOptions)&&(e.defaultEdgeOptions=T.defaultEdgeOptions);const U=T.modelValue||T.nodes||T.edges?[]:void 0;U&&(T.modelValue&&U.push(...T.modelValue),T.nodes&&U.push(...T.nodes),T.edges&&U.push(...T.edges),k(U));const W=()=>{Oe(T.maxZoom)&&M(T.maxZoom),Oe(T.minZoom)&&g(T.minZoom),Oe(T.translateExtent)&&R(T.translateExtent)};for(const ae of Object.keys(T)){const le=ae,pe=T[le];![...qg,...G].includes(le)&&Oe(pe)&&(e[le]=pe)}Ko(()=>e.d3Zoom).not.toBeNull().then(W),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:k,setNodes:A,setEdges:z,addNodes:V,addEdges:v,removeNodes:$,removeEdges:_,findNode:c,findEdge:u,updateEdge:C,updateEdgeData:N,updateNode:q,updateNodeData:X,applyEdgeChanges:L,applyNodeChanges:O,addSelectedElements:m,addSelectedNodes:y,addSelectedEdges:E,setMinZoom:g,setMaxZoom:M,setTranslateExtent:R,setNodeExtent:F,setPaneClickDistance:H,removeSelectedElements:p,removeSelectedNodes:x,removeSelectedEdges:w,startConnection:Z,updateConnection:I,endConnection:b,setInteractive:J,setState:te,getIntersectingNodes:D,getIncomers:i,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:j,panBy:Q,fitView:B=>o.value.fitView(B),zoomIn:B=>o.value.zoomIn(B),zoomOut:B=>o.value.zoomOut(B),zoomTo:(B,T)=>o.value.zoomTo(B,T),setViewport:(B,T)=>o.value.setViewport(B,T),setTransform:(B,T)=>o.value.setTransform(B,T),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(B,T,G)=>o.value.setCenter(B,T,G),fitBounds:(B,T)=>o.value.fitBounds(B,T),project:B=>o.value.project(B),screenToFlowCoordinate:B=>o.value.screenToFlowCoordinate(B),flowToScreenCoordinate:B=>o.value.flowToScreenCoordinate(B),toObject:()=>{const B=[],T=[];for(const G of e.nodes){const{computedPosition:U,handleBounds:W,selected:ae,dimensions:le,isParent:pe,resizing:de,dragging:ye,events:xe,...ke}=G;B.push(ke)}for(const G of e.edges){const{selected:U,sourceNode:W,targetNode:ae,events:le,...pe}=G;T.push(pe)}return JSON.parse(JSON.stringify({nodes:B,edges:T,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:B=>new Promise(T=>{const{nodes:G,edges:U,position:W,zoom:ae,viewport:le}=B;G&&A(G),U&&z(U);const[pe,de]=le?.x&&le?.y?[le.x,le.y]:W??[null,null];if(pe&&de){const ye=le?.zoom||ae||e.viewport.zoom;return Ko(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:pe,y:de,zoom:ye}).then(()=>{T(!0)})})}else T(!0)}),updateNodeInternals:r,viewportHelper:o,$reset:()=>{const B=ha();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const T=Qt.translate(B.defaultViewport.x??0,B.defaultViewport.y??0).scale(At(B.defaultViewport.zoom??1,B.minZoom,B.maxZoom)),G=e.viewportRef.getBoundingClientRect(),U=[[0,0],[G.width,G.height]],W=e.d3Zoom.constrain()(T,U,B.translateExtent);e.d3Zoom.transform(e.d3Selection,W)}te(B)},$destroy:()=>{}}}const jg=["data-id","data-handleid","data-nodeid","data-handlepos"],Yg={name:"Handle",compatConfig:{MODE:3}},tn=ve({...Yg,props:{id:{default:null},type:{},position:{default:()=>ue.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=qa(e,["position","connectable","connectableStart","connectableEnd","id"]),o=$e(()=>n.type??"source"),r=$e(()=>n.isValidConnection??null),{id:i,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:c,nodesConnectable:u,noDragClassName:d,noPanClassName:h}=Pe(),{id:f,node:y,nodeEl:E,connectedEdges:m}=da(),x=ce(),w=$e(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),p=$e(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),g=$e(()=>{var z,k,V,v,$,_;return((z=s.value)==null?void 0:z.nodeId)===f&&((k=s.value)==null?void 0:k.id)===e.id&&((V=s.value)==null?void 0:V.type)===o.value||((v=l.value)==null?void 0:v.nodeId)===f&&(($=l.value)==null?void 0:$.id)===e.id&&((_=l.value)==null?void 0:_.type)===o.value}),M=$e(()=>{var z,k,V;return((z=a.value)==null?void 0:z.nodeId)===f&&((k=a.value)==null?void 0:k.id)===e.id&&((V=a.value)==null?void 0:V.type)===o.value}),{handlePointerDown:R,handleClick:F}=ca({nodeId:f,handleId:e.id,isValidConnection:r,type:o}),H=ne(()=>typeof e.connectable=="string"&&e.connectable==="single"?!m.value.some(z=>{const k=z[`${o.value}Handle`];return z[o.value]!==f?!1:k?k===e.id:!0}):typeof e.connectable=="number"?m.value.filter(z=>{const k=z[`${o.value}Handle`];return z[o.value]!==f?!1:k?k===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(y,m.value):Oe(e.connectable)?e.connectable:u.value);je(()=>{var z;if(!y.dimensions.width||!y.dimensions.height)return;const k=(z=y.handleBounds[o.value])==null?void 0:z.find(O=>O.id===e.id);if(!c.value||k)return;const V=c.value.querySelector(".vue-flow__transformationpane");if(!E.value||!x.value||!V||!e.id)return;const v=E.value.getBoundingClientRect(),$=x.value.getBoundingClientRect(),_=window.getComputedStyle(V),{m22:C}=new window.DOMMatrixReadOnly(_.transform),N={id:e.id,position:e.position,x:($.left-v.left)/C,y:($.top-v.top)/C,type:o.value,nodeId:f,...Eo(x.value)};y.handleBounds[o.value]=[...y.handleBounds[o.value]??[],N]});function J(z){const k=Tr(z);H.value&&w.value&&(k&&z.button===0||!k)&&R(z)}function A(z){!f||!a.value&&!w.value||H.value&&F(z)}return t({handleClick:F,handlePointerDown:R,onClick:A,onPointerDown:J}),(z,k)=>(Y(),ee("div",{ref_key:"handle",ref:x,"data-id":`${S(i)}-${S(f)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":S(f),"data-handlepos":z.position,class:Ae(["vue-flow__handle",[`vue-flow__handle-${z.position}`,`vue-flow__handle-${e.id}`,S(d),S(h),o.value,{connectable:H.value,connecting:M.value,connectablestart:w.value,connectableend:p.value,connectionindicator:H.value&&(w.value&&!g.value||p.value&&g.value)}]]),onMousedown:J,onTouchstartPassive:J,onClick:A},[be(z.$slots,"default",{id:z.id})],42,jg))}}),Co=function({sourcePosition:e=ue.Bottom,targetPosition:t=ue.Top,label:n,connectable:o=!0,isValidTargetPos:r,isValidSourcePos:i,data:s}){const a=s.label??n;return[Ce(tn,{type:"target",position:t,connectable:o,isValidConnection:r}),typeof a!="string"&&a?Ce(a):Ce(Me,[a]),Ce(tn,{type:"source",position:e,connectable:o,isValidConnection:i})]};Co.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Co.inheritAttrs=!1;Co.compatConfig={MODE:3};const Wg=Co,No=function({targetPosition:e=ue.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:r}){const i=r.label??t;return[Ce(tn,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof i!="string"&&i?Ce(i):Ce(Me,[i])]};No.props=["targetPosition","label","isValidTargetPos","connectable","data"];No.inheritAttrs=!1;No.compatConfig={MODE:3};const Xg=No,$o=function({sourcePosition:e=ue.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:r}){const i=r.label??t;return[typeof i!="string"&&i?Ce(i):Ce(Me,[i]),Ce(tn,{type:"source",position:e,connectable:n,isValidConnection:o})]};$o.props=["sourcePosition","label","isValidSourcePos","connectable","data"];$o.inheritAttrs=!1;$o.compatConfig={MODE:3};const Ug=$o,Kg=["transform"],Zg=["width","height","x","y","rx","ry"],Jg=["y"],Qg={name:"EdgeText",compatConfig:{MODE:3}},ev=ve({...Qg,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=ce({x:0,y:0,width:0,height:0}),n=ce(null),o=ne(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);je(r),_e([()=>e.x,()=>e.y,n,()=>e.label],r);function r(){if(!n.value)return;const i=n.value.getBBox();(i.width!==t.value.width||i.height!==t.value.height)&&(t.value=i)}return(i,s)=>(Y(),ee("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(Y(),ee("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*i.labelBgPadding[0]}px`,height:`${t.value.height+2*i.labelBgPadding[1]}px`,x:-i.labelBgPadding[0],y:-i.labelBgPadding[1],style:Be(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,Zg)):ge("",!0),K("text",He(i.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:i.labelStyle}),[be(i.$slots,"default",{},()=>[typeof i.label!="string"?(Y(),we(qe(i.label),{key:0})):(Y(),ee(Me,{key:1},[Se(he(i.label),1)],64))])],16,Jg)],8,Kg))}}),tv=["id","d","marker-end","marker-start"],nv=["d","stroke-width"],ov={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Mo=ve({...ov,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=ce(null),o=ce(null),r=ce(null),i=Ga();return t({pathEl:n,interactionEl:o,labelEl:r}),(s,a)=>(Y(),ee(Me,null,[K("path",He(S(i),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,tv),s.interactionWidth?(Y(),ee("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,nv)):ge("",!0),s.label&&s.labelX&&s.labelY?(Y(),we(ev,{key:1,ref_key:"labelEl",ref:r,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):ge("",!0)],64))}});function pa({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function ga({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),d=Math.abs(c-t);return[l,c,u,d]}function Bn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Oi({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){let s,a;switch(e){case ue.Left:s=t-Bn(t-o,i),a=n;break;case ue.Right:s=t+Bn(o-t,i),a=n;break;case ue.Top:s=t,a=n-Bn(n-r,i);break;case ue.Bottom:s=t,a=n+Bn(r-n,i);break}return[s,a]}function va(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top,curvature:a=.25}=e,[l,c]=Oi({pos:o,x1:t,y1:n,x2:r,y2:i,c:a}),[u,d]=Oi({pos:s,x1:r,y1:i,x2:t,y2:n,c:a}),[h,f,y,E]=ga({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${t},${n} C${l},${c} ${u},${d} ${r},${i}`,h,f,y,E]}function Ii({pos:e,x1:t,y1:n,x2:o,y2:r}){let i,s;switch(e){case ue.Left:case ue.Right:i=.5*(t+o),s=n;break;case ue.Top:case ue.Bottom:i=t,s=.5*(n+r);break}return[i,s]}function ma(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top}=e,[a,l]=Ii({pos:o,x1:t,y1:n,x2:r,y2:i}),[c,u]=Ii({pos:s,x1:r,y1:i,x2:t,y2:n}),[d,h,f,y]=ga({sourceX:t,sourceY:n,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${t},${n} C${a},${l} ${c},${u} ${r},${i}`,d,h,f,y]}const Di={[ue.Left]:{x:-1,y:0},[ue.Right]:{x:1,y:0},[ue.Top]:{x:0,y:-1},[ue.Bottom]:{x:0,y:1}};function rv({source:e,sourcePosition:t=ue.Bottom,target:n}){return t===ue.Left||t===ue.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Ai(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function iv({source:e,sourcePosition:t=ue.Bottom,target:n,targetPosition:o=ue.Top,center:r,offset:i}){const s=Di[t],a=Di[o],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},u=rv({source:l,sourcePosition:t,target:c}),d=u.x!==0?"x":"y",h=u[d];let f,y,E;const m={x:0,y:0},x={x:0,y:0},[w,p,g,M]=pa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){y=r.x??w,E=r.y??p;const F=[{x:y,y:l.y},{x:y,y:c.y}],H=[{x:l.x,y:E},{x:c.x,y:E}];s[d]===h?f=d==="x"?F:H:f=d==="x"?H:F}else{const F=[{x:l.x,y:c.y}],H=[{x:c.x,y:l.y}];if(d==="x"?f=s.x===h?H:F:f=s.y===h?F:H,t===o){const V=Math.abs(e[d]-n[d]);if(V<=i){const v=Math.min(i-1,i-V);s[d]===h?m[d]=(l[d]>e[d]?-1:1)*v:x[d]=(c[d]>n[d]?-1:1)*v}}if(t!==o){const V=d==="x"?"y":"x",v=s[d]===a[V],$=l[V]>c[V],_=l[V]<c[V];(s[d]===1&&(!v&&$||v&&_)||s[d]!==1&&(!v&&_||v&&$))&&(f=d==="x"?F:H)}const J={x:l.x+m.x,y:l.y+m.y},A={x:c.x+x.x,y:c.y+x.y},z=Math.max(Math.abs(J.x-f[0].x),Math.abs(A.x-f[0].x)),k=Math.max(Math.abs(J.y-f[0].y),Math.abs(A.y-f[0].y));z>=k?(y=(J.x+A.x)/2,E=f[0].y):(y=f[0].x,E=(J.y+A.y)/2)}return[[e,{x:l.x+m.x,y:l.y+m.y},...f,{x:c.x+x.x,y:c.y+x.y},n],y,E,g,M]}function sv(e,t,n,o){const r=Math.min(Ai(e,t)/2,Ai(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function lr(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20}=e,[d,h,f,y,E]=iv({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:s,center:{x:l,y:c},offset:u});return[d.reduce((x,w,p)=>{let g;return p>0&&p<d.length-1?g=sv(d[p-1],w,d[p+1],a):g=`${p===0?"M":"L"}${w.x} ${w.y}`,x+=g,x},""),h,f,y,E]}function av(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,s,a,l]=pa({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,s,a,l]}const lv=ve({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=av(e);return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),uv=lv,cv=ve({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=lr({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),ya=cv,dv=ve({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>Ce(ya,{...e,...t,borderRadius:0})}}),fv=dv,hv=ve({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=va({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),pv=hv,gv=ve({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,r]=ma({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),vv=gv,mv={input:Ug,default:Wg,output:Xg},yv={default:pv,straight:uv,step:fv,smoothstep:ya,simplebezier:vv};function wv(e,t,n){const o=ne(()=>E=>t.value.get(E)),r=ne(()=>E=>n.value.get(E)),i=ne(()=>{const E={...yv,...e.edgeTypes},m=Object.keys(E);for(const x of e.edges)x.type&&!m.includes(x.type)&&(E[x.type]=x.type);return E}),s=ne(()=>{const E={...mv,...e.nodeTypes},m=Object.keys(E);for(const x of e.nodes)x.type&&!m.includes(x.type)&&(E[x.type]=x.type);return E}),a=ne(()=>e.onlyRenderVisibleElements?Qs(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=ne(()=>{if(e.onlyRenderVisibleElements){const E=[];for(const m of e.edges){const x=t.value.get(m.source),w=t.value.get(m.target);gg({sourcePos:x.computedPosition||{x:0,y:0},targetPos:w.computedPosition||{x:0,y:0},sourceWidth:x.dimensions.width,sourceHeight:x.dimensions.height,targetWidth:w.dimensions.width,targetHeight:w.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&E.push(m)}return E}return e.edges}),c=ne(()=>[...a.value,...l.value]),u=ne(()=>{const E=[];for(const m of e.nodes)m.selected&&E.push(m);return E}),d=ne(()=>{const E=[];for(const m of e.edges)m.selected&&E.push(m);return E}),h=ne(()=>[...u.value,...d.value]),f=ne(()=>{const E=[];for(const m of e.nodes)m.dimensions.width&&m.dimensions.height&&m.handleBounds!==void 0&&E.push(m);return E}),y=ne(()=>a.value.length>0&&f.value.length===a.value.length);return{getNode:o,getEdge:r,getElements:c,getEdgeTypes:i,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:u,getSelectedEdges:d,getNodesInitialized:f,areNodesInitialized:y}}class $t{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=on())==null?void 0:t.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??$t.instance;return $t.instance=o??new $t,n&&(n.config.globalProperties.$vueFlowStorage=$t.instance),$t.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=ha(),r=Va(o),i={};for(const[h,f]of Object.entries(r.hooks)){const y=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;i[y]=f.on}const s={};for(const[h,f]of Object.entries(r.hooks))s[h]=f.trigger;const a=ne(()=>{const h=new Map;for(const f of r.nodes)h.set(f.id,f);return h}),l=ne(()=>{const h=new Map;for(const f of r.edges)h.set(f.id,f);return h}),c=wv(r,a,l),u=Gg(r,a,l);u.setState({...r,...n});const d={...i,...c,...u,...ud(r),nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function Pe(e){const t=$t.getInstance(),n=cr(),o=typeof e=="object",r=o?e:{id:e},i=r.id,s=i??n?.vueFlowId;let a;if(n){const l=nn(Ti,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=i??t.getId(),c=t.create(l,r);a=c,(n??Ui(!0)).run(()=>{_e(c.applyDefault,(d,h,f)=>{const y=m=>{c.applyNodeChanges(m)},E=m=>{c.applyEdgeChanges(m)};d?(c.onNodesChange(y),c.onEdgesChange(E)):(c.hooks.value.nodesChange.off(y),c.hooks.value.edgesChange.off(E)),f(()=>{c.hooks.value.nodesChange.off(y),c.hooks.value.edgesChange.off(E)})},{immediate:!0}),mn(()=>{if(a){const d=t.get(a.id);d?d.$destroy():$n(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(r);if(n&&(Xt(Ti,a),n.vueFlowId=a.id),o){const l=on();l?.type.name!=="VueFlow"&&a.emits.error(new ze(Ie.USEVUEFLOW_OPTIONS))}return a}function _v(e){const{emits:t,dimensions:n}=Pe();let o;je(()=>{const r=()=>{var i,s;if(!e.value||!(((s=(i=e.value).checkVisibility)==null?void 0:s.call(i))??!0))return;const a=Eo(e.value);(a.width===0||a.height===0)&&t.error(new ze(Ie.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};r(),window.addEventListener("resize",r),e.value&&(o=new ResizeObserver(()=>r()),o.observe(e.value)),Ki(()=>{window.removeEventListener("resize",r),o&&e.value&&o.unobserve(e.value)})})}const bv={name:"UserSelection",compatConfig:{MODE:3}},xv=ve({...bv,props:{userSelectionRect:{}},setup(e){return(t,n)=>(Y(),ee("div",{class:"vue-flow__selection vue-flow__container",style:Be({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),Ev=["tabIndex"],kv={name:"NodesSelection",compatConfig:{MODE:3}},Sv=ve({...kv,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:s}=Pe(),a=fa(),l=ce(null),c=ua({el:l,onStart(y){t.selectionDragStart(y),t.nodeDragStart(y)},onDrag(y){t.selectionDrag(y),t.nodeDrag(y)},onStop(y){t.selectionDragStop(y),t.nodeDragStop(y)}});je(()=>{var y;i.value||(y=l.value)==null||y.focus({preventScroll:!0})});const u=ne(()=>Js(o.value)),d=ne(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function h(y){t.selectionContextMenu({event:y,nodes:o.value})}function f(y){i.value||Wt[y.key]&&(y.preventDefault(),a({x:Wt[y.key].x,y:Wt[y.key].y},y.shiftKey))}return(y,E)=>!S(s)&&u.value.width&&u.value.height?(Y(),ee("div",{key:0,class:Ae(["vue-flow__nodesselection vue-flow__container",S(r)]),style:Be({transform:`translate(${S(n).x}px,${S(n).y}px) scale(${S(n).zoom})`})},[K("div",{ref_key:"el",ref:l,class:Ae([{dragging:S(c)},"vue-flow__nodesselection-rect"]),style:Be(d.value),tabIndex:S(i)?void 0:-1,onContextmenu:h,onKeydown:f},null,46,Ev)],6)):ge("",!0)}});function Cv(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Nv={name:"Pane",compatConfig:{MODE:3}},$v=ve({...Nv,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:r,userSelectionActive:i,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:c,getSelectedEdges:u,getSelectedNodes:d,removeNodes:h,removeEdges:f,selectionMode:y,deleteKeyCode:E,multiSelectionKeyCode:m,multiSelectionActive:x,edgeLookup:w,nodeLookup:p,connectionLookup:g,defaultEdgeOptions:M,connectionStartHandle:R,panOnDrag:F}=Pe(),H=dt(null),J=dt(new Set),A=dt(new Set),z=dt(null),k=$e(()=>l.value&&(e.isSelecting||i.value)),V=$e(()=>R.value!==null);let v=!1,$=!1;const _=gn(E,{actInsideInputWithModifier:!1}),C=gn(m);_e(_,b=>{b&&(h(d.value),f(u.value),c.value=!1)}),_e(C,b=>{x.value=b});function N(b,P){return D=>{D.target===P&&b?.(D)}}function O(b){if(v||V.value){v=!1;return}r.paneClick(b),s(),c.value=!1}function L(b){var P;if(Array.isArray(F.value)&&((P=F.value)!=null&&P.includes(2))){b.preventDefault();return}r.paneContextMenu(b)}function q(b){r.paneScroll(b)}function X(b){var P,D,j;if(z.value=((P=t.value)==null?void 0:P.getBoundingClientRect())??null,!l.value||!e.isSelecting||b.button!==0||b.target!==H.value||!z.value)return;(j=(D=b.target)==null?void 0:D.setPointerCapture)==null||j.call(D,b.pointerId);const{x:Q,y:te}=Cv(b,z.value);$=!0,v=!1,s(),a.value={width:0,height:0,startX:Q,startY:te,x:Q,y:te},r.selectionStart(b)}function Z(b){var P;if(!z.value||!a.value)return;v=!0;const{x:D,y:j}=nt(b,z.value),{startX:Q=0,startY:te=0}=a.value,re={startX:Q,startY:te,x:D<Q?D:Q,y:j<te?j:te,width:Math.abs(D-Q),height:Math.abs(j-te)},ie=J.value,me=A.value;J.value=new Set(Qs(n.value,re,o.value,y.value===Mr.Partial,!0).map(T=>T.id)),A.value=new Set;const B=((P=M.value)==null?void 0:P.selectable)??!0;for(const T of J.value){const G=g.value.get(T);if(G)for(const{edgeId:U}of G.values()){const W=w.value.get(U);W&&(W.selectable??B)&&A.value.add(U)}}if(!Pi(ie,J.value)){const T=bt(p.value,J.value,!0);r.nodesChange(T)}if(!Pi(me,A.value)){const T=bt(w.value,A.value);r.edgesChange(T)}a.value=re,i.value=!0,c.value=!1}function I(b){var P;b.button!==0||!$||((P=b.target)==null||P.releasePointerCapture(b.pointerId),!i.value&&a.value&&b.target===H.value&&O(b),i.value=!1,a.value=null,c.value=J.value.size>0,r.selectionEnd(b),e.selectionKeyPressed&&(v=!1),$=!1)}return(b,P)=>(Y(),ee("div",{ref_key:"container",ref:H,class:Ae(["vue-flow__pane vue-flow__container",{selection:b.isSelecting}]),onClick:P[0]||(P[0]=D=>k.value?void 0:N(O,H.value)(D)),onContextmenu:P[1]||(P[1]=D=>N(L,H.value)(D)),onWheelPassive:P[2]||(P[2]=D=>N(q,H.value)(D)),onPointerenter:P[3]||(P[3]=D=>k.value?void 0:S(r).paneMouseEnter(D)),onPointerdown:P[4]||(P[4]=D=>k.value?X(D):S(r).paneMouseMove(D)),onPointermove:P[5]||(P[5]=D=>k.value?Z(D):S(r).paneMouseMove(D)),onPointerup:P[6]||(P[6]=D=>k.value?I(D):void 0),onPointerleave:P[7]||(P[7]=D=>S(r).paneMouseLeave(D))},[be(b.$slots,"default"),S(i)&&S(a)?(Y(),we(xv,{key:0,"user-selection-rect":S(a)},null,8,["user-selection-rect"])):ge("",!0),S(c)&&S(d).length?(Y(),we(Sv,{key:1})):ge("",!0)],34))}}),Mv={name:"Transform",compatConfig:{MODE:3}},Pv=ve({...Mv,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Pe(),r=ne(()=>n.value?!o.value:!1),i=ne(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(Y(),ee("div",{class:"vue-flow__transformationpane vue-flow__container",style:Be({transform:i.value,opacity:r.value?0:void 0})},[be(s.$slots,"default")],4))}}),Tv={name:"Viewport",compatConfig:{MODE:3}},Ov=ve({...Tv,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:r,zoomActivationKeyCode:i,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:c,panOnScrollSpeed:u,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:f,zoomOnScroll:y,preventScrolling:E,noWheelClassName:m,noPanClassName:x,emits:w,connectionStartHandle:p,userSelectionActive:g,paneDragging:M,d3Zoom:R,d3Selection:F,d3ZoomHandler:H,viewport:J,viewportRef:A,paneClickDistance:z}=Pe();_v(A);const k=dt(!1),V=dt(!1);let v=null,$=!1,_=0,C={x:0,y:0,zoom:0};const N=gn(a),O=gn(s),L=gn(i),q=$e(()=>(!O.value||O.value&&s.value===!0)&&(N.value||d.value)),X=$e(()=>N.value||l.value),Z=$e(()=>s.value===!0&&q.value!==!0),I=$e(()=>O.value&&s.value!==!0||g.value||Z.value),b=$e(()=>p.value!==null);je(()=>{if(!A.value){$n("Viewport element is missing");return}const te=A.value,re=te.getBoundingClientRect(),ie=Xp().clickDistance(z.value).scaleExtent([t.value,n.value]).translateExtent(r.value),me=Ye(te).call(ie),B=me.on("wheel.zoom"),T=Qt.translate(o.value.x??0,o.value.y??0).scale(At(o.value.zoom??1,t.value,n.value)),G=[[0,0],[re.width,re.height]],U=ie.constrain()(T,G,r.value);ie.transform(me,U),ie.wheelDelta(vi),R.value=ie,F.value=me,H.value=B,J.value={x:U.x,y:U.y,zoom:U.k},ie.on("start",W=>{var ae;if(!W.sourceEvent)return null;_=W.sourceEvent.button,k.value=!0;const le=j(W.transform);((ae=W.sourceEvent)==null?void 0:ae.type)==="mousedown"&&(M.value=!0),C=le,w.viewportChangeStart(le),w.moveStart({event:W,flowTransform:le})}),ie.on("end",W=>{if(!W.sourceEvent)return null;if(k.value=!1,M.value=!1,P(q.value,_??0)&&!$&&w.paneContextMenu(W.sourceEvent),$=!1,D(C,W.transform)){const ae=j(W.transform);C=ae,w.viewportChangeEnd(ae),w.moveEnd({event:W,flowTransform:ae})}}),ie.filter(W=>{var ae;const le=L.value||y.value,pe=f.value&&W.ctrlKey,de=W.button,ye=W.type==="wheel";if(de===1&&W.type==="mousedown"&&(Q(W,"vue-flow__node")||Q(W,"vue-flow__edge")))return!0;if(!q.value&&!le&&!X.value&&!h.value&&!f.value||g.value||b.value&&!ye||!h.value&&W.type==="dblclick"||Q(W,m.value)&&ye||Q(W,x.value)&&(!ye||X.value&&ye&&!L.value)||!f.value&&W.ctrlKey&&ye||!le&&!X.value&&!pe&&ye)return!1;if(!f&&W.type==="touchstart"&&((ae=W.touches)==null?void 0:ae.length)>1)return W.preventDefault(),!1;if(!q.value&&(W.type==="mousedown"||W.type==="touchstart")||Z.value&&Array.isArray(d.value)&&d.value.includes(0)&&de===0||Array.isArray(d.value)&&!d.value.includes(de)&&(W.type==="mousedown"||W.type==="touchstart"))return!1;const xe=Array.isArray(d.value)&&d.value.includes(de)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!de||de<=1;return(!W.ctrlKey||N.value||ye)&&xe}),_e([g,q],()=>{g.value&&!k.value?ie.on("zoom",null):g.value||ie.on("zoom",W=>{J.value={x:W.transform.x,y:W.transform.y,zoom:W.transform.k};const ae=j(W.transform);$=P(q.value,_??0),w.viewportChange(ae),w.move({event:W,flowTransform:ae})})},{immediate:!0}),_e([g,X,c,L,f,E,m],()=>{X.value&&!L.value&&!g.value?me.on("wheel.zoom",W=>{if(Q(W,m.value))return!1;const ae=L.value||y.value,le=f.value&&W.ctrlKey;if(!(!E.value||X.value||ae||le))return!1;W.preventDefault(),W.stopImmediatePropagation();const de=me.property("__zoom").k||1,ye=lo();if(!N.value&&W.ctrlKey&&f.value&&ye){const xa=et(W),Ea=vi(W),ka=de*2**Ea;ie.scaleTo(me,ka,xa,W);return}const xe=W.deltaMode===1?20:1;let ke=c.value===pn.Vertical?0:W.deltaX*xe,yt=c.value===pn.Horizontal?0:W.deltaY*xe;!ye&&W.shiftKey&&c.value!==pn.Vertical&&!ke&&yt&&(ke=yt,yt=0),ie.translateBy(me,-(ke/de)*u.value,-(yt/de)*u.value);const Qe=j(me.property("__zoom"));v&&clearTimeout(v),V.value?(w.move({event:W,flowTransform:Qe}),w.viewportChange(Qe),v=setTimeout(()=>{w.moveEnd({event:W,flowTransform:Qe}),w.viewportChangeEnd(Qe),V.value=!1},150)):(V.value=!0,w.moveStart({event:W,flowTransform:Qe}),w.viewportChangeStart(Qe))},{passive:!1}):typeof B<"u"&&me.on("wheel.zoom",function(W,ae){const le=!E.value&&W.type==="wheel"&&!W.ctrlKey,pe=L.value||y.value,de=f.value&&W.ctrlKey;if(!pe&&!l.value&&!de&&W.type==="wheel"||le||Q(W,m.value))return null;W.preventDefault(),B.call(this,W,ae)},{passive:!1})},{immediate:!0})});function P(te,re){return re===2&&Array.isArray(te)&&te.includes(2)}function D(te,re){return te.x!==re.x&&!Number.isNaN(re.x)||te.y!==re.y&&!Number.isNaN(re.y)||te.zoom!==re.k&&!Number.isNaN(re.k)}function j(te){return{x:te.x,y:te.y,zoom:te.k}}function Q(te,re){return te.target.closest(`.${re}`)}return(te,re)=>(Y(),ee("div",{ref_key:"viewportRef",ref:A,class:"vue-flow__viewport vue-flow__container"},[oe($v,{"is-selecting":I.value,"selection-key-pressed":S(O),class:Ae({connecting:b.value,dragging:S(M),draggable:S(d)===!0||Array.isArray(S(d))&&S(d).includes(0)})},{default:fe(()=>[oe(Pv,null,{default:fe(()=>[be(te.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Iv=["id"],Dv=["id"],Av=["id"],zv={name:"A11yDescriptions",compatConfig:{MODE:3}},Rv=ve({...zv,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Pe();return(r,i)=>(Y(),ee(Me,null,[K("div",{id:`${S(Gs)}-${S(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+he(S(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Iv),K("div",{id:`${S(js)}-${S(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Dv),S(n)?ge("",!0):(Y(),ee("div",{key:0,id:`${S(eg)}-${S(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},he(S(o)),9,Av))],64))}});function Bv(){const e=Pe();_e(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Lv(e,t,n){return n===ue.Left?e-t:n===ue.Right?e+t:e}function Vv(e,t,n){return n===ue.Top?e-t:n===ue.Bottom?e+t:e}const Or=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=ue.Top,type:r}){return Ce("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${r}`,cx:Lv(t,e,o),cy:Vv(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Or.props=["radius","centerX","centerY","position","type"];Or.compatConfig={MODE:3};const zi=Or,Fv=ve({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:r,emits:i,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:c,findEdge:u,findNode:d,isValidConnection:h,multiSelectionActive:f,disableKeyboardA11y:y,elementsSelectable:E,edgesUpdatable:m,edgesFocusable:x,hooks:w}=Pe(),p=ne(()=>u(e.id)),{emit:g,on:M}=Tg(p.value,i),R=nn(So),F=on(),H=ce(!1),J=ce(!1),A=ce(""),z=ce(null),k=ce("source"),V=ce(null),v=$e(()=>typeof p.value.selectable>"u"?E.value:p.value.selectable),$=$e(()=>typeof p.value.updatable>"u"?m.value:p.value.updatable),_=$e(()=>typeof p.value.focusable>"u"?x.value:p.value.focusable);Xt($g,e.id),Xt(Mg,V);const C=ne(()=>p.value.class instanceof Function?p.value.class(p.value):p.value.class),N=ne(()=>p.value.style instanceof Function?p.value.style(p.value):p.value.style),O=ne(()=>{const T=p.value.type||"default",G=R?.[`edge-${T}`];if(G)return G;let U=p.value.template??l.value[T];if(typeof U=="string"&&F){const W=Object.keys(F.appContext.components);W&&W.includes(T)&&(U=Zi(T,!1))}return U&&typeof U!="string"?U:(i.error(new ze(Ie.EDGE_TYPE_MISSING,U)),!1)}),{handlePointerDown:L}=ca({nodeId:A,handleId:z,type:k,isValidConnection:h,edgeUpdaterType:k,onEdgeUpdate:Z,onEdgeUpdateEnd:I});return()=>{const T=d(p.value.source),G=d(p.value.target),U="pathOptions"in p.value?p.value.pathOptions:{};if(!T&&!G)return i.error(new ze(Ie.EDGE_SOURCE_TARGET_MISSING,p.value.id,p.value.source,p.value.target)),null;if(!T)return i.error(new ze(Ie.EDGE_SOURCE_MISSING,p.value.id,p.value.source)),null;if(!G)return i.error(new ze(Ie.EDGE_TARGET_MISSING,p.value.id,p.value.target)),null;if(!p.value||p.value.hidden||T.hidden||G.hidden)return null;let W;o.value===St.Strict?W=T.handleBounds.source:W=[...T.handleBounds.source||[],...T.handleBounds.target||[]];const ae=ki(W,p.value.sourceHandle);let le;o.value===St.Strict?le=G.handleBounds.target:le=[...G.handleBounds.target||[],...G.handleBounds.source||[]];const pe=ki(le,p.value.targetHandle),de=ae?.position||ue.Bottom,ye=pe?.position||ue.Top,{x:xe,y:ke}=en(T,ae,de),{x:yt,y:Qe}=en(G,pe,ye);return p.value.sourceX=xe,p.value.sourceY=ke,p.value.targetX=yt,p.value.targetY=Qe,Ce("g",{ref:V,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${O.value===!1?"default":p.value.type||"default"}`,a.value,C.value,{updating:H.value,selected:p.value.selected,animated:p.value.animated,inactive:!v.value&&!w.value.edgeClick.hasListeners()}],tabIndex:_.value?0:void 0,"aria-label":p.value.ariaLabel===null?void 0:p.value.ariaLabel??`Edge from ${p.value.source} to ${p.value.target}`,"aria-describedby":_.value?`${js}-${t}`:void 0,"aria-roledescription":"edge",role:_.value?"group":"img",...p.value.domAttributes,onClick:P,onContextmenu:D,onDblclick:j,onMouseenter:Q,onMousemove:te,onMouseleave:re,onKeyDown:_.value?B:void 0},[J.value?null:Ce(O.value===!1?l.value.default:O.value,{id:e.id,sourceNode:T,targetNode:G,source:p.value.source,target:p.value.target,type:p.value.type,updatable:$.value,selected:p.value.selected,animated:p.value.animated,label:p.value.label,labelStyle:p.value.labelStyle,labelShowBg:p.value.labelShowBg,labelBgStyle:p.value.labelBgStyle,labelBgPadding:p.value.labelBgPadding,labelBgBorderRadius:p.value.labelBgBorderRadius,data:p.value.data,events:{...p.value.events,...M},style:N.value,markerStart:`url('#${kn(p.value.markerStart,t)}')`,markerEnd:`url('#${kn(p.value.markerEnd,t)}')`,sourcePosition:de,targetPosition:ye,sourceX:xe,sourceY:ke,targetX:yt,targetY:Qe,sourceHandleId:p.value.sourceHandle,targetHandleId:p.value.targetHandle,interactionWidth:p.value.interactionWidth,...U}),[$.value==="source"||$.value===!0?[Ce("g",{onMousedown:ie,onMouseenter:q,onMouseout:X},Ce(zi,{position:de,centerX:xe,centerY:ke,radius:r.value,type:"source","data-type":"source"}))]:null,$.value==="target"||$.value===!0?[Ce("g",{onMousedown:me,onMouseenter:q,onMouseout:X},Ce(zi,{position:ye,centerX:yt,centerY:Qe,radius:r.value,type:"target","data-type":"target"}))]:null]])};function q(){H.value=!0}function X(){H.value=!1}function Z(T,G){g.update({event:T,edge:p.value,connection:G})}function I(T){g.updateEnd({event:T,edge:p.value}),J.value=!1}function b(T,G){T.button===0&&(J.value=!0,A.value=G?p.value.target:p.value.source,z.value=(G?p.value.targetHandle:p.value.sourceHandle)??null,k.value=G?"target":"source",g.updateStart({event:T,edge:p.value}),L(T))}function P(T){var G;const U={event:T,edge:p.value};v.value&&(s.value=!1,p.value.selected&&f.value?(c([p.value]),(G=V.value)==null||G.blur()):n([p.value])),g.click(U)}function D(T){g.contextMenu({event:T,edge:p.value})}function j(T){g.doubleClick({event:T,edge:p.value})}function Q(T){g.mouseEnter({event:T,edge:p.value})}function te(T){g.mouseMove({event:T,edge:p.value})}function re(T){g.mouseLeave({event:T,edge:p.value})}function ie(T){b(T,!0)}function me(T){b(T,!1)}function B(T){var G;!y.value&&Ys.includes(T.key)&&v.value&&(T.key==="Escape"?((G=V.value)==null||G.blur(),c([u(e.id)])):n([u(e.id)]))}}}),Hv=Fv,qv=ve({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:r,connectionPosition:i,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:c,viewport:u,findNode:d}=Pe(),h=(e=nn(So))==null?void 0:e["connection-line"],f=ne(()=>{var w;return d((w=o.value)==null?void 0:w.nodeId)}),y=ne(()=>{var w;return d((w=r.value)==null?void 0:w.nodeId)??null}),E=ne(()=>({x:(i.value.x-u.value.x)/u.value.zoom,y:(i.value.y-u.value.y)/u.value.zoom})),m=ne(()=>l.value.markerStart?`url(#${kn(l.value.markerStart,t)})`:""),x=ne(()=>l.value.markerEnd?`url(#${kn(l.value.markerEnd,t)})`:"");return()=>{var w,p,g;if(!f.value||!o.value)return null;const M=o.value.id,R=o.value.type,F=f.value.handleBounds;let H=F?.[R]??[];if(n.value===St.Loose){const N=F?.[R==="source"?"target":"source"]??[];H=[...H,...N]}if(!H)return null;const J=(M?H.find(N=>N.id===M):H[0])??null,A=J?.position??ue.Top,{x:z,y:k}=en(f.value,J,A);let V=null;y.value&&(n.value===St.Strict?V=((w=y.value.handleBounds[R==="source"?"target":"source"])==null?void 0:w.find(N=>{var O;return N.id===((O=r.value)==null?void 0:O.id)}))||null:V=((p=[...y.value.handleBounds.source??[],...y.value.handleBounds.target??[]])==null?void 0:p.find(N=>{var O;return N.id===((O=r.value)==null?void 0:O.id)}))||null);const v=((g=r.value)==null?void 0:g.position)??(A?sr[A]:null);if(!A||!v)return null;const $=s.value??l.value.type??Nt.Bezier;let _="";const C={sourceX:z,sourceY:k,sourcePosition:A,targetX:E.value.x,targetY:E.value.y,targetPosition:v};return $===Nt.Bezier?[_]=va(C):$===Nt.Step?[_]=lr({...C,borderRadius:0}):$===Nt.SmoothStep?[_]=lr(C):$===Nt.SimpleBezier?[_]=ma(C):_=`M${z},${k} ${E.value.x},${E.value.y}`,Ce("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Ce("g",{class:"vue-flow__connection"},h?Ce(h,{sourceX:z,sourceY:k,sourcePosition:A,targetX:E.value.x,targetY:E.value.y,targetPosition:v,sourceNode:f.value,sourceHandle:J,targetNode:y.value,targetHandle:V,markerEnd:x.value,markerStart:m.value,connectionStatus:c.value}):Ce("path",{d:_,class:[l.value.class,c.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":x.value,"marker-start":m.value})))}}}),Gv=qv,jv=["id","markerWidth","markerHeight","markerUnits","orient"],Yv={name:"MarkerType",compatConfig:{MODE:3}},Wv=ve({...Yv,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(Y(),ee("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===S(io).ArrowClosed?(Y(),ee("polyline",{key:0,style:Be({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):ge("",!0),t.type===S(io).Arrow?(Y(),ee("polyline",{key:1,style:Be({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):ge("",!0)],8,jv))}}),Xv={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Uv={name:"MarkerDefinitions",compatConfig:{MODE:3}},Kv=ve({...Uv,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:r}=Pe(),i=ne(()=>{const s=new Set,a=[],l=c=>{if(c){const u=kn(c,t);s.has(u)||(typeof c=="object"?a.push({...c,id:u,color:c.color||r.value}):a.push({id:u,color:r.value,type:c}),s.add(u))}};for(const c of[o.value.markerEnd,o.value.markerStart])l(c);for(const c of n.value)for(const u of[c.markerStart,c.markerEnd])l(u);return a.sort((c,u)=>c.id.localeCompare(u.id))});return(s,a)=>(Y(),ee("svg",Xv,[K("defs",null,[(Y(!0),ee(Me,null,Ge(i.value,l=>(Y(),we(Wv,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),Zv={name:"Edges",compatConfig:{MODE:3}},Jv=ve({...Zv,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Pe();return(r,i)=>(Y(),ee(Me,null,[oe(Kv),(Y(!0),ee(Me,null,Ge(S(n),s=>(Y(),ee("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Be({zIndex:S(vg)(s,S(t),S(o))})},[oe(S(Hv),{id:s.id},null,8,["id"])],4))),128)),oe(S(Gv))],64))}}),Qv=ve({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:r,multiSelectionActive:i,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:c,onUpdateNodeInternals:u,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:f,disableKeyboardA11y:y,ariaLiveMessage:E,snapToGrid:m,snapGrid:x,nodeDragThreshold:w,nodesDraggable:p,elementsSelectable:g,nodesConnectable:M,nodesFocusable:R,hooks:F}=Pe(),H=ce(null);Xt(la,H),Xt(aa,e.id);const J=nn(So),A=on(),z=fa(),{node:k,parentNode:V}=da(e.id),{emit:v,on:$}=Ag(k,s),_=$e(()=>typeof k.draggable>"u"?p.value:k.draggable),C=$e(()=>typeof k.selectable>"u"?g.value:k.selectable),N=$e(()=>typeof k.connectable>"u"?M.value:k.connectable),O=$e(()=>typeof k.focusable>"u"?R.value:k.focusable),L=ne(()=>C.value||_.value||F.value.nodeClick.hasListeners()||F.value.nodeDoubleClick.hasListeners()||F.value.nodeMouseEnter.hasListeners()||F.value.nodeMouseMove.hasListeners()||F.value.nodeMouseLeave.hasListeners()),q=$e(()=>!!k.dimensions.width&&!!k.dimensions.height),X=ne(()=>{const G=k.type||"default",U=J?.[`node-${G}`];if(U)return U;let W=k.template||d.value[G];if(typeof W=="string"&&A){const ae=Object.keys(A.appContext.components);ae&&ae.includes(G)&&(W=Zi(G,!1))}return W&&typeof W!="string"?W:(s.error(new ze(Ie.NODE_TYPE_MISSING,W)),!1)}),Z=ua({id:e.id,el:H,disabled:()=>!_.value,selectable:C,dragHandle:()=>k.dragHandle,onStart(G){v.dragStart(G)},onDrag(G){v.drag(G)},onStop(G){v.dragStop(G)},onClick(G){B(G)}}),I=ne(()=>k.class instanceof Function?k.class(k):k.class),b=ne(()=>{const G=(k.style instanceof Function?k.style(k):k.style)||{},U=k.width instanceof Function?k.width(k):k.width,W=k.height instanceof Function?k.height(k):k.height;return!G.width&&U&&(G.width=typeof U=="string"?U:`${U}px`),!G.height&&W&&(G.height=typeof W=="string"?W:`${W}px`),G}),P=$e(()=>Number(k.zIndex??b.value.zIndex??0));return u(G=>{(G.includes(e.id)||!G.length)&&j()}),je(()=>{_e(()=>k.hidden,(G=!1,U,W)=>{!G&&H.value&&(e.resizeObserver.observe(H.value),W(()=>{H.value&&e.resizeObserver.unobserve(H.value)}))},{immediate:!0,flush:"post"})}),_e([()=>k.type,()=>k.sourcePosition,()=>k.targetPosition],()=>{pt(()=>{c([{id:e.id,nodeElement:H.value,forceUpdate:!0}])})}),_e([()=>k.position.x,()=>k.position.y,()=>{var G;return(G=V.value)==null?void 0:G.computedPosition.x},()=>{var G;return(G=V.value)==null?void 0:G.computedPosition.y},()=>{var G;return(G=V.value)==null?void 0:G.computedPosition.z},P,()=>k.selected,()=>k.dimensions.height,()=>k.dimensions.width,()=>{var G;return(G=V.value)==null?void 0:G.dimensions.height},()=>{var G;return(G=V.value)==null?void 0:G.dimensions.width}],([G,U,W,ae,le,pe])=>{const de={x:G,y:U,z:pe+(f.value&&k.selected?1e3:0)};typeof W<"u"&&typeof ae<"u"?k.computedPosition=cg({x:W,y:ae,z:le},de):k.computedPosition=de},{flush:"post",immediate:!0}),_e([()=>k.extent,h],([G,U],[W,ae])=>{(G!==W||U!==ae)&&D()}),k.extent==="parent"||typeof k.extent=="object"&&"range"in k.extent&&k.extent.range==="parent"?Ko(()=>q).toBe(!0).then(D):D(),()=>k.hidden?null:Ce("div",{ref:H,"data-id":k.id,class:["vue-flow__node",`vue-flow__node-${X.value===!1?"default":k.type||"default"}`,{[n.value]:_.value,dragging:Z?.value,draggable:_.value,selected:k.selected,selectable:C.value,parent:k.isParent},I.value],style:{visibility:q.value?"visible":"hidden",zIndex:k.computedPosition.z??P.value,transform:`translate(${k.computedPosition.x}px,${k.computedPosition.y}px)`,pointerEvents:L.value?"all":"none",...b.value},tabIndex:O.value?0:void 0,role:O.value?"group":void 0,"aria-describedby":y.value?void 0:`${Gs}-${t}`,"aria-label":k.ariaLabel,"aria-roledescription":"node",...k.domAttributes,onMouseenter:Q,onMousemove:te,onMouseleave:re,onContextmenu:ie,onClick:B,onDblclick:me,onKeydown:T},[Ce(X.value===!1?d.value.default:X.value,{id:k.id,type:k.type,data:k.data,events:{...k.events,...$},selected:k.selected,resizing:k.resizing,dragging:Z.value,connectable:N.value,position:k.computedPosition,dimensions:k.dimensions,isValidTargetPos:k.isValidTargetPos,isValidSourcePos:k.isValidSourcePos,parent:k.parentNode,parentNodeId:k.parentNode,zIndex:k.computedPosition.z??P.value,targetPosition:k.targetPosition,sourcePosition:k.sourcePosition,label:k.label,dragHandle:k.dragHandle,onUpdateNodeInternals:j})]);function D(){const G=k.computedPosition,{computedPosition:U,position:W}=Pr(k,m.value?ko(G,x.value):G,s.error,h.value,V.value);(k.computedPosition.x!==U.x||k.computedPosition.y!==U.y)&&(k.computedPosition={...k.computedPosition,...U}),(k.position.x!==W.x||k.position.y!==W.y)&&(k.position=W)}function j(){H.value&&c([{id:e.id,nodeElement:H.value,forceUpdate:!0}])}function Q(G){Z?.value||v.mouseEnter({event:G,node:k})}function te(G){Z?.value||v.mouseMove({event:G,node:k})}function re(G){Z?.value||v.mouseLeave({event:G,node:k})}function ie(G){return v.contextMenu({event:G,node:k})}function me(G){return v.doubleClick({event:G,node:k})}function B(G){C.value&&(!o.value||!_.value||w.value>0)&&ar(k,i.value,l,a,r,!1,H.value),v.click({event:G,node:k})}function T(G){if(!(ir(G)||y.value))if(Ys.includes(G.key)&&C.value){const U=G.key==="Escape";ar(k,i.value,l,a,r,U,H.value)}else _.value&&k.selected&&Wt[G.key]&&(G.preventDefault(),E.value=`Moved selected node ${G.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~k.position.x}, y: ${~~k.position.y}`,z({x:Wt[G.key].x,y:Wt[G.key].y},G.shiftKey))}}}),em=Qv;function tm(e={includeHiddenNodes:!1}){const{nodes:t}=Pe();return ne(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const nm={class:"vue-flow__nodes vue-flow__container"},om={name:"Nodes",compatConfig:{MODE:3}},rm=ve({...om,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Pe(),r=tm(),i=ce();return _e(r,s=>{s&&pt(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),je(()=>{i.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));pt(()=>n(a))})}),Ki(()=>{var s;return(s=i.value)==null?void 0:s.disconnect()}),(s,a)=>(Y(),ee("div",nm,[i.value?(Y(!0),ee(Me,{key:0},Ge(S(t),(l,c,u,d)=>{const h=[l.id];if(d&&d.key===l.id&&La(d,h))return d;const f=(Y(),we(S(em),{id:l.id,key:l.id,"resize-observer":i.value},null,8,["id","resize-observer"]));return f.memo=h,f},a,0),128)):ge("",!0)]))}});function im(){const{emits:e}=Pe();je(()=>{if(sa()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new ze(Ie.MISSING_STYLES))}})}const sm=K("div",{class:"vue-flow__edge-labels"},null,-1),am={name:"VueFlow",compatConfig:{MODE:3}},lm=ve({...am,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,r=Ra(),i=To(o,"modelValue",n),s=To(o,"nodes",n),a=To(o,"edges",n),l=Pe(o),c=Lg({modelValue:i,nodes:s,edges:a},o,l);return Fg(n,l.hooks),Bv(),im(),Xt(So,r),dr(c),t(l),(u,d)=>(Y(),ee("div",{ref:S(l).vueFlowRef,class:"vue-flow"},[oe(Ov,null,{default:fe(()=>[oe(Jv),sm,oe(rm),be(u.$slots,"zoom-pane")]),_:3}),be(u.$slots,"default"),oe(Rv)],512))}}),um={name:"Panel",compatConfig:{MODE:3}},cm=ve({...um,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Pe(),o=ne(()=>`${t.position}`.split("-"));return(r,i)=>(Y(),ee("div",{class:Ae(["vue-flow__panel",o.value]),style:Be({pointerEvents:S(n)?"none":"all"})},[be(r.$slots,"default")],6))}});var ht=(e=>(e.Lines="lines",e.Dots="dots",e))(ht||{});const wa=function({dimensions:e,size:t,color:n}){return Ce("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},_a=function({radius:e,color:t}){return Ce("circle",{cx:e,cy:e,r:e,fill:t})};ht.Lines+"",ht.Dots+"";const dm={[ht.Dots]:"#81818a",[ht.Lines]:"#eee"},fm=["id","x","y","width","height","patternTransform"],hm={key:2,height:"100",width:"100"},pm=["fill"],gm=["x","y","fill"],vm={name:"Background",compatConfig:{MODE:3}},mm=ve({...vm,props:{id:{},variant:{default:()=>ht.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=Pe(),o=ne(()=>{const s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],c=[a*s||1,l*s||1],u=e.size*s,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],f=[d*s||1+c[0]/2,h*s||1+c[1]/2];return{scaledGap:c,offset:f,size:u}}),r=$e(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=$e(()=>e.color||e.patternColor||dm[e.variant||ht.Dots]);return(s,a)=>(Y(),ee("svg",{class:"vue-flow__background vue-flow__container",style:Be({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[be(s.$slots,"pattern-container",{id:r.value},()=>[K("pattern",{id:r.value,x:S(n).x%o.value.scaledGap[0],y:S(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[be(s.$slots,"pattern",{},()=>[s.variant===S(ht).Lines?(Y(),we(S(wa),{key:0,size:s.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===S(ht).Dots?(Y(),we(S(_a),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):ge("",!0),s.bgColor?(Y(),ee("svg",hm,[K("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,pm)])):ge("",!0)])],8,fm)]),K("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,gm),be(s.$slots,"default",{id:r.value})],4))}}),ym={name:"ControlButton",compatConfig:{MODE:3}},wm=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},_m={type:"button",class:"vue-flow__controls-button"};function bm(e,t,n,o,r,i){return Y(),ee("button",_m,[be(e.$slots,"default")])}const Ln=wm(ym,[["render",bm]]),xm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Em=K("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),km=[Em];function Sm(e,t){return Y(),ee("svg",xm,km)}const Cm={render:Sm},Nm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},$m=K("path",{d:"M0 0h32v4.2H0z"},null,-1),Mm=[$m];function Pm(e,t){return Y(),ee("svg",Nm,Mm)}const Tm={render:Pm},Om={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Im=K("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1),Dm=[Im];function Am(e,t){return Y(),ee("svg",Om,Dm)}const zm={render:Am},Rm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Bm=K("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1),Lm=[Bm];function Vm(e,t){return Y(),ee("svg",Rm,Lm)}const Fm={render:Vm},Hm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},qm=K("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1),Gm=[qm];function jm(e,t){return Y(),ee("svg",Hm,Gm)}const Ym={render:jm},Wm={name:"Controls",compatConfig:{MODE:3}},Xm=ve({...Wm,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>qs.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:r,setInteractive:i,zoomIn:s,zoomOut:a,fitView:l,viewport:c,minZoom:u,maxZoom:d}=Pe(),h=$e(()=>n.value||o.value||r.value),f=$e(()=>c.value.zoom<=u.value),y=$e(()=>c.value.zoom>=d.value);function E(){s(),t("zoomIn")}function m(){a(),t("zoomOut")}function x(){l(e.fitViewParams),t("fitView")}function w(){i(!h.value),t("interactionChange",!h.value)}return(p,g)=>(Y(),we(S(cm),{class:"vue-flow__controls",position:p.position},{default:fe(()=>[be(p.$slots,"top"),p.showZoom?(Y(),ee(Me,{key:0},[be(p.$slots,"control-zoom-in",{},()=>[oe(Ln,{class:"vue-flow__controls-zoomin",disabled:y.value,onClick:E},{default:fe(()=>[be(p.$slots,"icon-zoom-in",{},()=>[(Y(),we(qe(S(Cm))))])]),_:3},8,["disabled"])]),be(p.$slots,"control-zoom-out",{},()=>[oe(Ln,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:m},{default:fe(()=>[be(p.$slots,"icon-zoom-out",{},()=>[(Y(),we(qe(S(Tm))))])]),_:3},8,["disabled"])])],64)):ge("",!0),p.showFitView?be(p.$slots,"control-fit-view",{key:1},()=>[oe(Ln,{class:"vue-flow__controls-fitview",onClick:x},{default:fe(()=>[be(p.$slots,"icon-fit-view",{},()=>[(Y(),we(qe(S(zm))))])]),_:3})]):ge("",!0),p.showInteractive?be(p.$slots,"control-interactive",{key:2},()=>[p.showInteractive?(Y(),we(Ln,{key:0,class:"vue-flow__controls-interactive",onClick:w},{default:fe(()=>[h.value?be(p.$slots,"icon-unlock",{key:0},()=>[(Y(),we(qe(S(Ym))))]):ge("",!0),h.value?ge("",!0):be(p.$slots,"icon-lock",{key:1},()=>[(Y(),we(qe(S(Fm))))])]),_:3})):ge("",!0)]):ge("",!0),be(p.$slots,"default")]),_:3},8,["position"]))}}),Um={key:0,class:"space-y-2"},Km={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},Zm={class:"shrink-0 font-mono"},Jm=["title"],Qm={class:"line-clamp-2 text-sm font-medium leading-snug"},ey={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},ty={class:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide"},ny={class:"rounded bg-background/60 px-1.5 py-0.5"},oy={class:"rounded bg-background/60 px-1.5 py-0.5"},ry={key:1,class:"space-y-1.5"},iy={class:"flex items-center gap-2 text-sm font-medium"},sy={class:"font-mono text-[11px] text-muted-foreground"},ay=ve({__name:"Node",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(e){const t=e,n=ne(()=>t.data),o=ne(()=>n.value.kind==="task"?n.value:null),r=ne(()=>n.value.kind==="external"?n.value:null),i=ne(()=>{if(n.value.kind!=="task")return{label:"Missing dependency",icon:Ut,class:"text-amber-600 dark:text-amber-400"};switch(n.value.status){case"completed":return{label:"Completed",icon:Wn,class:"text-emerald-600 dark:text-emerald-400"};case"in_progress":return{label:"In Progress",icon:Ji,class:"text-blue-600 dark:text-blue-400"};default:return{label:"Pending",icon:fn,class:"text-muted-foreground"}}}),s=ne(()=>n.value.kind!=="task"?null:n.value.priority.replace("_"," ")),a=ne(()=>n.value.kind!=="task"?null:n.value.category),l=ne(()=>n.value.kind==="external"?["border-amber-500/60 bg-amber-50/70 text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100","border-dashed"]:n.value.status==="completed"?["border-emerald-500/40 bg-emerald-50/70 text-emerald-950 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-100","border-solid"]:n.value.status==="in_progress"?["border-blue-500/40 bg-blue-50/80 text-blue-950 dark:border-blue-500/40 dark:bg-blue-500/10 dark:text-blue-100","border-solid"]:["border-border bg-card text-card-foreground","border-solid"]),c=ne(()=>n.value.kind!=="task"||!n.value.showPrdLabel?null:n.value.prdName?.trim()||n.value.prdSlug);return(u,d)=>(Y(),ee("div",{class:Ae(["w-[17rem] rounded-xl border px-3 py-2 shadow-sm transition-[transform,box-shadow,border-color] duration-150 ease-[var(--ease-out-cubic)] motion-reduce:transition-none",[S(l),e.selected?"ring-2 ring-primary/30 shadow-md":"hover:shadow-md hover:border-primary/40"]])},[oe(S(tn),{type:"target",position:S(ue).Top,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"]),S(o)?(Y(),ee("div",Um,[K("div",Km,[K("span",Zm,he(S(o).taskId),1),S(c)?(Y(),ee("span",{key:0,title:`${S(o).prdName} (${S(o).prdSlug})`,class:"max-w-[11rem] truncate rounded border border-border bg-background/60 px-1.5 py-0.5 text-[10px]"},he(S(c)),9,Jm)):ge("",!0)]),K("p",Qm,he(S(o).title),1),K("div",ey,[K("div",{class:Ae(["flex items-center gap-1.5",S(i).class])},[(Y(),we(qe(S(i).icon),{class:"size-3.5"})),K("span",null,he(S(i).label),1)],2),K("div",ty,[K("span",ny,he(S(a)),1),K("span",oy,he(S(s)),1)])])])):S(r)?(Y(),ee("div",ry,[K("div",iy,[oe(S(Ut),{class:"size-4"}),K("span",null,he(S(r).title),1)]),K("p",sy,he(S(r).dependencyRef),1)])):ge("",!0),oe(S(tn),{type:"source",position:S(ue).Bottom,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"])],2))}}),Ri=Object.assign(ay,{__name:"GraphNode"}),ly={class:"relative h-full overflow-hidden rounded-lg border border-border bg-card"},uy={key:0,class:"flex h-full items-center justify-center"},cy={class:"flex flex-col items-center gap-2 text-sm text-muted-foreground"},dy={key:1,class:"flex h-full items-center justify-center p-6"},fy={class:"max-w-sm text-center"},hy={class:"mt-1 text-sm text-muted-foreground"},py={key:2,class:"flex h-full items-center justify-center p-6"},gy={class:"max-w-sm text-center"},vy={class:"mt-1 text-sm text-muted-foreground"},my={key:4,class:"pointer-events-none absolute top-3 left-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},yy={class:"space-y-1 text-xs"},wy={class:"flex items-center gap-1.5 text-muted-foreground"},_y={class:"flex items-center gap-1.5 text-blue-600 dark:text-blue-400"},by={class:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400"},xy={class:"flex items-center gap-1.5 text-amber-600 dark:text-amber-400"},Ey={key:5,class:"pointer-events-none absolute top-3 right-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},ky={class:"flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground"},Sy={class:"rounded bg-muted px-1.5 py-0.5"},Cy={class:"rounded bg-blue-500/10 px-1.5 py-0.5 text-blue-700 dark:text-blue-300"},Ny={class:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-300"},$y={class:"rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300"},My=ve({__name:"Explorer",props:{payload:{},scope:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["taskClick"],setup(e,{emit:t}){const n=e,o=t,r={task:qt(Ri),external:qt(Ri)},i=Ta("(prefers-reduced-motion: reduce)"),s=ce(0);_e(()=>[n.scope,n.payload?.scope,n.payload?.nodes.length,n.payload?.edges.length],()=>{s.value+=1},{deep:!1});const a=ne(()=>`${n.scope}-${s.value}`),l=ne(()=>n.payload?n.payload.nodes.some(m=>m.kind==="task"):!1),c=ne(()=>n.payload?.stats);function u(m,x){return m.kind==="external"?{width:272,height:80}:x==="repo"?{width:272,height:116}:{width:272,height:96}}function d(m){return m==="repo"?{ranksep:136,nodesep:88,edgesep:34,marginx:36,marginy:28}:{ranksep:102,nodesep:56,edgesep:20,marginx:24,marginy:22}}function h(m,x){const w=new Wr.graphlib.Graph,p=d(n.scope);w.setDefaultEdgeLabel(()=>({})),w.setGraph({rankdir:"TB",ranker:"network-simplex",...p});for(const g of m){const M=u(g.data,n.scope);w.setNode(g.id,M)}for(const g of x)w.setEdge(g.source,g.target);return Wr.layout(w),m.map(g=>{const M=u(g.data,n.scope),R=w.node(g.id);return R?{...g,targetPosition:ue.Top,sourcePosition:ue.Bottom,position:{x:R.x-M.width/2,y:R.y-M.height/2}}:g})}const f=ne(()=>n.payload?n.payload.edges.map(m=>({id:m.id,source:m.source,target:m.target,type:"step",animated:m.unresolved&&!i.value,markerEnd:{type:io.ArrowClosed,width:16,height:16},style:{strokeWidth:m.unresolved?1.4:1.7,stroke:m.unresolved?"var(--muted-foreground)":"var(--border)",strokeOpacity:m.unresolved?.62:.95,strokeDasharray:m.unresolved?"5 4":void 0}})):[]),y=ne(()=>{if(!n.payload)return[];const m=n.payload.nodes.map(x=>({id:x.id,type:x.kind,data:{...x,showPrdLabel:x.kind==="task"?n.scope==="repo":void 0},draggable:!1,selectable:x.kind==="task",connectable:!1,position:{x:0,y:0}}));return h(m,f.value)});function E(m){const w=m.node.data;!w||w.kind!=="task"||o("taskClick",{prdSlug:w.prdSlug,taskId:w.taskId})}return(m,x)=>(Y(),ee("div",ly,[e.loading?(Y(),ee("div",uy,[K("div",cy,[oe(S(qo),{class:"size-5 animate-spin"}),x[0]||(x[0]=K("span",null,"Building graph...",-1))])])):e.error?(Y(),ee("div",dy,[K("div",fy,[oe(S(Yn),{class:"mx-auto mb-3 size-8 text-destructive"}),x[1]||(x[1]=K("p",{class:"text-sm font-medium"},"Graph unavailable",-1)),K("p",hy,he(e.error),1)])])):!e.payload||!S(l)?(Y(),ee("div",py,[K("div",gy,[oe(S(tl),{class:"mx-auto mb-3 size-8 text-muted-foreground/60"}),x[2]||(x[2]=K("p",{class:"text-sm font-medium"},"No graphable tasks yet",-1)),K("p",vy,he(e.scope==="repo"?"No PRDs with task state were found in this repository.":"This PRD does not have generated tasks yet."),1)])])):(Y(),we(S(lm),{key:S(a),nodes:S(y),edges:S(f),"node-types":r,"fit-view-on-init":!0,"fit-view-on-init-options":{padding:.2},"nodes-draggable":!1,"nodes-connectable":!1,"elements-selectable":!0,"zoom-on-scroll":!0,"pan-on-drag":!0,"min-zoom":.2,"max-zoom":1.8,class:"h-full",onNodeClick:E},{default:fe(()=>[oe(S(mm),{gap:20,size:1.2,variant:"dots",color:"var(--border)"}),oe(S(Xm),{position:"bottom-left","show-interactive":!1})]),_:1},8,["nodes","edges"])),e.payload&&S(l)?(Y(),ee("div",my,[x[7]||(x[7]=K("p",{class:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},"Legend",-1)),K("div",yy,[K("div",wy,[oe(S(fn),{class:"size-3.5"}),x[3]||(x[3]=Se(" Pending ",-1))]),K("div",_y,[oe(S(Ji),{class:"size-3.5"}),x[4]||(x[4]=Se(" In Progress ",-1))]),K("div",by,[oe(S(Wn),{class:"size-3.5"}),x[5]||(x[5]=Se(" Completed ",-1))]),K("div",xy,[oe(S(Ut),{class:"size-3.5"}),x[6]||(x[6]=Se(" Missing dependency ",-1))])])])):ge("",!0),S(c)&&S(l)?(Y(),ee("div",Ey,[K("div",ky,[K("span",Sy,"Total "+he(S(c).total),1),K("span",Cy,"WIP "+he(S(c).inProgress),1),K("span",Ny,"Done "+he(S(c).completed),1),K("span",$y,"Missing "+he(S(c).unresolved),1)])])):ge("",!0)]))}}),Gw=Object.assign(My,{__name:"GraphExplorer"}),Py={class:"space-y-0.5 p-2"},Ty=["onClick"],Oy={class:"min-w-0 flex-1"},Iy=["title"],Dy={class:"text-muted-foreground"},Ay={class:"mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-muted"},zy={class:"flex shrink-0 items-center gap-1 text-xs"},Ry={key:0,class:"text-green-600 dark:text-green-400"},By={key:1,class:"text-red-600 dark:text-red-400"},Ly={key:0,class:"py-4 text-center text-sm text-muted-foreground"},Vy=ve({__name:"ChangesMinimap",props:{files:{},selectedFile:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,r=ne(()=>n.files.length===0?1:Math.max(...n.files.map(u=>u.additions+u.deletions),1));function i(u){switch(u){case"added":return{icon:Cl,class:"text-green-600 dark:text-green-400"};case"deleted":return{icon:Nl,class:"text-red-600 dark:text-red-400"};case"renamed":return{icon:Ar,class:"text-blue-600 dark:text-blue-400"};default:return{icon:Sl,class:"text-yellow-600 dark:text-yellow-400"}}}function s(u){const d=u.additions+u.deletions;if(d===0)return{additions:0,deletions:0,total:0};const h=d/r.value*100,f=u.additions/d*h,y=u.deletions/d*h;return{additions:f,deletions:y,total:h}}function a(u){return u.status==="renamed"&&u.oldPath?`${u.oldPath} → ${u.path}`:u.path}function l(u){return u.split("/").pop()||u}function c(u){o("select",u)}return(u,d)=>(Y(),ee("div",Py,[(Y(!0),ee(Me,null,Ge(e.files,h=>(Y(),ee("button",{key:h.path,class:Ae(["group flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors hover:bg-muted/50",{"bg-muted":e.selectedFile===h.path}]),onClick:f=>c(h.path)},[(Y(),we(qe(i(h.status).icon),{class:Ae(["size-4 shrink-0",i(h.status).class])},null,8,["class"])),K("div",Oy,[K("div",{class:Ae(["truncate text-xs",{"font-medium":e.selectedFile===h.path}]),title:a(h)},[h.status==="renamed"&&h.oldPath?(Y(),ee(Me,{key:0},[K("span",Dy,he(l(h.oldPath)),1),oe(S(Ar),{class:"mx-1 inline size-3 text-muted-foreground"}),K("span",null,he(l(h.path)),1)],64)):(Y(),ee(Me,{key:1},[Se(he(h.path),1)],64))],10,Iy),K("div",Ay,[s(h).additions>0?(Y(),ee("div",{key:0,class:"bg-green-500 dark:bg-green-400",style:Be({width:`${s(h).additions}%`})},null,4)):ge("",!0),s(h).deletions>0?(Y(),ee("div",{key:1,class:"bg-red-500 dark:bg-red-400",style:Be({width:`${s(h).deletions}%`})},null,4)):ge("",!0)])]),K("div",zy,[h.additions>0?(Y(),ee("span",Ry," +"+he(h.additions),1)):ge("",!0),h.deletions>0?(Y(),ee("span",By," -"+he(h.deletions),1)):ge("",!0)])],10,Ty))),128)),e.files.length===0?(Y(),ee("div",Ly," No files changed ")):ge("",!0)]))}}),Fy=Object.assign(Vy,{__name:"GitChangesMinimap"}),Hy={class:"diff-viewer"},qy={key:0,class:"flex items-center justify-center py-8"},Gy={key:1,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},jy={key:2,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},Yy={key:3,class:"diff-container"},Wy={class:"flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6"},Xy={class:"text-center"},Uy={class:"text-sm text-muted-foreground"},Ky={key:4,class:"diff-container"},Zy={class:"full-file-view"},Jy={class:"diff-gutter"},Qy={class:"line-number"},e0={class:"diff-content"},t0=["innerHTML"],n0={key:5,class:"diff-container"},o0={class:"diff-toolbar"},r0={class:"diff-split"},i0={class:"diff-column-content"},s0={key:0,class:"diff-separator-half"},a0={class:"diff-gutter"},l0={key:0,class:"line-number"},u0={class:"diff-content"},c0=["innerHTML"],d0={class:"diff-column-content"},f0={key:0,class:"diff-separator-half"},h0={class:"diff-gutter"},p0={key:0,class:"line-number"},g0={class:"diff-content"},v0=["innerHTML"],Bi=1e4,Li=1500,m0=4e3,y0=ve({__name:"DiffViewer",props:{hunks:{},filePath:{},binary:{type:Boolean},oldPath:{},fileContent:{},showFullFile:{type:Boolean},isLoadingContent:{type:Boolean}},setup(e){const t=e,n=ce(!1),o=ce(!0),r=ce(null),i=ce(null),s=ce(!1);let a=0,l=0;_e(()=>t.filePath,()=>{n.value=!1});function c($){if(!o.value||s.value)return;const _=$.target;i.value&&(s.value=!0,i.value.scrollLeft=_.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}function u($){if(!o.value||s.value)return;const _=$.target;r.value&&(s.value=!0,r.value.scrollLeft=_.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}const d=ne(()=>{let $=0;for(const _ of t.hunks)$+=_.lines.length;return $}),h=ne(()=>d.value>Bi),f=ne(()=>t.hunks.length===0&&!t.binary),y=ne(()=>{const $=new Set,_=new Set;for(const C of t.hunks)for(const N of C.lines)N.type==="add"&&N.newNumber!==void 0&&$.add(N.newNumber),N.type==="remove"&&N.oldNumber!==void 0&&_.add(N.oldNumber);return{added:$,removed:_}}),E=ne(()=>t.fileContent?t.fileContent.split(`
28
- `):[]);function m($){const _=$.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",svelte:"svelte",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",dart:"dart",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",md:"markdown",mdx:"mdx",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile"}[_]||"text"}const x=ne(()=>m(t.filePath)),w=ce(new Map),p=ce(!0),g=new Map;let M=null;async function R(){return M||(M=ja(()=>import("./6tINjQEd.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then($=>$.codeToHtml)),M}const F=ne(()=>{const $=[],_=t.filePath;for(let C=0;C<t.hunks.length;C++){const N=t.hunks[C];C>0&&$.push({type:"separator",hunkIndex:C});const O=N.lines;let L=0;for(;L<O.length;){const q=O[L];if(q.type==="context")$.push({type:"line",pair:{id:`${_}:${C}-${L}`,left:{lineNum:q.oldNumber,content:q.content,type:"context"},right:{lineNum:q.newNumber,content:q.content,type:"context"}}}),L++;else if(q.type==="remove"){const X=[],Z=[];for(;L<O.length&&O[L].type==="remove";)X.push(O[L]),L++;for(;L<O.length&&O[L].type==="add";)Z.push(O[L]),L++;const I=Math.max(X.length,Z.length);for(let b=0;b<I;b++){const P=X[b],D=Z[b];$.push({type:"line",pair:{id:`${_}:${C}-${L-I+b}`,left:P?{lineNum:P.oldNumber,content:P.content,type:"remove"}:{content:"",type:"empty"},right:D?{lineNum:D.newNumber,content:D.content,type:"add"}:{content:"",type:"empty"}}})}}else q.type==="add"&&$.push({type:"line",pair:{id:`${_}:${C}-${L}`,left:{content:"",type:"empty"},right:{lineNum:q.newNumber,content:q.content,type:"add"}}}),L++}}return $});async function H($,_){if(!$.trim())return"";const C=`${_}:${$}`,N=g.get(C);if(N!==void 0)return N;try{const q=(await(await R())($,{lang:_,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/),X=q?q[1]||"":A($);return g.set(C,X),X}catch{const O=A($);return g.set(C,O),O}}async function J($,_){if(!$)return[];const C=$.split(`
29
- `);if(C.length>m0)return C.map(A);try{const L=(await(await R())($,{lang:_,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return!L||!L[1]?C.map(A):L[1].split(`
30
- `)}catch{return C.map(A)}}function A($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const z=ce([]),k=ce(!1);_e(()=>[t.fileContent,t.filePath],async([$],_,C)=>{const N=++a;let O=!1;if(C(()=>{O=!0}),z.value=[],!$){k.value=!1;return}k.value=!0;try{const L=await J($,x.value);if(O||N!==a)return;z.value=L}finally{!O&&N===a&&(k.value=!1)}},{immediate:!0}),_e(()=>[t.hunks,t.filePath,z.value],async($,_,C)=>{const N=++l;let O=!1;C(()=>{O=!0}),p.value=!0,w.value=new Map;const L=x.value,q=new Map,X=z.value,Z=[];try{for(const D of F.value){if(O||N!==l)return;if(D.type==="line"&&D.pair){if(D.pair.left.content&&D.pair.left.type!=="empty"){const j=`${D.pair.id}-old`;if(D.pair.left.type==="context"&&D.pair.left.lineNum&&X.length>0){const Q=D.pair.right.lineNum?D.pair.right.lineNum-1:-1;Q>=0&&Q<X.length?q.set(j,X[Q]||""):Z.push({key:j,content:D.pair.left.content})}else Z.push({key:j,content:D.pair.left.content})}if(D.pair.right.content&&D.pair.right.type!=="empty"){const j=`${D.pair.id}-new`,Q=D.pair.right.lineNum;Q&&X.length>0&&Q<=X.length?q.set(j,X[Q-1]||""):Z.push({key:j,content:D.pair.right.content})}}}const I=Z.slice(0,Li),b=Z.slice(Li);for(const{key:D,content:j}of b)q.set(D,A(j));const P=50;for(let D=0;D<I.length;D+=P){if(O||N!==l)return;const j=I.slice(D,D+P),Q=await Promise.all(j.map(async({key:te,content:re})=>{const ie=await H(re,L);return{key:te,result:ie}}));if(O||N!==l)return;for(const{key:te,result:re}of Q)q.set(te,re)}if(O||N!==l)return;w.value=q}finally{!O&&N===l&&(p.value=!1)}},{immediate:!0});function V($,_){return w.value.get(`${$}-${_}`)||""}function v($){return y.value.added.has($)?"add":"context"}return($,_)=>(Y(),ee("div",Hy,[(S(p)||e.isLoadingContent||S(k))&&!e.binary?(Y(),ee("div",qy,[..._[2]||(_[2]=[K("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):e.binary?(Y(),ee("div",Gy,[oe(S(kl),{class:"size-10 opacity-50"}),_[3]||(_[3]=K("div",{class:"text-center"},[K("p",{class:"font-medium"},"Binary file"),K("p",{class:"text-sm"},"This file cannot be displayed as a diff")],-1))])):S(f)&&!e.showFullFile?(Y(),ee("div",jy,[oe(S(Ut),{class:"size-10 opacity-50"}),_[4]||(_[4]=K("div",{class:"text-center"},[K("p",{class:"font-medium"},"No changes"),K("p",{class:"text-sm"},"This file was touched but has no content changes")],-1))])):S(h)&&!S(n)&&!e.showFullFile?(Y(),ee("div",Yy,[K("div",Wy,[oe(S(Ut),{class:"size-8 text-yellow-500"}),K("div",Xy,[_[5]||(_[5]=K("p",{class:"font-medium"},"Large file",-1)),K("p",Uy," This file has "+he(S(d).toLocaleString())+" lines (threshold: "+he(Bi.toLocaleString())+") ",1)]),oe(S(xt),{variant:"outline",size:"sm",onClick:_[0]||(_[0]=C=>n.value=!0)},{default:fe(()=>[oe(S(nl),{class:"mr-2 size-4"}),_[6]||(_[6]=Se(" Show full diff ",-1))]),_:1})])])):e.showFullFile&&e.fileContent?(Y(),ee("div",Ky,[K("div",Zy,[(Y(!0),ee(Me,null,Ge(S(E),(C,N)=>(Y(),ee("div",{key:N,class:Ae(["full-file-line",{"diff-add":v(N+1)==="add"}])},[K("div",Jy,[K("span",Qy,he(N+1),1)]),K("div",e0,[K("span",{class:"diff-code",innerHTML:S(z)[N]||A(C)},null,8,t0)])],2))),128))])])):(Y(),ee("div",n0,[K("div",o0,[oe(S(xt),{variant:"ghost",size:"sm",class:Ae(["h-7 gap-1.5 text-xs",{"text-primary":S(o)}]),onClick:_[1]||(_[1]=C=>o.value=!S(o))},{default:fe(()=>[(Y(),we(qe(S(o)?S(Ol):S(Pl)),{class:"size-3.5"})),Se(" "+he(S(o)?"Sync scroll":"Scroll unlocked"),1)]),_:1},8,["class"])]),K("div",r0,[K("div",{ref_key:"leftScrollRef",ref:r,class:"diff-column diff-column-left",onScroll:c},[K("div",i0,[(Y(!0),ee(Me,null,Ge(S(F),C=>(Y(),ee(Me,{key:C.type==="line"?`left-${C.pair?.id}`:`left-sep-${C.hunkIndex}`},[C.type==="separator"?(Y(),ee("div",s0,[..._[7]||(_[7]=[K("div",{class:"separator-line"},null,-1),K("span",{class:"separator-text"},"···",-1)])])):C.pair?(Y(),ee("div",{key:1,class:Ae(["diff-line",{"diff-remove":C.pair.left.type==="remove","diff-empty":C.pair.left.type==="empty","diff-context":C.pair.left.type==="context"}])},[K("div",a0,[C.pair.left.lineNum?(Y(),ee("span",l0,he(C.pair.left.lineNum),1)):ge("",!0)]),K("div",u0,[C.pair.left.type!=="empty"?(Y(),ee("span",{key:0,class:"diff-code",innerHTML:V(C.pair.id,"old")||A(C.pair.left.content)},null,8,c0)):ge("",!0)])],2)):ge("",!0)],64))),128))])],544),K("div",{ref_key:"rightScrollRef",ref:i,class:"diff-column diff-column-right",onScroll:u},[K("div",d0,[(Y(!0),ee(Me,null,Ge(S(F),C=>(Y(),ee(Me,{key:C.type==="line"?`right-${C.pair?.id}`:`right-sep-${C.hunkIndex}`},[C.type==="separator"?(Y(),ee("div",f0,[..._[8]||(_[8]=[K("span",{class:"separator-text"},"···",-1),K("div",{class:"separator-line"},null,-1)])])):C.pair?(Y(),ee("div",{key:1,class:Ae(["diff-line",{"diff-add":C.pair.right.type==="add","diff-empty":C.pair.right.type==="empty","diff-context":C.pair.right.type==="context"}])},[K("div",h0,[C.pair.right.lineNum?(Y(),ee("span",p0,he(C.pair.right.lineNum),1)):ge("",!0)]),K("div",g0,[C.pair.right.type!=="empty"?(Y(),ee("span",{key:0,class:"diff-code",innerHTML:V(C.pair.id,"new")||A(C.pair.right.content)},null,8,v0)):ge("",!0)])],2)):ge("",!0)],64))),128))])],544)])]))]))}}),w0=Object.assign(gl(y0,[["__scopeId","data-v-9eb8ced7"]]),{__name:"GitDiffViewer"}),_0=ve({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const r=hr(e,t);return(i,s)=>(Y(),we(S(_c),He({"data-slot":"tooltip"},S(r)),{default:fe(a=>[be(i.$slots,"default",co(fo(a)))]),_:3},16))}}),Vi=Object.assign(_0,{__name:"UiTooltip"}),b0=ve({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,r=ji(n,"class"),i=hr(r,o);return(s,a)=>(Y(),we(S(Nc),null,{default:fe(()=>[oe(S(Sc),He({"data-slot":"tooltip-content"},{...S(i),...s.$attrs},{class:S(Yi)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",n.class)}),{default:fe(()=>[be(s.$slots,"default"),oe(S(pc),{class:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]),_:3},16,["class"])]),_:3}))}}),Fi=Object.assign(b0,{__name:"UiTooltipContent"}),x0=ve({__name:"TooltipProvider",props:{delayDuration:{default:0},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(e){const t=e;return(n,o)=>(Y(),we(S(mc),co(fo(t)),{default:fe(()=>[be(n.$slots,"default")]),_:3},16))}}),Hi=Object.assign(x0,{__name:"UiTooltipProvider"}),E0=ve({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,o)=>(Y(),we(S(Mc),He({"data-slot":"tooltip-trigger"},t),{default:fe(()=>[be(n.$slots,"default")]),_:3},16))}}),qi=Object.assign(E0,{__name:"UiTooltipTrigger"});function ur(){let e=null;function t(){e?.controller.abort();const r=new AbortController,i={controller:r,signal:r.signal,isCurrent:()=>e===i&&!r.signal.aborted};return e=i,i}function n(r){e===r&&(e=null)}function o(){e?.controller.abort(),e=null}return{begin:t,clear:n,cancel:o}}function Ht(e){if(!e||typeof e!="object")return!1;const t=e;if(t.name==="AbortError"||t.cause?.name==="AbortError")return!0;const n=t.message||t.cause?.message;return typeof n=="string"&&n.toLowerCase().includes("aborted")}function ba(){const{showError:e}=Oa();function t(m){if(m&&typeof m=="object"){const x=m;return x.data?.message||x.data?.statusMessage||x.message||"Unknown error"}return"Unknown error"}const n=ce(0),o=ce(0),r=ce(0),i=ce(0),s=ne(()=>n.value>0),a=ne(()=>o.value>0),l=ne(()=>r.value>0),c=ne(()=>i.value>0);function u(m){m.value+=1}function d(m){m.value=Math.max(0,m.value-1)}async function h(m,x,w){if(!m||x.length===0)return{commits:[],failedShas:[]};u(n);try{const p={shas:x.join(",")};w?.repoPath&&(p.repo=w.repoPath);const g=await $fetch(`/api/repos/${m}/git/commits`,{query:p,signal:w?.signal}),M=g.map(F=>F.shortSha),R=x.filter(F=>!M.some(H=>H.startsWith(F)||F.startsWith(H)));return{commits:g,failedShas:R}}catch(p){return Ht(p)?{commits:[],failedShas:[]}:(w?.suppressError||e("Failed to fetch commits",t(p)),{commits:[],failedShas:x})}finally{d(n)}}async function f(m,x,w){if(!m||!x)return[];u(o);try{const p={commit:x};return w?.repoPath&&(p.repo=w.repoPath),await $fetch(`/api/repos/${m}/git/diff`,{query:p,signal:w?.signal})}catch(p){throw!Ht(p)&&!w?.suppressError&&e("Failed to fetch diff",t(p)),p}finally{d(o)}}async function y(m,x,w,p){if(!m||!x||!w)return[];u(r);try{const g={commit:x,file:w};return p?.repoPath&&(g.repo=p.repoPath),await $fetch(`/api/repos/${m}/git/file-diff`,{query:g,signal:p?.signal})}catch(g){throw!Ht(g)&&!p?.suppressError&&e("Failed to fetch file diff",t(g)),g}finally{d(r)}}async function E(m,x,w,p){if(!m||!x||!w)return null;u(i);try{const g={commit:x,file:w};return p?.repoPath&&(g.repo=p.repoPath),(await $fetch(`/api/repos/${m}/git/file-content`,{query:g,signal:p?.signal})).content}catch(g){throw!Ht(g)&&!p?.suppressError&&e("Failed to fetch file content",t(g)),g}finally{d(i)}}return{fetchCommits:h,fetchDiff:f,fetchFileDiff:y,fetchFileContent:E,isLoadingCommits:s,isLoadingDiff:a,isLoadingFileDiff:l,isLoadingFileContent:c}}const k0={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},S0={class:"text-center"},C0={class:"text-sm text-muted-foreground"},N0={key:1,class:"flex flex-1 items-center justify-center"},$0={key:2,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground"},M0={key:3,class:"flex min-h-0 flex-1 overflow-hidden"},P0={class:"flex w-56 shrink-0 flex-col border-r border-border"},T0={class:"flex items-center justify-between border-b border-border px-3 py-2"},O0={class:"text-xs font-medium text-muted-foreground"},I0={class:"text-muted-foreground/50 transition-colors hover:text-muted-foreground"},D0={class:"min-h-0 flex-1 overflow-y-auto"},A0={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},z0={key:0,class:"flex items-center gap-2 border-b border-border px-4 py-2"},R0={key:0,class:"min-w-0 flex-1 truncate font-mono text-sm"},B0={class:"text-muted-foreground"},L0={key:1,class:"min-w-0 flex-1 truncate font-mono text-sm"},V0={key:2,class:"rounded bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-600 dark:text-yellow-400"},F0={key:1,class:"flex flex-1 items-center justify-center"},H0={key:2,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},q0={class:"text-center"},G0={class:"text-xs text-muted-foreground"},j0={key:4,class:"flex flex-1 items-center justify-center text-sm text-muted-foreground"},Y0=ve({__name:"DiffPanel",props:{repoId:{},commitSha:{},repoPath:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{fetchDiff:r,fetchFileDiff:i,fetchFileContent:s,isLoadingDiff:a,isLoadingFileDiff:l,isLoadingFileContent:c}=ba(),u=ce([]),d=ce(),h=ce([]),f=ce(null),y=ce(null),E=ce(null),m=ce("changes"),x=ur(),w=ur();function p(N,O){if(N&&typeof N=="object"){const L=N;return L.data?.message||L.data?.statusMessage||L.statusMessage||L.message||O}return O}const g=ne(()=>u.value.find(N=>N.path===d.value)),M=ne(()=>`${n.repoPath||""}:${n.commitSha}:${d.value||""}`);function R(){y.value=null,u.value=[],d.value=void 0,h.value=[],f.value=null,E.value=null}async function F(){const N=n.repoId,O=n.commitSha,L=n.repoPath,q=x.begin();w.cancel(),R();try{const X=await r(N,O,{repoPath:L,signal:q.signal,suppressError:!0});if(!(q.isCurrent()&&n.repoId===N&&n.commitSha===O&&n.repoPath===L))return;u.value=X,X.length>0&&(d.value=X[0].path)}catch(X){if(Ht(X)||!q.isCurrent())return;y.value=p(X,"Could not load commit diff.")}finally{x.clear(q)}}async function H(){const N=d.value;if(!N){E.value=null,h.value=[],f.value=null;return}const O=n.repoId,L=n.commitSha,q=n.repoPath,X=m.value,Z=N,I=w.begin();E.value=null,h.value=[],f.value=null;const b=()=>I.isCurrent()&&n.repoId===O&&n.commitSha===L&&n.repoPath===q&&m.value===X&&d.value===Z;try{const P=i(O,L,Z,{repoPath:q,signal:I.signal,suppressError:!0});if(X==="full"){const[D,j]=await Promise.all([P,s(O,L,Z,{repoPath:q,signal:I.signal,suppressError:!0})]);if(!b())return;h.value=D,f.value=j}else{const D=await P;if(!b())return;h.value=D,f.value=null}}catch(P){if(!b()||Ht(P))return;E.value=p(P,"Could not load file diff.")}finally{w.clear(I)}}function J(){m.value=m.value==="changes"?"full":"changes"}function A(N){d.value=N}function z(){F()}function k(){H()}_e(()=>[d.value,m.value],()=>{H()}),_e(()=>[n.repoId,n.commitSha,n.repoPath],()=>{F()},{immediate:!0});const V=ce(null),v=ce(null);function $(N){if(u.value.length===0)return;const O=d.value?u.value.findIndex(X=>X.path===d.value):-1;let L;N==="next"?L=O<u.value.length-1?O+1:0:L=O>0?O-1:u.value.length-1;const q=u.value[L];q&&(d.value=q.path)}function _(N){if(!v.value)return;const O=v.value.querySelectorAll(".diff-separator");if(O.length===0)return;const L=v.value.closest(".overflow-y-auto, [data-radix-scroll-area-viewport]");if(!L)return;const q=L.scrollTop,X=L.getBoundingClientRect();let Z=null;if(N==="next"){for(const I of O)if(I.getBoundingClientRect().top-X.top+q>q+50){Z=I;break}!Z&&O.length>0&&(Z=O[0])}else{for(let I=O.length-1;I>=0;I--){const b=O[I];if(b.getBoundingClientRect().top-X.top+q<q-10){Z=b;break}}!Z&&O.length>0&&(Z=O[O.length-1])}Z&&Z.scrollIntoView({behavior:"smooth",block:"start"})}function C(N){if(!(N.target instanceof HTMLInputElement||N.target instanceof HTMLTextAreaElement))switch(N.key){case"j":case"ArrowDown":!N.ctrlKey&&!N.metaKey&&(N.preventDefault(),$("next"));break;case"k":case"ArrowUp":!N.ctrlKey&&!N.metaKey&&(N.preventDefault(),$("prev"));break;case"[":N.preventDefault(),_("prev");break;case"]":N.preventDefault(),_("next");break;case"Escape":N.preventDefault(),o("close");break}}return je(()=>{document.addEventListener("keydown",C)}),dr(()=>{x.cancel(),w.cancel(),document.removeEventListener("keydown",C)}),(N,O)=>{const L=Fy,q=w0;return Y(),ee("div",{ref_key:"panelRef",ref:V,class:"flex h-full flex-col overflow-hidden",tabindex:"-1"},[S(y)?(Y(),ee("div",k0,[oe(S(Yn),{class:"size-12 text-destructive"}),K("div",S0,[O[0]||(O[0]=K("p",{class:"font-medium"},"Failed to load diff",-1)),K("p",C0,he(S(y)),1)]),oe(S(xt),{variant:"outline",size:"sm",onClick:z},{default:fe(()=>[oe(S(Dr),{class:"mr-2 size-4"}),O[1]||(O[1]=Se(" Retry ",-1))]),_:1})])):S(a)&&S(u).length===0?(Y(),ee("div",N0,[oe(S(qo),{class:"size-8 animate-spin text-muted-foreground"})])):S(u).length===0?(Y(),ee("div",$0,[...O[2]||(O[2]=[K("p",null,"No files changed in this commit",-1)])])):(Y(),ee("div",M0,[K("div",P0,[K("div",T0,[K("span",O0,he(S(u).length)+" file"+he(S(u).length!==1?"s":"")+" changed ",1),oe(S(Hi),null,{default:fe(()=>[oe(S(Vi),null,{default:fe(()=>[oe(S(qi),{"as-child":""},{default:fe(()=>[K("button",I0,[oe(S(ol),{class:"size-3.5"})])]),_:1}),oe(S(Fi),{side:"bottom",align:"end",class:"max-w-xs"},{default:fe(()=>[...O[3]||(O[3]=[K("div",{class:"space-y-1 text-xs"},[K("div",{class:"flex justify-between gap-4"},[K("span",{class:"text-muted-foreground"},"Navigate files"),K("span",{class:"font-mono"},"j/k or ↑/↓")]),K("div",{class:"flex justify-between gap-4"},[K("span",{class:"text-muted-foreground"},"Jump to hunk"),K("span",{class:"font-mono"},"[ / ]")]),K("div",{class:"flex justify-between gap-4"},[K("span",{class:"text-muted-foreground"},"Close"),K("span",{class:"font-mono"},"Esc")])],-1)])]),_:1})]),_:1})]),_:1})]),K("div",D0,[oe(L,{files:S(u),"selected-file":S(d),onSelect:A},null,8,["files","selected-file"])])]),K("div",A0,[S(d)?(Y(),ee("div",z0,[S(g)?.oldPath?(Y(),ee("span",R0,[K("span",B0,he(S(g).oldPath),1),O[4]||(O[4]=K("span",{class:"mx-2 text-muted-foreground"},"→",-1)),K("span",null,he(S(d)),1)])):(Y(),ee("span",L0,he(S(d)),1)),S(g)?.binary?(Y(),ee("span",V0," binary ")):ge("",!0),S(g)?.binary?ge("",!0):(Y(),we(S(Hi),{key:3},{default:fe(()=>[oe(S(Vi),null,{default:fe(()=>[oe(S(qi),{"as-child":""},{default:fe(()=>[oe(S(xt),{variant:"ghost",size:"sm",class:"h-7 shrink-0 gap-1.5 text-xs",onClick:J},{default:fe(()=>[(Y(),we(qe(S(m)==="changes"?S(El):S(xl)),{class:"size-3.5"})),Se(" "+he(S(m)==="changes"?"Changes":"Full file"),1)]),_:1})]),_:1}),oe(S(Fi),null,{default:fe(()=>[Se(he(S(m)==="changes"?"Show full file with changes":"Show changes only"),1)]),_:1})]),_:1})]),_:1}))])):ge("",!0),S(l)?(Y(),ee("div",F0,[oe(S(qo),{class:"size-6 animate-spin text-muted-foreground"})])):S(E)?(Y(),ee("div",H0,[oe(S(Yn),{class:"size-8 text-destructive"}),K("div",q0,[O[5]||(O[5]=K("p",{class:"text-sm font-medium"},"Failed to load file diff",-1)),K("p",G0,he(S(E)),1)]),oe(S(xt),{variant:"outline",size:"sm",onClick:k},{default:fe(()=>[oe(S(Dr),{class:"mr-2 size-4"}),O[6]||(O[6]=Se(" Retry ",-1))]),_:1})])):S(d)?(Y(),we(S(rl),{key:3,class:"h-0 flex-1 overflow-hidden"},{default:fe(()=>[K("div",{ref_key:"diffViewerRef",ref:v},[(Y(),we(q,{key:S(M),hunks:S(h),"file-path":S(d),binary:S(g)?.binary,"old-path":S(g)?.oldPath,"file-content":S(f),"show-full-file":S(m)==="full","is-loading-content":S(c)},null,8,["hunks","file-path","binary","old-path","file-content","show-full-file","is-loading-content"]))],512)]),_:1})):(Y(),ee("div",j0," Select a file to view changes "))])]))],512)}}}),W0=Object.assign(Y0,{__name:"GitDiffPanel"}),X0={class:"space-y-2"},U0={key:1,class:"rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground"},K0=["onClick"],Z0={class:"flex items-start gap-3"},J0={class:"min-w-0 flex-1"},Q0={class:"flex flex-wrap items-center gap-2"},ew={class:"font-mono text-xs font-medium text-primary"},tw={class:"flex items-center gap-1 text-xs text-muted-foreground"},nw={class:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400"},ow={class:"flex items-center gap-0.5 text-xs text-red-600 dark:text-red-400"},rw={class:"mt-1 truncate text-sm"},iw={key:1,class:"flex items-center gap-1 text-muted-foreground"},sw={key:2,class:"text-muted-foreground"},aw={key:0,class:"mt-1 text-xs text-muted-foreground"},lw=ve({__name:"CommitList",props:{commits:{},repoId:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{fetchCommits:r,isLoadingCommits:i}=ba(),s=ce(new Map),a=ce(new Set);function l(w){return w.trim().toLowerCase()}function c(w){return(w||"").trim()}function u(w,p){return`${c(p)}::${l(w)}`}function d(w,p){const g=l(w),M=l(p.sha),R=l(p.shortSha);return M===g||R===g||M.startsWith(g)||g.startsWith(M)||R.startsWith(g)||g.startsWith(R)}const h=ne(()=>new Set(n.commits.map(p=>p.repo).filter(Boolean)).size>1),f=ur();_e(()=>({commits:n.commits,repoId:n.repoId}),async({commits:w,repoId:p},g,M)=>{const R=f.begin();if(M(()=>{f.clear(R)}),w.length===0||!p){s.value=new Map,a.value=new Set;return}const F=new Map;for(const z of w){const k=z.repo||"";F.has(k)||F.set(k,[]),F.get(k).push(z.sha)}const H=await Promise.all(Array.from(F.entries()).map(async([z,k])=>{const V=await r(p,k,{repoPath:z||void 0,signal:R.signal});return{repoPath:z,requestedShas:[...k],commits:V.commits,failedShas:V.failedShas}})),J=new Map,A=new Set;for(const{repoPath:z,requestedShas:k,commits:V,failedShas:v}of H){const $=[...V];for(const _ of k){const C=u(_,z),N=$.findIndex(O=>d(_,O));if(N>=0){const[O]=$.splice(N,1);if(O){J.set(C,{...O,repoPath:z});continue}}A.add(C)}for(const _ of v)A.add(u(_,z))}R.isCurrent()&&(s.value=J,a.value=A)},{immediate:!0}),dr(()=>{f.cancel()});function y(w){const p=new Date(w),M=new Date().getTime()-p.getTime(),R=Math.floor(M/1e3),F=Math.floor(R/60),H=Math.floor(F/60),J=Math.floor(H/24);return R<60?"just now":F<60?`${F} minute${F===1?"":"s"} ago`:H<24?`${H} hour${H===1?"":"s"} ago`:J<7?`${J} day${J===1?"":"s"} ago`:p.toLocaleDateString()}function E(w){o("select",w.sha,w.repo)}function m(w){const p=s.value.get(u(w.sha,w.repo));if(p)return p;const g=l(w.sha),M=`${c(w.repo)}::`;for(const[R,F]of s.value){if(!R.startsWith(M))continue;const H=R.slice(M.length);if(H.startsWith(g)||g.startsWith(H))return F}}function x(w){const p=u(w.sha,w.repo);if(a.value.has(p))return!0;const g=l(w.sha),M=`${c(w.repo)}::`;for(const R of a.value){if(!R.startsWith(M))continue;const F=R.slice(M.length);if(F.startsWith(g)||g.startsWith(F))return!0}return!1}return(w,p)=>(Y(),ee("div",X0,[S(i)?(Y(!0),ee(Me,{key:0},Ge(Math.min(e.commits.length,3),g=>(Y(),ee("div",{key:g,class:"animate-pulse rounded-lg border bg-muted/50 p-3"},[...p[0]||(p[0]=[Ya('<div class="flex items-start gap-3"><div class="h-5 w-5 rounded bg-muted"></div><div class="flex-1 space-y-2"><div class="h-4 w-20 rounded bg-muted"></div><div class="h-4 w-3/4 rounded bg-muted"></div><div class="h-3 w-1/2 rounded bg-muted"></div></div></div>',1)])]))),128)):e.commits.length===0?(Y(),ee("div",U0," No commits recorded for this task ")):(Y(!0),ee(Me,{key:2},Ge(e.commits,g=>(Y(),ee("button",{key:`${g.repo||""}:${g.sha}`,class:"w-full rounded-lg border bg-card p-3 text-left transition-colors hover:bg-muted/50 focus:outline-none focus:ring-2 focus:ring-ring",onClick:M=>E(g)},[K("div",Z0,[oe(S(Ml),{class:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),K("div",J0,[K("div",Q0,[K("code",ew,he(m(g)?.shortSha||g.sha.substring(0,7)),1),m(g)?(Y(),ee(Me,{key:0},[K("span",tw,[oe(S(Ia),{class:"size-3"}),Se(" "+he(m(g).filesChanged),1)]),K("span",nw,[oe(S(il),{class:"size-3"}),Se(he(m(g).additions),1)]),K("span",ow,[oe(S(Dl),{class:"size-3"}),Se(he(m(g).deletions),1)])],64)):ge("",!0),g.repo&&S(h)?(Y(),we(S(Vn),{key:1,variant:"secondary",class:"gap-1 text-xs"},{default:fe(()=>[oe(S($l),{class:"size-3"}),Se(" "+he(g.repo),1)]),_:2},1024)):ge("",!0)]),K("p",rw,[m(g)?(Y(),ee(Me,{key:0},[Se(he(m(g).message),1)],64)):x(g)?(Y(),ee("span",iw,[oe(S(Yn),{class:"size-3"}),p[1]||(p[1]=Se(" Commit unavailable ",-1))])):(Y(),ee("span",sw,"Loading..."))]),m(g)?(Y(),ee("p",aw,he(m(g).author)+" · "+he(y(m(g).date)),1)):ge("",!0)])])],8,K0))),128))]))}}),uw=Object.assign(lw,{__name:"GitCommitList"}),cw=ve({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=ji(t,"class");return(o,r)=>(Y(),we(S(sl),He({"data-slot":"separator"},S(n),{class:S(Yi)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t.class)}),null,16,["class"]))}}),Vt=Object.assign(cw,{__name:"UiSeparator"}),dw={class:"flex items-center gap-2"},fw={key:1,class:"min-h-0 flex-1 overflow-hidden"},hw={key:2,class:"min-h-0 flex-1 space-y-4 overflow-y-auto px-6"},pw={class:"flex flex-wrap items-center gap-2"},gw={class:"space-y-2"},vw={class:"text-sm text-muted-foreground leading-relaxed"},mw={key:0,class:"space-y-2"},yw={class:"flex items-center gap-2 text-sm font-medium"},ww={class:"ml-4 list-decimal space-y-1 text-sm text-muted-foreground"},_w={key:2,class:"space-y-2"},bw={class:"flex items-center gap-2 text-sm font-medium"},xw={class:"space-y-1.5 text-sm text-muted-foreground"},Ew={key:4,class:"space-y-2"},kw={class:"flex items-center gap-2 text-sm font-medium"},Sw={class:"space-y-1.5"},Cw={class:"mt-0.5 whitespace-nowrap rounded bg-background px-1.5 py-0.5 font-mono text-[11px] leading-none text-foreground/75"},Nw={class:"min-w-0 text-sm leading-snug text-muted-foreground"},$w={class:"space-y-2"},Mw={class:"flex items-center gap-2 text-sm font-medium"},Pw={key:6,class:"space-y-2"},Tw={class:"flex flex-col gap-1 text-xs text-muted-foreground"},Ow={key:0,class:"flex items-center gap-2"},Iw={key:1,class:"flex items-center gap-2"},Dw={key:7,class:"space-y-2"},Aw={class:"flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm"},zw={class:"text-muted-foreground"},Rw=ve({__name:"Detail",props:Xa({task:{},taskTitles:{},commits:{},repoId:{},taskPrdSlug:{},currentPrdSlug:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const t=e,n=Wa(e,"open"),o=ne(()=>{if(!t.task)return{label:"",variant:"secondary"};switch(t.task.category){case"setup":return{label:"Setup",variant:"secondary"};case"feature":return{label:"Feature",variant:"default"};case"integration":return{label:"Integration",variant:"outline"};case"testing":return{label:"Testing",variant:"secondary"};case"documentation":return{label:"Docs",variant:"secondary"};default:return{label:t.task.category,variant:"secondary"}}}),r=ne(()=>{if(!t.task)return{label:"",class:""};switch(t.task.priority){case"critical":return{label:"Critical",class:"text-destructive"};case"high":return{label:"High",class:"text-orange-500"};case"medium":return{label:"Medium",class:"text-muted-foreground"};case"low":return{label:"Low",class:"text-muted-foreground"};default:return{label:t.task.priority,class:"text-muted-foreground"}}}),i=ne(()=>{if(!t.task)return{label:"",icon:fn,class:""};switch(t.task.status){case"pending":return{label:"Pending",icon:fn,class:"text-muted-foreground"};case"in_progress":return{label:"In Progress",icon:wl,class:"text-blue-500"};case"completed":return{label:"Completed",icon:Wn,class:"text-green-500"};default:return{label:t.task.status,icon:fn,class:"text-muted-foreground"}}});function s(m){if(!m)return"";try{return new Date(m).toLocaleString()}catch{return m}}function a(m){return t.taskTitles?.get(m)??m}const l=ne(()=>t.commits&&t.commits.length>0&&t.repoId),c=ne(()=>!t.repoId||!t.taskPrdSlug?!1:t.currentPrdSlug?t.taskPrdSlug!==t.currentPrdSlug:!0),u=ne(()=>{if(!c.value||!t.repoId||!t.taskPrdSlug||!t.task)return"";const m=new URLSearchParams({task:t.task.id,taskPrd:t.taskPrdSlug});return`/${t.repoId}/${t.taskPrdSlug}?${m.toString()}`}),d=ce("details"),h=ce(null),f=ce(null);function y(m,x){h.value=m,f.value=x||null,d.value="diff"}function E(){d.value="details",h.value=null,f.value=null}return _e(()=>t.task,()=>{d.value="details",h.value=null,f.value=null}),_e(n,m=>{m||(d.value="details",h.value=null,f.value=null)}),(m,x)=>{const w=W0,p=uw,g=vl;return Y(),we(S(hl),{open:n.value,"onUpdate:open":x[0]||(x[0]=M=>n.value=M)},{default:fe(()=>[oe(S(fl),{class:Ae(["flex h-full w-full flex-col overflow-hidden sm:max-w-lg",S(d)==="diff"?"sm:!max-w-[94vw] xl:!max-w-[88vw]":""])},{default:fe(()=>[e.task?(Y(),we(S(al),{key:0,class:"px-6 pr-12"},{default:fe(()=>[K("div",dw,[S(d)==="diff"?(Y(),we(S(xt),{key:0,variant:"ghost",size:"icon",class:"size-8 shrink-0",onClick:E},{default:fe(()=>[oe(S(ml),{class:"size-4"})]),_:1})):ge("",!0),oe(S(ll),{class:"text-left text-lg"},{default:fe(()=>[Se(he(S(d)==="diff"?"Commit Changes":e.task.title),1)]),_:1})]),oe(S(ul),{class:"sr-only"},{default:fe(()=>[...x[1]||(x[1]=[Se("Task details",-1)])]),_:1})]),_:1})):ge("",!0),e.task&&S(d)==="diff"&&S(h)&&e.repoId?(Y(),ee("div",fw,[oe(w,{"repo-id":e.repoId,"commit-sha":S(h),"repo-path":S(f)||void 0,class:"h-full",onClose:E},null,8,["repo-id","commit-sha","repo-path"])])):e.task?(Y(),ee("div",hw,[K("div",pw,[oe(S(Vn),{variant:S(o).variant},{default:fe(()=>[oe(S(zl),{class:"mr-1 size-3"}),Se(" "+he(S(o).label),1)]),_:1},8,["variant"]),oe(S(Vn),{variant:"outline",class:Ae(S(r).class)},{default:fe(()=>[oe(S(Ut),{class:"mr-1 size-3"}),Se(" "+he(S(r).label),1)]),_:1},8,["class"]),oe(S(Vn),{variant:"outline",class:Ae(S(i).class)},{default:fe(()=>[(Y(),we(qe(S(i).icon),{class:"mr-1 size-3"})),Se(" "+he(S(i).label),1)]),_:1},8,["class"])]),K("div",gw,[x[2]||(x[2]=K("h4",{class:"text-sm font-medium"},"Description",-1)),K("p",vw,he(e.task.description),1)]),oe(S(Vt)),e.task.steps.length>0?(Y(),ee("div",mw,[K("h4",yw,[oe(S(Il),{class:"size-4"}),x[3]||(x[3]=Se(" Steps ",-1))]),K("ol",ww,[(Y(!0),ee(Me,null,Ge(e.task.steps,(M,R)=>(Y(),ee("li",{key:R,class:"pl-1"},he(M),1))),128))])])):ge("",!0),e.task.steps.length>0&&e.task.passes.length>0?(Y(),we(S(Vt),{key:1})):ge("",!0),e.task.passes.length>0?(Y(),ee("div",_w,[K("h4",bw,[oe(S(Al),{class:"size-4"}),x[4]||(x[4]=Se(" Pass Criteria ",-1))]),K("ul",xw,[(Y(!0),ee(Me,null,Ge(e.task.passes,(M,R)=>(Y(),ee("li",{key:R,class:"flex items-start gap-2"},[K("div",{class:Ae(["mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border",e.task.status==="completed"?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/50"])},[e.task.status==="completed"?(Y(),we(S(pl),{key:0,class:"size-3"})):ge("",!0)],2),K("span",null,he(M),1)]))),128))])])):ge("",!0),e.task.dependencies.length>0?(Y(),we(S(Vt),{key:3})):ge("",!0),e.task.dependencies.length>0?(Y(),ee("div",Ew,[K("h4",kw,[oe(S(Tl),{class:"size-4"}),x[5]||(x[5]=Se(" Dependencies ",-1))]),K("ul",Sw,[(Y(!0),ee(Me,null,Ge(e.task.dependencies,M=>(Y(),ee("li",{key:M,class:"grid grid-cols-[auto_minmax(0,1fr)] items-start gap-2.5 rounded-md border border-border/60 bg-muted/25 px-3 py-2"},[K("span",Cw,he(M),1),K("span",Nw,he(a(M)),1)]))),128))])])):ge("",!0),S(l)?(Y(),ee(Me,{key:5},[oe(S(Vt)),K("div",$w,[K("h4",Mw,[oe(S(_l),{class:"size-4"}),x[6]||(x[6]=Se(" Changes ",-1))]),oe(p,{commits:e.commits,"repo-id":e.repoId,onSelect:y},null,8,["commits","repo-id"])])],64)):ge("",!0),e.task.startedAt||e.task.completedAt?(Y(),ee("div",Pw,[oe(S(Vt)),K("div",Tw,[e.task.startedAt?(Y(),ee("div",Ow,[oe(S(yl),{class:"size-3"}),K("span",null,"Started: "+he(s(e.task.startedAt)),1)])):ge("",!0),e.task.completedAt?(Y(),ee("div",Iw,[oe(S(Wn),{class:"size-3"}),K("span",null,"Completed: "+he(s(e.task.completedAt)),1)])):ge("",!0)])])):ge("",!0),S(c)?(Y(),ee("div",Dw,[oe(S(Vt)),K("div",Aw,[K("span",zw,"This task belongs to "+he(e.taskPrdSlug)+".",1),oe(g,{to:S(u)},{default:fe(()=>[oe(S(xt),{variant:"outline",size:"sm",class:"h-8"},{default:fe(()=>[oe(S(bl),{class:"mr-1.5 size-3.5"}),x[7]||(x[7]=Se(" Open PRD ",-1))]),_:1})]),_:1},8,["to"])])])):ge("",!0)])):ge("",!0),oe(S(cl),{class:"px-6 pb-6"},{default:fe(()=>[oe(S(dl),{"as-child":""},{default:fe(()=>[oe(S(xt),{variant:"outline",class:"w-full"},{default:fe(()=>[...x[8]||(x[8]=[Se("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["class"])]),_:1},8,["open"])}}}),jw=Object.assign(Rw,{__name:"TasksDetail"});export{yl as C,bl as E,Dl as M,jw as _,fn as a,Wn as b,Gw as c};