orcaq 1.0.21 → 1.0.23

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 (211) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{CrgoNCm2.js → 0fpkWcbi.js} +2 -2
  3. package/.output/public/_nuxt/{DL3T5jYo.js → B6lwWVI5.js} +1 -1
  4. package/.output/public/_nuxt/BGEWnlhd.js +1 -0
  5. package/.output/public/_nuxt/BUePl0lK.js +1 -0
  6. package/.output/public/_nuxt/BWeOEh4Z.js +14 -0
  7. package/.output/public/_nuxt/BXECqniz.js +1 -0
  8. package/.output/public/_nuxt/BYa7Vkmx.js +1 -0
  9. package/.output/public/_nuxt/BeC_ewNB.js +47 -0
  10. package/.output/public/_nuxt/BeL_GfX-.js +39 -0
  11. package/.output/public/_nuxt/{CuBKbBH_.js → BkhEpKzy.js} +1 -1
  12. package/.output/public/_nuxt/{BH83_dXo.js → C26aAkUg.js} +1 -1
  13. package/.output/public/_nuxt/C81RYsqJ.js +26 -0
  14. package/.output/public/_nuxt/CFtLQlpa.js +1 -0
  15. package/.output/public/_nuxt/CHae0Jiv.js +1 -0
  16. package/.output/public/_nuxt/{9lJACZIQ.js → CJER2x4r.js} +1 -1
  17. package/.output/public/_nuxt/{ICwM1E4-.js → CYqdSIe6.js} +3 -3
  18. package/.output/public/_nuxt/CcN517Ci.js +1 -0
  19. package/.output/public/_nuxt/CfqyI4g1.js +4 -0
  20. package/.output/public/_nuxt/CnIhd9IM.js +9 -0
  21. package/.output/public/_nuxt/Co87DPdr.js +18 -0
  22. package/.output/public/_nuxt/{pAheHeBV.js → CouqeYue.js} +8 -8
  23. package/.output/public/_nuxt/Cv3wRRZy.js +31 -0
  24. package/.output/public/_nuxt/{DXV2HFBA.js → CvXDjqNF.js} +1 -1
  25. package/.output/public/_nuxt/D0LmHvgn.js +13 -0
  26. package/.output/public/_nuxt/{ivUnXl9B.js → D2Hot6Qz.js} +1 -1
  27. package/.output/public/_nuxt/D5XzVg8o.js +1 -0
  28. package/.output/public/_nuxt/{Bq3cyzOD.js → DCGzl5t1.js} +1 -1
  29. package/.output/public/_nuxt/DGE1UZv7.js +1 -0
  30. package/.output/public/_nuxt/{BNjPC06x.js → DNVnfTwM.js} +1 -1
  31. package/.output/public/_nuxt/DV-vuGJt.js +1 -0
  32. package/.output/public/_nuxt/DVwaLKvw.js +5 -0
  33. package/.output/public/_nuxt/{C2HlI1ss.js → DcIs4zDC.js} +1 -1
  34. package/.output/public/_nuxt/{Bh6RgYlO.js → DcoZ0u0V.js} +1 -1
  35. package/.output/public/_nuxt/Dduxqd2M.js +1 -0
  36. package/.output/public/_nuxt/DroUt-ok.js +1 -0
  37. package/.output/public/_nuxt/{D8vj6kFe.js → DyUmhpWC.js} +11 -11
  38. package/.output/public/_nuxt/JGp8ZHkv.js +257 -0
  39. package/.output/public/_nuxt/KoN09pZ5.js +1 -0
  40. package/.output/public/_nuxt/builds/latest.json +1 -1
  41. package/.output/public/_nuxt/builds/meta/bbd2d18d-c265-48d2-a51b-1d563b817934.json +1 -0
  42. package/.output/public/_nuxt/cX_8SODe.js +1 -0
  43. package/.output/public/_nuxt/entry.SsrkN9_U.css +1 -0
  44. package/.output/public/_nuxt/{C25Tmn1m.js → jEcGO2vg.js} +1 -1
  45. package/.output/public/_nuxt/vt077W6w.js +1 -0
  46. package/.output/public/_nuxt/yruHU3cQ.js +1 -0
  47. package/.output/public/_nuxt/zeVrAOTr.js +8 -0
  48. package/.output/server/chunks/build/client.manifest.mjs +305 -296
  49. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  50. package/.output/server/chunks/nitro/nitro.mjs +255 -241
  51. package/.output/server/node_modules/aws-ssl-profiles/lib/index.js +13 -0
  52. package/.output/server/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js +2888 -0
  53. package/.output/server/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js +111 -0
  54. package/.output/server/node_modules/aws-ssl-profiles/package.json +52 -0
  55. package/.output/server/node_modules/generate-function/index.js +181 -0
  56. package/.output/server/node_modules/generate-function/package.json +32 -0
  57. package/.output/server/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
  58. package/.output/server/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
  59. package/.output/server/node_modules/iconv-lite/encodings/index.js +23 -0
  60. package/.output/server/node_modules/iconv-lite/encodings/internal.js +198 -0
  61. package/.output/server/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  62. package/.output/server/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  63. package/.output/server/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
  64. package/.output/server/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  65. package/.output/server/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  66. package/.output/server/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  67. package/.output/server/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  68. package/.output/server/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  69. package/.output/server/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  70. package/.output/server/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  71. package/.output/server/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  72. package/.output/server/node_modules/iconv-lite/encodings/utf16.js +197 -0
  73. package/.output/server/node_modules/iconv-lite/encodings/utf32.js +319 -0
  74. package/.output/server/node_modules/iconv-lite/encodings/utf7.js +290 -0
  75. package/.output/server/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  76. package/.output/server/node_modules/iconv-lite/lib/index.js +180 -0
  77. package/.output/server/node_modules/iconv-lite/lib/streams.js +109 -0
  78. package/.output/server/node_modules/iconv-lite/package.json +44 -0
  79. package/.output/server/node_modules/is-property/is-property.js +5 -0
  80. package/.output/server/node_modules/is-property/package.json +36 -0
  81. package/.output/server/node_modules/long/package.json +58 -0
  82. package/.output/server/node_modules/long/umd/index.js +1622 -0
  83. package/.output/server/node_modules/long/umd/package.json +3 -0
  84. package/.output/server/node_modules/lru.min/lib/index.js +231 -0
  85. package/.output/server/node_modules/lru.min/package.json +87 -0
  86. package/.output/server/node_modules/mysql2/index.js +77 -0
  87. package/.output/server/node_modules/mysql2/lib/auth_41.js +95 -0
  88. package/.output/server/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js +108 -0
  89. package/.output/server/node_modules/mysql2/lib/auth_plugins/index.js +8 -0
  90. package/.output/server/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js +17 -0
  91. package/.output/server/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js +34 -0
  92. package/.output/server/node_modules/mysql2/lib/auth_plugins/sha256_password.js +68 -0
  93. package/.output/server/node_modules/mysql2/lib/base/connection.js +978 -0
  94. package/.output/server/node_modules/mysql2/lib/base/pool.js +237 -0
  95. package/.output/server/node_modules/mysql2/lib/base/pool_connection.js +70 -0
  96. package/.output/server/node_modules/mysql2/lib/commands/auth_switch.js +111 -0
  97. package/.output/server/node_modules/mysql2/lib/commands/binlog_dump.js +109 -0
  98. package/.output/server/node_modules/mysql2/lib/commands/change_user.js +68 -0
  99. package/.output/server/node_modules/mysql2/lib/commands/client_handshake.js +241 -0
  100. package/.output/server/node_modules/mysql2/lib/commands/close_statement.js +18 -0
  101. package/.output/server/node_modules/mysql2/lib/commands/command.js +54 -0
  102. package/.output/server/node_modules/mysql2/lib/commands/execute.js +112 -0
  103. package/.output/server/node_modules/mysql2/lib/commands/index.js +27 -0
  104. package/.output/server/node_modules/mysql2/lib/commands/ping.js +36 -0
  105. package/.output/server/node_modules/mysql2/lib/commands/prepare.js +143 -0
  106. package/.output/server/node_modules/mysql2/lib/commands/query.js +366 -0
  107. package/.output/server/node_modules/mysql2/lib/commands/quit.js +29 -0
  108. package/.output/server/node_modules/mysql2/lib/commands/register_slave.js +27 -0
  109. package/.output/server/node_modules/mysql2/lib/commands/server_handshake.js +203 -0
  110. package/.output/server/node_modules/mysql2/lib/compressed_protocol.js +127 -0
  111. package/.output/server/node_modules/mysql2/lib/connection.js +12 -0
  112. package/.output/server/node_modules/mysql2/lib/connection_config.js +294 -0
  113. package/.output/server/node_modules/mysql2/lib/constants/charset_encodings.js +316 -0
  114. package/.output/server/node_modules/mysql2/lib/constants/charsets.js +317 -0
  115. package/.output/server/node_modules/mysql2/lib/constants/client.js +39 -0
  116. package/.output/server/node_modules/mysql2/lib/constants/commands.js +36 -0
  117. package/.output/server/node_modules/mysql2/lib/constants/cursor.js +8 -0
  118. package/.output/server/node_modules/mysql2/lib/constants/encoding_charset.js +50 -0
  119. package/.output/server/node_modules/mysql2/lib/constants/errors.js +3973 -0
  120. package/.output/server/node_modules/mysql2/lib/constants/field_flags.js +20 -0
  121. package/.output/server/node_modules/mysql2/lib/constants/server_status.js +44 -0
  122. package/.output/server/node_modules/mysql2/lib/constants/session_track.js +11 -0
  123. package/.output/server/node_modules/mysql2/lib/constants/ssl_profiles.js +11 -0
  124. package/.output/server/node_modules/mysql2/lib/constants/types.js +64 -0
  125. package/.output/server/node_modules/mysql2/lib/create_connection.js +10 -0
  126. package/.output/server/node_modules/mysql2/lib/create_pool.js +10 -0
  127. package/.output/server/node_modules/mysql2/lib/create_pool_cluster.js +9 -0
  128. package/.output/server/node_modules/mysql2/lib/helpers.js +86 -0
  129. package/.output/server/node_modules/mysql2/lib/packet_parser.js +195 -0
  130. package/.output/server/node_modules/mysql2/lib/packets/auth_next_factor.js +35 -0
  131. package/.output/server/node_modules/mysql2/lib/packets/auth_switch_request.js +38 -0
  132. package/.output/server/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js +33 -0
  133. package/.output/server/node_modules/mysql2/lib/packets/auth_switch_response.js +30 -0
  134. package/.output/server/node_modules/mysql2/lib/packets/binary_row.js +95 -0
  135. package/.output/server/node_modules/mysql2/lib/packets/binlog_dump.js +33 -0
  136. package/.output/server/node_modules/mysql2/lib/packets/binlog_query_statusvars.js +115 -0
  137. package/.output/server/node_modules/mysql2/lib/packets/change_user.js +97 -0
  138. package/.output/server/node_modules/mysql2/lib/packets/close_statement.js +21 -0
  139. package/.output/server/node_modules/mysql2/lib/packets/column_definition.js +291 -0
  140. package/.output/server/node_modules/mysql2/lib/packets/execute.js +214 -0
  141. package/.output/server/node_modules/mysql2/lib/packets/handshake.js +112 -0
  142. package/.output/server/node_modules/mysql2/lib/packets/handshake_response.js +144 -0
  143. package/.output/server/node_modules/mysql2/lib/packets/index.js +152 -0
  144. package/.output/server/node_modules/mysql2/lib/packets/packet.js +931 -0
  145. package/.output/server/node_modules/mysql2/lib/packets/prepare_statement.js +27 -0
  146. package/.output/server/node_modules/mysql2/lib/packets/prepared_statement_header.js +16 -0
  147. package/.output/server/node_modules/mysql2/lib/packets/query.js +27 -0
  148. package/.output/server/node_modules/mysql2/lib/packets/register_slave.js +46 -0
  149. package/.output/server/node_modules/mysql2/lib/packets/resultset_header.js +124 -0
  150. package/.output/server/node_modules/mysql2/lib/packets/ssl_request.js +25 -0
  151. package/.output/server/node_modules/mysql2/lib/packets/text_row.js +47 -0
  152. package/.output/server/node_modules/mysql2/lib/parsers/binary_parser.js +235 -0
  153. package/.output/server/node_modules/mysql2/lib/parsers/parser_cache.js +68 -0
  154. package/.output/server/node_modules/mysql2/lib/parsers/static_binary_parser.js +213 -0
  155. package/.output/server/node_modules/mysql2/lib/parsers/static_text_parser.js +152 -0
  156. package/.output/server/node_modules/mysql2/lib/parsers/string.js +50 -0
  157. package/.output/server/node_modules/mysql2/lib/parsers/text_parser.js +214 -0
  158. package/.output/server/node_modules/mysql2/lib/pool.js +12 -0
  159. package/.output/server/node_modules/mysql2/lib/pool_cluster.js +369 -0
  160. package/.output/server/node_modules/mysql2/lib/pool_config.js +30 -0
  161. package/.output/server/node_modules/mysql2/lib/pool_connection.js +12 -0
  162. package/.output/server/node_modules/mysql2/lib/promise/connection.js +222 -0
  163. package/.output/server/node_modules/mysql2/lib/promise/inherit_events.js +27 -0
  164. package/.output/server/node_modules/mysql2/lib/promise/make_done_cb.js +19 -0
  165. package/.output/server/node_modules/mysql2/lib/promise/pool.js +112 -0
  166. package/.output/server/node_modules/mysql2/lib/promise/pool_cluster.js +54 -0
  167. package/.output/server/node_modules/mysql2/lib/promise/pool_connection.js +19 -0
  168. package/.output/server/node_modules/mysql2/lib/promise/prepared_statement_info.js +32 -0
  169. package/.output/server/node_modules/mysql2/lib/server.js +37 -0
  170. package/.output/server/node_modules/mysql2/package.json +80 -0
  171. package/.output/server/node_modules/mysql2/promise.js +202 -0
  172. package/.output/server/node_modules/named-placeholders/index.js +179 -0
  173. package/.output/server/node_modules/named-placeholders/package.json +36 -0
  174. package/.output/server/node_modules/safer-buffer/package.json +34 -0
  175. package/.output/server/node_modules/safer-buffer/safer.js +77 -0
  176. package/.output/server/node_modules/seq-queue/index.js +1 -0
  177. package/.output/server/node_modules/seq-queue/lib/seq-queue.js +199 -0
  178. package/.output/server/node_modules/seq-queue/package.json +16 -0
  179. package/.output/server/node_modules/sqlstring/index.js +1 -0
  180. package/.output/server/node_modules/sqlstring/lib/SqlString.js +237 -0
  181. package/.output/server/node_modules/sqlstring/package.json +47 -0
  182. package/.output/server/package.json +12 -1
  183. package/package.json +1 -1
  184. package/.output/public/_nuxt/8qASMGdV.js +0 -1
  185. package/.output/public/_nuxt/B2DnNiWd.js +0 -1
  186. package/.output/public/_nuxt/BIKqrFbQ.js +0 -1
  187. package/.output/public/_nuxt/BPQ-Pz1w.js +0 -39
  188. package/.output/public/_nuxt/BRpgKkVT.js +0 -51
  189. package/.output/public/_nuxt/BTCLPbPY.js +0 -4
  190. package/.output/public/_nuxt/BUV-RarV.js +0 -1
  191. package/.output/public/_nuxt/Bt9sU68B.js +0 -9
  192. package/.output/public/_nuxt/BwpH2ZxJ.js +0 -1
  193. package/.output/public/_nuxt/CU3ZV9iV.js +0 -1
  194. package/.output/public/_nuxt/CbcyysXi.js +0 -1
  195. package/.output/public/_nuxt/CepyvMhE.js +0 -1
  196. package/.output/public/_nuxt/CulD8qYQ.js +0 -193
  197. package/.output/public/_nuxt/CylkLpwm.js +0 -1
  198. package/.output/public/_nuxt/D-bWLYHw.js +0 -1
  199. package/.output/public/_nuxt/D-zecHND.js +0 -1
  200. package/.output/public/_nuxt/DIETYtCL.js +0 -1
  201. package/.output/public/_nuxt/DJ4vUzxS.js +0 -1
  202. package/.output/public/_nuxt/DK-itzXx.js +0 -8
  203. package/.output/public/_nuxt/Dh2zppOR.js +0 -1
  204. package/.output/public/_nuxt/DlmSeCnw.js +0 -5
  205. package/.output/public/_nuxt/DswTpYG4.js +0 -1
  206. package/.output/public/_nuxt/G830WtVn.js +0 -1
  207. package/.output/public/_nuxt/QZbJy9YW.js +0 -31
  208. package/.output/public/_nuxt/UXhX8z2W.js +0 -1
  209. package/.output/public/_nuxt/builds/meta/03cede5c-c45c-41b3-ac1a-73756bb8cff0.json +0 -1
  210. package/.output/public/_nuxt/entry.GqPNPe1e.css +0 -1
  211. package/.output/public/_nuxt/s5fCn4j5.js +0 -1
