@visulima/vis 1.0.0-alpha.37 → 1.0.0-alpha.38

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 (177) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE.md +1 -503
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +1 -1
  5. package/dist/config/index.d.ts +7 -0
  6. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
  7. package/dist/packem_chunks/bin.js +302 -515
  8. package/dist/packem_chunks/bloom-sync.js +1 -1
  9. package/dist/packem_chunks/catalog-detector.js +1 -0
  10. package/dist/packem_chunks/detect.js +3 -0
  11. package/dist/packem_chunks/detect2.js +8 -0
  12. package/dist/packem_chunks/discord.js +4 -0
  13. package/dist/packem_chunks/dynamic-import.js +1 -0
  14. package/dist/packem_chunks/extra-files.js +3 -0
  15. package/dist/packem_chunks/fix.js +1 -1
  16. package/dist/packem_chunks/git.js +3 -0
  17. package/dist/packem_chunks/handler10.js +1 -1
  18. package/dist/packem_chunks/handler12.js +1 -1
  19. package/dist/packem_chunks/handler13.js +1 -1
  20. package/dist/packem_chunks/handler14.js +1 -1
  21. package/dist/packem_chunks/handler15.js +1 -1
  22. package/dist/packem_chunks/handler16.js +1 -1
  23. package/dist/packem_chunks/handler17.js +1 -1
  24. package/dist/packem_chunks/handler18.js +1 -1
  25. package/dist/packem_chunks/handler19.js +1 -1
  26. package/dist/packem_chunks/handler21.js +1 -1
  27. package/dist/packem_chunks/handler27.js +1 -1
  28. package/dist/packem_chunks/handler28.js +1 -1
  29. package/dist/packem_chunks/handler29.js +1 -1
  30. package/dist/packem_chunks/handler3.js +4 -4
  31. package/dist/packem_chunks/handler30.js +2 -7
  32. package/dist/packem_chunks/handler31.js +2 -33
  33. package/dist/packem_chunks/handler32.js +2 -3
  34. package/dist/packem_chunks/handler33.js +3 -8
  35. package/dist/packem_chunks/handler34.js +6 -4
  36. package/dist/packem_chunks/handler35.js +1 -1
  37. package/dist/packem_chunks/handler36.js +42 -5
  38. package/dist/packem_chunks/handler37.js +8 -11
  39. package/dist/packem_chunks/handler38.js +9 -3
  40. package/dist/packem_chunks/handler39.js +74 -21
  41. package/dist/packem_chunks/handler4.js +1 -1
  42. package/dist/packem_chunks/handler40.js +5 -61
  43. package/dist/packem_chunks/handler41.js +4 -3
  44. package/dist/packem_chunks/handler42.js +3 -6
  45. package/dist/packem_chunks/handler43.js +2 -24
  46. package/dist/packem_chunks/handler44.js +1 -25
  47. package/dist/packem_chunks/handler45.js +1 -153
  48. package/dist/packem_chunks/handler46.js +1 -10
  49. package/dist/packem_chunks/handler47.js +3 -24
  50. package/dist/packem_chunks/handler48.js +1 -322
  51. package/dist/packem_chunks/handler49.js +7 -708
  52. package/dist/packem_chunks/handler5.js +6 -6
  53. package/dist/packem_chunks/handler50.js +33 -48
  54. package/dist/packem_chunks/handler51.js +3 -27
  55. package/dist/packem_chunks/handler52.js +8 -3
  56. package/dist/packem_chunks/handler53.js +4 -200
  57. package/dist/packem_chunks/handler54.js +1 -38
  58. package/dist/packem_chunks/handler55.js +12 -0
  59. package/dist/packem_chunks/handler56.js +7 -0
  60. package/dist/packem_chunks/handler57.js +5 -0
  61. package/dist/packem_chunks/handler58.js +11 -0
  62. package/dist/packem_chunks/handler59.js +3 -0
  63. package/dist/packem_chunks/handler60.js +22 -0
  64. package/dist/packem_chunks/handler61.js +61 -0
  65. package/dist/packem_chunks/handler62.js +3 -0
  66. package/dist/packem_chunks/handler63.js +6 -0
  67. package/dist/packem_chunks/handler64.js +708 -0
  68. package/dist/packem_chunks/handler65.js +24 -0
  69. package/dist/packem_chunks/handler66.js +25 -0
  70. package/dist/packem_chunks/handler67.js +153 -0
  71. package/dist/packem_chunks/handler68.js +10 -0
  72. package/dist/packem_chunks/handler69.js +24 -0
  73. package/dist/packem_chunks/handler7.js +1 -1
  74. package/dist/packem_chunks/handler70.js +322 -0
  75. package/dist/packem_chunks/handler71.js +48 -0
  76. package/dist/packem_chunks/handler72.js +27 -0
  77. package/dist/packem_chunks/handler73.js +3 -0
  78. package/dist/packem_chunks/handler74.js +190 -0
  79. package/dist/packem_chunks/handler75.js +38 -0
  80. package/dist/packem_chunks/handler8.js +1 -1
  81. package/dist/packem_chunks/handler9.js +1 -1
  82. package/dist/packem_chunks/heal-accept.js +1 -1
  83. package/dist/packem_chunks/heal.js +1 -1
  84. package/dist/packem_chunks/help-command.js +1 -1
  85. package/dist/packem_chunks/index.js +1 -7
  86. package/dist/packem_chunks/index2.js +7 -0
  87. package/dist/packem_chunks/interface.js +2 -0
  88. package/dist/packem_chunks/keys-refresh.js +1 -1
  89. package/dist/packem_chunks/list.js +1 -1
  90. package/dist/packem_chunks/loader.js +1 -1
  91. package/dist/packem_chunks/orchestrator.js +39 -0
  92. package/dist/packem_chunks/pre-mode.js +2 -0
  93. package/dist/packem_chunks/print-config.js +2 -0
  94. package/dist/packem_chunks/prompts.js +7 -0
  95. package/dist/packem_chunks/publish-guards.js +1 -0
  96. package/dist/packem_chunks/registry.js +48 -0
  97. package/dist/packem_chunks/resolveFormatter.js +9 -0
  98. package/dist/packem_chunks/security.js +1 -0
  99. package/dist/packem_chunks/shell-runner.js +1 -0
  100. package/dist/packem_chunks/slack.js +2 -0
  101. package/dist/packem_chunks/snapshot.js +2 -0
  102. package/dist/packem_chunks/stage-publisher.js +1 -0
  103. package/dist/packem_chunks/staged-registry.js +2 -0
  104. package/dist/packem_chunks/state.js +3 -0
  105. package/dist/packem_chunks/success-walk.js +8 -0
  106. package/dist/packem_chunks/sync.js +1 -1
  107. package/dist/packem_chunks/sync2.js +1 -1
  108. package/dist/packem_chunks/tripwire.js +1 -1
  109. package/dist/packem_chunks/verify-lockfile.js +2 -2
  110. package/dist/packem_chunks/version-resolver.js +2 -0
  111. package/dist/packem_chunks/webhook.js +1 -0
  112. package/dist/packem_chunks/workflow-templates.js +167 -0
  113. package/dist/packem_chunks/workspace.js +2 -0
  114. package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
  115. package/dist/packem_shared/ReleaseClient-YHzBIxYS.js +1 -0
  116. package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
  117. package/dist/packem_shared/{ai-analysis-DT3bU-_M.js → ai-analysis-K-DKU3ZA.js} +1 -1
  118. package/dist/packem_shared/{ai-fix-BkNqd5nP.js → ai-fix-BPrYoCk8.js} +1 -1
  119. package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
  120. package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
  121. package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
  122. package/dist/packem_shared/{cyclonedx-86-DbHtf.js → cyclonedx-kYozDyxp.js} +3 -3
  123. package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
  124. package/dist/packem_shared/dependency-scan-anTuZB1t.js +1 -0
  125. package/dist/packem_shared/{docker-tNrDU3oK.js → docker-BMLrNtWm.js} +1 -1
  126. package/dist/packem_shared/{failure-log-Dwqt6_Ga.js → failure-log-CEWP3bP0.js} +1 -1
  127. package/dist/packem_shared/index-BJbpNthk.js +1 -0
  128. package/dist/packem_shared/index-CgcF6_wo.js +1 -0
  129. package/dist/packem_shared/{index-dQ37x8_P.js → index-D1_fbGbj.js} +1 -1
  130. package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
  131. package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
  132. package/dist/packem_shared/{missing-package-json-41VUWFBY.js → missing-package-json-BfWUxTGv.js} +1 -1
  133. package/dist/packem_shared/{native-config-sync-BKAZ0NIs.js → native-config-sync-BEkJW7g3.js} +8 -8
  134. package/dist/packem_shared/pm-runner-OGResYrA.js +1 -0
  135. package/dist/packem_shared/provenance-_CJjMKwu.js +1 -0
  136. package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
  137. package/dist/packem_shared/{registry-keys-Bf2zzlcZ.js → registry-keys-BfFto6vI.js} +1 -1
  138. package/dist/packem_shared/{resolve-explicit-jH0RKyMJ.js → resolve-explicit-CMDl55Nz.js} +2 -2
  139. package/dist/packem_shared/s1ngularity-Dhr3bPk0.js +1 -0
  140. package/dist/packem_shared/{scan-progress-JBbd9QeT.js → scan-progress-DG7_JmTV.js} +1 -1
  141. package/dist/packem_shared/{signatures-D1H6h6GH.js → signatures-C730vkyK.js} +2 -2
  142. package/dist/packem_shared/slug-DoueYuLo.js +1 -0
  143. package/dist/packem_shared/spinner-CV3WVJLv.js +1 -0
  144. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
  145. package/dist/packem_shared/{tabs-BqUepRaD.js → tabs-BuTy5gPV.js} +1 -1
  146. package/dist/packem_shared/{typosquats-C8qg1neE.js → typosquats-DN78xx1x.js} +1 -1
  147. package/dist/packem_shared/use-measured-height-_eVGWtWt.js +1 -0
  148. package/dist/packem_shared/verify-6WCmFmy8.js +1 -0
  149. package/dist/packem_shared/{vis-update-app-CTwRkNgj.js → vis-update-app-k3fDxech.js} +1 -1
  150. package/dist/release/core/changelog/index.d.ts +5 -0
  151. package/dist/release/core/changelog/index.js +1 -0
  152. package/dist/release/core/package-managers/index.d.ts +6 -0
  153. package/dist/release/core/package-managers/index.js +1 -0
  154. package/dist/release/core/version-actions/index.d.ts +14 -0
  155. package/dist/release/core/version-actions/index.js +1 -0
  156. package/dist/release/index.d.ts +196 -0
  157. package/dist/release/index.js +1 -0
  158. package/dist/release/plugin-sdk.d.ts +127 -0
  159. package/dist/release/plugin-sdk.js +1 -0
  160. package/dist/release/presets.d.ts +225 -0
  161. package/dist/release/presets.js +1 -0
  162. package/dist/release/types.d.ts +1377 -0
  163. package/dist/release/types.js +1 -0
  164. package/index.d.ts +201 -201
  165. package/index.js +578 -752
  166. package/package.json +52 -10
  167. package/schemas/vis-config.schema.json +1394 -6
  168. package/schemas/vis-release-config.schema.json +1390 -0
  169. package/dist/packem_shared/dependency-scan-BDTH898x.js +0 -1
  170. package/dist/packem_shared/index-CB4p298r.js +0 -1
  171. package/dist/packem_shared/index-DMefdF51.js +0 -1
  172. package/dist/packem_shared/pm-runner-pVihAfxV.js +0 -1
  173. package/dist/packem_shared/provenance-DMuEftgc.js +0 -1
  174. package/dist/packem_shared/s1ngularity-BkfgC6NO.js +0 -1
  175. package/dist/packem_shared/spinner-BXSl864p.js +0 -1
  176. package/dist/packem_shared/use-measured-height-BBJ9intr.js +0 -1
  177. package/dist/packem_shared/verify-Du7xZ2BJ.js +0 -1
