@thxgg/steward 0.1.16 → 0.1.18

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 (157) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{CxHOXVf6.js → -z_Gr0GN.js} +1 -1
  3. package/.output/public/_nuxt/5LlyHjkF.js +60 -0
  4. package/.output/public/_nuxt/BA0u_CRT.js +1 -0
  5. package/.output/public/_nuxt/{Bibm_IDv.js → BA4e9-N5.js} +2 -2
  6. package/.output/public/_nuxt/{BSA0RJ-H.js → BO8EM227.js} +1 -1
  7. package/.output/public/_nuxt/C0XT5P3Q.js +1 -0
  8. package/.output/public/_nuxt/{BWVTacYj.js → CGzrvVc6.js} +1 -1
  9. package/.output/public/_nuxt/{Dum5qplW.js → CJlXUkTg.js} +1 -1
  10. package/.output/public/_nuxt/CZsXZugv.js +1 -0
  11. package/.output/public/_nuxt/{ynmyrfyT.js → C_HVaH3B.js} +1 -1
  12. package/.output/public/_nuxt/{wbjFvimm.js → DAnnHVQP.js} +1 -1
  13. package/.output/public/_nuxt/DEr8q68O.js +141 -0
  14. package/.output/public/_nuxt/Detail.DSyVQNdr.css +1 -0
  15. package/.output/public/_nuxt/DrXxYwWw.js +30 -0
  16. package/.output/public/_nuxt/QAzsKGuP.js +1 -0
  17. package/.output/public/_nuxt/TSsR_oCL.js +1 -0
  18. package/.output/public/_nuxt/WUF6Thhn.js +13 -0
  19. package/.output/public/_nuxt/_prd_.BkpxMFSV.css +1 -0
  20. package/.output/public/_nuxt/builds/latest.json +1 -1
  21. package/.output/public/_nuxt/builds/meta/19e0e040-a531-4c25-b46d-a6ca54a1ae3e.json +1 -0
  22. package/.output/public/_nuxt/i9wn3hS7.js +1 -0
  23. package/.output/server/chunks/_/git-api.mjs +101 -8
  24. package/.output/server/chunks/_/git-api.mjs.map +1 -1
  25. package/.output/server/chunks/_/git.mjs +3 -10
  26. package/.output/server/chunks/_/git.mjs.map +1 -1
  27. package/.output/server/chunks/_/prd-service.mjs +366 -0
  28. package/.output/server/chunks/_/prd-service.mjs.map +1 -0
  29. package/.output/server/chunks/_/repos.mjs +448 -0
  30. package/.output/server/chunks/_/repos.mjs.map +1 -0
  31. package/.output/server/chunks/_/task-graph.mjs +13 -14
  32. package/.output/server/chunks/_/task-graph.mjs.map +1 -1
  33. package/.output/server/chunks/_/watcher.mjs +54 -68
  34. package/.output/server/chunks/_/watcher.mjs.map +1 -1
  35. package/.output/server/chunks/build/{Detail-CUfU85GY.mjs → Detail-BQSkP9Zm.mjs} +170 -74
  36. package/.output/server/chunks/build/Detail-BQSkP9Zm.mjs.map +1 -0
  37. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-BFsE2PCW.mjs +4 -0
  38. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-BFsE2PCW.mjs.map +1 -0
  39. package/.output/server/chunks/build/DiffViewer-styles.D2bqX3nK.mjs +8 -0
  40. package/.output/server/chunks/build/DiffViewer-styles.D2bqX3nK.mjs.map +1 -0
  41. package/.output/server/chunks/build/DiffViewer-styles.FoV36wuV.mjs +10 -0
  42. package/.output/server/chunks/build/DiffViewer-styles.FoV36wuV.mjs.map +1 -0
  43. package/.output/server/chunks/build/Viewer-styles.D6wYWFb1.mjs +8 -0
  44. package/.output/server/chunks/build/Viewer-styles.D6wYWFb1.mjs.map +1 -0
  45. package/.output/server/chunks/build/{_prd_-CeVnQzOV.mjs → _prd_-CBR_wm9i.mjs} +73 -33
  46. package/.output/server/chunks/build/_prd_-CBR_wm9i.mjs.map +1 -0
  47. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  48. package/.output/server/chunks/build/{default-DWCOHHTE.mjs → default-Cao5eO80.mjs} +2 -3
  49. package/.output/server/chunks/build/default-Cao5eO80.mjs.map +1 -0
  50. package/.output/server/chunks/build/error-404-Bf6kdO80.mjs +0 -1
  51. package/.output/server/chunks/build/error-500-D_bcARXN.mjs +0 -1
  52. package/.output/server/chunks/build/{index-CckL_NBD.mjs → index-ByZO4Bvq.mjs} +2 -2
  53. package/.output/server/chunks/build/index-ByZO4Bvq.mjs.map +1 -0
  54. package/.output/server/chunks/build/{index-QVeSHT3L.mjs → index-ljj9uTXI.mjs} +6 -5
  55. package/.output/server/chunks/build/index-ljj9uTXI.mjs.map +1 -0
  56. package/.output/server/chunks/build/nuxt-link-SvT1nf8Z.mjs +1 -1
  57. package/.output/server/chunks/build/{repo-graph-CHNl58mY.mjs → repo-graph-CVnkmn8i.mjs} +23 -10
  58. package/.output/server/chunks/build/repo-graph-CVnkmn8i.mjs.map +1 -0
  59. package/.output/server/chunks/build/server.mjs +5 -6
  60. package/.output/server/chunks/build/styles.mjs +4 -4
  61. package/.output/server/chunks/build/{usePrd-SqcxGyFU.mjs → usePrd-f7ylhIqs.mjs} +10 -34
  62. package/.output/server/chunks/build/usePrd-f7ylhIqs.mjs.map +1 -0
  63. package/.output/server/chunks/nitro/nitro.mjs +614 -1211
  64. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  65. package/.output/server/chunks/routes/api/browse.get.mjs +34 -10
  66. package/.output/server/chunks/routes/api/browse.get.mjs.map +1 -1
  67. package/.output/server/chunks/routes/api/index.get.mjs +3 -2
  68. package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
  69. package/.output/server/chunks/routes/api/index.post.mjs +22 -7
  70. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
  71. package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs +29 -23
  72. package/.output/server/chunks/routes/api/repos/_repoId/git/commits.get.mjs.map +1 -1
  73. package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs +12 -7
  74. package/.output/server/chunks/routes/api/repos/_repoId/git/diff.get.mjs.map +1 -1
  75. package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs +32 -13
  76. package/.output/server/chunks/routes/api/repos/_repoId/git/file-content.get.mjs.map +1 -1
  77. package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs +14 -14
  78. package/.output/server/chunks/routes/api/repos/_repoId/git/file-diff.get.mjs.map +1 -1
  79. package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs +7 -2
  80. package/.output/server/chunks/routes/api/repos/_repoId/graph.get.mjs.map +1 -1
  81. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs +16 -2
  82. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/graph.get.mjs.map +1 -1
  83. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs +21 -9
  84. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/progress.get.mjs.map +1 -1
  85. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs +21 -85
  86. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks/_taskId/commits.get.mjs.map +1 -1
  87. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs +21 -9
  88. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug/tasks.get.mjs.map +1 -1
  89. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs +31 -50
  90. package/.output/server/chunks/routes/api/repos/_repoId/prd/_prdSlug_.get.mjs.map +1 -1
  91. package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs +20 -49
  92. package/.output/server/chunks/routes/api/repos/_repoId/prds.get.mjs.map +1 -1
  93. package/.output/server/chunks/routes/api/repos/_repoId/refresh-git-repos.post.mjs +6 -13
  94. package/.output/server/chunks/routes/api/repos/_repoId/refresh-git-repos.post.mjs.map +1 -1
  95. package/.output/server/chunks/routes/api/repos/_repoId_.delete.mjs +3 -2
  96. package/.output/server/chunks/routes/api/repos/_repoId_.delete.mjs.map +1 -1
  97. package/.output/server/chunks/routes/api/runtime.get.mjs +1 -2
  98. package/.output/server/chunks/routes/api/runtime.get.mjs.map +1 -1
  99. package/.output/server/chunks/routes/api/watch.get.mjs +5 -4
  100. package/.output/server/chunks/routes/api/watch.get.mjs.map +1 -1
  101. package/.output/server/chunks/routes/renderer.mjs +1 -1
  102. package/.output/server/index.mjs +1 -2
  103. package/.output/server/index.mjs.map +1 -1
  104. package/.output/server/node_modules/zod/index.js +4 -0
  105. package/.output/server/node_modules/zod/package.json +118 -0
  106. package/.output/server/node_modules/zod/v3/ZodError.js +133 -0
  107. package/.output/server/node_modules/zod/v3/errors.js +9 -0
  108. package/.output/server/node_modules/zod/v3/external.js +6 -0
  109. package/.output/server/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  110. package/.output/server/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  111. package/.output/server/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  112. package/.output/server/node_modules/zod/v3/helpers/util.js +133 -0
  113. package/.output/server/node_modules/zod/v3/locales/en.js +109 -0
  114. package/.output/server/node_modules/zod/v3/types.js +3693 -0
  115. package/.output/server/package.json +2 -1
  116. package/README.md +2 -2
  117. package/dist/host/src/api/prds.js +6 -172
  118. package/dist/host/src/api/repos.js +3 -18
  119. package/dist/host/src/api/state.js +8 -9
  120. package/dist/host/src/executor-runner.js +368 -0
  121. package/dist/host/src/executor.js +138 -260
  122. package/dist/host/src/mcp.js +27 -1
  123. package/dist/host/src/ui.js +14 -4
  124. package/dist/server/utils/change-events.js +33 -0
  125. package/dist/server/utils/git.js +11 -16
  126. package/dist/server/utils/prd-service.js +231 -0
  127. package/dist/server/utils/prd-state.js +54 -162
  128. package/dist/server/utils/repos.js +72 -17
  129. package/dist/server/utils/state-schema.js +61 -0
  130. package/dist/server/utils/task-graph.js +13 -13
  131. package/package.json +2 -1
  132. package/.output/public/_nuxt/CVJh28bx.js +0 -1
  133. package/.output/public/_nuxt/CyZuidLG.js +0 -60
  134. package/.output/public/_nuxt/D0op9E2g.js +0 -1
  135. package/.output/public/_nuxt/DX8awZaa.js +0 -1
  136. package/.output/public/_nuxt/Detail.z33AHKev.css +0 -1
  137. package/.output/public/_nuxt/DiTJUZOC.js +0 -1
  138. package/.output/public/_nuxt/T_3JE9C-.js +0 -1
  139. package/.output/public/_nuxt/WOI2tLsR.js +0 -42
  140. package/.output/public/_nuxt/_prd_.KTotLoF_.css +0 -1
  141. package/.output/public/_nuxt/builds/meta/029070b0-b8e2-4988-84f4-d0c9ff55c998.json +0 -1
  142. package/.output/public/_nuxt/odRGDGwj.js +0 -1
  143. package/.output/server/chunks/build/Detail-CUfU85GY.mjs.map +0 -1
  144. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs +0 -4
  145. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-CS8FTppg.mjs.map +0 -1
  146. package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs +0 -10
  147. package/.output/server/chunks/build/DiffViewer-styles.AUfwwelI.mjs.map +0 -1
  148. package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs +0 -8
  149. package/.output/server/chunks/build/DiffViewer-styles.D_it8zfk.mjs.map +0 -1
  150. package/.output/server/chunks/build/Viewer-styles.CshnetGw.mjs +0 -8
  151. package/.output/server/chunks/build/Viewer-styles.CshnetGw.mjs.map +0 -1
  152. package/.output/server/chunks/build/_prd_-CeVnQzOV.mjs.map +0 -1
  153. package/.output/server/chunks/build/default-DWCOHHTE.mjs.map +0 -1
  154. package/.output/server/chunks/build/index-CckL_NBD.mjs.map +0 -1
  155. package/.output/server/chunks/build/index-QVeSHT3L.mjs.map +0 -1
  156. package/.output/server/chunks/build/repo-graph-CHNl58mY.mjs.map +0 -1
  157. package/.output/server/chunks/build/usePrd-SqcxGyFU.mjs.map +0 -1