@@ -0,0 +1,39 @@
1
+ import{d as fe,J as K,a as xe,o as X,w as ue,r as Te,m as Yt,b as C,P as Ba,n as Qn,g as Xo,ac as Ra,K as yi,br as Jr,a2 as Bt,bs as jr,az as be,f as he,bt as wi,M as le,O as ye,A as Me,U as Ie,aC as es,bu as Ha,G as q,aB as Se,N as He,ay as xn,aF as Va,bc as Fn,bv as Fa,bq as we,l as $t,W as ts,T as Re,X as ze,aI as La,V as Mt,j as it,aA as ns,bw as Ya,E as rt,C as Ga,bx as Xa,a4 as Pt,by as os,aD as _e,a5 as ve,bz as ln,bp as Ua,y as Wa,R as Ae,Y as lt,Z as ut,S as je,$ as ct,ak as Za,al as Ka,aa as qa,am as Qa,bA as Ja,aV as ja,Q as el,a6 as tl,b0 as nl,aM as ol}from"./JGp8ZHkv.js";/* empty css */import{c as il,a as rl,d as sl,b as _i,D as al,e as ll,R as un,f as is,H as Fi,g as Li,h as Ln,i as ul,j as cl,M as dl,k as fl,l as hl,m as gl,n as pl}from"./CfqyI4g1.js";import{_ as vl}from"./DlAUqK2U.js";import{u as ml}from"./DcIs4zDC.js";import{u as yl}from"./CFtLQlpa.js";const wl=fe({__name:"BaseSeparator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=e,n=["horizontal","vertical"];function o(a){return n.includes(a)}const i=K(()=>o(t.orientation)?t.orientation:"horizontal"),r=K(()=>i.value==="vertical"?t.orientation:void 0),s=K(()=>t.decorative?{role:"none"}:{"aria-orientation":r.value,role:"separator"});return(a,l)=>(X(),xe(C(Ba),Yt({as:a.as,"as-child":a.asChild,"data-orientation":i.value},s.value),{default:ue(()=>[Te(a.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),_l=fe({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,o)=>(X(),xe(wl,Qn(Xo(t)),{default:ue(()=>[Te(n.$slots,"default")]),_:3},16))}}),Yi=fe({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=Ra(t,"class");return(o,i)=>(X(),xe(C(_l),Yt({"data-slot":"separator-root"},C(n),{class:C(yi)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t.class)}),null,16,["class"]))}});function po(e){return Jr()?(Fn(e),!0):!1}function et(e){return typeof e=="function"?e():C(e)}const bl=typeof window<"u"&&typeof document<"u",$l=e=>typeof e<"u",xl=Object.prototype.toString,El=e=>xl.call(e)==="[object Object]",Sl=()=>{};function Nl(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const rs=e=>e();function Cl(e=rs){const t=he(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:Ua(t),pause:n,resume:o,eventFilter:i}}function Gi(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function kl(e,t,n={}){const{eventFilter:o=rs,...i}=n;return be(e,Nl(o,t),i)}function Rt(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:s,resume:a,isActive:l}=Cl(o);return{stop:kl(e,t,{...i,eventFilter:r}),pause:s,resume:a,isActive:l}}function Ml(e,t={}){if(!rt(e))return Ga(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Xa(()=>({get(){return e.value[o]},set(i){var r;if((r=et(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a={...e.value,[o]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function Uo(e,t=!1){function n(d,{flush:h="sync",deep:g=!1,timeout:x,throwOnTimeout:m}={}){let E=null;const k=[new Promise(b=>{E=be(e,A=>{d(A)!==t&&(E==null||E(),b(A))},{flush:h,deep:g,immediate:!0})})];return x!=null&&k.push(Gi(x,m).then(()=>et(e)).finally(()=>E==null?void 0:E())),Promise.race(k)}function o(d,h){if(!rt(d))return n(A=>A===d,h);const{flush:g="sync",deep:x=!1,timeout:m,throwOnTimeout:E}=h??{};let w=null;const b=[new Promise(A=>{w=be([e,d],([D,O])=>{t!==(D===O)&&(w==null||w(),A(D))},{flush:g,deep:x,immediate:!0})})];return m!=null&&b.push(Gi(m,E).then(()=>et(e)).finally(()=>(w==null||w(),et(e)))),Promise.race(b)}function i(d){return n(h=>!!h,d)}function r(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(g=>{const x=Array.from(g);return x.includes(d)||x.includes(et(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let g=-1;return n(()=>(g+=1,g>=d),h)}return Array.isArray(et(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Uo(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return Uo(e,!t)}}}function Wo(e){return Uo(e)}function Il(e){var t;const n=et(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ss=bl?window:void 0;function as(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ss):[t,n,o,i]=e,!t)return Sl;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,d,h,g)=>(c.addEventListener(d,h,g),()=>c.removeEventListener(d,h,g)),l=be(()=>[Il(t),et(i)],([c,d])=>{if(s(),!c)return;const h=El(d)?{...d}:d;r.push(...n.flatMap(g=>o.map(x=>a(c,g,x,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return po(u),u}function Tl(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Xi(...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:i=ss,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,l=Tl(t);return as(i,r,c=>{c.repeat&&et(a)||l(c)&&n(c)},s)}function Al(e){return JSON.parse(JSON.stringify(e))}function Io(e,t,n,o={}){var i,r,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,g=xn(),x=n||(g==null?void 0:g.emit)||((i=g==null?void 0:g.$emit)==null?void 0:i.bind(g))||((s=(r=g==null?void 0:g.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(g==null?void 0:g.proxy));let m=u;t||(t="modelValue"),m=m||`update:${t.toString()}`;const E=b=>a?typeof a=="function"?a(b):Al(b):b,w=()=>$l(e[t])?E(e[t]):d,k=b=>{h?h(b)&&x(m,b):x(m,b)};if(l){const b=w(),A=he(b);let D=!1;return be(()=>e[t],O=>{D||(D=!0,A.value=E(O),it(()=>D=!1))}),be(A,O=>{!D&&(O!==e[t]||c)&&k(O)},{deep:c}),A}else return K({get(){return w()},set(b){k(b)}})}var Pl={value:()=>{}};function vo(){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 Yn(n)}function Yn(e){this._=e}function Dl(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Yn.prototype=vo.prototype={constructor:Yn,on:function(e,t){var n=this._,o=Dl(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=zl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Ui(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ui(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Yn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[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],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function zl(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Ui(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Pl,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 Wi={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 mo(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Wi.hasOwnProperty(t)?{space:Wi[t],local:e}:e}function Ol(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 Bl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ls(e){var t=mo(e);return(t.local?Bl:Ol)(t)}function Rl(){}function bi(e){return e==null?Rl:function(){return this.querySelector(e)}}function Hl(e){typeof e!="function"&&(e=bi(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Oe(o,this._parents)}function Vl(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Fl(){return[]}function us(e){return e==null?Fl:function(){return this.querySelectorAll(e)}}function Ll(e){return function(){return Vl(e.apply(this,arguments))}}function Yl(e){typeof e=="function"?e=Ll(e):e=us(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Oe(o,i)}function cs(e){return function(){return this.matches(e)}}function ds(e){return function(t){return t.matches(e)}}var Gl=Array.prototype.find;function Xl(e){return function(){return Gl.call(this.children,e)}}function Ul(){return this.firstElementChild}function Wl(e){return this.select(e==null?Ul:Xl(typeof e=="function"?e:ds(e)))}var Zl=Array.prototype.filter;function Kl(){return Array.from(this.children)}function ql(e){return function(){return Zl.call(this.children,e)}}function Ql(e){return this.selectAll(e==null?Kl:ql(typeof e=="function"?e:ds(e)))}function Jl(e){typeof e!="function"&&(e=cs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Oe(o,this._parents)}function fs(e){return new Array(e.length)}function jl(){return new Oe(this._enter||this._groups.map(fs),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 eu(e){return function(){return e}}function tu(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new Jn(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function nu(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,h=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new Jn(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function ou(e){return e.__data__}function iu(e,t){if(!arguments.length)return Array.from(this,ou);var n=t?nu:tu,o=this._parents,i=this._groups;typeof e!="function"&&(e=eu(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,g=ru(e.call(c,c&&c.__data__,u,o)),x=g.length,m=a[u]=new Array(x),E=s[u]=new Array(x),w=l[u]=new Array(h);n(c,d,m,E,w,g,t);for(var k=0,b=0,A,D;k<x;++k)if(A=m[k]){for(k>=b&&(b=k+1);!(D=E[b])&&++b<x;);A._next=D||null}}return s=new Oe(s,o),s._enter=a,s._exit=l,s}function ru(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function su(){return new Oe(this._exit||this._groups.map(fs),this._parents)}function au(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function lu(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),g,x=0;x<d;++x)(g=u[x]||c[x])&&(h[x]=g);for(;l<i;++l)a[l]=n[l];return new Oe(a,this._parents)}function uu(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function cu(e){e||(e=du);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Oe(i,this._parents).order()}function du(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function fu(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hu(){return Array.from(this)}function gu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function pu(){let e=0;for(const t of this)++e;return e}function vu(){return!this.node()}function mu(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function yu(e){return function(){this.removeAttribute(e)}}function wu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _u(e,t){return function(){this.setAttribute(e,t)}}function bu(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function $u(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xu(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 Eu(e,t){var n=mo(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?wu:yu:typeof t=="function"?n.local?xu:$u:n.local?bu:_u)(n,t))}function hs(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Su(e){return function(){this.style.removeProperty(e)}}function Nu(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Cu(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function ku(e,t,n){return arguments.length>1?this.each((t==null?Su:typeof t=="function"?Cu:Nu)(e,t,n??"")):Gt(this.node(),e)}function Gt(e,t){return e.style.getPropertyValue(t)||hs(e).getComputedStyle(e,null).getPropertyValue(t)}function Mu(e){return function(){delete this[e]}}function Iu(e,t){return function(){this[e]=t}}function Tu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Au(e,t){return arguments.length>1?this.each((t==null?Mu:typeof t=="function"?Tu:Iu)(e,t)):this.node()[e]}function gs(e){return e.trim().split(/^|\s+/)}function $i(e){return e.classList||new ps(e)}function ps(e){this._node=e,this._names=gs(e.getAttribute("class")||"")}ps.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 vs(e,t){for(var n=$i(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function ms(e,t){for(var n=$i(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Pu(e){return function(){vs(this,e)}}function Du(e){return function(){ms(this,e)}}function zu(e,t){return function(){(t.apply(this,arguments)?vs:ms)(this,e)}}function Ou(e,t){var n=gs(e+"");if(arguments.length<2){for(var o=$i(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?zu:t?Pu:Du)(n,t))}function Bu(){this.textContent=""}function Ru(e){return function(){this.textContent=e}}function Hu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Vu(e){return arguments.length?this.each(e==null?Bu:(typeof e=="function"?Hu:Ru)(e)):this.node().textContent}function Fu(){this.innerHTML=""}function Lu(e){return function(){this.innerHTML=e}}function Yu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Gu(e){return arguments.length?this.each(e==null?Fu:(typeof e=="function"?Yu:Lu)(e)):this.node().innerHTML}function Xu(){this.nextSibling&&this.parentNode.appendChild(this)}function Uu(){return this.each(Xu)}function Wu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zu(){return this.each(Wu)}function Ku(e){var t=typeof e=="function"?e:ls(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qu(){return null}function Qu(e,t){var n=typeof e=="function"?e:ls(e),o=t==null?qu:typeof t=="function"?t:bi(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Ju(){var e=this.parentNode;e&&e.removeChild(this)}function ju(){return this.each(Ju)}function ec(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nc(e){return this.select(e?tc:ec)}function oc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ic(e){return function(t){e.call(this,t,this.__data__)}}function rc(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 sc(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function ac(e,t,n){return function(){var o=this.__on,i,r=ic(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function lc(e,t,n){var o=rc(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?ac:sc,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function ys(e,t,n){var o=hs(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function uc(e,t){return function(){return ys(this,e,t)}}function cc(e,t){return function(){return ys(this,e,t.apply(this,arguments))}}function dc(e,t){return this.each((typeof t=="function"?cc:uc)(e,t))}function*fc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var ws=[null];function Oe(e,t){this._groups=e,this._parents=t}function En(){return new Oe([[document.documentElement]],ws)}function hc(){return this}Oe.prototype=En.prototype={constructor:Oe,select:Hl,selectAll:Yl,selectChild:Wl,selectChildren:Ql,filter:Jl,data:iu,enter:jl,exit:su,join:au,merge:lu,selection:hc,order:uu,sort:cu,call:fu,nodes:hu,node:gu,size:pu,empty:vu,each:mu,attr:Eu,style:ku,property:Au,classed:Ou,text:Vu,html:Gu,raise:Uu,lower:Zu,append:Ku,insert:Qu,remove:ju,clone:nc,datum:oc,on:lc,dispatch:dc,[Symbol.iterator]:fc};function Ve(e){return typeof e=="string"?new Oe([[document.querySelector(e)]],[document.documentElement]):new Oe([[e]],ws)}function gc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ue(e,t){if(e=gc(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const pc={passive:!1},fn={capture:!0,passive:!1};function To(e){e.stopImmediatePropagation()}function Ht(e){e.preventDefault(),e.stopImmediatePropagation()}function _s(e){var t=e.document.documentElement,n=Ve(e).on("dragstart.drag",Ht,fn);"onselectstart"in t?n.on("selectstart.drag",Ht,fn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function bs(e,t){var n=e.document.documentElement,o=Ve(e).on("dragstart.drag",null);t&&(o.on("click.drag",Ht,fn),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 Mn=e=>()=>e;function Ko(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:a,dx:l,dy:u,dispatch:c}){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:i,enumerable:!0,configurable:!0},active:{value:r,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:u,enumerable:!0,configurable:!0},_:{value:c}})}Ko.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vc(e){return!e.ctrlKey&&!e.button}function mc(){return this.parentNode}function yc(e,t){return t??{x:e.x,y:e.y}}function wc(){return navigator.maxTouchPoints||"ontouchstart"in this}function _c(){var e=vc,t=mc,n=yc,o=wc,i={},r=vo("start","drag","end"),s=0,a,l,u,c,d=0;function h(A){A.on("mousedown.drag",g).filter(o).on("touchstart.drag",E).on("touchmove.drag",w,pc).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(A,D){if(!(c||!e.call(this,A,D))){var O=b(this,t.call(this,A,D),A,D,"mouse");O&&(Ve(A.view).on("mousemove.drag",x,fn).on("mouseup.drag",m,fn),_s(A.view),To(A),u=!1,a=A.clientX,l=A.clientY,O("start",A))}}function x(A){if(Ht(A),!u){var D=A.clientX-a,O=A.clientY-l;u=D*D+O*O>d}i.mouse("drag",A)}function m(A){Ve(A.view).on("mousemove.drag mouseup.drag",null),bs(A.view,u),Ht(A),i.mouse("end",A)}function E(A,D){if(e.call(this,A,D)){var O=A.changedTouches,z=t.call(this,A,D),H=O.length,G,F;for(G=0;G<H;++G)(F=b(this,z,A,D,O[G].identifier,O[G]))&&(To(A),F("start",A,O[G]))}}function w(A){var D=A.changedTouches,O=D.length,z,H;for(z=0;z<O;++z)(H=i[D[z].identifier])&&(Ht(A),H("drag",A,D[z]))}function k(A){var D=A.changedTouches,O=D.length,z,H;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),z=0;z<O;++z)(H=i[D[z].identifier])&&(To(A),H("end",A,D[z]))}function b(A,D,O,z,H,G){var F=r.copy(),L=Ue(G||O,D),M,Z,f;if((f=n.call(A,new Ko("beforestart",{sourceEvent:O,target:h,identifier:H,active:s,x:L[0],y:L[1],dx:0,dy:0,dispatch:F}),z))!=null)return M=f.x-L[0]||0,Z=f.y-L[1]||0,function N(p,I,S){var P=L,T;switch(p){case"start":i[H]=N,T=s++;break;case"end":delete i[H],--s;case"drag":L=Ue(S||I,D),T=s;break}F.call(p,A,new Ko(p,{sourceEvent:I,subject:f,target:h,identifier:H,active:T,x:L[0]+M,y:L[1]+Z,dx:L[0]-P[0],dy:L[1]-P[1],dispatch:F}),z)}}return h.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Mn(!!A),h):e},h.container=function(A){return arguments.length?(t=typeof A=="function"?A:Mn(A),h):t},h.subject=function(A){return arguments.length?(n=typeof A=="function"?A:Mn(A),h):n},h.touchable=function(A){return arguments.length?(o=typeof A=="function"?A:Mn(!!A),h):o},h.on=function(){var A=r.on.apply(r,arguments);return A===r?h:A},h.clickDistance=function(A){return arguments.length?(d=(A=+A)*A,h):Math.sqrt(d)},h}function xi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $s(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Sn(){}var hn=.7,jn=1/hn,Vt="\\s*([+-]?\\d+)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bc=/^#([0-9a-f]{3,8})$/,$c=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),xc=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),Ec=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${gn}\\)$`),Sc=new RegExp(`^rgba\\(${We},${We},${We},${gn}\\)$`),Nc=new RegExp(`^hsl\\(${gn},${We},${We}\\)$`),Cc=new RegExp(`^hsla\\(${gn},${We},${We},${gn}\\)$`),Zi={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};xi(Sn,pn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ki,formatHex:Ki,formatHex8:kc,formatHsl:Mc,formatRgb:qi,toString:qi});function Ki(){return this.rgb().formatHex()}function kc(){return this.rgb().formatHex8()}function Mc(){return xs(this).formatHsl()}function qi(){return this.rgb().formatRgb()}function pn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Qi(t):n===3?new Pe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?In(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?In(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=$c.exec(e))?new Pe(t[1],t[2],t[3],1):(t=xc.exec(e))?new Pe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ec.exec(e))?In(t[1],t[2],t[3],t[4]):(t=Sc.exec(e))?In(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Nc.exec(e))?er(t[1],t[2]/100,t[3]/100,1):(t=Cc.exec(e))?er(t[1],t[2]/100,t[3]/100,t[4]):Zi.hasOwnProperty(e)?Qi(Zi[e]):e==="transparent"?new Pe(NaN,NaN,NaN,0):null}function Qi(e){return new Pe(e>>16&255,e>>8&255,e&255,1)}function In(e,t,n,o){return o<=0&&(e=t=n=NaN),new Pe(e,t,n,o)}function Ic(e){return e instanceof Sn||(e=pn(e)),e?(e=e.rgb(),new Pe(e.r,e.g,e.b,e.opacity)):new Pe}function qo(e,t,n,o){return arguments.length===1?Ic(e):new Pe(e,t,n,o??1)}function Pe(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}xi(Pe,qo,$s(Sn,{brighter(e){return e=e==null?jn:Math.pow(jn,e),new Pe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?hn:Math.pow(hn,e),new Pe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pe(It(this.r),It(this.g),It(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:Ji,formatHex:Ji,formatHex8:Tc,formatRgb:ji,toString:ji}));function Ji(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}`}function Tc(){return`#${Ct(this.r)}${Ct(this.g)}${Ct(this.b)}${Ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function ji(){const e=eo(this.opacity);return`${e===1?"rgb(":"rgba("}${It(this.r)}, ${It(this.g)}, ${It(this.b)}${e===1?")":`, ${e})`}`}function eo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function It(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ct(e){return e=It(e),(e<16?"0":"")+e.toString(16)}function er(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fe(e,t,n,o)}function xs(e){if(e instanceof Fe)return new Fe(e.h,e.s,e.l,e.opacity);if(e instanceof Sn||(e=pn(e)),!e)return new Fe;if(e instanceof Fe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Fe(s,a,l,e.opacity)}function Ac(e,t,n,o){return arguments.length===1?xs(e):new Fe(e,t,n,o??1)}function Fe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}xi(Fe,Ac,$s(Sn,{brighter(e){return e=e==null?jn:Math.pow(jn,e),new Fe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?hn:Math.pow(hn,e),new Fe(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,i=2*n-o;return new Pe(Ao(e>=240?e-240:e+120,i,o),Ao(e,i,o),Ao(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Fe(tr(this.h),Tn(this.s),Tn(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("}${tr(this.h)}, ${Tn(this.s)*100}%, ${Tn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tr(e){return e=(e||0)%360,e<0?e+360:e}function Tn(e){return Math.max(0,Math.min(1,e||0))}function Ao(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 Es=e=>()=>e;function Pc(e,t){return function(n){return e+n*t}}function Dc(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 zc(e){return(e=+e)==1?Ss:function(t,n){return n-t?Dc(t,n,e):Es(isNaN(t)?n:t)}}function Ss(e,t){var n=t-e;return n?Pc(e,n):Es(isNaN(e)?t:e)}const nr=function e(t){var n=zc(t);function o(i,r){var s=n((i=qo(i)).r,(r=qo(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Ss(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function gt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Qo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Po=new RegExp(Qo.source,"g");function Oc(e){return function(){return e}}function Bc(e){return function(t){return e(t)+""}}function Rc(e,t){var n=Qo.lastIndex=Po.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Qo.exec(e))&&(i=Po.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:gt(o,i)})),n=Po.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?Bc(l[0].x):Oc(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var or=180/Math.PI,Jo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ns(e,t,n,o,i,r){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:i,translateY:r,rotate:Math.atan2(t,e)*or,skewX:Math.atan(l)*or,scaleX:s,scaleY:a}}var An;function Hc(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Jo:Ns(t.a,t.b,t.c,t.d,t.e,t.f)}function Vc(e){return e==null||(An||(An=document.createElementNS("http://www.w3.org/2000/svg","g")),An.setAttribute("transform",e),!(e=An.transform.baseVal.consolidate()))?Jo:(e=e.matrix,Ns(e.a,e.b,e.c,e.d,e.e,e.f))}function Cs(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,g,x){if(u!==d||c!==h){var m=g.push("translate(",null,t,null,n);x.push({i:m-4,x:gt(u,d)},{i:m-2,x:gt(c,h)})}else(d||h)&&g.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:gt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:gt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,g,x){if(u!==d||c!==h){var m=g.push(i(g)+"scale(",null,",",null,")");x.push({i:m-4,x:gt(u,d)},{i:m-2,x:gt(c,h)})}else(d!==1||h!==1)&&g.push(i(g)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(g){for(var x=-1,m=h.length,E;++x<m;)d[(E=h[x]).i]=E.x(g);return d.join("")}}}var Fc=Cs(Hc,"px, ","px)","deg)"),Lc=Cs(Vc,", ",")",")"),Yc=1e-12;function ir(e){return((e=Math.exp(e))+1/e)/2}function Gc(e){return((e=Math.exp(e))-1/e)/2}function Xc(e){return((e=Math.exp(2*e))-1)/(e+1)}const Uc=function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],h=s[2],g=c-a,x=d-l,m=g*g+x*x,E,w;if(m<Yc)w=Math.log(h/u)/t,E=function(z){return[a+z*g,l+z*x,u*Math.exp(t*z*w)]};else{var k=Math.sqrt(m),b=(h*h-u*u+o*m)/(2*u*n*k),A=(h*h-u*u-o*m)/(2*h*n*k),D=Math.log(Math.sqrt(b*b+1)-b),O=Math.log(Math.sqrt(A*A+1)-A);w=(O-D)/t,E=function(z){var H=z*w,G=ir(D),F=u/(n*k)*(G*Xc(t*H+D)-Gc(D));return[a+F*g,l+F*x,u*G/ir(t*H+D)]}}return E.duration=w*1e3*t/Math.SQRT2,E}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var Xt=0,nn=0,Jt=0,ks=1e3,to,on,no=0,Dt=0,yo=0,vn=typeof performance=="object"&&performance.now?performance:Date,Ms=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ei(){return Dt||(Ms(Wc),Dt=vn.now()+yo)}function Wc(){Dt=0}function oo(){this._call=this._time=this._next=null}oo.prototype=Is.prototype={constructor:oo,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ei():+n)+(t==null?0:+t),!this._next&&on!==this&&(on?on._next=this:to=this,on=this),this._call=e,this._time=n,jo()},stop:function(){this._call&&(this._call=null,this._time=1/0,jo())}};function Is(e,t,n){var o=new oo;return o.restart(e,t,n),o}function Zc(){Ei(),++Xt;for(var e=to,t;e;)(t=Dt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Xt}function rr(){Dt=(no=vn.now())+yo,Xt=nn=0;try{Zc()}finally{Xt=0,qc(),Dt=0}}function Kc(){var e=vn.now(),t=e-no;t>ks&&(yo-=t,no=e)}function qc(){for(var e,t=to,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:to=n);on=e,jo(o)}function jo(e){if(!Xt){nn&&(nn=clearTimeout(nn));var t=e-Dt;t>24?(e<1/0&&(nn=setTimeout(rr,e-vn.now()-yo)),Jt&&(Jt=clearInterval(Jt))):(Jt||(no=vn.now(),Jt=setInterval(Kc,ks)),Xt=1,Ms(rr))}}function sr(e,t,n){var o=new oo;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Qc=vo("start","end","cancel","interrupt"),Jc=[],Ts=0,ar=1,ei=2,Gn=3,lr=4,ti=5,Xn=6;function wo(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;jc(e,n,{name:t,index:o,group:i,on:Qc,tween:Jc,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ts})}function Si(e,t){var n=Ye(e,t);if(n.state>Ts)throw new Error("too late; already scheduled");return n}function Ke(e,t){var n=Ye(e,t);if(n.state>Gn)throw new Error("too late; already running");return n}function Ye(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function jc(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Is(r,0,n.time);function r(u){n.state=ar,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,g;if(n.state!==ar)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===Gn)return sr(s);g.state===lr?(g.state=Xn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=Xn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(sr(function(){n.state===Gn&&(n.state=lr,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=ei,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ei){for(n.state=Gn,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ti,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===ti&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Xn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Un(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>ei&&o.state<ti,o.state=Xn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function ed(e){return this.each(function(){Un(this,e)})}function td(e,t){var n,o;return function(){var i=Ke(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function nd(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Ke(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function od(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ye(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?td:nd)(n,e,t))}function Ni(e,t,n){var o=e._id;return e.each(function(){var i=Ke(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ye(i,o).value[t]}}function As(e,t){var n;return(typeof t=="number"?gt:t instanceof pn?nr:(n=pn(t))?(t=n,nr):Rc)(e,t)}function id(e){return function(){this.removeAttribute(e)}}function rd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sd(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function ad(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function ld(e,t,n){var o,i,r;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===i?r:(i=l,r=t(o=s,a)))}}function ud(e,t,n){var o,i,r;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===i?r:(i=l,r=t(o=s,a)))}}function cd(e,t){var n=mo(e),o=n==="transform"?Lc:As;return this.attrTween(e,typeof t=="function"?(n.local?ud:ld)(n,o,Ni(this,"attr."+e,t)):t==null?(n.local?rd:id)(n):(n.local?ad:sd)(n,o,t))}function dd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hd(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&fd(e,r)),n}return i._value=t,i}function gd(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&dd(e,r)),n}return i._value=t,i}function pd(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=mo(e);return this.tween(n,(o.local?hd:gd)(o,t))}function vd(e,t){return function(){Si(this,e).delay=+t.apply(this,arguments)}}function md(e,t){return t=+t,function(){Si(this,e).delay=t}}function yd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vd:md)(t,e)):Ye(this.node(),t).delay}function wd(e,t){return function(){Ke(this,e).duration=+t.apply(this,arguments)}}function _d(e,t){return t=+t,function(){Ke(this,e).duration=t}}function bd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wd:_d)(t,e)):Ye(this.node(),t).duration}function $d(e,t){if(typeof t!="function")throw new Error;return function(){Ke(this,e).ease=t}}function xd(e){var t=this._id;return arguments.length?this.each($d(t,e)):Ye(this.node(),t).ease}function Ed(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ke(this,e).ease=n}}function Sd(e){if(typeof e!="function")throw new Error;return this.each(Ed(this._id,e))}function Nd(e){typeof e!="function"&&(e=cs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new st(o,this._parents,this._name,this._id)}function Cd(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,g=0;g<c;++g)(h=l[g]||u[g])&&(d[g]=h);for(;a<o;++a)s[a]=t[a];return new st(s,this._parents,this._name,this._id)}function kd(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 Md(e,t,n){var o,i,r=kd(t)?Si:Ke;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function Id(e,t){var n=this._id;return arguments.length<2?Ye(this.node(),n).on.on(e):this.each(Md(n,e,t))}function Td(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ad(){return this.on("end.remove",Td(this._id))}function Pd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bi(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,wo(u[h],t,n,h,u,Ye(c,n)));return new st(r,this._parents,t,n)}function Dd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=us(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),g,x=Ye(c,n),m=0,E=h.length;m<E;++m)(g=h[m])&&wo(g,t,n,m,h,x);r.push(h),s.push(c)}return new st(r,s,t,n)}var zd=En.prototype.constructor;function Od(){return new zd(this._groups,this._parents)}function Bd(e,t){var n,o,i;return function(){var r=Gt(this,e),s=(this.style.removeProperty(e),Gt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function Ps(e){return function(){this.style.removeProperty(e)}}function Rd(e,t,n){var o,i=n+"",r;return function(){var s=Gt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function Hd(e,t,n){var o,i,r;return function(){var s=Gt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Gt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function Vd(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Ke(this,e),u=l.on,c=l.value[r]==null?a||(a=Ps(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function Fd(e,t,n){var o=(e+="")=="transform"?Fc:As;return t==null?this.styleTween(e,Bd(e,o)).on("end.style."+e,Ps(e)):typeof t=="function"?this.styleTween(e,Hd(e,o,Ni(this,"style."+e,t))).each(Vd(this._id,e)):this.styleTween(e,Rd(e,o,t),n).on("end.style."+e,null)}function Ld(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Yd(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&Ld(e,s,n)),o}return r._value=t,r}function Gd(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,Yd(e,t,n??""))}function Xd(e){return function(){this.textContent=e}}function Ud(e){return function(){var t=e(this);this.textContent=t??""}}function Wd(e){return this.tween("text",typeof e=="function"?Ud(Ni(this,"text",e)):Xd(e==null?"":e+""))}function Zd(e){return function(t){this.textContent=e.call(this,t)}}function Kd(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Zd(i)),t}return o._value=e,o}function qd(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,Kd(e))}function Qd(){for(var e=this._name,t=this._id,n=Ds(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Ye(l,t);wo(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new st(o,this._parents,e,n)}function Jd(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=Ke(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var jd=0;function st(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Ds(){return++jd}var Qe=En.prototype;st.prototype={constructor:st,select:Pd,selectAll:Dd,selectChild:Qe.selectChild,selectChildren:Qe.selectChildren,filter:Nd,merge:Cd,selection:Od,transition:Qd,call:Qe.call,nodes:Qe.nodes,node:Qe.node,size:Qe.size,empty:Qe.empty,each:Qe.each,on:Id,attr:cd,attrTween:pd,style:Fd,styleTween:Gd,text:Wd,textTween:qd,remove:Ad,tween:od,delay:yd,duration:bd,ease:xd,easeVarying:Sd,end:Jd,[Symbol.iterator]:Qe[Symbol.iterator]};function ef(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tf={time:null,delay:0,duration:250,ease:ef};function nf(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 of(e){var t,n;e instanceof st?(t=e._id,e=e._name):(t=Ds(),(n=tf).time=Ei(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&wo(l,e,t,u,s,n||nf(l,t));return new st(o,this._parents,e,t)}En.prototype.interrupt=ed;En.prototype.transition=of;const Pn=e=>()=>e;function rf(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){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:i}})}function tt(e,t,n){this.k=e,this.x=t,this.y=n}tt.prototype={constructor:tt,scale:function(e){return e===1?this:new tt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new tt(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 Ut=new tt(1,0,0);tt.prototype;function Do(e){e.stopImmediatePropagation()}function jt(e){e.preventDefault(),e.stopImmediatePropagation()}function sf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function af(){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 ur(){return this.__zoom||Ut}function lf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function uf(){return navigator.maxTouchPoints||"ontouchstart"in this}function cf(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function df(){var e=sf,t=af,n=cf,o=lf,i=uf,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Uc,u=vo("start","zoom","end"),c,d,h,g=500,x=150,m=0,E=10;function w(f){f.property("__zoom",ur).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(f,N,p,I){var S=f.selection?f.selection():f;S.property("__zoom",ur),f!==S?D(f,N,p,I):S.interrupt().each(function(){O(this,arguments).event(I).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},w.scaleBy=function(f,N,p,I){w.scaleTo(f,function(){var S=this.__zoom.k,P=typeof N=="function"?N.apply(this,arguments):N;return S*P},p,I)},w.scaleTo=function(f,N,p,I){w.transform(f,function(){var S=t.apply(this,arguments),P=this.__zoom,T=p==null?A(S):typeof p=="function"?p.apply(this,arguments):p,R=P.invert(T),U=typeof N=="function"?N.apply(this,arguments):N;return n(b(k(P,U),T,R),S,s)},p,I)},w.translateBy=function(f,N,p,I){w.transform(f,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof p=="function"?p.apply(this,arguments):p),t.apply(this,arguments),s)},null,I)},w.translateTo=function(f,N,p,I,S){w.transform(f,function(){var P=t.apply(this,arguments),T=this.__zoom,R=I==null?A(P):typeof I=="function"?I.apply(this,arguments):I;return n(Ut.translate(R[0],R[1]).scale(T.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof p=="function"?-p.apply(this,arguments):-p),P,s)},I,S)};function k(f,N){return N=Math.max(r[0],Math.min(r[1],N)),N===f.k?f:new tt(N,f.x,f.y)}function b(f,N,p){var I=N[0]-p[0]*f.k,S=N[1]-p[1]*f.k;return I===f.x&&S===f.y?f:new tt(f.k,I,S)}function A(f){return[(+f[0][0]+ +f[1][0])/2,(+f[0][1]+ +f[1][1])/2]}function D(f,N,p,I){f.on("start.zoom",function(){O(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(I).end()}).tween("zoom",function(){var S=this,P=arguments,T=O(S,P).event(I),R=t.apply(S,P),U=p==null?A(R):typeof p=="function"?p.apply(S,P):p,ee=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),V=S.__zoom,Y=typeof N=="function"?N.apply(S,P):N,Q=l(V.invert(U).concat(ee/V.k),Y.invert(U).concat(ee/Y.k));return function(ie){if(ie===1)ie=Y;else{var ae=Q(ie),re=ee/ae[2];ie=new tt(re,U[0]-ae[0]*re,U[1]-ae[1]*re)}T.zoom(null,ie)}})}function O(f,N,p){return!p&&f.__zooming||new z(f,N)}function z(f,N){this.that=f,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(f,N),this.taps=0}z.prototype={event:function(f){return f&&(this.sourceEvent=f),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(f,N){return this.mouse&&f!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&f!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&f!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(f){var N=Ve(this.that).datum();u.call(f,this.that,new rf(f,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:u}),N)}};function H(f,...N){if(!e.apply(this,arguments))return;var p=O(this,N).event(f),I=this.__zoom,S=Math.max(r[0],Math.min(r[1],I.k*Math.pow(2,o.apply(this,arguments)))),P=Ue(f);if(p.wheel)(p.mouse[0][0]!==P[0]||p.mouse[0][1]!==P[1])&&(p.mouse[1]=I.invert(p.mouse[0]=P)),clearTimeout(p.wheel);else{if(I.k===S)return;p.mouse=[P,I.invert(P)],Un(this),p.start()}jt(f),p.wheel=setTimeout(T,x),p.zoom("mouse",n(b(k(I,S),p.mouse[0],p.mouse[1]),p.extent,s));function T(){p.wheel=null,p.end()}}function G(f,...N){if(h||!e.apply(this,arguments))return;var p=f.currentTarget,I=O(this,N,!0).event(f),S=Ve(f.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",ee,!0),P=Ue(f,p),T=f.clientX,R=f.clientY;_s(f.view),Do(f),I.mouse=[P,this.__zoom.invert(P)],Un(this),I.start();function U(V){if(jt(V),!I.moved){var Y=V.clientX-T,Q=V.clientY-R;I.moved=Y*Y+Q*Q>m}I.event(V).zoom("mouse",n(b(I.that.__zoom,I.mouse[0]=Ue(V,p),I.mouse[1]),I.extent,s))}function ee(V){S.on("mousemove.zoom mouseup.zoom",null),bs(V.view,I.moved),jt(V),I.event(V).end()}}function F(f,...N){if(e.apply(this,arguments)){var p=this.__zoom,I=Ue(f.changedTouches?f.changedTouches[0]:f,this),S=p.invert(I),P=p.k*(f.shiftKey?.5:2),T=n(b(k(p,P),I,S),t.apply(this,N),s);jt(f),a>0?Ve(this).transition().duration(a).call(D,T,I,f):Ve(this).call(w.transform,T,I,f)}}function L(f,...N){if(e.apply(this,arguments)){var p=f.touches,I=p.length,S=O(this,N,f.changedTouches.length===I).event(f),P,T,R,U;for(Do(f),T=0;T<I;++T)R=p[T],U=Ue(R,this),U=[U,this.__zoom.invert(U),R.identifier],S.touch0?!S.touch1&&S.touch0[2]!==U[2]&&(S.touch1=U,S.taps=0):(S.touch0=U,P=!0,S.taps=1+!!c);c&&(c=clearTimeout(c)),P&&(S.taps<2&&(d=U[0],c=setTimeout(function(){c=null},g)),Un(this),S.start())}}function M(f,...N){if(this.__zooming){var p=O(this,N).event(f),I=f.changedTouches,S=I.length,P,T,R,U;for(jt(f),P=0;P<S;++P)T=I[P],R=Ue(T,this),p.touch0&&p.touch0[2]===T.identifier?p.touch0[0]=R:p.touch1&&p.touch1[2]===T.identifier&&(p.touch1[0]=R);if(T=p.that.__zoom,p.touch1){var ee=p.touch0[0],V=p.touch0[1],Y=p.touch1[0],Q=p.touch1[1],ie=(ie=Y[0]-ee[0])*ie+(ie=Y[1]-ee[1])*ie,ae=(ae=Q[0]-V[0])*ae+(ae=Q[1]-V[1])*ae;T=k(T,Math.sqrt(ie/ae)),R=[(ee[0]+Y[0])/2,(ee[1]+Y[1])/2],U=[(V[0]+Q[0])/2,(V[1]+Q[1])/2]}else if(p.touch0)R=p.touch0[0],U=p.touch0[1];else return;p.zoom("touch",n(b(T,R,U),p.extent,s))}}function Z(f,...N){if(this.__zooming){var p=O(this,N).event(f),I=f.changedTouches,S=I.length,P,T;for(Do(f),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),P=0;P<S;++P)T=I[P],p.touch0&&p.touch0[2]===T.identifier?delete p.touch0:p.touch1&&p.touch1[2]===T.identifier&&delete p.touch1;if(p.touch1&&!p.touch0&&(p.touch0=p.touch1,delete p.touch1),p.touch0)p.touch0[1]=this.__zoom.invert(p.touch0[0]);else if(p.end(),p.taps===2&&(T=Ue(T,this),Math.hypot(d[0]-T[0],d[1]-T[1])<E)){var R=Ve(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return w.wheelDelta=function(f){return arguments.length?(o=typeof f=="function"?f:Pn(+f),w):o},w.filter=function(f){return arguments.length?(e=typeof f=="function"?f:Pn(!!f),w):e},w.touchable=function(f){return arguments.length?(i=typeof f=="function"?f:Pn(!!f),w):i},w.extent=function(f){return arguments.length?(t=typeof f=="function"?f:Pn([[+f[0][0],+f[0][1]],[+f[1][0],+f[1][1]]]),w):t},w.scaleExtent=function(f){return arguments.length?(r[0]=+f[0],r[1]=+f[1],w):[r[0],r[1]]},w.translateExtent=function(f){return arguments.length?(s[0][0]=+f[0][0],s[1][0]=+f[1][0],s[0][1]=+f[0][1],s[1][1]=+f[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(f){return arguments.length?(n=f,w):n},w.duration=function(f){return arguments.length?(a=+f,w):a},w.interpolate=function(f){return arguments.length?(l=f,w):l},w.on=function(){var f=u.on.apply(u,arguments);return f===u?w:f},w.clickDistance=function(f){return arguments.length?(m=(f=+f)*f,w):Math.sqrt(m)},w.tapDistance=function(f){return arguments.length?(E=+f,w):E},w}var te=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(te||{}),Ci=(e=>(e.Partial="partial",e.Full="full",e))(Ci||{}),Et=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Et||{}),_t=(e=>(e.Strict="strict",e.Loose="loose",e))(_t||{}),ni=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(ni||{}),cn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(cn||{});const ff=["INPUT","SELECT","TEXTAREA"];function oi(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof(o==null?void 0:o.hasAttribute)=="function"?o.hasAttribute("contenteditable"):!1,r=typeof(o==null?void 0:o.closest)=="function"?o.closest(".nokey"):null;return ff.includes(o==null?void 0:o.nodeName)||i||!!r}function hf(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function cr(e,t,n,o){const i=t.replace("+",`
2
+ `).replace(`
3
+
4
+ `,`
5
+ +`).split(`
6
+ `).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===i[a]);return o&&n.delete(e.toLowerCase()),r}function gf(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=pf(n.code,e);return Array.isArray(e)?e.some(i=>cr(n[o],i,t,n.type==="keyup")):cr(n[o],e,t,n.type==="keyup")}}function pf(e,t){return t.includes(e)?"code":"key"}function dn(e,t){const n=we(()=>ve(t==null?void 0:t.actInsideInputWithModifier)??!1),o=we(()=>ve(t==null?void 0:t.target)??window),i=we(()=>ve(t==null?void 0:t.preventDefault)??!0),r=he(ve(e)===!0);let s=!1;const a=new Set;let l=c(ve(e));be(()=>ve(e),(d,h)=>{typeof h=="boolean"&&typeof d!="boolean"&&u(),l=c(d)},{immediate:!0}),as(["blur","contextmenu"],u),Xi((...d)=>l(...d),d=>{var h,g;if(s=hf(d),(!s||s&&!n.value)&&oi(d))return;const m=((g=(h=d.composedPath)==null?void 0:h.call(d))==null?void 0:g[0])||d.target,E=(m==null?void 0:m.nodeName)==="BUTTON"||(m==null?void 0:m.nodeName)==="A";!i.value&&(s||!E)&&d.preventDefault(),r.value=!0},{eventName:"keydown",target:o}),Xi((...d)=>l(...d),d=>{if(r.value){if((!s||s&&!n.value)&&oi(d))return;s=!1,r.value=!1}},{eventName:"keyup",target:o});function u(){s=!1,a.clear(),r.value=ve(e)===!0}function c(d){return d===null?(u(),()=>!1):typeof d=="boolean"?(u(),r.value=d,()=>!1):Array.isArray(d)||typeof d=="string"?gf(d,a):d}return r}const zs="vue-flow__node-desc",Os="vue-flow__edge-desc",vf="vue-flow__aria-live",Bs=["Enter"," ","Escape"],Ft={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function io(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function ro(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 _o(e){return{width:e.offsetWidth,height:e.offsetHeight}}function zt(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Rs(e,t){return{x:zt(e.x,t[0][0],t[1][0]),y:zt(e.y,t[0][1],t[1][1])}}function dr(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function bt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function Tt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!bt(e)}function rn(e){return Tt(e)&&"computedPosition"in e}function Dn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function mf(e){return Dn(e.width)&&Dn(e.height)&&Dn(e.x)&&Dn(e.y)}function yf(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:ln({width:0,height:0}),computedPosition:ln({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:Ne(e.data)?e.data:{},events:ln(Ne(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Hs(e,t,n){var o,i;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.type)??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:e.updatable??(n==null?void 0:n.updatable),selectable:e.selectable??(n==null?void 0:n.selectable),focusable:e.focusable??(n==null?void 0:n.focusable),data:Ne(e.data)?e.data:{},events:ln(Ne(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(n==null?void 0:n.interactionWidth),...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function Vs(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===i&&r.add(a[o]);return t.filter(a=>r.has(a.id))}function wf(...e){if(e.length===3){const[r,s,a]=e;return Vs(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>bt(r)&&r.source===o).map(r=>n.find(s=>Tt(s)&&s.id===r.target))}function _f(...e){if(e.length===3){const[r,s,a]=e;return Vs(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>bt(r)&&r.target===o).map(r=>n.find(s=>Tt(s)&&s.id===r.source))}function Fs({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function bf(e,t){return t.some(n=>bt(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 ii({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function mn({x:e,y:t},{x:n,y:o,zoom:i},r=!1,s=[1,1]){const a={x:(e-n)/i,y:(t-o)/i};return r?bo(a,s):a}function Ls(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 so({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function Ys({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function $f(e,t){return Ys(Ls(so(e),so(t)))}function ki(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=Ls(t,so({...o.computedPosition,...o.dimensions}))}return Ys(t)}function Gs(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...mn(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=a,d=l.width??a.width??null,h=l.height??a.height??null;if(i&&!u||c)continue;const g=ro(r,io(a)),x=d===null||h===null,m=o&&g>0,E=(d??0)*(h??0);(x||m||g>=E||a.dragging)&&s.push(a)}return s}function St(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 fr(e,t,n,o,i,r=.1,s={x:0,y:0}){const a=t/(e.width*(1+r)),l=n/(e.height*(1+r)),u=Math.min(a,l),c=zt(u,o,i),d=e.x+e.width/2,h=e.y+e.height/2,g=t/2-d*c+(s.x??0),x=n/2-h*c+(s.y??0);return{x:g,y:x,zoom:c}}function xf(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Xs(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return n?n.selected?!0:Xs(n,t):!1}function yn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function hr(e,t,n){return e<t?zt(Math.abs(e-t),1,t)/t:e>n?-zt(Math.abs(e-n),1,t)/t:0}function Us(e,t,n=15,o=40){const i=hr(e.x,o,t.width-o)*n,r=hr(e.y,o,t.height-o)*n;return[i,r]}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 i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(e.position.x<0){const r=Math.abs(e.position.x);if(t.position.x=t.position.x-r,typeof i.width=="string"){const s=Number(i.width.replace("px",""));i.width=`${s+r}px`}else i.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(t.position.y=t.position.y-r,typeof i.height=="string"){const s=Number(i.height.replace("px",""));i.height=`${s+r}px`}else i.height+=r;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const s=t.style;return{...s(r),...i}}:t.style={...t.style,...i}}}}function gr(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)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 r=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(rn(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&rn(l)&&zo(s,l)}break;case"dimensions":if(rn(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[r.indexOf(s.parentNode)];l&&rn(l)&&(!!l.dimensions.width&&!!l.dimensions.height?zo(s,l):it(()=>{zo(s,l)}))}break}return t}function ft(e,t){return{id:e,type:"select",selected:t}}function pr(e){return{item:e,type:"add"}}function vr(e){return{id:e,type:"remove"}}function mr(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function pt(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(ft(r.id,s)))}return o}function W(e){const t=new Set;let n=!1;const o=()=>t.size>0;e&&(n=!0,t.add(e));const i=a=>{t.delete(a)};return{on:a=>{e&&n&&t.delete(e),t.add(a);const l=()=>{i(a),e&&n&&t.add(e)};return po(l),{off:l}},off:i,trigger:a=>Promise.all(Array.from(t).map(l=>l(a))),hasListeners:o,fns:t}}function yr(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 Ef(e,t,n,o,i){var r,s;const a=[];for(const l of e)(l.selected||l.id===i)&&(!l.parentNode||!Xs(l,o))&&(l.draggable||t&&typeof l.draggable>"u")&&a.push(ln({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-((s=l.computedPosition)==null?void 0:s.y)||0},from:l.computedPosition,extent:l.extent,parentNode:l.parentNode,dimensions:l.dimensions,expandParent:l.expandParent}));return a}function Oo({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function Ws(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 Sf(e,t,n){const[o,i,r,s]=typeof e!="string"?Ws(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-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function Nf(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&(i==null?void 0:i.range)==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=Sf(i,e,o);r&&(i=r)}else t(new ke(Ce.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,s=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,s,a,l]=Ws(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+l,i.range[0][1]+c+r],[i.range[1][0]+u-s,i.range[1][1]+c-a]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Cf({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Mi(e,t,n,o,i){const r=Cf(e.dimensions,Nf(e,n,o,i)),s=Rs(t,r);return{position:{x:s.x-((i==null?void 0:i.computedPosition.x)||0),y:s.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:s}}function Wt(e,t,n=te.Left,o=!1){const i=((t==null?void 0:t.x)??0)+e.computedPosition.x,r=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:s,height:a}=t??Tf(e);if(o)return{x:i+s/2,y:r+a/2};switch((t==null?void 0:t.position)??n){case te.Top:return{x:i+s/2,y:r};case te.Right:return{x:i+s,y:r+a/2};case te.Bottom:return{x:i+s/2,y:r+a};case te.Left:return{x:i,y:r+a/2}}}function wr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function kf({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=so({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(c.x2,u.x2)-Math.max(c.x,u.x)),h=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*h)>0}function Mf(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var Ce=(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))(Ce||{});const _r={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
7
+ Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
8
+ Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
9
+ Node: ${e}
10
+ Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
11
+ Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
12
+ Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
13
+ Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
14
+ Edge: ${e}
15
+ Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
16
+ Edge: ${e}
17
+ Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
18
+ Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
19
+ Edge: ${e}
20
+ Source: ${t}
21
+ Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
22
+ Edge: ${e}
23
+ Source: ${t}
24
+ Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
25
+ Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
26
+ 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 ke extends Error{constructor(t,...n){var o;super((o=_r[t])==null?void 0:o.call(_r,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Ii(e){return"clientX"in e}function If(e){return"sourceEvent"in e}function wt(e,t){const n=Ii(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}}const ao=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Tf(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 bo(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const Af=()=>!0;function Bo(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Pf(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())ro(i,io(r))>0&&o.push(r);return o}const Df=250;function zf(e,t,n,o){var i,r;let s=[],a=Number.POSITIVE_INFINITY;const l=Pf(e,n,t+Df);for(const u of l){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((r=u.handleBounds)==null?void 0:r.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:g}=Wt(u,d,d.position,!0),x=Math.sqrt((h-e.x)**2+(g-e.y)**2);x>t||(x<a?(s=[{...d,x:h,y:g}],a=x):x===a&&s.push({...d,x:h,y:g}))}}if(!s.length)return null;if(s.length>1){const u=o.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function br(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:s,lib:a,flowId:l,isValidConnection:u=Af},c,d,h){const g=r==="target",x=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:E}=wt(e),w=s.elementFromPoint(m,E),k=w!=null&&w.classList.contains(`${a}-flow__handle`)?w:x,b={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const A=Zs(void 0,k),D=k.getAttribute("data-nodeid"),O=k.getAttribute("data-handleid"),z=k.classList.contains("connectable"),H=k.classList.contains("connectableend");if(!D||!A)return b;const G={source:g?D:o,sourceHandle:g?O:i,target:g?o:D,targetHandle:g?i:O};b.connection=G;const L=z&&H&&(n===_t.Strict?g&&A==="source"||!g&&A==="target":D!==o||O!==i);b.isValid=L&&u(G,{nodes:d,edges:c,sourceNode:h(o),targetNode:h(D)}),b.toHandle=t}return b}function Zs(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Of(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Bf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Rf(e,t,n,o,i,r=!1){var s,a,l;const u=o.get(e);if(!u)return null;const c=i===_t.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((a=u.handleBounds)==null?void 0:a.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c==null?void 0:c.find(h=>h.id===n):c==null?void 0:c[0])??null;return d&&r?{...d,...Wt(u,d,d.position,!0)}:d}const ri={[te.Left]:te.Right,[te.Right]:te.Left,[te.Top]:te.Bottom,[te.Bottom]:te.Top},Hf=["production","prod"];function $o(e,...t){Ks()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Ks(){return!Hf.includes("production")}function $r(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,..._o(s)}}):null}function si(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),it(()=>{s.blur()})):n([e])}function Ne(e){return typeof C(e)<"u"}function Vf(e,t,n,o){if(!e||!e.source||!e.target)return n(new ke(Ce.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let i;return bt(e)?i=e:i={...e,id:Fs(e)},i=Hs(i,void 0,o),bf(i,t)?!1:i}function Ff(e,t,n,o,i){if(!t.source||!t.target)return i(new ke(Ce.EDGE_INVALID,e.id)),!1;if(!n)return i(new ke(Ce.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...s}=e;return{...s,id:o?Fs(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function xr(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!Tt(s)){n(new ke(Ce.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=yf(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=a}for(const r of i){const s=t(r.parentNode)||i.find(a=>a.id===r.parentNode);r.parentNode&&!s&&n(new ke(Ce.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function Er(e,t,n,o,i,r){let s=i;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${i}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),r){s=`${i}-${e}-${r}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Ro(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${r}-${a}`,c=`${r}-${a}--${i}-${s}`;Er("source",l,c,e,i,s),Er("target",l,u,e,r,a)}}function Sr(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ho(e,t,n,o,i,r,s,a){const l=[];for(const u of e){const c=bt(u)?u:Vf(u,a,i,r);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new ke(Ce.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new ke(Ce.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new ke(Ce.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){i(new ke(Ce.EDGE_INVALID,c.id));continue}const g=o(c.id);l.push({...Hs(c,g,r),sourceNode:d,targetNode:h})}return l}const Nr=Symbol("vueFlow"),qs=Symbol("nodeId"),Qs=Symbol("nodeRef"),Lf=Symbol("edgeId"),Yf=Symbol("edgeRef"),xo=Symbol("slots");function Js(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodes:r,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:g,multiSelectionActive:x,nodesSelectionActive:m,selectNodesOnDrag:E,removeSelectedElements:w,addSelectedNodes:k,updateNodePositions:b,emits:A}=$e(),{onStart:D,onDrag:O,onStop:z,onClick:H,el:G,disabled:F,id:L,selectable:M,dragHandle:Z}=e,f=he(!1);let N=[],p,I=null,S={x:void 0,y:void 0},P={x:0,y:0},T=null,R=!1,U=0,ee=!1;const V=Uf(),Y=({x:oe,y:ce})=>{S={x:oe,y:ce};let de=!1;if(N=N.map(y=>{const v={x:oe-y.distance.x,y:ce-y.distance.y},{computedPosition:$}=Mi(y,n.value?bo(v,o.value):v,A.error,s.value,y.parentNode?g(y.parentNode):void 0);return de=de||y.position.x!==$.x||y.position.y!==$.y,y.position=$,y}),!!de&&(b(N,!0,!0),f.value=!0,T)){const[y,v]=Oo({id:L,dragItems:N,findNode:g});O({event:T,node:y,nodes:v})}},Q=()=>{if(!I)return;const[oe,ce]=Us(P,I,c.value);if(oe!==0||ce!==0){const de={x:(S.x??0)-oe/l.value.zoom,y:(S.y??0)-ce/l.value.zoom};h({x:oe,y:ce})&&Y(de)}U=requestAnimationFrame(Q)},ie=(oe,ce)=>{R=!0;const de=g(L);!E.value&&!x.value&&de&&(de.selected||w()),de&&ve(M)&&E.value&&si(de,x.value,k,w,m,!1,ce);const y=V(oe.sourceEvent);if(S=y,N=Ef(r.value,d.value,y,g,L),N.length){const[v,$]=Oo({id:L,dragItems:N,findNode:g});D({event:oe.sourceEvent,node:v,nodes:$})}},ae=(oe,ce)=>{var de;oe.sourceEvent.type==="touchmove"&&oe.sourceEvent.touches.length>1||(a.value===0&&ie(oe,ce),S=V(oe.sourceEvent),I=((de=t.value)==null?void 0:de.getBoundingClientRect())||null,P=wt(oe.sourceEvent,I))},re=(oe,ce)=>{const de=V(oe.sourceEvent);if(!ee&&R&&u.value&&(ee=!0,Q()),!R){const y=de.xSnapped-(S.x??0),v=de.ySnapped-(S.y??0);Math.sqrt(y*y+v*v)>a.value&&ie(oe,ce)}(S.x!==de.xSnapped||S.y!==de.ySnapped)&&N.length&&R&&(T=oe.sourceEvent,P=wt(oe.sourceEvent,I),Y(de))},me=oe=>{let ce=!1;if(!R&&!f.value&&!x.value){const de=oe.sourceEvent,y=V(de),v=y.xSnapped-(S.x??0),$=y.ySnapped-(S.y??0),_=Math.sqrt(v*v+$*$);_!==0&&_<=a.value&&(H==null||H(de),ce=!0)}if(N.length&&!ce){b(N,!1,!1);const[de,y]=Oo({id:L,dragItems:N,findNode:g});z({event:oe.sourceEvent,node:de,nodes:y})}N=[],f.value=!1,ee=!1,R=!1,S={x:void 0,y:void 0},cancelAnimationFrame(U)};return be([()=>ve(F),G],([oe,ce],de,y)=>{if(ce){const v=Ve(ce);oe||(p=_c().on("start",$=>ae($,ce)).on("drag",$=>re($,ce)).on("end",$=>me($)).filter($=>{const _=$.target,B=ve(Z);return!$.button&&(!i.value||!yr(_,`.${i.value}`,ce)&&(!B||yr(_,B,ce)))}),v.call(p)),y(()=>{v.on(".drag",null),p&&(p.on("start",null),p.on("drag",null),p.on("end",null))})}}),f}function Gf(){return{doubleClick:W(),click:W(),mouseEnter:W(),mouseMove:W(),mouseLeave:W(),contextMenu:W(),updateStart:W(),update:W(),updateEnd:W()}}function Xf(e,t){const n=Gf();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Uf(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=$e();return i=>{var r;const s=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},a=If(i)?i.sourceEvent:i,{x:l,y:u}=wt(a,s),c=mn({x:l,y:u},e.value),{x:d,y:h}=n.value?bo(c,t.value):c;return{xSnapped:d,ySnapped:h,...c}}}function zn(){return!0}function js({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:g,autoPanOnConnect:x,autoPanSpeed:m,findNode:E,panBy:w,startConnection:k,updateConnection:b,endConnection:A,emits:D,viewport:O,edges:z,nodes:H,isValidConnection:G,nodeLookup:F}=$e();let L=null,M=!1,Z=null;function f(p){var I;const S=ve(n)==="target",P=Ii(p),T=dr(p.target);if(P&&p.button===0||!P){let R=function(se){y=wt(se,oe),Y=zf(mn(y,O.value,!1,[1,1]),c.value,F.value,_),v||($(),v=!0);const ge=br(se,{handle:Y,connectionMode:u.value,fromNodeId:ve(t),fromHandleId:ve(e),fromType:S?"target":"source",isValidConnection:V,doc:T,lib:"vue",flowId:a,nodeLookup:F.value},z.value,H.value,E);Z=ge.handleDomNode,L=ge.connection,M=Bf(!!Y,ge.isValid);const pe={...j,isValid:M,to:Y&&M?ii({x:Y.x,y:Y.y},O.value):y,toHandle:ge.toHandle,toPosition:M&&ge.toHandle?ge.toHandle.position:ri[_.position],toNode:ge.toHandle?F.value.get(ge.toHandle.nodeId):null};if(!(M&&Y&&(j!=null&&j.toHandle)&&pe.toHandle&&j.toHandle.type===pe.toHandle.type&&j.toHandle.nodeId===pe.toHandle.nodeId&&j.toHandle.id===pe.toHandle.id&&j.to.x===pe.to.x&&j.to.y===pe.to.y)){if(b(Y&&M?ii({x:Y.x,y:Y.y},O.value):y,ge.toHandle,Of(!!Y,M)),j=pe,!Y&&!M&&!Z)return Bo(de);L&&L.source!==L.target&&Z&&(Bo(de),de=Z,Z.classList.add("connecting","vue-flow__handle-connecting"),Z.classList.toggle("valid",!!M),Z.classList.toggle("vue-flow__handle-valid",!!M))}},U=function(se){(Y||Z)&&L&&M&&(r?r(se,L):D.connect(L)),D.connectEnd(se),i&&(s==null||s(se)),Bo(de),cancelAnimationFrame(Q),A(se),v=!1,M=!1,L=null,Z=null,T.removeEventListener("mousemove",R),T.removeEventListener("mouseup",U),T.removeEventListener("touchmove",R),T.removeEventListener("touchend",U)};const ee=E(ve(t));let V=ve(o)||G.value||zn;!V&&ee&&(V=(S?ee.isValidSourcePos:ee.isValidTargetPos)||zn);let Y,Q=0;const{x:ie,y:ae}=wt(p),re=T==null?void 0:T.elementFromPoint(ie,ae),me=Zs(ve(i),re),oe=(I=l.value)==null?void 0:I.getBoundingClientRect();if(!oe||!me)return;const ce=Rf(ve(t),me,ve(e),F.value,u.value);if(!ce)return;let de,y=wt(p,oe),v=!1;const $=()=>{if(!x.value)return;const[se,ge]=Us(y,oe,m.value);w({x:se,y:ge}),Q=requestAnimationFrame($)},_={...ce,nodeId:ve(t),type:me,position:ce.position},B=F.value.get(ve(t)),J={inProgress:!0,isValid:null,from:Wt(B,_,te.Left,!0),fromHandle:_,fromPosition:_.position,fromNode:B,to:y,toHandle:null,toPosition:ri[_.position],toNode:null};k({nodeId:ve(t),id:ve(e),type:me,position:(re==null?void 0:re.getAttribute("data-handlepos"))||te.Top},{x:ie-oe.left,y:ae-oe.top}),D.connectStart({event:p,nodeId:ve(t),handleId:ve(e),handleType:me});let j=J;T.addEventListener("mousemove",R),T.addEventListener("mouseup",U),T.addEventListener("touchmove",R),T.addEventListener("touchend",U)}}function N(p){var I,S;if(!d.value)return;const P=ve(n)==="target";if(!h.value){D.clickConnectStart({event:p,nodeId:ve(t),handleId:ve(e)}),k({nodeId:ve(t),type:ve(n),id:ve(e),position:te.Top},void 0,!0);return}let T=ve(o)||G.value||zn;const R=E(ve(t));if(!T&&R&&(T=(P?R.isValidSourcePos:R.isValidTargetPos)||zn),R&&(typeof R.connectable>"u"?g.value:R.connectable)===!1)return;const U=dr(p.target),ee=br(p,{handle:{nodeId:ve(t),id:ve(e),type:ve(n),position:te.Top},connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id||null,fromType:h.value.type,isValidConnection:T,doc:U,lib:"vue",flowId:a,nodeLookup:F.value},z.value,H.value,E),V=((I=ee.connection)==null?void 0:I.source)===((S=ee.connection)==null?void 0:S.target);ee.isValid&&ee.connection&&!V&&D.connect(ee.connection),D.clickConnectEnd(p),A(p,!0)}return{handlePointerDown:f,handleClick:N}}function Wf(){return Bt(qs,"")}function ea(e){const t=e??Wf()??"",n=Bt(Qs,he(null)),{findNode:o,edges:i,emits:r}=$e(),s=o(t);return s||r.error(new ke(Ce.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:K(()=>o(s.parentNode)),connectedEdges:K(()=>St([s],i.value))}}function Zf(){return{doubleClick:W(),click:W(),mouseEnter:W(),mouseMove:W(),mouseLeave:W(),contextMenu:W(),dragStart:W(),drag:W(),dragStop:W()}}function Kf(e,t){const n=Zf();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function ta(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:a}=$e();return(l,u=!1)=>{const c=r.value?i.value[0]:5,d=r.value?i.value[1]:5,h=u?4:1,g=l.x*c*h,x=l.y*d*h,m=[];for(const E of e.value)if(E.draggable||s&&typeof E.draggable>"u"){const w={x:E.computedPosition.x+g,y:E.computedPosition.y+x},{computedPosition:k}=Mi(E,w,a.error,t.value,E.parentNode?o(E.parentNode):void 0);m.push({id:E.id,position:k,from:E.position,distance:{x:l.x,y:l.y},dimensions:E.dimensions})}n(m,!0,!1)}}const Vo=.1;function dt(){return $o("Viewport not initialized yet."),Promise.resolve(!1)}const qf={zoomIn:dt,zoomOut:dt,zoomTo:dt,fitView:dt,setCenter:dt,fitBounds:dt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:dt,setTransform:dt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Qf(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleBy(Fo(e.d3Selection,i,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(a=>{const{x:l,y:u}=Rs({x:-o,y:-i},e.translateExtent),c=Ut.translate(-l,-u).scale(r);e.d3Selection&&e.d3Zoom?e.d3Zoom.transform(Fo(e.d3Selection,s,()=>{a(!0)}),c):a(!1)})}return K(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i==null?void 0:i.duration),zoomOut:i=>t(1/1.2,i==null?void 0:i.duration),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleTo(Fo(e.d3Selection,r==null?void 0:r.duration,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),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:(i={padding:Vo,includeHiddenNodes:!1,duration:0})=>{var r,s;const a=[];for(const h of e.nodes)h.dimensions.width&&h.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!h.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=ki(a),{x:u,y:c,zoom:d}=fr(l,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??Vo,i.offset);return n(u,c,d,i==null?void 0:i.duration)},setCenter:(i,r,s)=>{const a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-i*a,u=e.dimensions.height/2-r*a;return n(l,u,a,s==null?void 0:s.duration)},fitBounds:(i,r={padding:Vo})=>{const{x:s,y:a,zoom:l}=fr(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(s,a,l,r==null?void 0:r.duration)},project:i=>mn(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x-r,y:i.y-s};return mn(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x+r,y:i.y+s};return ii(a,e.viewport)}return{x:0,y:0}}}:qf)}function Fo(e,t=0,n){return e.transition().duration(t).on("end",n)}function Jf(e,t,n){const o=jr(!0);return o.run(()=>{const i=()=>{o.run(()=>{let m,E,w=!!(n.nodes.value.length||n.edges.value.length);m=Rt([e.modelValue,()=>{var k,b;return(b=(k=e.modelValue)==null?void 0:k.value)==null?void 0:b.length}],([k])=>{k&&Array.isArray(k)&&(E==null||E.pause(),n.setElements(k),!E&&!w&&k.length?w=!0:E==null||E.resume())}),E=Rt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([k,b])=>{var A;(A=e.modelValue)!=null&&A.value&&Array.isArray(e.modelValue.value)&&(m==null||m.pause(),e.modelValue.value=[...k,...b],it(()=>{m==null||m.resume()}))},{immediate:w}),Fn(()=>{m==null||m.stop(),E==null||E.stop()})})},r=()=>{o.run(()=>{let m,E,w=!!n.nodes.value.length;m=Rt([e.nodes,()=>{var k,b;return(b=(k=e.nodes)==null?void 0:k.value)==null?void 0:b.length}],([k])=>{k&&Array.isArray(k)&&(E==null||E.pause(),n.setNodes(k),!E&&!w&&k.length?w=!0:E==null||E.resume())}),E=Rt([n.nodes,()=>n.nodes.value.length],([k])=>{var b;(b=e.nodes)!=null&&b.value&&Array.isArray(e.nodes.value)&&(m==null||m.pause(),e.nodes.value=[...k],it(()=>{m==null||m.resume()}))},{immediate:w}),Fn(()=>{m==null||m.stop(),E==null||E.stop()})})},s=()=>{o.run(()=>{let m,E,w=!!n.edges.value.length;m=Rt([e.edges,()=>{var k,b;return(b=(k=e.edges)==null?void 0:k.value)==null?void 0:b.length}],([k])=>{k&&Array.isArray(k)&&(E==null||E.pause(),n.setEdges(k),!E&&!w&&k.length?w=!0:E==null||E.resume())}),E=Rt([n.edges,()=>n.edges.value.length],([k])=>{var b;(b=e.edges)!=null&&b.value&&Array.isArray(e.edges.value)&&(m==null||m.pause(),e.edges.value=[...k],it(()=>{m==null||m.resume()}))},{immediate:w}),Fn(()=>{m==null||m.stop(),E==null||E.stop()})})},a=()=>{o.run(()=>{be(()=>t.maxZoom,()=>{t.maxZoom&&Ne(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{be(()=>t.minZoom,()=>{t.minZoom&&Ne(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{be(()=>t.translateExtent,()=>{t.translateExtent&&Ne(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{be(()=>t.nodeExtent,()=>{t.nodeExtent&&Ne(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{be(()=>t.applyDefault,()=>{Ne(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const m=async E=>{let w=E;typeof t.autoConnect=="function"&&(w=await t.autoConnect(E)),w!==!1&&n.addEdges([w])};be(()=>t.autoConnect,()=>{Ne(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),be(n.autoConnect,(E,w,k)=>{E?n.onConnect(m):n.hooks.value.connect.off(m),k(()=>{n.hooks.value.connect.off(m)})},{immediate:!0})})},g=()=>{const m=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const E of Object.keys(t)){const w=E;if(!m.includes(w)){const k=we(()=>t[w]),b=n[w];rt(b)&&o.run(()=>{be(k,A=>{Ne(A)&&(b.value=A)},{immediate:!0})})}}};(()=>{i(),r(),s(),l(),a(),u(),c(),d(),h(),g()})()}),()=>o.stop()}function jf(){return{edgesChange:W(),nodesChange:W(),nodeDoubleClick:W(),nodeClick:W(),nodeMouseEnter:W(),nodeMouseMove:W(),nodeMouseLeave:W(),nodeContextMenu:W(),nodeDragStart:W(),nodeDrag:W(),nodeDragStop:W(),nodesInitialized:W(),miniMapNodeClick:W(),miniMapNodeDoubleClick:W(),miniMapNodeMouseEnter:W(),miniMapNodeMouseMove:W(),miniMapNodeMouseLeave:W(),connect:W(),connectStart:W(),connectEnd:W(),clickConnectStart:W(),clickConnectEnd:W(),paneReady:W(),init:W(),move:W(),moveStart:W(),moveEnd:W(),selectionDragStart:W(),selectionDrag:W(),selectionDragStop:W(),selectionContextMenu:W(),selectionStart:W(),selectionEnd:W(),viewportChangeStart:W(),viewportChange:W(),viewportChangeEnd:W(),paneScroll:W(),paneClick:W(),paneContextMenu:W(),paneMouseEnter:W(),paneMouseMove:W(),paneMouseLeave:W(),edgeContextMenu:W(),edgeMouseEnter:W(),edgeMouseMove:W(),edgeMouseLeave:W(),edgeDoubleClick:W(),edgeClick:W(),edgeUpdateStart:W(),edgeUpdate:W(),edgeUpdateEnd:W(),updateNodeInternals:W(),error:W(e=>$o(e.message))}}function eh(e,t){La(()=>{for(const[n,o]of Object.entries(t.value)){const i=r=>{e(n,r)};o.fns.add(i),po(()=>{o.off(i)})}})}function na(){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:Ci.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:cn.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:Et.Bezier,style:{}},connectionMode:_t.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:ao()?"Meta":"Control",zoomActivationKeyCode:ao()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:jf(),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 th=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function nh(e,t,n){const o=Qf(e),i=y=>{const v=y??[];e.hooks.updateNodeInternals.trigger(v)},r=y=>_f(y,e.nodes,e.edges),s=y=>wf(y,e.nodes,e.edges),a=y=>St(y,e.edges),l=({id:y,type:v,nodeId:$})=>{var _;return Array.from(((_=e.connectionLookup.get(`${$}-${v}-${y??null}`))==null?void 0:_.values())??[])},u=y=>{if(y)return t.value.get(y)},c=y=>{if(y)return n.value.get(y)},d=(y,v,$)=>{var _,B;const ne=[];for(const J of y){const j={id:J.id,type:"position",dragging:$,from:J.from};if(v&&(j.position=J.position,J.parentNode)){const se=u(J.parentNode);j.position={x:j.position.x-(((_=se==null?void 0:se.computedPosition)==null?void 0:_.x)??0),y:j.position.y-(((B=se==null?void 0:se.computedPosition)==null?void 0:B.y)??0)}}ne.push(j)}ne!=null&&ne.length&&e.hooks.nodesChange.trigger(ne)},h=y=>{if(!e.vueFlowRef)return;const v=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!v)return;const $=window.getComputedStyle(v),{m22:_}=new window.DOMMatrixReadOnly($.transform),B=[];for(const ne of y){const J=ne,j=u(J.id);if(j){const se=_o(J.nodeElement);if(!!(se.width&&se.height&&(j.dimensions.width!==se.width||j.dimensions.height!==se.height||J.forceUpdate))){const pe=J.nodeElement.getBoundingClientRect();j.dimensions=se,j.handleBounds.source=$r("source",J.nodeElement,pe,_,j.id),j.handleBounds.target=$r("target",J.nodeElement,pe,_,j.id),B.push({id:j.id,type:"dimensions",dimensions:se})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),B.length&&e.hooks.nodesChange.trigger(B)},g=(y,v)=>{const $=new Set,_=new Set;for(const J of y)Tt(J)?$.add(J.id):bt(J)&&_.add(J.id);const B=pt(t.value,$,!0),ne=pt(n.value,_);if(e.multiSelectionActive){for(const J of $)B.push(ft(J,v));for(const J of _)ne.push(ft(J,v))}B.length&&e.hooks.nodesChange.trigger(B),ne.length&&e.hooks.edgesChange.trigger(ne)},x=y=>{if(e.multiSelectionActive){const v=y.map($=>ft($.id,!0));e.hooks.nodesChange.trigger(v);return}e.hooks.nodesChange.trigger(pt(t.value,new Set(y.map(v=>v.id)),!0)),e.hooks.edgesChange.trigger(pt(n.value))},m=y=>{if(e.multiSelectionActive){const v=y.map($=>ft($.id,!0));e.hooks.edgesChange.trigger(v);return}e.hooks.edgesChange.trigger(pt(n.value,new Set(y.map(v=>v.id)))),e.hooks.nodesChange.trigger(pt(t.value,new Set,!0))},E=y=>{g(y,!0)},w=y=>{const $=(y||e.nodes).map(_=>(_.selected=!1,ft(_.id,!1)));e.hooks.nodesChange.trigger($)},k=y=>{const $=(y||e.edges).map(_=>(_.selected=!1,ft(_.id,!1)));e.hooks.edgesChange.trigger($)},b=y=>{if(!y||!y.length)return g([],!1);const v=y.reduce(($,_)=>{const B=ft(_.id,!1);return Tt(_)?$.nodes.push(B):$.edges.push(B),$},{nodes:[],edges:[]});v.nodes.length&&e.hooks.nodesChange.trigger(v.nodes),v.edges.length&&e.hooks.edgesChange.trigger(v.edges)},A=y=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([y,e.maxZoom]),e.minZoom=y},D=y=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([e.minZoom,y]),e.maxZoom=y},O=y=>{var v;(v=e.d3Zoom)==null||v.translateExtent(y),e.translateExtent=y},z=y=>{e.nodeExtent=y,i()},H=y=>{var v;(v=e.d3Zoom)==null||v.clickDistance(y)},G=y=>{e.nodesDraggable=y,e.nodesConnectable=y,e.elementsSelectable=y},F=y=>{const v=y instanceof Function?y(e.nodes):y;!e.initialized&&!v.length||(e.nodes=xr(v,u,e.hooks.error.trigger))},L=y=>{const v=y instanceof Function?y(e.edges):y;if(!e.initialized&&!v.length)return;const $=Ho(v,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Ro(e.connectionLookup,n.value,$),e.edges=$},M=y=>{const v=y instanceof Function?y([...e.nodes,...e.edges]):y;!e.initialized&&!v.length||(F(v.filter(Tt)),L(v.filter(bt)))},Z=y=>{let v=y instanceof Function?y(e.nodes):y;v=Array.isArray(v)?v:[v];const $=xr(v,u,e.hooks.error.trigger),_=[];for(const B of $)_.push(pr(B));_.length&&e.hooks.nodesChange.trigger(_)},f=y=>{let v=y instanceof Function?y(e.edges):y;v=Array.isArray(v)?v:[v];const $=Ho(v,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),_=[];for(const B of $)_.push(pr(B));_.length&&e.hooks.edgesChange.trigger(_)},N=(y,v=!0,$=!1)=>{const _=y instanceof Function?y(e.nodes):y,B=Array.isArray(_)?_:[_],ne=[],J=[];function j(ge){const pe=a(ge);for(const Ee of pe)(!Ne(Ee.deletable)||Ee.deletable)&&J.push(mr(Ee.id,Ee.source,Ee.target,Ee.sourceHandle,Ee.targetHandle))}function se(ge){const pe=[];for(const Ee of e.nodes)Ee.parentNode===ge&&pe.push(Ee);if(pe.length){for(const Ee of pe)ne.push(vr(Ee.id));v&&j(pe);for(const Ee of pe)se(Ee.id)}}for(const ge of B){const pe=typeof ge=="string"?u(ge):ge;pe&&(Ne(pe.deletable)&&!pe.deletable||(ne.push(vr(pe.id)),v&&j([pe]),$&&se(pe.id)))}J.length&&e.hooks.edgesChange.trigger(J),ne.length&&e.hooks.nodesChange.trigger(ne)},p=y=>{const v=y instanceof Function?y(e.edges):y,$=Array.isArray(v)?v:[v],_=[];for(const B of $){const ne=typeof B=="string"?c(B):B;ne&&(Ne(ne.deletable)&&!ne.deletable||_.push(mr(typeof B=="string"?B:B.id,ne.source,ne.target,ne.sourceHandle,ne.targetHandle)))}e.hooks.edgesChange.trigger(_)},I=(y,v,$=!0)=>{const _=c(y.id);if(!_)return!1;const B=e.edges.indexOf(_),ne=Ff(y,v,_,$,e.hooks.error.trigger);if(ne){const[J]=Ho([ne],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((j,se)=>se===B?J:j),Ro(e.connectionLookup,n.value,[J]),J}return!1},S=(y,v,$={replace:!1})=>{const _=c(y);if(!_)return;const B=typeof v=="function"?v(_):v;_.data=$.replace?B:{..._.data,...B}},P=y=>gr(y,e.nodes),T=y=>{const v=gr(y,e.edges);return Ro(e.connectionLookup,n.value,v),v},R=(y,v,$={replace:!1})=>{const _=u(y);if(!_)return;const B=typeof v=="function"?v(_):v;$.replace?e.nodes.splice(e.nodes.indexOf(_),1,B):Object.assign(_,B)},U=(y,v,$={replace:!1})=>{const _=u(y);if(!_)return;const B=typeof v=="function"?v(_):v;_.data=$.replace?B:{..._.data,...B}},ee=(y,v,$=!1)=>{$?e.connectionClickStartHandle=y:e.connectionStartHandle=y,e.connectionEndHandle=null,e.connectionStatus=null,v&&(e.connectionPosition=v)},V=(y,v=null,$=null)=>{e.connectionStartHandle&&(e.connectionPosition=y,e.connectionEndHandle=v,e.connectionStatus=$)},Y=(y,v)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,v?e.connectionClickStartHandle=null:e.connectionStartHandle=null},Q=y=>{const v=mf(y),$=v?null:rn(y)?y:u(y.id);return!v&&!$?[null,null,v]:[v?y:io($),$,v]},ie=(y,v=!0,$=e.nodes)=>{const[_,B,ne]=Q(y);if(!_)return[];const J=[];for(const j of $||e.nodes){if(!ne&&(j.id===B.id||!j.computedPosition))continue;const se=io(j),ge=ro(se,_);(v&&ge>0||ge>=Number(_.width)*Number(_.height))&&J.push(j)}return J},ae=(y,v,$=!0)=>{const[_]=Q(y);if(!_)return!1;const B=ro(_,v);return $&&B>0||B>=Number(_.width)*Number(_.height)},re=y=>{const{viewport:v,dimensions:$,d3Zoom:_,d3Selection:B,translateExtent:ne}=e;if(!_||!B||!y.x&&!y.y)return!1;const J=Ut.translate(v.x+y.x,v.y+y.y).scale(v.zoom),j=[[0,0],[$.width,$.height]],se=_.constrain()(J,j,ne),ge=e.viewport.x!==se.x||e.viewport.y!==se.y||e.viewport.zoom!==se.k;return _.transform(B,se),ge},me=y=>{const v=y instanceof Function?y(e):y,$=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ne(v.defaultEdgeOptions)&&(e.defaultEdgeOptions=v.defaultEdgeOptions);const _=v.modelValue||v.nodes||v.edges?[]:void 0;_&&(v.modelValue&&_.push(...v.modelValue),v.nodes&&_.push(...v.nodes),v.edges&&_.push(...v.edges),M(_));const B=()=>{Ne(v.maxZoom)&&D(v.maxZoom),Ne(v.minZoom)&&A(v.minZoom),Ne(v.translateExtent)&&O(v.translateExtent)};for(const ne of Object.keys(v)){const J=ne,j=v[J];![...th,...$].includes(J)&&Ne(j)&&(e[J]=j)}Wo(()=>e.d3Zoom).not.toBeNull().then(B),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:M,setNodes:F,setEdges:L,addNodes:Z,addEdges:f,removeNodes:N,removeEdges:p,findNode:u,findEdge:c,updateEdge:I,updateEdgeData:S,updateNode:R,updateNodeData:U,applyEdgeChanges:T,applyNodeChanges:P,addSelectedElements:E,addSelectedNodes:x,addSelectedEdges:m,setMinZoom:A,setMaxZoom:D,setTranslateExtent:O,setNodeExtent:z,setPaneClickDistance:H,removeSelectedElements:b,removeSelectedNodes:w,removeSelectedEdges:k,startConnection:ee,updateConnection:V,endConnection:Y,setInteractive:G,setState:me,getIntersectingNodes:ie,getIncomers:r,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:ae,panBy:re,fitView:y=>o.value.fitView(y),zoomIn:y=>o.value.zoomIn(y),zoomOut:y=>o.value.zoomOut(y),zoomTo:(y,v)=>o.value.zoomTo(y,v),setViewport:(y,v)=>o.value.setViewport(y,v),setTransform:(y,v)=>o.value.setTransform(y,v),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(y,v,$)=>o.value.setCenter(y,v,$),fitBounds:(y,v)=>o.value.fitBounds(y,v),project:y=>o.value.project(y),screenToFlowCoordinate:y=>o.value.screenToFlowCoordinate(y),flowToScreenCoordinate:y=>o.value.flowToScreenCoordinate(y),toObject:()=>{const y=[],v=[];for(const $ of e.nodes){const{computedPosition:_,handleBounds:B,selected:ne,dimensions:J,isParent:j,resizing:se,dragging:ge,events:pe,...Ee}=$;y.push(Ee)}for(const $ of e.edges){const{selected:_,sourceNode:B,targetNode:ne,events:J,...j}=$;v.push(j)}return JSON.parse(JSON.stringify({nodes:y,edges:v,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:y=>new Promise(v=>{const{nodes:$,edges:_,position:B,zoom:ne,viewport:J}=y;if($&&F($),_&&L(_),J!=null&&J.x&&(J!=null&&J.y)||B){const j=(J==null?void 0:J.x)||B[0],se=(J==null?void 0:J.y)||B[1],ge=(J==null?void 0:J.zoom)||ne||e.viewport.zoom;return Wo(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:j,y:se,zoom:ge}).then(()=>{v(!0)})})}else v(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const y=na();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const v=Ut.translate(y.defaultViewport.x??0,y.defaultViewport.y??0).scale(zt(y.defaultViewport.zoom??1,y.minZoom,y.maxZoom)),$=e.viewportRef.getBoundingClientRect(),_=[[0,0],[$.width,$.height]],B=e.d3Zoom.constrain()(v,_,y.translateExtent);e.d3Zoom.transform(e.d3Selection,B)}me(y)},$destroy:()=>{}}}const oh=["data-id","data-handleid","data-nodeid","data-handlepos"],ih={name:"Handle",compatConfig:{MODE:3}},Zt=fe({...ih,props:{id:{default:null},type:{},position:{default:()=>te.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=we(()=>n.type??"source"),i=we(()=>n.isValidConnection??null),{id:r,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=$e(),{id:g,node:x,nodeEl:m,connectedEdges:E}=ea(),w=he(),k=we(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),b=we(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),A=we(()=>{var L,M,Z,f,N,p;return((L=s.value)==null?void 0:L.nodeId)===g&&((M=s.value)==null?void 0:M.id)===e.id&&((Z=s.value)==null?void 0:Z.type)===o.value||((f=l.value)==null?void 0:f.nodeId)===g&&((N=l.value)==null?void 0:N.id)===e.id&&((p=l.value)==null?void 0:p.type)===o.value}),D=we(()=>{var L,M,Z;return((L=a.value)==null?void 0:L.nodeId)===g&&((M=a.value)==null?void 0:M.id)===e.id&&((Z=a.value)==null?void 0:Z.type)===o.value}),{handlePointerDown:O,handleClick:z}=js({nodeId:g,handleId:e.id,isValidConnection:i,type:o}),H=K(()=>typeof e.connectable=="string"&&e.connectable==="single"?!E.value.some(L=>{const M=L[`${o.value}Handle`];return L[o.value]!==g?!1:M?M===e.id:!0}):typeof e.connectable=="number"?E.value.filter(L=>{const M=L[`${o.value}Handle`];return L[o.value]!==g?!1:M?M===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(x,E.value):Ne(e.connectable)?e.connectable:c.value);$t(()=>{var L;if(!x.dimensions.width||!x.dimensions.height)return;const M=(L=x.handleBounds[o.value])==null?void 0:L.find(P=>P.id===e.id);if(!u.value||M)return;const Z=u.value.querySelector(".vue-flow__transformationpane");if(!m.value||!w.value||!Z||!e.id)return;const f=m.value.getBoundingClientRect(),N=w.value.getBoundingClientRect(),p=window.getComputedStyle(Z),{m22:I}=new window.DOMMatrixReadOnly(p.transform),S={id:e.id,position:e.position,x:(N.left-f.left)/I,y:(N.top-f.top)/I,type:o.value,nodeId:g,..._o(w.value)};x.handleBounds[o.value]=[...x.handleBounds[o.value]??[],S]});function G(L){const M=Ii(L);H.value&&k.value&&(M&&L.button===0||!M)&&O(L)}function F(L){!g||!a.value&&!k.value||H.value&&z(L)}return t({handleClick:z,handlePointerDown:O,onClick:F,onPointerDown:G}),(L,M)=>(X(),le("div",{ref_key:"handle",ref:w,"data-id":`${C(r)}-${C(g)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":C(g),"data-handlepos":L.position,class:He(["vue-flow__handle",[`vue-flow__handle-${L.position}`,`vue-flow__handle-${e.id}`,C(d),C(h),o.value,{connectable:H.value,connecting:D.value,connectablestart:k.value,connectableend:b.value,connectionindicator:H.value&&(k.value&&!A.value||b.value&&A.value)}]]),onMousedown:G,onTouchstartPassive:G,onClick:F},[Te(L.$slots,"default",{id:L.id})],42,oh))}}),Eo=function({sourcePosition:e=te.Bottom,targetPosition:t=te.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){const a=s.label||n;return[_e(Zt,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?_e(a):_e(Ie,[a]),_e(Zt,{type:"source",position:e,connectable:o,isValidConnection:r})]};Eo.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Eo.inheritAttrs=!1;Eo.compatConfig={MODE:3};const rh=Eo,So=function({targetPosition:e=te.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label||t;return[_e(Zt,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?_e(r):_e(Ie,[r])]};So.props=["targetPosition","label","isValidTargetPos","connectable","data"];So.inheritAttrs=!1;So.compatConfig={MODE:3};const sh=So,No=function({sourcePosition:e=te.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label||t;return[typeof r!="string"&&r?_e(r):_e(Ie,[r]),_e(Zt,{type:"source",position:e,connectable:n,isValidConnection:o})]};No.props=["sourcePosition","label","isValidSourcePos","connectable","data"];No.inheritAttrs=!1;No.compatConfig={MODE:3};const ah=No,lh=["transform"],uh=["width","height","x","y","rx","ry"],ch=["y"],dh={name:"EdgeText",compatConfig:{MODE:3}},fh=fe({...dh,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=he({x:0,y:0,width:0,height:0}),n=he(null),o=K(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);$t(i),be([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,s)=>(X(),le("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(X(),le("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:Se(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,uh)):Me("",!0),ye("text",Yt(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Te(r.$slots,"default",{},()=>[typeof r.label!="string"?(X(),xe(ts(r.label),{key:0})):(X(),le(Ie,{key:1},[Re(ze(r.label),1)],64))])],16,ch)],8,lh))}}),hh=["id","d","marker-end","marker-start"],gh=["d","stroke-width"],ph={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Nn=fe({...ph,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=he(null),o=he(null),i=he(null),r=wi();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,a)=>(X(),le(Ie,null,[ye("path",Yt(C(r),{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,hh),s.interactionWidth?(X(),le("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,gh)):Me("",!0),s.label&&s.labelX&&s.labelY?(X(),xe(fh,{key:1,ref_key:"labelEl",ref:i,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"])):Me("",!0)],64))}});function oa({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[r,a,i,s]}function ia({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+r*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function On(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Cr({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case te.Left:s=t-On(t-o,r),a=n;break;case te.Right:s=t+On(o-t,r),a=n;break;case te.Top:s=t,a=n-On(n-i,r);break;case te.Bottom:s=t,a=n+On(i-n,r);break}return[s,a]}function Ti(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top,curvature:a=.25}=e,[l,u]=Cr({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,d]=Cr({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[h,g,x,m]=ia({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${i},${r}`,h,g,x,m]}function kr({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case te.Left:case te.Right:r=.5*(t+o),s=n;break;case te.Top:case te.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function ra(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top}=e,[a,l]=kr({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=kr({pos:s,x1:i,y1:r,x2:t,y2:n}),[d,h,g,x]=ia({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${i},${r}`,d,h,g,x]}const Mr={[te.Left]:{x:-1,y:0},[te.Right]:{x:1,y:0},[te.Top]:{x:0,y:-1},[te.Bottom]:{x:0,y:1}};function vh({source:e,sourcePosition:t=te.Bottom,target:n}){return t===te.Left||t===te.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 Ir(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function mh({source:e,sourcePosition:t=te.Bottom,target:n,targetPosition:o=te.Top,center:i,offset:r}){const s=Mr[t],a=Mr[o],l={x:e.x+s.x*r,y:e.y+s.y*r},u={x:n.x+a.x*r,y:n.y+a.y*r},c=vh({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let g,x,m;const E={x:0,y:0},w={x:0,y:0},[k,b,A,D]=oa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){x=i.x??k,m=i.y??b;const z=[{x,y:l.y},{x,y:u.y}],H=[{x:l.x,y:m},{x:u.x,y:m}];s[d]===h?g=d==="x"?z:H:g=d==="x"?H:z}else{const z=[{x:l.x,y:u.y}],H=[{x:u.x,y:l.y}];if(d==="x"?g=s.x===h?H:z:g=s.y===h?z:H,t===o){const Z=Math.abs(e[d]-n[d]);if(Z<=r){const f=Math.min(r-1,r-Z);s[d]===h?E[d]=(l[d]>e[d]?-1:1)*f:w[d]=(u[d]>n[d]?-1:1)*f}}if(t!==o){const Z=d==="x"?"y":"x",f=s[d]===a[Z],N=l[Z]>u[Z],p=l[Z]<u[Z];(s[d]===1&&(!f&&N||f&&p)||s[d]!==1&&(!f&&p||f&&N))&&(g=d==="x"?z:H)}const G={x:l.x+E.x,y:l.y+E.y},F={x:u.x+w.x,y:u.y+w.y},L=Math.max(Math.abs(G.x-g[0].x),Math.abs(F.x-g[0].x)),M=Math.max(Math.abs(G.y-g[0].y),Math.abs(F.y-g[0].y));L>=M?(x=(G.x+F.x)/2,m=g[0].y):(x=g[0].x,m=(G.y+F.y)/2)}return[[e,{x:l.x+E.x,y:l.y+E.y},...g,{x:u.x+w.x,y:u.y+w.y},n],x,m,A,D]}function yh(e,t,n,o){const i=Math.min(Ir(e,t)/2,Ir(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${s}Q ${r},${s} ${r},${s+i*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${s+i*l}Q ${r},${s} ${r+i*a},${s}`}function ai(e){const{sourceX:t,sourceY:n,sourcePosition:o=te.Bottom,targetX:i,targetY:r,targetPosition:s=te.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,g,x,m]=mh({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((w,k,b)=>{let A;return b>0&&b<d.length-1?A=yh(d[b-1],k,d[b+1],a):A=`${b===0?"M":"L"}${k.x} ${k.y}`,w+=A,w},""),h,g,x,m]}function wh(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,l]=oa({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,l]}const _h=fe({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,i]=wh(e);return _e(Nn,{path:n,labelX:o,labelY:i,...t,...e})}}}),bh=_h,$h=fe({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,i]=ai({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return _e(Nn,{path:n,labelX:o,labelY:i,...t,...e})}}}),sa=$h,xh=fe({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>_e(sa,{...e,...t,borderRadius:0})}}),Eh=xh,Sh=fe({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,i]=Ti({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return _e(Nn,{path:n,labelX:o,labelY:i,...t,...e})}}}),Nh=Sh,Ch=fe({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,i]=ra({...e,sourcePosition:e.sourcePosition??te.Bottom,targetPosition:e.targetPosition??te.Top});return _e(Nn,{path:n,labelX:o,labelY:i,...t,...e})}}}),kh=Ch,Mh={input:ah,default:rh,output:sh},Ih={default:Nh,straight:bh,step:Eh,smoothstep:sa,simplebezier:kh};function Th(e,t,n){const o=K(()=>m=>t.value.get(m)),i=K(()=>m=>n.value.get(m)),r=K(()=>{const m={...Ih,...e.edgeTypes},E=Object.keys(m);for(const w of e.edges)w.type&&!E.includes(w.type)&&(m[w.type]=w.type);return m}),s=K(()=>{const m={...Mh,...e.nodeTypes},E=Object.keys(m);for(const w of e.nodes)w.type&&!E.includes(w.type)&&(m[w.type]=w.type);return m}),a=K(()=>e.onlyRenderVisibleElements?Gs(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=K(()=>{if(e.onlyRenderVisibleElements){const m=[];for(const E of e.edges){const w=t.value.get(E.source),k=t.value.get(E.target);kf({sourcePos:w.computedPosition||{x:0,y:0},targetPos:k.computedPosition||{x:0,y:0},sourceWidth:w.dimensions.width,sourceHeight:w.dimensions.height,targetWidth:k.dimensions.width,targetHeight:k.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&m.push(E)}return m}return e.edges}),u=K(()=>[...a.value,...l.value]),c=K(()=>{const m=[];for(const E of e.nodes)E.selected&&m.push(E);return m}),d=K(()=>{const m=[];for(const E of e.edges)E.selected&&m.push(E);return m}),h=K(()=>[...c.value,...d.value]),g=K(()=>{const m=[];for(const E of e.nodes)E.dimensions.width&&E.dimensions.height&&E.handleBounds!==void 0&&m.push(E);return m}),x=K(()=>a.value.length>0&&g.value.length===a.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:g,areNodesInitialized:x}}class Nt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=xn())==null?void 0:t.appContext.app,o=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??Nt.instance;return Nt.instance=o??new Nt,n&&(n.config.globalProperties.$vueFlowStorage=Nt.instance),Nt.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=na(),i=Va(o),r={};for(const[h,g]of Object.entries(i.hooks)){const x=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[x]=g.on}const s={};for(const[h,g]of Object.entries(i.hooks))s[h]=g.trigger;const a=K(()=>{const h=new Map;for(const g of i.nodes)h.set(g.id,g);return h}),l=K(()=>{const h=new Map;for(const g of i.edges)h.set(g.id,g);return h}),u=Th(i,a,l),c=nh(i,a,l);c.setState({...i,...n});const d={...r,...u,...c,...Ml(i),nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.43.1",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function $e(e){const t=Nt.getInstance(),n=Jr(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r??(n==null?void 0:n.vueFlowId);let a;if(n){const l=Bt(Nr,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=r??t.getId(),u=t.create(l,i);a=u,(n??jr(!0)).run(()=>{be(u.applyDefault,(d,h,g)=>{const x=E=>{u.applyNodeChanges(E)},m=E=>{u.applyEdgeChanges(E)};d?(u.onNodesChange(x),u.onEdgesChange(m)):(u.hooks.value.nodesChange.off(x),u.hooks.value.edgesChange.off(m)),g(()=>{u.hooks.value.nodesChange.off(x),u.hooks.value.edgesChange.off(m)})},{immediate:!0}),po(()=>{if(a){const d=t.get(a.id);d?d.$destroy():$o(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(Pt(Nr,a),n.vueFlowId=a.id),o){const l=xn();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new ke(Ce.USEVUEFLOW_OPTIONS))}return a}function Ah(e){const{emits:t,dimensions:n}=$e();let o;$t(()=>{const i=e.value,r=()=>{if(!i)return;const s=_o(i);(s.width===0||s.height===0)&&t.error(new ke(Ce.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:s.width||500,height:s.height||500}};r(),window.addEventListener("resize",r),i&&(o=new ResizeObserver(()=>r()),o.observe(i)),ns(()=>{window.removeEventListener("resize",r),o&&i&&o.unobserve(i)})})}const Ph={name:"UserSelection",compatConfig:{MODE:3}},Dh=fe({...Ph,props:{userSelectionRect:{}},setup(e){return(t,n)=>(X(),le("div",{class:"vue-flow__selection vue-flow__container",style:Se({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),zh=["tabIndex"],Oh={name:"NodesSelection",compatConfig:{MODE:3}},Bh=fe({...Oh,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=$e(),a=ta(),l=he(null),u=Js({el:l,onStart(x){t.selectionDragStart(x)},onDrag(x){t.selectionDrag(x)},onStop(x){t.selectionDragStop(x)}});$t(()=>{var x;r.value||(x=l.value)==null||x.focus({preventScroll:!0})});const c=K(()=>ki(o.value)),d=K(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(x){t.selectionContextMenu({event:x,nodes:o.value})}function g(x){r||Ft[x.key]&&(x.preventDefault(),a({x:Ft[x.key].x,y:Ft[x.key].y},x.shiftKey))}return(x,m)=>!C(s)&&c.value.width&&c.value.height?(X(),le("div",{key:0,class:He(["vue-flow__nodesselection vue-flow__container",C(i)]),style:Se({transform:`translate(${C(n).x}px,${C(n).y}px) scale(${C(n).zoom})`})},[ye("div",{ref_key:"el",ref:l,class:He([{dragging:C(u)},"vue-flow__nodesselection-rect"]),style:Se(d.value),tabIndex:C(r)?void 0:-1,onContextmenu:h,onKeydown:g},null,46,zh)],6)):Me("",!0)}});function Rh(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Hh={name:"Pane",compatConfig:{MODE:3}},Vh=fe({...Hh,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:g,selectionMode:x,deleteKeyCode:m,multiSelectionKeyCode:E,multiSelectionActive:w,edgeLookup:k,nodeLookup:b,connectionLookup:A,defaultEdgeOptions:D,connectionStartHandle:O}=$e(),z=he(null),H=he(new Set),G=he(new Set),F=he(),L=we(()=>l.value&&(e.isSelecting||r.value)),M=we(()=>O.value!==null);let Z=!1,f=!1;const N=dn(m,{actInsideInputWithModifier:!1}),p=dn(E);be(N,V=>{V&&(h(d.value),g(c.value),u.value=!1)}),be(p,V=>{w.value=V});function I(V,Y){return Q=>{Q.target===Y&&(V==null||V(Q))}}function S(V){if(Z||M.value){Z=!1;return}i.paneClick(V),s(),u.value=!1}function P(V){V.preventDefault(),V.stopPropagation(),i.paneContextMenu(V)}function T(V){i.paneScroll(V)}function R(V){var Y,Q,ie;if(F.value=(Y=t.value)==null?void 0:Y.getBoundingClientRect(),!l.value||!e.isSelecting||V.button!==0||V.target!==z.value||!F.value)return;(ie=(Q=V.target)==null?void 0:Q.setPointerCapture)==null||ie.call(Q,V.pointerId);const{x:ae,y:re}=Rh(V,F.value);f=!0,Z=!1,s(),a.value={width:0,height:0,startX:ae,startY:re,x:ae,y:re},i.selectionStart(V)}function U(V){var Y;if(!F.value||!a.value)return;Z=!0;const{x:Q,y:ie}=wt(V,F.value),{startX:ae=0,startY:re=0}=a.value,me={startX:ae,startY:re,x:Q<ae?Q:ae,y:ie<re?ie:re,width:Math.abs(Q-ae),height:Math.abs(ie-re)},oe=H.value,ce=G.value;H.value=new Set(Gs(n.value,me,o.value,x.value===Ci.Partial,!0).map(y=>y.id)),G.value=new Set;const de=((Y=D.value)==null?void 0:Y.selectable)??!0;for(const y of H.value){const v=A.value.get(y);if(v)for(const{edgeId:$}of v.values()){const _=k.value.get($);_&&(_.selectable??de)&&G.value.add($)}}if(!Sr(oe,H.value)){const y=pt(b.value,H.value,!0);i.nodesChange(y)}if(!Sr(ce,G.value)){const y=pt(k.value,G.value);i.edgesChange(y)}a.value=me,r.value=!0,u.value=!1}function ee(V){var Y;V.button!==0||!f||((Y=V.target)==null||Y.releasePointerCapture(V.pointerId),!r.value&&a.value&&V.target===z.value&&S(V),r.value=!1,a.value=null,u.value=H.value.size>0,i.selectionEnd(V),e.selectionKeyPressed&&(Z=!1),f=!1)}return(V,Y)=>(X(),le("div",{ref_key:"container",ref:z,class:He(["vue-flow__pane vue-flow__container",{selection:V.isSelecting}]),onClick:Y[0]||(Y[0]=Q=>L.value?void 0:I(S,z.value)(Q)),onContextmenu:Y[1]||(Y[1]=Q=>I(P,z.value)(Q)),onWheelPassive:Y[2]||(Y[2]=Q=>I(T,z.value)(Q)),onPointerenter:Y[3]||(Y[3]=Q=>L.value?void 0:C(i).paneMouseEnter(Q)),onPointerdown:Y[4]||(Y[4]=Q=>L.value?R(Q):C(i).paneMouseMove(Q)),onPointermove:Y[5]||(Y[5]=Q=>L.value?U(Q):C(i).paneMouseMove(Q)),onPointerup:Y[6]||(Y[6]=Q=>L.value?ee(Q):void 0),onPointerleave:Y[7]||(Y[7]=Q=>C(i).paneMouseLeave(Q))},[Te(V.$slots,"default"),C(r)&&C(a)?(X(),xe(Dh,{key:0,"user-selection-rect":C(a)},null,8,["user-selection-rect"])):Me("",!0),C(u)&&C(d).length?(X(),xe(Bh,{key:1})):Me("",!0)],34))}}),Fh={name:"Transform",compatConfig:{MODE:3}},Lh=fe({...Fh,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=$e(),i=K(()=>n.value?!o.value:!1),r=K(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(X(),le("div",{class:"vue-flow__transformationpane vue-flow__container",style:Se({transform:r.value,opacity:i.value?0:void 0})},[Te(s.$slots,"default")],4))}}),Yh={name:"Viewport",compatConfig:{MODE:3}},Gh=fe({...Yh,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:g,zoomOnScroll:x,preventScrolling:m,noWheelClassName:E,noPanClassName:w,emits:k,connectionStartHandle:b,userSelectionActive:A,paneDragging:D,d3Zoom:O,d3Selection:z,d3ZoomHandler:H,viewport:G,viewportRef:F,paneClickDistance:L}=$e();Ah(F);const M=he(!1),Z=he(!1);let f=null,N=!1,p=0,I={x:0,y:0,zoom:0};const S=dn(a),P=dn(s),T=dn(r),R=we(()=>(!P.value||P.value&&s.value===!0)&&(S.value||d.value)),U=we(()=>S.value||l.value),ee=we(()=>P.value||s.value===!0&&R.value!==!0);$t(()=>{if(!F.value){$o("Viewport element is missing");return}const re=F.value,me=re.getBoundingClientRect(),oe=df().clickDistance(L.value).scaleExtent([t.value,n.value]).translateExtent(i.value),ce=Ve(re).call(oe),de=ce.on("wheel.zoom"),y=Ut.translate(o.value.x??0,o.value.y??0).scale(zt(o.value.zoom??1,t.value,n.value)),v=[[0,0],[me.width,me.height]],$=oe.constrain()(y,v,i.value);oe.transform(ce,$),oe.wheelDelta(Y),O.value=oe,z.value=ce,H.value=de,G.value={x:$.x,y:$.y,zoom:$.k},oe.on("start",_=>{var B;if(!_.sourceEvent)return null;p=_.sourceEvent.button,M.value=!0;const ne=ie(_.transform);((B=_.sourceEvent)==null?void 0:B.type)==="mousedown"&&(D.value=!0),I=ne,k.viewportChangeStart(ne),k.moveStart({event:_,flowTransform:ne})}),oe.on("end",_=>{if(!_.sourceEvent)return null;if(M.value=!1,D.value=!1,V(R.value,p??0)&&!N&&k.paneContextMenu(_.sourceEvent),N=!1,Q(I,_.transform)){const B=ie(_.transform);I=B,k.viewportChangeEnd(B),k.moveEnd({event:_,flowTransform:B})}}),oe.filter(_=>{var B;const ne=T.value||x.value,J=g.value&&_.ctrlKey,j=_.button;if(j===1&&_.type==="mousedown"&&(ae(_,"vue-flow__node")||ae(_,"vue-flow__edge")))return!0;if(!R.value&&!ne&&!U.value&&!h.value&&!g.value||A.value||!h.value&&_.type==="dblclick"||ae(_,E.value)&&_.type==="wheel"||ae(_,w.value)&&(_.type!=="wheel"||U.value&&_.type==="wheel"&&!T.value)||!g.value&&_.ctrlKey&&_.type==="wheel"||!ne&&!U.value&&!J&&_.type==="wheel")return!1;if(!g&&_.type==="touchstart"&&((B=_.touches)==null?void 0:B.length)>1)return _.preventDefault(),!1;if(!R.value&&(_.type==="mousedown"||_.type==="touchstart")||s.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&j===0||Array.isArray(d.value)&&!d.value.includes(j)&&(_.type==="mousedown"||_.type==="touchstart"))return!1;const se=Array.isArray(d.value)&&d.value.includes(j)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!j||j<=1;return(!_.ctrlKey||S.value||_.type==="wheel")&&se}),be([A,R],()=>{A.value&&!M.value?oe.on("zoom",null):A.value||oe.on("zoom",_=>{G.value={x:_.transform.x,y:_.transform.y,zoom:_.transform.k};const B=ie(_.transform);N=V(R.value,p??0),k.viewportChange(B),k.move({event:_,flowTransform:B})})},{immediate:!0}),be([A,U,u,T,g,m,E],()=>{U.value&&!T.value&&!A.value?ce.on("wheel.zoom",_=>{if(ae(_,E.value))return!1;const B=T.value||x.value,ne=g.value&&_.ctrlKey;if(!(!m.value||U.value||B||ne))return!1;_.preventDefault(),_.stopImmediatePropagation();const j=ce.property("__zoom").k||1,se=ao();if(!S.value&&_.ctrlKey&&g.value&&se){const Qt=Ue(_),za=Y(_),Oa=j*2**za;oe.scaleTo(ce,Oa,Qt,_);return}const ge=_.deltaMode===1?20:1;let pe=u.value===cn.Vertical?0:_.deltaX*ge,Ee=u.value===cn.Horizontal?0:_.deltaY*ge;!se&&_.shiftKey&&u.value!==cn.Vertical&&!pe&&Ee&&(pe=Ee,Ee=0),oe.translateBy(ce,-(pe/j)*c.value,-(Ee/j)*c.value);const Xe=ie(ce.property("__zoom"));f&&clearTimeout(f),Z.value?(k.move({event:_,flowTransform:Xe}),k.viewportChange(Xe),f=setTimeout(()=>{k.moveEnd({event:_,flowTransform:Xe}),k.viewportChangeEnd(Xe),Z.value=!1},150)):(Z.value=!0,k.moveStart({event:_,flowTransform:Xe}),k.viewportChangeStart(Xe))},{passive:!1}):typeof de<"u"&&ce.on("wheel.zoom",function(_,B){const ne=!m.value&&_.type==="wheel"&&!_.ctrlKey,J=T.value||x.value,j=g.value&&_.ctrlKey;if(!J&&!l.value&&!j&&_.type==="wheel"||ne||ae(_,E.value))return null;_.preventDefault(),de.call(this,_,B)},{passive:!1})},{immediate:!0})});function V(re,me){return me===2&&Array.isArray(re)&&re.includes(2)}function Y(re){const me=re.ctrlKey&&ao()?10:1;return-re.deltaY*(re.deltaMode===1?.05:re.deltaMode?1:.002)*me}function Q(re,me){return re.x!==me.x&&!Number.isNaN(me.x)||re.y!==me.y&&!Number.isNaN(me.y)||re.zoom!==me.k&&!Number.isNaN(me.k)}function ie(re){return{x:re.x,y:re.y,zoom:re.k}}function ae(re,me){return re.target.closest(`.${me}`)}return(re,me)=>(X(),le("div",{ref_key:"viewportRef",ref:F,class:"vue-flow__viewport vue-flow__container"},[q(Vh,{"is-selecting":ee.value,"selection-key-pressed":C(P),class:He({connecting:!!C(b),dragging:C(D),draggable:C(d)===!0||Array.isArray(C(d))&&C(d).includes(0)})},{default:ue(()=>[q(Lh,null,{default:ue(()=>[Te(re.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Xh=["id"],Uh=["id"],Wh=["id"],Zh={name:"A11yDescriptions",compatConfig:{MODE:3}},Kh=fe({...Zh,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=$e();return(i,r)=>(X(),le(Ie,null,[ye("div",{id:`${C(zs)}-${C(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+ze(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,Xh),ye("div",{id:`${C(Os)}-${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,Uh),C(n)?Me("",!0):(X(),le("div",{key:0,id:`${C(vf)}-${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%)"}},ze(C(o)),9,Wh))],64))}});function qh(){const e=$e();be(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Qh(e,t,n){return n===te.Left?e-t:n===te.Right?e+t:e}function Jh(e,t,n){return n===te.Top?e-t:n===te.Bottom?e+t:e}const Ai=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=te.Top,type:i}){return _e("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Qh(t,e,o),cy:Jh(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Ai.props=["radius","centerX","centerY","position","type"];Ai.compatConfig={MODE:3};const Tr=Ai,jh=fe({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:g,disableKeyboardA11y:x,elementsSelectable:m,edgesUpdatable:E,edgesFocusable:w,hooks:k}=$e(),b=K(()=>c(e.id)),{emit:A,on:D}=Xf(b.value,r),O=Bt(xo),z=xn(),H=he(!1),G=he(!1),F=he(""),L=he(null),M=he("source"),Z=he(null),f=we(()=>typeof b.value.selectable>"u"?m.value:b.value.selectable),N=we(()=>typeof b.value.updatable>"u"?E.value:b.value.updatable),p=we(()=>typeof b.value.focusable>"u"?w.value:b.value.focusable);Pt(Lf,e.id),Pt(Yf,Z);const I=K(()=>b.value.class instanceof Function?b.value.class(b.value):b.value.class),S=K(()=>b.value.style instanceof Function?b.value.style(b.value):b.value.style),P=K(()=>{const v=b.value.type||"default",$=O==null?void 0:O[`edge-${v}`];if($)return $;let _=b.value.template??l.value[v];if(typeof _=="string"&&z){const B=Object.keys(z.appContext.components);B&&B.includes(v)&&(_=os(v,!1))}return _&&typeof _!="string"?_:(r.error(new ke(Ce.EDGE_TYPE_MISSING,_)),!1)}),{handlePointerDown:T}=js({nodeId:F,handleId:L,type:M,isValidConnection:h,edgeUpdaterType:M,onEdgeUpdate:ee,onEdgeUpdateEnd:V});return()=>{const v=d(b.value.source),$=d(b.value.target),_="pathOptions"in b.value?b.value.pathOptions:{};if(!v&&!$)return r.error(new ke(Ce.EDGE_SOURCE_TARGET_MISSING,b.value.id,b.value.source,b.value.target)),null;if(!v)return r.error(new ke(Ce.EDGE_SOURCE_MISSING,b.value.id,b.value.source)),null;if(!$)return r.error(new ke(Ce.EDGE_TARGET_MISSING,b.value.id,b.value.target)),null;if(!b.value||b.value.hidden||v.hidden||$.hidden)return null;let B;o.value===_t.Strict?B=v.handleBounds.source:B=[...v.handleBounds.source||[],...v.handleBounds.target||[]];const ne=wr(B,b.value.sourceHandle);let J;o.value===_t.Strict?J=$.handleBounds.target:J=[...$.handleBounds.target||[],...$.handleBounds.source||[]];const j=wr(J,b.value.targetHandle),se=(ne==null?void 0:ne.position)||te.Bottom,ge=(j==null?void 0:j.position)||te.Top,{x:pe,y:Ee}=Wt(v,ne,se),{x:Xe,y:Qt}=Wt($,j,ge);return b.value.sourceX=pe,b.value.sourceY=Ee,b.value.targetX=Xe,b.value.targetY=Qt,_e("g",{ref:Z,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${P.value===!1?"default":b.value.type||"default"}`,a.value,I.value,{updating:H.value,selected:b.value.selected,animated:b.value.animated,inactive:!f.value&&!k.value.edgeClick.hasListeners()}],onClick:Q,onContextmenu:ie,onDblclick:ae,onMouseenter:re,onMousemove:me,onMouseleave:oe,onKeyDown:p.value?y:void 0,tabIndex:p.value?0:void 0,"aria-label":b.value.ariaLabel===null?void 0:b.value.ariaLabel||`Edge from ${b.value.source} to ${b.value.target}`,"aria-describedby":p.value?`${Os}-${t}`:void 0,role:p.value?"button":"img"},[G.value?null:_e(P.value===!1?l.value.default:P.value,{id:e.id,sourceNode:v,targetNode:$,source:b.value.source,target:b.value.target,type:b.value.type,updatable:N.value,selected:b.value.selected,animated:b.value.animated,label:b.value.label,labelStyle:b.value.labelStyle,labelShowBg:b.value.labelShowBg,labelBgStyle:b.value.labelBgStyle,labelBgPadding:b.value.labelBgPadding,labelBgBorderRadius:b.value.labelBgBorderRadius,data:b.value.data,events:{...b.value.events,...D},style:S.value,markerStart:`url('#${yn(b.value.markerStart,t)}')`,markerEnd:`url('#${yn(b.value.markerEnd,t)}')`,sourcePosition:se,targetPosition:ge,sourceX:pe,sourceY:Ee,targetX:Xe,targetY:Qt,sourceHandleId:b.value.sourceHandle,targetHandleId:b.value.targetHandle,interactionWidth:b.value.interactionWidth,..._}),[N.value==="source"||N.value===!0?[_e("g",{onMousedown:ce,onMouseenter:R,onMouseout:U},_e(Tr,{position:se,centerX:pe,centerY:Ee,radius:i.value,type:"source","data-type":"source"}))]:null,N.value==="target"||N.value===!0?[_e("g",{onMousedown:de,onMouseenter:R,onMouseout:U},_e(Tr,{position:ge,centerX:Xe,centerY:Qt,radius:i.value,type:"target","data-type":"target"}))]:null]])};function R(){H.value=!0}function U(){H.value=!1}function ee(v,$){A.update({event:v,edge:b.value,connection:$})}function V(v){A.updateEnd({event:v,edge:b.value}),G.value=!1}function Y(v,$){v.button===0&&(G.value=!0,F.value=$?b.value.target:b.value.source,L.value=($?b.value.targetHandle:b.value.sourceHandle)??null,M.value=$?"target":"source",A.updateStart({event:v,edge:b.value}),T(v))}function Q(v){var $;const _={event:v,edge:b.value};f.value&&(s.value=!1,b.value.selected&&g.value?(u([b.value]),($=Z.value)==null||$.blur()):n([b.value])),A.click(_)}function ie(v){A.contextMenu({event:v,edge:b.value})}function ae(v){A.doubleClick({event:v,edge:b.value})}function re(v){A.mouseEnter({event:v,edge:b.value})}function me(v){A.mouseMove({event:v,edge:b.value})}function oe(v){A.mouseLeave({event:v,edge:b.value})}function ce(v){Y(v,!0)}function de(v){Y(v,!1)}function y(v){var $;!x.value&&Bs.includes(v.key)&&f.value&&(v.key==="Escape"?(($=Z.value)==null||$.blur(),u([c(e.id)])):n([c(e.id)]))}}}),eg=jh,tg=fe({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=$e(),h=(e=Bt(xo))==null?void 0:e["connection-line"],g=K(()=>{var k;return d((k=o.value)==null?void 0:k.nodeId)}),x=K(()=>{var k;return d((k=i.value)==null?void 0:k.nodeId)??null}),m=K(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),E=K(()=>l.value.markerStart?`url(#${yn(l.value.markerStart,t)})`:""),w=K(()=>l.value.markerEnd?`url(#${yn(l.value.markerEnd,t)})`:"");return()=>{var k,b,A;if(!g.value||!o.value)return null;const D=o.value.id,O=o.value.type,z=g.value.handleBounds;let H=(z==null?void 0:z[O])??[];if(n.value===_t.Loose){const S=(z==null?void 0:z[O==="source"?"target":"source"])??[];H=[...H,...S]}if(!H)return null;const G=(D?H.find(S=>S.id===D):H[0])??null,F=(G==null?void 0:G.position)??te.Top,{x:L,y:M}=Wt(g.value,G,F);let Z=null;x.value&&(n.value===_t.Strict?Z=((k=x.value.handleBounds[O==="source"?"target":"source"])==null?void 0:k.find(S=>{var P;return S.id===((P=i.value)==null?void 0:P.id)}))||null:Z=((b=[...x.value.handleBounds.source??[],...x.value.handleBounds.target??[]])==null?void 0:b.find(S=>{var P;return S.id===((P=i.value)==null?void 0:P.id)}))||null);const f=((A=i.value)==null?void 0:A.position)??(F?ri[F]:null);if(!F||!f)return null;const N=s.value??l.value.type??Et.Bezier;let p="";const I={sourceX:L,sourceY:M,sourcePosition:F,targetX:m.value.x,targetY:m.value.y,targetPosition:f};return N===Et.Bezier?[p]=Ti(I):N===Et.Step?[p]=ai({...I,borderRadius:0}):N===Et.SmoothStep?[p]=ai(I):N===Et.SimpleBezier?[p]=ra(I):p=`M${L},${M} ${m.value.x},${m.value.y}`,_e("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},_e("g",{class:"vue-flow__connection"},h?_e(h,{sourceX:L,sourceY:M,sourcePosition:F,targetX:m.value.x,targetY:m.value.y,targetPosition:f,sourceNode:g.value,sourceHandle:G,targetNode:x.value,targetHandle:Z,markerEnd:w.value,markerStart:E.value,connectionStatus:u.value}):_e("path",{d:p,class:[l.value.class,u,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":w.value,"marker-start":E.value})))}}}),ng=tg,og=["id","markerWidth","markerHeight","markerUnits","orient"],ig={name:"MarkerType",compatConfig:{MODE:3}},rg=fe({...ig,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)=>(X(),le("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(ni).ArrowClosed?(X(),le("polyline",{key:0,style:Se({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)):Me("",!0),t.type===C(ni).Arrow?(X(),le("polyline",{key:1,style:Se({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Me("",!0)],8,og))}}),sg={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},ag={name:"MarkerDefinitions",compatConfig:{MODE:3}},lg=fe({...ag,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=$e(),r=K(()=>{const s=new Set,a=[],l=u=>{if(u){const c=yn(u,t);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||i.value}):a.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(X(),le("svg",sg,[ye("defs",null,[(X(!0),le(Ie,null,Mt(r.value,l=>(X(),xe(rg,{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))])]))}}),ug={name:"Edges",compatConfig:{MODE:3}},cg=fe({...ug,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=$e();return(i,r)=>(X(),le(Ie,null,[q(lg),(X(!0),le(Ie,null,Mt(C(n),s=>(X(),le("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Se({zIndex:C(Mf)(s,C(t),C(o))})},[q(C(eg),{id:s.id},null,8,["id"])],4))),128)),q(C(ng))],64))}}),dg=fe({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:g,disableKeyboardA11y:x,ariaLiveMessage:m,snapToGrid:E,snapGrid:w,nodeDragThreshold:k,nodesDraggable:b,elementsSelectable:A,nodesConnectable:D,nodesFocusable:O,hooks:z}=$e(),H=he(null);Pt(Qs,H),Pt(qs,e.id);const G=Bt(xo),F=xn(),L=ta(),{node:M,parentNode:Z}=ea(e.id),{emit:f,on:N}=Kf(M,s),p=we(()=>typeof M.draggable>"u"?b.value:M.draggable),I=we(()=>typeof M.selectable>"u"?A.value:M.selectable),S=we(()=>typeof M.connectable>"u"?D.value:M.connectable),P=we(()=>typeof M.focusable>"u"?O.value:M.focusable),T=we(()=>I.value||p.value||z.value.nodeClick.hasListeners()||z.value.nodeDoubleClick.hasListeners()||z.value.nodeMouseEnter.hasListeners()||z.value.nodeMouseMove.hasListeners()||z.value.nodeMouseLeave.hasListeners()),R=we(()=>!!M.dimensions.width&&!!M.dimensions.height),U=K(()=>{const $=M.type||"default",_=G==null?void 0:G[`node-${$}`];if(_)return _;let B=M.template||d.value[$];if(typeof B=="string"&&F){const ne=Object.keys(F.appContext.components);ne&&ne.includes($)&&(B=os($,!1))}return B&&typeof B!="string"?B:(s.error(new ke(Ce.NODE_TYPE_MISSING,B)),!1)}),ee=Js({id:e.id,el:H,disabled:()=>!p.value,selectable:I,dragHandle:()=>M.dragHandle,onStart($){f.dragStart($)},onDrag($){f.drag($)},onStop($){f.dragStop($)},onClick($){y($)}}),V=K(()=>M.class instanceof Function?M.class(M):M.class),Y=K(()=>{const $=(M.style instanceof Function?M.style(M):M.style)||{},_=M.width instanceof Function?M.width(M):M.width,B=M.height instanceof Function?M.height(M):M.height;return!$.width&&_&&($.width=typeof _=="string"?_:`${_}px`),!$.height&&B&&($.height=typeof B=="string"?B:`${B}px`),$}),Q=we(()=>Number(M.zIndex??Y.value.zIndex??0));return c($=>{($.includes(e.id)||!$.length)&&ae()}),$t(()=>{be(()=>M.hidden,($=!1,_,B)=>{!$&&H.value&&(e.resizeObserver.observe(H.value),B(()=>{H.value&&e.resizeObserver.unobserve(H.value)}))},{immediate:!0,flush:"post"})}),be([()=>M.type,()=>M.sourcePosition,()=>M.targetPosition],()=>{it(()=>{u([{id:e.id,nodeElement:H.value,forceUpdate:!0}])})}),be([()=>M.position.x,()=>M.position.y,()=>{var $;return($=Z.value)==null?void 0:$.computedPosition.x},()=>{var $;return($=Z.value)==null?void 0:$.computedPosition.y},()=>{var $;return($=Z.value)==null?void 0:$.computedPosition.z},Q,()=>M.selected,()=>M.dimensions.height,()=>M.dimensions.width,()=>{var $;return($=Z.value)==null?void 0:$.dimensions.height},()=>{var $;return($=Z.value)==null?void 0:$.dimensions.width}],([$,_,B,ne,J,j])=>{const se={x:$,y:_,z:j+(g.value&&M.selected?1e3:0)};typeof B<"u"&&typeof ne<"u"?M.computedPosition=xf({x:B,y:ne,z:J},se):M.computedPosition=se},{flush:"post",immediate:!0}),be([()=>M.extent,h],([$,_],[B,ne])=>{($!==B||_!==ne)&&ie()}),M.extent==="parent"||typeof M.extent=="object"&&"range"in M.extent&&M.extent.range==="parent"?Wo(()=>R).toBe(!0).then(ie):ie(),()=>M.hidden?null:_e("div",{ref:H,"data-id":M.id,class:["vue-flow__node",`vue-flow__node-${U.value===!1?"default":M.type||"default"}`,{[n.value]:p.value,dragging:ee==null?void 0:ee.value,draggable:p.value,selected:M.selected,selectable:I.value,parent:M.isParent},V.value],style:{visibility:R.value?"visible":"hidden",zIndex:M.computedPosition.z??Q.value,transform:`translate(${M.computedPosition.x}px,${M.computedPosition.y}px)`,pointerEvents:T.value?"all":"none",...Y.value},tabIndex:P.value?0:void 0,role:P.value?"button":void 0,"aria-describedby":x.value?void 0:`${zs}-${t}`,"aria-label":M.ariaLabel,onMouseenter:re,onMousemove:me,onMouseleave:oe,onContextmenu:ce,onClick:y,onDblclick:de,onKeydown:v},[_e(U.value===!1?d.value.default:U.value,{id:M.id,type:M.type,data:M.data,events:{...M.events,...N},selected:M.selected,resizing:M.resizing,dragging:ee.value,connectable:S.value,position:M.computedPosition,dimensions:M.dimensions,isValidTargetPos:M.isValidTargetPos,isValidSourcePos:M.isValidSourcePos,parent:M.parentNode,parentNodeId:M.parentNode,zIndex:M.computedPosition.z??Q.value,targetPosition:M.targetPosition,sourcePosition:M.sourcePosition,label:M.label,dragHandle:M.dragHandle,onUpdateNodeInternals:ae})]);function ie(){const $=M.computedPosition,{computedPosition:_,position:B}=Mi(M,E.value?bo($,w.value):$,s.error,h.value,Z.value);(M.computedPosition.x!==_.x||M.computedPosition.y!==_.y)&&(M.computedPosition={...M.computedPosition,..._}),(M.position.x!==B.x||M.position.y!==B.y)&&(M.position=B)}function ae(){H.value&&u([{id:e.id,nodeElement:H.value,forceUpdate:!0}])}function re($){ee!=null&&ee.value||f.mouseEnter({event:$,node:M})}function me($){ee!=null&&ee.value||f.mouseMove({event:$,node:M})}function oe($){ee!=null&&ee.value||f.mouseLeave({event:$,node:M})}function ce($){return f.contextMenu({event:$,node:M})}function de($){return f.doubleClick({event:$,node:M})}function y($){I.value&&(!o.value||!p.value||k.value>0)&&si(M,r.value,l,a,i,!1,H.value),f.click({event:$,node:M})}function v($){if(!(oi($)||x.value))if(Bs.includes($.key)&&I.value){const _=$.key==="Escape";si(M,r.value,l,a,i,_,H.value)}else p.value&&M.selected&&Ft[$.key]&&($.preventDefault(),m.value=`Moved selected node ${$.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~M.position.x}, y: ${~~M.position.y}`,L({x:Ft[$.key].x,y:Ft[$.key].y},$.shiftKey))}}}),fg=dg;function hg(e={includeHiddenNodes:!1}){const{nodes:t}=$e();return K(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const gg={class:"vue-flow__nodes vue-flow__container"},pg={name:"Nodes",compatConfig:{MODE:3}},vg=fe({...pg,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=$e(),i=hg(),r=he();return be(i,s=>{s&&it(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),$t(()=>{r.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));it(()=>n(a))})}),ns(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(X(),le("div",gg,[r.value?(X(!0),le(Ie,{key:0},Mt(C(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&Ya(d,h))return d;const g=(X(),xe(C(fg),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return g.memo=h,g},a,0),128)):Me("",!0)]))}});function mg(){const{emits:e}=$e();$t(()=>{if(Ks()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new ke(Ce.MISSING_STYLES))}})}const yg=ye("div",{class:"vue-flow__edge-labels"},null,-1),wg={name:"VueFlow",compatConfig:{MODE:3}},_g=fe({...wg,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,i=es(),r=Io(o,"modelValue",n),s=Io(o,"nodes",n),a=Io(o,"edges",n),l=$e(o),u=Jf({modelValue:r,nodes:s,edges:a},o,l);return eh(n,l.hooks),qh(),mg(),Pt(xo,i),Ha(()=>{u()}),t(l),(c,d)=>(X(),le("div",{ref:C(l).vueFlowRef,class:"vue-flow"},[q(Gh,null,{default:ue(()=>[q(cg),yg,q(vg),Te(c.$slots,"zoom-pane")]),_:3}),Te(c.$slots,"default"),q(Kh)],512))}}),bg={name:"Panel",compatConfig:{MODE:3}},$g=fe({...bg,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=$e(),o=K(()=>`${t.position}`.split("-"));return(i,r)=>(X(),le("div",{class:He(["vue-flow__panel",o.value]),style:Se({pointerEvents:C(n)?"none":"all"})},[Te(i.$slots,"default")],6))}});var nt=(e=>(e.Lines="lines",e.Dots="dots",e))(nt||{});const aa=function({dimensions:e,size:t,color:n}){return _e("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},la=function({radius:e,color:t}){return _e("circle",{cx:e,cy:e,r:e,fill:t})};nt.Lines+"",nt.Dots+"";const xg={[nt.Dots]:"#81818a",[nt.Lines]:"#eee"},Eg=["id","x","y","width","height","patternTransform"],Sg={key:2,height:"100",width:"100"},Ng=["fill"],Cg=["x","y","fill"],kg={name:"Background",compatConfig:{MODE:3}},Mg=fe({...kg,props:{id:{},variant:{default:()=>nt.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}=$e(),o=K(()=>{const s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[a*s||1,l*s||1],c=e.size*s,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],g=[d*s||1+u[0]/2,h*s||1+u[1]/2];return{scaledGap:u,offset:g,size:c}}),i=we(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=we(()=>e.color||e.patternColor||xg[e.variant||nt.Dots]);return(s,a)=>(X(),le("svg",{class:"vue-flow__background vue-flow__container",style:Se({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[Te(s.$slots,"pattern-container",{id:i.value},()=>[ye("pattern",{id:i.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"},[Te(s.$slots,"pattern",{},()=>[s.variant===C(nt).Lines?(X(),xe(C(aa),{key:0,size:s.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===C(nt).Dots?(X(),xe(C(la),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):Me("",!0),s.bgColor?(X(),le("svg",Sg,[ye("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,Ng)])):Me("",!0)])],8,Eg)]),ye("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,Cg),Te(s.$slots,"default",{id:i.value})],4))}});var Ig={value:()=>{}};function Pi(){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 Wn(n)}function Wn(e){this._=e}function Tg(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Wn.prototype=Pi.prototype={constructor:Wn,on:function(e,t){var n=this._,o=Tg(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=Ag(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Ar(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ar(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Wn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[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],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function Ag(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Ar(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Ig,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var li="http://www.w3.org/1999/xhtml";const Pr={svg:"http://www.w3.org/2000/svg",xhtml:li,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Co(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Pr.hasOwnProperty(t)?{space:Pr[t],local:e}:e}function Pg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===li&&t.documentElement.namespaceURI===li?t.createElement(e):t.createElementNS(n,e)}}function Dg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ua(e){var t=Co(e);return(t.local?Dg:Pg)(t)}function zg(){}function Di(e){return e==null?zg:function(){return this.querySelector(e)}}function Og(e){typeof e!="function"&&(e=Di(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Be(o,this._parents)}function Bg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rg(){return[]}function ca(e){return e==null?Rg:function(){return this.querySelectorAll(e)}}function Hg(e){return function(){return Bg(e.apply(this,arguments))}}function Vg(e){typeof e=="function"?e=Hg(e):e=ca(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Be(o,i)}function da(e){return function(){return this.matches(e)}}function fa(e){return function(t){return t.matches(e)}}var Fg=Array.prototype.find;function Lg(e){return function(){return Fg.call(this.children,e)}}function Yg(){return this.firstElementChild}function Gg(e){return this.select(e==null?Yg:Lg(typeof e=="function"?e:fa(e)))}var Xg=Array.prototype.filter;function Ug(){return Array.from(this.children)}function Wg(e){return function(){return Xg.call(this.children,e)}}function Zg(e){return this.selectAll(e==null?Ug:Wg(typeof e=="function"?e:fa(e)))}function Kg(e){typeof e!="function"&&(e=da(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Be(o,this._parents)}function ha(e){return new Array(e.length)}function qg(){return new Be(this._enter||this._groups.map(ha),this._parents)}function lo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}lo.prototype={constructor:lo,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 Qg(e){return function(){return e}}function Jg(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new lo(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function jg(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,h=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new lo(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function ep(e){return e.__data__}function tp(e,t){if(!arguments.length)return Array.from(this,ep);var n=t?jg:Jg,o=this._parents,i=this._groups;typeof e!="function"&&(e=Qg(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,g=np(e.call(c,c&&c.__data__,u,o)),x=g.length,m=a[u]=new Array(x),E=s[u]=new Array(x),w=l[u]=new Array(h);n(c,d,m,E,w,g,t);for(var k=0,b=0,A,D;k<x;++k)if(A=m[k]){for(k>=b&&(b=k+1);!(D=E[b])&&++b<x;);A._next=D||null}}return s=new Be(s,o),s._enter=a,s._exit=l,s}function np(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function op(){return new Be(this._exit||this._groups.map(ha),this._parents)}function ip(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function rp(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),g,x=0;x<d;++x)(g=u[x]||c[x])&&(h[x]=g);for(;l<i;++l)a[l]=n[l];return new Be(a,this._parents)}function sp(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function ap(e){e||(e=lp);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Be(i,this._parents).order()}function lp(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function up(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cp(){return Array.from(this)}function dp(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function fp(){let e=0;for(const t of this)++e;return e}function hp(){return!this.node()}function gp(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function pp(e){return function(){this.removeAttribute(e)}}function vp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mp(e,t){return function(){this.setAttribute(e,t)}}function yp(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wp(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function _p(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 bp(e,t){var n=Co(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?vp:pp:typeof t=="function"?n.local?_p:wp:n.local?yp:mp)(n,t))}function ga(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $p(e){return function(){this.style.removeProperty(e)}}function xp(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ep(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Sp(e,t,n){return arguments.length>1?this.each((t==null?$p:typeof t=="function"?Ep:xp)(e,t,n??"")):Kt(this.node(),e)}function Kt(e,t){return e.style.getPropertyValue(t)||ga(e).getComputedStyle(e,null).getPropertyValue(t)}function Np(e){return function(){delete this[e]}}function Cp(e,t){return function(){this[e]=t}}function kp(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Mp(e,t){return arguments.length>1?this.each((t==null?Np:typeof t=="function"?kp:Cp)(e,t)):this.node()[e]}function pa(e){return e.trim().split(/^|\s+/)}function zi(e){return e.classList||new va(e)}function va(e){this._node=e,this._names=pa(e.getAttribute("class")||"")}va.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 ma(e,t){for(var n=zi(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function ya(e,t){for(var n=zi(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Ip(e){return function(){ma(this,e)}}function Tp(e){return function(){ya(this,e)}}function Ap(e,t){return function(){(t.apply(this,arguments)?ma:ya)(this,e)}}function Pp(e,t){var n=pa(e+"");if(arguments.length<2){for(var o=zi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Ap:t?Ip:Tp)(n,t))}function Dp(){this.textContent=""}function zp(e){return function(){this.textContent=e}}function Op(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Bp(e){return arguments.length?this.each(e==null?Dp:(typeof e=="function"?Op:zp)(e)):this.node().textContent}function Rp(){this.innerHTML=""}function Hp(e){return function(){this.innerHTML=e}}function Vp(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Fp(e){return arguments.length?this.each(e==null?Rp:(typeof e=="function"?Vp:Hp)(e)):this.node().innerHTML}function Lp(){this.nextSibling&&this.parentNode.appendChild(this)}function Yp(){return this.each(Lp)}function Gp(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Xp(){return this.each(Gp)}function Up(e){var t=typeof e=="function"?e:ua(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Wp(){return null}function Zp(e,t){var n=typeof e=="function"?e:ua(e),o=t==null?Wp:typeof t=="function"?t:Di(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Kp(){var e=this.parentNode;e&&e.removeChild(this)}function qp(){return this.each(Kp)}function Qp(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Jp(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jp(e){return this.select(e?Jp:Qp)}function ev(e){return arguments.length?this.property("__data__",e):this.node().__data__}function tv(e){return function(t){e.call(this,t,this.__data__)}}function nv(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 ov(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function iv(e,t,n){return function(){var o=this.__on,i,r=tv(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function rv(e,t,n){var o=nv(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?iv:ov,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function wa(e,t,n){var o=ga(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function sv(e,t){return function(){return wa(this,e,t)}}function av(e,t){return function(){return wa(this,e,t.apply(this,arguments))}}function lv(e,t){return this.each((typeof t=="function"?av:sv)(e,t))}function*uv(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var _a=[null];function Be(e,t){this._groups=e,this._parents=t}function Cn(){return new Be([[document.documentElement]],_a)}function cv(){return this}Be.prototype=Cn.prototype={constructor:Be,select:Og,selectAll:Vg,selectChild:Gg,selectChildren:Zg,filter:Kg,data:tp,enter:qg,exit:op,join:ip,merge:rp,selection:cv,order:sp,sort:ap,call:up,nodes:cp,node:dp,size:fp,empty:hp,each:gp,attr:bp,style:Sp,property:Mp,classed:Pp,text:Bp,html:Fp,raise:Yp,lower:Xp,append:Up,insert:Zp,remove:qp,clone:jp,datum:ev,on:rv,dispatch:lv,[Symbol.iterator]:uv};function yt(e){return typeof e=="string"?new Be([[document.querySelector(e)]],[document.documentElement]):new Be([[e]],_a)}function dv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ht(e,t){if(e=dv(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const ui={capture:!0,passive:!1};function ci(e){e.preventDefault(),e.stopImmediatePropagation()}function fv(e){var t=e.document.documentElement,n=yt(e).on("dragstart.drag",ci,ui);"onselectstart"in t?n.on("selectstart.drag",ci,ui):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hv(e,t){var n=e.document.documentElement,o=yt(e).on("dragstart.drag",null);t&&(o.on("click.drag",ci,ui),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Oi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ba(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function kn(){}var wn=.7,uo=1/wn,Lt="\\s*([+-]?\\d+)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ze="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gv=/^#([0-9a-f]{3,8})$/,pv=new RegExp(`^rgb\\(${Lt},${Lt},${Lt}\\)$`),vv=new RegExp(`^rgb\\(${Ze},${Ze},${Ze}\\)$`),mv=new RegExp(`^rgba\\(${Lt},${Lt},${Lt},${_n}\\)$`),yv=new RegExp(`^rgba\\(${Ze},${Ze},${Ze},${_n}\\)$`),wv=new RegExp(`^hsl\\(${_n},${Ze},${Ze}\\)$`),_v=new RegExp(`^hsla\\(${_n},${Ze},${Ze},${_n}\\)$`),Dr={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};Oi(kn,bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zr,formatHex:zr,formatHex8:bv,formatHsl:$v,formatRgb:Or,toString:Or});function zr(){return this.rgb().formatHex()}function bv(){return this.rgb().formatHex8()}function $v(){return $a(this).formatHsl()}function Or(){return this.rgb().formatRgb()}function bn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Br(t):n===3?new De(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bn(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=pv.exec(e))?new De(t[1],t[2],t[3],1):(t=vv.exec(e))?new De(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mv.exec(e))?Bn(t[1],t[2],t[3],t[4]):(t=yv.exec(e))?Bn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=wv.exec(e))?Vr(t[1],t[2]/100,t[3]/100,1):(t=_v.exec(e))?Vr(t[1],t[2]/100,t[3]/100,t[4]):Dr.hasOwnProperty(e)?Br(Dr[e]):e==="transparent"?new De(NaN,NaN,NaN,0):null}function Br(e){return new De(e>>16&255,e>>8&255,e&255,1)}function Bn(e,t,n,o){return o<=0&&(e=t=n=NaN),new De(e,t,n,o)}function xv(e){return e instanceof kn||(e=bn(e)),e?(e=e.rgb(),new De(e.r,e.g,e.b,e.opacity)):new De}function di(e,t,n,o){return arguments.length===1?xv(e):new De(e,t,n,o??1)}function De(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Oi(De,di,ba(kn,{brighter(e){return e=e==null?uo:Math.pow(uo,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new De(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new De(At(this.r),At(this.g),At(this.b),co(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:Rr,formatHex:Rr,formatHex8:Ev,formatRgb:Hr,toString:Hr}));function Rr(){return`#${kt(this.r)}${kt(this.g)}${kt(this.b)}`}function Ev(){return`#${kt(this.r)}${kt(this.g)}${kt(this.b)}${kt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hr(){const e=co(this.opacity);return`${e===1?"rgb(":"rgba("}${At(this.r)}, ${At(this.g)}, ${At(this.b)}${e===1?")":`, ${e})`}`}function co(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function At(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kt(e){return e=At(e),(e<16?"0":"")+e.toString(16)}function Vr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Le(e,t,n,o)}function $a(e){if(e instanceof Le)return new Le(e.h,e.s,e.l,e.opacity);if(e instanceof kn||(e=bn(e)),!e)return new Le;if(e instanceof Le)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Le(s,a,l,e.opacity)}function Sv(e,t,n,o){return arguments.length===1?$a(e):new Le(e,t,n,o??1)}function Le(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Oi(Le,Sv,ba(kn,{brighter(e){return e=e==null?uo:Math.pow(uo,e),new Le(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Le(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,i=2*n-o;return new De(Lo(e>=240?e-240:e+120,i,o),Lo(e,i,o),Lo(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Le(Fr(this.h),Rn(this.s),Rn(this.l),co(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=co(this.opacity);return`${e===1?"hsl(":"hsla("}${Fr(this.h)}, ${Rn(this.s)*100}%, ${Rn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Fr(e){return e=(e||0)%360,e<0?e+360:e}function Rn(e){return Math.max(0,Math.min(1,e||0))}function Lo(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 xa=e=>()=>e;function Nv(e,t){return function(n){return e+n*t}}function Cv(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 kv(e){return(e=+e)==1?Ea:function(t,n){return n-t?Cv(t,n,e):xa(isNaN(t)?n:t)}}function Ea(e,t){var n=t-e;return n?Nv(e,n):xa(isNaN(e)?t:e)}const Lr=function e(t){var n=kv(t);function o(i,r){var s=n((i=di(i)).r,(r=di(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Ea(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var fi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yo=new RegExp(fi.source,"g");function Mv(e){return function(){return e}}function Iv(e){return function(t){return e(t)+""}}function Tv(e,t){var n=fi.lastIndex=Yo.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=fi.exec(e))&&(i=Yo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:vt(o,i)})),n=Yo.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?Iv(l[0].x):Mv(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var Yr=180/Math.PI,hi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Sa(e,t,n,o,i,r){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:i,translateY:r,rotate:Math.atan2(t,e)*Yr,skewX:Math.atan(l)*Yr,scaleX:s,scaleY:a}}var Hn;function Av(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?hi:Sa(t.a,t.b,t.c,t.d,t.e,t.f)}function Pv(e){return e==null||(Hn||(Hn=document.createElementNS("http://www.w3.org/2000/svg","g")),Hn.setAttribute("transform",e),!(e=Hn.transform.baseVal.consolidate()))?hi:(e=e.matrix,Sa(e.a,e.b,e.c,e.d,e.e,e.f))}function Na(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,g,x){if(u!==d||c!==h){var m=g.push("translate(",null,t,null,n);x.push({i:m-4,x:vt(u,d)},{i:m-2,x:vt(c,h)})}else(d||h)&&g.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:vt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:vt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,g,x){if(u!==d||c!==h){var m=g.push(i(g)+"scale(",null,",",null,")");x.push({i:m-4,x:vt(u,d)},{i:m-2,x:vt(c,h)})}else(d!==1||h!==1)&&g.push(i(g)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(g){for(var x=-1,m=h.length,E;++x<m;)d[(E=h[x]).i]=E.x(g);return d.join("")}}}var Dv=Na(Av,"px, ","px)","deg)"),zv=Na(Pv,", ",")",")"),Ov=1e-12;function Gr(e){return((e=Math.exp(e))+1/e)/2}function Bv(e){return((e=Math.exp(e))-1/e)/2}function Rv(e){return((e=Math.exp(2*e))-1)/(e+1)}const Hv=function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],h=s[2],g=c-a,x=d-l,m=g*g+x*x,E,w;if(m<Ov)w=Math.log(h/u)/t,E=function(z){return[a+z*g,l+z*x,u*Math.exp(t*z*w)]};else{var k=Math.sqrt(m),b=(h*h-u*u+o*m)/(2*u*n*k),A=(h*h-u*u-o*m)/(2*h*n*k),D=Math.log(Math.sqrt(b*b+1)-b),O=Math.log(Math.sqrt(A*A+1)-A);w=(O-D)/t,E=function(z){var H=z*w,G=Gr(D),F=u/(n*k)*(G*Rv(t*H+D)-Bv(D));return[a+F*g,l+F*x,u*G/Gr(t*H+D)]}}return E.duration=w*1e3*t/Math.SQRT2,E}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var qt=0,sn=0,en=0,Ca=1e3,fo,an,ho=0,Ot=0,ko=0,$n=typeof performance=="object"&&performance.now?performance:Date,ka=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bi(){return Ot||(ka(Vv),Ot=$n.now()+ko)}function Vv(){Ot=0}function go(){this._call=this._time=this._next=null}go.prototype=Ma.prototype={constructor:go,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Bi():+n)+(t==null?0:+t),!this._next&&an!==this&&(an?an._next=this:fo=this,an=this),this._call=e,this._time=n,gi()},stop:function(){this._call&&(this._call=null,this._time=1/0,gi())}};function Ma(e,t,n){var o=new go;return o.restart(e,t,n),o}function Fv(){Bi(),++qt;for(var e=fo,t;e;)(t=Ot-e._time)>=0&&e._call.call(void 0,t),e=e._next;--qt}function Xr(){Ot=(ho=$n.now())+ko,qt=sn=0;try{Fv()}finally{qt=0,Yv(),Ot=0}}function Lv(){var e=$n.now(),t=e-ho;t>Ca&&(ko-=t,ho=e)}function Yv(){for(var e,t=fo,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:fo=n);an=e,gi(o)}function gi(e){if(!qt){sn&&(sn=clearTimeout(sn));var t=e-Ot;t>24?(e<1/0&&(sn=setTimeout(Xr,e-$n.now()-ko)),en&&(en=clearInterval(en))):(en||(ho=$n.now(),en=setInterval(Lv,Ca)),qt=1,ka(Xr))}}function Ur(e,t,n){var o=new go;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Gv=Pi("start","end","cancel","interrupt"),Xv=[],Ia=0,Wr=1,pi=2,Zn=3,Zr=4,vi=5,Kn=6;function Mo(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Uv(e,n,{name:t,index:o,group:i,on:Gv,tween:Xv,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ia})}function Ri(e,t){var n=Ge(e,t);if(n.state>Ia)throw new Error("too late; already scheduled");return n}function qe(e,t){var n=Ge(e,t);if(n.state>Zn)throw new Error("too late; already running");return n}function Ge(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Uv(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Ma(r,0,n.time);function r(u){n.state=Wr,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,g;if(n.state!==Wr)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===Zn)return Ur(s);g.state===Zr?(g.state=Kn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=Kn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(Ur(function(){n.state===Zn&&(n.state=Zr,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=pi,n.on.call("start",e,e.__data__,n.index,n.group),n.state===pi){for(n.state=Zn,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=vi,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===vi&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Kn,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function qn(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>pi&&o.state<vi,o.state=Kn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Wv(e){return this.each(function(){qn(this,e)})}function Zv(e,t){var n,o;return function(){var i=qe(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Kv(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=qe(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function qv(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ge(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Zv:Kv)(n,e,t))}function Hi(e,t,n){var o=e._id;return e.each(function(){var i=qe(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ge(i,o).value[t]}}function Ta(e,t){var n;return(typeof t=="number"?vt:t instanceof bn?Lr:(n=bn(t))?(t=n,Lr):Tv)(e,t)}function Qv(e){return function(){this.removeAttribute(e)}}function Jv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jv(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function em(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function tm(e,t,n){var o,i,r;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===i?r:(i=l,r=t(o=s,a)))}}function nm(e,t,n){var o,i,r;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===i?r:(i=l,r=t(o=s,a)))}}function om(e,t){var n=Co(e),o=n==="transform"?zv:Ta;return this.attrTween(e,typeof t=="function"?(n.local?nm:tm)(n,o,Hi(this,"attr."+e,t)):t==null?(n.local?Jv:Qv)(n):(n.local?em:jv)(n,o,t))}function im(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function rm(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function sm(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&rm(e,r)),n}return i._value=t,i}function am(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&im(e,r)),n}return i._value=t,i}function lm(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=Co(e);return this.tween(n,(o.local?sm:am)(o,t))}function um(e,t){return function(){Ri(this,e).delay=+t.apply(this,arguments)}}function cm(e,t){return t=+t,function(){Ri(this,e).delay=t}}function dm(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?um:cm)(t,e)):Ge(this.node(),t).delay}function fm(e,t){return function(){qe(this,e).duration=+t.apply(this,arguments)}}function hm(e,t){return t=+t,function(){qe(this,e).duration=t}}function gm(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fm:hm)(t,e)):Ge(this.node(),t).duration}function pm(e,t){if(typeof t!="function")throw new Error;return function(){qe(this,e).ease=t}}function vm(e){var t=this._id;return arguments.length?this.each(pm(t,e)):Ge(this.node(),t).ease}function mm(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qe(this,e).ease=n}}function ym(e){if(typeof e!="function")throw new Error;return this.each(mm(this._id,e))}function wm(e){typeof e!="function"&&(e=da(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new at(o,this._parents,this._name,this._id)}function _m(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,g=0;g<c;++g)(h=l[g]||u[g])&&(d[g]=h);for(;a<o;++a)s[a]=t[a];return new at(s,this._parents,this._name,this._id)}function bm(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 $m(e,t,n){var o,i,r=bm(t)?Ri:qe;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function xm(e,t){var n=this._id;return arguments.length<2?Ge(this.node(),n).on.on(e):this.each($m(n,e,t))}function Em(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Sm(){return this.on("end.remove",Em(this._id))}function Nm(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Di(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,Mo(u[h],t,n,h,u,Ge(c,n)));return new at(r,this._parents,t,n)}function Cm(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ca(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),g,x=Ge(c,n),m=0,E=h.length;m<E;++m)(g=h[m])&&Mo(g,t,n,m,h,x);r.push(h),s.push(c)}return new at(r,s,t,n)}var km=Cn.prototype.constructor;function Mm(){return new km(this._groups,this._parents)}function Im(e,t){var n,o,i;return function(){var r=Kt(this,e),s=(this.style.removeProperty(e),Kt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function Aa(e){return function(){this.style.removeProperty(e)}}function Tm(e,t,n){var o,i=n+"",r;return function(){var s=Kt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function Am(e,t,n){var o,i,r;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===i?r:(i=l,r=t(o=s,a))}}function Pm(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=qe(this,e),u=l.on,c=l.value[r]==null?a||(a=Aa(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function Dm(e,t,n){var o=(e+="")=="transform"?Dv:Ta;return t==null?this.styleTween(e,Im(e,o)).on("end.style."+e,Aa(e)):typeof t=="function"?this.styleTween(e,Am(e,o,Hi(this,"style."+e,t))).each(Pm(this._id,e)):this.styleTween(e,Tm(e,o,t),n).on("end.style."+e,null)}function zm(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Om(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&zm(e,s,n)),o}return r._value=t,r}function Bm(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,Om(e,t,n??""))}function Rm(e){return function(){this.textContent=e}}function Hm(e){return function(){var t=e(this);this.textContent=t??""}}function Vm(e){return this.tween("text",typeof e=="function"?Hm(Hi(this,"text",e)):Rm(e==null?"":e+""))}function Fm(e){return function(t){this.textContent=e.call(this,t)}}function Lm(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Fm(i)),t}return o._value=e,o}function Ym(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,Lm(e))}function Gm(){for(var e=this._name,t=this._id,n=Pa(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Ge(l,t);Mo(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new at(o,this._parents,e,n)}function Xm(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=qe(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var Um=0;function at(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Pa(){return++Um}var Je=Cn.prototype;at.prototype={constructor:at,select:Nm,selectAll:Cm,selectChild:Je.selectChild,selectChildren:Je.selectChildren,filter:wm,merge:_m,selection:Mm,transition:Gm,call:Je.call,nodes:Je.nodes,node:Je.node,size:Je.size,empty:Je.empty,each:Je.each,on:xm,attr:om,attrTween:lm,style:Dm,styleTween:Bm,text:Vm,textTween:Ym,remove:Sm,tween:qv,delay:dm,duration:gm,ease:vm,easeVarying:ym,end:Xm,[Symbol.iterator]:Je[Symbol.iterator]};function Wm(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Zm={time:null,delay:0,duration:250,ease:Wm};function Km(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 qm(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=Pa(),(n=Zm).time=Bi(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Mo(l,e,t,u,s,n||Km(l,t));return new at(o,this._parents,e,t)}Cn.prototype.interrupt=Wv;Cn.prototype.transition=qm;const Vn=e=>()=>e;function Qm(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){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:i}})}function ot(e,t,n){this.k=e,this.x=t,this.y=n}ot.prototype={constructor:ot,scale:function(e){return e===1?this:new ot(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ot(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 Vi=new ot(1,0,0);ot.prototype;function Go(e){e.stopImmediatePropagation()}function tn(e){e.preventDefault(),e.stopImmediatePropagation()}function Jm(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function jm(){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 Kr(){return this.__zoom||Vi}function e0(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function t0(){return navigator.maxTouchPoints||"ontouchstart"in this}function n0(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function o0(){var e=Jm,t=jm,n=n0,o=e0,i=t0,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Hv,u=Pi("start","zoom","end"),c,d,h,g=500,x=150,m=0,E=10;function w(f){f.property("__zoom",Kr).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",M).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(f,N,p,I){var S=f.selection?f.selection():f;S.property("__zoom",Kr),f!==S?D(f,N,p,I):S.interrupt().each(function(){O(this,arguments).event(I).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},w.scaleBy=function(f,N,p,I){w.scaleTo(f,function(){var S=this.__zoom.k,P=typeof N=="function"?N.apply(this,arguments):N;return S*P},p,I)},w.scaleTo=function(f,N,p,I){w.transform(f,function(){var S=t.apply(this,arguments),P=this.__zoom,T=p==null?A(S):typeof p=="function"?p.apply(this,arguments):p,R=P.invert(T),U=typeof N=="function"?N.apply(this,arguments):N;return n(b(k(P,U),T,R),S,s)},p,I)},w.translateBy=function(f,N,p,I){w.transform(f,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof p=="function"?p.apply(this,arguments):p),t.apply(this,arguments),s)},null,I)},w.translateTo=function(f,N,p,I,S){w.transform(f,function(){var P=t.apply(this,arguments),T=this.__zoom,R=I==null?A(P):typeof I=="function"?I.apply(this,arguments):I;return n(Vi.translate(R[0],R[1]).scale(T.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof p=="function"?-p.apply(this,arguments):-p),P,s)},I,S)};function k(f,N){return N=Math.max(r[0],Math.min(r[1],N)),N===f.k?f:new ot(N,f.x,f.y)}function b(f,N,p){var I=N[0]-p[0]*f.k,S=N[1]-p[1]*f.k;return I===f.x&&S===f.y?f:new ot(f.k,I,S)}function A(f){return[(+f[0][0]+ +f[1][0])/2,(+f[0][1]+ +f[1][1])/2]}function D(f,N,p,I){f.on("start.zoom",function(){O(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(I).end()}).tween("zoom",function(){var S=this,P=arguments,T=O(S,P).event(I),R=t.apply(S,P),U=p==null?A(R):typeof p=="function"?p.apply(S,P):p,ee=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),V=S.__zoom,Y=typeof N=="function"?N.apply(S,P):N,Q=l(V.invert(U).concat(ee/V.k),Y.invert(U).concat(ee/Y.k));return function(ie){if(ie===1)ie=Y;else{var ae=Q(ie),re=ee/ae[2];ie=new ot(re,U[0]-ae[0]*re,U[1]-ae[1]*re)}T.zoom(null,ie)}})}function O(f,N,p){return!p&&f.__zooming||new z(f,N)}function z(f,N){this.that=f,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(f,N),this.taps=0}z.prototype={event:function(f){return f&&(this.sourceEvent=f),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(f,N){return this.mouse&&f!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&f!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&f!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(f){var N=yt(this.that).datum();u.call(f,this.that,new Qm(f,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:u}),N)}};function H(f,...N){if(!e.apply(this,arguments))return;var p=O(this,N).event(f),I=this.__zoom,S=Math.max(r[0],Math.min(r[1],I.k*Math.pow(2,o.apply(this,arguments)))),P=ht(f);if(p.wheel)(p.mouse[0][0]!==P[0]||p.mouse[0][1]!==P[1])&&(p.mouse[1]=I.invert(p.mouse[0]=P)),clearTimeout(p.wheel);else{if(I.k===S)return;p.mouse=[P,I.invert(P)],qn(this),p.start()}tn(f),p.wheel=setTimeout(T,x),p.zoom("mouse",n(b(k(I,S),p.mouse[0],p.mouse[1]),p.extent,s));function T(){p.wheel=null,p.end()}}function G(f,...N){if(h||!e.apply(this,arguments))return;var p=f.currentTarget,I=O(this,N,!0).event(f),S=yt(f.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",ee,!0),P=ht(f,p),T=f.clientX,R=f.clientY;fv(f.view),Go(f),I.mouse=[P,this.__zoom.invert(P)],qn(this),I.start();function U(V){if(tn(V),!I.moved){var Y=V.clientX-T,Q=V.clientY-R;I.moved=Y*Y+Q*Q>m}I.event(V).zoom("mouse",n(b(I.that.__zoom,I.mouse[0]=ht(V,p),I.mouse[1]),I.extent,s))}function ee(V){S.on("mousemove.zoom mouseup.zoom",null),hv(V.view,I.moved),tn(V),I.event(V).end()}}function F(f,...N){if(e.apply(this,arguments)){var p=this.__zoom,I=ht(f.changedTouches?f.changedTouches[0]:f,this),S=p.invert(I),P=p.k*(f.shiftKey?.5:2),T=n(b(k(p,P),I,S),t.apply(this,N),s);tn(f),a>0?yt(this).transition().duration(a).call(D,T,I,f):yt(this).call(w.transform,T,I,f)}}function L(f,...N){if(e.apply(this,arguments)){var p=f.touches,I=p.length,S=O(this,N,f.changedTouches.length===I).event(f),P,T,R,U;for(Go(f),T=0;T<I;++T)R=p[T],U=ht(R,this),U=[U,this.__zoom.invert(U),R.identifier],S.touch0?!S.touch1&&S.touch0[2]!==U[2]&&(S.touch1=U,S.taps=0):(S.touch0=U,P=!0,S.taps=1+!!c);c&&(c=clearTimeout(c)),P&&(S.taps<2&&(d=U[0],c=setTimeout(function(){c=null},g)),qn(this),S.start())}}function M(f,...N){if(this.__zooming){var p=O(this,N).event(f),I=f.changedTouches,S=I.length,P,T,R,U;for(tn(f),P=0;P<S;++P)T=I[P],R=ht(T,this),p.touch0&&p.touch0[2]===T.identifier?p.touch0[0]=R:p.touch1&&p.touch1[2]===T.identifier&&(p.touch1[0]=R);if(T=p.that.__zoom,p.touch1){var ee=p.touch0[0],V=p.touch0[1],Y=p.touch1[0],Q=p.touch1[1],ie=(ie=Y[0]-ee[0])*ie+(ie=Y[1]-ee[1])*ie,ae=(ae=Q[0]-V[0])*ae+(ae=Q[1]-V[1])*ae;T=k(T,Math.sqrt(ie/ae)),R=[(ee[0]+Y[0])/2,(ee[1]+Y[1])/2],U=[(V[0]+Q[0])/2,(V[1]+Q[1])/2]}else if(p.touch0)R=p.touch0[0],U=p.touch0[1];else return;p.zoom("touch",n(b(T,R,U),p.extent,s))}}function Z(f,...N){if(this.__zooming){var p=O(this,N).event(f),I=f.changedTouches,S=I.length,P,T;for(Go(f),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),P=0;P<S;++P)T=I[P],p.touch0&&p.touch0[2]===T.identifier?delete p.touch0:p.touch1&&p.touch1[2]===T.identifier&&delete p.touch1;if(p.touch1&&!p.touch0&&(p.touch0=p.touch1,delete p.touch1),p.touch0)p.touch0[1]=this.__zoom.invert(p.touch0[0]);else if(p.end(),p.taps===2&&(T=ht(T,this),Math.hypot(d[0]-T[0],d[1]-T[1])<E)){var R=yt(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return w.wheelDelta=function(f){return arguments.length?(o=typeof f=="function"?f:Vn(+f),w):o},w.filter=function(f){return arguments.length?(e=typeof f=="function"?f:Vn(!!f),w):e},w.touchable=function(f){return arguments.length?(i=typeof f=="function"?f:Vn(!!f),w):i},w.extent=function(f){return arguments.length?(t=typeof f=="function"?f:Vn([[+f[0][0],+f[0][1]],[+f[1][0],+f[1][1]]]),w):t},w.scaleExtent=function(f){return arguments.length?(r[0]=+f[0],r[1]=+f[1],w):[r[0],r[1]]},w.translateExtent=function(f){return arguments.length?(s[0][0]=+f[0][0],s[1][0]=+f[1][0],s[0][1]=+f[0][1],s[1][1]=+f[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(f){return arguments.length?(n=f,w):n},w.duration=function(f){return arguments.length?(a=+f,w):a},w.interpolate=function(f){return arguments.length?(l=f,w):l},w.on=function(){var f=u.on.apply(u,arguments);return f===u?w:f},w.clickDistance=function(f){return arguments.length?(m=(f=+f)*f,w):Math.sqrt(m)},w.tapDistance=function(f){return arguments.length?(E=+f,w):E},w}const Da=Symbol("MiniMapSlots"),i0=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],r0={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},s0=fe({...r0,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:t}){const n=e,o=Bt(Da),i=wi(),r=we(()=>i.style??{});function s(d){t("click",d)}function a(d){t("dblclick",d)}function l(d){t("mouseenter",d)}function u(d){t("mousemove",d)}function c(d){t("mouseleave",d)}return(d,h)=>!d.hidden&&d.dimensions.width!==0&&d.dimensions.height!==0?(X(),le(Ie,{key:0},[C(o)[`node-${n.type}`]?(X(),xe(ts(C(o)[`node-${n.type}`]),Qn(Yt({key:0},{...n,...d.$attrs})),null,16)):(X(),le("rect",Yt({key:1,id:d.id},d.$attrs,{class:["vue-flow__minimap-node",{selected:d.selected,dragging:d.dragging}],x:d.position.x,y:d.position.y,rx:d.borderRadius,ry:d.borderRadius,width:d.dimensions.width,height:d.dimensions.height,fill:d.color||r.value.background||r.value.backgroundColor,stroke:d.strokeColor,"stroke-width":d.strokeWidth,"shape-rendering":d.shapeRendering,onClick:s,onDblclick:a,onMouseenter:l,onMousemove:u,onMouseleave:c}),null,16,i0))],64)):Me("",!0)}}),a0=["width","height","viewBox","aria-labelledby"],l0=["id"],u0=["d","fill","stroke","stroke-width"],c0={name:"MiniMap",compatConfig:{MODE:3}},d0=fe({...c0,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:10},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:t}){const n=es(),o=wi(),i=200,r=150,{id:s,edges:a,viewport:l,translateExtent:u,dimensions:c,emits:d,d3Selection:h,d3Zoom:g,getNodesInitialized:x}=$e(),m=he();Pt(Da,n);const E=we(()=>{var S;return e.width??((S=o.style)==null?void 0:S.width)??i}),w=we(()=>{var S;return e.height??((S=o.style)==null?void 0:S.height)??r}),k=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",b=K(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),A=K(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),D=K(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),O=K(()=>ki(x.value.filter(S=>!S.hidden))),z=K(()=>({x:-l.value.x/l.value.zoom,y:-l.value.y/l.value.zoom,width:c.value.width/l.value.zoom,height:c.value.height/l.value.zoom})),H=K(()=>x.value&&x.value.length?$f(O.value,z.value):z.value),G=K(()=>{const S=H.value.width/E.value,P=H.value.height/w.value;return Math.max(S,P)}),F=K(()=>{const S=G.value*E.value,P=G.value*w.value,T=e.offsetScale*G.value;return{offset:T,x:H.value.x-(S-H.value.width)/2-T,y:H.value.y-(P-H.value.height)/2-T,width:S+T*2,height:P+T*2}}),L=K(()=>!F.value.x||!F.value.y?"":`
27
+ M${F.value.x-F.value.offset},${F.value.y-F.value.offset}
28
+ h${F.value.width+F.value.offset*2}
29
+ v${F.value.height+F.value.offset*2}
30
+ h${-F.value.width-F.value.offset*2}z
31
+ M${z.value.x+e.maskBorderRadius},${z.value.y}
32
+ h${z.value.width-2*e.maskBorderRadius}
33
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
34
+ v${z.value.height-2*e.maskBorderRadius}
35
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
36
+ h${-(z.value.width-2*e.maskBorderRadius)}
37
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
38
+ v${-(z.value.height-2*e.maskBorderRadius)}
39
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);Wa(S=>{if(m.value){const P=yt(m.value),T=ee=>{if(ee.sourceEvent.type!=="wheel"||!h.value||!g.value)return;const V=-ee.sourceEvent.deltaY*(ee.sourceEvent.deltaMode===1?.05:ee.sourceEvent.deltaMode?1:.002)*e.zoomStep,Y=l.value.zoom*2**V;g.value.scaleTo(h.value,Y)},R=ee=>{if(ee.sourceEvent.type!=="mousemove"||!h.value||!g.value)return;const V=G.value*Math.max(1,l.value.zoom)*(e.inversePan?-1:1),Y={x:l.value.x-ee.sourceEvent.movementX*V,y:l.value.y-ee.sourceEvent.movementY*V},Q=[[0,0],[c.value.width,c.value.height]],ie=Vi.translate(Y.x,Y.y).scale(l.value.zoom),ae=g.value.constrain()(ie,Q,u.value);g.value.transform(h.value,ae)},U=o0().on("zoom",e.pannable?R:()=>{}).on("zoom.wheel",e.zoomable?T:()=>{});P.call(U),S(()=>{P.on("zoom",null)})}},{flush:"post"});function M(S){const[P,T]=ht(S);t("click",{event:S,position:{x:P,y:T}})}function Z(S,P){const T={event:S,node:P,connectedEdges:St([P],a.value)};d.miniMapNodeClick(T),t("nodeClick",T)}function f(S,P){const T={event:S,node:P,connectedEdges:St([P],a.value)};d.miniMapNodeDoubleClick(T),t("nodeDblclick",T)}function N(S,P){const T={event:S,node:P,connectedEdges:St([P],a.value)};d.miniMapNodeMouseEnter(T),t("nodeMouseenter",T)}function p(S,P){const T={event:S,node:P,connectedEdges:St([P],a.value)};d.miniMapNodeMouseMove(T),t("nodeMousemove",T)}function I(S,P){const T={event:S,node:P,connectedEdges:St([P],a.value)};d.miniMapNodeMouseLeave(T),t("nodeMouseleave",T)}return(S,P)=>(X(),xe(C($g),{position:S.position,class:He(["vue-flow__minimap",{pannable:S.pannable,zoomable:S.zoomable}])},{default:ue(()=>[(X(),le("svg",{ref_key:"el",ref:m,width:E.value,height:w.value,viewBox:[F.value.x,F.value.y,F.value.width,F.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${C(s)}`,onClick:M},[S.ariaLabel?(X(),le("title",{key:0,id:`vue-flow__minimap-${C(s)}`},ze(S.ariaLabel),9,l0)):Me("",!0),(X(!0),le(Ie,null,Mt(C(x),T=>(X(),xe(s0,{id:T.id,key:T.id,position:T.computedPosition,dimensions:T.dimensions,selected:T.selected,dragging:T.dragging,style:Se(T.style),class:He(D.value(T)),color:b.value(T),"border-radius":S.nodeBorderRadius,"stroke-color":A.value(T),"stroke-width":S.nodeStrokeWidth,"shape-rendering":C(k),type:T.type,hidden:T.hidden,onClick:R=>Z(R,T),onDblclick:R=>f(R,T),onMouseenter:R=>N(R,T),onMousemove:R=>p(R,T),onMouseleave:R=>I(R,T)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),ye("path",{class:"vue-flow__minimap-mask",d:L.value,fill:S.maskColor,stroke:S.maskStrokeColor,"stroke-width":S.maskStrokeWidth,"fill-rule":"evenodd"},null,8,u0)],8,a0))]),_:1},8,["position","class"]))}}),{HORIZONTAL_STEP:f0,VERTICAL_STEP:h0}=al;function g0(e){const t={},n=e.length;if(n===0)return t;const o=Math.ceil(Math.sqrt(n)),i=Math.ceil(n/o);let r=0,s=0,a=0;for(let l=0;l<i;l++){let u=0;s=0;for(let c=0;c<o&&r<n;c++){const d=e[r],h=sl(d.columns.length),g=_i({schemaName:d.schema,tableName:d.table});t[g]={x:u,y:a},u+=f0,s=Math.max(s,h+h0),r++}a+=s}return t}function p0(e){const t=Object.values(e).map(c=>c.x),n=Object.values(e).map(c=>c.y);if(t.length===0||n.length===0)return e;const o=Math.min(...t),i=Math.max(...t),r=Math.min(...n),s=Math.max(...n),a=(o+i)/2,l=(r+s)/2,u={};for(const[c,d]of Object.entries(e))u[c]={x:d.x-a,y:d.y-l};return u}const v0=e=>{let t=g0(e);t=p0(t);const n=il(e,t),o=rl(e);return{nodes:n,edges:o}},mt=(e,t)=>`${e}-${t}`,xt=(e,t,n,o)=>{const{id:i,sourceHandle:r,targetHandle:s,sourceNode:a,targetNode:l,selectable:u}=e,c=t||(o==null?void 0:o.edgeId)===i||(n==null?void 0:n.edgeIds.has(i))||!1;e.animated=c;const d=(E,w,k)=>{if(!E||!w)return;E.label||(E.label=new Map);const b=E.label;k?b.set(w,!0):b.delete(w)},h=mt(a==null?void 0:a.id,r),g=mt(l==null?void 0:l.id,s),x=c||u||(n==null?void 0:n.relatedColumnIds.has(h))||(o==null?void 0:o.sourceId)===h||t,m=c||u||(n==null?void 0:n.relatedColumnIds.has(g))||(o==null?void 0:o.targetId)===g||t;d(a,r,!!x),d(l,s,!!m)},mi=({findNode:e,fitView:t,getViewport:n,nodeId:o})=>{if(!e(o))return;const r=n().zoom;t({nodes:[o],maxZoom:r,minZoom:r,duration:ll})},qr=e=>(e||0)*un-un/2-1+2+10+un,m0={class:"table-node"},y0={class:"w-fit text-center px-2 box-border text-white text-xl"},w0=["onClick"],_0={class:"col-span-2 py-2 truncate flex items-center gap-1"},b0={class:"w-6 flex items-center justify-center"},$0={class:"truncate"},x0={class:"col-span-1 py-2 truncate text-center text-muted-foreground"},E0=fe({__name:"ValueNode",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,{findNode:n,fitView:o,getViewport:i}=$e(),r=K(()=>new Set(t.data.primary_keys.map(h=>h.column))),s=K(()=>new Set(t.data.foreign_keys.map(h=>h.column))),a=K(()=>t.data.columns.map(h=>({...h,isPrimary:r.value.has(h.name),isForeign:s.value.has(h.name)}))),l=K(()=>new Map(a.value.map((h,g)=>[h.name,g+1]))),u=K(()=>t.data.foreign_keys.map(({column:h})=>{const g=l.value.get(h);return{id:h,top:qr(g)}})),c=K(()=>t.data.primary_keys.map(({column:h})=>{const g=l.value.get(h);return{id:h,top:qr(g)}})),d=h=>{if(!h.isForeign)return;const g=t.data.foreign_keys.find(m=>m.column===h.name);if(!g)return;const x=_i({schemaName:g.reference_schema,tableName:g.reference_table});mi({nodeId:x,findNode:n,fitView:o,getViewport:i})};return(h,g)=>{const x=Ae;return X(),le("div",m0,[ye("div",{class:"flex flex-col rounded-md",style:Se({width:C(is)+"px"})},[ye("div",{class:"rounded-t-md box-border p-2 bg-primary/90 flex items-center justify-center",style:Se({height:C(un)+10+"px"})},[ye("p",y0,ze(h.data.table)+" "+ze(h.data.schema==="public"?"":`(${h.data.schema})`),1)],4),(X(!0),le(Ie,null,Mt(a.value,m=>{var E;return X(),le("div",{key:m.name,class:He(["grid grid-cols-3 px-2 border-t ",m.isForeign&&"cursor-pointer hover:bg-blue-200/80",((E=h.label)==null?void 0:E.get(m.name))&&"bg-blue-200/40"]),style:Se({height:C(un)+"px"}),onClick:w=>d(m)},[ye("div",_0,[ye("div",b0,[m.isPrimary?(X(),xe(x,{key:0,name:"hugeicons:key-01",class:"w-4 text-yellow-400 text-xl"})):m.isForeign?(X(),xe(x,{key:1,name:"hugeicons:key-01",class:"min-w-4 text-gray-400 text-xl"})):m.nullable?(X(),xe(x,{key:2,name:"hugeicons:diamond",class:"min-w-4 text-gray-300"})):(X(),xe(x,{key:3,name:"mynaui:diamond-solid",class:"min-w-4 text-gray-300"}))]),ye("p",$0,ze(m.name),1),m.isForeign?(X(),xe(x,{key:0,name:"hugeicons:link-04",class:"min-w-3 text-gray-400"})):Me("",!0)]),ye("div",x0,ze(m.type),1)],14,w0)}),128))],4),(X(!0),le(Ie,null,Mt(u.value,m=>(X(),xe(C(Zt),{key:m.id,type:"source",id:m.id,position:C(te).Left,connectable:!1,style:Se({top:m.top+"px",left:C(Li),height:C(Fi),opacity:0})},null,8,["id","position","style"]))),128)),(X(!0),le(Ie,null,Mt(c.value,m=>(X(),xe(C(Zt),{key:m.id,type:"target",id:m.id,position:C(te).Right,connectable:!1,style:Se({top:m.top+"px",right:C(Li),height:C(Fi),opacity:0})},null,8,["id","position","style"]))),128))])}}}),S0=vl(E0,[["__scopeId","data-v-bfa916a0"]]),Qr=fe({__name:"Kbd",props:{class:{}},setup(e){const t=e;return(n,o)=>(X(),le("kbd",{class:He(C(yi)("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",t.class))},[Te(n.$slots,"default")],2))}}),N0=fe({__name:"KbdGroup",props:{class:{}},setup(e){const t=e;return(n,o)=>(X(),le("kbd",{"data-slot":"kbd-group",class:He(C(yi)("inline-flex items-center gap-1",t.class))},[Te(n.$slots,"default")],2))}}),C0={class:"absolute bottom-1 z-10 left-1/2 -translate-x-1/2 w-fit h-10 bg-background box-border border-2 border-border rounded-lg p-1 flex flex-row gap-0.5"},k0={class:"w-7 h-7 text-center py-0.5 text-sm flex items-center justify-center"},M0=fe({__name:"ErdControls",props:{isHand:{type:Boolean},isUseBgGrid:{type:[String,Boolean]},isUseMiniMap:{type:Boolean},isShowFilter:{type:Boolean}},emits:["update:isHand","update:isUseBgGrid","update:isUseMiniMap","update:isShowFilter","arrange"],setup(e,{emit:t}){const n=e,{zoomIn:o,zoomOut:i,fitView:r,getViewport:s}=$e(),a=t,l=K(()=>Math.round(s().zoom*100)),u=()=>a("update:isHand",!n.isHand),c=()=>{if(!n.isUseBgGrid){a("update:isUseBgGrid","dots");return}if(n.isUseBgGrid==="dots"){a("update:isUseBgGrid","lines");return}a("update:isUseBgGrid",!1)},d=()=>a("update:isUseMiniMap",!n.isUseMiniMap),h=()=>a("update:isShowFilter",!n.isShowFilter),g=()=>a("arrange"),x=()=>i({duration:Ln}),m=()=>o({duration:Ln}),E=()=>r({duration:Ln});return(w,k)=>(X(),le("div",C0,[q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:w.isUseBgGrid?"secondary":"ghost",size:"iconMd",onClick:k[0]||(k[0]=b=>c())},{default:ue(()=>[q(C(Ae),{name:"hugeicons:grid",class:"size-4!"})]),_:1},8,["variant"])]),_:1}),q(C(ct),null,{default:ue(()=>[Re(ze(w.isUseBgGrid?"Hide grid":"Show grid"),1)]),_:1})]),_:1}),q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:w.isUseMiniMap?"secondary":"ghost",size:"iconMd",onClick:k[1]||(k[1]=b=>d())},{default:ue(()=>[q(C(Ae),{name:"hugeicons:dashboard-circle",class:"size-4"})]),_:1},8,["variant"])]),_:1}),q(C(ct),null,{default:ue(()=>[Re(ze(w.isUseMiniMap?"Hide minimap":"Show minimap"),1)]),_:1})]),_:1}),q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:w.isHand?"secondary":"ghost",size:"iconMd",onClick:k[2]||(k[2]=b=>u())},{default:ue(()=>[w.isHand?(X(),xe(C(Ae),{key:1,name:"hugeicons:hold-04",class:"size-4!"})):(X(),xe(C(Ae),{key:0,name:"hugeicons:hold-03",class:"size-4!"}))]),_:1},8,["variant"])]),_:1}),q(C(ct),null,{default:ue(()=>k[4]||(k[4]=[Re("Click to enable pan mode "),ye("br",null,null,-1),Re(" Or hold Space/Middle mouse + drag to pan")])),_:1})]),_:1}),q(C(Yi),{orientation:"vertical",class:"mx-1.5"}),q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:"ghost",size:"iconMd",onClick:x},{default:ue(()=>[q(C(Ae),{name:"hugeicons:minus-sign",class:"size-4!"})]),_:1})]),_:1}),q(C(ct),null,{default:ue(()=>k[5]||(k[5]=[Re("Zoom out")])),_:1})]),_:1}),ye("div",k0,ze(C(l)),1),q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:"ghost",size:"iconMd",onClick:m},{default:ue(()=>[q(C(Ae),{name:"hugeicons:add-01",class:"size-4!"})]),_:1})]),_:1}),q(C(ct),null,{default:ue(()=>k[6]||(k[6]=[Re("Zoom in")])),_:1})]),_:1}),q(C(Yi),{orientation:"vertical",class:"mx-1.5"}),q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:"ghost",size:"iconMd",onClick:E},{default:ue(()=>[q(C(Ae),{name:"hugeicons:center-focus",class:"size-4!"})]),_:1})]),_:1}),q(C(ct),null,{default:ue(()=>k[7]||(k[7]=[Re("Fit to view")])),_:1})]),_:1}),q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:"ghost",size:"iconMd",onClick:g},{default:ue(()=>[q(C(Ae),{name:"hugeicons:coordinate-01",class:"size-4!"})]),_:1})]),_:1}),q(C(ct),null,{default:ue(()=>k[8]||(k[8]=[Re("Arrange the diagram")])),_:1})]),_:1}),q(C(lt),null,{default:ue(()=>[q(C(ut),{"as-child":""},{default:ue(()=>[q(C(je),{variant:w.isShowFilter?"secondary":"ghost",size:"iconMd",onClick:k[3]||(k[3]=b=>h())},{default:ue(()=>[q(C(Ae),{name:"hugeicons:filter",class:"size-4"})]),_:1},8,["variant"])]),_:1}),q(C(ct),null,{default:ue(()=>[Re(ze(w.isShowFilter?"Hide filter":"Show filter")+" ",1),q(C(N0),null,{default:ue(()=>[q(C(Qr),null,{default:ue(()=>k[9]||(k[9]=[Re("⌘")])),_:1}),q(C(Qr),null,{default:ue(()=>k[10]||(k[10]=[Re("f")])),_:1})]),_:1})]),_:1})]),_:1})]))}}),I0=["id","markerWidth","markerHeight"],T0=["fill"],A0=["fill"],P0=fe({__name:"MarkerMany",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(X(),le("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"0",markerUnits:"userSpaceOnUse"},[ye("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M23.2381 1.93974C23.481 1.80822 23.5712 1.50476 23.4396 1.26195C23.3081 1.01914 23.0047 0.928928 22.7619 1.06045L10.7619 7.56045C10.6063 7.64471 10.5068 7.80491 10.5003 7.98171C10.4938 8.15851 10.5817 8.32587 10.7306 8.42134L10.7532 8.43574L10.8193 8.47786C10.8773 8.51474 10.9627 8.5689 11.0728 8.63831C11.293 8.77712 11.6121 8.97693 12.0083 9.22151C12.8004 9.71055 13.9017 10.379 15.1381 11.0967C17.6 12.5258 20.6347 14.172 22.8291 14.97C23.0886 15.0644 23.3755 14.9305 23.4699 14.671C23.5643 14.4115 23.4304 14.1246 23.1709 14.0302C21.0695 13.2661 18.1042 11.6623 15.6401 10.2319C14.5191 9.58119 13.5096 8.97094 12.7436 8.5H23.3333C23.6095 8.5 23.8333 8.27614 23.8333 8C23.8333 7.72386 23.6095 7.5 23.3333 7.5H12.973L23.2381 1.93974ZM11 8.0001L10.7306 8.42134C10.7306 8.42134 10.7302 8.42105 11 8.0001Z"},null,12,T0),ye("path",{style:Se({strokeWidth:t.strokeWidth}),d:"M6.665 13.16C9.24141 13.16 11.33 11.0714 11.33 8.495C11.33 5.91859 9.24141 3.83 6.665 3.83C4.08859 3.83 2 5.91859 2 8.495C2 11.0714 4.08859 13.16 6.665 13.16Z",fill:"transparent"},null,4),ye("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M6.665 4.33C4.36473 4.33 2.5 6.19473 2.5 8.495C2.5 10.7953 4.36473 12.66 6.665 12.66C8.96527 12.66 10.83 10.7953 10.83 8.495C10.83 6.19473 8.96527 4.33 6.665 4.33ZM1.5 8.495C1.5 5.64245 3.81245 3.33 6.665 3.33C9.51755 3.33 11.83 5.64245 11.83 8.495C11.83 11.3476 9.51755 13.66 6.665 13.66C3.81245 13.66 1.5 11.3476 1.5 8.495Z"},null,12,A0)],8,I0))}}),D0=["id","markerWidth","markerHeight"],z0=["fill"],O0=["fill"],B0=["fill"],R0=fe({__name:"MarkerZeroOrOne",props:{id:{},fill:{default:"#b1b1b7"},strokeWidth:{default:1.5},width:{default:24},height:{default:24}},setup(e){return(t,n)=>(X(),le("marker",{id:t.id,viewBox:"0 0 24 24",refX:"2",refY:"8",markerWidth:t.width,markerHeight:t.height,orient:"180",markerUnits:"userSpaceOnUse"},[ye("path",{style:Se({strokeWidth:t.strokeWidth}),d:"M6.665 12.6601C9.24141 12.6601 11.33 10.5715 11.33 7.99508C11.33 5.41867 9.24141 3.33008 6.665 3.33008C4.08859 3.33008 2 5.41867 2 7.99508C2 10.5715 4.08859 12.6601 6.665 12.6601Z",fill:"transparent"},null,4),ye("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M6.665 3.83008C4.36473 3.83008 2.5 5.69481 2.5 7.99508C2.5 10.2953 4.36473 12.1601 6.665 12.1601C8.96527 12.1601 10.83 10.2953 10.83 7.99508C10.83 5.69481 8.96527 3.83008 6.665 3.83008ZM1.5 7.99508C1.5 5.14253 3.81245 2.83008 6.665 2.83008C9.51755 2.83008 11.83 5.14253 11.83 7.99508C11.83 10.8476 9.51755 13.1601 6.665 13.1601C3.81245 13.1601 1.5 10.8476 1.5 7.99508Z"},null,12,z0),ye("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,fillRule:"evenodd",clipRule:"evenodd",d:"M16 2.83008C16.2761 2.83008 16.5 3.05394 16.5 3.33008V12.6634C16.5 12.9396 16.2761 13.1634 16 13.1634C15.7239 13.1634 15.5 12.9396 15.5 12.6634V3.33008C15.5 3.05394 15.7239 2.83008 16 2.83008Z"},null,12,O0),ye("path",{style:Se({strokeWidth:t.strokeWidth}),fill:t.fill,d:"M23.5 7.5H11V8.5H23.5V7.5Z"},null,12,B0)],8,D0))}}),H0=fe({__name:"CustomEdge",props:{id:{},sourceNode:{},targetNode:{},source:{},target:{},type:{},label:{},style:{},selected:{type:Boolean},sourcePosition:{},targetPosition:{},sourceHandleId:{},targetHandleId:{},animated:{type:Boolean},updatable:{type:Boolean},markerStart:{},markerEnd:{},curvature:{},interactionWidth:{},data:{},events:{},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{},sourceX:{},sourceY:{},targetX:{},targetY:{}},setup(e){const t=e,n=K(()=>Ti({sourceX:t.sourceX,sourceY:t.sourceY,sourcePosition:t.sourcePosition,targetX:t.targetX,targetY:t.targetY,targetPosition:t.targetPosition,curvature:.6})),o=K(()=>`${t.id}-marker-zero-or-one`),i=K(()=>`${t.id}-marker-many`),r=K(()=>{var a,l;return((a=t.sourceNode)==null?void 0:a.selected)||((l=t.targetNode)==null?void 0:l.selected)||t.animated?"var(--color-primary)":"var(--color-zinc-400)"});return(s,a)=>(X(),le(Ie,null,[q(C(Nn),{id:s.id,path:n.value[0],"marker-start":`url(#${i.value})`,"marker-end":`url(#${o.value})`,style:Se({stroke:r.value,strokeWidth:s.animated?3:1.5})},null,8,["id","path","marker-start","marker-end","style"]),q(R0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:o.value},null,8,["fill","id"]),q(P0,{fill:r.value,"stroke-width":1.5,width:30,height:30,id:i.value},null,8,["fill","id"])],64))}}),V0={class:"px-2 pt-2 flex flex-col h-full w-full"},F0={class:"text-base font-normal"},L0={class:"relative w-full pt-2 mb-2"},Y0={class:"h-full w-[19rem] overflow-y-auto"},G0=fe({__name:"ErdFilterPanal",props:{isShowFilter:{type:Boolean},tables:{},tableId:{}},emits:["update:isShowFilter","focusTable"],setup(e,{emit:t}){const n=e,o=t,i=Za(""),r=Ka(i,Qa),s=K(()=>cl(n.tableId||"")),a=K(()=>{const u=[];return n.tables.forEach(c=>{if(!c.table.toLowerCase().includes(r.value.toLowerCase()))return;const d=_i({schemaName:c.schema,tableName:c.table}),h={title:c.table,id:d,icon:"vscode-icons:file-type-sql",closeIcon:"vscode-icons:file-type-sql",path:d,isFolder:!1};u.push(h)}),u}),l=(u,c)=>{const{value:d}=c;o("focusTable",d.id)};return(u,c)=>{const d=qa,h=je,g=ul;return X(),le("div",{class:He(["flex flex-col h-full bg-background absolute right-0 top-0 shadow transition-all ease-in-out",[u.isShowFilter?"w-[20rem]":"w-[0rem]"]])},[ye("div",{class:"w-5 h-8 absolute -left-5 top-2 cursor-pointer bg-background border border-r-0 rounded-l-md flex-col justify-center flex items-center",onClick:c[0]||(c[0]=x=>o("update:isShowFilter",!u.isShowFilter))},[u.isShowFilter?(X(),xe(C(Ae),{key:0,name:"hugeicons:arrow-right-01",class:"size-5!"})):(X(),xe(C(Ae),{key:1,name:"hugeicons:arrow-left-01",class:"size-5!"}))]),ye("div",V0,[ye("div",null,[ye("h1",F0,ze(C(s).tableName),1),c[4]||(c[4]=ye("p",{class:"text-muted-foreground text-sm"}," This view only show this table and relations ",-1))]),ye("div",L0,[q(d,{type:"text",placeholder:"Search tables",class:"pr-6 w-full h-8",modelValue:C(i),"onUpdate:modelValue":c[1]||(c[1]=x=>rt(i)?i.value=x:null)},null,8,["modelValue"]),C(i)?(X(),le("div",{key:0,class:"absolute right-2 top-3.5 w-4 cursor-pointer hover:bg-accent",onClick:c[2]||(c[2]=x=>i.value="")},[q(C(Ae),{name:"lucide:x",class:"stroke-3! text-muted-foreground"})])):Me("",!0)]),ye("div",Y0,[q(g,{class:"overflow-x-hidden",explorerFiles:C(a),"onUpdate:explorerFiles":c[3]||(c[3]=x=>rt(a)?a.value=x:null),isShowArrow:!1,isExpandedByArrow:!1,onClickTreeItem:l},{"extra-actions":ue(()=>[q(h,{size:"iconSm",class:"hover:bg-background",variant:"ghost"},{default:ue(()=>[q(C(Ae),{name:"hugeicons:dashed-line-circle",class:"size-4! min-w-4 text-muted-foreground"})]),_:1})]),_:1},8,["explorerFiles"])])])],2)}}});function X0(e){const t=he(!1),n=he(!0),o=he("dots"),i=he({tableId:"",relatedColumnIds:new Set,edgeIds:new Set}),r=he({edgeId:"",sourceId:"",targetId:""}),{getEdges:s,findEdge:a,findNode:l,fitView:u,getViewport:c,getNodes:d}=$e(),h=D=>{if(!e.focusTableId)return;const O=D.findNode(e.focusTableId);if(!O)return;const z=new Set,H=new Set,G=!0;O.selected=!0,s.value.forEach(F=>{if(F.sourceNode.id===O.id||F.targetNode.id===O.id){const L=mt(F.sourceNode.id,F.sourceHandle),M=mt(F.targetNode.id,F.targetHandle);H.add(L),H.add(M),z.add(F.id),xt(F,G,i.value,r.value)}}),i.value={tableId:O.id,edgeIds:z,relatedColumnIds:H}},g=D=>{D.sort((z,H)=>Number(z.selected)-Number(H.selected)).forEach(z=>{if(z.type!=="select")return;const H=z.selected;s.value.forEach(G=>{var Z,f,N,p,I,S;if(!(G.sourceNode.id===z.id||G.targetNode.id===z.id))return;const L=mt(G.sourceNode.id,G.sourceHandle),M=mt(G.targetNode.id,G.targetHandle);H?((Z=i.value)==null||Z.relatedColumnIds.add(L),(f=i.value)==null||f.relatedColumnIds.add(M),(N=i.value)==null||N.edgeIds.add(G.id)):((p=i.value)==null||p.relatedColumnIds.delete(L),(I=i.value)==null||I.relatedColumnIds.delete(M),(S=i.value)==null||S.edgeIds.delete(G.id)),xt(G,H,i.value,r.value)})})};return{isUseBgGrid:o,isUseMiniMap:n,isHand:t,activeTable:i,activeEdge:r,onInitVueFlow:h,onNodesChange:g,onEdgesChange:D=>{D.forEach(O=>{if(O.type!=="select")return;const z=a(O.id);if(!z)return;const H=O.selected,G=mt(z.sourceNode.id,z.sourceHandle),F=mt(z.targetNode.id,z.targetHandle);r.value=H?{edgeId:O.id,sourceId:G,targetId:F}:null,xt(z,H,i.value,r.value)})},onNodeMouseEnter:({node:D})=>{D.selected||s.value.forEach(O=>{(O.sourceNode.id===D.id||O.targetNode.id===D.id)&&xt(O,!0,i.value,r.value)})},onNodeMouseLeave:({node:D})=>{D.selected||s.value.forEach(O=>{(O.sourceNode.id===D.id||O.targetNode.id===D.id)&&xt(O,!1,i.value,r.value)})},handleEdgeMouseEnter:({edge:D})=>{D.selected||xt(D,!0,i.value,r.value)},handleEdgeMouseLeave:({edge:D})=>{D.selected||xt(D,!1,i.value,r.value)},onDoubleClickEdge:({edge:D})=>{D.selected=!0,mi({nodeId:D.source,findNode:l,fitView:u,getViewport:c})},getNodes:d,fitView:u,onfocusNode:D=>{mi({nodeId:D,findNode:l,fitView:u,getViewport:c});const O=l(D);O&&(O.selected=!0,g([{id:D,type:"select",selected:!0}]))}}}const U0=fe({__name:"ErdDiagram",props:{nodes:{},edges:{},focusTableId:{},isShowFilter:{type:Boolean},matrixTablePosition:{},tables:{},tableId:{}},emits:["update:isShowFilter"],setup(e,{emit:t}){const{width:n,height:o}=Ja(),i=e,r=t,{onInitVueFlow:s,onNodesChange:a,onEdgesChange:l,onNodeMouseEnter:u,onNodeMouseLeave:c,handleEdgeMouseEnter:d,handleEdgeMouseLeave:h,onDoubleClickEdge:g,isHand:x,isUseBgGrid:m,isUseMiniMap:E,getNodes:w,fitView:k,onfocusNode:b}=X0(i),A=()=>{var D;(D=w.value)==null||D.forEach(O=>{var H;const z=(H=i.matrixTablePosition)==null?void 0:H[O.id];z&&(O.position=z)}),k({duration:Ln})};return(D,O)=>(X(),le(Ie,null,[q(C(_g),{class:"erd-flow w-full","pan-on-drag":C(x),"pan-on-scroll":!0,"pan-on-scroll-speed":1.2,nodes:i.nodes,edges:i.edges,"default-viewport":{zoom:C(hl),x:C(n)/2-C(is)/2,y:C(o)/2-200},"min-zoom":C(fl),"max-zoom":C(dl),onInit:C(s),onNodeMouseEnter:C(u),onNodeMouseLeave:C(c),onEdgeMouseEnter:C(d),onEdgeMouseLeave:C(h),onNodesChange:C(a),onEdgesChange:C(l),onEdgeDoubleClick:C(g)},{"edge-custom":ue(z=>[q(H0,Qn(Xo(z)),null,16)]),"node-value":ue(z=>[q(S0,Qn(Xo(z)),null,16)]),default:ue(()=>[C(m)?(X(),xe(C(Mg),{key:0,size:2,gap:30,variant:C(m)},null,8,["variant"])):Me("",!0),C(E)?(X(),xe(C(d0),{key:1,pannable:"",position:"top-right","node-color":"var(--primary)",nodeBorderRadius:10})):Me("",!0),q(M0,{isShowFilter:i.isShowFilter,isHand:C(x),"onUpdate:isHand":O[0]||(O[0]=z=>rt(x)?x.value=z:null),isUseBgGrid:C(m),"onUpdate:isUseBgGrid":O[1]||(O[1]=z=>rt(m)?m.value=z:null),isUseMiniMap:C(E),"onUpdate:isUseMiniMap":O[2]||(O[2]=z=>rt(E)?E.value=z:null),"onUpdate:isShowFilter":O[3]||(O[3]=z=>r("update:isShowFilter",z)),onArrange:A},null,8,["isShowFilter","isHand","isUseBgGrid","isUseMiniMap"])]),_:1},8,["pan-on-drag","nodes","edges","default-viewport","min-zoom","max-zoom","onInit","onNodeMouseEnter","onNodeMouseLeave","onEdgeMouseEnter","onEdgeMouseLeave","onNodesChange","onEdgesChange","onEdgeDoubleClick"]),q(G0,{isShowFilter:i.isShowFilter,"onUpdate:isShowFilter":[O[4]||(O[4]=z=>i.isShowFilter=z),O[5]||(O[5]=z=>r("update:isShowFilter",z))],"table-id":i.tableId,tables:i.tables,onFocusTable:C(b)},null,8,["isShowFilter","table-id","tables","onFocusTable"])],64))}}),W0=ja("erdStore",()=>{const e=he(""),t=he([]);function n(i){t.value=i}function o(i){e.value=i}return{currentConnectionId:e,tables:t,setTables:n,setCurrentConnectionId:o}},{persist:!1}),Z0=()=>{var s,a;const{connectionStore:e}=el(),t=W0();if(t.tables.length>0&&((s=e.selectedConnection)==null?void 0:s.id)===t.currentConnectionId)return{isFetching:!1,tableSchema:we(t.tables||[])};const{data:n,status:o}=yl("/api/get-tables",{method:"POST",body:{dbConnectionString:(a=e.selectedConnection)==null?void 0:a.connectionString},onResponseError({response:l}){tl(l==null?void 0:l.statusText)},onResponse:({response:l})=>{var c;const u=l._data.tables||[];t.setTables(u),t.setCurrentConnectionId(((c=e.selectedConnection)==null?void 0:c.id)||"")}},"$13ug5ALprk"),i=K(()=>o.value==="pending"),r=K(()=>{var l;return((l=n.value)==null?void 0:l.tables)||[]});return{isFetching:i,tableSchema:r}},K0=["id"],ny=fe({__name:"WrapperErdDiagram",props:{tableId:{}},setup(e){const t=e,n=he(),{tableSchema:o,isFetching:i}=Z0(),r=K(()=>{if(t.tableId)return gl(t.tableId,o.value||[])}),s=K(()=>r.value?t.tableId?pl(r.value):v0(o.value||[]):{nodes:[],edges:[]}),a=he(!1),l=()=>{a.value=!a.value};return nl([{key:"meta+f",callback:()=>{l()},isPreventDefault:!0}],{target:n}),(u,c)=>{var h,g;const d=ol;return X(),le("div",{class:"w-full h-full relative",ref_key:"wrapperRef",ref:n,id:C(ml)()},[q(d,{visible:C(i)},null,8,["visible"]),q(U0,{nodes:s.value.nodes,edges:s.value.edges,matrixTablePosition:(h=s.value)==null?void 0:h.matrixPosition,focusTableId:t.tableId,tables:((g=r.value)==null?void 0:g.tables)||[],tableId:u.tableId,isShowFilter:C(a),"onUpdate:isShowFilter":c[0]||(c[0]=x=>rt(a)?a.value=x:null)},null,8,["nodes","edges","matrixTablePosition","focusTableId","tables","tableId","isShowFilter"])],8,K0)}}});export{ny as _,Yi as a};