@@ -1,708 +1,7 @@
1
- import{createRequire as fr}from"node:module";import{j as Ge,q as kt,E as fe}from"../packem_shared/Table-CcVkyULl-B_ef6zfS.js";import{projectGraphToDot as mr}from"@visulima/task-runner";import{a4 as d,a5 as T,g as x,aE as br,aF as yr,aG as wr,aD as vr,t as he,ae as xr,aH as kr,aI as Et,b as Er,O as Gr,$ as _r,k as jr,j as Sr}from"./bin.js";import{g as Ot}from"../packem_shared/_commonjsHelpers-B5Y90VFO.js";import{d as Ir}from"../packem_shared/anolilab-text-CAM_E6uK.js";const gr=fr(import.meta.url),Ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,et=y=>{if(typeof Ve<"u"&&Ve.versions&&Ve.versions.node){const[l,h]=Ve.versions.node.split(".").map(Number);if(l>22||l===22&&h>=3||l===20&&h>=16)return Ve.getBuiltinModule(y)}return gr(y)},{readFileSync:Ar}=et("node:fs"),{createRequire:Nr}=et("node:module"),{join:Cr,dirname:Dr}=et("node:path"),Mr=et("events");var st,Gt;function Tr(){if(Gt)return st;Gt=1;var y=Mr;function l(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function h(r,o,n){if(N())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,o);var t=new(r.bind.apply(r,e));return n&&D(t,n.prototype),t}function u(r,o,n){return(o=C(o))in r?Object.defineProperty(r,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[o]=n,r}function v(r){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(o){return o.__proto__||Object.getPrototypeOf(o)},v(r)}function m(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,D(r,o)}function k(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch{return typeof r=="function"}}function N(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N=function(){return!!r})()}function D(r,o){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},D(r,o)}function j(r,o){if(typeof r!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var e=n.call(r,o);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(r)}function C(r){var o=j(r,"string");return typeof o=="symbol"?o:o+""}function I(r){"@babel/helpers - typeof";return I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},I(r)}function q(r){var o=typeof Map=="function"?new Map:void 0;return q=function(n){if(n===null||!k(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(o!==void 0){if(o.has(n))return o.get(n);o.set(n,e)}function e(){return h(n,arguments,v(this).constructor)}return e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),D(e,n)},q(r)}function z(){for(var r=arguments[0],o=1,n=arguments.length;o<n;o++)if(arguments[o])for(var e in arguments[o])r[e]=arguments[o][e];return r}var L=z;typeof Object.assign=="function"&&(L=Object.assign);function $(r,o,n,e){var t=r._nodes.get(o),i=null;return t&&(e==="mixed"?i=t.out&&t.out[n]||t.undirected&&t.undirected[n]:e==="directed"?i=t.out&&t.out[n]:i=t.undirected&&t.undirected[n]),i}function R(r){return I(r)==="object"&&r!==null}function K(r){var o;for(o in r)return!1;return!0}function W(r,o,n){Object.defineProperty(r,o,{enumerable:!1,configurable:!1,writable:!0,value:n})}function B(r,o,n){var e={enumerable:!0,configurable:!0};typeof n=="function"?e.get=n:(e.value=n,e.writable=!1),Object.defineProperty(r,o,e)}function ie(r){return!(!R(r)||r.attributes&&!Array.isArray(r.attributes))}function de(){var r=Math.floor(Math.random()*256)&255;return function(){return r++}}function ce(){var r=arguments,o=null,n=-1;return u(u({},Symbol.iterator,function(){return this}),"next",function(){var e=null;do{if(o===null){if(n++,n>=r.length)return{done:!0};o=r[n][Symbol.iterator]()}if(e=o.next(),e.done){o=null;continue}break}while(!0);return e})}function re(){return u(u({},Symbol.iterator,function(){return this}),"next",function(){return{done:!0}})}var _e=(function(r){m(o,r);function o(n){var e;return e=r.call(this)||this,e.name="GraphError",e.message=n,e}return o})(q(Error)),G=(function(r){m(o,r);function o(n){var e;return e=r.call(this,n)||this,e.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(l(e),o.prototype.constructor),e}return o})(_e),_=(function(r){m(o,r);function o(n){var e;return e=r.call(this,n)||this,e.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(l(e),o.prototype.constructor),e}return o})(_e),w=(function(r){m(o,r);function o(n){var e;return e=r.call(this,n)||this,e.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(l(e),o.prototype.constructor),e}return o})(_e);function c(r,o){this.key=r,this.attributes=o,this.clear()}c.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function X(r,o){this.key=r,this.attributes=o,this.clear()}X.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function je(r,o){this.key=r,this.attributes=o,this.clear()}je.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function S(r,o,n,e,t){this.key=o,this.attributes=t,this.undirected=r,this.source=n,this.target=e}S.prototype.attach=function(){var r="out",o="in";this.undirected&&(r=o="undirected");var n=this.source.key,e=this.target.key;this.source[r][e]=this,!(this.undirected&&n===e)&&(this.target[o][n]=this)},S.prototype.attachMulti=function(){var r="out",o="in",n=this.source.key,e=this.target.key;this.undirected&&(r=o="undirected");var t=this.source[r],i=t[e];if(typeof i>"u"){t[e]=this,this.undirected&&n===e||(this.target[o][n]=this);return}i.previous=this,this.next=i,t[e]=this,this.target[o][n]=this},S.prototype.detach=function(){var r=this.source.key,o=this.target.key,n="out",e="in";this.undirected&&(n=e="undirected"),delete this.source[n][o],delete this.target[e][r]},S.prototype.detachMulti=function(){var r=this.source.key,o=this.target.key,n="out",e="in";this.undirected&&(n=e="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][o],delete this.target[e][r]):(this.next.previous=void 0,this.source[n][o]=this.next,this.target[e][r]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var f=0,Q=1,ee=2,ge=3;function se(r,o,n,e,t,i,a){var s,p,g,E;if(e=""+e,n===f){if(s=r._nodes.get(e),!s)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));g=t,E=i}else if(n===ge){if(t=""+t,p=r._edges.get(t),!p)throw new _("Graph.".concat(o,': could not find the "').concat(t,'" edge in the graph.'));var A=p.source.key,M=p.target.key;if(e===A)s=p.target;else if(e===M)s=p.source;else throw new _("Graph.".concat(o,': the "').concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(A,", ").concat(M,")."));g=i,E=a}else{if(p=r._edges.get(e),!p)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'));n===Q?s=p.source:s=p.target,g=t,E=i}return[s,g,E]}function oe(r,o,n){r.prototype[o]=function(e,t,i){var a=se(this,o,n,e,t,i),s=a[0],p=a[1];return s.attributes[p]}}function F(r,o,n){r.prototype[o]=function(e,t){var i=se(this,o,n,e,t),a=i[0];return a.attributes}}function We(r,o,n){r.prototype[o]=function(e,t,i){var a=se(this,o,n,e,t,i),s=a[0],p=a[1];return s.attributes.hasOwnProperty(p)}}function pe(r,o,n){r.prototype[o]=function(e,t,i,a){var s=se(this,o,n,e,t,i,a),p=s[0],g=s[1],E=s[2];return p.attributes[g]=E,this.emit("nodeAttributesUpdated",{key:p.key,type:"set",attributes:p.attributes,name:g}),this}}function rt(r,o,n){r.prototype[o]=function(e,t,i,a){var s=se(this,o,n,e,t,i,a),p=s[0],g=s[1],E=s[2];if(typeof E!="function")throw new G("Graph.".concat(o,": updater should be a function."));var A=p.attributes,M=E(A[g]);return A[g]=M,this.emit("nodeAttributesUpdated",{key:p.key,type:"set",attributes:p.attributes,name:g}),this}}function Me(r,o,n){r.prototype[o]=function(e,t,i){var a=se(this,o,n,e,t,i),s=a[0],p=a[1];return delete s.attributes[p],this.emit("nodeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:p}),this}}function nt(r,o,n){r.prototype[o]=function(e,t,i){var a=se(this,o,n,e,t,i),s=a[0],p=a[1];if(!R(p))throw new G("Graph.".concat(o,": provided attributes are not a plain object."));return s.attributes=p,this.emit("nodeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function Le(r,o,n){r.prototype[o]=function(e,t,i){var a=se(this,o,n,e,t,i),s=a[0],p=a[1];if(!R(p))throw new G("Graph.".concat(o,": provided attributes are not a plain object."));return L(s.attributes,p),this.emit("nodeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:p}),this}}function J(r,o,n){r.prototype[o]=function(e,t,i){var a=se(this,o,n,e,t,i),s=a[0],p=a[1];if(typeof p!="function")throw new G("Graph.".concat(o,": provided updater is not a function."));return s.attributes=p(s.attributes),this.emit("nodeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}var H=[{name:function(r){return"get".concat(r,"Attribute")},attacher:oe},{name:function(r){return"get".concat(r,"Attributes")},attacher:F},{name:function(r){return"has".concat(r,"Attribute")},attacher:We},{name:function(r){return"set".concat(r,"Attribute")},attacher:pe},{name:function(r){return"update".concat(r,"Attribute")},attacher:rt},{name:function(r){return"remove".concat(r,"Attribute")},attacher:Me},{name:function(r){return"replace".concat(r,"Attributes")},attacher:nt},{name:function(r){return"merge".concat(r,"Attributes")},attacher:Le},{name:function(r){return"update".concat(r,"Attributes")},attacher:J}];function V(r){H.forEach(function(o){var n=o.name,e=o.attacher;e(r,n("Node"),f),e(r,n("Source"),Q),e(r,n("Target"),ee),e(r,n("Opposite"),ge)})}function me(r,o,n){r.prototype[o]=function(e,t){var i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+t;if(t=arguments[2],i=$(this,a,s,n),!i)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,i=this._edges.get(e),!i)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}return i.attributes[t]}}function U(r,o,n){r.prototype[o]=function(e){var t;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,a=""+arguments[1];if(t=$(this,i,a,n),!t)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(i,'" - "').concat(a,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,t=this._edges.get(e),!t)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}return t.attributes}}function O(r,o,n){r.prototype[o]=function(e,t){var i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+t;if(t=arguments[2],i=$(this,a,s,n),!i)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,i=this._edges.get(e),!i)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}return i.attributes.hasOwnProperty(t)}}function b(r,o,n){r.prototype[o]=function(e,t,i){var a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,p=""+t;if(t=arguments[2],i=arguments[3],a=$(this,s,p,n),!a)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(s,'" - "').concat(p,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,a=this._edges.get(e),!a)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}return a.attributes[t]=i,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:t}),this}}function ye(r,o,n){r.prototype[o]=function(e,t,i){var a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,p=""+t;if(t=arguments[2],i=arguments[3],a=$(this,s,p,n),!a)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(s,'" - "').concat(p,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,a=this._edges.get(e),!a)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}if(typeof i!="function")throw new G("Graph.".concat(o,": updater should be a function."));return a.attributes[t]=i(a.attributes[t]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:t}),this}}function Se(r,o,n){r.prototype[o]=function(e,t){var i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+t;if(t=arguments[2],i=$(this,a,s,n),!i)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,i=this._edges.get(e),!i)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}return delete i.attributes[t],this.emit("edgeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:t}),this}}function we(r,o,n){r.prototype[o]=function(e,t){var i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+t;if(t=arguments[2],i=$(this,a,s,n),!i)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,i=this._edges.get(e),!i)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}if(!R(t))throw new G("Graph.".concat(o,": provided attributes are not a plain object."));return i.attributes=t,this.emit("edgeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}function Ae(r,o,n){r.prototype[o]=function(e,t){var i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+t;if(t=arguments[2],i=$(this,a,s,n),!i)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,i=this._edges.get(e),!i)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}if(!R(t))throw new G("Graph.".concat(o,": provided attributes are not a plain object."));return L(i.attributes,t),this.emit("edgeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:t}),this}}function le(r,o,n){r.prototype[o]=function(e,t){var i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new w("Graph.".concat(o,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new w("Graph.".concat(o,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var a=""+e,s=""+t;if(t=arguments[2],i=$(this,a,s,n),!i)throw new _("Graph.".concat(o,': could not find an edge for the given path ("').concat(a,'" - "').concat(s,'").'))}else{if(n!=="mixed")throw new w("Graph.".concat(o,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,i=this._edges.get(e),!i)throw new _("Graph.".concat(o,': could not find the "').concat(e,'" edge in the graph.'))}if(typeof t!="function")throw new G("Graph.".concat(o,": provided updater is not a function."));return i.attributes=t(i.attributes),this.emit("edgeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}var Ne=[{name:function(r){return"get".concat(r,"Attribute")},attacher:me},{name:function(r){return"get".concat(r,"Attributes")},attacher:U},{name:function(r){return"has".concat(r,"Attribute")},attacher:O},{name:function(r){return"set".concat(r,"Attribute")},attacher:b},{name:function(r){return"update".concat(r,"Attribute")},attacher:ye},{name:function(r){return"remove".concat(r,"Attribute")},attacher:Se},{name:function(r){return"replace".concat(r,"Attributes")},attacher:we},{name:function(r){return"merge".concat(r,"Attributes")},attacher:Ae},{name:function(r){return"update".concat(r,"Attributes")},attacher:le}];function qe(r){Ne.forEach(function(o){var n=o.name,e=o.attacher;e(r,n("Edge"),"mixed"),e(r,n("DirectedEdge"),"directed"),e(r,n("UndirectedEdge"),"undirected")})}var ze=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Re(r,o,n,e){var t=!1;for(var i in o)if(i!==e){var a=o[i];if(t=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),r&&t)return a.key}}function Oe(r,o,n,e){var t,i,a,s=!1;for(var p in o)if(p!==e){t=o[p];do{if(i=t.source,a=t.target,s=n(t.key,t.attributes,i.key,a.key,i.attributes,a.attributes,t.undirected),r&&s)return t.key;t=t.next}while(t!==void 0)}}function ve(r,o){var n=Object.keys(r),e=n.length,t,i=0;return u(u({},Symbol.iterator,function(){return this}),"next",function(){do if(t)t=t.next;else{if(i>=e)return{done:!0};var a=n[i++];if(a===o){t=void 0;continue}t=r[a]}while(!t);return{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}}})}function Ue(r,o,n,e){var t=o[n];if(t){var i=t.source,a=t.target;if(e(t.key,t.attributes,i.key,a.key,i.attributes,a.attributes,t.undirected)&&r)return t.key}}function xe(r,o,n,e){var t=o[n];if(t){var i=!1;do{if(i=e(t.key,t.attributes,t.source.key,t.target.key,t.source.attributes,t.target.attributes,t.undirected),r&&i)return t.key;t=t.next}while(t!==void 0)}}function Ce(r,o){var n=r[o];if(n.next!==void 0)return u(u({},Symbol.iterator,function(){return this}),"next",function(){if(!n)return{done:!0};var t={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:t}});var e=!1;return u(u({},Symbol.iterator,function(){return this}),"next",function(){return e===!0?{done:!0}:(e=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})})}function Fe(r,o){if(r.size===0)return[];if(o==="mixed"||o===r.type)return Array.from(r._edges.keys());for(var n=o==="undirected"?r.undirectedSize:r.directedSize,e=new Array(n),t=o==="undirected",i=r._edges.values(),a=0,s,p;s=i.next(),s.done!==!0;)p=s.value,p.undirected===t&&(e[a++]=p.key);return e}function pt(r,o,n,e){if(o.size!==0){for(var t=n!=="mixed"&&n!==o.type,i=n==="undirected",a,s,p=!1,g=o._edges.values();a=g.next(),a.done!==!0;)if(s=a.value,!(t&&s.undirected!==i)){var E=s,A=E.key,M=E.attributes,P=E.source,Y=E.target;if(p=e(A,M,P.key,Y.key,P.attributes,Y.attributes,s.undirected),r&&p)return A}}}function Ft(r,o){if(r.size===0)return re();var n=o!=="mixed"&&o!==r.type,e=o==="undirected",t=r._edges.values();return u(u({},Symbol.iterator,function(){return this}),"next",function(){for(var i,a;;){if(i=t.next(),i.done)return i;if(a=i.value,!(n&&a.undirected!==e))break}var s={edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected};return{value:s,done:!1}})}function it(r,o,n,e,t,i){var a=o?Oe:Re,s;if(n!=="undirected"&&(e!=="out"&&(s=a(r,t.in,i),r&&s)||e!=="in"&&(s=a(r,t.out,i,e?void 0:t.key),r&&s))||n!=="directed"&&(s=a(r,t.undirected,i),r&&s))return s}function Pt(r,o,n,e){var t=[];return it(!1,r,o,n,e,function(i){t.push(i)}),t}function $t(r,o,n){var e=re();return r!=="undirected"&&(o!=="out"&&typeof n.in<"u"&&(e=ce(e,ve(n.in))),o!=="in"&&typeof n.out<"u"&&(e=ce(e,ve(n.out,o?void 0:n.key)))),r!=="directed"&&typeof n.undirected<"u"&&(e=ce(e,ve(n.undirected))),e}function ot(r,o,n,e,t,i,a){var s=n?xe:Ue,p;if(o!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&(p=s(r,t.in,i,a),r&&p)||typeof t.out<"u"&&e!=="in"&&(e||t.key!==i)&&(p=s(r,t.out,i,a),r&&p))||o!=="directed"&&typeof t.undirected<"u"&&(p=s(r,t.undirected,i,a),r&&p))return p}function Wt(r,o,n,e,t){var i=[];return ot(!1,r,o,n,e,t,function(a){i.push(a)}),i}function qt(r,o,n,e){var t=re();return r!=="undirected"&&(typeof n.in<"u"&&o!=="out"&&e in n.in&&(t=ce(t,Ce(n.in,e))),typeof n.out<"u"&&o!=="in"&&e in n.out&&(o||n.key!==e)&&(t=ce(t,Ce(n.out,e)))),r!=="directed"&&typeof n.undirected<"u"&&e in n.undirected&&(t=ce(t,Ce(n.undirected,e))),t}function Bt(r,o){var n=o.name,e=o.type,t=o.direction;r.prototype[n]=function(i,a){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];if(!arguments.length)return Fe(this,e);if(arguments.length===1){i=""+i;var s=this._nodes.get(i);if(typeof s>"u")throw new _("Graph.".concat(n,': could not find the "').concat(i,'" node in the graph.'));return Pt(this.multi,e==="mixed"?this.type:e,t,s)}if(arguments.length===2){i=""+i,a=""+a;var p=this._nodes.get(i);if(!p)throw new _("Graph.".concat(n,': could not find the "').concat(i,'" source node in the graph.'));if(!this._nodes.has(a))throw new _("Graph.".concat(n,': could not find the "').concat(a,'" target node in the graph.'));return Wt(e,this.multi,t,p,a)}throw new G("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}function Ht(r,o){var n=o.name,e=o.type,t=o.direction,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);r.prototype[i]=function(g,E,A){if(!(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)){if(arguments.length===1)return A=g,pt(!1,this,e,A);if(arguments.length===2){g=""+g,A=E;var M=this._nodes.get(g);if(typeof M>"u")throw new _("Graph.".concat(i,': could not find the "').concat(g,'" node in the graph.'));return it(!1,this.multi,e==="mixed"?this.type:e,t,M,A)}if(arguments.length===3){g=""+g,E=""+E;var P=this._nodes.get(g);if(!P)throw new _("Graph.".concat(i,': could not find the "').concat(g,'" source node in the graph.'));if(!this._nodes.has(E))throw new _("Graph.".concat(i,': could not find the "').concat(E,'" target node in the graph.'));return ot(!1,e,this.multi,t,P,E,A)}throw new G("Graph.".concat(i,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var a="map"+n[0].toUpperCase()+n.slice(1);r.prototype[a]=function(){var g=Array.prototype.slice.call(arguments),E=g.pop(),A;if(g.length===0){var M=0;e!=="directed"&&(M+=this.undirectedSize),e!=="undirected"&&(M+=this.directedSize),A=new Array(M);var P=0;g.push(function(Y,ne,te,ae,ue,be,De){A[P++]=E(Y,ne,te,ae,ue,be,De)})}else A=[],g.push(function(Y,ne,te,ae,ue,be,De){A.push(E(Y,ne,te,ae,ue,be,De))});return this[i].apply(this,g),A};var s="filter"+n[0].toUpperCase()+n.slice(1);r.prototype[s]=function(){var g=Array.prototype.slice.call(arguments),E=g.pop(),A=[];return g.push(function(M,P,Y,ne,te,ae,ue){E(M,P,Y,ne,te,ae,ue)&&A.push(M)}),this[i].apply(this,g),A};var p="reduce"+n[0].toUpperCase()+n.slice(1);r.prototype[p]=function(){var g=Array.prototype.slice.call(arguments);if(g.length<2||g.length>4)throw new G("Graph.".concat(p,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(g.length,")."));if(typeof g[g.length-1]=="function"&&typeof g[g.length-2]!="function")throw new G("Graph.".concat(p,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var E,A;g.length===2?(E=g[0],A=g[1],g=[]):g.length===3?(E=g[1],A=g[2],g=[g[0]]):g.length===4&&(E=g[2],A=g[3],g=[g[0],g[1]]);var M=A;return g.push(function(P,Y,ne,te,ae,ue,be){M=E(M,P,Y,ne,te,ae,ue,be)}),this[i].apply(this,g),M}}function Vt(r,o){var n=o.name,e=o.type,t=o.direction,i="find"+n[0].toUpperCase()+n.slice(1,-1);r.prototype[i]=function(p,g,E){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return!1;if(arguments.length===1)return E=p,pt(!0,this,e,E);if(arguments.length===2){p=""+p,E=g;var A=this._nodes.get(p);if(typeof A>"u")throw new _("Graph.".concat(i,': could not find the "').concat(p,'" node in the graph.'));return it(!0,this.multi,e==="mixed"?this.type:e,t,A,E)}if(arguments.length===3){p=""+p,g=""+g;var M=this._nodes.get(p);if(!M)throw new _("Graph.".concat(i,': could not find the "').concat(p,'" source node in the graph.'));if(!this._nodes.has(g))throw new _("Graph.".concat(i,': could not find the "').concat(g,'" target node in the graph.'));return ot(!0,e,this.multi,t,M,g,E)}throw new G("Graph.".concat(i,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var a="some"+n[0].toUpperCase()+n.slice(1,-1);r.prototype[a]=function(){var p=Array.prototype.slice.call(arguments),g=p.pop();p.push(function(A,M,P,Y,ne,te,ae){return g(A,M,P,Y,ne,te,ae)});var E=this[i].apply(this,p);return!!E};var s="every"+n[0].toUpperCase()+n.slice(1,-1);r.prototype[s]=function(){var p=Array.prototype.slice.call(arguments),g=p.pop();p.push(function(A,M,P,Y,ne,te,ae){return!g(A,M,P,Y,ne,te,ae)});var E=this[i].apply(this,p);return!E}}function Kt(r,o){var n=o.name,e=o.type,t=o.direction,i=n.slice(0,-1)+"Entries";r.prototype[i]=function(a,s){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return re();if(!arguments.length)return Ft(this,e);if(arguments.length===1){a=""+a;var p=this._nodes.get(a);if(!p)throw new _("Graph.".concat(i,': could not find the "').concat(a,'" node in the graph.'));return $t(e,t,p)}if(arguments.length===2){a=""+a,s=""+s;var g=this._nodes.get(a);if(!g)throw new _("Graph.".concat(i,': could not find the "').concat(a,'" source node in the graph.'));if(!this._nodes.has(s))throw new _("Graph.".concat(i,': could not find the "').concat(s,'" target node in the graph.'));return qt(e,t,g,s)}throw new G("Graph.".concat(i,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}function Yt(r){ze.forEach(function(o){Bt(r,o),Ht(r,o),Vt(r,o),Kt(r,o)})}var Xt=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Ye(){this.A=null,this.B=null}Ye.prototype.wrap=function(r){this.A===null?this.A=r:this.B===null&&(this.B=r)},Ye.prototype.has=function(r){return this.A!==null&&r in this.A||this.B!==null&&r in this.B};function Be(r,o,n,e,t){for(var i in e){var a=e[i],s=a.source,p=a.target,g=s===n?p:s;if(!(o&&o.has(g.key))){var E=t(g.key,g.attributes);if(r&&E)return g.key}}}function at(r,o,n,e,t){if(o!=="mixed"){if(o==="undirected")return Be(r,null,e,e.undirected,t);if(typeof n=="string")return Be(r,null,e,e[n],t)}var i=new Ye,a;if(o!=="undirected"){if(n!=="out"){if(a=Be(r,null,e,e.in,t),r&&a)return a;i.wrap(e.in)}if(n!=="in"){if(a=Be(r,i,e,e.out,t),r&&a)return a;i.wrap(e.out)}}if(o!=="directed"&&(a=Be(r,i,e,e.undirected,t),r&&a))return a}function Qt(r,o,n){if(r!=="mixed"){if(r==="undirected")return Object.keys(n.undirected);if(typeof o=="string")return Object.keys(n[o])}var e=[];return at(!1,r,o,n,function(t){e.push(t)}),e}function He(r,o,n){var e=Object.keys(n),t=e.length,i=0;return u(u({},Symbol.iterator,function(){return this}),"next",function(){var a=null;do{if(i>=t)return r&&r.wrap(n),{done:!0};var s=n[e[i++]],p=s.source,g=s.target;if(a=p===o?g:p,r&&r.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}})}function Jt(r,o,n){if(r!=="mixed"){if(r==="undirected")return He(null,n,n.undirected);if(typeof o=="string")return He(null,n,n[o])}var e=re(),t=new Ye;return r!=="undirected"&&(o!=="out"&&(e=ce(e,He(t,n,n.in))),o!=="in"&&(e=ce(e,He(t,n,n.out)))),r!=="directed"&&(e=ce(e,He(t,n,n.undirected))),e}function Zt(r,o){var n=o.name,e=o.type,t=o.direction;r.prototype[n]=function(i){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];i=""+i;var a=this._nodes.get(i);if(typeof a>"u")throw new _("Graph.".concat(n,': could not find the "').concat(i,'" node in the graph.'));return Qt(e==="mixed"?this.type:e,t,a)}}function er(r,o){var n=o.name,e=o.type,t=o.direction,i="forEach"+n[0].toUpperCase()+n.slice(1,-1);r.prototype[i]=function(g,E){if(!(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)){g=""+g;var A=this._nodes.get(g);if(typeof A>"u")throw new _("Graph.".concat(i,': could not find the "').concat(g,'" node in the graph.'));at(!1,e==="mixed"?this.type:e,t,A,E)}};var a="map"+n[0].toUpperCase()+n.slice(1);r.prototype[a]=function(g,E){var A=[];return this[i](g,function(M,P){A.push(E(M,P))}),A};var s="filter"+n[0].toUpperCase()+n.slice(1);r.prototype[s]=function(g,E){var A=[];return this[i](g,function(M,P){E(M,P)&&A.push(M)}),A};var p="reduce"+n[0].toUpperCase()+n.slice(1);r.prototype[p]=function(g,E,A){if(arguments.length<3)throw new G("Graph.".concat(p,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var M=A;return this[i](g,function(P,Y){M=E(M,P,Y)}),M}}function tr(r,o){var n=o.name,e=o.type,t=o.direction,i=n[0].toUpperCase()+n.slice(1,-1),a="find"+i;r.prototype[a]=function(g,E){if(!(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)){g=""+g;var A=this._nodes.get(g);if(typeof A>"u")throw new _("Graph.".concat(a,': could not find the "').concat(g,'" node in the graph.'));return at(!0,e==="mixed"?this.type:e,t,A,E)}};var s="some"+i;r.prototype[s]=function(g,E){var A=this[a](g,E);return!!A};var p="every"+i;r.prototype[p]=function(g,E){var A=this[a](g,function(M,P){return!E(M,P)});return!A}}function rr(r,o){var n=o.name,e=o.type,t=o.direction,i=n.slice(0,-1)+"Entries";r.prototype[i]=function(a){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return re();a=""+a;var s=this._nodes.get(a);if(typeof s>"u")throw new _("Graph.".concat(i,': could not find the "').concat(a,'" node in the graph.'));return Jt(e==="mixed"?this.type:e,t,s)}}function nr(r){Xt.forEach(function(o){Zt(r,o),er(r,o),tr(r,o),rr(r,o)})}function Xe(r,o,n,e,t){for(var i=e._nodes.values(),a=e.type,s,p,g,E,A,M,P;s=i.next(),s.done!==!0;){var Y=!1;if(p=s.value,a!=="undirected"){E=p.out;for(g in E){A=E[g];do M=A.target,Y=!0,P=t(p.key,M.key,p.attributes,M.attributes,A.key,A.attributes,A.undirected),A=A.next;while(A)}}if(a!=="directed"){E=p.undirected;for(g in E)if(!(o&&p.key>g)){A=E[g];do M=A.target,M.key!==g&&(M=A.source),Y=!0,P=t(p.key,M.key,p.attributes,M.attributes,A.key,A.attributes,A.undirected),A=A.next;while(A)}}n&&!Y&&(P=t(p.key,null,p.attributes,null,null,null,null))}}function ir(r,o){var n={key:r};return K(o.attributes)||(n.attributes=L({},o.attributes)),n}function or(r,o,n){var e={key:o,source:n.source.key,target:n.target.key};return K(n.attributes)||(e.attributes=L({},n.attributes)),r==="mixed"&&n.undirected&&(e.undirected=!0),e}function ar(r){if(!R(r))throw new G('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in r))throw new G("Graph.import: serialized node is missing its key.");if("attributes"in r&&(!R(r.attributes)||r.attributes===null))throw new G("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function sr(r){if(!R(r))throw new G('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in r))throw new G("Graph.import: serialized edge is missing its source.");if(!("target"in r))throw new G("Graph.import: serialized edge is missing its target.");if("attributes"in r&&(!R(r.attributes)||r.attributes===null))throw new G("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in r&&typeof r.undirected!="boolean")throw new G("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}var cr=de(),dr=new Set(["directed","undirected","mixed"]),ht=new Set(["domain","_events","_eventsCount","_maxListeners"]),lr=[{name:function(r){return"".concat(r,"Edge")},generateKey:!0},{name:function(r){return"".concat(r,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(r){return"".concat(r,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(r){return"".concat(r,"EdgeWithKey")}},{name:function(r){return"".concat(r,"DirectedEdgeWithKey")},type:"directed"},{name:function(r){return"".concat(r,"UndirectedEdgeWithKey")},type:"undirected"}],ur={allowSelfLoops:!0,multi:!1,type:"mixed"};function pr(r,o,n){if(n&&!R(n))throw new G('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(o=""+o,n=n||{},r._nodes.has(o))throw new w('Graph.addNode: the "'.concat(o,'" node already exist in the graph.'));var e=new r.NodeDataClass(o,n);return r._nodes.set(o,e),r.emit("nodeAdded",{key:o,attributes:n}),e}function ft(r,o,n){var e=new r.NodeDataClass(o,n);return r._nodes.set(o,e),r.emit("nodeAdded",{key:o,attributes:n}),e}function gt(r,o,n,e,t,i,a,s){if(!e&&r.type==="undirected")throw new w("Graph.".concat(o,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(e&&r.type==="directed")throw new w("Graph.".concat(o,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(s&&!R(s))throw new G("Graph.".concat(o,': invalid attributes. Expecting an object but got "').concat(s,'"'));if(i=""+i,a=""+a,s=s||{},!r.allowSelfLoops&&i===a)throw new w("Graph.".concat(o,': source & target are the same ("').concat(i,`"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`));var p=r._nodes.get(i),g=r._nodes.get(a);if(!p)throw new _("Graph.".concat(o,': source node "').concat(i,'" not found.'));if(!g)throw new _("Graph.".concat(o,': target node "').concat(a,'" not found.'));var E={key:null,undirected:e,source:i,target:a,attributes:s};if(n)t=r._edgeKeyGenerator();else if(t=""+t,r._edges.has(t))throw new w("Graph.".concat(o,': the "').concat(t,'" edge already exists in the graph.'));if(!r.multi&&(e?typeof p.undirected[a]<"u":typeof p.out[a]<"u"))throw new w("Graph.".concat(o,': an edge linking "').concat(i,'" to "').concat(a,`" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`));var A=new S(e,t,p,g,s);r._edges.set(t,A);var M=i===a;return e?(p.undirectedDegree++,g.undirectedDegree++,M&&(p.undirectedLoops++,r._undirectedSelfLoopCount++)):(p.outDegree++,g.inDegree++,M&&(p.directedLoops++,r._directedSelfLoopCount++)),r.multi?A.attachMulti():A.attach(),e?r._undirectedSize++:r._directedSize++,E.key=t,r.emit("edgeAdded",E),t}function hr(r,o,n,e,t,i,a,s,p){if(!e&&r.type==="undirected")throw new w("Graph.".concat(o,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(e&&r.type==="directed")throw new w("Graph.".concat(o,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(s){if(p){if(typeof s!="function")throw new G("Graph.".concat(o,': invalid updater function. Expecting a function but got "').concat(s,'"'))}else if(!R(s))throw new G("Graph.".concat(o,': invalid attributes. Expecting an object but got "').concat(s,'"'))}i=""+i,a=""+a;var g;if(p&&(g=s,s=void 0),!r.allowSelfLoops&&i===a)throw new w("Graph.".concat(o,': source & target are the same ("').concat(i,`"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`));var E=r._nodes.get(i),A=r._nodes.get(a),M,P;if(!n&&(M=r._edges.get(t),M)){if((M.source.key!==i||M.target.key!==a)&&(!e||M.source.key!==a||M.target.key!==i))throw new w("Graph.".concat(o,': inconsistency detected when attempting to merge the "').concat(t,'" edge with "').concat(i,'" source & "').concat(a,'" target vs. ("').concat(M.source.key,'", "').concat(M.target.key,'").'));P=M}if(!P&&!r.multi&&E&&(P=e?E.undirected[a]:E.out[a]),P){var Y=[P.key,!1,!1,!1];if(p?!g:!s)return Y;if(p){var ne=P.attributes;P.attributes=g(ne),r.emit("edgeAttributesUpdated",{type:"replace",key:P.key,attributes:P.attributes})}else L(P.attributes,s),r.emit("edgeAttributesUpdated",{type:"merge",key:P.key,attributes:P.attributes,data:s});return Y}s=s||{},p&&g&&(s=g(s));var te={key:null,undirected:e,source:i,target:a,attributes:s};if(n)t=r._edgeKeyGenerator();else if(t=""+t,r._edges.has(t))throw new w("Graph.".concat(o,': the "').concat(t,'" edge already exists in the graph.'));var ae=!1,ue=!1;E||(E=ft(r,i,{}),ae=!0,i===a&&(A=E,ue=!0)),A||(A=ft(r,a,{}),ue=!0),M=new S(e,t,E,A,s),r._edges.set(t,M);var be=i===a;return e?(E.undirectedDegree++,A.undirectedDegree++,be&&(E.undirectedLoops++,r._undirectedSelfLoopCount++)):(E.outDegree++,A.inDegree++,be&&(E.directedLoops++,r._directedSelfLoopCount++)),r.multi?M.attachMulti():M.attach(),e?r._undirectedSize++:r._directedSize++,te.key=t,r.emit("edgeAdded",te),[t,!0,ae,ue]}function Pe(r,o){r._edges.delete(o.key);var n=o.source,e=o.target,t=o.attributes,i=o.undirected,a=n===e;i?(n.undirectedDegree--,e.undirectedDegree--,a&&(n.undirectedLoops--,r._undirectedSelfLoopCount--)):(n.outDegree--,e.inDegree--,a&&(n.directedLoops--,r._directedSelfLoopCount--)),r.multi?o.detachMulti():o.detach(),i?r._undirectedSize--:r._directedSize--,r.emit("edgeDropped",{key:o.key,attributes:t,source:n.key,target:e.key,undirected:i})}var Z=(function(r){m(o,r);function o(e){var t;if(t=r.call(this)||this,e=L({},ur,e),typeof e.multi!="boolean")throw new G(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "`.concat(e.multi,'".'));if(!dr.has(e.type))throw new G(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "`.concat(e.type,'".'));if(typeof e.allowSelfLoops!="boolean")throw new G(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "`.concat(e.allowSelfLoops,'".'));var i=e.type==="mixed"?c:e.type==="directed"?X:je;W(l(t),"NodeDataClass",i);var a="geid_"+cr()+"_",s=0,p=function(){var g;do g=a+s++;while(t._edges.has(g));return g};return W(l(t),"_attributes",{}),W(l(t),"_nodes",new Map),W(l(t),"_edges",new Map),W(l(t),"_directedSize",0),W(l(t),"_undirectedSize",0),W(l(t),"_directedSelfLoopCount",0),W(l(t),"_undirectedSelfLoopCount",0),W(l(t),"_edgeKeyGenerator",p),W(l(t),"_options",e),ht.forEach(function(g){return W(l(t),g,t[g])}),B(l(t),"order",function(){return t._nodes.size}),B(l(t),"size",function(){return t._edges.size}),B(l(t),"directedSize",function(){return t._directedSize}),B(l(t),"undirectedSize",function(){return t._undirectedSize}),B(l(t),"selfLoopCount",function(){return t._directedSelfLoopCount+t._undirectedSelfLoopCount}),B(l(t),"directedSelfLoopCount",function(){return t._directedSelfLoopCount}),B(l(t),"undirectedSelfLoopCount",function(){return t._undirectedSelfLoopCount}),B(l(t),"multi",t._options.multi),B(l(t),"type",t._options.type),B(l(t),"allowSelfLoops",t._options.allowSelfLoops),B(l(t),"implementation",function(){return"graphology"}),t}var n=o.prototype;return n._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},n.hasNode=function(e){return this._nodes.has(""+e)},n.hasDirectedEdge=function(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){var i=""+e,a=this._edges.get(i);return!!a&&!a.undirected}else if(arguments.length===2){e=""+e,t=""+t;var s=this._nodes.get(e);return s?s.out.hasOwnProperty(t):!1}throw new G("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.hasUndirectedEdge=function(e,t){if(this.type==="directed")return!1;if(arguments.length===1){var i=""+e,a=this._edges.get(i);return!!a&&a.undirected}else if(arguments.length===2){e=""+e,t=""+t;var s=this._nodes.get(e);return s?s.undirected.hasOwnProperty(t):!1}throw new G("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.hasEdge=function(e,t){if(arguments.length===1){var i=""+e;return this._edges.has(i)}else if(arguments.length===2){e=""+e,t=""+t;var a=this._nodes.get(e);return a?typeof a.out<"u"&&a.out.hasOwnProperty(t)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(t):!1}throw new G("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},n.directedEdge=function(e,t){if(this.type!=="undirected"){if(e=""+e,t=""+t,this.multi)throw new w("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var i=this._nodes.get(e);if(!i)throw new _('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new _('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var a=i.out&&i.out[t]||void 0;if(a)return a.key}},n.undirectedEdge=function(e,t){if(this.type!=="directed"){if(e=""+e,t=""+t,this.multi)throw new w("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var i=this._nodes.get(e);if(!i)throw new _('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new _('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var a=i.undirected&&i.undirected[t]||void 0;if(a)return a.key}},n.edge=function(e,t){if(this.multi)throw new w("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new _('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var a=i.out&&i.out[t]||i.undirected&&i.undirected[t]||void 0;if(a)return a.key},n.areDirectedNeighbors=function(e,t){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.areDirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?!1:t in i.in||t in i.out},n.areOutNeighbors=function(e,t){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.areOutNeighbors: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?!1:t in i.out},n.areInNeighbors=function(e,t){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.areInNeighbors: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?!1:t in i.in},n.areUndirectedNeighbors=function(e,t){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.areUndirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return this.type==="directed"?!1:t in i.undirected},n.areNeighbors=function(e,t){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.areNeighbors: could not find the "'.concat(e,'" node in the graph.'));return this.type!=="undirected"&&(t in i.in||t in i.out)||this.type!=="directed"&&t in i.undirected},n.areInboundNeighbors=function(e,t){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.areInboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return this.type!=="undirected"&&t in i.in||this.type!=="directed"&&t in i.undirected},n.areOutboundNeighbors=function(e,t){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new _('Graph.areOutboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return this.type!=="undirected"&&t in i.out||this.type!=="directed"&&t in i.undirected},n.inDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?0:t.inDegree},n.outDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?0:t.outDegree},n.directedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?0:t.inDegree+t.outDegree},n.undirectedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return this.type==="directed"?0:t.undirectedDegree},n.inboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.inboundDegree: could not find the "'.concat(e,'" node in the graph.'));var i=0;return this.type!=="directed"&&(i+=t.undirectedDegree),this.type!=="undirected"&&(i+=t.inDegree),i},n.outboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.outboundDegree: could not find the "'.concat(e,'" node in the graph.'));var i=0;return this.type!=="directed"&&(i+=t.undirectedDegree),this.type!=="undirected"&&(i+=t.outDegree),i},n.degree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var i=0;return this.type!=="directed"&&(i+=t.undirectedDegree),this.type!=="undirected"&&(i+=t.inDegree+t.outDegree),i},n.inDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?0:t.inDegree-t.directedLoops},n.outDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?0:t.outDegree-t.directedLoops},n.directedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2},n.undirectedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2},n.inboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var i=0,a=0;return this.type!=="directed"&&(i+=t.undirectedDegree,a+=t.undirectedLoops*2),this.type!=="undirected"&&(i+=t.inDegree,a+=t.directedLoops),i-a},n.outboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var i=0,a=0;return this.type!=="directed"&&(i+=t.undirectedDegree,a+=t.undirectedLoops*2),this.type!=="undirected"&&(i+=t.outDegree,a+=t.directedLoops),i-a},n.degreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.degreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var i=0,a=0;return this.type!=="directed"&&(i+=t.undirectedDegree,a+=t.undirectedLoops*2),this.type!=="undirected"&&(i+=t.inDegree+t.outDegree,a+=t.directedLoops*2),i-a},n.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new _('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},n.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new _('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},n.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new _('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},n.opposite=function(e,t){e=""+e,t=""+t;var i=this._edges.get(t);if(!i)throw new _('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var a=i.source.key,s=i.target.key;if(e===a)return s;if(e===s)return a;throw new _('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(a,", ").concat(s,")."))},n.hasExtremity=function(e,t){e=""+e,t=""+t;var i=this._edges.get(e);if(!i)throw new _('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return i.source.key===t||i.target.key===t},n.isUndirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new _('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},n.isDirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new _('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},n.isSelfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new _('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},n.addNode=function(e,t){var i=pr(this,e,t);return i.key},n.mergeNode=function(e,t){if(t&&!R(t))throw new G('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var i=this._nodes.get(e);return i?(t&&(L(i.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:i.attributes,data:t})),[e,!1]):(i=new this.NodeDataClass(e,t),this._nodes.set(e,i),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])},n.updateNode=function(e,t){if(t&&typeof t!="function")throw new G('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));e=""+e;var i=this._nodes.get(e);if(i){if(t){var a=i.attributes;i.attributes=t(a),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:i.attributes})}return[e,!1]}var s=t?t({}):{};return i=new this.NodeDataClass(e,s),this._nodes.set(e,i),this.emit("nodeAdded",{key:e,attributes:s}),[e,!0]},n.dropNode=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new _('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));var i;if(this.type!=="undirected"){for(var a in t.out){i=t.out[a];do Pe(this,i),i=i.next;while(i)}for(var s in t.in){i=t.in[s];do Pe(this,i),i=i.next;while(i)}}if(this.type!=="directed")for(var p in t.undirected){i=t.undirected[p];do Pe(this,i),i=i.next;while(i)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})},n.dropEdge=function(e){var t;if(arguments.length>1){var i=""+arguments[0],a=""+arguments[1];if(t=$(this,i,a,this.type),!t)throw new _('Graph.dropEdge: could not find the "'.concat(i,'" -> "').concat(a,'" edge in the graph.'))}else if(e=""+e,t=this._edges.get(e),!t)throw new _('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));return Pe(this,t),this},n.dropDirectedEdge=function(e,t){if(arguments.length<2)throw new w("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new w("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;var i=$(this,e,t,"directed");if(!i)throw new _('Graph.dropDirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return Pe(this,i),this},n.dropUndirectedEdge=function(e,t){if(arguments.length<2)throw new w("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new w("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var i=$(this,e,t,"undirected");if(!i)throw new _('Graph.dropUndirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return Pe(this,i),this},n.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},n.clearEdges=function(){for(var e=this._nodes.values(),t;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},n.getAttribute=function(e){return this._attributes[e]},n.getAttributes=function(){return this._attributes},n.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},n.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},n.updateAttribute=function(e,t){if(typeof t!="function")throw new G("Graph.updateAttribute: updater should be a function.");var i=this._attributes[e];return this._attributes[e]=t(i),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},n.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},n.replaceAttributes=function(e){if(!R(e))throw new G("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},n.mergeAttributes=function(e){if(!R(e))throw new G("Graph.mergeAttributes: provided attributes are not a plain object.");return L(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},n.updateAttributes=function(e){if(typeof e!="function")throw new G("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},n.updateEachNodeAttributes=function(e,t){if(typeof e!="function")throw new G("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!ie(t))throw new G("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var i=this._nodes.values(),a,s;a=i.next(),a.done!==!0;)s=a.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},n.updateEachEdgeAttributes=function(e,t){if(typeof e!="function")throw new G("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!ie(t))throw new G("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var i=this._edges.values(),a,s,p,g;a=i.next(),a.done!==!0;)s=a.value,p=s.source,g=s.target,s.attributes=e(s.key,s.attributes,p.key,g.key,p.attributes,g.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},n.forEachAdjacencyEntry=function(e){if(typeof e!="function")throw new G("Graph.forEachAdjacencyEntry: expecting a callback.");Xe(!1,!1,!1,this,e)},n.forEachAdjacencyEntryWithOrphans=function(e){if(typeof e!="function")throw new G("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Xe(!1,!1,!0,this,e)},n.forEachAssymetricAdjacencyEntry=function(e){if(typeof e!="function")throw new G("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Xe(!1,!0,!1,this,e)},n.forEachAssymetricAdjacencyEntryWithOrphans=function(e){if(typeof e!="function")throw new G("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Xe(!1,!0,!0,this,e)},n.nodes=function(){return Array.from(this._nodes.keys())},n.forEachNode=function(e){if(typeof e!="function")throw new G("Graph.forEachNode: expecting a callback.");for(var t=this._nodes.values(),i,a;i=t.next(),i.done!==!0;)a=i.value,e(a.key,a.attributes)},n.findNode=function(e){if(typeof e!="function")throw new G("Graph.findNode: expecting a callback.");for(var t=this._nodes.values(),i,a;i=t.next(),i.done!==!0;)if(a=i.value,e(a.key,a.attributes))return a.key},n.mapNodes=function(e){if(typeof e!="function")throw new G("Graph.mapNode: expecting a callback.");for(var t=this._nodes.values(),i,a,s=new Array(this.order),p=0;i=t.next(),i.done!==!0;)a=i.value,s[p++]=e(a.key,a.attributes);return s},n.someNode=function(e){if(typeof e!="function")throw new G("Graph.someNode: expecting a callback.");for(var t=this._nodes.values(),i,a;i=t.next(),i.done!==!0;)if(a=i.value,e(a.key,a.attributes))return!0;return!1},n.everyNode=function(e){if(typeof e!="function")throw new G("Graph.everyNode: expecting a callback.");for(var t=this._nodes.values(),i,a;i=t.next(),i.done!==!0;)if(a=i.value,!e(a.key,a.attributes))return!1;return!0},n.filterNodes=function(e){if(typeof e!="function")throw new G("Graph.filterNodes: expecting a callback.");for(var t=this._nodes.values(),i,a,s=[];i=t.next(),i.done!==!0;)a=i.value,e(a.key,a.attributes)&&s.push(a.key);return s},n.reduceNodes=function(e,t){if(typeof e!="function")throw new G("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new G("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var i=t,a=this._nodes.values(),s,p;s=a.next(),s.done!==!0;)p=s.value,i=e(i,p.key,p.attributes);return i},n.nodeEntries=function(){var e=this._nodes.values();return u(u({},Symbol.iterator,function(){return this}),"next",function(){var t=e.next();if(t.done)return t;var i=t.value;return{value:{node:i.key,attributes:i.attributes},done:!1}})},n.export=function(){var e=this,t=new Array(this._nodes.size),i=0;this._nodes.forEach(function(s,p){t[i++]=ir(p,s)});var a=new Array(this._edges.size);return i=0,this._edges.forEach(function(s,p){a[i++]=or(e.type,p,s)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:a}},n.import=function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e instanceof o)return e.forEachNode(function(Ie,Te){i?t.mergeNode(Ie,Te):t.addNode(Ie,Te)}),e.forEachEdge(function(Ie,Te,Je,Ze,bn,yn,xt){i?xt?t.mergeUndirectedEdgeWithKey(Ie,Je,Ze,Te):t.mergeDirectedEdgeWithKey(Ie,Je,Ze,Te):xt?t.addUndirectedEdgeWithKey(Ie,Je,Ze,Te):t.addDirectedEdgeWithKey(Ie,Je,Ze,Te)}),this;if(!R(e))throw new G("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!R(e.attributes))throw new G("Graph.import: invalid attributes. Expecting a plain object.");i?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}var a,s,p,g,E;if(e.nodes){if(p=e.nodes,!Array.isArray(p))throw new G("Graph.import: invalid nodes. Expecting an array.");for(a=0,s=p.length;a<s;a++){g=p[a],ar(g);var A=g,M=A.key,P=A.attributes;i?this.mergeNode(M,P):this.addNode(M,P)}}if(e.edges){var Y=!1;if(this.type==="undirected"&&(Y=!0),p=e.edges,!Array.isArray(p))throw new G("Graph.import: invalid edges. Expecting an array.");for(a=0,s=p.length;a<s;a++){E=p[a],sr(E);var ne=E,te=ne.source,ae=ne.target,ue=ne.attributes,be=ne.undirected,De=be===void 0?Y:be,Qe=void 0;"key"in E?(Qe=i?De?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:De?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,Qe.call(this,E.key,te,ae,ue)):(Qe=i?De?this.mergeUndirectedEdge:this.mergeDirectedEdge:De?this.addUndirectedEdge:this.addDirectedEdge,Qe.call(this,te,ae,ue))}}return this},n.nullCopy=function(e){var t=new o(L({},this._options,e));return t.replaceAttributes(L({},this.getAttributes())),t},n.emptyCopy=function(e){var t=this.nullCopy(e);return this._nodes.forEach(function(i,a){var s=L({},i.attributes);i=new t.NodeDataClass(a,s),t._nodes.set(a,i)}),t},n.copy=function(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new w('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(e.type,'" because this would mean losing information about the current graph.'));if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new w("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new w("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var t=this.emptyCopy(e),i=this._edges.values(),a,s;a=i.next(),a.done!==!0;)s=a.value,gt(t,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,L({},s.attributes));return t},n.toJSON=function(){return this.export()},n.toString=function(){return"[object Graph]"},n.inspect=function(){var e=this,t={};this._nodes.forEach(function(g,E){t[E]=g.attributes});var i={},a={};this._edges.forEach(function(g,E){var A=g.undirected?"--":"->",M="",P=g.source.key,Y=g.target.key,ne;g.undirected&&P>Y&&(ne=P,P=Y,Y=ne);var te="(".concat(P,")").concat(A,"(").concat(Y,")");E.startsWith("geid_")?e.multi&&(typeof a[te]>"u"?a[te]=0:a[te]++,M+="".concat(a[te],". ")):M+="[".concat(E,"]: "),M+=te,i[M]=g.attributes});var s={};for(var p in this)this.hasOwnProperty(p)&&!ht.has(p)&&typeof this[p]!="function"&&I(p)!=="symbol"&&(s[p]=this[p]);return s.attributes=this._attributes,s.nodes=t,s.edges=i,W(s,"constructor",this.constructor),s},o})(y.EventEmitter);typeof Symbol<"u"&&(Z.prototype[Symbol.for("nodejs.util.inspect.custom")]=Z.prototype.inspect),lr.forEach(function(r){["add","merge","update"].forEach(function(o){var n=r.name(o),e=o==="add"?gt:hr;r.generateKey?Z.prototype[n]=function(t,i,a){return e(this,n,!0,(r.type||this.type)==="undirected",null,t,i,a,o==="update")}:Z.prototype[n]=function(t,i,a,s){return e(this,n,!1,(r.type||this.type)==="undirected",t,i,a,s,o==="update")}})}),V(Z),qe(Z),Yt(Z),nr(Z);var mt=(function(r){m(o,r);function o(n){var e=L({type:"directed"},n);if("multi"in e&&e.multi!==!1)throw new G("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(e.type!=="directed")throw new G('DirectedGraph.from: inconsistent "'+e.type+'" type in given options!');return r.call(this,e)||this}return o})(Z),bt=(function(r){m(o,r);function o(n){var e=L({type:"undirected"},n);if("multi"in e&&e.multi!==!1)throw new G("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(e.type!=="undirected")throw new G('UndirectedGraph.from: inconsistent "'+e.type+'" type in given options!');return r.call(this,e)||this}return o})(Z),yt=(function(r){m(o,r);function o(n){var e=L({multi:!0},n);if("multi"in e&&e.multi!==!0)throw new G("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return r.call(this,e)||this}return o})(Z),wt=(function(r){m(o,r);function o(n){var e=L({type:"directed",multi:!0},n);if("multi"in e&&e.multi!==!0)throw new G("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(e.type!=="directed")throw new G('MultiDirectedGraph.from: inconsistent "'+e.type+'" type in given options!');return r.call(this,e)||this}return o})(Z),vt=(function(r){m(o,r);function o(n){var e=L({type:"undirected",multi:!0},n);if("multi"in e&&e.multi!==!0)throw new G("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(e.type!=="undirected")throw new G('MultiUndirectedGraph.from: inconsistent "'+e.type+'" type in given options!');return r.call(this,e)||this}return o})(Z);function $e(r){r.from=function(o,n){var e=L({},o.options,n),t=new r(e);return t.import(o),t}}return $e(Z),$e(mt),$e(bt),$e(yt),$e(wt),$e(vt),Z.Graph=Z,Z.DirectedGraph=mt,Z.UndirectedGraph=bt,Z.MultiGraph=yt,Z.MultiDirectedGraph=wt,Z.MultiUndirectedGraph=vt,Z.InvalidArgumentsGraphError=G,Z.NotFoundGraphError=_,Z.UsageGraphError=w,st=Z,st}var Lr=Tr();const zr=Ot(Lr);var ct,_t;function Rr(){return _t||(_t=1,ct=function(y){return y!==null&&typeof y=="object"&&typeof y.addUndirectedEdgeWithKey=="function"&&typeof y.dropNode=="function"&&typeof y.multi=="boolean"}),ct}var Ke={},jt;function Or(){if(jt)return Ke;jt=1;function y(u){return typeof u!="number"||isNaN(u)?1:u}function l(u,v){var m={},k=function(j){return typeof j>"u"?v:j};typeof v=="function"&&(k=v);var N=function(j){return k(j[u])},D=function(){return k(void 0)};return typeof u=="string"?(m.fromAttributes=N,m.fromGraph=function(j,C){return N(j.getNodeAttributes(C))},m.fromEntry=function(j,C){return N(C)}):typeof u=="function"?(m.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},m.fromGraph=function(j,C){return k(u(C,j.getNodeAttributes(C)))},m.fromEntry=function(j,C){return k(u(j,C))}):(m.fromAttributes=D,m.fromGraph=D,m.fromEntry=D),m}function h(u,v){var m={},k=function(j){return typeof j>"u"?v:j};typeof v=="function"&&(k=v);var N=function(j){return k(j[u])},D=function(){return k(void 0)};return typeof u=="string"?(m.fromAttributes=N,m.fromGraph=function(j,C){return N(j.getEdgeAttributes(C))},m.fromEntry=function(j,C){return N(C)},m.fromPartialEntry=m.fromEntry,m.fromMinimalEntry=m.fromEntry):typeof u=="function"?(m.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},m.fromGraph=function(j,C){var I=j.extremities(C);return k(u(C,j.getEdgeAttributes(C),I[0],I[1],j.getNodeAttributes(I[0]),j.getNodeAttributes(I[1]),j.isUndirected(C)))},m.fromEntry=function(j,C,I,q,z,L,$){return k(u(j,C,I,q,z,L,$))},m.fromPartialEntry=function(j,C,I,q){return k(u(j,C,I,q))},m.fromMinimalEntry=function(j,C){return k(u(j,C))}):(m.fromAttributes=D,m.fromGraph=D,m.fromEntry=D,m.fromMinimalEntry=D),m}return Ke.createNodeValueGetter=l,Ke.createEdgeValueGetter=h,Ke.createEdgeWeightGetter=function(u){return h(u,y)},Ke}var dt,St;function Ur(){if(St)return dt;St=1;var y=0,l=1,h=2,u=3,v=4,m=5,k=6,N=7,D=8,j=9,C=0,I=1,q=2,z=0,L=1,$=2,R=3,K=4,W=5,B=6,ie=7,de=8,ce=3,re=10,_e=3,G=9,_=10;return dt=function(w,c,X){var je,S,f,Q,ee,ge,se,oe,F,We,pe=c.length,rt=X.length,Me=w.adjustSizes,nt=w.barnesHutTheta*w.barnesHutTheta,Le,J,H,V,me,U,O,b=[];for(f=0;f<pe;f+=re)c[f+v]=c[f+h],c[f+m]=c[f+u],c[f+h]=0,c[f+u]=0;if(w.outboundAttractionDistribution){for(Le=0,f=0;f<pe;f+=re)Le+=c[f+k];Le/=pe/re}if(w.barnesHutOptimize){var ye=1/0,Se=-1/0,we=1/0,Ae=-1/0,le,Ne,qe;for(f=0;f<pe;f+=re)ye=Math.min(ye,c[f+y]),Se=Math.max(Se,c[f+y]),we=Math.min(we,c[f+l]),Ae=Math.max(Ae,c[f+l]);var ze=Se-ye,Re=Ae-we;for(ze>Re?(we-=(ze-Re)/2,Ae=we+ze):(ye-=(Re-ze)/2,Se=ye+Re),b[0+z]=-1,b[0+L]=(ye+Se)/2,b[0+$]=(we+Ae)/2,b[0+R]=Math.max(Se-ye,Ae-we),b[0+K]=-1,b[0+W]=-1,b[0+B]=0,b[0+ie]=0,b[0+de]=0,je=1,f=0;f<pe;f+=re)for(S=0,qe=ce;;)if(b[S+W]>=0){c[f+y]<b[S+L]?c[f+l]<b[S+$]?le=b[S+W]:le=b[S+W]+G:c[f+l]<b[S+$]?le=b[S+W]+G*2:le=b[S+W]+G*3,b[S+ie]=(b[S+ie]*b[S+B]+c[f+y]*c[f+k])/(b[S+B]+c[f+k]),b[S+de]=(b[S+de]*b[S+B]+c[f+l]*c[f+k])/(b[S+B]+c[f+k]),b[S+B]+=c[f+k],S=le;continue}else if(b[S+z]<0){b[S+z]=f;break}else{if(b[S+W]=je*G,oe=b[S+R]/2,F=b[S+W],b[F+z]=-1,b[F+L]=b[S+L]-oe,b[F+$]=b[S+$]-oe,b[F+R]=oe,b[F+K]=F+G,b[F+W]=-1,b[F+B]=0,b[F+ie]=0,b[F+de]=0,F+=G,b[F+z]=-1,b[F+L]=b[S+L]-oe,b[F+$]=b[S+$]+oe,b[F+R]=oe,b[F+K]=F+G,b[F+W]=-1,b[F+B]=0,b[F+ie]=0,b[F+de]=0,F+=G,b[F+z]=-1,b[F+L]=b[S+L]+oe,b[F+$]=b[S+$]-oe,b[F+R]=oe,b[F+K]=F+G,b[F+W]=-1,b[F+B]=0,b[F+ie]=0,b[F+de]=0,F+=G,b[F+z]=-1,b[F+L]=b[S+L]+oe,b[F+$]=b[S+$]+oe,b[F+R]=oe,b[F+K]=b[S+K],b[F+W]=-1,b[F+B]=0,b[F+ie]=0,b[F+de]=0,je+=4,c[b[S+z]+y]<b[S+L]?c[b[S+z]+l]<b[S+$]?le=b[S+W]:le=b[S+W]+G:c[b[S+z]+l]<b[S+$]?le=b[S+W]+G*2:le=b[S+W]+G*3,b[S+B]=c[b[S+z]+k],b[S+ie]=c[b[S+z]+y],b[S+de]=c[b[S+z]+l],b[le+z]=b[S+z],b[S+z]=-1,c[f+y]<b[S+L]?c[f+l]<b[S+$]?Ne=b[S+W]:Ne=b[S+W]+G:c[f+l]<b[S+$]?Ne=b[S+W]+G*2:Ne=b[S+W]+G*3,le===Ne)if(qe--){S=le;continue}else{qe=ce;break}b[Ne+z]=f;break}}if(w.barnesHutOptimize)for(J=w.scalingRatio,f=0;f<pe;f+=re)for(S=0;;)if(b[S+W]>=0)if(U=Math.pow(c[f+y]-b[S+ie],2)+Math.pow(c[f+l]-b[S+de],2),We=b[S+R],4*We*We/U<nt){if(H=c[f+y]-b[S+ie],V=c[f+l]-b[S+de],Me===!0?U>0?(O=J*c[f+k]*b[S+B]/U,c[f+h]+=H*O,c[f+u]+=V*O):U<0&&(O=-J*c[f+k]*b[S+B]/Math.sqrt(U),c[f+h]+=H*O,c[f+u]+=V*O):U>0&&(O=J*c[f+k]*b[S+B]/U,c[f+h]+=H*O,c[f+u]+=V*O),S=b[S+K],S<0)break;continue}else{S=b[S+W];continue}else{if(ge=b[S+z],ge>=0&&ge!==f&&(H=c[f+y]-c[ge+y],V=c[f+l]-c[ge+l],U=H*H+V*V,Me===!0?U>0?(O=J*c[f+k]*c[ge+k]/U,c[f+h]+=H*O,c[f+u]+=V*O):U<0&&(O=-J*c[f+k]*c[ge+k]/Math.sqrt(U),c[f+h]+=H*O,c[f+u]+=V*O):U>0&&(O=J*c[f+k]*c[ge+k]/U,c[f+h]+=H*O,c[f+u]+=V*O)),S=b[S+K],S<0)break;continue}else for(J=w.scalingRatio,Q=0;Q<pe;Q+=re)for(ee=0;ee<Q;ee+=re)H=c[Q+y]-c[ee+y],V=c[Q+l]-c[ee+l],Me===!0?(U=Math.sqrt(H*H+V*V)-c[Q+D]-c[ee+D],U>0?(O=J*c[Q+k]*c[ee+k]/U/U,c[Q+h]+=H*O,c[Q+u]+=V*O,c[ee+h]-=H*O,c[ee+u]-=V*O):U<0&&(O=100*J*c[Q+k]*c[ee+k],c[Q+h]+=H*O,c[Q+u]+=V*O,c[ee+h]-=H*O,c[ee+u]-=V*O)):(U=Math.sqrt(H*H+V*V),U>0&&(O=J*c[Q+k]*c[ee+k]/U/U,c[Q+h]+=H*O,c[Q+u]+=V*O,c[ee+h]-=H*O,c[ee+u]-=V*O));for(F=w.gravity/w.scalingRatio,J=w.scalingRatio,f=0;f<pe;f+=re)O=0,H=c[f+y],V=c[f+l],U=Math.sqrt(Math.pow(H,2)+Math.pow(V,2)),w.strongGravityMode?U>0&&(O=J*c[f+k]*F):U>0&&(O=J*c[f+k]*F/U),c[f+h]-=H*O,c[f+u]-=V*O;for(J=1*(w.outboundAttractionDistribution?Le:1),se=0;se<rt;se+=_e)Q=X[se+C],ee=X[se+I],oe=X[se+q],me=Math.pow(oe,w.edgeWeightInfluence),H=c[Q+y]-c[ee+y],V=c[Q+l]-c[ee+l],Me===!0?(U=Math.sqrt(H*H+V*V)-c[Q+D]-c[ee+D],w.linLogMode?w.outboundAttractionDistribution?U>0&&(O=-J*me*Math.log(1+U)/U/c[Q+k]):U>0&&(O=-J*me*Math.log(1+U)/U):w.outboundAttractionDistribution?U>0&&(O=-J*me/c[Q+k]):U>0&&(O=-J*me)):(U=Math.sqrt(Math.pow(H,2)+Math.pow(V,2)),w.linLogMode?w.outboundAttractionDistribution?U>0&&(O=-J*me*Math.log(1+U)/U/c[Q+k]):U>0&&(O=-J*me*Math.log(1+U)/U):w.outboundAttractionDistribution?(U=1,O=-J*me/c[Q+k]):(U=1,O=-J*me)),U>0&&(c[Q+h]+=H*O,c[Q+u]+=V*O,c[ee+h]-=H*O,c[ee+u]-=V*O);var Oe,ve,Ue,xe,Ce,Fe;if(Me===!0)for(f=0;f<pe;f+=re)c[f+j]!==1&&(Oe=Math.sqrt(Math.pow(c[f+h],2)+Math.pow(c[f+u],2)),Oe>_&&(c[f+h]=c[f+h]*_/Oe,c[f+u]=c[f+u]*_/Oe),ve=c[f+k]*Math.sqrt((c[f+v]-c[f+h])*(c[f+v]-c[f+h])+(c[f+m]-c[f+u])*(c[f+m]-c[f+u])),Ue=Math.sqrt((c[f+v]+c[f+h])*(c[f+v]+c[f+h])+(c[f+m]+c[f+u])*(c[f+m]+c[f+u]))/2,xe=.1*Math.log(1+Ue)/(1+Math.sqrt(ve)),Ce=c[f+y]+c[f+h]*(xe/w.slowDown),c[f+y]=Ce,Fe=c[f+l]+c[f+u]*(xe/w.slowDown),c[f+l]=Fe);else for(f=0;f<pe;f+=re)c[f+j]!==1&&(ve=c[f+k]*Math.sqrt((c[f+v]-c[f+h])*(c[f+v]-c[f+h])+(c[f+m]-c[f+u])*(c[f+m]-c[f+u])),Ue=Math.sqrt((c[f+v]+c[f+h])*(c[f+v]+c[f+h])+(c[f+m]+c[f+u])*(c[f+m]+c[f+u]))/2,xe=c[f+N]*Math.log(1+Ue)/(1+Math.sqrt(ve)),c[f+N]=Math.min(1,Math.sqrt(xe*(Math.pow(c[f+h],2)+Math.pow(c[f+u],2))/(1+Math.sqrt(ve)))),Ce=c[f+y]+c[f+h]*(xe/w.slowDown),c[f+y]=Ce,Fe=c[f+l]+c[f+u]*(xe/w.slowDown),c[f+l]=Fe);return{}},dt}var ke={},At;function Fr(){if(At)return ke;At=1;var y=10,l=3;return ke.assign=function(h){h=h||{};var u=Array.prototype.slice.call(arguments).slice(1),v,m,k;for(v=0,k=u.length;v<k;v++)if(u[v])for(m in u[v])h[m]=u[v][m];return h},ke.validateSettings=function(h){return"linLogMode"in h&&typeof h.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in h&&typeof h.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in h&&typeof h.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in h&&typeof h.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in h&&!(typeof h.scalingRatio=="number"&&h.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in h&&typeof h.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in h&&!(typeof h.gravity=="number"&&h.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in h&&!(typeof h.slowDown=="number"||h.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in h&&typeof h.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in h&&!(typeof h.barnesHutTheta=="number"&&h.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},ke.graphToByteArrays=function(h,u){var v=h.order,m=h.size,k={},N,D=new Float32Array(v*y),j=new Float32Array(m*l);return N=0,h.forEachNode(function(C,I){k[C]=N,D[N]=I.x,D[N+1]=I.y,D[N+2]=0,D[N+3]=0,D[N+4]=0,D[N+5]=0,D[N+6]=1,D[N+7]=1,D[N+8]=I.size||1,D[N+9]=I.fixed?1:0,N+=y}),N=0,h.forEachEdge(function(C,I,q,z,L,$,R){var K=k[q],W=k[z],B=u(C,I,q,z,L,$,R);D[K+6]+=B,D[W+6]+=B,j[N]=K,j[N+1]=W,j[N+2]=B,N+=l}),{nodes:D,edges:j}},ke.assignLayoutChanges=function(h,u,v){var m=0;h.updateEachNodeAttributes(function(k,N){return N.x=u[m],N.y=u[m+1],m+=y,v?v(k,N):N})},ke.readGraphPositions=function(h,u){var v=0;h.forEachNode(function(m,k){u[v]=k.x,u[v+1]=k.y,v+=y})},ke.collectLayoutChanges=function(h,u,v){for(var m=h.nodes(),k={},N=0,D=0,j=u.length;N<j;N+=y){if(v){var C=Object.assign({},h.getNodeAttributes(m[D]));C.x=u[N],C.y=u[N+1],C=v(m[D],C),k[m[D]]={x:C.x,y:C.y}}else k[m[D]]={x:u[N],y:u[N+1]};D++}return k},ke.createWorker=function(h){var u=window.URL||window.webkitURL,v=h.toString(),m=u.createObjectURL(new Blob(["("+v+").call(this);"],{type:"text/javascript"})),k=new Worker(m);return u.revokeObjectURL(m),k},ke}var lt,Nt;function Pr(){return Nt||(Nt=1,lt={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),lt}var ut,Ct;function $r(){if(Ct)return ut;Ct=1;var y=Rr(),l=Or().createEdgeWeightGetter,h=Ur(),u=Fr(),v=Pr();function m(D,j,C){if(!y(j))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof C=="number"&&(C={iterations:C});var I=C.iterations;if(typeof I!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(I<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var q=l("getEdgeWeight"in C?C.getEdgeWeight:"weight").fromEntry,z=typeof C.outputReducer=="function"?C.outputReducer:null,L=u.assign({},v,C.settings),$=u.validateSettings(L);if($)throw new Error("graphology-layout-forceatlas2: "+$.message);var R=u.graphToByteArrays(j,q),K;for(K=0;K<I;K++)h(L,R.nodes,R.edges);if(D){u.assignLayoutChanges(j,R.nodes,z);return}return u.collectLayoutChanges(j,R.nodes)}function k(D){var j=typeof D=="number"?D:D.order;return{barnesHutOptimize:j>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(j)}}var N=m.bind(null,!1);return N.assign=m.bind(null,!0),N.inferSettings=k,ut=N,ut}var Wr=$r();const Dt=Ot(Wr);var qr=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:""}}}@layer theme{:root,:host{--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-light:300;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--leading-tight:1.25;--leading-snug:1.375;--radius-sm:.25rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--sans);--default-mono-font-family:var(--mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0;--mono:ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;--sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif}@media (prefers-color-scheme:dark){:root{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}}html[data-theme=light]{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0}html[data-theme=dark]{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}body{background-image:radial-gradient(circle, var(--border) .5px, transparent .5px);font-feature-settings:"ss01";background-size:14px 14px}}@layer components{.tbtn-theme [data-icon=moon]{display:inline-flex}.tbtn-theme [data-icon=sun]{display:none}@media (prefers-color-scheme:dark){.tbtn-theme [data-icon=moon]{display:none}.tbtn-theme [data-icon=sun]{display:inline-flex}}html[data-theme=light] .tbtn-theme [data-icon=moon]{display:inline-flex}html[data-theme=light] .tbtn-theme [data-icon=sun],html[data-theme=dark] .tbtn-theme [data-icon=moon]{display:none}html[data-theme=dark] .tbtn-theme [data-icon=sun]{display:inline-flex}.anolilab-logo{width:auto;height:13px;fill:var(--fg)}.anolilab-accent{fill:#dfff1b}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:calc(var(--spacing) * 0)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.z-20{z-index:20}.z-30{z-index:30}.z-\\[2\\]{z-index:2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-12{margin-inline:calc(var(--spacing) * 12)}.mx-\\[0\\.12em\\]{margin-inline:.12em}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-\\[7px\\]{width:7px;height:7px}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-\\[6px\\]{height:6px}.h-\\[7px\\]{height:7px}.h-\\[8px\\]{height:8px}.h-\\[10px\\]{height:10px}.h-\\[18px\\]{height:18px}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.min-h-\\[400px\\]{min-height:400px}.min-h-\\[480px\\]{min-height:480px}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-9{width:calc(var(--spacing) * 9)}.w-\\[7px\\]{width:7px}.w-\\[8px\\]{width:8px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[380px\\]{max-width:380px}.max-w-\\[1080px\\]{max-width:1080px}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[260px\\]{min-width:260px}.flex-1{flex:1}.flex-\\[1_1_280px\\]{flex:280px}.flex-auto{flex:auto}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\\[72px_1fr\\]{grid-template-columns:72px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-16{gap:calc(var(--spacing) * 16)}.gap-\\[0\\.65rem\\]{gap:.65rem}.gap-\\[2px\\]{gap:2px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent,.border-accent\\/60{border-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.border-accent\\/60{border-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.border-border{border-color:var(--border)}.border-border2{border-color:var(--border2)}.border-fg{border-color:var(--fg)}.border-link{border-color:var(--link)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-accent\\/40{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/40{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.bg-bg,.bg-bg\\/40{background-color:var(--bg)}@supports (color:color-mix(in lab, red, red)){.bg-bg\\/40{background-color:color-mix(in oklab, var(--bg) 40%, transparent)}}.bg-border{background-color:var(--border)}.bg-border2{background-color:var(--border2)}.bg-edge{background-color:var(--edge)}.bg-edge-faint{background-color:var(--edge-faint)}.bg-fg{background-color:var(--fg)}.bg-node-app{background-color:var(--node-app)}.bg-node-lib{background-color:var(--node-lib)}.bg-panel,.bg-panel\\/95{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/95{background-color:color-mix(in oklab, var(--panel) 95%, transparent)}}.bg-panel2{background-color:var(--panel2)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\\[5px\\]{padding-inline:5px}.px-\\[6px\\]{padding-inline:6px}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-\\[3px\\]{padding-block:3px}.py-px{padding-block:1px}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-7{padding-top:calc(var(--spacing) * 7)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pl-0{padding-left:calc(var(--spacing) * 0)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-\\[7px\\]{padding-left:7px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[28px\\]{font-size:28px}.text-\\[44px\\]{font-size:44px}.text-\\[72px\\]{font-size:72px}.text-\\[clamp\\(28px\\,5vw\\,52px\\)\\]{font-size:clamp(28px,5vw,52px)}.leading-\\[0\\.9\\]{--tw-leading:.9;line-height:.9}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\\[0\\.11em\\]{--tw-tracking:.11em;letter-spacing:.11em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.15em\\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\\[0\\.16em\\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\\[0\\.22em\\]{--tw-tracking:.22em;letter-spacing:.22em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent{color:var(--accent)}.text-bg{color:var(--bg)}.text-faint{color:var(--faint)}.text-fg{color:var(--fg)}.text-link{color:var(--link)}.text-muted{color:var(--muted)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.opacity-40{opacity:.4}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_4px_12px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_8px_24px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-0{outline-style:var(--tw-outline-style);outline-width:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.group-data-\\[state\\=off\\]\\:opacity-30:is(:where(.group)[data-state=off] *){opacity:.3}.placeholder\\:text-faint::placeholder{color:var(--faint)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:calc(var(--spacing) * 0)}.before\\:text-faint:before{content:var(--tw-content);color:var(--faint)}.before\\:content-\\[\\'→\\'\\]:before{--tw-content:"→";content:var(--tw-content)}.after\\:ml-auto:after{content:var(--tw-content);margin-left:auto}.after\\:font-mono:after{content:var(--tw-content);font-family:var(--mono)}.after\\:text-\\[9px\\]:after{content:var(--tw-content);font-size:9px}.after\\:tracking-\\[0\\.1em\\]:after{content:var(--tw-content);--tw-tracking:.1em;letter-spacing:.1em}.after\\:text-accent:after{content:var(--tw-content);color:var(--accent)}.after\\:content-\\[\\'ON\\'\\]:after{--tw-content:"ON";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-fg:focus-within{border-color:var(--fg)}@media (hover:hover){.hover\\:border-fg:hover{border-color:var(--fg)}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-row-hover:hover{background-color:var(--row-hover)}.hover\\:text-accent:hover{color:var(--accent)}.hover\\:text-fg:hover{color:var(--fg)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-90:hover{opacity:.9}}.focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-fg:focus-visible{--tw-ring-color:var(--fg)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-40:disabled{opacity:.4}.aria-selected\\:bg-row-hover[aria-selected=true]{background-color:var(--row-hover)}.data-\\[open\\=false\\]\\:hidden[data-open=false]{display:none}.data-\\[pinned\\=true\\]\\:pointer-events-auto[data-pinned=true]{pointer-events:auto}.data-\\[pinned\\=true\\]\\:border-accent[data-pinned=true]{border-color:var(--accent)}.data-\\[state\\=off\\]\\:text-faint[data-state=off]{color:var(--faint)}.data-\\[state\\=off\\]\\:line-through[data-state=off]{text-decoration-line:line-through}.data-\\[state\\=off\\]\\:after\\:text-faint[data-state=off]:after{content:var(--tw-content);color:var(--faint)}.data-\\[state\\=off\\]\\:after\\:content-\\[\\'OFF\\'\\][data-state=off]:after{--tw-content:"OFF";content:var(--tw-content)}.data-\\[state\\=selected\\]\\:bg-row-hover[data-state=selected]{background-color:var(--row-hover)}.data-\\[state\\=zero\\]\\:text-accent[data-state=zero]{color:var(--accent)}@media (min-width:40rem){.sm\\:min-w-\\[320px\\]{min-width:320px}}@media (min-width:48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\\:grid-cols-\\[1\\.4fr_1fr\\]{grid-template-columns:1.4fr 1fr}}.\\[\\&_svg\\]\\:size-\\[14px\\] svg{width:14px;height:14px}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_tr\\]\\:border-b-0 tr{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\\[\\&\\>\\*\\+\\*\\]\\:ml-6>*+*{margin-left:calc(var(--spacing) * 6)}.\\[\\&\\>\\*\\+\\*\\]\\:border-l>*+*{border-left-style:var(--tw-border-style);border-left-width:1px}.\\[\\&\\>\\*\\+\\*\\]\\:border-border>*+*{border-color:var(--border)}.\\[\\&\\>\\*\\+\\*\\]\\:pl-6>*+*{padding-left:calc(var(--spacing) * 6)}.\\[\\&\\>td\\]\\:border-b>td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\\[\\&\\>td\\]\\:border-border>td{border-color:var(--border)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}`;const Br=qr,Hr=Nr(import.meta.url),tt=(y,l)=>{const h=Hr.resolve(y);return Ar(Cr(Dr(h),l),"utf8")},Vr=tt("sigma","sigma.min.js"),Kr=tt("graphology","graphology.umd.min.js"),Yr=tt("@floating-ui/core","floating-ui.core.umd.min.js"),Xr=tt("@floating-ui/dom","floating-ui.dom.umd.min.js"),Qr='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>',Jr='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32 1.41-1.41"/></svg>',Ee=y=>y.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;"),Zr=9,en=4,tn=(y,l)=>{if(y.length===0)return[];const h=new zr({multi:!0,type:"directed"});for(const m of y){const k=h.order/y.length*Math.PI*2;h.addNode(m.name,{path:m.path,size:m.type==="application"?Zr:en,type:m.type,x:Math.cos(k),y:Math.sin(k)})}for(const m of l)h.hasNode(m.source)&&h.hasNode(m.target)&&h.addEdge(m.source,m.target,{type:m.type});const u=Dt.inferSettings(h);Dt.assign(h,{iterations:600,settings:{...u,adjustSizes:!0,barnesHutOptimize:h.order>100,gravity:1.2,linLogMode:!0,scalingRatio:8,slowDown:4}});const v=[];return h.forEachNode((m,k)=>{v.push({name:m,path:k.path,size:k.size,type:k.type,x:k.x,y:k.y})}),v},rn=y=>{const l=y.now??new Date,h=y.nodes.filter(C=>C.type==="application").length,u=y.nodes.length-h,v=tn(y.nodes,y.edges),m=new Set(v.map(C=>C.name)),k=y.edges.filter(C=>m.has(C.source)&&m.has(C.target)),N={edges:k,nodes:v},D=y.nodes.length===0,j={chip:"font-mono tracking-[0.08em] text-muted border border-border2 inline-flex h-7 items-center justify-center rounded-[4px] px-3 text-[11px] font-medium uppercase",dvNum:"font-mono text-[22px] font-medium text-fg leading-none",labelMono:"font-mono text-[10px] uppercase tracking-[0.15em] text-faint"};return`<!doctype html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="utf-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1">
7
- <title>${Ee(y.tool.name)} graph · ${Ee(l.toISOString().slice(0,10))}</title>
8
- <style>${Br}</style>
9
- </head>
10
- <body class="bg-bg text-fg">
11
- <div class="min-h-screen flex flex-col">
12
- <header class="flex flex-wrap items-end gap-4 px-8 pt-8 pb-5">
13
- <div class="font-sans text-[clamp(28px,5vw,52px)] font-semibold text-fg leading-none tracking-tight">${(()=>{const[C,...I]=y.tool.name.split("-");return I.length>0?`${Ee(C??y.tool.name)}<span class="text-accent mx-[0.12em] font-light">/</span>${Ee(I.join("-"))}`:Ee(y.tool.name)})()}<span class="font-mono tracking-[0.22em] text-faint mt-3 block text-[10px] font-medium uppercase">dependency graph</span></div>
14
- <span class="flex-auto"></span>
15
- <span class="${j.chip}">v${Ee(y.tool.version)}</span>
16
- <button id="theme" class="tbtn-theme font-mono text-muted border border-border2 inline-flex h-7 w-9 cursor-pointer items-center justify-center rounded-[4px] bg-transparent transition-colors duration-150 hover:text-fg hover:border-fg" type="button" aria-label="Toggle color theme" title="Toggle color theme"><span data-icon="moon" class="items-center justify-center">${Qr}</span><span data-icon="sun" class="items-center justify-center">${Jr}</span></button>
17
- </header>
18
- <div class="flex flex-wrap items-end gap-6 px-8 pt-5 pb-5 border-b border-border">
19
- <div class="flex flex-wrap items-stretch gap-0 [&>*+*]:pl-6 [&>*+*]:ml-6 [&>*+*]:border-l [&>*+*]:border-border">
20
- <div class="flex items-baseline gap-[0.65rem]"><span class="${j.labelMono}">apps</span><span class="${j.dvNum}">${String(h)}</span></div>
21
- <div class="flex items-baseline gap-[0.65rem]"><span class="${j.labelMono}">libraries</span><span class="${j.dvNum}">${String(u)}</span></div>
22
- <div class="flex items-baseline gap-[0.65rem]"><span class="${j.labelMono}">dependencies</span><span class="${j.dvNum}">${String(k.length)}</span></div>
23
- </div>
24
- <span class="flex-auto"></span>
25
- <div class="relative min-w-[260px] sm:min-w-[320px] ml-auto">
26
- <label class="flex items-center gap-3 border-b border-border2 transition-colors duration-150 hover:border-fg focus-within:border-fg pb-1.5">
27
- <span class="${j.labelMono} select-none">find:</span>
28
- <input id="filter" type="search" class="w-full min-w-0 border-0 bg-transparent py-0.5 text-fg text-[12px] font-mono outline-0 placeholder:text-faint" placeholder="package name…" aria-label="Filter packages" autocomplete="off" spellcheck="false" />
29
- <span id="filter-count" data-state="" class="font-mono text-faint text-[10px] tracking-[0.05em] shrink-0 select-none data-[state=zero]:text-accent" aria-live="polite"></span>
30
- </label>
31
- <div id="filter-results" data-open="false" class="data-[open=false]:hidden absolute z-20 top-full left-0 right-0 mt-2 bg-panel border border-border max-h-72 overflow-y-auto shadow-[0_4px_12px_rgba(0,0,0,0.08)]" role="listbox" aria-label="Matching packages"></div>
32
- </div>
33
- </div>
34
- <main class="relative flex-1 min-h-[480px]">${D?'<div class="flex flex-col items-center justify-center min-h-[400px] gap-4 text-center"><div class="font-sans text-[72px] font-semibold text-fg leading-none tracking-tight">NONE</div><div class="font-mono text-faint text-[12px] uppercase tracking-[0.15em]">No projects discovered in this workspace.</div></div>':`<div id="graph" class="absolute inset-0"></div>
35
- <div id="tooltip" data-pinned="false" class="fixed z-30 top-0 left-0 hidden bg-panel border border-border2 px-4 py-3 max-w-[380px] pointer-events-none font-sans shadow-[0_8px_24px_rgba(0,0,0,0.12)] data-[pinned=true]:pointer-events-auto data-[pinned=true]:border-accent"></div>
36
- <div id="legend" class="absolute top-4 right-4 bg-panel/95 backdrop-blur-sm border border-border px-4 py-3 min-w-[200px]">
37
- <div class="${j.labelMono} mb-2">Filter</div>
38
- <div data-toggle="app" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-app shrink-0 group-data-[state=off]:opacity-30"></span>Application</div>
39
- <div data-toggle="lib" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-lib shrink-0 group-data-[state=off]:opacity-30"></span>Library</div>
40
- <div data-toggle="prod" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge shrink-0 group-data-[state=off]:opacity-30"></span>Static dep</div>
41
- <div data-toggle="dev" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge-faint shrink-0 group-data-[state=off]:opacity-30"></span>Dev / implicit</div>
42
- <div data-toggle="peer" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-accent shrink-0 group-data-[state=off]:opacity-30"></span>Peer</div>
43
- </div>
44
- <div class="absolute bottom-4 left-4 flex flex-wrap items-center gap-x-6 gap-y-2 bg-panel/95 backdrop-blur-sm border border-border px-4 py-2 font-mono text-[10px] uppercase tracking-[0.15em] text-faint">
45
- <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">/</span><span>Search</span></div>
46
- <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">R</span><span>Fit view</span></div>
47
- <div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">Click</span><span>Pin · click empty to unpin</span></div>
48
- </div>`}</main>
49
- <footer class="flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-8 py-4 text-[10px] uppercase border-t border-border font-mono text-faint tracking-[0.1em]">
50
- <span><b class="text-fg font-semibold">${Ee(y.tool.name)}</b> ${Ee(y.tool.version)} · generated ${Ee(l.toISOString())}</span>
51
- <span class="inline-flex items-center gap-2"><span>built by</span><a class="sig-by-link inline-flex items-center" href="https://anolilab.com" rel="noreferrer noopener" target="_blank" aria-label="Anolilab">${Ir}</a></span>
52
- </footer>
53
- </div>
54
- <script>${Kr}<\/script>
55
- <script>${Vr}<\/script>
56
- <script>${Yr}<\/script>
57
- <script>${Xr}<\/script>
58
- <script>
59
- (() => {
60
- const root = document.documentElement;
61
- const themeBtn = document.getElementById('theme');
62
- const mql = window.matchMedia('(prefers-color-scheme: dark)');
63
-
64
- try {
65
- const stored = localStorage.getItem('vis-graph-theme');
66
- if (stored === 'light' || stored === 'dark') {
67
- root.dataset.theme = stored;
68
- }
69
- } catch {}
70
-
71
- const data = ${JSON.stringify(N).replaceAll("</",String.raw`<\/`)};
72
- if (!data.nodes.length || !window.graphology || !window.Sigma) {
73
- return;
74
- }
75
-
76
- // Reusable Tailwind utility-class strings for dynamically-created elements.
77
- // Inline-everywhere is the system of record; these strings only exist
78
- // because the JS DOM API can't read Tailwind from the markup.
79
- const CLS = {
80
- ttlName: 'font-sans text-fg text-[13px] font-semibold leading-tight mb-1 break-words',
81
- ttlType: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em]',
82
- ttlPath: 'font-mono text-muted text-[10px] mt-2 break-all',
83
- ttlSection: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] mt-3 mb-1',
84
- ttlEmpty: 'font-mono text-faint text-[10px] italic mt-2',
85
- ttlMore: 'font-mono text-faint text-[10px] italic pl-3 mt-1',
86
- ttlUl: 'mt-1 space-y-0.5',
87
- ttlLi: "font-mono text-fg text-[11px] leading-snug pl-3 relative before:content-['→'] before:text-faint before:absolute before:left-0",
88
- matchItem: 'flex items-center justify-between gap-3 px-3 py-2 cursor-pointer text-[12px] hover:bg-row-hover aria-selected:bg-row-hover',
89
- miName: 'font-sans text-fg truncate',
90
- miMark: 'bg-accent-soft text-accent rounded-sm px-0.5',
91
- miKind: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] shrink-0',
92
- matchEmpty: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] px-3 py-3',
93
- };
94
-
95
- // Read live colors from the rendered CSS so theme switches stay in one
96
- // place: change vars → call sigma.refresh() and node/edge colors update.
97
- const css = () => {
98
- const s = getComputedStyle(root);
99
- return {
100
- app: s.getPropertyValue('--node-app').trim(),
101
- lib: s.getPropertyValue('--node-lib').trim(),
102
- edge: s.getPropertyValue('--edge').trim(),
103
- edgeFaint: s.getPropertyValue('--edge-faint').trim(),
104
- accent: s.getPropertyValue('--accent').trim(),
105
- fg: s.getPropertyValue('--fg').trim(),
106
- muted: s.getPropertyValue('--muted').trim(),
107
- };
108
- };
109
-
110
- let theme = css();
111
-
112
- const Graph = window.graphology.Graph || window.graphology;
113
- const graph = new Graph({ multi: true, type: 'directed' });
114
-
115
- const colorForNode = (type) => type === 'application' ? theme.app : theme.lib;
116
- const colorForEdge = (type) => {
117
- if (type === 'peerDependency') return theme.accent;
118
- if (type === 'devDependency' || type === 'implicit') return theme.edgeFaint;
119
- return theme.edge;
120
- };
121
-
122
- // Attribute is named "kind", not "type": sigma reads node.type as its
123
- // program-class name and bails when it sees "application" / "library".
124
- for (const n of data.nodes) {
125
- graph.addNode(n.name, {
126
- x: n.x,
127
- y: n.y,
128
- size: n.size,
129
- label: n.name,
130
- kind: n.type,
131
- path: n.path,
132
- color: colorForNode(n.type),
133
- });
134
- }
135
-
136
- for (const e of data.edges) {
137
- graph.addEdge(e.source, e.target, {
138
- color: colorForEdge(e.type),
139
- depType: e.type,
140
- size: 1,
141
- });
142
- }
143
-
144
- // Adjacency for tooltip & hover-emphasis.
145
- const depMap = {}, rdepMap = {};
146
- for (const n of data.nodes) { depMap[n.name] = []; rdepMap[n.name] = []; }
147
- for (const e of data.edges) {
148
- depMap[e.source].push(e.target);
149
- rdepMap[e.target].push(e.source);
150
- }
151
-
152
- const container = document.getElementById('graph');
153
- const tooltip = document.getElementById('tooltip');
154
- const filterInput = document.getElementById('filter');
155
- const filterCount = document.getElementById('filter-count');
156
- const filterResults = document.getElementById('filter-results');
157
-
158
- const renderer = new window.Sigma(graph, container, {
159
- renderEdgeLabels: false,
160
- labelColor: { color: theme.fg },
161
- labelFont: 'system-ui, -apple-system, sans-serif',
162
- labelSize: 11,
163
- labelWeight: '500',
164
- labelDensity: 0.7,
165
- labelGridCellSize: 80,
166
- defaultEdgeColor: theme.edge,
167
- defaultNodeColor: theme.lib,
168
- defaultEdgeType: 'arrow',
169
- minCameraRatio: 0.05,
170
- maxCameraRatio: 8,
171
- // Suppress sigma's built-in hover label panel. We render our own tooltip,
172
- // so its empty label box (the small rectangle near the cursor) is noise.
173
- defaultDrawNodeHover: () => undefined,
174
- });
175
-
176
- // State: hover follows the mouse, focus is sticky (set by clicking a node
177
- // or selecting a search result), pin keeps the tooltip locked in place.
178
- let hoveredNode = null;
179
- let focusedNode = null;
180
- let pinned = false;
181
- let filterTerm = '';
182
- let matches = [];
183
- let activeMatchIndex = -1;
184
-
185
- // Legend filter state: each key toggles the visibility of a category.
186
- // previewCategory is set transiently while hovering a legend row so the
187
- // user can sneak-peek which lines/nodes belong to that category without
188
- // committing to a toggle.
189
- const visible = { app: true, lib: true, prod: true, dev: true, peer: true };
190
- let previewCategory = null;
191
- const isNodeCat = (k) => k === 'app' || k === 'lib';
192
- const isEdgeCat = (k) => k === 'prod' || k === 'dev' || k === 'peer';
193
- const edgeCategory = (depType) => {
194
- if (depType === 'peerDependency') return 'peer';
195
- if (depType === 'devDependency' || depType === 'implicit') return 'dev';
196
- return 'prod';
197
- };
198
- const nodeVisible = (kind) => visible[kind === 'application' ? 'app' : 'lib'];
199
-
200
- const activeNode = () => focusedNode || hoveredNode;
201
-
202
- renderer.setSetting('nodeReducer', (node, attrs) => {
203
- if (!nodeVisible(attrs.kind)) {
204
- return { ...attrs, hidden: true, label: '' };
205
- }
206
- // Legend-row preview takes precedence over normal focus/hover emphasis:
207
- // hovering a category gives an unambiguous "show me what's in this set".
208
- if (previewCategory) {
209
- const nodeCat = attrs.kind === 'application' ? 'app' : 'lib';
210
- const inPreview = isNodeCat(previewCategory) ? nodeCat === previewCategory : false;
211
- return {
212
- ...attrs,
213
- color: inPreview ? attrs.color : theme.edgeFaint,
214
- label: inPreview ? attrs.label : '',
215
- zIndex: inPreview ? 1 : 0,
216
- };
217
- }
218
- const active = activeNode();
219
- const matchedFilter = !filterTerm || node.toLowerCase().includes(filterTerm);
220
- const isActive = active === node;
221
- const isRelated = active && (depMap[active]?.includes(node) || rdepMap[active]?.includes(node));
222
- const dim = (filterTerm && !matchedFilter) || (active && !isActive && !isRelated);
223
- return {
224
- ...attrs,
225
- color: isActive ? theme.accent : attrs.color,
226
- label: dim ? '' : attrs.label,
227
- zIndex: isActive ? 2 : isRelated ? 1 : 0,
228
- };
229
- });
230
-
231
- renderer.setSetting('edgeReducer', (edge, attrs) => {
232
- if (!visible[edgeCategory(attrs.depType)]) {
233
- return { ...attrs, hidden: true };
234
- }
235
- const ext = graph.extremities(edge);
236
- if (!nodeVisible(graph.getNodeAttribute(ext[0], 'kind')) || !nodeVisible(graph.getNodeAttribute(ext[1], 'kind'))) {
237
- return { ...attrs, hidden: true };
238
- }
239
- if (previewCategory) {
240
- if (isEdgeCat(previewCategory)) {
241
- const inPreview = edgeCategory(attrs.depType) === previewCategory;
242
- return { ...attrs, color: inPreview ? theme.accent : theme.edgeFaint, size: inPreview ? 1.5 : 0.3, zIndex: inPreview ? 1 : 0 };
243
- }
244
- // Previewing a node category dims every edge — the focus is on the dots.
245
- return { ...attrs, color: theme.edgeFaint, size: 0.3 };
246
- }
247
- const active = activeNode();
248
- const touchesActive = active && (ext[0] === active || ext[1] === active);
249
- if (active && !touchesActive) {
250
- return { ...attrs, color: theme.edgeFaint, hidden: false, size: 0.5 };
251
- }
252
- if (touchesActive) {
253
- return { ...attrs, color: theme.accent, size: 1.5, zIndex: 1 };
254
- }
255
- return attrs;
256
- });
257
-
258
- // Tooltip body assembled with safe DOM methods (createElement +
259
- // textContent) — no innerHTML, no template strings of user data.
260
- const MAX_TOOLTIP_ITEMS = 8;
261
- const setTooltipContent = (name) => {
262
- const node = graph.getNodeAttributes(name);
263
- const deps = depMap[name] || [];
264
- const rdeps = rdepMap[name] || [];
265
- tooltip.textContent = '';
266
-
267
- const nameEl = document.createElement('div');
268
- nameEl.className = CLS.ttlName;
269
- nameEl.textContent = name;
270
- tooltip.appendChild(nameEl);
271
-
272
- const typeEl = document.createElement('div');
273
- typeEl.className = CLS.ttlType;
274
- typeEl.textContent = node.kind + (pinned ? ' · pinned' : '');
275
- tooltip.appendChild(typeEl);
276
-
277
- if (node.path) {
278
- const pathEl = document.createElement('div');
279
- pathEl.className = CLS.ttlPath;
280
- pathEl.textContent = node.path;
281
- tooltip.appendChild(pathEl);
282
- }
283
-
284
- const addSection = (label, items) => {
285
- const heading = document.createElement('div');
286
- heading.className = CLS.ttlSection;
287
- heading.textContent = label + ' (' + items.length + ')';
288
- tooltip.appendChild(heading);
289
- const ul = document.createElement('ul');
290
- ul.className = CLS.ttlUl;
291
- const shown = items.slice(0, MAX_TOOLTIP_ITEMS);
292
- for (const item of shown) {
293
- const li = document.createElement('li');
294
- li.className = CLS.ttlLi;
295
- li.textContent = item;
296
- ul.appendChild(li);
297
- }
298
- if (items.length > MAX_TOOLTIP_ITEMS) {
299
- const more = document.createElement('li');
300
- more.className = CLS.ttlMore;
301
- more.textContent = (items.length - MAX_TOOLTIP_ITEMS) + ' more';
302
- ul.appendChild(more);
303
- }
304
- tooltip.appendChild(ul);
305
- };
306
-
307
- if (deps.length) addSection('Depends on', deps);
308
- if (rdeps.length) addSection('Required by', rdeps);
309
- if (!deps.length && !rdeps.length) {
310
- const empty = document.createElement('div');
311
- empty.className = CLS.ttlEmpty;
312
- empty.textContent = 'No dependencies';
313
- tooltip.appendChild(empty);
314
- }
315
- };
316
-
317
- // Tooltip placement delegated to Floating UI. We build a virtual reference
318
- // element that either follows the cursor (hover) or anchors to a node's
319
- // viewport position (pinned), then run computePosition with flip + shift +
320
- // size middleware so the tooltip always fits the viewport.
321
- const FUI = window.FloatingUIDOM;
322
- let lastMouse = null;
323
- let anchorMode = 'cursor'; // 'cursor' (follows mouse) or 'node' (sticky to node)
324
- let anchorNode = null;
325
- let cleanupAutoUpdate = null;
326
-
327
- const cursorRef = {
328
- getBoundingClientRect() {
329
- const x = lastMouse ? lastMouse.clientX : 0;
330
- const y = lastMouse ? lastMouse.clientY : 0;
331
- return { width: 0, height: 0, x, y, top: y, left: x, right: x, bottom: y };
332
- },
333
- };
334
-
335
- const nodeRef = {
336
- getBoundingClientRect() {
337
- if (!anchorNode || !graph.hasNode(anchorNode)) {
338
- return { width: 0, height: 0, x: 0, y: 0, top: 0, left: 0, right: 0, bottom: 0 };
339
- }
340
- const pos = renderer.getNodeDisplayData(anchorNode);
341
- const vp = renderer.graphToViewport({ x: pos.x, y: pos.y });
342
- const rect = container.getBoundingClientRect();
343
- const r = (pos.size || 4) + 4;
344
- const cx = rect.left + vp.x;
345
- const cy = rect.top + vp.y;
346
- return { width: r * 2, height: r * 2, x: cx - r, y: cy - r, top: cy - r, left: cx - r, right: cx + r, bottom: cy + r };
347
- },
348
- };
349
-
350
- const updatePosition = async () => {
351
- if (tooltip.style.display !== 'block') return;
352
- const ref = anchorMode === 'node' ? nodeRef : cursorRef;
353
- const { x, y } = await FUI.computePosition(ref, tooltip, {
354
- placement: 'right-start',
355
- strategy: 'fixed',
356
- middleware: [
357
- FUI.offset(12),
358
- FUI.flip({ fallbackPlacements: ['left-start', 'right-end', 'left-end', 'top', 'bottom'] }),
359
- FUI.shift({ padding: 12 }),
360
- FUI.size({
361
- padding: 12,
362
- apply({ availableWidth, availableHeight, elements }) {
363
- const maxW = Math.min(380, Math.max(220, availableWidth));
364
- const maxH = Math.max(160, availableHeight);
365
- Object.assign(elements.floating.style, {
366
- maxWidth: maxW + 'px',
367
- maxHeight: maxH + 'px',
368
- overflowY: 'auto',
369
- });
370
- },
371
- }),
372
- ],
373
- });
374
- Object.assign(tooltip.style, { left: x + 'px', top: y + 'px' });
375
- };
376
-
377
- const stopAutoUpdate = () => {
378
- if (cleanupAutoUpdate) { cleanupAutoUpdate(); cleanupAutoUpdate = null; }
379
- };
380
-
381
- // Auto-update is only used for the node-anchored (pinned) mode, where the
382
- // reference is stable across events but its viewport position changes when
383
- // the user pans, zooms, or resizes. In cursor mode we drive recomputation
384
- // ourselves from the mousemove handler.
385
- const startAutoUpdate = () => {
386
- stopAutoUpdate();
387
- if (anchorMode === 'node') {
388
- cleanupAutoUpdate = FUI.autoUpdate(nodeRef, tooltip, updatePosition);
389
- }
390
- };
391
-
392
- const showTooltipFor = (name, mode = 'cursor') => {
393
- anchorMode = mode;
394
- anchorNode = mode === 'node' ? name : null;
395
- setTooltipContent(name);
396
- tooltip.style.display = 'block';
397
- startAutoUpdate();
398
- updatePosition();
399
- };
400
-
401
- const hideTooltip = () => {
402
- stopAutoUpdate();
403
- tooltip.style.display = 'none';
404
- tooltip.dataset.pinned = 'false';
405
- anchorNode = null;
406
- };
407
-
408
- renderer.on('enterNode', (e) => {
409
- hoveredNode = e.node;
410
- if (!pinned) showTooltipFor(e.node, 'cursor');
411
- renderer.refresh({ skipIndexation: true });
412
- });
413
-
414
- renderer.on('leaveNode', () => {
415
- hoveredNode = null;
416
- if (!pinned) hideTooltip();
417
- renderer.refresh({ skipIndexation: true });
418
- });
419
-
420
- // Click a node to pin it; the anchor switches from the cursor to the node
421
- // so the tooltip stays attached even when the mouse moves away.
422
- renderer.on('clickNode', (e) => {
423
- focusedNode = e.node;
424
- pinned = true;
425
- tooltip.dataset.pinned = 'true';
426
- showTooltipFor(e.node, 'node');
427
- renderer.refresh({ skipIndexation: true });
428
- });
429
-
430
- renderer.on('clickStage', () => {
431
- if (pinned || focusedNode) {
432
- focusedNode = null;
433
- pinned = false;
434
- tooltip.dataset.pinned = 'false';
435
- if (hoveredNode) {
436
- showTooltipFor(hoveredNode, 'cursor');
437
- } else {
438
- hideTooltip();
439
- }
440
- renderer.refresh({ skipIndexation: true });
441
- }
442
- });
443
-
444
- let posRafQueued = false;
445
- container.addEventListener('mousemove', (e) => {
446
- lastMouse = { clientX: e.clientX, clientY: e.clientY };
447
- if (anchorMode === 'cursor' && tooltip.style.display === 'block' && !posRafQueued) {
448
- posRafQueued = true;
449
- requestAnimationFrame(() => {
450
- posRafQueued = false;
451
- updatePosition();
452
- });
453
- }
454
- });
455
-
456
- const focusOnNode = (name, { pin = true } = {}) => {
457
- if (!graph.hasNode(name)) return;
458
- const pos = renderer.getNodeDisplayData(name);
459
- if (pos) renderer.getCamera().animate({ x: pos.x, y: pos.y, ratio: 0.3 }, { duration: 600 });
460
- focusedNode = name;
461
- pinned = pin;
462
- if (pin) tooltip.dataset.pinned = 'true';
463
- showTooltipFor(name, pin ? 'node' : 'cursor');
464
- renderer.refresh({ skipIndexation: true });
465
- };
466
-
467
- // ── Search results ───────────────────────────────────────────────────
468
- const totalNodes = data.nodes.length;
469
- const renderResults = () => {
470
- filterResults.textContent = '';
471
- if (!filterTerm) {
472
- filterResults.dataset.open = 'false';
473
- filterCount.textContent = '';
474
- filterCount.dataset.state = '';
475
- activeMatchIndex = -1;
476
- return;
477
- }
478
- filterCount.textContent = matches.length + ' / ' + totalNodes;
479
- filterCount.dataset.state = matches.length === 0 ? 'zero' : '';
480
- if (matches.length === 0) {
481
- const empty = document.createElement('div');
482
- empty.className = CLS.matchEmpty;
483
- const b = document.createElement('b'); b.textContent = 'No matches'; b.className = 'text-fg';
484
- empty.appendChild(b);
485
- empty.appendChild(document.createTextNode(' for "' + filterTerm + '"'));
486
- filterResults.appendChild(empty);
487
- filterResults.dataset.open = 'true';
488
- activeMatchIndex = -1;
489
- return;
490
- }
491
- const limit = Math.min(matches.length, 24);
492
- for (let i = 0; i < limit; i++) {
493
- const m = matches[i];
494
- const row = document.createElement('div');
495
- row.className = CLS.matchItem;
496
- row.setAttribute('role', 'option');
497
- row.dataset.index = String(i);
498
- if (i === activeMatchIndex) row.setAttribute('aria-selected', 'true');
499
-
500
- const nameEl = document.createElement('span');
501
- nameEl.className = CLS.miName;
502
- const idx = m.name.toLowerCase().indexOf(filterTerm);
503
- if (idx >= 0) {
504
- nameEl.appendChild(document.createTextNode(m.name.slice(0, idx)));
505
- const mark = document.createElement('mark');
506
- mark.className = CLS.miMark;
507
- mark.textContent = m.name.slice(idx, idx + filterTerm.length);
508
- nameEl.appendChild(mark);
509
- nameEl.appendChild(document.createTextNode(m.name.slice(idx + filterTerm.length)));
510
- } else {
511
- nameEl.textContent = m.name;
512
- }
513
- row.appendChild(nameEl);
514
-
515
- const kindEl = document.createElement('span');
516
- kindEl.className = CLS.miKind;
517
- kindEl.textContent = m.type === 'application' ? 'app' : 'lib';
518
- row.appendChild(kindEl);
519
-
520
- row.addEventListener('mousedown', (ev) => {
521
- ev.preventDefault();
522
- focusOnNode(m.name);
523
- filterResults.dataset.open = 'false';
524
- });
525
- filterResults.appendChild(row);
526
- }
527
- if (matches.length > limit) {
528
- const more = document.createElement('div');
529
- more.className = CLS.matchEmpty;
530
- more.textContent = '+ ' + (matches.length - limit) + ' more — refine to see';
531
- filterResults.appendChild(more);
532
- }
533
- filterResults.dataset.open = 'true';
534
- };
535
-
536
- const recomputeMatches = () => {
537
- if (!filterTerm) { matches = []; return; }
538
- matches = [];
539
- for (const n of data.nodes) {
540
- if (n.name.toLowerCase().includes(filterTerm)) matches.push(n);
541
- }
542
- matches.sort((a, b) => {
543
- // Apps first, then by closeness of match position, then by name.
544
- if (a.type !== b.type) return a.type === 'application' ? -1 : 1;
545
- const ai = a.name.toLowerCase().indexOf(filterTerm);
546
- const bi = b.name.toLowerCase().indexOf(filterTerm);
547
- if (ai !== bi) return ai - bi;
548
- return a.name.localeCompare(b.name);
549
- });
550
- };
551
-
552
- let rafQueued = false;
553
- filterInput.addEventListener('input', () => {
554
- filterTerm = filterInput.value.toLowerCase().trim();
555
- recomputeMatches();
556
- activeMatchIndex = matches.length ? 0 : -1;
557
- renderResults();
558
- if (!rafQueued) {
559
- rafQueued = true;
560
- requestAnimationFrame(() => {
561
- rafQueued = false;
562
- renderer.refresh({ skipIndexation: true });
563
- });
564
- }
565
- });
566
-
567
- filterInput.addEventListener('focus', () => {
568
- if (filterTerm) filterResults.dataset.open = 'true';
569
- });
570
-
571
- document.addEventListener('mousedown', (e) => {
572
- if (!filterResults.contains(e.target) && e.target !== filterInput) {
573
- filterResults.dataset.open = 'false';
574
- }
575
- });
576
-
577
- filterInput.addEventListener('keydown', (e) => {
578
- if (e.key === 'ArrowDown') {
579
- if (matches.length) {
580
- e.preventDefault();
581
- activeMatchIndex = (activeMatchIndex + 1) % matches.length;
582
- renderResults();
583
- }
584
- } else if (e.key === 'ArrowUp') {
585
- if (matches.length) {
586
- e.preventDefault();
587
- activeMatchIndex = (activeMatchIndex - 1 + matches.length) % matches.length;
588
- renderResults();
589
- }
590
- } else if (e.key === 'Enter') {
591
- if (matches.length && activeMatchIndex >= 0) {
592
- e.preventDefault();
593
- focusOnNode(matches[activeMatchIndex].name);
594
- filterResults.dataset.open = 'false';
595
- }
596
- }
597
- });
598
-
599
- // ── Legend / category filter ─────────────────────────────────────────
600
- const legend = document.getElementById('legend');
601
- const toggleCategory = (key) => {
602
- if (!(key in visible)) return;
603
- visible[key] = !visible[key];
604
- const row = legend?.querySelector('[data-toggle="' + key + '"]');
605
- if (row) {
606
- row.dataset.state = visible[key] ? 'on' : 'off';
607
- row.setAttribute('aria-checked', String(visible[key]));
608
- }
609
- renderer.refresh({ skipIndexation: true });
610
- };
611
- let previewRafQueued = false;
612
- const queuePreviewRefresh = () => {
613
- if (previewRafQueued) return;
614
- previewRafQueued = true;
615
- requestAnimationFrame(() => {
616
- previewRafQueued = false;
617
- renderer.refresh({ skipIndexation: true });
618
- });
619
- };
620
- legend?.querySelectorAll('[data-toggle]').forEach((row) => {
621
- row.addEventListener('click', () => toggleCategory(row.dataset.toggle));
622
- row.addEventListener('mouseenter', () => {
623
- previewCategory = row.dataset.toggle;
624
- queuePreviewRefresh();
625
- });
626
- row.addEventListener('mouseleave', () => {
627
- previewCategory = null;
628
- queuePreviewRefresh();
629
- });
630
- row.addEventListener('focus', () => {
631
- previewCategory = row.dataset.toggle;
632
- queuePreviewRefresh();
633
- });
634
- row.addEventListener('blur', () => {
635
- previewCategory = null;
636
- queuePreviewRefresh();
637
- });
638
- row.addEventListener('keydown', (e) => {
639
- if (e.key === ' ' || e.key === 'Enter') {
640
- e.preventDefault();
641
- toggleCategory(row.dataset.toggle);
642
- }
643
- });
644
- });
645
-
646
- // ── Camera controls ──────────────────────────────────────────────────
647
- const resetView = () => {
648
- renderer.getCamera().animatedReset({ duration: 600 });
649
- };
650
-
651
- const applyTheme = () => {
652
- theme = css();
653
- graph.forEachNode((node, attrs) => {
654
- graph.setNodeAttribute(node, 'color', colorForNode(attrs.kind));
655
- });
656
- graph.forEachEdge((edge, attrs) => {
657
- graph.setEdgeAttribute(edge, 'color', colorForEdge(attrs.depType));
658
- });
659
- renderer.setSetting('labelColor', { color: theme.fg });
660
- renderer.setSetting('defaultEdgeColor', theme.edge);
661
- renderer.setSetting('defaultNodeColor', theme.lib);
662
- renderer.refresh();
663
- };
664
-
665
- themeBtn?.addEventListener('click', () => {
666
- const isDark = root.dataset.theme ? root.dataset.theme === 'dark' : mql.matches;
667
- const next = isDark ? 'light' : 'dark';
668
- root.dataset.theme = next;
669
- try { localStorage.setItem('vis-graph-theme', next); } catch {}
670
- applyTheme();
671
- });
672
-
673
- mql.addEventListener('change', () => {
674
- if (!root.dataset.theme) applyTheme();
675
- });
676
-
677
- // Keyboard shortcuts: '/' focuses search, 'R' fits view, Esc clears + unpins.
678
- window.addEventListener('keydown', (e) => {
679
- const inField = document.activeElement === filterInput;
680
- if (e.key === '/' && !inField) {
681
- e.preventDefault();
682
- filterInput.focus();
683
- filterInput.select();
684
- } else if ((e.key === 'r' || e.key === 'R') && !inField) {
685
- e.preventDefault();
686
- resetView();
687
- } else if (e.key === 'Escape') {
688
- if (inField) {
689
- filterInput.value = '';
690
- filterTerm = '';
691
- matches = [];
692
- renderResults();
693
- renderer.refresh({ skipIndexation: true });
694
- filterInput.blur();
695
- } else if (pinned || focusedNode) {
696
- focusedNode = null;
697
- pinned = false;
698
- tooltip.dataset.pinned = 'false';
699
- if (!hoveredNode) hideTooltip();
700
- renderer.refresh({ skipIndexation: true });
701
- }
702
- }
703
- });
704
- })();
705
- <\/script>
706
- </body>
707
- </html>`},nn={application:0,library:3,service:1,tool:2},Mt=y=>nn[y]??Number.MAX_SAFE_INTEGER,on=y=>{const l=new Map;for(const[h,u]of Object.entries(y.dependencies))for(const v of u){const m=l.get(v.target)??[];m.push(h),l.set(v.target,m)}return Object.values(y.nodes).map(h=>({deps:y.dependencies[h.name]??[],name:h.name,reverseDeps:l.get(h.name)??[],type:h.type})).sort((h,u)=>h.type!==u.type?Mt(h.type)-Mt(u.type):h.name.localeCompare(u.name))},an=(y,l,h)=>{let u=y;if(l==="app"?u=u.filter(v=>v.type==="application"):l==="lib"&&(u=u.filter(v=>v.type!=="application")),h){const v=h.toLowerCase();u=u.filter(m=>m.name.toLowerCase().includes(v))}return u};class sn{#e;#r=new Set;#n;constructor(l){this.#n=l;const h=on(l);this.#e={allNodes:h,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",selectedIndex:0}}getSnapshot=()=>this.#e;subscribe=l=>(this.#r.add(l),()=>{this.#r.delete(l)});getFilteredNodes(){return an(this.#e.allNodes,this.#e.filterType,this.#e.filterText)}getStats(){const l=this.#e.allNodes.filter(v=>v.type==="application").length,h=this.#e.allNodes.length,u=Object.values(this.#n.dependencies).reduce((v,m)=>v+m.length,0);return{apps:l,deps:u,libs:h-l,total:h}}setSelectedIndex(l){const h=this.getFilteredNodes(),u=h.length===0?-1:Math.max(0,Math.min(l,h.length-1));u!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:u})}setFocusedPanel(l){l!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:l})}setFilterType(l){l!==this.#e.filterType&&this.#t({...this.#e,filterType:l,selectedIndex:0})}setFilter(l){this.#t({...this.#e,filterText:l,selectedIndex:0})}setFilterActive(l){l!==this.#e.filterActive&&this.#t({...this.#e,filterActive:l,filterText:l?this.#e.filterText:"",selectedIndex:l?this.#e.selectedIndex:0})}#t(l){this.#e=l;for(const h of this.#r)try{h()}catch{}}}const cn=({focused:y,node:l,scrollRef:h})=>{const u=y?"white":"gray";if(!l)return d.jsx(T,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:d.jsx(x,{dimColor:!0,children:"No project selected"})});const v=l.type==="application",m=v?"yellow":"cyan",k=v?"Application":"Library";return d.jsx(T,{borderColor:u,borderStyle:"single",borderTopRightTitle:` ${k} `,borderTopTitle:` ${l.name} `,flexDirection:"column",flexGrow:1,children:d.jsxs(br,{flexGrow:1,flexShrink:1,paddingX:2,ref:h,scrollbar:!0,scrollbarColor:"gray",children:[d.jsxs(T,{flexDirection:"column",marginTop:1,children:[d.jsxs(T,{children:[d.jsx(x,{dimColor:!0,children:"── "}),d.jsx(x,{bold:!0,color:"white",children:"DEPENDS ON"}),d.jsxs(x,{dimColor:!0,children:[" ","(",l.deps.length,")"]})]}),l.deps.length===0?d.jsx(T,{marginTop:1,paddingLeft:2,children:d.jsx(x,{dimColor:!0,children:"No dependencies"})}):d.jsx(T,{flexDirection:"column",marginTop:1,children:l.deps.map(N=>d.jsxs(T,{gap:1,paddingLeft:2,children:[d.jsx(x,{color:"cyan",children:"→"}),d.jsx(x,{children:N.target}),N.type!=="static"&&d.jsxs(x,{dimColor:!0,children:["(",N.type,")"]})]},N.target))})]}),d.jsxs(T,{flexDirection:"column",marginTop:1,children:[d.jsxs(T,{children:[d.jsx(x,{dimColor:!0,children:"── "}),d.jsx(x,{bold:!0,color:"white",children:"REQUIRED BY"}),d.jsxs(x,{dimColor:!0,children:[" ","(",l.reverseDeps.length,")"]})]}),l.reverseDeps.length===0?d.jsx(T,{marginTop:1,paddingLeft:2,children:d.jsx(x,{dimColor:!0,children:"No reverse dependencies"})}):d.jsx(T,{flexDirection:"column",marginTop:1,children:l.reverseDeps.map(N=>d.jsxs(T,{gap:1,paddingLeft:2,children:[d.jsx(x,{color:"magenta",children:"←"}),d.jsx(x,{children:N})]},N))})]}),d.jsxs(T,{flexDirection:"column",marginTop:1,children:[d.jsxs(T,{children:[d.jsx(x,{dimColor:!0,children:"── "}),d.jsx(x,{bold:!0,color:"white",children:"INFO"})]}),d.jsxs(T,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[d.jsxs(T,{children:[d.jsx(T,{width:16,children:d.jsx(x,{dimColor:!0,children:"Type:"})}),d.jsx(x,{color:m,children:k})]}),d.jsxs(T,{children:[d.jsx(T,{width:16,children:d.jsx(x,{dimColor:!0,children:"Dependencies:"})}),d.jsx(x,{children:String(l.deps.length)})]}),d.jsxs(T,{children:[d.jsx(T,{width:16,children:d.jsx(x,{dimColor:!0,children:"Required by:"})}),d.jsx(x,{children:String(l.reverseDeps.length)})]}),d.jsxs(T,{children:[d.jsx(T,{width:16,children:d.jsx(x,{dimColor:!0,children:"Connectivity:"})}),d.jsx(x,{children:String(l.deps.length+l.reverseDeps.length)})]})]})]})]})})},dn=[{key:"all",label:"All",shortcut:"1"},{key:"app",label:"Apps",shortcut:"2"},{key:"lib",label:"Libs",shortcut:"3"}],It=({isSelected:y,node:l})=>{const h=l.type==="application",u=h?"yellow":"cyan",v=h?"app":"lib";return d.jsxs(T,{flexShrink:0,height:1,children:[d.jsxs(x,{children:[y?"▶":" "," "]}),d.jsx(T,{flexGrow:1,children:d.jsx(x,{bold:y,inverse:y,wrap:"truncate",children:l.name})}),d.jsxs(x,{color:u,children:[" ",v]}),d.jsxs(x,{dimColor:!0,children:[" ","→",l.deps.length," ","←",l.reverseDeps.length]})]})},Tt=({count:y,label:l})=>d.jsxs(T,{flexShrink:0,height:1,marginTop:1,children:[d.jsxs(x,{dimColor:!0,children:["▼"," "]}),d.jsx(x,{bold:!0,color:"white",children:l.toUpperCase()}),d.jsxs(x,{dimColor:!0,children:[" ","(",y,")"]})]}),ln=({filterActive:y,filterText:l,filterType:h,focused:u,nodes:v,scrollOffset:m,selectedIndex:k,stats:N,viewportHeight:D})=>{const j=u?"white":"gray",C=v.filter(R=>R.type==="application"),I=v.filter(R=>R.type!=="application"),q=[];let z=0;if(C.length>0){q.push(d.jsx(Tt,{count:C.length,label:"Applications"},"hdr-apps"));for(const R of C){const K=z;q.push(d.jsx(It,{isSelected:K===k,node:R},R.name)),z++}}if(I.length>0){q.push(d.jsx(Tt,{count:I.length,label:"Libraries"},"hdr-libs"));for(const R of I){const K=z;q.push(d.jsx(It,{isSelected:K===k,node:R},R.name)),z++}}let L=0;C.length>0&&(L+=2+C.length),I.length>0&&(L+=2+I.length);const $=L>D&&D>0;return d.jsxs(T,{borderColor:j,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[d.jsxs(T,{flexShrink:0,gap:1,paddingX:1,children:[d.jsx(x,{bold:!0,inverse:!0,children:" VIS "}),d.jsxs(x,{wrap:"truncate",children:[N.total," ","packages"]}),d.jsxs(x,{dimColor:!0,children:["(",N.apps," ","apps,"," ",N.libs," ","libs,"," ",N.deps," ","deps)"]})]}),d.jsx(T,{flexShrink:0,gap:1,paddingX:1,paddingY:1,children:dn.map(R=>{const K=h===R.key;return d.jsxs(T,{children:[d.jsx(x,{dimColor:!K,children:"["}),d.jsx(x,{bold:K,color:K?"cyan":"gray",children:R.shortcut}),d.jsx(x,{dimColor:!K,children:"]"}),d.jsxs(x,{color:K?"white":"gray",children:[" ",R.label]})]},R.key)})}),y&&d.jsxs(T,{flexShrink:0,paddingX:1,children:[d.jsx(x,{bold:!0,color:"white",children:"/ "}),d.jsx(x,{children:l}),d.jsx(x,{inverse:!0,children:" "})]}),d.jsxs(T,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[d.jsx(T,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:d.jsx(T,{flexDirection:"column",marginTop:-m,children:q})}),$&&d.jsx(T,{flexShrink:0,marginLeft:1,marginRight:1,children:d.jsx(yr,{contentHeight:L,placement:"inset",scrollOffset:m,style:"block",viewportHeight:D})})]})]})},un=100,pn=40,hn=10,Lt={1:"all",2:"app",3:"lib"},fn=({autoExitSeconds:y=0,store:l})=>{const{exit:h}=wr(),{columns:u,rows:v}=vr(),m=he.useSyncExternalStore(l.subscribe,l.getSnapshot),[k,N]=he.useState(!1),D=he.useRef(null),j=he.useRef(null),[C,I]=he.useState(0),[q,z]=he.useState(!1),L=he.useMemo(()=>l.getFilteredNodes(),[m.allNodes,m.filterType,m.filterText]),$=he.useMemo(()=>l.getStats(),[m.allNodes]),R=L[m.selectedIndex]??null,K=he.useMemo(()=>{let w=0,c=0;for(const X of L)X.type==="application"?w+=1:c+=1;return{appsCount:w,libsCount:c}},[L]),W=he.useCallback(w=>{const{appsCount:c,libsCount:X}=K;if(w<c)return(c>0?2:0)+w;const je=c>0?2+c:0,S=X>0?2:0;return je+S+(w-c)},[K]),B=Math.max(1,v-8-(m.filterActive?1:0)),ie=he.useCallback(w=>{const c=W(w);I(X=>c>X+B-2?Math.max(0,c-B+2):c<X+1?Math.max(0,c-1):X)},[W,B]);if(he.useEffect(()=>{j.current?.scrollToTop()},[R?.name]),xr((w,c)=>{if(w==="c"&&c.ctrl){h();return}if(!q){if(k){c.escape||w==="?"?N(!1):w==="q"?(N(!1),z(!0)):c.downArrow||w==="j"?D.current?.scrollBy(1):(c.upArrow||w==="k")&&D.current?.scrollBy(-1);return}if(w==="?"){N(!0);return}if(w==="q"){z(!0);return}if(c.tab){l.setFocusedPanel(m.focusedPanel==="list"?"detail":"list");return}if(Lt[w]){l.setFilterType(Lt[w]);return}if(m.filterActive){if(c.escape){l.setFilterActive(!1);return}if(c.return){l.setFilterActive(!1);return}if(c.backspace){l.setFilter(m.filterText.slice(0,-1));return}if(w&&!c.ctrl&&!c.meta){l.setFilter(m.filterText+w);return}return}if(m.focusedPanel==="list"){if(L.length===0){w==="/"&&l.setFilterActive(!0);return}if(c.downArrow||w==="j"){const X=Math.min(m.selectedIndex+1,L.length-1);l.setSelectedIndex(X),ie(X);return}if(c.upArrow||w==="k"){const X=Math.max(m.selectedIndex-1,0);l.setSelectedIndex(X),ie(X);return}if(c.pageDown){const X=Math.min(m.selectedIndex+10,L.length-1);l.setSelectedIndex(X),ie(X);return}if(c.pageUp){const X=Math.max(m.selectedIndex-10,0);l.setSelectedIndex(X),ie(X);return}if(c.home){l.setSelectedIndex(0),I(0);return}if(c.end){const X=L.length-1;l.setSelectedIndex(X),ie(X);return}if(w==="/"){l.setFilterActive(!0);return}if(c.rightArrow){l.setFocusedPanel("detail");return}return}if(m.focusedPanel==="detail"){if(c.escape||c.leftArrow){l.setFocusedPanel("list");return}if(c.downArrow||w==="j"){j.current?.scrollBy(1);return}if(c.upArrow||w==="k"){j.current?.scrollBy(-1);return}if(c.pageDown){j.current?.scrollBy(10);return}if(c.pageUp){j.current?.scrollBy(-10);return}if(c.home){j.current?.scrollToTop();return}c.end&&j.current?.scrollToBottom()}}},{isActive:!0}),u<pn||v<hn)return d.jsx(T,{alignItems:"center",height:v,justifyContent:"center",width:u,children:d.jsxs(x,{color:"yellow",children:["Terminal too small (",u,"x",v,")"]})});const de=u>=un,ce=d.jsx(T,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:d.jsxs(T,{flexWrap:"wrap",gap:2,paddingX:1,children:[d.jsxs(T,{gap:1,children:[d.jsx(x,{bold:!0,color:"white",children:"q"}),d.jsx(x,{dimColor:!0,children:"QUIT"})]},"q"),d.jsxs(T,{gap:1,children:[d.jsx(x,{bold:!0,color:"white",children:"?"}),d.jsx(x,{dimColor:!0,children:"HELP"})]},"?"),d.jsxs(T,{gap:1,children:[d.jsx(x,{bold:!0,color:"white",children:"↑↓"}),d.jsx(x,{dimColor:!0,children:"NAV"})]},"nav"),d.jsxs(T,{gap:1,children:[d.jsx(x,{bold:!0,color:"white",children:"1-3 /"}),d.jsx(x,{dimColor:!0,children:"FILTER"})]},"f"),d.jsxs(T,{gap:1,children:[d.jsx(x,{bold:!0,color:"white",children:"Tab"}),d.jsx(x,{dimColor:!0,children:"PANEL"})]},"t")]})}),re=d.jsxs(kr,{footer:d.jsxs(x,{dimColor:!0,children:[d.jsx(x,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",d.jsx(x,{bold:!0,color:"white",children:"?"}),"/",d.jsx(x,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:D,title:"KEYBOARD SHORTCUTS",visible:k,width:52,children:[d.jsxs(T,{flexDirection:"column",marginBottom:1,children:[d.jsxs(T,{marginBottom:1,children:[d.jsx(x,{dimColor:!0,children:"── "}),d.jsx(x,{bold:!0,color:"white",children:"NAVIGATION"})]}),d.jsxs(T,{children:[d.jsx(T,{width:24,children:d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","↑","/k"]}),d.jsx(x,{dimColor:!0,children:" Move up"})]})}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","↓","/j"]}),d.jsx(x,{dimColor:!0,children:" Move down"})]})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","Tab"]}),d.jsx(x,{dimColor:!0,children:" Switch panel"})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","→","/","←"]}),d.jsx(x,{dimColor:!0,children:" Focus detail/list"})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","PgUp/PgDn"]}),d.jsx(x,{dimColor:!0,children:" Jump 10 items"})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","Home/End"]}),d.jsx(x,{dimColor:!0,children:" Jump to start/end"})]})]}),d.jsxs(T,{flexDirection:"column",marginBottom:1,children:[d.jsxs(T,{marginBottom:1,children:[d.jsx(x,{dimColor:!0,children:"── "}),d.jsx(x,{bold:!0,color:"white",children:"FILTERS"})]}),d.jsxs(T,{children:[d.jsx(T,{width:24,children:d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","1"]}),d.jsx(x,{dimColor:!0,children:" All"})]})}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","2"]}),d.jsx(x,{dimColor:!0,children:" Apps only"})]})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","3"]}),d.jsx(x,{dimColor:!0,children:" Libraries only"})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","/"]}),d.jsx(x,{dimColor:!0,children:" Text filter"})]})]}),d.jsxs(T,{flexDirection:"column",children:[d.jsxs(T,{marginBottom:1,children:[d.jsx(x,{dimColor:!0,children:"── "}),d.jsx(x,{bold:!0,color:"white",children:"ACTIONS"})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","q"]}),d.jsx(x,{dimColor:!0,children:" Quit"})]}),d.jsxs(x,{children:[d.jsxs(x,{bold:!0,color:"white",children:[" ","?"]}),d.jsx(x,{dimColor:!0,children:" Toggle help"})]})]})]}),_e=d.jsx(ln,{filterActive:m.filterActive,filterText:m.filterText,filterType:m.filterType,focused:m.focusedPanel==="list",nodes:L,scrollOffset:C,selectedIndex:m.selectedIndex,stats:$,viewportHeight:B}),G=d.jsx(cn,{focused:m.focusedPanel==="detail",node:R,scrollRef:j});if(de){const w=Math.floor(u*.35);return d.jsxs(T,{flexDirection:"column",height:v,width:u,children:[d.jsxs(T,{flexDirection:"row",flexGrow:1,children:[d.jsx(T,{flexGrow:1,children:_e}),d.jsx(T,{width:w,children:G})]}),ce,d.jsx(Et,{autoExitSeconds:y??3,onCancel:()=>{z(!1)},visible:q}),re]})}const _=Math.floor(v*.55);return d.jsxs(T,{flexDirection:"column",height:v,width:u,children:[d.jsx(T,{height:_,children:_e}),d.jsx(T,{flexGrow:1,children:G}),ce,d.jsx(Et,{autoExitSeconds:y??3,onCancel:()=>{z(!1)},visible:q}),re]})},Ut=(y,l,h,u,v,m,k,N)=>{const D=h?fe("└── "):fe("├── "),j=v.has(y),C=j?fe(" (*)"):"",I=u.get(y),q=I?.type==="application"?Ge(y):y;if(m.push(`${l}${D}${q}${C}`),j)return;v.add(y);const z=I?.deps??[],L=h?`${l} `:`${l}${fe("│")} `;if(N>=k&&z.length>0){m.push(`${L}${fe(`... ${z.length} more`)}`);return}for(let $=0;$<z.length;$++){const R=z[$];R&&Ut(R.target,L,$===z.length-1,u,v,m,k,N+1)}},zt=(y,l,h,u,v,m)=>{const k=l.get(y),N=k?.type==="application"?Ge(y):y;u.push(`${m}${N}`),h.add(y);const D=k?.deps??[];if(D.length===0){u.push(`${m} ${fe("(no dependencies)")}`);return}if(v<=0){u.push(`${m} ${fe(`... ${D.length} dependencies`)}`);return}for(let j=0;j<D.length;j++){const C=D[j];C&&Ut(C.target,m,j===D.length-1,l,h,u,v,1)}},Rt=(y,l)=>{const h=new Map;for(const[I,q]of Object.entries(y.nodes))h.set(I,{deps:(y.dependencies[I]??[]).map(z=>({target:z.target,type:z.type})),name:I,type:q.type});const u=[],v=[];for(const[I,q]of h)q.type==="application"?u.push(I):v.push(I);u.sort(),v.sort();const m=u.length+v.length,k=Object.values(y.dependencies).reduce((I,q)=>I+q.length,0),N=[Ge("Project Dependency Graph"),""];if(u.length>0){N.push(` ${Ge(kt(`Applications (${u.length})`))}`,"");for(const I of u)zt(I,h,new Set,N,l," "),N.push("")}if(v.length>0){N.push(` ${Ge(kt(`Libraries (${v.length})`))}`,"");for(const I of v)zt(I,h,new Set,N,l," "),N.push("")}const D=process.stdout.columns||80;N.push(fe("─".repeat(Math.min(D,60)))),N.push(`${Ge(String(m))} packages ${fe("·")} ${Ge(String(k))} dependencies ${fe("·")} ${Ge(String(u.length))} apps${fe(",")} ${Ge(String(v.length))} libraries`);const j=new Set;let C=!1;for(const I of[...u,...v]){const q=h.get(I)?.deps??[];for(const z of q)j.has(z.target)&&(C=!0),j.add(z.target);j.add(I)}return C&&N.push(fe("(*) = already shown above")),N.join(`
708
- `)},gn=y=>{const l=Object.values(y.nodes).map(h=>({name:h.name,type:h.type}));return{edges:Object.values(y.dependencies).flat(),nodes:l}},mn=y=>{const l=Object.values(y.nodes).map(u=>({name:u.name,path:u.data?.root,type:u.type})),h=[];for(const u of Object.values(y.dependencies))for(const v of u)h.push({source:v.source,target:v.target,type:v.type});return rn({edges:h,nodes:l,tool:{name:"vis-graph",version:"alpha"},workspaceRoot:process.cwd()})},_n=async({fs:y,logger:l,options:h,visConfig:u,workspaceRoot:v})=>{if(!v)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const m=v,{packageJsons:k,workspace:N}=Er(m,u),D=Gr(m,N,k),j=!!process.stdout.isTTY&&!Sr,C=h.format??(j?"tui":"ascii"),I=h.output,q=h.depth??1/0;let z;switch(C){case"dot":{z=mr(D);break}case"html":{z=mn(D);break}case"json":{z=JSON.stringify(gn(D),void 0,2);break}case"tui":{if(!j){z=Rt(D,q);break}const L=u?.tui?.autoExit===!0?3:typeof u?.tui?.autoExit=="number"?u.tui.autoExit:0;process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume());const $=setInterval(()=>{},1e3),R=new sn(D);await _r(jr.createElement(fn,{autoExitSeconds:L,store:R}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval($);return}default:z=Rt(D,q)}I?(await y.writeFile(I,z,"utf8"),l.info(`Graph written to ${I}`)):l.info(z)};export{_n as default};
1
+ import{createRequire as $}from"node:module";import{N as y,R as l,S as d,h as b}from"../packem_shared/ai-analysis-K-DKU3ZA.js";import{h as x,k as w,d as _}from"./bin.js";import{j as S,E as p,q as j,I as E,s as I}from"../packem_shared/Table-CcVkyULl-B_ef6zfS.js";const C=$(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const u={command:"ai",description:"AI-assisted commands: provider detection, cache management, and failure-fix proposals."},N=e=>{if(typeof e!="function")return String(e);const{name:t}=e;return t==="Boolean"?"boolean":t==="Number"?"number":t==="String"?"string":t??"unknown"},R=e=>{const t=[...e.commandPath??[],e.name].join(" "),i=(e.examples??[]).map(([o,r])=>({command:o??"",description:r??""})),n=(e.options??[]).map(o=>({defaultValue:o.defaultValue,description:o.description,name:o.name,type:N(o.type)}));return{argument:e.argument?{description:e.argument.description,name:e.argument.name}:void 0,description:e.description??"",examples:i,name:e.name,options:n,path:t}},f=(e,t=u)=>({command:t.command,description:t.description,subcommands:e.map(i=>R(i))}),P=(e,t=u)=>`${JSON.stringify(f(e,t),void 0,2)}
2
+ `,T=(e,t=u)=>{const i=f(e,t),n=[S(`vis ${i.command} — ${i.description}`),"",p("Subcommands:")];for(const o of i.subcommands){const r=o.argument?` ${j(`<${o.argument.name}>`)}`:"";if(n.push(""),n.push(` ${E(`vis ${o.path}`)}${r}`),o.description&&n.push(` ${o.description}`),o.options.length>0){const s=o.options.map(c=>`--${c.name}${c.type==="boolean"?"":`=<${c.type}>`}`).join(", ");n.push(p(` options: ${s}`))}if(o.examples.length>0){n.push(p(" examples:"));for(const s of o.examples){const c=s.description?p(` — ${s.description}`):"";n.push(` ${I(s.command)}${c}`)}}}return n.push(""),n.push(p(`Run \`vis ${i.command} discover-help\` for the machine-readable JSON catalogue (designed for AI agents).`)),n.push(p(`Run \`vis ${i.command} <subcommand> --help\` for full usage of a specific subcommand.`)),`${n.join(`
3
+ `)}
4
+ `},h=async()=>{const{default:e}=await import("./bin.js").then(t=>t.bw);return e.filter(t=>t.name!=="ai")},O=async()=>{const e=await h();process.stderr.write(T(e))},B=async()=>{const e=await h();process.stdout.write(P(e))},k=async({logger:e,visConfig:t})=>{const i=t?.ai,n=l(i);if(!n){e.error("No AI provider available to test."),process.exitCode=1;return}e.info(`Testing ${n.name}...`);try{const o=await b(n,"Reply with exactly: OK",{timeoutMs:3e4});e.info(`Provider ${n.name} responded: ${o.stdout.trim().slice(0,200)}`)}catch(o){const r=o instanceof Error?o.message:String(o);e.error(`Provider ${n.name} failed: ${r}`),process.exitCode=1}},F=({logger:e,options:t,visConfig:i})=>{const n=t.format??"table",o=i?.ai,r=y(),s=l(o);if(n==="json"){const a=r.map(m=>({available:m.available,method:m.detectionMethod,name:m.name,path:m.path,priority:d[m.name]??0,selected:m.name===s?.name,version:m.version}));process.stdout.write(`${JSON.stringify(a,void 0,2)}
5
+ `);return}const c=r.map(a=>({method:a.detectionMethod??"-",path:a.path??"-",priority:String(d[a.name]??0),provider:a.name,selected:a.name===s?.name?">>>":"",status:a.available?"available":"not found",version:a.version??"-"})),g=process.stdout.columns||80,v=x(w.createElement(_,{data:c}),{columns:g});e.info(v),s?e.info(`
6
+ Selected provider: ${s.name} (priority ${String(d[s.name]??0)})`):e.info(`
7
+ No AI provider available. Install one of the supported AI CLI tools.`)},V=async e=>{const{aiFix:t}=await import("./fix.js");await t(e)};export{B as aiDiscoverHelpExecute,V as aiFixExecute,F as aiProvidersExecute,O as aiRootExecute,k as aiTestExecute};