@@ -0,0 +1,30 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DEr8q68O.js","./WUF6Thhn.js","./BA4e9-N5.js","./entry.LcDOtJnR.css"])))=>i.map(i=>d[i]);
2
+ import{c as Oe,f as ka,t as Sa,g as Ca,h as Na,P as uo,i as $a,j as Hi,d as Ma,k as Or,l as Ta,B as bt,r as qi,e as Gi,b as Oa,F as Pa}from"./BA0u_CRT.js";import{N as Ho,q as ce,z as je,s as ne,g as ve,y as xe,O as ji,o as j,x as we,w as fe,l as C,c as ee,L as He,k as _e,P as ur,Q as dn,R as Bt,C as dt,b as oe,E as Le,S as Ia,J as co,K as fo,v as Yi,d as Se,t as he,p as Da,I as qe,T as Aa,U as za,A as Wi,i as tn,V as Xi,H as Ae,W as Ba,a as K,F as Me,r as Ge,B as pt,D as Ui,X as La,n as ge,Y as $e,Z as nn,_ as Wt,$ as Ce,a0 as Ee,a1 as Ra,m as cr,a2 as Va,a3 as an,a4 as Ht,a5 as Fa,a6 as Ki,a7 as Ha,a8 as qa,a9 as Ga,aa as ja,ab as Ya}from"./BA4e9-N5.js";import{c as ho,b as Ze,V as Wa,D as Xa,e as Ua,d as dr,P as Ka,T as Za,a as Ja,L as qo,C as Yn,G as Qa,f as el,R as Pr,K as tl,S as nl,g as ol,B as Vn,h as rl,i as il,j as sl,k as al,l as ll,m as ul,n as cl,o as dl,p as fl}from"./BO8EM227.js";import{A as Ir}from"./CJlXUkTg.js";import{_ as hl}from"./DlAUqK2U.js";import{_ as pl}from"./QAzsKGuP.js";const gl=Oe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const vl=Oe("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=Oe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const fn=Oe("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Zi=Oe("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const ml=Oe("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const yl=Oe("diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const wl=Oe("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 _l=Oe("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 xl=Oe("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 bl=Oe("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 El=Oe("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 kl=Oe("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 Sl=Oe("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 Cl=Oe("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 Nl=Oe("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 $l=Oe("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 Ml=Oe("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 Tl=Oe("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 Ol=Oe("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 Pl=Oe("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Il=Oe("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 Dl=Oe("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"}]]);const Xt=Oe("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function Al(e,t){const n=ka(!1,300);Sa(()=>{n.value=!1});const o=ce(null),r=Ca();function i(){o.value=null,n.value=!1}function s(a,l){const c=a.currentTarget,u={x:a.clientX,y:a.clientY},d=zl(u,c.getBoundingClientRect()),h=Bl(u,d,1),f=Ll(l.getBoundingClientRect()),v=Vl([...h,...f]);o.value=v,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=!Rl(d,o.value),v=!!u.closest("[data-grace-area-trigger]");h?i():(f||v)&&(i(),r.trigger())};e.value?.ownerDocument.addEventListener("pointermove",l),a(()=>e.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function zl(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 Bl(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 Ll(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 Rl(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 Vl(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),Fl(t)}function Fl(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 Hl(e){const t=ce(),n=ne(()=>t.value?.width??0),o=ne(()=>t.value?.height??0);return je(()=>{const r=Na(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[Ji,ql]=ho("PopperRoot");var Gl=ve({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=ce();return ql({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>xe(n.$slots,"default")}}),jl=Gl,Yl=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=Ji();return ji(()=>{r.onAnchorChange(t.reference??o.value)}),(i,s)=>(j(),we(C(uo),{ref:C(n),as:i.as,"as-child":i.asChild},{default:fe(()=>[xe(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),Wl=Yl;const Xl={key:0,d:"M0 0L6 6L12 0"},Ul={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var Kl=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)=>(j(),we(C(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(()=>[xe(n.$slots,"default",{},()=>[n.rounded?(j(),ee("path",Ul)):(j(),ee("path",Xl))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Zl=Kl;function Jl(e){return e!==null}function Ql(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 v="",b="";return c==="bottom"?(v=s?d:`${h}px`,b=`${-l}px`):c==="top"?(v=s?d:`${h}px`,b=`${o.floating.height+l}px`):c==="right"?(v=`${-l}px`,b=s?d:`${f}px`):c==="left"&&(v=`${o.floating.width+l}px`,b=s?d:`${f}px`),{data:{x:v,y:b}}}}}function Go(e){const[t,n="center"]=e.split("-");return[t,n]}const eu=["top","right","bottom","left"],Et=Math.min,Re=Math.max,Xn=Math.round,Mn=Math.floor,rt=e=>({x:e,y:e}),tu={left:"right",right:"left",bottom:"top",top:"bottom"},nu={start:"end",end:"start"};function jo(e,t,n){return Re(e,Et(t,n))}function gt(e,t){return typeof e=="function"?e(t):e}function vt(e){return e.split("-")[0]}function on(e){return e.split("-")[1]}function fr(e){return e==="x"?"y":"x"}function hr(e){return e==="y"?"height":"width"}const ou=new Set(["top","bottom"]);function ot(e){return ou.has(vt(e))?"y":"x"}function pr(e){return fr(ot(e))}function ru(e,t,n){n===void 0&&(n=!1);const o=on(e),r=pr(e),i=hr(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 iu(e){const t=Un(e);return[Yo(e),t,Yo(t)]}function Yo(e){return e.replace(/start|end/g,t=>nu[t])}const Dr=["left","right"],Ar=["right","left"],su=["top","bottom"],au=["bottom","top"];function lu(e,t,n){switch(e){case"top":case"bottom":return n?t?Ar:Dr:t?Dr:Ar;case"left":case"right":return t?su:au;default:return[]}}function uu(e,t,n,o){const r=on(e);let i=lu(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=>tu[t])}function cu(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qi(e){return typeof e!="number"?cu(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 zr(e,t,n){let{reference:o,floating:r}=e;const i=ot(t),s=pr(t),a=hr(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(on(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 du(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),v=Qi(f),_=a[h?d==="floating"?"reference":"floating":d],y=Kn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(_)))==null||n?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),m=await(i.isElement==null?void 0:i.isElement(g))?await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1}:{x:1,y:1},M=Kn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:g,strategy:l}):x);return{top:(y.top-M.top+v.top)/m.y,bottom:(M.bottom-y.bottom+v.bottom)/m.y,left:(y.left-M.left+v.left)/m.x,right:(M.right-y.right+v.right)/m.x}}const fu=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}=zr(c,o,l),h=o,f={},v=0;for(let _=0;_<a.length;_++){var b;const{name:y,fn:x}=a[_],{x:g,y:m,data:M,reset:z}=await x({x:u,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:f,rects:c,platform:{...s,detectOverflow:(b=s.detectOverflow)!=null?b:du},elements:{reference:e,floating:t}});u=g??u,d=m??d,f={...f,[y]:{...f[y],...M}},z&&v<=50&&(v++,typeof z=="object"&&(z.placement&&(h=z.placement),z.rects&&(c=z.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):z.rects),{x:u,y:d}=zr(c,h,l)),_=-1)}return{x:u,y:d,placement:h,strategy:r,middlewareData:f}},hu=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=Qi(u),h={x:n,y:o},f=pr(r),v=hr(f),b=await s.getDimensions(c),_=f==="y",y=_?"top":"left",x=_?"bottom":"right",g=_?"clientHeight":"clientWidth",m=i.reference[v]+i.reference[f]-h[f]-i.floating[v],M=h[f]-i.reference[f],z=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let L=z?z[g]:0;(!L||!await(s.isElement==null?void 0:s.isElement(z)))&&(L=a.floating[g]||i.floating[v]);const F=m/2-M/2,Z=L/2-b[v]/2-1,O=Et(d[y],Z),A=Et(d[x],Z),S=O,$=L-b[v]-A,p=L/2-b[v]/2+F,k=jo(S,p,$),w=!l.arrow&&on(r)!=null&&p!==k&&i.reference[v]/2-(p<S?O:A)-b[v]/2<0,N=w?p<S?p-S:p-$:0;return{[f]:h[f]+N,data:{[f]:k,centerOffset:p-k-N,...w&&{alignmentOffset:N}},reset:w}}}),pu=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:v="none",flipAlignment:b=!0,..._}=gt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=vt(r),x=ot(a),g=vt(a)===a,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=h||(g||!b?[Un(a)]:iu(a)),z=v!=="none";!h&&z&&M.push(...uu(a,b,v,m));const L=[a,...M],F=await l.detectOverflow(t,_),Z=[];let O=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&Z.push(F[y]),d){const p=ru(r,s,m);Z.push(F[p[0]],F[p[1]])}if(O=[...O,{placement:r,overflows:Z}],!Z.every(p=>p<=0)){var A,S;const p=(((A=i.flip)==null?void 0:A.index)||0)+1,k=L[p];if(k&&(!(d==="alignment"?x!==ot(k):!1)||O.every(D=>ot(D.placement)===x?D.overflows[0]>0:!0)))return{data:{index:p,overflows:O},reset:{placement:k}};let w=(S=O.filter(N=>N.overflows[0]<=0).sort((N,D)=>N.overflows[1]-D.overflows[1])[0])==null?void 0:S.placement;if(!w)switch(f){case"bestFit":{var $;const N=($=O.filter(D=>{if(z){const q=ot(D.placement);return q===x||q==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(q=>q>0).reduce((q,V)=>q+V,0)]).sort((D,q)=>D[1]-q[1])[0])==null?void 0:$[0];N&&(w=N);break}case"initialPlacement":w=a;break}if(r!==w)return{reset:{placement:w}}}return{}}}};function Br(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Lr(e){return eu.some(t=>e[t]>=0)}const gu=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=Br(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Lr(a)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),a=Br(s,n.floating);return{data:{escapedOffsets:a,escaped:Lr(a)}}}default:return{}}}}},es=new Set(["left","top"]);async function vu(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=on(n),l=ot(n)==="y",c=es.has(s)?-1:1,u=i&&l?-1:1,d=gt(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const mu=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 vu(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}}}}},yu=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:y=>{let{x,y:g}=y;return{x,y:g}}},...c}=gt(e,t),u={x:n,y:o},d=await i.detectOverflow(t,c),h=ot(vt(r)),f=fr(h);let v=u[f],b=u[h];if(s){const y=f==="y"?"top":"left",x=f==="y"?"bottom":"right",g=v+d[y],m=v-d[x];v=jo(g,v,m)}if(a){const y=h==="y"?"top":"left",x=h==="y"?"bottom":"right",g=b+d[y],m=b-d[x];b=jo(g,b,m)}const _=l.fn({...t,[f]:v,[h]:b});return{..._,data:{x:_.x-n,y:_.y-o,enabled:{[f]:s,[h]:a}}}}}},wu=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=fr(d);let f=u[h],v=u[d];const b=gt(a,t),_=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const g=h==="y"?"height":"width",m=i.reference[h]-i.floating[g]+_.mainAxis,M=i.reference[h]+i.reference[g]-_.mainAxis;f<m?f=m:f>M&&(f=M)}if(c){var y,x;const g=h==="y"?"width":"height",m=es.has(vt(r)),M=i.reference[d]-i.floating[g]+(m&&((y=s.offset)==null?void 0:y[d])||0)+(m?0:_.crossAxis),z=i.reference[d]+i.reference[g]+(m?0:((x=s.offset)==null?void 0:x[d])||0)-(m?_.crossAxis:0);v<M?v=M:v>z&&(v=z)}return{[h]:f,[d]:v}}}},_u=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=on(r),f=ot(r)==="y",{width:v,height:b}=i.floating;let _,y;d==="top"||d==="bottom"?(_=d,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,_=h==="end"?"top":"bottom");const x=b-u.top-u.bottom,g=v-u.left-u.right,m=Et(b-u[_],x),M=Et(v-u[y],g),z=!t.middlewareData.shift;let L=m,F=M;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=g),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(L=x),z&&!h){const O=Re(u.left,0),A=Re(u.right,0),S=Re(u.top,0),$=Re(u.bottom,0);f?F=v-2*(O!==0||A!==0?O+A:Re(u.left,u.right)):L=b-2*(S!==0||$!==0?S+$:Re(u.top,u.bottom))}await l({...t,availableWidth:F,availableHeight:L});const Z=await s.getDimensions(a.floating);return v!==Z.width||b!==Z.height?{reset:{rects:!0}}:{}}}};function po(){return typeof window<"u"}function zt(e){return gr(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=(gr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gr(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 Rr(e){return!po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}const xu=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)&&!xu.has(r)}const bu=new Set(["table","td","th"]);function Eu(e){return bu.has(zt(e))}const ku=[":popover-open",":modal"];function go(e){return ku.some(t=>{try{return e.matches(t)}catch{return!1}})}const Su=["transform","translate","scale","rotate","perspective"],Cu=["transform","translate","scale","rotate","perspective","filter"],Nu=["paint","layout","strict","content"];function vr(e){const t=mr(),n=Xe(e)?Ue(e):e;return Su.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)||Cu.some(o=>(n.willChange||"").includes(o))||Nu.some(o=>(n.contain||"").includes(o))}function $u(e){let t=kt(e);for(;st(t)&&!Ut(t);){if(vr(t))return t;if(go(t))return null;t=kt(t)}return null}function mr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Mu=new Set(["html","body","#document"]);function Ut(e){return Mu.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||Rr(e)&&e.host||at(e);return Rr(t)?t.host:t}function ts(e){const t=kt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&Sn(t)?t:ts(t)}function vn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=ts(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 ns(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 yr(e){return Xe(e)?e:e.contextElement}function qt(e){const t=yr(e);if(!st(t))return rt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=ns(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 Tu=rt(0);function os(e){const t=Ve(e);return!mr()||!t.visualViewport?Tu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ou(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ve(e)?!1:t}function Pt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=yr(e);let s=rt(1);t&&(o?Xe(o)&&(s=qt(o)):s=qt(e));const a=Ou(i,n,o)?os(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 v=h,b=Wo(v);for(;b&&o&&f!==v;){const _=qt(b),y=b.getBoundingClientRect(),x=Ue(b),g=y.left+(b.clientLeft+parseFloat(x.paddingLeft))*_.x,m=y.top+(b.clientTop+parseFloat(x.paddingTop))*_.y;l*=_.x,c*=_.y,u*=_.x,d*=_.y,l+=g,c+=m,v=Ve(b),b=Wo(v)}}return Kn({width:u,height:d,x:l,y:c})}function mo(e,t){const n=vo(e).scrollLeft;return t?t.left+n:Pt(at(e)).left+n}function rs(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 Pu(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=Pt(o);c=qt(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const h=s&&!d&&!i?rs(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 Iu(e){return Array.from(e.getClientRects())}function Du(e){const t=at(e),n=vo(e),o=e.ownerDocument.body,r=Re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+mo(e);const a=-n.scrollTop;return Ue(o).direction==="rtl"&&(s+=Re(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const Vr=25;function Au(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=mr();(!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,v=Math.abs(o.clientWidth-d.clientWidth-f);v<=Vr&&(i-=v)}else c<=Vr&&(i+=c);return{width:i,height:s,x:a,y:l}}const zu=new Set(["absolute","fixed"]);function Bu(e,t){const n=Pt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=st(e)?qt(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 Fr(e,t,n){let o;if(t==="viewport")o=Au(e,n);else if(t==="document")o=Du(at(e));else if(Xe(t))o=Bu(t,n);else{const r=os(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Kn(o)}function is(e,t){const n=kt(e);return n===t||!Xe(n)||Ut(n)?!1:Ue(n).position==="fixed"||is(n,t)}function Lu(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)&&!Ut(s);){const a=Ue(s),l=vr(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&zu.has(r.position)||Sn(s)&&!l&&is(e,s))?o=o.filter(u=>u!==s):r=a,s=kt(s)}return t.set(e,o),o}function Ru(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?go(t)?[]:Lu(t,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=Fr(t,u,r);return c.top=Re(d.top,c.top),c.right=Et(d.right,c.right),c.bottom=Et(d.bottom,c.bottom),c.left=Re(d.left,c.left),c},Fr(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Vu(e){const{width:t,height:n}=ns(e);return{width:t,height:n}}function Fu(e,t,n){const o=st(t),r=at(t),i=n==="fixed",s=Pt(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=Pt(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?rs(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 To(e){return Ue(e).position==="static"}function Hr(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 ss(e,t){const n=Ve(e);if(go(e))return n;if(!st(e)){let r=kt(e);for(;r&&!Ut(r);){if(Xe(r)&&!To(r))return r;r=kt(r)}return n}let o=Hr(e,t);for(;o&&Eu(o)&&To(o);)o=Hr(o,t);return o&&Ut(o)&&To(o)&&!vr(o)?n:o||$u(e)||n}const Hu=async function(e){const t=this.getOffsetParent||ss,n=this.getDimensions,o=await n(e.floating);return{reference:Fu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function qu(e){return Ue(e).direction==="rtl"}const Gu={convertOffsetParentRelativeRectToViewportRelativeRect:Pu,getDocumentElement:at,getClippingRect:Ru,getOffsetParent:ss,getElementRects:Hu,getClientRects:Iu,getDimensions:Vu,getScale:qt,isElement:Xe,isRTL:qu};function as(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ju(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 v=Mn(d),b=Mn(r.clientWidth-(u+h)),_=Mn(r.clientHeight-(d+f)),y=Mn(u),g={rootMargin:-v+"px "+-b+"px "+-_+"px "+-y+"px",threshold:Re(0,Et(1,l))||1};let m=!0;function M(z){const L=z[0].intersectionRatio;if(L!==l){if(!m)return s();L?s(!1,L):o=setTimeout(()=>{s(!1,1e-7)},1e3)}L===1&&!as(c,e.getBoundingClientRect())&&s(),m=!1}try{n=new IntersectionObserver(M,{...g,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,g)}n.observe(e)}return s(!0),i}function Yu(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=yr(e),u=r||i?[...c?vn(c):[],...vn(t)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=c&&a?ju(c,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(y=>{let[x]=y;x&&x.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var g;(g=f)==null||g.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let v,b=l?Pt(e):null;l&&_();function _(){const y=Pt(e);b&&!as(b,y)&&n(),b=y,v=requestAnimationFrame(_)}return n(),()=>{var y;u.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),d?.(),(y=f)==null||y.disconnect(),f=null,l&&cancelAnimationFrame(v)}}const Wu=mu,Xu=yu,qr=pu,Uu=_u,Ku=gu,Zu=hu,Ju=wu,Qu=(e,t,n)=>{const o=new Map,r={platform:Gu,...n},i={...r.platform,_c:o};return fu(e,t,{...r,platform:i})};function ec(e){return e!=null&&typeof e=="object"&&"$el"in e}function Xo(e){if(ec(e)){const t=e.$el;return gr(t)&&zt(t)==="#comment"?null:t}return e}function Ft(e){return typeof e=="function"?e():C(e)}function tc(e){return{name:"arrow",options:e,fn(t){const n=Xo(Ft(e.element));return n==null?{}:Zu({element:n,padding:e.padding}).fn(t)}}}function ls(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gr(e,t){const n=ls(e);return Math.round(t*n)/n}function nc(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=ne(()=>{var L;return(L=Ft(n.open))!=null?L:!0}),i=ne(()=>Ft(n.middleware)),s=ne(()=>{var L;return(L=Ft(n.placement))!=null?L:"bottom"}),a=ne(()=>{var L;return(L=Ft(n.strategy))!=null?L:"absolute"}),l=ne(()=>{var L;return(L=Ft(n.transform))!=null?L:!0}),c=ne(()=>Xo(e.value)),u=ne(()=>Xo(t.value)),d=ce(0),h=ce(0),f=ce(a.value),v=ce(s.value),b=dt({}),_=ce(!1),y=ne(()=>{const L={position:f.value,left:"0",top:"0"};if(!u.value)return L;const F=Gr(u.value,d.value),Z=Gr(u.value,h.value);return l.value?{...L,transform:"translate("+F+"px, "+Z+"px)",...ls(u.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:F+"px",top:Z+"px"}});let x;function g(){if(c.value==null||u.value==null)return;const L=r.value;Qu(c.value,u.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(F=>{d.value=F.x,h.value=F.y,f.value=F.strategy,v.value=F.placement,b.value=F.middlewareData,_.value=L!==!1})}function m(){typeof x=="function"&&(x(),x=void 0)}function M(){if(m(),o===void 0){g();return}if(c.value!=null&&u.value!=null){x=o(c.value,u.value,g);return}}function z(){r.value||(_.value=!1)}return _e([i,s,a,r],g,{flush:"sync"}),_e([c,u],M,{flush:"sync"}),_e(r,z,{flush:"sync"}),ur()&&dn(m),{x:Bt(d),y:Bt(h),strategy:Bt(f),placement:Bt(v),middlewareData:Bt(b),isPositioned:Bt(_),floatingStyles:y,update:g}}const oc={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},[rc,ic]=ho("PopperContent");var sc=ve({inheritAttrs:!1,__name:"PopperContent",props:Ia({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}},{...oc}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,r=Ji(),{forwardRef:i,currentElement:s}=Ze(),a=ce(),l=ce(),{width:c,height:u}=Hl(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]),v=ne(()=>({padding:h.value,boundary:f.value.filter(Jl),altBoundary:f.value.length>0})),b=ne(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=$a(()=>[Wu({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&qr({...v.value,...b.value}),n.avoidCollisions&&Xu({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Ju():void 0,...v.value}),!n.prioritizePosition&&n.avoidCollisions&&qr({...v.value,...b.value}),Uu({...v.value,apply:({elements:S,rects:$,availableWidth:p,availableHeight:k})=>{const{width:w,height:N}=$.reference,D=S.floating.style;D.setProperty("--reka-popper-available-width",`${p}px`),D.setProperty("--reka-popper-available-height",`${k}px`),D.setProperty("--reka-popper-anchor-width",`${w}px`),D.setProperty("--reka-popper-anchor-height",`${N}px`)}}),l.value&&tc({element:l.value,padding:n.arrowPadding}),Ql({arrowWidth:c.value,arrowHeight:u.value}),n.hideWhenDetached&&Ku({strategy:"referenceHidden",...v.value})]),y=ne(()=>n.reference??r.anchor.value),{floatingStyles:x,placement:g,isPositioned:m,middlewareData:M}=nc(y,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...S)=>Yu(...S,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:_}),z=ne(()=>Go(g.value)[0]),L=ne(()=>Go(g.value)[1]);ji(()=>{m.value&&o("placed")});const F=ne(()=>{const S=M.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&S}),Z=ce("");Ho(()=>{s.value&&(Z.value=window.getComputedStyle(s.value).zIndex)});const O=ne(()=>M.value.arrow?.x??0),A=ne(()=>M.value.arrow?.y??0);return ic({placedSide:z,onArrowChange:S=>l.value=S,arrowX:O,arrowY:A,shouldHideArrow:F}),(S,$)=>(j(),ee("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:Le({...C(x),transform:C(m)?C(x).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z.value,"--reka-popper-transform-origin":[C(M).transformOrigin?.x,C(M).transformOrigin?.y].join(" "),...C(M).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[oe(C(uo),He({ref:C(i)},S.$attrs,{"as-child":n.asChild,as:S.as,"data-side":z.value,"data-align":L.value,style:{animation:C(m)?void 0:"none"}}),{default:fe(()=>[xe(S.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),ac=sc;const lc={top:"bottom",right:"left",bottom:"top",left:"right"};var uc=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=rc(),o=ne(()=>lc[n.placedSide.value]);return(r,i)=>(j(),ee("span",{ref:s=>{C(n).onArrowChange(s)},style:Le({position:"absolute",left:C(n).arrowX?.value?`${C(n).arrowX?.value}px`:void 0,top:C(n).arrowY?.value?`${C(n).arrowY?.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[C(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[C(n).placedSide.value],visibility:C(n).shouldHideArrow.value?"hidden":void 0})},[oe(Zl,He(r.$attrs,{ref:C(t),style:{display:"block"},as:r.as,"as-child":r.asChild,rounded:r.rounded,width:r.width,height:r.height}),{default:fe(()=>[xe(r.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),cc=uc,dc=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)=>(j(),we(C(cc),co(fo(t)),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),fc=dc;const[wr,hc]=ho("TooltipProvider");var pc=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}=Yi(t);Ze();const l=ce(!0),c=ce(!1),{start:u,stop:d}=Hi(()=>{l.value=!0},o,{immediate:!1});return hc({isOpenDelayed:l,delayDuration:n,onOpen(){d(),l.value=!1},onClose(){u()},isPointerInTransitRef:c,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:s}),(h,f)=>xe(h.$slots,"default")}}),gc=pc;const us="tooltip.open",[yo,vc]=ho("TooltipRoot");var mc=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=wr(),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=Ma(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});_e(u,g=>{r.onClose&&(g?(r.onOpen(),document.dispatchEvent(new CustomEvent(us))):r.onClose())});const d=ce(!1),h=ce(),f=ne(()=>u.value?d.value?"delayed-open":"instant-open":"closed"),{start:v,stop:b}=Hi(()=>{d.value=!0,u.value=!0},l,{immediate:!1});function _(){b(),d.value=!1,u.value=!0}function y(){b(),u.value=!1}function x(){v()}return vc({contentId:"",open:u,stateAttribute:f,trigger:h,onTriggerChange(g){h.value=g},onTriggerEnter(){r.isOpenDelayed.value?x():_()},onTriggerLeave(){i.value?y():b()},onOpen:_,onClose:y,disableHoverableContent:i,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:c}),(g,m)=>(j(),we(C(jl),null,{default:fe(()=>[xe(g.$slots,"default",{open:C(u)})]),_:3}))}}),yc=mc,wc=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(()=>{Or(window,"scroll",c=>{c.target?.contains(r.trigger.value)&&r.onClose()}),Or(window,us,r.onClose)}),(c,u)=>(j(),we(C(Xa),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=d=>o("escapeKeyDown",d)),onPointerDownOutside:u[1]||(u[1]=d=>{C(r).disableClosingTrigger.value&&C(r).trigger.value?.contains(d.target)&&d.preventDefault(),o("pointerDownOutside",d)}),onFocusOutside:u[2]||(u[2]=Da(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=d=>C(r).onClose())},{default:fe(()=>[oe(C(ac),He({ref:C(i),"data-state":C(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(()=>[xe(c.$slots,"default"),oe(C(Wa),{id:C(r).contentId,role:"tooltip"},{default:fe(()=>[Se(he(a.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),cs=wc,_c=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=Ua(e),{forwardRef:o,currentElement:r}=Ze(),{trigger:i,onClose:s}=yo(),a=wr(),{isPointerInTransit:l,onPointerExit:c}=Al(i,r);return a.isPointerInTransitRef=l,c(()=>{s()}),(u,d)=>(j(),we(cs,He({ref:C(o)},C(n)),{default:fe(()=>[xe(u.$slots,"default")]),_:3},16))}}),xc=_c,bc=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=dr(n,o),{forwardRef:s}=Ze();return(a,l)=>(j(),we(C(Ka),{present:a.forceMount||C(r).open.value},{default:fe(()=>[(j(),we(qe(C(r).disableHoverableContent.value?cs:xc),He({ref:C(s)},C(i)),{default:fe(()=>[xe(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ec=bc,kc=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)=>(j(),we(C(Za),co(fo(t)),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),Sc=kc,Cc=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=wr();n.contentId||=Ja(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:i}=Ze(),s=ce(!1),a=ce(!1),l=ne(()=>n.disabled.value?{}:{click:b,focus:f,pointermove:d,pointerleave:h,pointerdown:u,blur:v});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(_){_.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function h(){n.onTriggerLeave(),a.value=!1}function f(_){s.value||n.ignoreNonKeyboardFocus.value&&!_.target.matches?.(":focus-visible")||n.onOpen()}function v(){n.onClose()}function b(){n.disableClosingTrigger.value||n.onClose()}return(_,y)=>(j(),we(C(Wl),{"as-child":"",reference:_.reference},{default:fe(()=>[oe(C(uo),He({ref:C(r),"aria-describedby":C(n).open.value?C(n).contentId:void 0,"data-state":C(n).stateAttribute.value,as:_.as,"as-child":t.asChild,"data-grace-area-trigger":""},Aa(l.value)),{default:fe(()=>[xe(_.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Nc=Cc,Ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ke=Ne((e,t)=>{var n=Object.defineProperty,o=($,p,k)=>p in $?n($,p,{enumerable:!0,configurable:!0,writable:!0,value:k}):$[p]=k,r=($,p)=>()=>(p||$((p={exports:{}}).exports,p),p.exports),i=($,p,k)=>o($,typeof p!="symbol"?p+"":p,k),s=r(($,p)=>{var k="\0",w="\0",N="",D=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[w]={})}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(E=>Object.keys(I._in[E]).length===0)}sinks(){var I=this;return this.nodes().filter(E=>Object.keys(I._out[E]).length===0)}setNodes(I,E){var P=arguments,R=this;return I.forEach(function(W){P.length>1?R.setNode(W,E):R.setNode(W)}),this}setNode(I,E){return Object.hasOwn(this._nodes,I)?(arguments.length>1&&(this._nodes[I]=E),this):(this._nodes[I]=arguments.length>1?E:this._defaultNodeLabelFn(I),this._isCompound&&(this._parent[I]=w,this._children[I]={},this._children[w][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 E=this;if(Object.hasOwn(this._nodes,I)){var P=R=>E.removeEdge(E._edgeObjs[R]);delete this._nodes[I],this._isCompound&&(this._removeFromParentsChildList(I),delete this._parent[I],this.children(I).forEach(function(R){E.setParent(R)}),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,E){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(E===void 0)E=w;else{E+="";for(var P=E;P!==void 0;P=this.parent(P))if(P===I)throw new Error("Setting "+E+" as parent of "+I+" would create a cycle");this.setNode(E)}return this.setNode(I),this._removeFromParentsChildList(I),this._parent[I]=E,this._children[E][I]=!0,this}_removeFromParentsChildList(I){delete this._children[this._parent[I]][I]}parent(I){if(this._isCompound){var E=this._parent[I];if(E!==w)return E}}children(I=w){if(this._isCompound){var E=this._children[I];if(E)return Object.keys(E)}else{if(I===w)return this.nodes();if(this.hasNode(I))return[]}}predecessors(I){var E=this._preds[I];if(E)return Object.keys(E)}successors(I){var E=this._sucs[I];if(E)return Object.keys(E)}neighbors(I){var E=this.predecessors(I);if(E){let R=new Set(E);for(var P of this.successors(I))R.add(P);return Array.from(R.values())}}isLeaf(I){var E;return this.isDirected()?E=this.successors(I):E=this.neighbors(I),E.length===0}filterNodes(I){var E=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});E.setGraph(this.graph());var P=this;Object.entries(this._nodes).forEach(function([Q,te]){I(Q)&&E.setNode(Q,te)}),Object.values(this._edgeObjs).forEach(function(Q){E.hasNode(Q.v)&&E.hasNode(Q.w)&&E.setEdge(Q,P.edge(Q))});var R={};function W(Q){var te=P.parent(Q);return te===void 0||E.hasNode(te)?(R[Q]=te,te):te in R?R[te]:W(te)}return this._isCompound&&E.nodes().forEach(Q=>E.setParent(Q,W(Q))),E}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,E){var P=this,R=arguments;return I.reduce(function(W,Q){return R.length>1?P.setEdge(W,Q,E):P.setEdge(W,Q),Q}),this}setEdge(){var I,E,P,R,W=!1,Q=arguments[0];typeof Q=="object"&&Q!==null&&"v"in Q?(I=Q.v,E=Q.w,P=Q.name,arguments.length===2&&(R=arguments[1],W=!0)):(I=Q,E=arguments[1],P=arguments[3],arguments.length>2&&(R=arguments[2],W=!0)),I=""+I,E=""+E,P!==void 0&&(P=""+P);var te=G(this._isDirected,I,E,P);if(Object.hasOwn(this._edgeLabels,te))return W&&(this._edgeLabels[te]=R),this;if(P!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(I),this.setNode(E),this._edgeLabels[te]=W?R:this._defaultEdgeLabelFn(I,E,P);var re=U(this._isDirected,I,E,P);return I=re.v,E=re.w,Object.freeze(re),this._edgeObjs[te]=re,q(this._preds[E],I),q(this._sucs[I],E),this._in[E][te]=re,this._out[I][te]=re,this._edgeCount++,this}edge(I,E,P){var R=arguments.length===1?J(this._isDirected,arguments[0]):G(this._isDirected,I,E,P);return this._edgeLabels[R]}edgeAsObj(){let I=this.edge(...arguments);return typeof I!="object"?{label:I}:I}hasEdge(I,E,P){var R=arguments.length===1?J(this._isDirected,arguments[0]):G(this._isDirected,I,E,P);return Object.hasOwn(this._edgeLabels,R)}removeEdge(I,E,P){var R=arguments.length===1?J(this._isDirected,arguments[0]):G(this._isDirected,I,E,P),W=this._edgeObjs[R];return W&&(I=W.v,E=W.w,delete this._edgeLabels[R],delete this._edgeObjs[R],V(this._preds[E],I),V(this._sucs[I],E),delete this._in[E][R],delete this._out[I][R],this._edgeCount--),this}inEdges(I,E){return this.isDirected()?this.filterEdges(this._in[I],I,E):this.nodeEdges(I,E)}outEdges(I,E){return this.isDirected()?this.filterEdges(this._out[I],I,E):this.nodeEdges(I,E)}nodeEdges(I,E){if(I in this._nodes)return this.filterEdges({...this._in[I],...this._out[I]},I,E)}filterEdges(I,E,P){if(I){var R=Object.values(I);return P?R.filter(function(W){return W.v===E&&W.w===P||W.v===P&&W.w===E}):R}}};function q(I,E){I[E]?I[E]++:I[E]=1}function V(I,E){--I[E]||delete I[E]}function G(I,E,P,R){var W=""+E,Q=""+P;if(!I&&W>Q){var te=W;W=Q,Q=te}return W+N+Q+N+(R===void 0?k:R)}function U(I,E,P,R){var W=""+E,Q=""+P;if(!I&&W>Q){var te=W;W=Q,Q=te}var re={v:W,w:Q};return R&&(re.name=R),re}function J(I,E){return G(I,E.v,E.w,E.name)}p.exports=D}),a=r(($,p)=>{p.exports="3.0.2"}),l=r(($,p)=>{p.exports={Graph:s(),version:a()}}),c=r(($,p)=>{var k=s();p.exports={write:w,read:q};function w(V){var G={options:{directed:V.isDirected(),multigraph:V.isMultigraph(),compound:V.isCompound()},nodes:N(V),edges:D(V)};return V.graph()!==void 0&&(G.value=structuredClone(V.graph())),G}function N(V){return V.nodes().map(function(G){var U=V.node(G),J=V.parent(G),I={v:G};return U!==void 0&&(I.value=U),J!==void 0&&(I.parent=J),I})}function D(V){return V.edges().map(function(G){var U=V.edge(G),J={v:G.v,w:G.w};return G.name!==void 0&&(J.name=G.name),U!==void 0&&(J.value=U),J})}function q(V){var G=new k(V.options).setGraph(V.value);return V.nodes.forEach(function(U){G.setNode(U.v,U.value),U.parent&&G.setParent(U.v,U.parent)}),V.edges.forEach(function(U){G.setEdge({v:U.v,w:U.w,name:U.name},U.value)}),G}}),u=r(($,p)=>{p.exports=w;var k=()=>1;function w(D,q,V,G){return N(D,String(q),V||k,G||function(U){return D.outEdges(U)})}function N(D,q,V,G){var U={},J=!0,I=0,E=D.nodes(),P=function(te){var re=V(te);U[te.v].distance+re<U[te.w].distance&&(U[te.w]={distance:U[te.v].distance+re,predecessor:te.v},J=!0)},R=function(){E.forEach(function(te){G(te).forEach(function(re){var ae=re.v===te?re.v:re.w,me=ae===re.v?re.w:re.v;P({v:ae,w:me})})})};E.forEach(function(te){var re=te===q?0:Number.POSITIVE_INFINITY;U[te]={distance:re}});for(var W=E.length,Q=1;Q<W&&(J=!1,I++,R(),!!J);Q++);if(I===W-1&&(J=!1,R(),J))throw new Error("The graph contains a negative weight cycle");return U}}),d=r(($,p)=>{p.exports=k;function k(w){var N={},D=[],q;function V(G){Object.hasOwn(N,G)||(N[G]=!0,q.push(G),w.successors(G).forEach(V),w.predecessors(G).forEach(V))}return w.nodes().forEach(function(G){q=[],V(G),q.length&&D.push(q)}),D}}),h=r(($,p)=>{var k=class{constructor(){i(this,"_arr",[]),i(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(w){return w.key})}has(w){return Object.hasOwn(this._keyIndices,w)}priority(w){var N=this._keyIndices[w];if(N!==void 0)return this._arr[N].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(w,N){var D=this._keyIndices;if(w=String(w),!Object.hasOwn(D,w)){var q=this._arr,V=q.length;return D[w]=V,q.push({key:w,priority:N}),this._decrease(V),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var w=this._arr.pop();return delete this._keyIndices[w.key],this._heapify(0),w.key}decrease(w,N){var D=this._keyIndices[w];if(N>this._arr[D].priority)throw new Error("New priority is greater than current priority. Key: "+w+" Old: "+this._arr[D].priority+" New: "+N);this._arr[D].priority=N,this._decrease(D)}_heapify(w){var N=this._arr,D=2*w,q=D+1,V=w;D<N.length&&(V=N[D].priority<N[V].priority?D:V,q<N.length&&(V=N[q].priority<N[V].priority?q:V),V!==w&&(this._swap(w,V),this._heapify(V)))}_decrease(w){for(var N=this._arr,D=N[w].priority,q;w!==0&&(q=w>>1,!(N[q].priority<D));)this._swap(w,q),w=q}_swap(w,N){var D=this._arr,q=this._keyIndices,V=D[w],G=D[N];D[w]=G,D[N]=V,q[G.key]=w,q[V.key]=N}};p.exports=k}),f=r(($,p)=>{var k=h();p.exports=N;var w=()=>1;function N(q,V,G,U){var J=function(I){return q.outEdges(I)};return D(q,String(V),G||w,U||J)}function D(q,V,G,U){var J={},I=new k,E,P,R=function(W){var Q=W.v!==E?W.v:W.w,te=J[Q],re=G(W),ae=P.distance+re;if(re<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+W+" Weight: "+re);ae<te.distance&&(te.distance=ae,te.predecessor=E,I.decrease(Q,ae))};for(q.nodes().forEach(function(W){var Q=W===V?0:Number.POSITIVE_INFINITY;J[W]={distance:Q},I.add(W,Q)});I.size()>0&&(E=I.removeMin(),P=J[E],P.distance!==Number.POSITIVE_INFINITY);)U(E).forEach(R);return J}}),v=r(($,p)=>{var k=f();p.exports=w;function w(N,D,q){return N.nodes().reduce(function(V,G){return V[G]=k(N,G,D,q),V},{})}}),b=r(($,p)=>{p.exports=k;function k(N,D,q){if(N[D].predecessor!==void 0)throw new Error("Invalid source vertex");if(N[q].predecessor===void 0&&q!==D)throw new Error("Invalid destination vertex");return{weight:N[q].distance,path:w(N,D,q)}}function w(N,D,q){for(var V=[],G=q;G!==D;)V.push(G),G=N[G].predecessor;return V.push(D),V.reverse()}}),_=r(($,p)=>{p.exports=k;function k(w){var N=0,D=[],q={},V=[];function G(U){var J=q[U]={onStack:!0,lowlink:N,index:N++};if(D.push(U),w.successors(U).forEach(function(P){Object.hasOwn(q,P)?q[P].onStack&&(J.lowlink=Math.min(J.lowlink,q[P].index)):(G(P),J.lowlink=Math.min(J.lowlink,q[P].lowlink))}),J.lowlink===J.index){var I=[],E;do E=D.pop(),q[E].onStack=!1,I.push(E);while(U!==E);V.push(I)}}return w.nodes().forEach(function(U){Object.hasOwn(q,U)||G(U)}),V}}),y=r(($,p)=>{var k=_();p.exports=w;function w(N){return k(N).filter(function(D){return D.length>1||D.length===1&&N.hasEdge(D[0],D[0])})}}),x=r(($,p)=>{p.exports=w;var k=()=>1;function w(D,q,V){return N(D,q||k,V||function(G){return D.outEdges(G)})}function N(D,q,V){var G={},U=D.nodes();return U.forEach(function(J){G[J]={},G[J][J]={distance:0},U.forEach(function(I){J!==I&&(G[J][I]={distance:Number.POSITIVE_INFINITY})}),V(J).forEach(function(I){var E=I.v===J?I.w:I.v,P=q(I);G[J][E]={distance:P,predecessor:J}})}),U.forEach(function(J){var I=G[J];U.forEach(function(E){var P=G[E];U.forEach(function(R){var W=P[J],Q=I[R],te=P[R],re=W.distance+Q.distance;re<te.distance&&(te.distance=re,te.predecessor=Q.predecessor)})})}),G}}),g=r(($,p)=>{function k(N){var D={},q={},V=[];function G(U){if(Object.hasOwn(q,U))throw new w;Object.hasOwn(D,U)||(q[U]=!0,D[U]=!0,N.predecessors(U).forEach(G),delete q[U],V.push(U))}if(N.sinks().forEach(G),Object.keys(D).length!==N.nodeCount())throw new w;return V}var w=class extends Error{constructor(){super(...arguments)}};p.exports=k,k.CycleException=w}),m=r(($,p)=>{var k=g();p.exports=w;function w(N){try{k(N)}catch(D){if(D instanceof k.CycleException)return!1;throw D}return!0}}),M=r(($,p)=>{p.exports=k;function k(N,D,q,V,G){Array.isArray(D)||(D=[D]);var U=(N.isDirected()?N.successors:N.neighbors).bind(N),J={};return D.forEach(function(I){if(!N.hasNode(I))throw new Error("Graph does not have node: "+I);G=w(N,I,q==="post",J,U,V,G)}),G}function w(N,D,q,V,G,U,J){return Object.hasOwn(V,D)||(V[D]=!0,q||(J=U(J,D)),G(D).forEach(function(I){J=w(N,I,q,V,G,U,J)}),q&&(J=U(J,D))),J}}),z=r(($,p)=>{var k=M();p.exports=w;function w(N,D,q){return k(N,D,q,function(V,G){return V.push(G),V},[])}}),L=r(($,p)=>{var k=z();p.exports=w;function w(N,D){return k(N,D,"post")}}),F=r(($,p)=>{var k=z();p.exports=w;function w(N,D){return k(N,D,"pre")}}),Z=r(($,p)=>{var k=s(),w=h();p.exports=N;function N(D,q){var V=new k,G={},U=new w,J;function I(P){var R=P.v===J?P.w:P.v,W=U.priority(R);if(W!==void 0){var Q=q(P);Q<W&&(G[R]=J,U.decrease(R,Q))}}if(D.nodeCount()===0)return V;D.nodes().forEach(function(P){U.add(P,Number.POSITIVE_INFINITY),V.setNode(P)}),U.decrease(D.nodes()[0],0);for(var E=!1;U.size()>0;){if(J=U.removeMin(),Object.hasOwn(G,J))V.setEdge(J,G[J]);else{if(E)throw new Error("Input graph is not connected: "+D);E=!0}D.nodeEdges(J).forEach(I)}return V}}),O=r(($,p)=>{var k=f(),w=u();p.exports=N;function N(q,V,G,U){return D(q,V,G,U||function(J){return q.outEdges(J)})}function D(q,V,G,U){if(G===void 0)return k(q,V,G,U);for(var J=!1,I=q.nodes(),E=0;E<I.length;E++){for(var P=U(I[E]),R=0;R<P.length;R++){var W=P[R],Q=W.v===I[E]?W.v:W.w,te=Q===W.v?W.w:W.v;G({v:Q,w:te})<0&&(J=!0)}if(J)return w(q,V,G,U)}return k(q,V,G,U)}}),A=r(($,p)=>{p.exports={bellmanFord:u(),components:d(),dijkstra:f(),dijkstraAll:v(),extractPath:b(),findCycles:y(),floydWarshall:x(),isAcyclic:m(),postorder:L(),preorder:F(),prim:Z(),shortestPaths:O(),reduce:M(),tarjan:_(),topsort:g()}}),S=l();t.exports={Graph:S.Graph,json:c(),alg:A(),version:S.version}}),$c=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}),Mc=Ne((e,t)=>{var n=Ke().Graph,o=$c();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(v=>d.outEdges(v.v,v.w))}function s(d,h,f){let v=[],b=h[h.length-1],_=h[0],y;for(;d.nodeCount();){for(;y=_.dequeue();)a(d,h,f,y);for(;y=b.dequeue();)a(d,h,f,y);if(d.nodeCount()){for(let x=h.length-2;x>0;--x)if(y=h[x].dequeue(),y){v=v.concat(a(d,h,f,y,!0));break}}}return v}function a(d,h,f,v,b){let _=b?[]:void 0;return d.inEdges(v.v).forEach(y=>{let x=d.edge(y),g=d.node(y.v);b&&_.push({v:y.v,w:y.w}),g.out-=x,c(h,f,g)}),d.outEdges(v.v).forEach(y=>{let x=d.edge(y),g=y.w,m=d.node(g);m.in-=x,c(h,f,m)}),d.removeNode(v.v),_}function l(d,h){let f=new n,v=0,b=0;d.nodes().forEach(x=>{f.setNode(x,{v:x,in:0,out:0})}),d.edges().forEach(x=>{let g=f.edge(x.v,x.w)||0,m=h(x),M=g+m;f.setEdge(x.v,x.w,M),b=Math.max(b,f.node(x.v).out+=m),v=Math.max(v,f.node(x.w).in+=m)});let _=u(b+v+3).map(()=>new o),y=v+1;return f.nodes().forEach(x=>{c(_,y,f.node(x))}),{graph:f,buckets:_,zeroIdx:y}}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:b,asNonCompoundGraph:i,buildLayerMatrix:c,intersectRect:l,mapValues:F,maxRank:_,normalizeRanks:u,notime:g,partition:y,pick:L,predecessorWeights:a,range:z,removeEmptyRanks:d,simplify:r,successorWeights:s,time:x,uniqueId:M,zipObject:Z};function o(O,A,S,$){for(var p=$;O.hasNode(p);)p=M($);return S.dummy=A,O.setNode(p,S),p}function r(O){let A=new n().setGraph(O.graph());return O.nodes().forEach(S=>A.setNode(S,O.node(S))),O.edges().forEach(S=>{let $=A.edge(S.v,S.w)||{weight:0,minlen:1},p=O.edge(S);A.setEdge(S.v,S.w,{weight:$.weight+p.weight,minlen:Math.max($.minlen,p.minlen)})}),A}function i(O){let A=new n({multigraph:O.isMultigraph()}).setGraph(O.graph());return O.nodes().forEach(S=>{O.children(S).length||A.setNode(S,O.node(S))}),O.edges().forEach(S=>{A.setEdge(S,O.edge(S))}),A}function s(O){let A=O.nodes().map(S=>{let $={};return O.outEdges(S).forEach(p=>{$[p.w]=($[p.w]||0)+O.edge(p).weight}),$});return Z(O.nodes(),A)}function a(O){let A=O.nodes().map(S=>{let $={};return O.inEdges(S).forEach(p=>{$[p.v]=($[p.v]||0)+O.edge(p).weight}),$});return Z(O.nodes(),A)}function l(O,A){let S=O.x,$=O.y,p=A.x-S,k=A.y-$,w=O.width/2,N=O.height/2;if(!p&&!k)throw new Error("Not possible to find intersection inside of the rectangle");let D,q;return Math.abs(k)*w>Math.abs(p)*N?(k<0&&(N=-N),D=N*p/k,q=N):(p<0&&(w=-w),D=w,q=w*k/p),{x:S+D,y:$+q}}function c(O){let A=z(_(O)+1).map(()=>[]);return O.nodes().forEach(S=>{let $=O.node(S),p=$.rank;p!==void 0&&(A[p][$.order]=S)}),A}function u(O){let A=O.nodes().map($=>{let p=O.node($).rank;return p===void 0?Number.MAX_VALUE:p}),S=b(Math.min,A);O.nodes().forEach($=>{let p=O.node($);Object.hasOwn(p,"rank")&&(p.rank-=S)})}function d(O){let A=O.nodes().map(w=>O.node(w).rank).filter(w=>w!==void 0),S=b(Math.min,A),$=[];O.nodes().forEach(w=>{let N=O.node(w).rank-S;$[N]||($[N]=[]),$[N].push(w)});let p=0,k=O.graph().nodeRankFactor;Array.from($).forEach((w,N)=>{w===void 0&&N%k!==0?--p:w!==void 0&&p&&w.forEach(D=>O.node(D).rank+=p)})}function h(O,A,S,$){let p={width:0,height:0};return arguments.length>=4&&(p.rank=S,p.order=$),o(O,"border",p,A)}function f(O,A=v){let S=[];for(let $=0;$<O.length;$+=A){let p=O.slice($,$+A);S.push(p)}return S}var v=65535;function b(O,A){if(A.length>v){let S=f(A);return O.apply(null,S.map($=>O.apply(null,$)))}else return O.apply(null,A)}function _(O){let A=O.nodes().map(S=>{let $=O.node(S).rank;return $===void 0?Number.MIN_VALUE:$});return b(Math.max,A)}function y(O,A){let S={lhs:[],rhs:[]};return O.forEach($=>{A($)?S.lhs.push($):S.rhs.push($)}),S}function x(O,A){let S=Date.now();try{return A()}finally{console.log(O+" time: "+(Date.now()-S)+"ms")}}function g(O,A){return A()}var m=0;function M(O){var A=++m;return O+(""+A)}function z(O,A,S=1){A==null&&(A=O,O=0);let $=k=>k<A;S<0&&($=k=>A<k);let p=[];for(let k=O;$(k);k+=S)p.push(k);return p}function L(O,A){let S={};for(let $ of A)O[$]!==void 0&&(S[$]=O[$]);return S}function F(O,A){let S=A;return typeof A=="string"&&(S=$=>$[A]),Object.entries(O).reduce(($,[p,k])=>($[p]=S(k,p),$),{})}function Z(O,A){return O.reduce((S,$,p)=>(S[$]=A[p],S),{})}}),Tc=Ne((e,t)=>{var n=Mc(),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)}})}}),Oc=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),v=f.labelRank;if(d===c+1)return;s.removeEdge(a);let b,_,y;for(y=0,++c;c<d;++y,++c)f.points=[],_={width:0,height:0,edgeLabel:f,edgeObj:a,rank:c},b=n.addDummyNode(s,"edge",_,"_d"),c===v&&(_.width=f.width,_.height=f.height,_.dummy="edge-label",_.labelpos=f.labelpos),s.setEdge(l,b,{weight:f.weight},h),y===0&&s.graph().dummyChains.push(b),l=b;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}}),ds=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,v=d===f?h.w:f;!l.hasNode(v)&&!o(c,h)&&(l.setNode(v,{}),l.setEdge(d,v,{}),u(v))})}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)}}),Pc=Ne((e,t)=>{var n=ds(),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=v,l.enterEdge=b,l.exchangeEdges=_;function l(m){m=a(m),r(m);var M=n(m);h(M),c(M,m);for(var z,L;z=v(M);)L=b(M,m,z),_(M,m,z,L)}function c(m,M){var z=s(m,m.nodes());z=z.slice(0,z.length-1),z.forEach(L=>u(m,M,L))}function u(m,M,z){var L=m.node(z),F=L.parent;m.edge(z,F).cutvalue=d(m,M,z)}function d(m,M,z){var L=m.node(z),F=L.parent,Z=!0,O=M.edge(z,F),A=0;return O||(Z=!1,O=M.edge(F,z)),A=O.weight,M.nodeEdges(z).forEach(S=>{var $=S.v===z,p=$?S.w:S.v;if(p!==F){var k=$===Z,w=M.edge(S).weight;if(A+=k?w:-w,x(m,z,p)){var N=m.edge(z,p).cutvalue;A+=k?-N:N}}}),A}function h(m,M){arguments.length<2&&(M=m.nodes()[0]),f(m,{},1,M)}function f(m,M,z,L,F){var Z=z,O=m.node(L);return M[L]=!0,m.neighbors(L).forEach(A=>{Object.hasOwn(M,A)||(z=f(m,M,z,A,L))}),O.low=Z,O.lim=z++,F?O.parent=F:delete O.parent,z}function v(m){return m.edges().find(M=>m.edge(M).cutvalue<0)}function b(m,M,z){var L=z.v,F=z.w;M.hasEdge(L,F)||(L=z.w,F=z.v);var Z=m.node(L),O=m.node(F),A=Z,S=!1;Z.lim>O.lim&&(A=O,S=!0);var $=M.edges().filter(p=>S===g(m,m.node(p.v),A)&&S!==g(m,m.node(p.w),A));return $.reduce((p,k)=>o(M,k)<o(M,p)?k:p)}function _(m,M,z,L){var F=z.v,Z=z.w;m.removeEdge(F,Z),m.setEdge(L.v,L.w,{}),h(m),c(m,M),y(m,M)}function y(m,M){var z=m.nodes().find(F=>!M.node(F).parent),L=i(m,z);L=L.slice(1),L.forEach(F=>{var Z=m.node(F).parent,O=M.edge(F,Z),A=!1;O||(O=M.edge(Z,F),A=!0),M.node(F).rank=M.node(Z).rank+(A?O.minlen:-O.minlen)})}function x(m,M,z){return m.hasEdge(M,z)}function g(m,M,z){return z.low<=M.lim&&M.lim<=z.lim}}),Ic=Ne((e,t)=>{var n=Zn(),o=n.longestPath,r=ds(),i=Pc();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)}}),Dc=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,v=d[f],b=!0;for(;a!==c.w;){if(l=i.node(a),b){for(;(v=d[f])!==h&&i.node(v).maxRank<l.rank;)f++;v===h&&(b=!1)}if(!b){for(;f<d.length-1&&i.node(v=d[f+1]).minRank<=l.rank;)f++;v=d[f]}i.setParent(a,v),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,v;f=a;do f=i.parent(f),c.push(f);while(f&&(s[f].low>d||h>s[f].lim));for(v=f,f=l;(f=i.parent(f))!==v;)u.push(f);return{path:c.concat(u.reverse()),lca:v}}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}}),Ac=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(b=>l.edge(b).minlen*=f);let v=s(l)+1;l.children().forEach(b=>r(l,c,f,v,h,u,b)),l.graph().nodeRankFactor=f}function r(l,c,u,d,h,f,v){let b=l.children(v);if(!b.length){v!==c&&l.setEdge(c,v,{weight:0,minlen:u});return}let _=n.addBorderNode(l,"_bt"),y=n.addBorderNode(l,"_bb"),x=l.node(v);l.setParent(_,v),x.borderTop=_,l.setParent(y,v),x.borderBottom=y,b.forEach(g=>{r(l,c,u,d,h,f,g);let m=l.node(g),M=m.borderTop?m.borderTop:g,z=m.borderBottom?m.borderBottom:g,L=m.borderTop?d:2*d,F=M!==z?1:h-f[v]+1;l.setEdge(_,M,{weight:L,minlen:F,nestingEdge:!0}),l.setEdge(z,y,{weight:L,minlen:F,nestingEdge:!0})}),l.parent(v)||l.setEdge(c,_,{weight:0,minlen:h+f[v]})}function i(l){var c={};function u(d,h){var f=l.children(d);f&&f.length&&f.forEach(v=>u(v,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)})}}),zc=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})}}),Bc=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}}),Lc=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}}),Rc=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((v,b)=>b)),c=s.flatMap(v=>i.outEdges(v).map(b=>({pos:l[b.w],weight:i.edge(b).weight})).sort((b,_)=>b.pos-_.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(v=>{let b=v.pos+u;h[b]+=v.weight;let _=0;for(;b>0;)b%2&&(_+=h[b+1]),b=b-1>>1,h[b]+=v.weight;f+=v.weight*_}),f}}),Vc=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}})}}),Fc=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}}),Hc=Ne((e,t)=>{var n=De();t.exports=o;function o(s,a){let l=n.partition(s,_=>Object.hasOwn(_,"barycenter")),c=l.lhs,u=l.rhs.sort((_,y)=>y.i-_.i),d=[],h=0,f=0,v=0;c.sort(i(!!a)),v=r(d,u,v),c.forEach(_=>{v+=_.vs.length,d.push(_.vs),h+=_.barycenter*_.weight,f+=_.weight,v=r(d,u,v)});let b={vs:d.flat(!0)};return f&&(b.barycenter=h/f,b.weight=f),b}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}}),qc=Ne((e,t)=>{var n=Vc(),o=Fc(),r=Hc();t.exports=i;function i(l,c,u,d){let h=l.children(c),f=l.node(c),v=f?f.borderLeft:void 0,b=f?f.borderRight:void 0,_={};v&&(h=h.filter(m=>m!==v&&m!==b));let y=n(l,h);y.forEach(m=>{if(l.children(m.v).length){let M=i(l,m.v,u,d);_[m.v]=M,Object.hasOwn(M,"barycenter")&&a(m,M)}});let x=o(y,u);s(x,_);let g=r(x,d);if(v&&(g.vs=[v,g.vs,b].flat(!0),l.predecessors(v).length)){let m=l.node(l.predecessors(v)[0]),M=l.node(l.predecessors(b)[0]);Object.hasOwn(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+m.order+M.order)/(g.weight+2),g.weight+=2}return g}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)}}),Gc=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),v=s.parent(h);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(d.setNode(h),d.setParent(h,v||u),s[l](h).forEach(b=>{let _=b.v===h?b.w:b.v,y=d.edge(_,h),x=y!==void 0?y.weight:0;d.setEdge(_,h,{weight:s.edge(b).weight+x})}),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}}),jc=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}})}}),Yc=Ne((e,t)=>{var n=Lc(),o=Rc(),r=qc(),i=Gc(),s=jc(),a=Ke().Graph,l=De();t.exports=c;function c(f,v={}){if(typeof v.customOrder=="function"){v.customOrder(f,c);return}let b=l.maxRank(f),_=u(f,l.range(1,b+1),"inEdges"),y=u(f,l.range(b-1,-1,-1),"outEdges"),x=n(f);if(h(f,x),v.disableOptimalOrderHeuristic)return;let g=Number.POSITIVE_INFINITY,m,M=v.constraints||[];for(let z=0,L=0;L<4;++z,++L){d(z%2?_:y,z%4>=2,M),x=l.buildLayerMatrix(f);let F=o(f,x);F<g?(L=0,m=Object.assign({},x),g=F):F===g&&(m=structuredClone(x))}h(f,m)}function u(f,v,b){let _=new Map,y=(x,g)=>{_.has(x)||_.set(x,[]),_.get(x).push(g)};for(let x of f.nodes()){let g=f.node(x);if(typeof g.rank=="number"&&y(g.rank,x),typeof g.minRank=="number"&&typeof g.maxRank=="number")for(let m=g.minRank;m<=g.maxRank;m++)m!==g.rank&&y(m,x)}return v.map(function(x){return i(f,x,b,_.get(x)||[])})}function d(f,v,b){let _=new a;f.forEach(function(y){b.forEach(m=>_.setEdge(m.left,m.right));let x=y.graph().root,g=r(y,x,_,v);g.vs.forEach((m,M)=>y.node(m).order=M),s(y,_,g.vs)})}function h(f,v){Object.values(v).forEach(b=>b.forEach((_,y)=>f.node(_).order=y))}}),Wc=Ne((e,t)=>{var n=Ke().Graph,o=De();t.exports={positionX:b,findType1Conflicts:r,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:v};function r(x,g){let m={};function M(z,L){let F=0,Z=0,O=z.length,A=L[L.length-1];return L.forEach((S,$)=>{let p=s(x,S),k=p?x.node(p).order:O;(p||S===A)&&(L.slice(Z,$+1).forEach(w=>{x.predecessors(w).forEach(N=>{let D=x.node(N),q=D.order;(q<F||k<q)&&!(D.dummy&&x.node(w).dummy)&&a(m,N,w)})}),Z=$+1,F=k)}),L}return g.length&&g.reduce(M),m}function i(x,g){let m={};function M(L,F,Z,O,A){let S;o.range(F,Z).forEach($=>{S=L[$],x.node(S).dummy&&x.predecessors(S).forEach(p=>{let k=x.node(p);k.dummy&&(k.order<O||k.order>A)&&a(m,p,S)})})}function z(L,F){let Z=-1,O,A=0;return F.forEach((S,$)=>{if(x.node(S).dummy==="border"){let p=x.predecessors(S);p.length&&(O=x.node(p[0]).order,M(F,A,$,Z,O),A=$,Z=O)}M(F,A,F.length,O,L.length)}),F}return g.length&&g.reduce(z),m}function s(x,g){if(x.node(g).dummy)return x.predecessors(g).find(m=>x.node(m).dummy)}function a(x,g,m){if(g>m){let z=g;g=m,m=z}let M=x[g];M||(x[g]=M={}),M[m]=!0}function l(x,g,m){if(g>m){let M=g;g=m,m=M}return!!x[g]&&Object.hasOwn(x[g],m)}function c(x,g,m,M){let z={},L={},F={};return g.forEach(Z=>{Z.forEach((O,A)=>{z[O]=O,L[O]=O,F[O]=A})}),g.forEach(Z=>{let O=-1;Z.forEach(A=>{let S=M(A);if(S.length){S=S.sort((p,k)=>F[p]-F[k]);let $=(S.length-1)/2;for(let p=Math.floor($),k=Math.ceil($);p<=k;++p){let w=S[p];L[A]===A&&O<F[w]&&!l(m,A,w)&&(L[w]=A,L[A]=z[A]=z[w],O=F[w])}}})}),{root:z,align:L}}function u(x,g,m,M,z){let L={},F=d(x,g,m,z),Z=z?"borderLeft":"borderRight";function O($,p){let k=F.nodes().slice(),w={},N=k.pop();for(;N;){if(w[N])$(N);else{w[N]=!0,k.push(N);for(let D of p(N))k.push(D)}N=k.pop()}}function A($){L[$]=F.inEdges($).reduce((p,k)=>Math.max(p,L[k.v]+F.edge(k)),0)}function S($){let p=F.outEdges($).reduce((w,N)=>Math.min(w,L[N.w]-F.edge(N)),Number.POSITIVE_INFINITY),k=x.node($);p!==Number.POSITIVE_INFINITY&&k.borderType!==Z&&(L[$]=Math.max(L[$],p))}return O(A,F.predecessors.bind(F)),O(S,F.successors.bind(F)),Object.keys(M).forEach($=>L[$]=L[m[$]]),L}function d(x,g,m,M){let z=new n,L=x.graph(),F=_(L.nodesep,L.edgesep,M);return g.forEach(Z=>{let O;Z.forEach(A=>{let S=m[A];if(z.setNode(S),O){var $=m[O],p=z.edge($,S);z.setEdge($,S,Math.max(F(x,A,O),p||0))}O=A})}),z}function h(x,g){return Object.values(g).reduce((m,M)=>{let z=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY;Object.entries(M).forEach(([Z,O])=>{let A=y(x,Z)/2;z=Math.max(O+A,z),L=Math.min(O-A,L)});let F=z-L;return F<m[0]&&(m=[F,M]),m},[Number.POSITIVE_INFINITY,null])[1]}function f(x,g){let m=Object.values(g),M=o.applyWithChunking(Math.min,m),z=o.applyWithChunking(Math.max,m);["u","d"].forEach(L=>{["l","r"].forEach(F=>{let Z=L+F,O=x[Z];if(O===g)return;let A=Object.values(O),S=M-o.applyWithChunking(Math.min,A);F!=="l"&&(S=z-o.applyWithChunking(Math.max,A)),S&&(x[Z]=o.mapValues(O,$=>$+S))})})}function v(x,g){return o.mapValues(x.ul,(m,M)=>{if(g)return x[g.toLowerCase()][M];{let z=Object.values(x).map(L=>L[M]).sort((L,F)=>L-F);return(z[1]+z[2])/2}})}function b(x){let g=o.buildLayerMatrix(x),m=Object.assign(r(x,g),i(x,g)),M={},z;["u","d"].forEach(F=>{z=F==="u"?g:Object.values(g).reverse(),["l","r"].forEach(Z=>{Z==="r"&&(z=z.map($=>Object.values($).reverse()));let O=(F==="u"?x.predecessors:x.successors).bind(x),A=c(x,z,m,O),S=u(x,z,A.root,A.align,Z==="r");Z==="r"&&(S=o.mapValues(S,$=>-$)),M[F+Z]=S})});let L=h(x,M);return f(M,L),v(M,x.graph().align)}function _(x,g,m){return(M,z,L)=>{let F=M.node(z),Z=M.node(L),O=0,A;if(O+=F.width/2,Object.hasOwn(F,"labelpos"))switch(F.labelpos.toLowerCase()){case"l":A=-F.width/2;break;case"r":A=F.width/2;break}if(A&&(O+=m?A:-A),A=0,O+=(F.dummy?g:x)/2,O+=(Z.dummy?g:x)/2,O+=Z.width/2,Object.hasOwn(Z,"labelpos"))switch(Z.labelpos.toLowerCase()){case"l":A=Z.width/2;break;case"r":A=-Z.width/2;break}return A&&(O+=m?A:-A),A=0,O}}function y(x,g){return x.node(g).width}}),Xc=Ne((e,t)=>{var n=De(),o=Wc().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,v)=>{let b=s.node(v).height;return f>b?f:b},0);d.forEach(f=>{let v=s.node(f);c==="top"?v.y=u+v.height/2:c==="bottom"?v.y=u+h-v.height/2:v.y=u+h/2}),u+=h+l})}}),Uc=Ne((e,t)=>{var n=Tc(),o=Oc(),r=Ic(),i=De().normalizeRanks,s=Dc(),a=De().removeEmptyRanks,l=Ac(),c=zc(),u=Bc(),d=Yc(),h=Xc(),f=De(),v=Ke().Graph;t.exports=b;function b(E,P={}){let R=P.debugTiming?f.time:f.notime;return R("layout",()=>{let W=R(" buildLayoutGraph",()=>O(E));return R(" runLayout",()=>_(W,R,P)),R(" updateInputGraph",()=>y(E,W)),W})}function _(E,P,R){P(" makeSpaceForEdgeLabels",()=>A(E)),P(" removeSelfEdges",()=>V(E)),P(" acyclic",()=>n.run(E)),P(" nestingGraph.run",()=>l.run(E)),P(" rank",()=>r(f.asNonCompoundGraph(E))),P(" injectEdgeLabelProxies",()=>S(E)),P(" removeEmptyRanks",()=>a(E)),P(" nestingGraph.cleanup",()=>l.cleanup(E)),P(" normalizeRanks",()=>i(E)),P(" assignRankMinMax",()=>$(E)),P(" removeEdgeLabelProxies",()=>p(E)),P(" normalize.run",()=>o.run(E)),P(" parentDummyChains",()=>s(E)),P(" addBorderSegments",()=>c(E)),P(" order",()=>d(E,R)),P(" insertSelfEdges",()=>G(E)),P(" adjustCoordinateSystem",()=>u.adjust(E)),P(" position",()=>h(E)),P(" positionSelfEdges",()=>U(E)),P(" removeBorderNodes",()=>q(E)),P(" normalize.undo",()=>o.undo(E)),P(" fixupEdgeLabelCoords",()=>N(E)),P(" undoCoordinateSystem",()=>u.undo(E)),P(" translateGraph",()=>k(E)),P(" assignNodeIntersects",()=>w(E)),P(" reversePoints",()=>D(E)),P(" acyclic.undo",()=>n.undo(E))}function y(E,P){E.nodes().forEach(R=>{let W=E.node(R),Q=P.node(R);W&&(W.x=Q.x,W.y=Q.y,W.order=Q.order,W.rank=Q.rank,P.children(R).length&&(W.width=Q.width,W.height=Q.height))}),E.edges().forEach(R=>{let W=E.edge(R),Q=P.edge(R);W.points=Q.points,Object.hasOwn(Q,"x")&&(W.x=Q.x,W.y=Q.y)}),E.graph().width=P.graph().width,E.graph().height=P.graph().height}var x=["nodesep","edgesep","ranksep","marginx","marginy"],g={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},m=["acyclicer","ranker","rankdir","align","rankalign"],M=["width","height","rank"],z={width:0,height:0},L=["minlen","weight","width","height","labeloffset"],F={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Z=["labelpos"];function O(E){let P=new v({multigraph:!0,compound:!0}),R=I(E.graph());return P.setGraph(Object.assign({},g,J(R,x),f.pick(R,m))),E.nodes().forEach(W=>{let Q=I(E.node(W)),te=J(Q,M);Object.keys(z).forEach(re=>{te[re]===void 0&&(te[re]=z[re])}),P.setNode(W,te),P.setParent(W,E.parent(W))}),E.edges().forEach(W=>{let Q=I(E.edge(W));P.setEdge(W,Object.assign({},F,J(Q,L),f.pick(Q,Z)))}),P}function A(E){let P=E.graph();P.ranksep/=2,E.edges().forEach(R=>{let W=E.edge(R);W.minlen*=2,W.labelpos.toLowerCase()!=="c"&&(P.rankdir==="TB"||P.rankdir==="BT"?W.width+=W.labeloffset:W.height+=W.labeloffset)})}function S(E){E.edges().forEach(P=>{let R=E.edge(P);if(R.width&&R.height){let W=E.node(P.v),Q={rank:(E.node(P.w).rank-W.rank)/2+W.rank,e:P};f.addDummyNode(E,"edge-proxy",Q,"_ep")}})}function $(E){let P=0;E.nodes().forEach(R=>{let W=E.node(R);W.borderTop&&(W.minRank=E.node(W.borderTop).rank,W.maxRank=E.node(W.borderBottom).rank,P=Math.max(P,W.maxRank))}),E.graph().maxRank=P}function p(E){E.nodes().forEach(P=>{let R=E.node(P);R.dummy==="edge-proxy"&&(E.edge(R.e).labelRank=R.rank,E.removeNode(P))})}function k(E){let P=Number.POSITIVE_INFINITY,R=0,W=Number.POSITIVE_INFINITY,Q=0,te=E.graph(),re=te.marginx||0,ae=te.marginy||0;function me(B){let T=B.x,H=B.y,X=B.width,Y=B.height;P=Math.min(P,T-X/2),R=Math.max(R,T+X/2),W=Math.min(W,H-Y/2),Q=Math.max(Q,H+Y/2)}E.nodes().forEach(B=>me(E.node(B))),E.edges().forEach(B=>{let T=E.edge(B);Object.hasOwn(T,"x")&&me(T)}),P-=re,W-=ae,E.nodes().forEach(B=>{let T=E.node(B);T.x-=P,T.y-=W}),E.edges().forEach(B=>{let T=E.edge(B);T.points.forEach(H=>{H.x-=P,H.y-=W}),Object.hasOwn(T,"x")&&(T.x-=P),Object.hasOwn(T,"y")&&(T.y-=W)}),te.width=R-P+re,te.height=Q-W+ae}function w(E){E.edges().forEach(P=>{let R=E.edge(P),W=E.node(P.v),Q=E.node(P.w),te,re;R.points?(te=R.points[0],re=R.points[R.points.length-1]):(R.points=[],te=Q,re=W),R.points.unshift(f.intersectRect(W,te)),R.points.push(f.intersectRect(Q,re))})}function N(E){E.edges().forEach(P=>{let R=E.edge(P);if(Object.hasOwn(R,"x"))switch((R.labelpos==="l"||R.labelpos==="r")&&(R.width-=R.labeloffset),R.labelpos){case"l":R.x-=R.width/2+R.labeloffset;break;case"r":R.x+=R.width/2+R.labeloffset;break}})}function D(E){E.edges().forEach(P=>{let R=E.edge(P);R.reversed&&R.points.reverse()})}function q(E){E.nodes().forEach(P=>{if(E.children(P).length){let R=E.node(P),W=E.node(R.borderTop),Q=E.node(R.borderBottom),te=E.node(R.borderLeft[R.borderLeft.length-1]),re=E.node(R.borderRight[R.borderRight.length-1]);R.width=Math.abs(re.x-te.x),R.height=Math.abs(Q.y-W.y),R.x=te.x+R.width/2,R.y=W.y+R.height/2}}),E.nodes().forEach(P=>{E.node(P).dummy==="border"&&E.removeNode(P)})}function V(E){E.edges().forEach(P=>{if(P.v===P.w){var R=E.node(P.v);R.selfEdges||(R.selfEdges=[]),R.selfEdges.push({e:P,label:E.edge(P)}),E.removeEdge(P)}})}function G(E){var P=f.buildLayerMatrix(E);P.forEach(R=>{var W=0;R.forEach((Q,te)=>{var re=E.node(Q);re.order=te+W,(re.selfEdges||[]).forEach(ae=>{f.addDummyNode(E,"selfedge",{width:ae.label.width,height:ae.label.height,rank:re.rank,order:te+ ++W,e:ae.e,label:ae.label},"_se")}),delete re.selfEdges})})}function U(E){E.nodes().forEach(P=>{var R=E.node(P);if(R.dummy==="selfedge"){var W=E.node(R.e.v),Q=W.x+W.width/2,te=W.y,re=R.x-Q,ae=W.height/2;E.setEdge(R.e,R.label),E.removeNode(P),R.label.points=[{x:Q+2*re/3,y:te-ae},{x:Q+5*re/6,y:te-ae},{x:Q+re,y:te},{x:Q+5*re/6,y:te+ae},{x:Q+2*re/3,y:te+ae}],R.label.x=R.x,R.label.y=R.y}})}function J(E,P){return f.mapValues(f.pick(E,P),Number)}function I(E){var P={};return E&&Object.entries(E).forEach(([R,W])=>{typeof R=="string"&&(R=R.toLowerCase()),P[R]=W}),P}}),Kc=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}}),Zc=Ne((e,t)=>{t.exports="2.0.4"}),Jc=Ne((e,t)=>{t.exports={graphlib:Ke(),layout:Uc(),debug:Kc(),util:{time:De().time,notime:De().notime},version:Zc()}});const jr=Jc();function mn(e){return ur()?(dn(e),!0):!1}function ct(e){return typeof e=="function"?e():C(e)}const Qc=typeof window<"u"&&typeof document<"u",ed=e=>typeof e<"u",td=Object.prototype.toString,nd=e=>td.call(e)==="[object Object]",od=()=>{};function rd(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 fs=e=>e();function id(e=fs){const t=ce(!0);function n(){t.value=!1}function o(){t.value=!0}const r=(...i)=>{t.value&&e(...i)};return{isActive:an(t),pause:n,resume:o,eventFilter:r}}function Yr(e,t=!1,n="Timeout"){return new Promise((o,r)=>{setTimeout(t?()=>r(n):o,e)})}function sd(e,t,n={}){const{eventFilter:o=fs,...r}=n;return _e(e,rd(o,t),r)}function Lt(e,t,n={}){const{eventFilter:o,...r}=n,{eventFilter:i,pause:s,resume:a,isActive:l}=id(o);return{stop:sd(e,t,{...r,eventFilter:i}),pause:s,resume:a,isActive:l}}function ad(e,t={}){if(!cr(e))return Yi(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Va(()=>({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:v,throwOnTimeout:b}={}){let _=null;const x=[new Promise(g=>{_=_e(e,m=>{d(m)!==t&&(_?.(),g(m))},{flush:h,deep:f,immediate:!0})})];return v!=null&&x.push(Yr(v,b).then(()=>ct(e)).finally(()=>_?.())),Promise.race(x)}function o(d,h){if(!cr(d))return n(m=>m===d,h);const{flush:f="sync",deep:v=!1,timeout:b,throwOnTimeout:_}=h??{};let y=null;const g=[new Promise(m=>{y=_e([e,d],([M,z])=>{t!==(M===z)&&(y?.(),m(M))},{flush:f,deep:v,immediate:!0})})];return b!=null&&g.push(Yr(b,_).then(()=>ct(e)).finally(()=>(y?.(),ct(e)))),Promise.race(g)}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 v=Array.from(f);return v.includes(d)||v.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 ld(e){var t;const n=ct(e);return(t=n?.$el)!=null?t:n}const hs=Qc?window:void 0;function ps(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=hs):[t,n,o,r]=e,!t)return od;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(()=>[ld(t),ct(r)],([u,d])=>{if(s(),!u)return;const h=nd(d)?{...d}:d;i.push(...n.flatMap(f=>o.map(v=>a(u,f,v,h))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return mn(c),c}function ud(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wr(...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=hs,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=ud(t);return ps(r,i,u=>{u.repeat&&ct(a)||l(u)&&n(u)},s)}function cd(e){return JSON.parse(JSON.stringify(e))}function Oo(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=nn(),v=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 b=c;t||(t="modelValue"),b=b||`update:${t.toString()}`;const _=g=>a?typeof a=="function"?a(g):cd(g):g,y=()=>ed(e[t])?_(e[t]):d,x=g=>{h?h(g)&&v(b,g):v(b,g)};if(l){const g=y(),m=ce(g);let M=!1;return _e(()=>e[t],z=>{M||(M=!0,m.value=_(z),pt(()=>M=!1))}),_e(m,z=>{!M&&(z!==e[t]||u)&&x(z)},{deep:u}),m}else return ne({get(){return y()},set(g){x(g)}})}var dd={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 fd(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=fd(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=hd(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]=Xr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Xr(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 hd(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Xr(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=dd,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 Ur={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)),Ur.hasOwnProperty(t)?{space:Ur[t],local:e}:e}function pd(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 gd(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gs(e){var t=_o(e);return(t.local?gd:pd)(t)}function vd(){}function _r(e){return e==null?vd:function(){return this.querySelector(e)}}function md(e){typeof e!="function"&&(e=_r(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 yd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wd(){return[]}function vs(e){return e==null?wd:function(){return this.querySelectorAll(e)}}function _d(e){return function(){return yd(e.apply(this,arguments))}}function xd(e){typeof e=="function"?e=_d(e):e=vs(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 ms(e){return function(){return this.matches(e)}}function ys(e){return function(t){return t.matches(e)}}var bd=Array.prototype.find;function Ed(e){return function(){return bd.call(this.children,e)}}function kd(){return this.firstElementChild}function Sd(e){return this.select(e==null?kd:Ed(typeof e=="function"?e:ys(e)))}var Cd=Array.prototype.filter;function Nd(){return Array.from(this.children)}function $d(e){return function(){return Cd.call(this.children,e)}}function Md(e){return this.selectAll(e==null?Nd:$d(typeof e=="function"?e:ys(e)))}function Td(e){typeof e!="function"&&(e=ms(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 ws(e){return new Array(e.length)}function Od(){return new Fe(this._enter||this._groups.map(ws),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 Pd(e){return function(){return e}}function Id(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 Dd(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 Ad(e){return e.__data__}function zd(e,t){if(!arguments.length)return Array.from(this,Ad);var n=t?Dd:Id,o=this._parents,r=this._groups;typeof e!="function"&&(e=Pd(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=Bd(e.call(u,u&&u.__data__,c,o)),v=f.length,b=a[c]=new Array(v),_=s[c]=new Array(v),y=l[c]=new Array(h);n(u,d,b,_,y,f,t);for(var x=0,g=0,m,M;x<v;++x)if(m=b[x]){for(x>=g&&(g=x+1);!(M=_[g])&&++g<v;);m._next=M||null}}return s=new Fe(s,o),s._enter=a,s._exit=l,s}function Bd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ld(){return new Fe(this._exit||this._groups.map(ws),this._parents)}function Rd(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 Vd(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,v=0;v<d;++v)(f=c[v]||u[v])&&(h[v]=f);for(;l<r;++l)a[l]=n[l];return new Fe(a,this._parents)}function Fd(){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 Hd(e){e||(e=qd);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 qd(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Gd(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function jd(){return Array.from(this)}function Yd(){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 Wd(){let e=0;for(const t of this)++e;return e}function Xd(){return!this.node()}function Ud(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 Kd(e){return function(){this.removeAttribute(e)}}function Zd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jd(e,t){return function(){this.setAttribute(e,t)}}function Qd(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ef(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tf(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 nf(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?Zd:Kd:typeof t=="function"?n.local?tf:ef:n.local?Qd:Jd)(n,t))}function _s(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function of(e){return function(){this.style.removeProperty(e)}}function rf(e,t,n){return function(){this.style.setProperty(e,t,n)}}function sf(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function af(e,t,n){return arguments.length>1?this.each((t==null?of:typeof t=="function"?sf:rf)(e,t,n??"")):Kt(this.node(),e)}function Kt(e,t){return e.style.getPropertyValue(t)||_s(e).getComputedStyle(e,null).getPropertyValue(t)}function lf(e){return function(){delete this[e]}}function uf(e,t){return function(){this[e]=t}}function cf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function df(e,t){return arguments.length>1?this.each((t==null?lf:typeof t=="function"?cf:uf)(e,t)):this.node()[e]}function xs(e){return e.trim().split(/^|\s+/)}function xr(e){return e.classList||new bs(e)}function bs(e){this._node=e,this._names=xs(e.getAttribute("class")||"")}bs.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 Es(e,t){for(var n=xr(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function ks(e,t){for(var n=xr(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function ff(e){return function(){Es(this,e)}}function hf(e){return function(){ks(this,e)}}function pf(e,t){return function(){(t.apply(this,arguments)?Es:ks)(this,e)}}function gf(e,t){var n=xs(e+"");if(arguments.length<2){for(var o=xr(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?pf:t?ff:hf)(n,t))}function vf(){this.textContent=""}function mf(e){return function(){this.textContent=e}}function yf(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wf(e){return arguments.length?this.each(e==null?vf:(typeof e=="function"?yf:mf)(e)):this.node().textContent}function _f(){this.innerHTML=""}function xf(e){return function(){this.innerHTML=e}}function bf(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ef(e){return arguments.length?this.each(e==null?_f:(typeof e=="function"?bf:xf)(e)):this.node().innerHTML}function kf(){this.nextSibling&&this.parentNode.appendChild(this)}function Sf(){return this.each(kf)}function Cf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nf(){return this.each(Cf)}function $f(e){var t=typeof e=="function"?e:gs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Mf(){return null}function Tf(e,t){var n=typeof e=="function"?e:gs(e),o=t==null?Mf:typeof t=="function"?t:_r(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Of(){var e=this.parentNode;e&&e.removeChild(this)}function Pf(){return this.each(Of)}function If(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Df(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Af(e){return this.select(e?Df:If)}function zf(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Bf(e){return function(t){e.call(this,t,this.__data__)}}function Lf(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 Rf(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 Vf(e,t,n){return function(){var o=this.__on,r,i=Bf(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 Ff(e,t,n){var o=Lf(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?Vf:Rf,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Ss(e,t,n){var o=_s(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 Hf(e,t){return function(){return Ss(this,e,t)}}function qf(e,t){return function(){return Ss(this,e,t.apply(this,arguments))}}function Gf(e,t){return this.each((typeof t=="function"?qf:Hf)(e,t))}function*jf(){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 Cs=[null];function Fe(e,t){this._groups=e,this._parents=t}function Cn(){return new Fe([[document.documentElement]],Cs)}function Yf(){return this}Fe.prototype=Cn.prototype={constructor:Fe,select:md,selectAll:xd,selectChild:Sd,selectChildren:Md,filter:Td,data:zd,enter:Od,exit:Ld,join:Rd,merge:Vd,selection:Yf,order:Fd,sort:Hd,call:Gd,nodes:jd,node:Yd,size:Wd,empty:Xd,each:Ud,attr:nf,style:af,property:df,classed:gf,text:wf,html:Ef,raise:Sf,lower:Nf,append:$f,insert:Tf,remove:Pf,clone:Af,datum:zf,on:Ff,dispatch:Gf,[Symbol.iterator]:jf};function Ye(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],Cs)}function Wf(e){let t;for(;t=e.sourceEvent;)e=t;return e}function et(e,t){if(e=Wf(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 Xf={passive:!1},yn={capture:!0,passive:!1};function Po(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ns(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",Gt,yn);"onselectstart"in t?n.on("selectstart.drag",Gt,yn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $s(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",Gt,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 Tn=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 Uf(e){return!e.ctrlKey&&!e.button}function Kf(){return this.parentNode}function Zf(e,t){return t??{x:e.x,y:e.y}}function Jf(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qf(){var e=Uf,t=Kf,n=Zf,o=Jf,r={},i=wo("start","drag","end"),s=0,a,l,c,u,d=0;function h(m){m.on("mousedown.drag",f).filter(o).on("touchstart.drag",_).on("touchmove.drag",y,Xf).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(m,M){if(!(u||!e.call(this,m,M))){var z=g(this,t.call(this,m,M),m,M,"mouse");z&&(Ye(m.view).on("mousemove.drag",v,yn).on("mouseup.drag",b,yn),Ns(m.view),Po(m),c=!1,a=m.clientX,l=m.clientY,z("start",m))}}function v(m){if(Gt(m),!c){var M=m.clientX-a,z=m.clientY-l;c=M*M+z*z>d}r.mouse("drag",m)}function b(m){Ye(m.view).on("mousemove.drag mouseup.drag",null),$s(m.view,c),Gt(m),r.mouse("end",m)}function _(m,M){if(e.call(this,m,M)){var z=m.changedTouches,L=t.call(this,m,M),F=z.length,Z,O;for(Z=0;Z<F;++Z)(O=g(this,L,m,M,z[Z].identifier,z[Z]))&&(Po(m),O("start",m,z[Z]))}}function y(m){var M=m.changedTouches,z=M.length,L,F;for(L=0;L<z;++L)(F=r[M[L].identifier])&&(Gt(m),F("drag",m,M[L]))}function x(m){var M=m.changedTouches,z=M.length,L,F;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),L=0;L<z;++L)(F=r[M[L].identifier])&&(Po(m),F("end",m,M[L]))}function g(m,M,z,L,F,Z){var O=i.copy(),A=et(Z||z,M),S,$,p;if((p=n.call(m,new Jo("beforestart",{sourceEvent:z,target:h,identifier:F,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:O}),L))!=null)return S=p.x-A[0]||0,$=p.y-A[1]||0,function k(w,N,D){var q=A,V;switch(w){case"start":r[F]=k,V=s++;break;case"end":delete r[F],--s;case"drag":A=et(D||N,M),V=s;break}O.call(w,m,new Jo(w,{sourceEvent:N,subject:p,target:h,identifier:F,active:V,x:A[0]+S,y:A[1]+$,dx:A[0]-q[0],dy:A[1]-q[1],dispatch:O}),L)}}return h.filter=function(m){return arguments.length?(e=typeof m=="function"?m:Tn(!!m),h):e},h.container=function(m){return arguments.length?(t=typeof m=="function"?m:Tn(m),h):t},h.subject=function(m){return arguments.length?(n=typeof m=="function"?m:Tn(m),h):n},h.touchable=function(m){return arguments.length?(o=typeof m=="function"?m:Tn(!!m),h):o},h.on=function(){var m=i.on.apply(i,arguments);return m===i?h:m},h.clickDistance=function(m){return arguments.length?(d=(m=+m)*m,h):Math.sqrt(d)},h}function br(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ms(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,jt="\\s*([+-]?\\d+)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eh=/^#([0-9a-f]{3,8})$/,th=new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`),nh=new RegExp(`^rgb\\(${it},${it},${it}\\)$`),oh=new RegExp(`^rgba\\(${jt},${jt},${jt},${_n}\\)$`),rh=new RegExp(`^rgba\\(${it},${it},${it},${_n}\\)$`),ih=new RegExp(`^hsl\\(${_n},${it},${it}\\)$`),sh=new RegExp(`^hsla\\(${_n},${it},${it},${_n}\\)$`),Kr={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};br(Nn,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zr,formatHex:Zr,formatHex8:ah,formatHsl:lh,formatRgb:Jr,toString:Jr});function Zr(){return this.rgb().formatHex()}function ah(){return this.rgb().formatHex8()}function lh(){return Ts(this).formatHsl()}function Jr(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=eh.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Qr(t):n===3?new Be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?On(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?On(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=th.exec(e))?new Be(t[1],t[2],t[3],1):(t=nh.exec(e))?new Be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oh.exec(e))?On(t[1],t[2],t[3],t[4]):(t=rh.exec(e))?On(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ih.exec(e))?ni(t[1],t[2]/100,t[3]/100,1):(t=sh.exec(e))?ni(t[1],t[2]/100,t[3]/100,t[4]):Kr.hasOwnProperty(e)?Qr(Kr[e]):e==="transparent"?new Be(NaN,NaN,NaN,0):null}function Qr(e){return new Be(e>>16&255,e>>8&255,e&255,1)}function On(e,t,n,o){return o<=0&&(e=t=n=NaN),new Be(e,t,n,o)}function uh(e){return e instanceof Nn||(e=It(e)),e?(e=e.rgb(),new Be(e.r,e.g,e.b,e.opacity)):new Be}function Qo(e,t,n,o){return arguments.length===1?uh(e):new Be(e,t,n,o??1)}function Be(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}br(Be,Qo,Ms(Nn,{brighter(e){return e=e==null?Qn:Math.pow(Qn,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Be(Tt(this.r),Tt(this.g),Tt(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:ei,formatHex:ei,formatHex8:ch,formatRgb:ti,toString:ti}));function ei(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}`}function ch(){return`#${Mt(this.r)}${Mt(this.g)}${Mt(this.b)}${Mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function ti(){const e=eo(this.opacity);return`${e===1?"rgb(":"rgba("}${Tt(this.r)}, ${Tt(this.g)}, ${Tt(this.b)}${e===1?")":`, ${e})`}`}function eo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Tt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mt(e){return e=Tt(e),(e<16?"0":"")+e.toString(16)}function ni(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 dh(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}br(We,dh,Ms(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 Be(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(oi(this.h),Pn(this.s),Pn(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("}${oi(this.h)}, ${Pn(this.s)*100}%, ${Pn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function oi(e){return e=(e||0)%360,e<0?e+360:e}function Pn(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 Er=e=>()=>e;function fh(e,t){return function(n){return e+n*t}}function hh(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 ph(e){return(e=+e)==1?Os:function(t,n){return n-t?hh(t,n,e):Er(isNaN(t)?n:t)}}function Os(e,t){var n=t-e;return n?fh(e,n):Er(isNaN(e)?t:e)}const to=(function e(t){var n=ph(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 gh(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 vh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mh(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 yh(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 wh(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 _h(e){return function(){return e}}function xh(e){return function(t){return e(t)+""}}function Ps(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]?xh(l[0].x):_h(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"?Er(t):(n==="number"?tt:n==="string"?(o=It(t))?(t=o,to):Ps:t instanceof It?to:t instanceof Date?yh:vh(t)?gh:Array.isArray(t)?mh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wh:tt)(e,t)}var ri=180/Math.PI,tr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Is(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)*ri,skewX:Math.atan(l)*ri,scaleX:s,scaleY:a}}var In;function bh(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?tr:Is(t.a,t.b,t.c,t.d,t.e,t.f)}function Eh(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,Is(e.a,e.b,e.c,e.d,e.e,e.f))}function Ds(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,h,f,v){if(c!==d||u!==h){var b=f.push("translate(",null,t,null,n);v.push({i:b-4,x:tt(c,d)},{i:b-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,v){if(c!==d||u!==h){var b=f.push(r(f)+"scale(",null,",",null,")");v.push({i:b-4,x:tt(c,d)},{i:b-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 v=-1,b=h.length,_;++v<b;)d[(_=h[v]).i]=_.x(f);return d.join("")}}}var kh=Ds(bh,"px, ","px)","deg)"),Sh=Ds(Eh,", ",")",")"),Ch=1e-12;function ii(e){return((e=Math.exp(e))+1/e)/2}function Nh(e){return((e=Math.exp(e))-1/e)/2}function $h(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,v=d-l,b=f*f+v*v,_,y;if(b<Ch)y=Math.log(h/c)/t,_=function(L){return[a+L*f,l+L*v,c*Math.exp(t*L*y)]};else{var x=Math.sqrt(b),g=(h*h-c*c+o*b)/(2*c*n*x),m=(h*h-c*c-o*b)/(2*h*n*x),M=Math.log(Math.sqrt(g*g+1)-g),z=Math.log(Math.sqrt(m*m+1)-m);y=(z-M)/t,_=function(L){var F=L*y,Z=ii(M),O=c/(n*x)*(Z*$h(t*F+M)-Nh(M));return[a+O*f,l+O*v,c*Z/ii(t*F+M)]}}return _.duration=y*1e3*t/Math.SQRT2,_}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 Zt=0,ln=0,rn=0,As=1e3,no,un,oo=0,Dt=0,xo=0,xn=typeof performance=="object"&&performance.now?performance:Date,zs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kr(){return Dt||(zs(Mh),Dt=xn.now()+xo)}function Mh(){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?kr():+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 Th(){kr(),++Zt;for(var e=no,t;e;)(t=Dt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zt}function si(){Dt=(oo=xn.now())+xo,Zt=ln=0;try{Th()}finally{Zt=0,Ph(),Dt=0}}function Oh(){var e=xn.now(),t=e-oo;t>As&&(xo-=t,oo=e)}function Ph(){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(!Zt){ln&&(ln=clearTimeout(ln));var t=e-Dt;t>24?(e<1/0&&(ln=setTimeout(si,e-xn.now()-xo)),rn&&(rn=clearInterval(rn))):(rn||(oo=xn.now(),rn=setInterval(Oh,As)),Zt=1,zs(si))}}function ai(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 Ih=wo("start","end","cancel","interrupt"),Dh=[],Ls=0,li=1,or=2,qn=3,ui=4,rr=5,Gn=6;function bo(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ah(e,n,{name:t,index:o,group:r,on:Ih,tween:Dh,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ls})}function Sr(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 Ah(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Bs(i,0,n.time);function i(c){n.state=li,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!==li)return l();for(u in o)if(f=o[u],f.name===n.name){if(f.state===qn)return ai(s);f.state===ui?(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(ai(function(){n.state===qn&&(n.state=ui,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 zh(e){return this.each(function(){jn(this,e)})}function Bh(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 Lh(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 Rh(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?Bh:Lh)(n,e,t))}function Cr(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 Rs(e,t){var n;return(typeof t=="number"?tt:t instanceof It?to:(n=It(t))?(t=n,to):Ps)(e,t)}function Vh(e){return function(){this.removeAttribute(e)}}function Fh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hh(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 qh(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 Gh(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 jh(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 Yh(e,t){var n=_o(e),o=n==="transform"?Sh:Rs;return this.attrTween(e,typeof t=="function"?(n.local?jh:Gh)(n,o,Cr(this,"attr."+e,t)):t==null?(n.local?Fh:Vh)(n):(n.local?qh:Hh)(n,o,t))}function Wh(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Xh(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Uh(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Xh(e,i)),n}return r._value=t,r}function Kh(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Wh(e,i)),n}return r._value=t,r}function Zh(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?Uh:Kh)(o,t))}function Jh(e,t){return function(){Sr(this,e).delay=+t.apply(this,arguments)}}function Qh(e,t){return t=+t,function(){Sr(this,e).delay=t}}function ep(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jh:Qh)(t,e)):Je(this.node(),t).delay}function tp(e,t){return function(){lt(this,e).duration=+t.apply(this,arguments)}}function np(e,t){return t=+t,function(){lt(this,e).duration=t}}function op(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tp:np)(t,e)):Je(this.node(),t).duration}function rp(e,t){if(typeof t!="function")throw new Error;return function(){lt(this,e).ease=t}}function ip(e){var t=this._id;return arguments.length?this.each(rp(t,e)):Je(this.node(),t).ease}function sp(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;lt(this,e).ease=n}}function ap(e){if(typeof e!="function")throw new Error;return this.each(sp(this._id,e))}function lp(e){typeof e!="function"&&(e=ms(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 up(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 cp(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 dp(e,t,n){var o,r,i=cp(t)?Sr:lt;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function fp(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(dp(n,e,t))}function hp(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pp(){return this.on("end.remove",hp(this._id))}function gp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_r(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,bo(c[h],t,n,h,c,Je(u,n)));return new mt(i,this._parents,t,n)}function vp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vs(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,v=Je(u,n),b=0,_=h.length;b<_;++b)(f=h[b])&&bo(f,t,n,b,h,v);i.push(h),s.push(u)}return new mt(i,s,t,n)}var mp=Cn.prototype.constructor;function yp(){return new mp(this._groups,this._parents)}function wp(e,t){var n,o,r;return function(){var i=Kt(this,e),s=(this.style.removeProperty(e),Kt(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Vs(e){return function(){this.style.removeProperty(e)}}function _p(e,t,n){var o,r=n+"",i;return function(){var s=Kt(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function xp(e,t,n){var o,r,i;return function(){var s=Kt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Kt(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function bp(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=Vs(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Ep(e,t,n){var o=(e+="")=="transform"?kh:Rs;return t==null?this.styleTween(e,wp(e,o)).on("end.style."+e,Vs(e)):typeof t=="function"?this.styleTween(e,xp(e,o,Cr(this,"style."+e,t))).each(bp(this._id,e)):this.styleTween(e,_p(e,o,t),n).on("end.style."+e,null)}function kp(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Sp(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&kp(e,s,n)),o}return i._value=t,i}function Cp(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,Sp(e,t,n??""))}function Np(e){return function(){this.textContent=e}}function $p(e){return function(){var t=e(this);this.textContent=t??""}}function Mp(e){return this.tween("text",typeof e=="function"?$p(Cr(this,"text",e)):Np(e==null?"":e+""))}function Tp(e){return function(t){this.textContent=e.call(this,t)}}function Op(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Tp(r)),t}return o._value=e,o}function Pp(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,Op(e))}function Ip(){for(var e=this._name,t=this._id,n=Fs(),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);bo(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 Dp(){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 Ap=0;function mt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Fs(){return++Ap}var ut=Cn.prototype;mt.prototype={constructor:mt,select:gp,selectAll:vp,selectChild:ut.selectChild,selectChildren:ut.selectChildren,filter:lp,merge:up,selection:yp,transition:Ip,call:ut.call,nodes:ut.nodes,node:ut.node,size:ut.size,empty:ut.empty,each:ut.each,on:fp,attr:Yh,attrTween:Zh,style:Ep,styleTween:Cp,text:Mp,textTween:Pp,remove:pp,tween:Rh,delay:ep,duration:op,ease:ip,easeVarying:ap,end:Dp,[Symbol.iterator]:ut[Symbol.iterator]};function zp(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Bp={time:null,delay:0,duration:250,ease:zp};function Lp(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 Rp(e){var t,n;e instanceof mt?(t=e._id,e=e._name):(t=Fs(),(n=Bp).time=kr(),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])&&bo(l,e,t,c,s,n||Lp(l,t));return new mt(o,this._parents,e,t)}Cn.prototype.interrupt=zh;Cn.prototype.transition=Rp;const Dn=e=>()=>e;function Vp(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 Jt=new ft(1,0,0);ft.prototype;function Ao(e){e.stopImmediatePropagation()}function sn(e){e.preventDefault(),e.stopImmediatePropagation()}function Fp(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Hp(){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 ci(){return this.__zoom||Jt}function qp(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Gp(){return navigator.maxTouchPoints||"ontouchstart"in this}function jp(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 Yp(){var e=Fp,t=Hp,n=jp,o=qp,r=Gp,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,v=150,b=0,_=10;function y(p){p.property("__zoom",ci).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",O).filter(r).on("touchstart.zoom",A).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(p,k,w,N){var D=p.selection?p.selection():p;D.property("__zoom",ci),p!==D?M(p,k,w,N):D.interrupt().each(function(){z(this,arguments).event(N).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},y.scaleBy=function(p,k,w,N){y.scaleTo(p,function(){var D=this.__zoom.k,q=typeof k=="function"?k.apply(this,arguments):k;return D*q},w,N)},y.scaleTo=function(p,k,w,N){y.transform(p,function(){var D=t.apply(this,arguments),q=this.__zoom,V=w==null?m(D):typeof w=="function"?w.apply(this,arguments):w,G=q.invert(V),U=typeof k=="function"?k.apply(this,arguments):k;return n(g(x(q,U),V,G),D,s)},w,N)},y.translateBy=function(p,k,w,N){y.transform(p,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof w=="function"?w.apply(this,arguments):w),t.apply(this,arguments),s)},null,N)},y.translateTo=function(p,k,w,N,D){y.transform(p,function(){var q=t.apply(this,arguments),V=this.__zoom,G=N==null?m(q):typeof N=="function"?N.apply(this,arguments):N;return n(Jt.translate(G[0],G[1]).scale(V.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof w=="function"?-w.apply(this,arguments):-w),q,s)},N,D)};function x(p,k){return k=Math.max(i[0],Math.min(i[1],k)),k===p.k?p:new ft(k,p.x,p.y)}function g(p,k,w){var N=k[0]-w[0]*p.k,D=k[1]-w[1]*p.k;return N===p.x&&D===p.y?p:new ft(p.k,N,D)}function m(p){return[(+p[0][0]+ +p[1][0])/2,(+p[0][1]+ +p[1][1])/2]}function M(p,k,w,N){p.on("start.zoom",function(){z(this,arguments).event(N).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(N).end()}).tween("zoom",function(){var D=this,q=arguments,V=z(D,q).event(N),G=t.apply(D,q),U=w==null?m(G):typeof w=="function"?w.apply(D,q):w,J=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),I=D.__zoom,E=typeof k=="function"?k.apply(D,q):k,P=l(I.invert(U).concat(J/I.k),E.invert(U).concat(J/E.k));return function(R){if(R===1)R=E;else{var W=P(R),Q=J/W[2];R=new ft(Q,U[0]-W[0]*Q,U[1]-W[1]*Q)}V.zoom(null,R)}})}function z(p,k,w){return!w&&p.__zooming||new L(p,k)}function L(p,k){this.that=p,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(p,k),this.taps=0}L.prototype={event:function(p){return p&&(this.sourceEvent=p),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(p,k){return this.mouse&&p!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&p!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&p!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(p){var k=Ye(this.that).datum();c.call(p,this.that,new Vp(p,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:c}),k)}};function F(p,...k){if(!e.apply(this,arguments))return;var w=z(this,k).event(p),N=this.__zoom,D=Math.max(i[0],Math.min(i[1],N.k*Math.pow(2,o.apply(this,arguments)))),q=et(p);if(w.wheel)(w.mouse[0][0]!==q[0]||w.mouse[0][1]!==q[1])&&(w.mouse[1]=N.invert(w.mouse[0]=q)),clearTimeout(w.wheel);else{if(N.k===D)return;w.mouse=[q,N.invert(q)],jn(this),w.start()}sn(p),w.wheel=setTimeout(V,v),w.zoom("mouse",n(g(x(N,D),w.mouse[0],w.mouse[1]),w.extent,s));function V(){w.wheel=null,w.end()}}function Z(p,...k){if(h||!e.apply(this,arguments))return;var w=p.currentTarget,N=z(this,k,!0).event(p),D=Ye(p.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",J,!0),q=et(p,w),V=p.clientX,G=p.clientY;Ns(p.view),Ao(p),N.mouse=[q,this.__zoom.invert(q)],jn(this),N.start();function U(I){if(sn(I),!N.moved){var E=I.clientX-V,P=I.clientY-G;N.moved=E*E+P*P>b}N.event(I).zoom("mouse",n(g(N.that.__zoom,N.mouse[0]=et(I,w),N.mouse[1]),N.extent,s))}function J(I){D.on("mousemove.zoom mouseup.zoom",null),$s(I.view,N.moved),sn(I),N.event(I).end()}}function O(p,...k){if(e.apply(this,arguments)){var w=this.__zoom,N=et(p.changedTouches?p.changedTouches[0]:p,this),D=w.invert(N),q=w.k*(p.shiftKey?.5:2),V=n(g(x(w,q),N,D),t.apply(this,k),s);sn(p),a>0?Ye(this).transition().duration(a).call(M,V,N,p):Ye(this).call(y.transform,V,N,p)}}function A(p,...k){if(e.apply(this,arguments)){var w=p.touches,N=w.length,D=z(this,k,p.changedTouches.length===N).event(p),q,V,G,U;for(Ao(p),V=0;V<N;++V)G=w[V],U=et(G,this),U=[U,this.__zoom.invert(U),G.identifier],D.touch0?!D.touch1&&D.touch0[2]!==U[2]&&(D.touch1=U,D.taps=0):(D.touch0=U,q=!0,D.taps=1+!!u);u&&(u=clearTimeout(u)),q&&(D.taps<2&&(d=U[0],u=setTimeout(function(){u=null},f)),jn(this),D.start())}}function S(p,...k){if(this.__zooming){var w=z(this,k).event(p),N=p.changedTouches,D=N.length,q,V,G,U;for(sn(p),q=0;q<D;++q)V=N[q],G=et(V,this),w.touch0&&w.touch0[2]===V.identifier?w.touch0[0]=G:w.touch1&&w.touch1[2]===V.identifier&&(w.touch1[0]=G);if(V=w.that.__zoom,w.touch1){var J=w.touch0[0],I=w.touch0[1],E=w.touch1[0],P=w.touch1[1],R=(R=E[0]-J[0])*R+(R=E[1]-J[1])*R,W=(W=P[0]-I[0])*W+(W=P[1]-I[1])*W;V=x(V,Math.sqrt(R/W)),G=[(J[0]+E[0])/2,(J[1]+E[1])/2],U=[(I[0]+P[0])/2,(I[1]+P[1])/2]}else if(w.touch0)G=w.touch0[0],U=w.touch0[1];else return;w.zoom("touch",n(g(V,G,U),w.extent,s))}}function $(p,...k){if(this.__zooming){var w=z(this,k).event(p),N=p.changedTouches,D=N.length,q,V;for(Ao(p),h&&clearTimeout(h),h=setTimeout(function(){h=null},f),q=0;q<D;++q)V=N[q],w.touch0&&w.touch0[2]===V.identifier?delete w.touch0:w.touch1&&w.touch1[2]===V.identifier&&delete w.touch1;if(w.touch1&&!w.touch0&&(w.touch0=w.touch1,delete w.touch1),w.touch0)w.touch0[1]=this.__zoom.invert(w.touch0[0]);else if(w.end(),w.taps===2&&(V=et(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<_)){var G=Ye(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return y.wheelDelta=function(p){return arguments.length?(o=typeof p=="function"?p:Dn(+p),y):o},y.filter=function(p){return arguments.length?(e=typeof p=="function"?p:Dn(!!p),y):e},y.touchable=function(p){return arguments.length?(r=typeof p=="function"?p:Dn(!!p),y):r},y.extent=function(p){return arguments.length?(t=typeof p=="function"?p:Dn([[+p[0][0],+p[0][1]],[+p[1][0],+p[1][1]]]),y):t},y.scaleExtent=function(p){return arguments.length?(i[0]=+p[0],i[1]=+p[1],y):[i[0],i[1]]},y.translateExtent=function(p){return arguments.length?(s[0][0]=+p[0][0],s[1][0]=+p[1][0],s[0][1]=+p[0][1],s[1][1]=+p[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(p){return arguments.length?(n=p,y):n},y.duration=function(p){return arguments.length?(a=+p,y):a},y.interpolate=function(p){return arguments.length?(l=p,y):l},y.on=function(){var p=c.on.apply(c,arguments);return p===c?y:p},y.clickDistance=function(p){return arguments.length?(b=(p=+p)*p,y):Math.sqrt(b)},y.tapDistance=function(p){return arguments.length?(_=+p,y):_},y}var ue=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(ue||{}),Nr=(e=>(e.Partial="partial",e.Full="full",e))(Nr||{}),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||{}),Hs=(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))(Hs||{});const Wp=["INPUT","SELECT","TEXTAREA"],Xp=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 Wp.includes(o?.nodeName)||r||!!i}function Up(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function di(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 Kp(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Zp(n.code,e);return Array.isArray(e)?e.some(r=>di(n[o],r,t,n.type==="keyup")):di(n[o],e,t,n.type==="keyup")}}function Zp(e,t){return t.includes(e)?"code":"key"}function gn(e,t){const n=ne(()=>Ee(t?.target)??Xp),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}),ps(["blur","contextmenu"],a),Wr((...c)=>s(...c),c=>{var u,d;const h=Ee(t?.actInsideInputWithModifier)??!0,f=Ee(t?.preventDefault)??!1;if(r=Up(c),(!r||r&&!h)&&ir(c))return;const b=((d=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:d[0])||c.target,_=b?.nodeName==="BUTTON"||b?.nodeName==="A";!f&&(r||!_)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Wr((...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"?Kp(c,i):c}return o}const qs="vue-flow__node-desc",Gs="vue-flow__edge-desc",Jp="vue-flow__aria-live",js=["Enter"," ","Escape"],Yt={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 Ys(e,t){return{x:At(e.x,t[0][0],t[1][0]),y:At(e.y,t[0][1],t[1][1])}}function fi(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 Ot(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Ct(e)}function cn(e){return Ot(e)&&"computedPosition"in e}function An(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Qp(e){return An(e.width)&&An(e.height)&&An(e.x)&&An(e.y)}function eg(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:Ht({width:0,height:0}),computedPosition:Ht({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:Pe(e.data)?e.data:{},events:Ht(Pe(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Ws(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:Pe(e.data)?e.data:{},events:Ht(Pe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function Xs(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 tg(...e){if(e.length===3){const[i,s,a]=e;return Xs(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=>Ot(s)&&s.id===i.target))}function ng(...e){if(e.length===3){const[i,s,a]=e;return Xs(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=>Ot(s)&&s.id===i.source))}function Us({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function og(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 bn({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 rg(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 Ks({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function ig({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Zs(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=rg(t,Ks({...o.computedPosition,...o.dimensions}))}return ig(t)}function Js(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)),v=d===null||h===null,b=o&&f>0,_=(d??0)*(h??0);(v||b||f>=_||a.dragging)&&s.push(a)}return s}function Qs(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 Rt(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 sg(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Rt(e,n),r=Rt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Rt(e.top??e.y??0,n),r=Rt(e.bottom??e.y??0,n),i=Rt(e.left??e.x??0,t),s=Rt(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 ag(e,t,n,o,r,i){const{x:s,y:a}=bn(e,{x:t,y:n,zoom:o}),{x:l,y:c}=bn({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 hi(e,t,n,o,r,i=.1){const s=sg(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,v=n/2-h*u,b=ag(e,f,v,u,t,n),_={left:Math.min(b.left-s.left,0),top:Math.min(b.top-s.top,0),right:Math.min(b.right-s.right,0),bottom:Math.min(b.bottom-s.bottom,0)};return{x:f-_.left+_.right,y:v-_.top+_.bottom,zoom:u}}function lg(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function ea(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:ea(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 pi(e){const t=e.ctrlKey&&lo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function gi(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 ta(e,t,n=15,o=40){const r=gi(e.x,o,t.width-o)*n,i=gi(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 vi(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 mi(e){return{item:e,type:"add"}}function yi(e){return{id:e,type:"remove"}}function wi(e,t,n,o,r){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:r||null,type:"remove"}}function xt(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 _i=()=>{};function ie(e){const t=new Set;let n=_i,o=()=>!1;const r=()=>t.size>0||o(),i=h=>{n=h},s=()=>{n=_i},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(v=>v(h)))},hasListeners:r,listeners:t,setEmitter:i,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function xi(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 ug(e,t,n,o){var r,i;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!ea(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 Bo({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 na(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 cg(e,t,n){const[o,r,i,s]=typeof e!="string"?na(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 dg(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=cg(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]=na(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 fg({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function $r(e,t,n,o,r){const i=fg(e.dimensions,dg(e,n,o,r)),s=Ys(t,i);return{position:{x:s.x-(r?.computedPosition.x||0),y:s.y-(r?.computedPosition.y||0)},computedPosition:s}}function Qt(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??vg(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 bi(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function hg({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=Ks({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 pg(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 Ei={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=Ei[t])==null?void 0:o.call(Ei,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Mr(e){return"clientX"in e}function gg(e){return"sourceEvent"in e}function nt(e,t){const n=Mr(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 vg(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 mg=()=>!0;function Lo(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function yg(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 wg=250;function _g(e,t,n,o){var r,i;let s=[],a=Number.POSITIVE_INFINITY;const l=yg(e,n,t+wg);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}=Qt(c,d,d.position,!0),v=Math.sqrt((h-e.x)**2+(f-e.y)**2);v>t||(v<a?(s=[{...d,x:h,y:f}],a=v):v===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 ki(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=mg},u,d,h,f){const v=i==="target",b=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:_,y}=nt(e),x=s.elementFromPoint(_,y),g=x?.classList.contains(`${a}-flow__handle`)?x:b,m={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const M=oa(void 0,g),z=g.getAttribute("data-nodeid"),L=g.getAttribute("data-handleid"),F=g.classList.contains("connectable"),Z=g.classList.contains("connectableend");if(!z||!M)return m;const O={source:v?z:o,sourceHandle:v?L:r,target:v?o:z,targetHandle:v?r:L};m.connection=O;const S=F&&Z&&(n===St.Strict?v&&M==="source"||!v&&M==="target":z!==o||L!==r);m.isValid=S&&c(O,{nodes:d,edges:u,sourceNode:h(O.source),targetNode:h(O.target)}),m.toHandle=ra(z,M,L,f,n,!0)}return m}function oa(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function xg(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function bg(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function ra(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,...Qt(c,d,d.position,!0)}:d}const sr={[ue.Left]:ue.Right,[ue.Right]:ue.Left,[ue.Top]:ue.Bottom,[ue.Bottom]:ue.Top},Eg=["production","prod"];function $n(e,...t){ia()&&console.warn(`[Vue Flow]: ${e}`,...t)}function ia(){return!Eg.includes("production")}function Si(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 Pe(e){return typeof C(e)<"u"}function kg(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:Us(e)},r=Ws(r,void 0,o),og(r,t)?!1:r}function Sg(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?Us(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Ci(e,t,n){const o={},r=[];for(let i=0;i<e.length;++i){const s=e[i];if(!Ot(s)){n(new ze(Ie.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const a=eg(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 Ni(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 Ro(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}`;Ni("source",l,u,e,r,s),Ni("target",l,c,e,i,a)}}function $i(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:kg(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({...Ws(u,f,i),sourceNode:d,targetNode:h})}return l}const Mi=Symbol("vueFlow"),sa=Symbol("nodeId"),aa=Symbol("nodeRef"),Cg=Symbol("edgeId"),Ng=Symbol("edgeRef"),So=Symbol("slots");function la(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:v,nodesSelectionActive:b,selectNodesOnDrag:_,removeSelectedElements:y,addSelectedNodes:x,updateNodePositions:g,emits:m}=Te(),{onStart:M,onDrag:z,onStop:L,onClick:F,el:Z,disabled:O,id:A,selectable:S,dragHandle:$}=e,p=dt(!1);let k=[],w,N=null,D={x:void 0,y:void 0},q={x:0,y:0},V=null,G=!1,U=!1,J=0,I=!1;const E=Tg(),P=({x:ae,y:me})=>{D={x:ae,y:me};let B=!1;if(k=k.map(T=>{const H={x:ae-T.distance.x,y:me-T.distance.y},{computedPosition:X}=$r(T,n.value?ko(H,o.value):H,m.error,s.value,T.parentNode?f(T.parentNode):void 0);return B=B||T.position.x!==X.x||T.position.y!==X.y,T.position=X,T}),U=U||B,!!B&&(g(k,!0,!0),p.value=!0,V)){const[T,H]=Bo({id:A,dragItems:k,findNode:f});z({event:V,node:T,nodes:H})}},R=()=>{if(!N)return;const[ae,me]=ta(q,N,u.value);if(ae!==0||me!==0){const B={x:(D.x??0)-ae/l.value.zoom,y:(D.y??0)-me/l.value.zoom};h({x:ae,y:me})&&P(B)}J=requestAnimationFrame(R)},W=(ae,me)=>{G=!0;const B=f(A);!_.value&&!v.value&&B&&(B.selected||y()),B&&Ee(S)&&_.value&&ar(B,v.value,x,y,b,!1,me);const T=E(ae.sourceEvent);if(D=T,k=ug(i.value,d.value,T,A),k.length){const[H,X]=Bo({id:A,dragItems:k,findNode:f});M({event:ae.sourceEvent,node:H,nodes:X})}},Q=(ae,me)=>{var B;ae.sourceEvent.type==="touchmove"&&ae.sourceEvent.touches.length>1||(U=!1,a.value===0&&W(ae,me),D=E(ae.sourceEvent),N=((B=t.value)==null?void 0:B.getBoundingClientRect())||null,q=nt(ae.sourceEvent,N))},te=(ae,me)=>{const B=E(ae.sourceEvent);if(!I&&G&&c.value&&(I=!0,R()),!G){const T=B.xSnapped-(D.x??0),H=B.ySnapped-(D.y??0);Math.sqrt(T*T+H*H)>a.value&&W(ae,me)}(D.x!==B.xSnapped||D.y!==B.ySnapped)&&k.length&&G&&(V=ae.sourceEvent,q=nt(ae.sourceEvent,N),P(B))},re=ae=>{let me=!1;if(!G&&!p.value&&!v.value){const B=ae.sourceEvent,T=E(B),H=T.xSnapped-(D.x??0),X=T.ySnapped-(D.y??0),Y=Math.sqrt(H*H+X*X);Y!==0&&Y<=a.value&&(F?.(B),me=!0)}if(k.length&&!me){U&&(g(k,!1,!1),U=!1);const[B,T]=Bo({id:A,dragItems:k,findNode:f});L({event:ae.sourceEvent,node:B,nodes:T})}k=[],p.value=!1,I=!1,G=!1,D={x:void 0,y:void 0},cancelAnimationFrame(J)};return _e([()=>Ee(O),Z],([ae,me],B,T)=>{if(me){const H=Ye(me);ae||(w=Qf().on("start",X=>Q(X,me)).on("drag",X=>te(X,me)).on("end",X=>re(X)).filter(X=>{const Y=X.target,se=Ee($);return!X.button&&(!r.value||!xi(Y,`.${r.value}`,me)&&(!se||xi(Y,se,me)))}),H.call(w)),T(()=>{H.on(".drag",null),w&&(w.on("start",null),w.on("drag",null),w.on("end",null))})}}),p}function $g(){return{doubleClick:ie(),click:ie(),mouseEnter:ie(),mouseMove:ie(),mouseLeave:ie(),contextMenu:ie(),updateStart:ie(),update:ie(),updateEnd:ie()}}function Mg(e,t){const n=$g();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 Tg(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=Te();return r=>{var i;const s=((i=o.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},a=gg(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 ua({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:v,autoPanSpeed:b,findNode:_,panBy:y,startConnection:x,updateConnection:g,endConnection:m,emits:M,viewport:z,edges:L,nodes:F,isValidConnection:Z,nodeLookup:O}=Te();let A=null,S=!1,$=null;function p(w){var N;const D=Ee(n)==="target",q=Mr(w),V=fi(w.target),G=w.currentTarget;if(G&&(q&&w.button===0||!q)){let U=function(de){B=nt(de,re),P=_g(En(B,z.value,!1,[1,1]),u.value,O.value,X),T||(H(),T=!0);const ye=ki(de,{handle:P,connectionMode:c.value,fromNodeId:Ee(t),fromHandleId:Ee(e),fromType:D?"target":"source",isValidConnection:E,doc:V,lib:"vue",flowId:a,nodeLookup:O.value},L.value,F.value,_,O.value);$=ye.handleDomNode,A=ye.connection,S=bg(!!P,ye.isValid);const be={...pe,isValid:S,to:ye.toHandle&&S?bn({x:ye.toHandle.x,y:ye.toHandle.y},z.value):B,toHandle:ye.toHandle,toPosition:S&&ye.toHandle?ye.toHandle.position:sr[X.position],toNode:ye.toHandle?O.value.get(ye.toHandle.nodeId):null};if(S&&P&&pe?.toHandle&&be.toHandle&&pe.toHandle.type===be.toHandle.type&&pe.toHandle.nodeId===be.toHandle.nodeId&&pe.toHandle.id===be.toHandle.id&&pe.to.x===be.to.x&&pe.to.y===be.to.y)return;const ke=P??ye.toHandle;if(g(ke&&S?bn({x:ke.x,y:ke.y},z.value):B,ke,xg(!!ke,S)),pe=be,!P&&!S&&!$)return Lo(me);A&&A.source!==A.target&&$&&(Lo(me),me=$,$.classList.add("connecting","vue-flow__handle-connecting"),$.classList.toggle("valid",!!S),$.classList.toggle("vue-flow__handle-valid",!!S))},J=function(de){"touches"in de&&de.touches.length>0||((P||$)&&A&&S&&(i?i(de,A):M.connect(A)),M.connectEnd(de),r&&s?.(de),Lo(me),cancelAnimationFrame(R),m(de),T=!1,S=!1,A=null,$=null,V.removeEventListener("mousemove",U),V.removeEventListener("mouseup",J),V.removeEventListener("touchmove",U),V.removeEventListener("touchend",J))};const I=_(Ee(t));let E=Ee(o)||Z.value||zn;!E&&I&&(E=(D?I.isValidSourcePos:I.isValidTargetPos)||zn);let P,R=0;const{x:W,y:Q}=nt(w),te=oa(Ee(r),G),re=(N=l.value)==null?void 0:N.getBoundingClientRect();if(!re||!te)return;const ae=ra(Ee(t),te,Ee(e),O.value,c.value);if(!ae)return;let me,B=nt(w,re),T=!1;const H=()=>{if(!v.value)return;const[de,ye]=ta(B,re,b.value);y({x:de,y:ye}),R=requestAnimationFrame(H)},X={...ae,nodeId:Ee(t),type:te,position:ae.position},Y=O.value.get(Ee(t)),le={inProgress:!0,isValid:null,from:Qt(Y,X,ue.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:Y,to:B,toHandle:null,toPosition:sr[X.position],toNode:null};x({nodeId:Ee(t),id:Ee(e),type:te,position:G?.getAttribute("data-handlepos")||ue.Top,...B},{x:W-re.left,y:Q-re.top}),M.connectStart({event:w,nodeId:Ee(t),handleId:Ee(e),handleType:te});let pe=le;V.addEventListener("mousemove",U),V.addEventListener("mouseup",J),V.addEventListener("touchmove",U),V.addEventListener("touchend",J)}}function k(w){var N,D;if(!d.value)return;const q=Ee(n)==="target";if(!h.value){M.clickConnectStart({event:w,nodeId:Ee(t),handleId:Ee(e)}),x({nodeId:Ee(t),type:Ee(n),id:Ee(e),position:ue.Top,...nt(w)},void 0,!0);return}let V=Ee(o)||Z.value||zn;const G=_(Ee(t));if(!V&&G&&(V=(q?G.isValidSourcePos:G.isValidTargetPos)||zn),G&&(typeof G.connectable>"u"?f.value:G.connectable)===!1)return;const U=fi(w.target),J=ki(w,{handle:{nodeId:Ee(t),id:Ee(e),type:Ee(n),position:ue.Top,...nt(w)},connectionMode:c.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:V,doc:U,lib:"vue",flowId:a,nodeLookup:O.value},L.value,F.value,_,O.value),I=((N=J.connection)==null?void 0:N.source)===((D=J.connection)==null?void 0:D.target);J.isValid&&J.connection&&!I&&M.connect(J.connection),M.clickConnectEnd(w),m(w,!0)}return{handlePointerDown:p,handleClick:k}}function Og(){return tn(sa,"")}function ca(e){const t=e??Og()??"",n=tn(aa,ce(null)),{findNode:o,edges:r,emits:i}=Te(),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(()=>Qs([s],r.value))}}function Pg(){return{doubleClick:ie(),click:ie(),mouseEnter:ie(),mouseMove:ie(),mouseLeave:ie(),contextMenu:ie(),dragStart:ie(),drag:ie(),dragStop:ie()}}function Ig(e,t){const n=Pg();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 da(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:r,snapToGrid:i,nodesDraggable:s,emits:a}=Te();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,v=l.y*d*h,b=[];for(const _ of e.value)if(_.draggable||s&&typeof _.draggable>"u"){const y={x:_.computedPosition.x+f,y:_.computedPosition.y+v},{position:x}=$r(_,y,a.error,t.value,_.parentNode?o(_.parentNode):void 0);b.push({id:_.id,position:x,from:_.position,distance:{x:l.x,y:l.y},dimensions:_.dimensions})}n(b,!0,!1)}}const Bn=.1,Dg=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 Ag={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 zg(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}=Ys({x:-o,y:-r},e.translateExtent),d=Jt.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:Bn,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=Zs(a),{x:c,y:u,zoom:d}=hi(l,e.dimensions.width,e.dimensions.height,r.minZoom??e.minZoom,r.maxZoom??e.maxZoom,r.padding??Bn);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:Bn})=>{const{x:s,y:a,zoom:l}=hi(r,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??Bn);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 bn(a,e.viewport)}return{x:0,y:0}}}:Ag)}function Fo(e,t=0,n=Dg,o=()=>{}){const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e}function Bg(e,t,n){const o=Xi(!0);return o.run(()=>{const r=()=>{o.run(()=>{let b,_,y=!!(n.nodes.value.length||n.edges.value.length);b=Lt([e.modelValue,()=>{var x,g;return(g=(x=e.modelValue)==null?void 0:x.value)==null?void 0:g.length}],([x])=>{x&&Array.isArray(x)&&(_?.pause(),n.setElements(x),!_&&!y&&x.length?y=!0:_?.resume())}),_=Lt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([x,g])=>{var m;(m=e.modelValue)!=null&&m.value&&Array.isArray(e.modelValue.value)&&(b?.pause(),e.modelValue.value=[...x,...g],pt(()=>{b?.resume()}))},{immediate:y}),dn(()=>{b?.stop(),_?.stop()})})},i=()=>{o.run(()=>{let b,_,y=!!n.nodes.value.length;b=Lt([e.nodes,()=>{var x,g;return(g=(x=e.nodes)==null?void 0:x.value)==null?void 0:g.length}],([x])=>{x&&Array.isArray(x)&&(_?.pause(),n.setNodes(x),!_&&!y&&x.length?y=!0:_?.resume())}),_=Lt([n.nodes,()=>n.nodes.value.length],([x])=>{var g;(g=e.nodes)!=null&&g.value&&Array.isArray(e.nodes.value)&&(b?.pause(),e.nodes.value=[...x],pt(()=>{b?.resume()}))},{immediate:y}),dn(()=>{b?.stop(),_?.stop()})})},s=()=>{o.run(()=>{let b,_,y=!!n.edges.value.length;b=Lt([e.edges,()=>{var x,g;return(g=(x=e.edges)==null?void 0:x.value)==null?void 0:g.length}],([x])=>{x&&Array.isArray(x)&&(_?.pause(),n.setEdges(x),!_&&!y&&x.length?y=!0:_?.resume())}),_=Lt([n.edges,()=>n.edges.value.length],([x])=>{var g;(g=e.edges)!=null&&g.value&&Array.isArray(e.edges.value)&&(b?.pause(),e.edges.value=[...x],pt(()=>{b?.resume()}))},{immediate:y}),dn(()=>{b?.stop(),_?.stop()})})},a=()=>{o.run(()=>{_e(()=>t.maxZoom,()=>{t.maxZoom&&Pe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{_e(()=>t.minZoom,()=>{t.minZoom&&Pe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{_e(()=>t.translateExtent,()=>{t.translateExtent&&Pe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},u=()=>{o.run(()=>{_e(()=>t.nodeExtent,()=>{t.nodeExtent&&Pe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{_e(()=>t.applyDefault,()=>{Pe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const b=async _=>{let y=_;typeof t.autoConnect=="function"&&(y=await t.autoConnect(_)),y!==!1&&n.addEdges([y])};_e(()=>t.autoConnect,()=>{Pe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),_e(n.autoConnect,(_,y,x)=>{_?n.onConnect(b):n.hooks.value.connect.off(b),x(()=>{n.hooks.value.connect.off(b)})},{immediate:!0})})},f=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const _ of Object.keys(t)){const y=_;if(!b.includes(y)){const x=$e(()=>t[y]),g=n[y];cr(g)&&o.run(()=>{_e(x,m=>{Pe(m)&&(g.value=m)},{immediate:!0})})}}};r(),i(),s(),l(),a(),c(),u(),d(),h(),f()}),()=>o.stop()}function Lg(){return{edgesChange:ie(),nodesChange:ie(),nodeDoubleClick:ie(),nodeClick:ie(),nodeMouseEnter:ie(),nodeMouseMove:ie(),nodeMouseLeave:ie(),nodeContextMenu:ie(),nodeDragStart:ie(),nodeDrag:ie(),nodeDragStop:ie(),nodesInitialized:ie(),miniMapNodeClick:ie(),miniMapNodeDoubleClick:ie(),miniMapNodeMouseEnter:ie(),miniMapNodeMouseMove:ie(),miniMapNodeMouseLeave:ie(),connect:ie(),connectStart:ie(),connectEnd:ie(),clickConnectStart:ie(),clickConnectEnd:ie(),paneReady:ie(),init:ie(),move:ie(),moveStart:ie(),moveEnd:ie(),selectionDragStart:ie(),selectionDrag:ie(),selectionDragStop:ie(),selectionContextMenu:ie(),selectionStart:ie(),selectionEnd:ie(),viewportChangeStart:ie(),viewportChange:ie(),viewportChangeEnd:ie(),paneScroll:ie(),paneClick:ie(),paneContextMenu:ie(),paneMouseEnter:ie(),paneMouseMove:ie(),paneMouseLeave:ie(),edgeContextMenu:ie(),edgeMouseEnter:ie(),edgeMouseMove:ie(),edgeMouseLeave:ie(),edgeDoubleClick:ie(),edgeClick:ie(),edgeUpdateStart:ie(),edgeUpdate:ie(),edgeUpdateEnd:ie(),updateNodeInternals:ie(),error:ie(e=>$n(e.message))}}function Rg(e,t){const n=nn();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=Vg(r);return!!((i=n?.vnode.props)==null?void 0:i[s])}}function Vg(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(r,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function fa(){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:Nr.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:Lg(),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 Fg=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Hg(e,t,n){const o=zg(e),r=B=>{const T=B??[];e.hooks.updateNodeInternals.trigger(T)},i=B=>ng(B,e.nodes,e.edges),s=B=>tg(B,e.nodes,e.edges),a=B=>Qs(B,e.edges),l=({id:B,type:T,nodeId:H})=>{var X;const Y=B?`-${T}-${B}`:`-${T}`;return Array.from(((X=e.connectionLookup.get(`${H}${Y}`))==null?void 0:X.values())??[])},c=B=>{if(B)return t.value.get(B)},u=B=>{if(B)return n.value.get(B)},d=(B,T,H)=>{var X,Y;const se=[];for(const le of B){const pe={id:le.id,type:"position",dragging:H,from:le.from};if(T&&(pe.position=le.position,le.parentNode)){const de=c(le.parentNode);pe.position={x:pe.position.x-(((X=de?.computedPosition)==null?void 0:X.x)??0),y:pe.position.y-(((Y=de?.computedPosition)==null?void 0:Y.y)??0)}}se.push(pe)}se?.length&&e.hooks.nodesChange.trigger(se)},h=B=>{if(!e.vueFlowRef)return;const T=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!T)return;const H=window.getComputedStyle(T),{m22:X}=new window.DOMMatrixReadOnly(H.transform),Y=[];for(const se of B){const le=se,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 be=le.nodeElement.getBoundingClientRect();pe.dimensions=de,pe.handleBounds.source=Si("source",le.nodeElement,be,X,pe.id),pe.handleBounds.target=Si("target",le.nodeElement,be,X,pe.id),Y.push({id:pe.id,type:"dimensions",dimensions:de})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),Y.length&&e.hooks.nodesChange.trigger(Y)},f=(B,T)=>{const H=new Set,X=new Set;for(const le of B)Ot(le)?H.add(le.id):Ct(le)&&X.add(le.id);const Y=xt(t.value,H,!0),se=xt(n.value,X);if(e.multiSelectionActive){for(const le of H)Y.push(_t(le,T));for(const le of X)se.push(_t(le,T))}Y.length&&e.hooks.nodesChange.trigger(Y),se.length&&e.hooks.edgesChange.trigger(se)},v=B=>{if(e.multiSelectionActive){const T=B.map(H=>_t(H.id,!0));e.hooks.nodesChange.trigger(T);return}e.hooks.nodesChange.trigger(xt(t.value,new Set(B.map(T=>T.id)),!0)),e.hooks.edgesChange.trigger(xt(n.value))},b=B=>{if(e.multiSelectionActive){const T=B.map(H=>_t(H.id,!0));e.hooks.edgesChange.trigger(T);return}e.hooks.edgesChange.trigger(xt(n.value,new Set(B.map(T=>T.id)))),e.hooks.nodesChange.trigger(xt(t.value,new Set,!0))},_=B=>{f(B,!0)},y=B=>{const H=(B||e.nodes).map(X=>(X.selected=!1,_t(X.id,!1)));e.hooks.nodesChange.trigger(H)},x=B=>{const H=(B||e.edges).map(X=>(X.selected=!1,_t(X.id,!1)));e.hooks.edgesChange.trigger(H)},g=B=>{if(!B||!B.length)return f([],!1);const T=B.reduce((H,X)=>{const Y=_t(X.id,!1);return Ot(X)?H.nodes.push(Y):H.edges.push(Y),H},{nodes:[],edges:[]});T.nodes.length&&e.hooks.nodesChange.trigger(T.nodes),T.edges.length&&e.hooks.edgesChange.trigger(T.edges)},m=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},z=B=>{var T;(T=e.d3Zoom)==null||T.translateExtent(B),e.translateExtent=B},L=B=>{e.nodeExtent=B,r()},F=B=>{var T;(T=e.d3Zoom)==null||T.clickDistance(B)},Z=B=>{e.nodesDraggable=B,e.nodesConnectable=B,e.elementsSelectable=B},O=B=>{const T=B instanceof Function?B(e.nodes):B;!e.initialized&&!T.length||(e.nodes=Ci(T,c,e.hooks.error.trigger))},A=B=>{const T=B instanceof Function?B(e.edges):B;if(!e.initialized&&!T.length)return;const H=Vo(T,e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Ro(e.connectionLookup,n.value,H),e.edges=H},S=B=>{const T=B instanceof Function?B([...e.nodes,...e.edges]):B;!e.initialized&&!T.length||(O(T.filter(Ot)),A(T.filter(Ct)))},$=B=>{let T=B instanceof Function?B(e.nodes):B;T=Array.isArray(T)?T:[T];const H=Ci(T,c,e.hooks.error.trigger),X=[];for(const Y of H)X.push(mi(Y));X.length&&e.hooks.nodesChange.trigger(X)},p=B=>{let T=B instanceof Function?B(e.edges):B;T=Array.isArray(T)?T:[T];const H=Vo(T,e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),X=[];for(const Y of H)X.push(mi(Y));X.length&&e.hooks.edgesChange.trigger(X)},k=(B,T=!0,H=!1)=>{const X=B instanceof Function?B(e.nodes):B,Y=Array.isArray(X)?X:[X],se=[],le=[];function pe(ye){const be=a(ye);for(const ke of be)(!Pe(ke.deletable)||ke.deletable)&&le.push(wi(ke.id,ke.source,ke.target,ke.sourceHandle,ke.targetHandle))}function de(ye){const be=[];for(const ke of e.nodes)ke.parentNode===ye&&be.push(ke);if(be.length){for(const ke of be)se.push(yi(ke.id));T&&pe(be);for(const ke of be)de(ke.id)}}for(const ye of Y){const be=typeof ye=="string"?c(ye):ye;be&&(Pe(be.deletable)&&!be.deletable||(se.push(yi(be.id)),T&&pe([be]),H&&de(be.id)))}le.length&&e.hooks.edgesChange.trigger(le),se.length&&e.hooks.nodesChange.trigger(se)},w=B=>{const T=B instanceof Function?B(e.edges):B,H=Array.isArray(T)?T:[T],X=[];for(const Y of H){const se=typeof Y=="string"?u(Y):Y;se&&(Pe(se.deletable)&&!se.deletable||X.push(wi(typeof Y=="string"?Y:Y.id,se.source,se.target,se.sourceHandle,se.targetHandle)))}e.hooks.edgesChange.trigger(X)},N=(B,T,H=!0)=>{const X=u(B.id);if(!X)return!1;const Y=e.edges.indexOf(X),se=Sg(B,T,X,H,e.hooks.error.trigger);if(se){const[le]=Vo([se],e.isValidConnection,c,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((pe,de)=>de===Y?le:pe),Ro(e.connectionLookup,n.value,[le]),le}return!1},D=(B,T,H={replace:!1})=>{const X=u(B);if(!X)return;const Y=typeof T=="function"?T(X):T;X.data=H.replace?Y:{...X.data,...Y}},q=B=>vi(B,e.nodes),V=B=>{const T=vi(B,e.edges);return Ro(e.connectionLookup,n.value,T),T},G=(B,T,H={replace:!1})=>{const X=c(B);if(!X)return;const Y=typeof T=="function"?T(X):T;H.replace?e.nodes.splice(e.nodes.indexOf(X),1,Y):Object.assign(X,Y)},U=(B,T,H={replace:!1})=>{const X=c(B);if(!X)return;const Y=typeof T=="function"?T(X):T;X.data=H.replace?Y:{...X.data,...Y}},J=(B,T,H=!1)=>{H?e.connectionClickStartHandle=B:e.connectionStartHandle=B,e.connectionEndHandle=null,e.connectionStatus=null,T&&(e.connectionPosition=T)},I=(B,T=null,H=null)=>{e.connectionStartHandle&&(e.connectionPosition=B,e.connectionEndHandle=T,e.connectionStatus=H)},E=(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=Qp(B),H=T?null:cn(B)?B:c(B.id);return!T&&!H?[null,null,T]:[T?B:so(H),H,T]},R=(B,T=!0,H=e.nodes)=>{const[X,Y,se]=P(B);if(!X)return[];const le=[];for(const pe of H||e.nodes){if(!se&&(pe.id===Y.id||!pe.computedPosition))continue;const de=so(pe),ye=ao(de,X);(T&&ye>0||ye>=de.width*de.height||ye>=Number(X.width)*Number(X.height))&&le.push(pe)}return le},W=(B,T,H=!0)=>{const[X]=P(B);if(!X)return!1;const Y=ao(X,T);return H&&Y>0||Y>=Number(X.width)*Number(X.height)},Q=B=>{const{viewport:T,dimensions:H,d3Zoom:X,d3Selection:Y,translateExtent:se}=e;if(!X||!Y||!B.x&&!B.y)return!1;const le=Jt.translate(T.x+B.x,T.y+B.y).scale(T.zoom),pe=[[0,0],[H.width,H.height]],de=X.constrain()(le,pe,se),ye=e.viewport.x!==de.x||e.viewport.y!==de.y||e.viewport.zoom!==de.k;return X.transform(Y,de),ye},te=B=>{const T=B instanceof Function?B(e):B,H=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Pe(T.defaultEdgeOptions)&&(e.defaultEdgeOptions=T.defaultEdgeOptions);const X=T.modelValue||T.nodes||T.edges?[]:void 0;X&&(T.modelValue&&X.push(...T.modelValue),T.nodes&&X.push(...T.nodes),T.edges&&X.push(...T.edges),S(X));const Y=()=>{Pe(T.maxZoom)&&M(T.maxZoom),Pe(T.minZoom)&&m(T.minZoom),Pe(T.translateExtent)&&z(T.translateExtent)};for(const se of Object.keys(T)){const le=se,pe=T[le];![...Fg,...H].includes(le)&&Pe(pe)&&(e[le]=pe)}Ko(()=>e.d3Zoom).not.toBeNull().then(Y),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:S,setNodes:O,setEdges:A,addNodes:$,addEdges:p,removeNodes:k,removeEdges:w,findNode:c,findEdge:u,updateEdge:N,updateEdgeData:D,updateNode:G,updateNodeData:U,applyEdgeChanges:V,applyNodeChanges:q,addSelectedElements:_,addSelectedNodes:v,addSelectedEdges:b,setMinZoom:m,setMaxZoom:M,setTranslateExtent:z,setNodeExtent:L,setPaneClickDistance:F,removeSelectedElements:g,removeSelectedNodes:y,removeSelectedEdges:x,startConnection:J,updateConnection:I,endConnection:E,setInteractive:Z,setState:te,getIntersectingNodes:R,getIncomers:i,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:W,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,H)=>o.value.setCenter(B,T,H),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 H of e.nodes){const{computedPosition:X,handleBounds:Y,selected:se,dimensions:le,isParent:pe,resizing:de,dragging:ye,events:be,...ke}=H;B.push(ke)}for(const H of e.edges){const{selected:X,sourceNode:Y,targetNode:se,events:le,...pe}=H;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:H,edges:X,position:Y,zoom:se,viewport:le}=B;H&&O(H),X&&A(X);const[pe,de]=le?.x&&le?.y?[le.x,le.y]:Y??[null,null];if(pe&&de){const ye=le?.zoom||se||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=fa();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const T=Jt.translate(B.defaultViewport.x??0,B.defaultViewport.y??0).scale(At(B.defaultViewport.zoom??1,B.minZoom,B.maxZoom)),H=e.viewportRef.getBoundingClientRect(),X=[[0,0],[H.width,H.height]],Y=e.d3Zoom.constrain()(T,X,B.translateExtent);e.d3Zoom.transform(e.d3Selection,Y)}te(B)},$destroy:()=>{}}}const qg=["data-id","data-handleid","data-nodeid","data-handlepos"],Gg={name:"Handle",compatConfig:{MODE:3}},en=ve({...Gg,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=Fa(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}=Te(),{id:f,node:v,nodeEl:b,connectedEdges:_}=ca(),y=ce(),x=$e(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),g=$e(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),m=$e(()=>{var A,S,$,p,k,w;return((A=s.value)==null?void 0:A.nodeId)===f&&((S=s.value)==null?void 0:S.id)===e.id&&(($=s.value)==null?void 0:$.type)===o.value||((p=l.value)==null?void 0:p.nodeId)===f&&((k=l.value)==null?void 0:k.id)===e.id&&((w=l.value)==null?void 0:w.type)===o.value}),M=$e(()=>{var A,S,$;return((A=a.value)==null?void 0:A.nodeId)===f&&((S=a.value)==null?void 0:S.id)===e.id&&(($=a.value)==null?void 0:$.type)===o.value}),{handlePointerDown:z,handleClick:L}=ua({nodeId:f,handleId:e.id,isValidConnection:r,type:o}),F=ne(()=>typeof e.connectable=="string"&&e.connectable==="single"?!_.value.some(A=>{const S=A[`${o.value}Handle`];return A[o.value]!==f?!1:S?S===e.id:!0}):typeof e.connectable=="number"?_.value.filter(A=>{const S=A[`${o.value}Handle`];return A[o.value]!==f?!1:S?S===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(v,_.value):Pe(e.connectable)?e.connectable:u.value);je(()=>{var A;if(!v.dimensions.width||!v.dimensions.height)return;const S=(A=v.handleBounds[o.value])==null?void 0:A.find(q=>q.id===e.id);if(!c.value||S)return;const $=c.value.querySelector(".vue-flow__transformationpane");if(!b.value||!y.value||!$||!e.id)return;const p=b.value.getBoundingClientRect(),k=y.value.getBoundingClientRect(),w=window.getComputedStyle($),{m22:N}=new window.DOMMatrixReadOnly(w.transform),D={id:e.id,position:e.position,x:(k.left-p.left)/N,y:(k.top-p.top)/N,type:o.value,nodeId:f,...Eo(y.value)};v.handleBounds[o.value]=[...v.handleBounds[o.value]??[],D]});function Z(A){const S=Mr(A);F.value&&x.value&&(S&&A.button===0||!S)&&z(A)}function O(A){!f||!a.value&&!x.value||F.value&&L(A)}return t({handleClick:L,handlePointerDown:z,onClick:O,onPointerDown:Z}),(A,S)=>(j(),ee("div",{ref_key:"handle",ref:y,"data-id":`${C(i)}-${C(f)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":C(f),"data-handlepos":A.position,class:Ae(["vue-flow__handle",[`vue-flow__handle-${A.position}`,`vue-flow__handle-${e.id}`,C(d),C(h),o.value,{connectable:F.value,connecting:M.value,connectablestart:x.value,connectableend:g.value,connectionindicator:F.value&&(x.value&&!m.value||g.value&&m.value)}]]),onMousedown:Z,onTouchstartPassive:Z,onClick:O},[xe(A.$slots,"default",{id:A.id})],42,qg))}}),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(en,{type:"target",position:t,connectable:o,isValidConnection:r}),typeof a!="string"&&a?Ce(a):Ce(Me,[a]),Ce(en,{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 jg=Co,No=function({targetPosition:e=ue.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:r}){const i=r.label??t;return[Ce(en,{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 Yg=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(en,{type:"source",position:e,connectable:n,isValidConnection:o})]};$o.props=["sourcePosition","label","isValidSourcePos","connectable","data"];$o.inheritAttrs=!1;$o.compatConfig={MODE:3};const Wg=$o,Xg=["transform"],Ug=["width","height","x","y","rx","ry"],Kg=["y"],Zg={name:"EdgeText",compatConfig:{MODE:3}},Jg=ve({...Zg,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)=>(j(),ee("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(j(),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:Le(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,Ug)):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}),[xe(i.$slots,"default",{},()=>[typeof i.label!="string"?(j(),we(qe(i.label),{key:0})):(j(),ee(Me,{key:1},[Se(he(i.label),1)],64))])],16,Kg)],8,Xg))}}),Qg=["id","d","marker-end","marker-start"],ev=["d","stroke-width"],tv={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Mo=ve({...tv,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=Ha();return t({pathEl:n,interactionEl:o,labelEl:r}),(s,a)=>(j(),ee(Me,null,[K("path",He(C(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,Qg),s.interactionWidth?(j(),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,ev)):ge("",!0),s.label&&s.labelX&&s.labelY?(j(),we(Jg,{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 ha({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 pa({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 Ln(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ti({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){let s,a;switch(e){case ue.Left:s=t-Ln(t-o,i),a=n;break;case ue.Right:s=t+Ln(o-t,i),a=n;break;case ue.Top:s=t,a=n-Ln(n-r,i);break;case ue.Bottom:s=t,a=n+Ln(r-n,i);break}return[s,a]}function ga(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top,curvature:a=.25}=e,[l,c]=Ti({pos:o,x1:t,y1:n,x2:r,y2:i,c:a}),[u,d]=Ti({pos:s,x1:r,y1:i,x2:t,y2:n,c:a}),[h,f,v,b]=pa({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,v,b]}function Oi({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 va(e){const{sourceX:t,sourceY:n,sourcePosition:o=ue.Bottom,targetX:r,targetY:i,targetPosition:s=ue.Top}=e,[a,l]=Oi({pos:o,x1:t,y1:n,x2:r,y2:i}),[c,u]=Oi({pos:s,x1:r,y1:i,x2:t,y2:n}),[d,h,f,v]=pa({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,v]}const Pi={[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 nv({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 Ii(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function ov({source:e,sourcePosition:t=ue.Bottom,target:n,targetPosition:o=ue.Top,center:r,offset:i}){const s=Pi[t],a=Pi[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=nv({source:l,sourcePosition:t,target:c}),d=u.x!==0?"x":"y",h=u[d];let f,v,b;const _={x:0,y:0},y={x:0,y:0},[x,g,m,M]=ha({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){v=r.x??x,b=r.y??g;const L=[{x:v,y:l.y},{x:v,y:c.y}],F=[{x:l.x,y:b},{x:c.x,y:b}];s[d]===h?f=d==="x"?L:F:f=d==="x"?F:L}else{const L=[{x:l.x,y:c.y}],F=[{x:c.x,y:l.y}];if(d==="x"?f=s.x===h?F:L:f=s.y===h?L:F,t===o){const $=Math.abs(e[d]-n[d]);if($<=i){const p=Math.min(i-1,i-$);s[d]===h?_[d]=(l[d]>e[d]?-1:1)*p:y[d]=(c[d]>n[d]?-1:1)*p}}if(t!==o){const $=d==="x"?"y":"x",p=s[d]===a[$],k=l[$]>c[$],w=l[$]<c[$];(s[d]===1&&(!p&&k||p&&w)||s[d]!==1&&(!p&&w||p&&k))&&(f=d==="x"?L:F)}const Z={x:l.x+_.x,y:l.y+_.y},O={x:c.x+y.x,y:c.y+y.y},A=Math.max(Math.abs(Z.x-f[0].x),Math.abs(O.x-f[0].x)),S=Math.max(Math.abs(Z.y-f[0].y),Math.abs(O.y-f[0].y));A>=S?(v=(Z.x+O.x)/2,b=f[0].y):(v=f[0].x,b=(Z.y+O.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...f,{x:c.x+y.x,y:c.y+y.y},n],v,b,m,M]}function rv(e,t,n,o){const r=Math.min(Ii(e,t)/2,Ii(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,v,b]=ov({source:{x:t,y:n},sourcePosition:o,target:{x:r,y:i},targetPosition:s,center:{x:l,y:c},offset:u});return[d.reduce((y,x,g)=>{let m;return g>0&&g<d.length-1?m=rv(d[g-1],x,d[g+1],a):m=`${g===0?"M":"L"}${x.x} ${x.y}`,y+=m,y},""),h,f,v,b]}function iv(e){const{sourceX:t,sourceY:n,targetX:o,targetY:r}=e,[i,s,a,l]=ha({sourceX:t,sourceY:n,targetX:o,targetY:r});return[`M ${t},${n}L ${o},${r}`,i,s,a,l]}const sv=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]=iv(e);return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),av=sv,lv=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})}}}),ma=lv,uv=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(ma,{...e,...t,borderRadius:0})}}),cv=uv,dv=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]=ga({...e,sourcePosition:e.sourcePosition??ue.Bottom,targetPosition:e.targetPosition??ue.Top});return Ce(Mo,{path:n,labelX:o,labelY:r,...t,...e})}}}),fv=dv,hv=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]=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={input:Wg,default:jg,output:Yg},vv={default:fv,straight:av,step:cv,smoothstep:ma,simplebezier:pv};function mv(e,t,n){const o=ne(()=>b=>t.value.get(b)),r=ne(()=>b=>n.value.get(b)),i=ne(()=>{const b={...vv,...e.edgeTypes},_=Object.keys(b);for(const y of e.edges)y.type&&!_.includes(y.type)&&(b[y.type]=y.type);return b}),s=ne(()=>{const b={...gv,...e.nodeTypes},_=Object.keys(b);for(const y of e.nodes)y.type&&!_.includes(y.type)&&(b[y.type]=y.type);return b}),a=ne(()=>e.onlyRenderVisibleElements?Js(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 b=[];for(const _ of e.edges){const y=t.value.get(_.source),x=t.value.get(_.target);hg({sourcePos:y.computedPosition||{x:0,y:0},targetPos:x.computedPosition||{x:0,y:0},sourceWidth:y.dimensions.width,sourceHeight:y.dimensions.height,targetWidth:x.dimensions.width,targetHeight:x.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&b.push(_)}return b}return e.edges}),c=ne(()=>[...a.value,...l.value]),u=ne(()=>{const b=[];for(const _ of e.nodes)_.selected&&b.push(_);return b}),d=ne(()=>{const b=[];for(const _ of e.edges)_.selected&&b.push(_);return b}),h=ne(()=>[...u.value,...d.value]),f=ne(()=>{const b=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&_.handleBounds!==void 0&&b.push(_);return b}),v=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:v}}class $t{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=nn())==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=fa(),r=Ra(o),i={};for(const[h,f]of Object.entries(r.hooks)){const v=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;i[v]=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=mv(r,a,l),u=Hg(r,a,l);u.setState({...r,...n});const d={...i,...c,...u,...ad(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 Te(e){const t=$t.getInstance(),n=ur(),o=typeof e=="object",r=o?e:{id:e},i=r.id,s=i??n?.vueFlowId;let a;if(n){const l=tn(Mi,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??Xi(!0)).run(()=>{_e(c.applyDefault,(d,h,f)=>{const v=_=>{c.applyNodeChanges(_)},b=_=>{c.applyEdgeChanges(_)};d?(c.onNodesChange(v),c.onEdgesChange(b)):(c.hooks.value.nodesChange.off(v),c.hooks.value.edgesChange.off(b)),f(()=>{c.hooks.value.nodesChange.off(v),c.hooks.value.edgesChange.off(b)})},{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&&(Wt(Mi,a),n.vueFlowId=a.id),o){const l=nn();l?.type.name!=="VueFlow"&&a.emits.error(new ze(Ie.USEVUEFLOW_OPTIONS))}return a}function yv(e){const{emits:t,dimensions:n}=Te();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)),Ui(()=>{window.removeEventListener("resize",r),o&&e.value&&o.unobserve(e.value)})})}const wv={name:"UserSelection",compatConfig:{MODE:3}},_v=ve({...wv,props:{userSelectionRect:{}},setup(e){return(t,n)=>(j(),ee("div",{class:"vue-flow__selection vue-flow__container",style:Le({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),xv=["tabIndex"],bv={name:"NodesSelection",compatConfig:{MODE:3}},Ev=ve({...bv,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:r,disableKeyboardA11y:i,userSelectionActive:s}=Te(),a=da(),l=ce(null),c=la({el:l,onStart(v){t.selectionDragStart(v),t.nodeDragStart(v)},onDrag(v){t.selectionDrag(v),t.nodeDrag(v)},onStop(v){t.selectionDragStop(v),t.nodeDragStop(v)}});je(()=>{var v;i.value||(v=l.value)==null||v.focus({preventScroll:!0})});const u=ne(()=>Zs(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(v){t.selectionContextMenu({event:v,nodes:o.value})}function f(v){i.value||Yt[v.key]&&(v.preventDefault(),a({x:Yt[v.key].x,y:Yt[v.key].y},v.shiftKey))}return(v,b)=>!C(s)&&u.value.width&&u.value.height?(j(),ee("div",{key:0,class:Ae(["vue-flow__nodesselection vue-flow__container",C(r)]),style:Le({transform:`translate(${C(n).x}px,${C(n).y}px) scale(${C(n).zoom})`})},[K("div",{ref_key:"el",ref:l,class:Ae([{dragging:C(c)},"vue-flow__nodesselection-rect"]),style:Le(d.value),tabIndex:C(i)?void 0:-1,onContextmenu:h,onKeydown:f},null,46,xv)],6)):ge("",!0)}});function kv(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Sv={name:"Pane",compatConfig:{MODE:3}},Cv=ve({...Sv,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:v,deleteKeyCode:b,multiSelectionKeyCode:_,multiSelectionActive:y,edgeLookup:x,nodeLookup:g,connectionLookup:m,defaultEdgeOptions:M,connectionStartHandle:z,panOnDrag:L}=Te(),F=dt(null),Z=dt(new Set),O=dt(new Set),A=dt(null),S=$e(()=>l.value&&(e.isSelecting||i.value)),$=$e(()=>z.value!==null);let p=!1,k=!1;const w=gn(b,{actInsideInputWithModifier:!1}),N=gn(_);_e(w,E=>{E&&(h(d.value),f(u.value),c.value=!1)}),_e(N,E=>{y.value=E});function D(E,P){return R=>{R.target===P&&E?.(R)}}function q(E){if(p||$.value){p=!1;return}r.paneClick(E),s(),c.value=!1}function V(E){var P;if(Array.isArray(L.value)&&((P=L.value)!=null&&P.includes(2))){E.preventDefault();return}r.paneContextMenu(E)}function G(E){r.paneScroll(E)}function U(E){var P,R,W;if(A.value=((P=t.value)==null?void 0:P.getBoundingClientRect())??null,!l.value||!e.isSelecting||E.button!==0||E.target!==F.value||!A.value)return;(W=(R=E.target)==null?void 0:R.setPointerCapture)==null||W.call(R,E.pointerId);const{x:Q,y:te}=kv(E,A.value);k=!0,p=!1,s(),a.value={width:0,height:0,startX:Q,startY:te,x:Q,y:te},r.selectionStart(E)}function J(E){var P;if(!A.value||!a.value)return;p=!0;const{x:R,y:W}=nt(E,A.value),{startX:Q=0,startY:te=0}=a.value,re={startX:Q,startY:te,x:R<Q?R:Q,y:W<te?W:te,width:Math.abs(R-Q),height:Math.abs(W-te)},ae=Z.value,me=O.value;Z.value=new Set(Js(n.value,re,o.value,v.value===Nr.Partial,!0).map(T=>T.id)),O.value=new Set;const B=((P=M.value)==null?void 0:P.selectable)??!0;for(const T of Z.value){const H=m.value.get(T);if(H)for(const{edgeId:X}of H.values()){const Y=x.value.get(X);Y&&(Y.selectable??B)&&O.value.add(X)}}if(!$i(ae,Z.value)){const T=xt(g.value,Z.value,!0);r.nodesChange(T)}if(!$i(me,O.value)){const T=xt(x.value,O.value);r.edgesChange(T)}a.value=re,i.value=!0,c.value=!1}function I(E){var P;E.button!==0||!k||((P=E.target)==null||P.releasePointerCapture(E.pointerId),!i.value&&a.value&&E.target===F.value&&q(E),i.value=!1,a.value=null,c.value=Z.value.size>0,r.selectionEnd(E),e.selectionKeyPressed&&(p=!1),k=!1)}return(E,P)=>(j(),ee("div",{ref_key:"container",ref:F,class:Ae(["vue-flow__pane vue-flow__container",{selection:E.isSelecting}]),onClick:P[0]||(P[0]=R=>S.value?void 0:D(q,F.value)(R)),onContextmenu:P[1]||(P[1]=R=>D(V,F.value)(R)),onWheelPassive:P[2]||(P[2]=R=>D(G,F.value)(R)),onPointerenter:P[3]||(P[3]=R=>S.value?void 0:C(r).paneMouseEnter(R)),onPointerdown:P[4]||(P[4]=R=>S.value?U(R):C(r).paneMouseMove(R)),onPointermove:P[5]||(P[5]=R=>S.value?J(R):C(r).paneMouseMove(R)),onPointerup:P[6]||(P[6]=R=>S.value?I(R):void 0),onPointerleave:P[7]||(P[7]=R=>C(r).paneMouseLeave(R))},[xe(E.$slots,"default"),C(i)&&C(a)?(j(),we(_v,{key:0,"user-selection-rect":C(a)},null,8,["user-selection-rect"])):ge("",!0),C(c)&&C(d).length?(j(),we(Ev,{key:1})):ge("",!0)],34))}}),Nv={name:"Transform",compatConfig:{MODE:3}},$v=ve({...Nv,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=Te(),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)=>(j(),ee("div",{class:"vue-flow__transformationpane vue-flow__container",style:Le({transform:i.value,opacity:r.value?0:void 0})},[xe(s.$slots,"default")],4))}}),Mv={name:"Viewport",compatConfig:{MODE:3}},Tv=ve({...Mv,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:v,preventScrolling:b,noWheelClassName:_,noPanClassName:y,emits:x,connectionStartHandle:g,userSelectionActive:m,paneDragging:M,d3Zoom:z,d3Selection:L,d3ZoomHandler:F,viewport:Z,viewportRef:O,paneClickDistance:A}=Te();yv(O);const S=dt(!1),$=dt(!1);let p=null,k=!1,w=0,N={x:0,y:0,zoom:0};const D=gn(a),q=gn(s),V=gn(i),G=$e(()=>(!q.value||q.value&&s.value===!0)&&(D.value||d.value)),U=$e(()=>D.value||l.value),J=$e(()=>s.value===!0&&G.value!==!0),I=$e(()=>q.value&&s.value!==!0||m.value||J.value),E=$e(()=>g.value!==null);je(()=>{if(!O.value){$n("Viewport element is missing");return}const te=O.value,re=te.getBoundingClientRect(),ae=Yp().clickDistance(A.value).scaleExtent([t.value,n.value]).translateExtent(r.value),me=Ye(te).call(ae),B=me.on("wheel.zoom"),T=Jt.translate(o.value.x??0,o.value.y??0).scale(At(o.value.zoom??1,t.value,n.value)),H=[[0,0],[re.width,re.height]],X=ae.constrain()(T,H,r.value);ae.transform(me,X),ae.wheelDelta(pi),z.value=ae,L.value=me,F.value=B,Z.value={x:X.x,y:X.y,zoom:X.k},ae.on("start",Y=>{var se;if(!Y.sourceEvent)return null;w=Y.sourceEvent.button,S.value=!0;const le=W(Y.transform);((se=Y.sourceEvent)==null?void 0:se.type)==="mousedown"&&(M.value=!0),N=le,x.viewportChangeStart(le),x.moveStart({event:Y,flowTransform:le})}),ae.on("end",Y=>{if(!Y.sourceEvent)return null;if(S.value=!1,M.value=!1,P(G.value,w??0)&&!k&&x.paneContextMenu(Y.sourceEvent),k=!1,R(N,Y.transform)){const se=W(Y.transform);N=se,x.viewportChangeEnd(se),x.moveEnd({event:Y,flowTransform:se})}}),ae.filter(Y=>{var se;const le=V.value||v.value,pe=f.value&&Y.ctrlKey,de=Y.button,ye=Y.type==="wheel";if(de===1&&Y.type==="mousedown"&&(Q(Y,"vue-flow__node")||Q(Y,"vue-flow__edge")))return!0;if(!G.value&&!le&&!U.value&&!h.value&&!f.value||m.value||E.value&&!ye||!h.value&&Y.type==="dblclick"||Q(Y,_.value)&&ye||Q(Y,y.value)&&(!ye||U.value&&ye&&!V.value)||!f.value&&Y.ctrlKey&&ye||!le&&!U.value&&!pe&&ye)return!1;if(!f&&Y.type==="touchstart"&&((se=Y.touches)==null?void 0:se.length)>1)return Y.preventDefault(),!1;if(!G.value&&(Y.type==="mousedown"||Y.type==="touchstart")||J.value&&Array.isArray(d.value)&&d.value.includes(0)&&de===0||Array.isArray(d.value)&&!d.value.includes(de)&&(Y.type==="mousedown"||Y.type==="touchstart"))return!1;const be=Array.isArray(d.value)&&d.value.includes(de)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!de||de<=1;return(!Y.ctrlKey||D.value||ye)&&be}),_e([m,G],()=>{m.value&&!S.value?ae.on("zoom",null):m.value||ae.on("zoom",Y=>{Z.value={x:Y.transform.x,y:Y.transform.y,zoom:Y.transform.k};const se=W(Y.transform);k=P(G.value,w??0),x.viewportChange(se),x.move({event:Y,flowTransform:se})})},{immediate:!0}),_e([m,U,c,V,f,b,_],()=>{U.value&&!V.value&&!m.value?me.on("wheel.zoom",Y=>{if(Q(Y,_.value))return!1;const se=V.value||v.value,le=f.value&&Y.ctrlKey;if(!(!b.value||U.value||se||le))return!1;Y.preventDefault(),Y.stopImmediatePropagation();const de=me.property("__zoom").k||1,ye=lo();if(!D.value&&Y.ctrlKey&&f.value&&ye){const xa=et(Y),ba=pi(Y),Ea=de*2**ba;ae.scaleTo(me,Ea,xa,Y);return}const be=Y.deltaMode===1?20:1;let ke=c.value===pn.Vertical?0:Y.deltaX*be,yt=c.value===pn.Horizontal?0:Y.deltaY*be;!ye&&Y.shiftKey&&c.value!==pn.Vertical&&!ke&&yt&&(ke=yt,yt=0),ae.translateBy(me,-(ke/de)*u.value,-(yt/de)*u.value);const Qe=W(me.property("__zoom"));p&&clearTimeout(p),$.value?(x.move({event:Y,flowTransform:Qe}),x.viewportChange(Qe),p=setTimeout(()=>{x.moveEnd({event:Y,flowTransform:Qe}),x.viewportChangeEnd(Qe),$.value=!1},150)):($.value=!0,x.moveStart({event:Y,flowTransform:Qe}),x.viewportChangeStart(Qe))},{passive:!1}):typeof B<"u"&&me.on("wheel.zoom",function(Y,se){const le=!b.value&&Y.type==="wheel"&&!Y.ctrlKey,pe=V.value||v.value,de=f.value&&Y.ctrlKey;if(!pe&&!l.value&&!de&&Y.type==="wheel"||le||Q(Y,_.value))return null;Y.preventDefault(),B.call(this,Y,se)},{passive:!1})},{immediate:!0})});function P(te,re){return re===2&&Array.isArray(te)&&te.includes(2)}function R(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 W(te){return{x:te.x,y:te.y,zoom:te.k}}function Q(te,re){return te.target.closest(`.${re}`)}return(te,re)=>(j(),ee("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[oe(Cv,{"is-selecting":I.value,"selection-key-pressed":C(q),class:Ae({connecting:E.value,dragging:C(M),draggable:C(d)===!0||Array.isArray(C(d))&&C(d).includes(0)})},{default:fe(()=>[oe($v,null,{default:fe(()=>[xe(te.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Ov=["id"],Pv=["id"],Iv=["id"],Dv={name:"A11yDescriptions",compatConfig:{MODE:3}},Av=ve({...Dv,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=Te();return(r,i)=>(j(),ee(Me,null,[K("div",{id:`${C(qs)}-${C(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+he(C(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,Ov),K("div",{id:`${C(Gs)}-${C(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,Pv),C(n)?ge("",!0):(j(),ee("div",{key:0,id:`${C(Jp)}-${C(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(C(o)),9,Iv))],64))}});function zv(){const e=Te();_e(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Bv(e,t,n){return n===ue.Left?e-t:n===ue.Right?e+t:e}function Lv(e,t,n){return n===ue.Top?e-t:n===ue.Bottom?e+t:e}const Tr=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:Bv(t,e,o),cy:Lv(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Tr.props=["radius","centerX","centerY","position","type"];Tr.compatConfig={MODE:3};const Di=Tr,Rv=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:v,elementsSelectable:b,edgesUpdatable:_,edgesFocusable:y,hooks:x}=Te(),g=ne(()=>u(e.id)),{emit:m,on:M}=Mg(g.value,i),z=tn(So),L=nn(),F=ce(!1),Z=ce(!1),O=ce(""),A=ce(null),S=ce("source"),$=ce(null),p=$e(()=>typeof g.value.selectable>"u"?b.value:g.value.selectable),k=$e(()=>typeof g.value.updatable>"u"?_.value:g.value.updatable),w=$e(()=>typeof g.value.focusable>"u"?y.value:g.value.focusable);Wt(Cg,e.id),Wt(Ng,$);const N=ne(()=>g.value.class instanceof Function?g.value.class(g.value):g.value.class),D=ne(()=>g.value.style instanceof Function?g.value.style(g.value):g.value.style),q=ne(()=>{const T=g.value.type||"default",H=z?.[`edge-${T}`];if(H)return H;let X=g.value.template??l.value[T];if(typeof X=="string"&&L){const Y=Object.keys(L.appContext.components);Y&&Y.includes(T)&&(X=Ki(T,!1))}return X&&typeof X!="string"?X:(i.error(new ze(Ie.EDGE_TYPE_MISSING,X)),!1)}),{handlePointerDown:V}=ua({nodeId:O,handleId:A,type:S,isValidConnection:h,edgeUpdaterType:S,onEdgeUpdate:J,onEdgeUpdateEnd:I});return()=>{const T=d(g.value.source),H=d(g.value.target),X="pathOptions"in g.value?g.value.pathOptions:{};if(!T&&!H)return i.error(new ze(Ie.EDGE_SOURCE_TARGET_MISSING,g.value.id,g.value.source,g.value.target)),null;if(!T)return i.error(new ze(Ie.EDGE_SOURCE_MISSING,g.value.id,g.value.source)),null;if(!H)return i.error(new ze(Ie.EDGE_TARGET_MISSING,g.value.id,g.value.target)),null;if(!g.value||g.value.hidden||T.hidden||H.hidden)return null;let Y;o.value===St.Strict?Y=T.handleBounds.source:Y=[...T.handleBounds.source||[],...T.handleBounds.target||[]];const se=bi(Y,g.value.sourceHandle);let le;o.value===St.Strict?le=H.handleBounds.target:le=[...H.handleBounds.target||[],...H.handleBounds.source||[]];const pe=bi(le,g.value.targetHandle),de=se?.position||ue.Bottom,ye=pe?.position||ue.Top,{x:be,y:ke}=Qt(T,se,de),{x:yt,y:Qe}=Qt(H,pe,ye);return g.value.sourceX=be,g.value.sourceY=ke,g.value.targetX=yt,g.value.targetY=Qe,Ce("g",{ref:$,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${q.value===!1?"default":g.value.type||"default"}`,a.value,N.value,{updating:F.value,selected:g.value.selected,animated:g.value.animated,inactive:!p.value&&!x.value.edgeClick.hasListeners()}],tabIndex:w.value?0:void 0,"aria-label":g.value.ariaLabel===null?void 0:g.value.ariaLabel??`Edge from ${g.value.source} to ${g.value.target}`,"aria-describedby":w.value?`${Gs}-${t}`:void 0,"aria-roledescription":"edge",role:w.value?"group":"img",...g.value.domAttributes,onClick:P,onContextmenu:R,onDblclick:W,onMouseenter:Q,onMousemove:te,onMouseleave:re,onKeyDown:w.value?B:void 0},[Z.value?null:Ce(q.value===!1?l.value.default:q.value,{id:e.id,sourceNode:T,targetNode:H,source:g.value.source,target:g.value.target,type:g.value.type,updatable:k.value,selected:g.value.selected,animated:g.value.animated,label:g.value.label,labelStyle:g.value.labelStyle,labelShowBg:g.value.labelShowBg,labelBgStyle:g.value.labelBgStyle,labelBgPadding:g.value.labelBgPadding,labelBgBorderRadius:g.value.labelBgBorderRadius,data:g.value.data,events:{...g.value.events,...M},style:D.value,markerStart:`url('#${kn(g.value.markerStart,t)}')`,markerEnd:`url('#${kn(g.value.markerEnd,t)}')`,sourcePosition:de,targetPosition:ye,sourceX:be,sourceY:ke,targetX:yt,targetY:Qe,sourceHandleId:g.value.sourceHandle,targetHandleId:g.value.targetHandle,interactionWidth:g.value.interactionWidth,...X}),[k.value==="source"||k.value===!0?[Ce("g",{onMousedown:ae,onMouseenter:G,onMouseout:U},Ce(Di,{position:de,centerX:be,centerY:ke,radius:r.value,type:"source","data-type":"source"}))]:null,k.value==="target"||k.value===!0?[Ce("g",{onMousedown:me,onMouseenter:G,onMouseout:U},Ce(Di,{position:ye,centerX:yt,centerY:Qe,radius:r.value,type:"target","data-type":"target"}))]:null]])};function G(){F.value=!0}function U(){F.value=!1}function J(T,H){m.update({event:T,edge:g.value,connection:H})}function I(T){m.updateEnd({event:T,edge:g.value}),Z.value=!1}function E(T,H){T.button===0&&(Z.value=!0,O.value=H?g.value.target:g.value.source,A.value=(H?g.value.targetHandle:g.value.sourceHandle)??null,S.value=H?"target":"source",m.updateStart({event:T,edge:g.value}),V(T))}function P(T){var H;const X={event:T,edge:g.value};p.value&&(s.value=!1,g.value.selected&&f.value?(c([g.value]),(H=$.value)==null||H.blur()):n([g.value])),m.click(X)}function R(T){m.contextMenu({event:T,edge:g.value})}function W(T){m.doubleClick({event:T,edge:g.value})}function Q(T){m.mouseEnter({event:T,edge:g.value})}function te(T){m.mouseMove({event:T,edge:g.value})}function re(T){m.mouseLeave({event:T,edge:g.value})}function ae(T){E(T,!0)}function me(T){E(T,!1)}function B(T){var H;!v.value&&js.includes(T.key)&&p.value&&(T.key==="Escape"?((H=$.value)==null||H.blur(),c([u(e.id)])):n([u(e.id)]))}}}),Vv=Rv,Fv=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}=Te(),h=(e=tn(So))==null?void 0:e["connection-line"],f=ne(()=>{var x;return d((x=o.value)==null?void 0:x.nodeId)}),v=ne(()=>{var x;return d((x=r.value)==null?void 0:x.nodeId)??null}),b=ne(()=>({x:(i.value.x-u.value.x)/u.value.zoom,y:(i.value.y-u.value.y)/u.value.zoom})),_=ne(()=>l.value.markerStart?`url(#${kn(l.value.markerStart,t)})`:""),y=ne(()=>l.value.markerEnd?`url(#${kn(l.value.markerEnd,t)})`:"");return()=>{var x,g,m;if(!f.value||!o.value)return null;const M=o.value.id,z=o.value.type,L=f.value.handleBounds;let F=L?.[z]??[];if(n.value===St.Loose){const D=L?.[z==="source"?"target":"source"]??[];F=[...F,...D]}if(!F)return null;const Z=(M?F.find(D=>D.id===M):F[0])??null,O=Z?.position??ue.Top,{x:A,y:S}=Qt(f.value,Z,O);let $=null;v.value&&(n.value===St.Strict?$=((x=v.value.handleBounds[z==="source"?"target":"source"])==null?void 0:x.find(D=>{var q;return D.id===((q=r.value)==null?void 0:q.id)}))||null:$=((g=[...v.value.handleBounds.source??[],...v.value.handleBounds.target??[]])==null?void 0:g.find(D=>{var q;return D.id===((q=r.value)==null?void 0:q.id)}))||null);const p=((m=r.value)==null?void 0:m.position)??(O?sr[O]:null);if(!O||!p)return null;const k=s.value??l.value.type??Nt.Bezier;let w="";const N={sourceX:A,sourceY:S,sourcePosition:O,targetX:b.value.x,targetY:b.value.y,targetPosition:p};return k===Nt.Bezier?[w]=ga(N):k===Nt.Step?[w]=lr({...N,borderRadius:0}):k===Nt.SmoothStep?[w]=lr(N):k===Nt.SimpleBezier?[w]=va(N):w=`M${A},${S} ${b.value.x},${b.value.y}`,Ce("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Ce("g",{class:"vue-flow__connection"},h?Ce(h,{sourceX:A,sourceY:S,sourcePosition:O,targetX:b.value.x,targetY:b.value.y,targetPosition:p,sourceNode:f.value,sourceHandle:Z,targetNode:v.value,targetHandle:$,markerEnd:y.value,markerStart:_.value,connectionStatus:c.value}):Ce("path",{d:w,class:[l.value.class,c.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":y.value,"marker-start":_.value})))}}}),Hv=Fv,qv=["id","markerWidth","markerHeight","markerUnits","orient"],Gv={name:"MarkerType",compatConfig:{MODE:3}},jv=ve({...Gv,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)=>(j(),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===C(io).ArrowClosed?(j(),ee("polyline",{key:0,style:Le({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===C(io).Arrow?(j(),ee("polyline",{key:1,style:Le({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,qv))}}),Yv={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Wv={name:"MarkerDefinitions",compatConfig:{MODE:3}},Xv=ve({...Wv,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:r}=Te(),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)=>(j(),ee("svg",Yv,[K("defs",null,[(j(!0),ee(Me,null,Ge(i.value,l=>(j(),we(jv,{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))])]))}}),Uv={name:"Edges",compatConfig:{MODE:3}},Kv=ve({...Uv,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=Te();return(r,i)=>(j(),ee(Me,null,[oe(Xv),(j(!0),ee(Me,null,Ge(C(n),s=>(j(),ee("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Le({zIndex:C(pg)(s,C(t),C(o))})},[oe(C(Vv),{id:s.id},null,8,["id"])],4))),128)),oe(C(Hv))],64))}}),Zv=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:v,ariaLiveMessage:b,snapToGrid:_,snapGrid:y,nodeDragThreshold:x,nodesDraggable:g,elementsSelectable:m,nodesConnectable:M,nodesFocusable:z,hooks:L}=Te(),F=ce(null);Wt(aa,F),Wt(sa,e.id);const Z=tn(So),O=nn(),A=da(),{node:S,parentNode:$}=ca(e.id),{emit:p,on:k}=Ig(S,s),w=$e(()=>typeof S.draggable>"u"?g.value:S.draggable),N=$e(()=>typeof S.selectable>"u"?m.value:S.selectable),D=$e(()=>typeof S.connectable>"u"?M.value:S.connectable),q=$e(()=>typeof S.focusable>"u"?z.value:S.focusable),V=ne(()=>N.value||w.value||L.value.nodeClick.hasListeners()||L.value.nodeDoubleClick.hasListeners()||L.value.nodeMouseEnter.hasListeners()||L.value.nodeMouseMove.hasListeners()||L.value.nodeMouseLeave.hasListeners()),G=$e(()=>!!S.dimensions.width&&!!S.dimensions.height),U=ne(()=>{const H=S.type||"default",X=Z?.[`node-${H}`];if(X)return X;let Y=S.template||d.value[H];if(typeof Y=="string"&&O){const se=Object.keys(O.appContext.components);se&&se.includes(H)&&(Y=Ki(H,!1))}return Y&&typeof Y!="string"?Y:(s.error(new ze(Ie.NODE_TYPE_MISSING,Y)),!1)}),J=la({id:e.id,el:F,disabled:()=>!w.value,selectable:N,dragHandle:()=>S.dragHandle,onStart(H){p.dragStart(H)},onDrag(H){p.drag(H)},onStop(H){p.dragStop(H)},onClick(H){B(H)}}),I=ne(()=>S.class instanceof Function?S.class(S):S.class),E=ne(()=>{const H=(S.style instanceof Function?S.style(S):S.style)||{},X=S.width instanceof Function?S.width(S):S.width,Y=S.height instanceof Function?S.height(S):S.height;return!H.width&&X&&(H.width=typeof X=="string"?X:`${X}px`),!H.height&&Y&&(H.height=typeof Y=="string"?Y:`${Y}px`),H}),P=$e(()=>Number(S.zIndex??E.value.zIndex??0));return u(H=>{(H.includes(e.id)||!H.length)&&W()}),je(()=>{_e(()=>S.hidden,(H=!1,X,Y)=>{!H&&F.value&&(e.resizeObserver.observe(F.value),Y(()=>{F.value&&e.resizeObserver.unobserve(F.value)}))},{immediate:!0,flush:"post"})}),_e([()=>S.type,()=>S.sourcePosition,()=>S.targetPosition],()=>{pt(()=>{c([{id:e.id,nodeElement:F.value,forceUpdate:!0}])})}),_e([()=>S.position.x,()=>S.position.y,()=>{var H;return(H=$.value)==null?void 0:H.computedPosition.x},()=>{var H;return(H=$.value)==null?void 0:H.computedPosition.y},()=>{var H;return(H=$.value)==null?void 0:H.computedPosition.z},P,()=>S.selected,()=>S.dimensions.height,()=>S.dimensions.width,()=>{var H;return(H=$.value)==null?void 0:H.dimensions.height},()=>{var H;return(H=$.value)==null?void 0:H.dimensions.width}],([H,X,Y,se,le,pe])=>{const de={x:H,y:X,z:pe+(f.value&&S.selected?1e3:0)};typeof Y<"u"&&typeof se<"u"?S.computedPosition=lg({x:Y,y:se,z:le},de):S.computedPosition=de},{flush:"post",immediate:!0}),_e([()=>S.extent,h],([H,X],[Y,se])=>{(H!==Y||X!==se)&&R()}),S.extent==="parent"||typeof S.extent=="object"&&"range"in S.extent&&S.extent.range==="parent"?Ko(()=>G).toBe(!0).then(R):R(),()=>S.hidden?null:Ce("div",{ref:F,"data-id":S.id,class:["vue-flow__node",`vue-flow__node-${U.value===!1?"default":S.type||"default"}`,{[n.value]:w.value,dragging:J?.value,draggable:w.value,selected:S.selected,selectable:N.value,parent:S.isParent},I.value],style:{visibility:G.value?"visible":"hidden",zIndex:S.computedPosition.z??P.value,transform:`translate(${S.computedPosition.x}px,${S.computedPosition.y}px)`,pointerEvents:V.value?"all":"none",...E.value},tabIndex:q.value?0:void 0,role:q.value?"group":void 0,"aria-describedby":v.value?void 0:`${qs}-${t}`,"aria-label":S.ariaLabel,"aria-roledescription":"node",...S.domAttributes,onMouseenter:Q,onMousemove:te,onMouseleave:re,onContextmenu:ae,onClick:B,onDblclick:me,onKeydown:T},[Ce(U.value===!1?d.value.default:U.value,{id:S.id,type:S.type,data:S.data,events:{...S.events,...k},selected:S.selected,resizing:S.resizing,dragging:J.value,connectable:D.value,position:S.computedPosition,dimensions:S.dimensions,isValidTargetPos:S.isValidTargetPos,isValidSourcePos:S.isValidSourcePos,parent:S.parentNode,parentNodeId:S.parentNode,zIndex:S.computedPosition.z??P.value,targetPosition:S.targetPosition,sourcePosition:S.sourcePosition,label:S.label,dragHandle:S.dragHandle,onUpdateNodeInternals:W})]);function R(){const H=S.computedPosition,{computedPosition:X,position:Y}=$r(S,_.value?ko(H,y.value):H,s.error,h.value,$.value);(S.computedPosition.x!==X.x||S.computedPosition.y!==X.y)&&(S.computedPosition={...S.computedPosition,...X}),(S.position.x!==Y.x||S.position.y!==Y.y)&&(S.position=Y)}function W(){F.value&&c([{id:e.id,nodeElement:F.value,forceUpdate:!0}])}function Q(H){J?.value||p.mouseEnter({event:H,node:S})}function te(H){J?.value||p.mouseMove({event:H,node:S})}function re(H){J?.value||p.mouseLeave({event:H,node:S})}function ae(H){return p.contextMenu({event:H,node:S})}function me(H){return p.doubleClick({event:H,node:S})}function B(H){N.value&&(!o.value||!w.value||x.value>0)&&ar(S,i.value,l,a,r,!1,F.value),p.click({event:H,node:S})}function T(H){if(!(ir(H)||v.value))if(js.includes(H.key)&&N.value){const X=H.key==="Escape";ar(S,i.value,l,a,r,X,F.value)}else w.value&&S.selected&&Yt[H.key]&&(H.preventDefault(),b.value=`Moved selected node ${H.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.position.x}, y: ${~~S.position.y}`,A({x:Yt[H.key].x,y:Yt[H.key].y},H.shiftKey))}}}),Jv=Zv;function Qv(e={includeHiddenNodes:!1}){const{nodes:t}=Te();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 em={class:"vue-flow__nodes vue-flow__container"},tm={name:"Nodes",compatConfig:{MODE:3}},nm=ve({...tm,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=Te(),r=Qv(),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))})}),Ui(()=>{var s;return(s=i.value)==null?void 0:s.disconnect()}),(s,a)=>(j(),ee("div",em,[i.value?(j(!0),ee(Me,{key:0},Ge(C(t),(l,c,u,d)=>{const h=[l.id];if(d&&d.key===l.id&&La(d,h))return d;const f=(j(),we(C(Jv),{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 om(){const{emits:e}=Te();je(()=>{if(ia()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new ze(Ie.MISSING_STYLES))}})}const rm=K("div",{class:"vue-flow__edge-labels"},null,-1),im={name:"VueFlow",compatConfig:{MODE:3}},sm=ve({...im,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=za(),i=Oo(o,"modelValue",n),s=Oo(o,"nodes",n),a=Oo(o,"edges",n),l=Te(o),c=Bg({modelValue:i,nodes:s,edges:a},o,l);return Rg(n,l.hooks),zv(),om(),Wt(So,r),Wi(c),t(l),(u,d)=>(j(),ee("div",{ref:C(l).vueFlowRef,class:"vue-flow"},[oe(Tv,null,{default:fe(()=>[oe(Kv),rm,oe(nm),xe(u.$slots,"zoom-pane")]),_:3}),xe(u.$slots,"default"),oe(Av)],512))}}),am={name:"Panel",compatConfig:{MODE:3}},lm=ve({...am,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Te(),o=ne(()=>`${t.position}`.split("-"));return(r,i)=>(j(),ee("div",{class:Ae(["vue-flow__panel",o.value]),style:Le({pointerEvents:C(n)?"none":"all"})},[xe(r.$slots,"default")],6))}});var ht=(e=>(e.Lines="lines",e.Dots="dots",e))(ht||{});const ya=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]}`})},wa=function({radius:e,color:t}){return Ce("circle",{cx:e,cy:e,r:e,fill:t})};ht.Lines+"",ht.Dots+"";const um={[ht.Dots]:"#81818a",[ht.Lines]:"#eee"},cm=["id","x","y","width","height","patternTransform"],dm={key:2,height:"100",width:"100"},fm=["fill"],hm=["x","y","fill"],pm={name:"Background",compatConfig:{MODE:3}},gm=ve({...pm,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}=Te(),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||um[e.variant||ht.Dots]);return(s,a)=>(j(),ee("svg",{class:"vue-flow__background vue-flow__container",style:Le({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[xe(s.$slots,"pattern-container",{id:r.value},()=>[K("pattern",{id:r.value,x:C(n).x%o.value.scaledGap[0],y:C(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"},[xe(s.$slots,"pattern",{},()=>[s.variant===C(ht).Lines?(j(),we(C(ya),{key:0,size:s.lineWidth,color:i.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===C(ht).Dots?(j(),we(C(wa),{key:1,color:i.value,radius:o.value.size/2},null,8,["color","radius"])):ge("",!0),s.bgColor?(j(),ee("svg",dm,[K("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,fm)])):ge("",!0)])],8,cm)]),K("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,hm),xe(s.$slots,"default",{id:r.value})],4))}}),vm={name:"ControlButton",compatConfig:{MODE:3}},mm=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},ym={type:"button",class:"vue-flow__controls-button"};function wm(e,t,n,o,r,i){return j(),ee("button",ym,[xe(e.$slots,"default")])}const Rn=mm(vm,[["render",wm]]),_m={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},xm=K("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),bm=[xm];function Em(e,t){return j(),ee("svg",_m,bm)}const km={render:Em},Sm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Cm=K("path",{d:"M0 0h32v4.2H0z"},null,-1),Nm=[Cm];function $m(e,t){return j(),ee("svg",Sm,Nm)}const Mm={render:$m},Tm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Om=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),Pm=[Om];function Im(e,t){return j(),ee("svg",Tm,Pm)}const Dm={render:Im},Am={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},zm=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),Bm=[zm];function Lm(e,t){return j(),ee("svg",Am,Bm)}const Rm={render:Lm},Vm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Fm=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),Hm=[Fm];function qm(e,t){return j(),ee("svg",Vm,Hm)}const Gm={render:qm},jm={name:"Controls",compatConfig:{MODE:3}},Ym=ve({...jm,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Hs.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}=Te(),h=$e(()=>n.value||o.value||r.value),f=$e(()=>c.value.zoom<=u.value),v=$e(()=>c.value.zoom>=d.value);function b(){s(),t("zoomIn")}function _(){a(),t("zoomOut")}function y(){l(e.fitViewParams),t("fitView")}function x(){i(!h.value),t("interactionChange",!h.value)}return(g,m)=>(j(),we(C(lm),{class:"vue-flow__controls",position:g.position},{default:fe(()=>[xe(g.$slots,"top"),g.showZoom?(j(),ee(Me,{key:0},[xe(g.$slots,"control-zoom-in",{},()=>[oe(Rn,{class:"vue-flow__controls-zoomin",disabled:v.value,onClick:b},{default:fe(()=>[xe(g.$slots,"icon-zoom-in",{},()=>[(j(),we(qe(C(km))))])]),_:3},8,["disabled"])]),xe(g.$slots,"control-zoom-out",{},()=>[oe(Rn,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:_},{default:fe(()=>[xe(g.$slots,"icon-zoom-out",{},()=>[(j(),we(qe(C(Mm))))])]),_:3},8,["disabled"])])],64)):ge("",!0),g.showFitView?xe(g.$slots,"control-fit-view",{key:1},()=>[oe(Rn,{class:"vue-flow__controls-fitview",onClick:y},{default:fe(()=>[xe(g.$slots,"icon-fit-view",{},()=>[(j(),we(qe(C(Dm))))])]),_:3})]):ge("",!0),g.showInteractive?xe(g.$slots,"control-interactive",{key:2},()=>[g.showInteractive?(j(),we(Rn,{key:0,class:"vue-flow__controls-interactive",onClick:x},{default:fe(()=>[h.value?xe(g.$slots,"icon-unlock",{key:0},()=>[(j(),we(qe(C(Gm))))]):ge("",!0),h.value?ge("",!0):xe(g.$slots,"icon-lock",{key:1},()=>[(j(),we(qe(C(Rm))))])]),_:3})):ge("",!0)]):ge("",!0),xe(g.$slots,"default")]),_:3},8,["position"]))}}),Wm={key:0,class:"space-y-2"},Xm={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},Um={class:"shrink-0 font-mono"},Km=["title"],Zm={class:"line-clamp-2 text-sm font-medium leading-snug"},Jm={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},Qm={class:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide"},ey={class:"rounded bg-background/60 px-1.5 py-0.5"},ty={class:"rounded bg-background/60 px-1.5 py-0.5"},ny={key:1,class:"space-y-1.5"},oy={class:"flex items-center gap-2 text-sm font-medium"},ry={class:"font-mono text-[11px] text-muted-foreground"},iy=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:Xt,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:Zi,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)=>(j(),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",[C(l),e.selected?"ring-2 ring-primary/30 shadow-md":"hover:shadow-md hover:border-primary/40"]])},[oe(C(en),{type:"target",position:C(ue).Top,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"]),C(o)?(j(),ee("div",Wm,[K("div",Xm,[K("span",Um,he(C(o).taskId),1),C(c)?(j(),ee("span",{key:0,title:`${C(o).prdName} (${C(o).prdSlug})`,class:"max-w-[11rem] truncate rounded border border-border bg-background/60 px-1.5 py-0.5 text-[10px]"},he(C(c)),9,Km)):ge("",!0)]),K("p",Zm,he(C(o).title),1),K("div",Jm,[K("div",{class:Ae(["flex items-center gap-1.5",C(i).class])},[(j(),we(qe(C(i).icon),{class:"size-3.5"})),K("span",null,he(C(i).label),1)],2),K("div",Qm,[K("span",ey,he(C(a)),1),K("span",ty,he(C(s)),1)])])])):C(r)?(j(),ee("div",ny,[K("div",oy,[oe(C(Xt),{class:"size-4"}),K("span",null,he(C(r).title),1)]),K("p",ry,he(C(r).dependencyRef),1)])):ge("",!0),oe(C(en),{type:"source",position:C(ue).Bottom,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"])],2))}}),Ai=Object.assign(iy,{__name:"GraphNode"}),sy={class:"relative h-full overflow-hidden rounded-lg border border-border bg-card"},ay={key:0,class:"flex h-full items-center justify-center"},ly={class:"flex flex-col items-center gap-2 text-sm text-muted-foreground"},uy={key:1,class:"flex h-full items-center justify-center p-6"},cy={class:"max-w-sm text-center"},dy={class:"mt-1 text-sm text-muted-foreground"},fy={key:2,class:"flex h-full items-center justify-center p-6"},hy={class:"max-w-sm text-center"},py={class:"mt-1 text-sm text-muted-foreground"},gy={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"},vy={class:"space-y-1 text-xs"},my={class:"flex items-center gap-1.5 text-muted-foreground"},yy={class:"flex items-center gap-1.5 text-blue-600 dark:text-blue-400"},wy={class:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400"},_y={class:"flex items-center gap-1.5 text-amber-600 dark:text-amber-400"},xy={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"},by={class:"flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground"},Ey={class:"rounded bg-muted px-1.5 py-0.5"},ky={class:"rounded bg-blue-500/10 px-1.5 py-0.5 text-blue-700 dark:text-blue-300"},Sy={class:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-300"},Cy={class:"rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300"},Ny=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:Ht(Ai),external:Ht(Ai)},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(_=>_.kind==="task"):!1),c=ne(()=>n.payload?.stats);function u(_,y){return _.kind==="external"?{width:272,height:80}:y==="repo"?{width:272,height:116}:{width:272,height:96}}function d(_){return _==="repo"?{ranksep:136,nodesep:88,edgesep:34,marginx:36,marginy:28}:{ranksep:102,nodesep:56,edgesep:20,marginx:24,marginy:22}}function h(_,y){const x=new jr.graphlib.Graph,g=d(n.scope);x.setDefaultEdgeLabel(()=>({})),x.setGraph({rankdir:"TB",ranker:"network-simplex",...g});for(const m of _){const M=u(m.data,n.scope);x.setNode(m.id,M)}for(const m of y)x.setEdge(m.source,m.target);return jr.layout(x),_.map(m=>{const M=u(m.data,n.scope),z=x.node(m.id);return z?{...m,targetPosition:ue.Top,sourcePosition:ue.Bottom,position:{x:z.x-M.width/2,y:z.y-M.height/2}}:m})}const f=ne(()=>n.payload?n.payload.edges.map(_=>({id:_.id,source:_.source,target:_.target,type:"step",animated:_.unresolved&&!i.value,markerEnd:{type:io.ArrowClosed,width:16,height:16},style:{strokeWidth:_.unresolved?1.4:1.7,stroke:_.unresolved?"var(--muted-foreground)":"var(--border)",strokeOpacity:_.unresolved?.62:.95,strokeDasharray:_.unresolved?"5 4":void 0}})):[]),v=ne(()=>{if(!n.payload)return[];const _=n.payload.nodes.map(y=>({id:y.id,type:y.kind,data:{...y,showPrdLabel:y.kind==="task"?n.scope==="repo":void 0},draggable:!1,selectable:y.kind==="task",connectable:!1,position:{x:0,y:0}}));return h(_,f.value)});function b(_){const x=_.node.data;!x||x.kind!=="task"||o("taskClick",{prdSlug:x.prdSlug,taskId:x.taskId})}return(_,y)=>(j(),ee("div",sy,[e.loading?(j(),ee("div",ay,[K("div",ly,[oe(C(qo),{class:"size-5 animate-spin"}),y[0]||(y[0]=K("span",null,"Building graph...",-1))])])):e.error?(j(),ee("div",uy,[K("div",cy,[oe(C(Yn),{class:"mx-auto mb-3 size-8 text-destructive"}),y[1]||(y[1]=K("p",{class:"text-sm font-medium"},"Graph unavailable",-1)),K("p",dy,he(e.error),1)])])):!e.payload||!C(l)?(j(),ee("div",fy,[K("div",hy,[oe(C(Qa),{class:"mx-auto mb-3 size-8 text-muted-foreground/60"}),y[2]||(y[2]=K("p",{class:"text-sm font-medium"},"No graphable tasks yet",-1)),K("p",py,he(e.scope==="repo"?"No PRDs with task state were found in this repository.":"This PRD does not have generated tasks yet."),1)])])):(j(),we(C(sm),{key:C(a),nodes:C(v),edges:C(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:b},{default:fe(()=>[oe(C(gm),{gap:20,size:1.2,variant:"dots",color:"var(--border)"}),oe(C(Ym),{position:"bottom-left","show-interactive":!1})]),_:1},8,["nodes","edges"])),e.payload&&C(l)?(j(),ee("div",gy,[y[7]||(y[7]=K("p",{class:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},"Legend",-1)),K("div",vy,[K("div",my,[oe(C(fn),{class:"size-3.5"}),y[3]||(y[3]=Se(" Pending ",-1))]),K("div",yy,[oe(C(Zi),{class:"size-3.5"}),y[4]||(y[4]=Se(" In Progress ",-1))]),K("div",wy,[oe(C(Wn),{class:"size-3.5"}),y[5]||(y[5]=Se(" Completed ",-1))]),K("div",_y,[oe(C(Xt),{class:"size-3.5"}),y[6]||(y[6]=Se(" Missing dependency ",-1))])])])):ge("",!0),C(c)&&C(l)?(j(),ee("div",xy,[K("div",by,[K("span",Ey,"Total "+he(C(c).total),1),K("span",ky,"WIP "+he(C(c).inProgress),1),K("span",Sy,"Done "+he(C(c).completed),1),K("span",Cy,"Missing "+he(C(c).unresolved),1)])])):ge("",!0)]))}}),Fw=Object.assign(Ny,{__name:"GraphExplorer"}),$y={class:"space-y-0.5 p-2"},My=["onClick"],Ty={class:"min-w-0 flex-1"},Oy=["title"],Py={class:"text-muted-foreground"},Iy={class:"mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-muted"},Dy={class:"flex shrink-0 items-center gap-1 text-xs"},Ay={key:0,class:"text-green-600 dark:text-green-400"},zy={key:1,class:"text-red-600 dark:text-red-400"},By={key:0,class:"py-4 text-center text-sm text-muted-foreground"},Ly=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:kl,class:"text-green-600 dark:text-green-400"};case"deleted":return{icon:Sl,class:"text-red-600 dark:text-red-400"};case"renamed":return{icon:Ir,class:"text-blue-600 dark:text-blue-400"};default:return{icon:El,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,v=u.deletions/d*h;return{additions:f,deletions:v,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)=>(j(),ee("div",$y,[(j(!0),ee(Me,null,Ge(e.files,h=>(j(),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)},[(j(),we(qe(i(h.status).icon),{class:Ae(["size-4 shrink-0",i(h.status).class])},null,8,["class"])),K("div",Ty,[K("div",{class:Ae(["truncate text-xs",{"font-medium":e.selectedFile===h.path}]),title:a(h)},[h.status==="renamed"&&h.oldPath?(j(),ee(Me,{key:0},[K("span",Py,he(l(h.oldPath)),1),oe(C(Ir),{class:"mx-1 inline size-3 text-muted-foreground"}),K("span",null,he(l(h.path)),1)],64)):(j(),ee(Me,{key:1},[Se(he(h.path),1)],64))],10,Oy),K("div",Iy,[s(h).additions>0?(j(),ee("div",{key:0,class:"bg-green-500 dark:bg-green-400",style:Le({width:`${s(h).additions}%`})},null,4)):ge("",!0),s(h).deletions>0?(j(),ee("div",{key:1,class:"bg-red-500 dark:bg-red-400",style:Le({width:`${s(h).deletions}%`})},null,4)):ge("",!0)])]),K("div",Dy,[h.additions>0?(j(),ee("span",Ay," +"+he(h.additions),1)):ge("",!0),h.deletions>0?(j(),ee("span",zy," -"+he(h.deletions),1)):ge("",!0)])],10,My))),128)),e.files.length===0?(j(),ee("div",By," No files changed ")):ge("",!0)]))}}),Ry=Object.assign(Ly,{__name:"GitChangesMinimap"}),Vy={class:"diff-viewer"},Fy={key:0,class:"flex items-center justify-center py-8"},Hy={key:1,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},qy={key:2,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},Gy={key:3,class:"diff-container"},jy={class:"flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6"},Yy={class:"text-center"},Wy={class:"text-sm text-muted-foreground"},Xy={key:4,class:"diff-container"},Uy={class:"full-file-view"},Ky={class:"diff-gutter"},Zy={class:"line-number"},Jy={class:"diff-content"},Qy=["innerHTML"],e0={key:5,class:"diff-container"},t0={class:"diff-toolbar"},n0={class:"diff-split"},o0={class:"diff-column-content"},r0={key:0,class:"diff-separator-half"},i0={class:"diff-gutter"},s0={key:0,class:"line-number"},a0={class:"diff-content"},l0=["innerHTML"],u0={class:"diff-column-content"},c0={key:0,class:"diff-separator-half"},d0={class:"diff-gutter"},f0={key:0,class:"line-number"},h0={class:"diff-content"},p0=["innerHTML"],zi=1e4,Bi=1500,g0=4e3,v0=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);function a($){if(!o.value||s.value)return;const p=$.target;i.value&&(s.value=!0,i.value.scrollLeft=p.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}function l($){if(!o.value||s.value)return;const p=$.target;r.value&&(s.value=!0,r.value.scrollLeft=p.scrollLeft,requestAnimationFrame(()=>{s.value=!1}))}const c=ne(()=>{let $=0;for(const p of t.hunks)$+=p.lines.length;return $}),u=ne(()=>c.value>zi),d=ne(()=>t.hunks.length===0&&!t.binary),h=ne(()=>{const $=new Set,p=new Set;for(const k of t.hunks)for(const w of k.lines)w.type==="add"&&w.newNumber!==void 0&&$.add(w.newNumber),w.type==="remove"&&w.oldNumber!==void 0&&p.add(w.oldNumber);return{added:$,removed:p}}),f=ne(()=>t.fileContent?t.fileContent.split(`
28
+ `):[]);function v($){const p=$.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"}[p]||"text"}const b=ne(()=>v(t.filePath)),_=ce(new Map),y=ce(!0),x=new Map;let g=null;async function m(){return g||(g=qa(()=>import("./DEr8q68O.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then($=>$.codeToHtml)),g}const M=ne(()=>{const $=[];for(let p=0;p<t.hunks.length;p++){const k=t.hunks[p];p>0&&$.push({type:"separator",hunkIndex:p});const w=k.lines;let N=0;for(;N<w.length;){const D=w[N];if(D.type==="context")$.push({type:"line",pair:{id:`${p}-${N}`,left:{lineNum:D.oldNumber,content:D.content,type:"context"},right:{lineNum:D.newNumber,content:D.content,type:"context"}}}),N++;else if(D.type==="remove"){const q=[],V=[];for(;N<w.length&&w[N].type==="remove";)q.push(w[N]),N++;for(;N<w.length&&w[N].type==="add";)V.push(w[N]),N++;const G=Math.max(q.length,V.length);for(let U=0;U<G;U++){const J=q[U],I=V[U];$.push({type:"line",pair:{id:`${p}-${N-G+U}`,left:J?{lineNum:J.oldNumber,content:J.content,type:"remove"}:{content:"",type:"empty"},right:I?{lineNum:I.newNumber,content:I.content,type:"add"}:{content:"",type:"empty"}}})}}else D.type==="add"&&$.push({type:"line",pair:{id:`${p}-${N}`,left:{content:"",type:"empty"},right:{lineNum:D.newNumber,content:D.content,type:"add"}}}),N++}}return $});async function z($,p){if(!$.trim())return"";const k=`${p}:${$}`,w=x.get(k);if(w!==void 0)return w;try{const q=(await(await m())($,{lang:p,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/),V=q?q[1]||"":F($);return x.set(k,V),V}catch{const N=F($);return x.set(k,N),N}}async function L($,p){if(!$)return[];const k=$.split(`
29
+ `);if(k.length>g0)return k.map(F);try{const D=(await(await m())($,{lang:p,themes:{light:"catppuccin-latte",dark:"catppuccin-mocha"}})).match(/<code[^>]*>([\s\S]*?)<\/code>/);return!D||!D[1]?k.map(F):D[1].split(`
30
+ `)}catch{return k.map(F)}}function F($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}const Z=ce([]),O=ce(!1);_e(()=>[t.fileContent,t.filePath],async([$])=>{if(!$){Z.value=[];return}O.value=!0;const p=b.value;Z.value=await L($,p),O.value=!1},{immediate:!0}),_e(()=>[t.hunks,t.filePath,Z.value],async()=>{y.value=!0;const $=b.value,p=new Map,k=Z.value,w=[];for(const V of M.value)if(V.type==="line"&&V.pair){if(V.pair.left.content&&V.pair.left.type!=="empty"){const G=`${V.pair.id}-old`;if(V.pair.left.type==="context"&&V.pair.left.lineNum&&k.length>0){const U=V.pair.right.lineNum?V.pair.right.lineNum-1:-1;U>=0&&U<k.length?p.set(G,k[U]||""):w.push({key:G,content:V.pair.left.content})}else w.push({key:G,content:V.pair.left.content})}if(V.pair.right.content&&V.pair.right.type!=="empty"){const G=`${V.pair.id}-new`,U=V.pair.right.lineNum;U&&k.length>0&&U<=k.length?p.set(G,k[U-1]||""):w.push({key:G,content:V.pair.right.content})}}const N=w.slice(0,Bi),D=w.slice(Bi);for(const{key:V,content:G}of D)p.set(V,F(G));const q=50;for(let V=0;V<N.length;V+=q){const G=N.slice(V,V+q),U=await Promise.all(G.map(async({key:J,content:I})=>{const E=await z(I,$);return{key:J,result:E}}));for(const{key:J,result:I}of U)p.set(J,I)}_.value=p,y.value=!1},{immediate:!0});function A($,p){return _.value.get(`${$}-${p}`)||""}function S($){return h.value.added.has($)?"add":"context"}return($,p)=>(j(),ee("div",Vy,[(C(y)||e.isLoadingContent||C(O))&&!e.binary?(j(),ee("div",Fy,[...p[2]||(p[2]=[K("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):e.binary?(j(),ee("div",Hy,[oe(C(bl),{class:"size-10 opacity-50"}),p[3]||(p[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))])):C(d)&&!e.showFullFile?(j(),ee("div",qy,[oe(C(Xt),{class:"size-10 opacity-50"}),p[4]||(p[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))])):C(u)&&!C(n)&&!e.showFullFile?(j(),ee("div",Gy,[K("div",jy,[oe(C(Xt),{class:"size-8 text-yellow-500"}),K("div",Yy,[p[5]||(p[5]=K("p",{class:"font-medium"},"Large file",-1)),K("p",Wy," This file has "+he(C(c).toLocaleString())+" lines (threshold: "+he(zi.toLocaleString())+") ",1)]),oe(C(bt),{variant:"outline",size:"sm",onClick:p[0]||(p[0]=k=>n.value=!0)},{default:fe(()=>[oe(C(el),{class:"mr-2 size-4"}),p[6]||(p[6]=Se(" Show full diff ",-1))]),_:1})])])):e.showFullFile&&e.fileContent?(j(),ee("div",Xy,[K("div",Uy,[(j(!0),ee(Me,null,Ge(C(f),(k,w)=>(j(),ee("div",{key:w,class:Ae(["full-file-line",{"diff-add":S(w+1)==="add"}])},[K("div",Ky,[K("span",Zy,he(w+1),1)]),K("div",Jy,[K("span",{class:"diff-code",innerHTML:C(Z)[w]||F(k)},null,8,Qy)])],2))),128))])])):(j(),ee("div",e0,[K("div",t0,[oe(C(bt),{variant:"ghost",size:"sm",class:Ae(["h-7 gap-1.5 text-xs",{"text-primary":C(o)}]),onClick:p[1]||(p[1]=k=>o.value=!C(o))},{default:fe(()=>[(j(),we(qe(C(o)?C(Tl):C($l)),{class:"size-3.5"})),Se(" "+he(C(o)?"Sync scroll":"Scroll unlocked"),1)]),_:1},8,["class"])]),K("div",n0,[K("div",{ref_key:"leftScrollRef",ref:r,class:"diff-column diff-column-left",onScroll:a},[K("div",o0,[(j(!0),ee(Me,null,Ge(C(M),k=>(j(),ee(Me,{key:k.type==="line"?`left-${k.pair?.id}`:`left-sep-${k.hunkIndex}`},[k.type==="separator"?(j(),ee("div",r0,[...p[7]||(p[7]=[K("div",{class:"separator-line"},null,-1),K("span",{class:"separator-text"},"···",-1)])])):k.pair?(j(),ee("div",{key:1,class:Ae(["diff-line",{"diff-remove":k.pair.left.type==="remove","diff-empty":k.pair.left.type==="empty","diff-context":k.pair.left.type==="context"}])},[K("div",i0,[k.pair.left.lineNum?(j(),ee("span",s0,he(k.pair.left.lineNum),1)):ge("",!0)]),K("div",a0,[k.pair.left.type!=="empty"?(j(),ee("span",{key:0,class:"diff-code",innerHTML:A(k.pair.id,"old")||F(k.pair.left.content)},null,8,l0)):ge("",!0)])],2)):ge("",!0)],64))),128))])],544),K("div",{ref_key:"rightScrollRef",ref:i,class:"diff-column diff-column-right",onScroll:l},[K("div",u0,[(j(!0),ee(Me,null,Ge(C(M),k=>(j(),ee(Me,{key:k.type==="line"?`right-${k.pair?.id}`:`right-sep-${k.hunkIndex}`},[k.type==="separator"?(j(),ee("div",c0,[...p[8]||(p[8]=[K("span",{class:"separator-text"},"···",-1),K("div",{class:"separator-line"},null,-1)])])):k.pair?(j(),ee("div",{key:1,class:Ae(["diff-line",{"diff-add":k.pair.right.type==="add","diff-empty":k.pair.right.type==="empty","diff-context":k.pair.right.type==="context"}])},[K("div",d0,[k.pair.right.lineNum?(j(),ee("span",f0,he(k.pair.right.lineNum),1)):ge("",!0)]),K("div",h0,[k.pair.right.type!=="empty"?(j(),ee("span",{key:0,class:"diff-code",innerHTML:A(k.pair.id,"new")||F(k.pair.right.content)},null,8,p0)):ge("",!0)])],2)):ge("",!0)],64))),128))])],544)])]))]))}}),m0=Object.assign(hl(v0,[["__scopeId","data-v-a5da7e6e"]]),{__name:"GitDiffViewer"}),y0=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=dr(e,t);return(i,s)=>(j(),we(C(yc),He({"data-slot":"tooltip"},C(r)),{default:fe(a=>[xe(i.$slots,"default",co(fo(a)))]),_:3},16))}}),Li=Object.assign(y0,{__name:"UiTooltip"}),w0=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=qi(n,"class"),i=dr(r,o);return(s,a)=>(j(),we(C(Sc),null,{default:fe(()=>[oe(C(Ec),He({"data-slot":"tooltip-content"},{...C(i),...s.$attrs},{class:C(Gi)("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(()=>[xe(s.$slots,"default"),oe(C(fc),{class:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]),_:3},16,["class"])]),_:3}))}}),Ri=Object.assign(w0,{__name:"UiTooltipContent"}),_0=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)=>(j(),we(C(gc),co(fo(t)),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),Vi=Object.assign(_0,{__name:"UiTooltipProvider"}),x0=ve({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,o)=>(j(),we(C(Nc),He({"data-slot":"tooltip-trigger"},t),{default:fe(()=>[xe(n.$slots,"default")]),_:3},16))}}),Fi=Object.assign(x0,{__name:"UiTooltipTrigger"});function _a(){const{showError:e}=Oa();function t(u){if(u&&typeof u=="object"){const d=u;return d.data?.message||d.data?.statusMessage||d.message||"Unknown error"}return"Unknown error"}const n=ce(!1),o=ce(!1),r=ce(!1),i=ce(!1);async function s(u,d,h){if(!u||d.length===0)return{commits:[],failedShas:[]};n.value=!0;try{const f={shas:d.join(",")};h&&(f.repo=h);const v=await $fetch(`/api/repos/${u}/git/commits`,{query:f}),b=v.map(y=>y.shortSha),_=d.filter(y=>!b.some(x=>x.startsWith(y)||y.startsWith(x)));return{commits:v,failedShas:_}}catch(f){return e("Failed to fetch commits",t(f)),{commits:[],failedShas:d}}finally{n.value=!1}}async function a(u,d,h){if(!u||!d)return[];o.value=!0;try{const f={commit:d};return h&&(f.repo=h),await $fetch(`/api/repos/${u}/git/diff`,{query:f})}catch(f){throw e("Failed to fetch diff",t(f)),f}finally{o.value=!1}}async function l(u,d,h,f){if(!u||!d||!h)return[];r.value=!0;try{const v={commit:d,file:h};return f&&(v.repo=f),await $fetch(`/api/repos/${u}/git/file-diff`,{query:v})}catch(v){throw e("Failed to fetch file diff",t(v)),v}finally{r.value=!1}}async function c(u,d,h,f){if(!u||!d||!h)return null;i.value=!0;try{const v={commit:d,file:h};return f&&(v.repo=f),(await $fetch(`/api/repos/${u}/git/file-content`,{query:v})).content}catch(v){throw e("Failed to fetch file content",t(v)),v}finally{i.value=!1}}return{fetchCommits:s,fetchDiff:a,fetchFileDiff:l,fetchFileContent:c,isLoadingCommits:an(n),isLoadingDiff:an(o),isLoadingFileDiff:an(r),isLoadingFileContent:an(i)}}const b0={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},E0={class:"text-center"},k0={class:"text-sm text-muted-foreground"},S0={key:1,class:"flex flex-1 items-center justify-center"},C0={key:2,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground"},N0={key:3,class:"flex min-h-0 flex-1 overflow-hidden"},$0={class:"flex w-56 shrink-0 flex-col border-r border-border"},M0={class:"flex items-center justify-between border-b border-border px-3 py-2"},T0={class:"text-xs font-medium text-muted-foreground"},O0={class:"text-muted-foreground/50 transition-colors hover:text-muted-foreground"},P0={class:"min-h-0 flex-1 overflow-y-auto"},I0={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},D0={key:0,class:"flex items-center gap-2 border-b border-border px-4 py-2"},A0={key:0,class:"min-w-0 flex-1 truncate font-mono text-sm"},z0={class:"text-muted-foreground"},B0={key:1,class:"min-w-0 flex-1 truncate font-mono text-sm"},L0={key:2,class:"rounded bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-600 dark:text-yellow-400"},R0={key:1,class:"flex flex-1 items-center justify-center"},V0={key:2,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},F0={class:"text-center"},H0={class:"text-xs text-muted-foreground"},q0={key:4,class:"flex flex-1 items-center justify-center text-sm text-muted-foreground"},G0=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}=_a(),u=ce([]),d=ce(),h=ce([]),f=ce(null),v=ce(null),b=ce(null),_=ce("changes");function y(p,k){if(p&&typeof p=="object"){const w=p;return w.data?.message||w.data?.statusMessage||w.statusMessage||w.message||k}return k}const x=ne(()=>u.value.find(p=>p.path===d.value));async function g(){v.value=null,u.value=[],d.value=void 0,h.value=[],f.value=null;try{const p=await r(n.repoId,n.commitSha,n.repoPath);u.value=p,p.length>0&&(d.value=p[0].path)}catch(p){v.value=y(p,"Could not load commit diff.")}}async function m(){if(!d.value){h.value=[],f.value=null;return}b.value=null;try{const p=await i(n.repoId,n.commitSha,d.value,n.repoPath);if(h.value=p,_.value==="full"){const k=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=k}else f.value=null}catch(p){b.value=y(p,"Could not load file diff.")}}function M(){_.value=_.value==="changes"?"full":"changes"}_e(_,async p=>{if(p==="full"&&d.value&&!f.value)try{const k=await s(n.repoId,n.commitSha,d.value,n.repoPath);f.value=k,b.value=null}catch(k){b.value=y(k,"Could not load file content.")}});function z(p){d.value=p}function L(){g()}function F(){m()}_e(d,()=>{m()}),_e(()=>[n.repoId,n.commitSha,n.repoPath],()=>{g()},{immediate:!0});const Z=ce(null),O=ce(null);function A(p){if(u.value.length===0)return;const k=d.value?u.value.findIndex(D=>D.path===d.value):-1;let w;p==="next"?w=k<u.value.length-1?k+1:0:w=k>0?k-1:u.value.length-1;const N=u.value[w];N&&(d.value=N.path)}function S(p){if(!O.value)return;const k=O.value.querySelectorAll(".diff-separator");if(k.length===0)return;const w=O.value.closest(".overflow-y-auto, [data-radix-scroll-area-viewport]");if(!w)return;const N=w.scrollTop,D=w.getBoundingClientRect();let q=null;if(p==="next"){for(const V of k)if(V.getBoundingClientRect().top-D.top+N>N+50){q=V;break}!q&&k.length>0&&(q=k[0])}else{for(let V=k.length-1;V>=0;V--){const G=k[V];if(G.getBoundingClientRect().top-D.top+N<N-10){q=G;break}}!q&&k.length>0&&(q=k[k.length-1])}q&&q.scrollIntoView({behavior:"smooth",block:"start"})}function $(p){if(!(p.target instanceof HTMLInputElement||p.target instanceof HTMLTextAreaElement))switch(p.key){case"j":case"ArrowDown":!p.ctrlKey&&!p.metaKey&&(p.preventDefault(),A("next"));break;case"k":case"ArrowUp":!p.ctrlKey&&!p.metaKey&&(p.preventDefault(),A("prev"));break;case"[":p.preventDefault(),S("prev");break;case"]":p.preventDefault(),S("next");break;case"Escape":p.preventDefault(),o("close");break}}return je(()=>{document.addEventListener("keydown",$)}),Wi(()=>{document.removeEventListener("keydown",$)}),(p,k)=>{const w=Ry,N=m0;return j(),ee("div",{ref_key:"panelRef",ref:Z,class:"flex h-full flex-col overflow-hidden",tabindex:"-1"},[C(v)?(j(),ee("div",b0,[oe(C(Yn),{class:"size-12 text-destructive"}),K("div",E0,[k[0]||(k[0]=K("p",{class:"font-medium"},"Failed to load diff",-1)),K("p",k0,he(C(v)),1)]),oe(C(bt),{variant:"outline",size:"sm",onClick:L},{default:fe(()=>[oe(C(Pr),{class:"mr-2 size-4"}),k[1]||(k[1]=Se(" Retry ",-1))]),_:1})])):C(a)&&C(u).length===0?(j(),ee("div",S0,[oe(C(qo),{class:"size-8 animate-spin text-muted-foreground"})])):C(u).length===0?(j(),ee("div",C0,[...k[2]||(k[2]=[K("p",null,"No files changed in this commit",-1)])])):(j(),ee("div",N0,[K("div",$0,[K("div",M0,[K("span",T0,he(C(u).length)+" file"+he(C(u).length!==1?"s":"")+" changed ",1),oe(C(Vi),null,{default:fe(()=>[oe(C(Li),null,{default:fe(()=>[oe(C(Fi),{"as-child":""},{default:fe(()=>[K("button",O0,[oe(C(tl),{class:"size-3.5"})])]),_:1}),oe(C(Ri),{side:"bottom",align:"end",class:"max-w-xs"},{default:fe(()=>[...k[3]||(k[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",P0,[oe(w,{files:C(u),"selected-file":C(d),onSelect:z},null,8,["files","selected-file"])])]),K("div",I0,[C(d)?(j(),ee("div",D0,[C(x)?.oldPath?(j(),ee("span",A0,[K("span",z0,he(C(x).oldPath),1),k[4]||(k[4]=K("span",{class:"mx-2 text-muted-foreground"},"→",-1)),K("span",null,he(C(d)),1)])):(j(),ee("span",B0,he(C(d)),1)),C(x)?.binary?(j(),ee("span",L0," binary ")):ge("",!0),C(x)?.binary?ge("",!0):(j(),we(C(Vi),{key:3},{default:fe(()=>[oe(C(Li),null,{default:fe(()=>[oe(C(Fi),{"as-child":""},{default:fe(()=>[oe(C(bt),{variant:"ghost",size:"sm",class:"h-7 shrink-0 gap-1.5 text-xs",onClick:M},{default:fe(()=>[(j(),we(qe(C(_)==="changes"?C(xl):C(_l)),{class:"size-3.5"})),Se(" "+he(C(_)==="changes"?"Changes":"Full file"),1)]),_:1})]),_:1}),oe(C(Ri),null,{default:fe(()=>[Se(he(C(_)==="changes"?"Show full file with changes":"Show changes only"),1)]),_:1})]),_:1})]),_:1}))])):ge("",!0),C(l)?(j(),ee("div",R0,[oe(C(qo),{class:"size-6 animate-spin text-muted-foreground"})])):C(b)?(j(),ee("div",V0,[oe(C(Yn),{class:"size-8 text-destructive"}),K("div",F0,[k[5]||(k[5]=K("p",{class:"text-sm font-medium"},"Failed to load file diff",-1)),K("p",H0,he(C(b)),1)]),oe(C(bt),{variant:"outline",size:"sm",onClick:F},{default:fe(()=>[oe(C(Pr),{class:"mr-2 size-4"}),k[6]||(k[6]=Se(" Retry ",-1))]),_:1})])):C(d)?(j(),we(C(nl),{key:3,class:"h-0 flex-1 overflow-hidden"},{default:fe(()=>[K("div",{ref_key:"diffViewerRef",ref:O},[oe(N,{hunks:C(h),"file-path":C(d),binary:C(x)?.binary,"old-path":C(x)?.oldPath,"file-content":C(f),"show-full-file":C(_)==="full","is-loading-content":C(c)},null,8,["hunks","file-path","binary","old-path","file-content","show-full-file","is-loading-content"])],512)]),_:1})):(j(),ee("div",q0," Select a file to view changes "))])]))],512)}}}),j0=Object.assign(G0,{__name:"GitDiffPanel"}),Y0={class:"space-y-2"},W0={key:1,class:"rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground"},X0=["onClick"],U0={class:"flex items-start gap-3"},K0={class:"min-w-0 flex-1"},Z0={class:"flex flex-wrap items-center gap-2"},J0={class:"font-mono text-xs font-medium text-primary"},Q0={class:"flex items-center gap-1 text-xs text-muted-foreground"},ew={class:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400"},tw={class:"flex items-center gap-0.5 text-xs text-red-600 dark:text-red-400"},nw={class:"mt-1 truncate text-sm"},ow={key:1,class:"flex items-center gap-1 text-muted-foreground"},rw={key:2,class:"text-muted-foreground"},iw={key:0,class:"mt-1 text-xs text-muted-foreground"},sw=ve({__name:"CommitList",props:{commits:{},repoId:{}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{fetchCommits:r,isLoadingCommits:i}=_a(),s=ce(new Map),a=ce(new Set);function l(y){return y.trim().toLowerCase()}function c(y){return(y||"").trim()}function u(y,x){return`${c(x)}::${l(y)}`}function d(y,x){const g=l(y),m=l(x.sha),M=l(x.shortSha);return m===g||M===g||m.startsWith(g)||g.startsWith(m)||M.startsWith(g)||g.startsWith(M)}const h=ne(()=>new Set(n.commits.map(x=>x.repo).filter(Boolean)).size>1);_e(()=>({commits:n.commits,repoId:n.repoId}),async({commits:y,repoId:x})=>{if(y.length===0||!x){s.value=new Map,a.value=new Set;return}const g=new Map;for(const L of y){const F=L.repo||"";g.has(F)||g.set(F,[]),g.get(F).push(L.sha)}const m=await Promise.all(Array.from(g.entries()).map(async([L,F])=>{const Z=await r(x,F,L||void 0);return{repoPath:L,requestedShas:[...F],commits:Z.commits,failedShas:Z.failedShas}})),M=new Map,z=new Set;for(const{repoPath:L,requestedShas:F,commits:Z,failedShas:O}of m){const A=[...Z];for(const S of F){const $=u(S,L),p=A.findIndex(k=>d(S,k));if(p>=0){const[k]=A.splice(p,1);if(k){M.set($,{...k,repoPath:L});continue}}z.add($)}for(const S of O)z.add(u(S,L))}s.value=M,a.value=z},{immediate:!0});function f(y){const x=new Date(y),m=new Date().getTime()-x.getTime(),M=Math.floor(m/1e3),z=Math.floor(M/60),L=Math.floor(z/60),F=Math.floor(L/24);return M<60?"just now":z<60?`${z} minute${z===1?"":"s"} ago`:L<24?`${L} hour${L===1?"":"s"} ago`:F<7?`${F} day${F===1?"":"s"} ago`:x.toLocaleDateString()}function v(y){o("select",y.sha,y.repo)}function b(y){const x=s.value.get(u(y.sha,y.repo));if(x)return x;const g=l(y.sha),m=`${c(y.repo)}::`;for(const[M,z]of s.value){if(!M.startsWith(m))continue;const L=M.slice(m.length);if(L.startsWith(g)||g.startsWith(L))return z}}function _(y){const x=u(y.sha,y.repo);if(a.value.has(x))return!0;const g=l(y.sha),m=`${c(y.repo)}::`;for(const M of a.value){if(!M.startsWith(m))continue;const z=M.slice(m.length);if(z.startsWith(g)||g.startsWith(z))return!0}return!1}return(y,x)=>(j(),ee("div",Y0,[C(i)?(j(!0),ee(Me,{key:0},Ge(Math.min(e.commits.length,3),g=>(j(),ee("div",{key:g,class:"animate-pulse rounded-lg border bg-muted/50 p-3"},[...x[0]||(x[0]=[Ga('<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?(j(),ee("div",W0," No commits recorded for this task ")):(j(!0),ee(Me,{key:2},Ge(e.commits,g=>(j(),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=>v(g)},[K("div",U0,[oe(C(Nl),{class:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),K("div",K0,[K("div",Z0,[K("code",J0,he(b(g)?.shortSha||g.sha.substring(0,7)),1),b(g)?(j(),ee(Me,{key:0},[K("span",Q0,[oe(C(Pa),{class:"size-3"}),Se(" "+he(b(g).filesChanged),1)]),K("span",ew,[oe(C(ol),{class:"size-3"}),Se(he(b(g).additions),1)]),K("span",tw,[oe(C(Pl),{class:"size-3"}),Se(he(b(g).deletions),1)])],64)):ge("",!0),g.repo&&C(h)?(j(),we(C(Vn),{key:1,variant:"secondary",class:"gap-1 text-xs"},{default:fe(()=>[oe(C(Cl),{class:"size-3"}),Se(" "+he(g.repo),1)]),_:2},1024)):ge("",!0)]),K("p",nw,[b(g)?(j(),ee(Me,{key:0},[Se(he(b(g).message),1)],64)):_(g)?(j(),ee("span",ow,[oe(C(Yn),{class:"size-3"}),x[1]||(x[1]=Se(" Commit unavailable ",-1))])):(j(),ee("span",rw,"Loading..."))]),b(g)?(j(),ee("p",iw,he(b(g).author)+" · "+he(f(b(g).date)),1)):ge("",!0)])])],8,X0))),128))]))}}),aw=Object.assign(sw,{__name:"GitCommitList"}),lw=ve({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=qi(t,"class");return(o,r)=>(j(),we(C(rl),He({"data-slot":"separator"},C(n),{class:C(Gi)("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(lw,{__name:"UiSeparator"}),uw={class:"flex items-center gap-2"},cw={key:1,class:"min-h-0 flex-1 overflow-hidden"},dw={key:2,class:"min-h-0 flex-1 space-y-4 overflow-y-auto px-6"},fw={class:"flex flex-wrap items-center gap-2"},hw={class:"space-y-2"},pw={class:"text-sm text-muted-foreground leading-relaxed"},gw={key:0,class:"space-y-2"},vw={class:"flex items-center gap-2 text-sm font-medium"},mw={class:"ml-4 list-decimal space-y-1 text-sm text-muted-foreground"},yw={key:2,class:"space-y-2"},ww={class:"flex items-center gap-2 text-sm font-medium"},_w={class:"space-y-1.5 text-sm text-muted-foreground"},xw={key:4,class:"space-y-2"},bw={class:"flex items-center gap-2 text-sm font-medium"},Ew={class:"space-y-1 text-sm text-muted-foreground"},kw={class:"font-mono text-xs"},Sw={class:"space-y-2"},Cw={class:"flex items-center gap-2 text-sm font-medium"},Nw={key:6,class:"space-y-2"},$w={class:"flex flex-col gap-1 text-xs text-muted-foreground"},Mw={key:0,class:"flex items-center gap-2"},Tw={key:1,class:"flex items-center gap-2"},Ow={key:7,class:"space-y-2"},Pw={class:"flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm"},Iw={class:"text-muted-foreground"},Dw=ve({__name:"Detail",props:Ya({task:{},taskTitles:{},commits:{},repoId:{},taskPrdSlug:{},currentPrdSlug:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const t=e,n=ja(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:ml,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(_){if(!_)return"";try{return new Date(_).toLocaleString()}catch{return _}}function a(_){return t.taskTitles?.get(_)??_}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 _=new URLSearchParams({task:t.task.id,taskPrd:t.taskPrdSlug});return`/${t.repoId}/${t.taskPrdSlug}?${_.toString()}`}),d=ce("details"),h=ce(null),f=ce(null);function v(_,y){h.value=_,f.value=y||null,d.value="diff"}function b(){d.value="details",h.value=null,f.value=null}return _e(()=>t.task,()=>{d.value="details",h.value=null,f.value=null}),_e(n,_=>{_||(d.value="details",h.value=null,f.value=null)}),(_,y)=>{const x=j0,g=aw,m=pl;return j(),we(C(dl),{open:n.value,"onUpdate:open":y[0]||(y[0]=M=>n.value=M)},{default:fe(()=>[oe(C(cl),{class:Ae(["flex h-full w-full flex-col overflow-hidden sm:max-w-lg",C(d)==="diff"?"sm:!max-w-[94vw] xl:!max-w-[88vw]":""])},{default:fe(()=>[e.task?(j(),we(C(il),{key:0,class:"px-6 pr-12"},{default:fe(()=>[K("div",uw,[C(d)==="diff"?(j(),we(C(bt),{key:0,variant:"ghost",size:"icon",class:"size-8 shrink-0",onClick:b},{default:fe(()=>[oe(C(gl),{class:"size-4"})]),_:1})):ge("",!0),oe(C(sl),{class:"text-left text-lg"},{default:fe(()=>[Se(he(C(d)==="diff"?"Commit Changes":e.task.title),1)]),_:1})]),oe(C(al),{class:"sr-only"},{default:fe(()=>[...y[1]||(y[1]=[Se("Task details",-1)])]),_:1})]),_:1})):ge("",!0),e.task&&C(d)==="diff"&&C(h)&&e.repoId?(j(),ee("div",cw,[oe(x,{"repo-id":e.repoId,"commit-sha":C(h),"repo-path":C(f)||void 0,class:"h-full",onClose:b},null,8,["repo-id","commit-sha","repo-path"])])):e.task?(j(),ee("div",dw,[K("div",fw,[oe(C(Vn),{variant:C(o).variant},{default:fe(()=>[oe(C(Dl),{class:"mr-1 size-3"}),Se(" "+he(C(o).label),1)]),_:1},8,["variant"]),oe(C(Vn),{variant:"outline",class:Ae(C(r).class)},{default:fe(()=>[oe(C(Xt),{class:"mr-1 size-3"}),Se(" "+he(C(r).label),1)]),_:1},8,["class"]),oe(C(Vn),{variant:"outline",class:Ae(C(i).class)},{default:fe(()=>[(j(),we(qe(C(i).icon),{class:"mr-1 size-3"})),Se(" "+he(C(i).label),1)]),_:1},8,["class"])]),K("div",hw,[y[2]||(y[2]=K("h4",{class:"text-sm font-medium"},"Description",-1)),K("p",pw,he(e.task.description),1)]),oe(C(Vt)),e.task.steps.length>0?(j(),ee("div",gw,[K("h4",vw,[oe(C(Ol),{class:"size-4"}),y[3]||(y[3]=Se(" Steps ",-1))]),K("ol",mw,[(j(!0),ee(Me,null,Ge(e.task.steps,(M,z)=>(j(),ee("li",{key:z,class:"pl-1"},he(M),1))),128))])])):ge("",!0),e.task.steps.length>0&&e.task.passes.length>0?(j(),we(C(Vt),{key:1})):ge("",!0),e.task.passes.length>0?(j(),ee("div",yw,[K("h4",ww,[oe(C(Il),{class:"size-4"}),y[4]||(y[4]=Se(" Pass Criteria ",-1))]),K("ul",_w,[(j(!0),ee(Me,null,Ge(e.task.passes,(M,z)=>(j(),ee("li",{key:z,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"?(j(),we(C(fl),{key:0,class:"size-3"})):ge("",!0)],2),K("span",null,he(M),1)]))),128))])])):ge("",!0),e.task.dependencies.length>0?(j(),we(C(Vt),{key:3})):ge("",!0),e.task.dependencies.length>0?(j(),ee("div",xw,[K("h4",bw,[oe(C(Ml),{class:"size-4"}),y[5]||(y[5]=Se(" Dependencies ",-1))]),K("ul",Ew,[(j(!0),ee(Me,null,Ge(e.task.dependencies,M=>(j(),ee("li",{key:M,class:"flex items-center gap-2"},[K("span",kw,he(M),1),K("span",null,he(a(M)),1)]))),128))])])):ge("",!0),C(l)?(j(),ee(Me,{key:5},[oe(C(Vt)),K("div",Sw,[K("h4",Cw,[oe(C(yl),{class:"size-4"}),y[6]||(y[6]=Se(" Changes ",-1))]),oe(g,{commits:e.commits,"repo-id":e.repoId,onSelect:v},null,8,["commits","repo-id"])])],64)):ge("",!0),e.task.startedAt||e.task.completedAt?(j(),ee("div",Nw,[oe(C(Vt)),K("div",$w,[e.task.startedAt?(j(),ee("div",Mw,[oe(C(vl),{class:"size-3"}),K("span",null,"Started: "+he(s(e.task.startedAt)),1)])):ge("",!0),e.task.completedAt?(j(),ee("div",Tw,[oe(C(Wn),{class:"size-3"}),K("span",null,"Completed: "+he(s(e.task.completedAt)),1)])):ge("",!0)])])):ge("",!0),C(c)?(j(),ee("div",Ow,[oe(C(Vt)),K("div",Pw,[K("span",Iw,"This task belongs to "+he(e.taskPrdSlug)+".",1),oe(m,{to:C(u)},{default:fe(()=>[oe(C(bt),{variant:"outline",size:"sm",class:"h-8"},{default:fe(()=>[oe(C(wl),{class:"mr-1.5 size-3.5"}),y[7]||(y[7]=Se(" Open PRD ",-1))]),_:1})]),_:1},8,["to"])])])):ge("",!0)])):ge("",!0),oe(C(ll),{class:"px-6 pb-6"},{default:fe(()=>[oe(C(ul),{"as-child":""},{default:fe(()=>[oe(C(bt),{variant:"outline",class:"w-full"},{default:fe(()=>[...y[8]||(y[8]=[Se("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["class"])]),_:1},8,["open"])}}}),Hw=Object.assign(Dw,{__name:"TasksDetail"});export{vl as C,wl as E,Pl as M,Hw as _,fn as a,Wn as b,Fw as c};