@preventive/triage 1.0.0-alpha.33 → 1.0.0-alpha.35
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.
- package/client/linked-findings.js +5 -4
- package/common/bundle-metadata.js +4 -3
- package/common/bundle-source-links.d.ts +2 -1
- package/common/bundle-source-links.js +133 -6
- package/common/bundle-sources.d.ts +2 -0
- package/common/bundle-sources.js +2 -4
- package/common/managed/repository-alias.ts +65 -0
- package/common/managed/routes.js +20 -1
- package/common/managed/triage.ts +2 -2
- package/out/client-managed-import.js +51 -46
- package/out/client-managed.js +252 -72
- package/out/client-sync.js +14 -14
- package/out/graph.js +11 -11
- package/out/index.html +1 -0
- package/out/terminal.js +320 -212
- package/out/view.css +1 -1
- package/out/view.js +410 -202
- package/package.json +22 -17
- package/server-managed/activity.ts +15 -1
- package/server-managed/bundle-advisories.ts +8 -3
- package/server-managed/bundle-advisory-inventory.ts +27 -25
- package/server-managed/bundle-build-worker.js +45 -9
- package/server-managed/bundle-build.ts +35 -11
- package/server-managed/bundle-cache.ts +1 -1
- package/server-managed/bundle.ts +17 -1
- package/server-managed/config.ts +5 -0
- package/server-managed/db-methods.ts +168 -49
- package/server-managed/db-neon.ts +59 -4
- package/server-managed/db-schema.ts +12 -3
- package/server-managed/db.ts +9 -1
- package/server-managed/github-issue-links.ts +127 -0
- package/server-managed/github-issues.ts +1 -1
- package/server-managed/http-response.ts +7 -1
- package/server-managed/http.ts +248 -80
- package/server-managed/index.ts +4 -0
- package/server-managed/link-reports.ts +158 -0
- package/server-managed/managed-issues.ts +31 -3
- package/server-managed/management.ts +17 -4
- package/server-managed/public-workspace.ts +5 -2
- package/server-managed/report-sources.ts +6 -5
- package/server-managed/repository-aliases.ts +91 -0
- package/server-managed/revisions.ts +2 -2
- package/server-managed/sql.ts +3 -2
- package/server-managed/storage.ts +17 -0
- package/server-managed/team-feed.ts +3 -3
- package/server-managed/team-reports.ts +24 -15
- package/server-managed/upstream-cache.ts +73 -0
- package/server-managed/workspace-shares.ts +16 -12
package/out/graph.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var Bo=globalThis[Symbol.for("@rray/frontend")];if(!Bo)throw new Error("@rray/frontend global not installed; view.js must run before lazy bundles import this wrapper");var{LitElement:ut,html:O,nothing:ui,unsafeCSS:Ue,render:ot,StateElement:br,classMap:pt,repeat:Jt,styleMap:Ze}=Bo;var Ho=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{display:grid;grid-template-columns:1fr 300px;grid-template-rows:auto 1fr;grid-template-areas:"topbar right" "stage right";min-height:0;border:1px solid var(--border);border-radius:var(--ui-radius, 8px);overflow:hidden;background:var(--graph-canvas-bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,sans-serif;font-size:12px}.graph2-layout{display:contents}:host([matrix]){grid-template-columns:minmax(0,1fr) 320px}.graph2-topbar{grid-area:topbar;display:flex;flex-direction:column;gap:.5rem;padding:var(--graph-topbar-padding, .6rem .75rem .6rem var(--graph-topbar-left-padding, .75rem));font-size:.825rem;background:var(--surface);backdrop-filter:var(--glass-blur);border-bottom:1px solid var(--graph-divider)}.graph2-topbar-row{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;padding:0}.graph2-topbar .g2-spacer{flex:1}.g2-matrix-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:11px;& button{height:30px;padding:4px 7px;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:var(--surface);color:var(--text);font:inherit}& button:hover,button[aria-pressed=true]{background:var(--graph-hover-bg);border-color:var(--muted)}}.graph2-topbar triage-selector{margin-left:auto}.g2-icon-btn{width:28px;height:28px;border-radius:var(--ui-radius, 5px);background:var(--graph-hover-bg);border:1px solid var(--border);color:var(--muted);display:grid;place-items:center;font-family:inherit;&:hover{color:var(--accent);border-color:var(--accent)}}.g2-path-filter-wrap{position:relative;flex:0 0 12rem;padding-right:22px}.g2-path-filter-wrap .g2-path-filter-clear{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:18px;height:18px;background:transparent;border:0;border-radius:var(--ui-radius, 50%);color:var(--muted);font:400 10px/1 inherit;font-family:inherit;&:hover{color:var(--text);background:var(--surface-active)}}.g2-path-filter:placeholder-shown~.g2-path-filter-clear{display:none}.g2-layout-tabs{display:inline-flex;flex-shrink:0;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);padding:2px;gap:2px;& button{position:relative;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:var(--ui-radius, 4px);background:transparent;color:var(--muted);font:inherit;font-size:11px;padding:5px 7px}& button[aria-pressed=true]{background:var(--graph-hover-bg);color:var(--text);box-shadow:var(--graph-layout-active-shadow, inset 0 0 0 1px var(--border))}}.g2-reason-filter{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:11px;& select{min-width:0;max-width:12rem;height:30px;padding:3px 6px;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);background:var(--surface);color:var(--text);font:inherit}}.graph2-right{grid-area:right;border-left:1px solid var(--graph-divider);background:var(--surface);backdrop-filter:var(--glass-blur);display:flex;flex-direction:column;overflow:hidden;padding:14px}.g2-panel-title{font-family:inherit;font-weight:600;font-size:11px;line-height:1;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);opacity:.85;margin:14px 0 8px;display:flex;align-items:baseline;gap:6px;&:first-child{margin-top:0}}.g2-panel-title-row{justify-content:space-between;gap:8px}#g2-top-pkgs-block{margin-top:14px;flex:1 1 0;min-height:0;display:flex;flex-direction:column}.g2-mini-tabs{display:flex;gap:1px;background:var(--graph-mini-tabs-bg, var(--graph-divider));border-radius:var(--ui-radius, 4px);overflow:hidden}.g2-mini-tab{background:transparent;border:0;color:var(--muted);font-family:inherit;font-weight:500;font-size:11px;line-height:1.4;text-transform:none;letter-spacing:0;padding:2px 7px;&:hover{color:var(--text);background:var(--graph-hover-bg)}&.on{background:var(--surface-active);color:var(--accent);text-decoration:var(--graph-mini-tab-active-decoration, none);text-underline-offset:.2em}}.graph2-stage{grid-area:stage;position:relative;background:var(--graph-canvas-bg);overflow:hidden;cursor:grab;&:active{cursor:grabbing}& canvas{position:absolute;inset:0;width:100%;height:100%;display:block}}.g2-stage-overlay{position:absolute;top:12px;left:12px;z-index:3;display:flex;flex-direction:column;gap:4px;pointer-events:none;max-width:calc(100% - 60px)}.g2-stage-overlay>*{pointer-events:auto}.g2-stage-stats{position:absolute;bottom:10px;left:12px;z-index:2;display:flex;flex-wrap:wrap;gap:2px 14px;font:500 10px/1.4 ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;color:var(--muted);opacity:.7;text-transform:uppercase;letter-spacing:.06em;pointer-events:none;max-width:calc(100% - 80px);& b{font-weight:600;color:var(--text);opacity:1}}.g2-stage-overlay-tr{position:absolute;top:12px;right:12px;z-index:3;pointer-events:auto}.g2-focus-pkg-btn{width:28px;height:28px;display:grid;place-items:center;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);color:var(--accent);box-shadow:var(--shadow-glass);&:hover{border-color:var(--accent);background:var(--surface-active)}& svg{display:block}}.g2-back-btn{display:inline-flex;align-items:center;gap:4px;padding:6px 11px;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);color:var(--accent);font:500 11px/1 inherit;font-family:inherit;box-shadow:var(--shadow-glass);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-self:flex-start;&:hover{border-color:var(--accent);background:var(--surface-active)}}.g2-zoom-ctrl{position:absolute;right:12px;bottom:12px;display:flex;flex-direction:column;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);overflow:hidden;z-index:3;box-shadow:var(--shadow-glass);& button{width:28px;height:28px;background:transparent;border:0;color:var(--muted);border-bottom:1px solid var(--graph-divider);display:grid;place-items:center;font-family:inherit;font-size:13px;&:last-child{border-bottom:0}&:hover:not(:disabled){color:var(--accent);background:var(--surface-active)}&:disabled{opacity:.35}}}.g2-zoom-pct{font:500 9px/1 ui-monospace,monospace;color:var(--muted);padding:5px 0;text-align:center;border-bottom:1px solid var(--graph-divider)}.g2-zoom-ctrl .g2-zoom-fit-btn{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-weight:600;font-size:9px;line-height:1;letter-spacing:-.02em;text-transform:lowercase}.g2-tooltip{position:absolute;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 7px);padding:9px 11px;pointer-events:none;min-width:170px;max-width:260px;opacity:0;transition:opacity .12s;z-index:10;box-shadow:var(--shadow-glass);&.show{opacity:1}}.g2-tt-path{font:500 11px/1.3 ui-monospace,monospace;color:var(--text);word-break:break-all;margin-bottom:4px}.g2-tt-head{display:flex;align-items:center;gap:6px;margin-bottom:6px;flex-wrap:wrap}.g2-tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.g2-tt-pkg{font-size:10px;color:var(--muted);word-break:break-all}.g2-tooltip .tree-count-chips{margin-top:6px}:host-context(body.theme-light) .graph2-right .tree-count-chip.medium,:host-context(body.theme-light) .g2-tooltip .tree-count-chip.medium{color:#fff}.g2-selection-card{background:var(--graph-hover-bg);border:1px solid var(--border);border-radius:var(--ui-radius, 8px);overflow:hidden}.g2-sel-head{padding:11px 13px;border-bottom:1px solid var(--graph-divider);display:flex;align-items:center;gap:8px}.g2-sel-file-head{padding:11px 13px;border-bottom:1px solid var(--graph-divider);display:flex;flex-direction:column;gap:6px}.g2-sel-path{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-weight:600;font-size:12px;line-height:1.3;color:var(--text);word-break:break-all}.g2-sel-pkg-row{display:flex;align-items:center;gap:6px;min-width:0}.g2-sel-pkg{font-size:11px;color:var(--muted);word-break:break-all;min-width:0}.g2-sel-fullpath{padding:7px 13px;border-bottom:1px solid var(--graph-divider);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-size:10px;line-height:1.3;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.g2-sel-size{padding:5px 13px 7px;border-bottom:1px solid var(--graph-divider);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-size:10px;line-height:1.3;color:var(--muted);font-variant-numeric:tabular-nums}.g2-sel-dot{width:11px;height:11px;border-radius:50%;box-shadow:0 0 0 3px color-mix(in srgb,var(--dot) 22%,transparent);flex-shrink:0}.g2-sel-id{font:600 12px/1 ui-monospace,monospace;color:var(--text);word-break:break-all;flex:1;min-width:0}.g2-sel-grp{font:500 9px/1 ui-monospace,monospace;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;flex-shrink:0}.g2-sel-body{padding:11px 13px}.g2-sel-row{display:flex;justify-content:space-between;gap:12px;font-size:11px;padding:5px 0;border-bottom:1px solid var(--graph-divider);&:last-child{border-bottom:0}.k{color:var(--muted);flex-shrink:0}.v{color:var(--text);font-family:ui-monospace,monospace;word-break:break-all;text-align:right;min-width:0}}.g2-sel-section{padding:9px 13px;border-top:1px solid var(--graph-divider)}.g2-sel-section-label{font-family:inherit;font-weight:600;font-size:11px;line-height:1;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);opacity:.85;margin-bottom:5px}.g2-sel-section-empty{color:var(--muted);opacity:.55;font-size:11px;font-style:italic}.g2-sel-jumps{padding:11px 13px;display:flex;gap:5px;flex-wrap:wrap;border-top:1px solid var(--graph-divider)}.g2-sel-jump{background:var(--surface-active);border:1px solid var(--border);color:var(--accent);border-radius:var(--ui-radius, 4px);padding:2px 8px;font-family:inherit;font-weight:500;font-size:11px;line-height:1.3;&:hover{border-color:var(--accent)}}.g2-sel-file-list{list-style:none;margin:0;padding:0;max-height:110px;overflow:hidden auto;-webkit-app-region:no-drag;app-region:no-drag;&::-webkit-scrollbar{width:4px}&::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}& li{padding:0}}.g2-sel-file-link{display:flex;align-items:center;gap:6px;width:100%;background:transparent;border:0;border-radius:var(--ui-radius, 3px);padding:2px 6px;min-height:20.5px;font:400 11px/1.4 ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;color:var(--accent);text-align:left;&:hover{background:var(--graph-hover-bg)}.g2-sel-file-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.g2-sel-file-path{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}.g2-empty-state,.g2-sel-section-empty,.g2-dist-empty{cursor:default;user-select:none;-webkit-user-select:none}.g2-empty-state{background:var(--graph-hover-bg);border:1px dashed var(--border);border-radius:var(--ui-radius, 8px);padding:18px 14px;text-align:center;color:var(--muted);font-size:11px;line-height:1.5;& strong{color:var(--text);display:block;margin-bottom:4px;font-weight:500}}.g2-dist-bar{width:100%;height:5px;border-radius:3px;overflow:hidden;display:flex;background:var(--surface-active);margin-bottom:8px;>span{display:block;height:100%}}.g2-dist-list{display:flex;flex-direction:column;gap:0;flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:none;-webkit-app-region:no-drag;app-region:no-drag;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--border) transparent;&::-webkit-scrollbar{width:5px}&::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}}.g2-dist-empty{color:var(--muted);opacity:.55;font-size:10px;font-style:italic;padding:6px 0;text-align:center}@media print{:host{display:none!important}}
|
|
2
|
-
`;var
|
|
3
|
-
`;var
|
|
4
|
-
`;var Uo=`.toolbar{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem;padding:.6rem .75rem;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 10px);box-shadow:var(--shadow-glass);font-size:.825rem;& label{color:var(--muted);margin-right:.15rem}& select{height:30px;box-sizing:border-box;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);padding:.25rem .4rem;font-size:.8rem;&:focus{border-color:var(--accent);outline:none}}& select.sort-select{padding:.3rem 1.7rem .3rem .55rem;min-width:8.5rem;font-weight:500;appearance:none;-webkit-appearance:none;background:transparent}:is(revalidate-filter,findings-sort){position:relative;display:inline-block;&:after{content:"";position:absolute;right:.7rem;top:50%;width:.35rem;height:.35rem;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:translateY(-70%) rotate(45deg);pointer-events:none}}& repo-filter{display:inline-block;min-width:0;max-width:100%}& analyzer-select{position:relative;display:inline-block}.analyzer-btn{display:inline-flex;align-items:center;gap:.45rem;height:30px;box-sizing:border-box;padding:.3rem .55rem;min-width:8.5rem;background:transparent;color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);font-family:inherit;font-size:.8rem;font-weight:500;&:hover{border-color:var(--accent)}&:focus-visible{border-color:var(--accent);outline:none}&.active{color:var(--accent)}.analyzer-btn-label{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:18rem}& svg{color:var(--muted);flex-shrink:0}}& range-slider{color:var(--accent);margin:0 .25rem}.conf-vals{color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.72rem;font-variant-numeric:tabular-nums;.dash{color:var(--muted);margin:0 .15rem}}& conf-filter{position:relative;display:inline-flex;align-items:center;height:30px;box-sizing:border-box;padding:0 .55rem;gap:.5rem;background:transparent;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);.conf-range-label{color:var(--muted);font-size:.7rem;font-weight:500;letter-spacing:.04em}& range-slider{margin:0}.conf-range{display:inline-flex;align-items:center;gap:.5rem}:is(.conf-range,.conf-range-label).replaced{visibility:hidden}:is(.conf-range,.conf-range-label).disabled{opacity:.35}& revalidate-filter{position:relative;display:inline-flex;align-items:center;flex:none;width:1.4rem;.sort-select{width:100%;border:0;height:auto;min-width:0;padding:0 .95rem 0 .2rem;font-size:.72rem;color:var(--muted);cursor:default;&:hover{color:var(--text)}}&:after{right:.25rem}&.replaces{position:static;.sort-select{position:absolute;inset:0 .55rem;width:auto;padding-left:0;color:var(--text)}&:after{right:.8rem}}.partial-cycle{position:absolute;right:1.75rem;top:50%;transform:translateY(-50%);z-index:1;padding:.1rem .3rem;border-radius:var(--ui-radius, 3px);font:inherit;font-size:.66rem;line-height:1.4;white-space:nowrap;cursor:default;--chip: var(--muted);color:var(--chip);border:1px solid rgb(from var(--chip) r g b / .45);background:rgb(from var(--chip) r g b / .1);&.included{--chip: var(--green)}&.excluded{--chip: var(--critical)}&.only{--chip: var(--yellow)}&:hover{background:rgb(from var(--chip) r g b / .22)}&:focus-visible{outline:1px solid var(--accent);outline-offset:1px}}}}& input[type=text]{background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);padding:.25rem .4rem;font-size:.8rem;flex:1;min-width:8rem;&:focus{border-color:var(--accent);outline:none}}.result-count{color:var(--muted);margin-left:auto}.checkbox-label{display:inline-flex;align-items:center;gap:.25rem;color:var(--muted);& input{margin:0}}}.analyzer-menu[popover]{position:fixed;inset:auto;margin:0;align-items:stretch;gap:.35rem;padding:.3rem;background:var(--bg);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);box-shadow:0 4px 12px #00000040;font-size:.825rem;-webkit-app-region:no-drag;app-region:no-drag}.analyzer-menu[popover]:not(:popover-open){display:none}.analyzer-menu[popover]:popover-open{display:flex}.analyzer-menu-sep{border-left:1px solid var(--border)}.analyzer-menu-col{display:flex;flex-direction:column;gap:1px;min-width:9rem;max-height:60vh;overflow-y:auto}.analyzer-menu-head{padding:.25rem .5rem .2rem;color:var(--muted);font-size:.68rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase}.analyzer-menu-item{display:flex;align-items:center;gap:.45rem;background:transparent;border:0;border-radius:var(--ui-radius, 3px);padding:.3rem .5rem;color:var(--text);text-align:left;font-family:inherit;font-size:.78rem;&:before{content:"";width:.8rem;flex-shrink:0}&.active:before{content:"\\2713";color:var(--accent)}&:hover{background:var(--surface)}&.zero{opacity:.45}.analyzer-menu-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:16rem}.analyzer-menu-count{color:var(--muted);font-size:.7rem;font-weight:600;font-variant-numeric:tabular-nums}}download-button{display:contents}.toolbar-export-btn{height:30px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:0 .55rem;background:transparent;color:var(--muted);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);font-family:inherit;transition:background .12s,color .12s;&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}& svg{display:block}}.trash-btn{height:30px;box-sizing:border-box;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);padding:.25rem .55rem;font-size:.8rem;font-family:inherit;&:hover{border-color:var(--accent)}&.active{border-color:var(--critical);color:var(--critical)}}.toolbar .trash-btn{margin-left:auto}triage-selector,slide-triage-tabs{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}.toolbar triage-selector{margin-left:auto}.toolbar-end{display:flex;align-items:center;gap:.75rem;margin-left:auto;&:not(:has(.toolbar-export-btn,annotation-filter,revalidation-switch)){display:none}}revalidation-switch{display:inline-flex;align-items:center;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}.revalidation-toggle{height:100%;&:has(+.revalidation-detail){border-right:1px solid var(--border)}}.revalidation-conflicts{padding:0 .6rem;background:transparent;border:none;color:var(--text);font:inherit;font-size:.78rem;cursor:default;&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.revalidation-detail{display:inline-flex;align-items:center;justify-content:center;width:30px;height:100%;box-sizing:border-box;padding:0;background:transparent;border:none;color:var(--muted);cursor:default;transition:background .12s,color .12s,opacity .12s;&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .06)}&.on{color:var(--accent);background:var(--surface-active)}&:disabled{opacity:.4;cursor:default}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.revalidation-upstream{display:inline-flex;align-items:center;justify-content:center;width:30px;height:100%;box-sizing:border-box;padding:0;background:transparent;border:none;color:var(--muted);cursor:default;transition:background .12s,color .12s;&:not(:first-child){border-left:1px solid var(--border)}&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .06)}&.on{color:var(--accent);background:var(--surface-active)}&:disabled{opacity:.4;cursor:default}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}triage-selector.is-empty{display:none}.triage-state-btn{background:transparent;border:none;color:var(--muted);padding:0 .55rem;display:inline-flex;align-items:center;gap:.35rem;transition:background .12s,color .12s;font-family:inherit;font-size:.8rem;cursor:default;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{background:var(--surface-active)}}.triage-state-btn.active.triage-state-deleted{color:var(--critical)}.triage-state-btn.active.triage-state-fixed{color:var(--green, #4ade80)}.triage-state-btn.active.triage-state-inprogress{color:var(--warning, #d97706)}.triage-state-btn.active.triage-state-invalid{color:var(--muted)}.triage-state-btn.active.triage-state-ignored{color:var(--accent, #2563eb)}entity-search{display:contents}view-mode-buttons{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden;.view-mode-btn{background:transparent;border:none;color:var(--muted);padding:.28rem .5rem;display:inline-flex;align-items:center;justify-content:center;transition:background .12s,color .12s;font-family:inherit;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{color:var(--accent);background:var(--surface-active)}& svg{display:block}}}:is(.revalidation-detail,.revalidation-upstream,.view-mode-btn){position:relative}:is(.revalidation-detail.on,.revalidation-upstream.on,.view-mode-btn.active,.g2-layout-tabs button[aria-pressed=true]):before{content:var(--selected-icon-ring-content, none);position:absolute;left:50%;top:50%;width:22px;height:22px;box-sizing:border-box;border:1px solid currentcolor;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}source-filter{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden;.source-chip{background:transparent;border:none;color:var(--muted);padding:0 .55rem;display:inline-flex;align-items:center;transition:background .12s,color .12s;font-family:inherit;font-size:.75rem;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{color:var(--accent);background:var(--surface-active)}}}severity-mode-switch{display:inline-flex;align-items:center;gap:.4rem;height:30px;box-sizing:border-box;.severity-mode-label{color:var(--muted);font-size:.7rem;font-weight:500;letter-spacing:.04em}.severity-mode-chips{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}.severity-mode-chip{background:transparent;border:none;color:var(--muted);padding:0 .55rem;display:inline-flex;align-items:center;transition:background .12s,color .12s;font-family:inherit;font-size:.75rem;cursor:default;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{color:var(--accent);background:var(--surface-active)}}}annotation-filter{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden;.annotation-chip{position:relative;background:transparent;border:none;color:var(--muted);padding:0 .45rem;display:inline-flex;align-items:center;transition:background .12s,color .12s;cursor:default;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.sel-with,&.sel-without{color:var(--accent);background:var(--surface-active)}&.sel-with .flag-cloth{fill:var(--accent)}&.sel-without:after{content:"";position:absolute;left:18%;right:18%;top:50%;height:1.5px;background:currentcolor;border-radius:1px;transform:rotate(-20deg);transform-origin:center;pointer-events:none}& svg{display:block}}}.toolbar-row{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center}.search-row{display:inline-flex;align-items:center;gap:.65rem;flex:1 1 14rem;min-width:12rem}toolbar-search,.toolbar-search{display:inline-flex;align-items:center;gap:.5rem;flex:1;min-width:0;height:30px;box-sizing:border-box;padding:0 .65rem;background:var(--bg);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);&:has(input:focus){border-color:var(--accent)}>svg{color:var(--muted);flex-shrink:0}&[kind] input[type=text],&.toolbar-search input[type=text]{flex:1;min-width:0;background:transparent;border:0;outline:none;color:var(--text);font:inherit;font-size:.8rem;padding:0;&:focus{border:0}&::placeholder{color:var(--muted)}&:focus::placeholder{color:transparent}&::-webkit-search-cancel-button{display:none}}}.search-negate-btn{flex-shrink:0;width:20px;height:20px;display:grid;place-items:center;background:transparent;color:var(--muted);border:0;border-radius:var(--ui-radius, 3px);padding:0;transition:background .12s,color .12s;& svg{width:13px;height:13px}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .08)}&.active{color:var(--accent);background:rgb(from var(--text) r g b / .1)}}@media(width<=1200px){.toolbar-row.sev-row .search-row{flex-basis:100%}}severity-chips{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}severity-chips>.sev-chip{display:inline-flex;align-items:center;gap:.35rem;background:transparent;border:0;padding:0 .4rem;color:var(--muted);font-family:inherit;font-size:.8rem;transition:background .12s,color .12s;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}.sd{width:8px;height:8px;border-radius:2px;flex-shrink:0;background:currentcolor}}:is(.sev-chip,.triage-state-btn){.n{align-self:flex-start;margin:1px -5px 0;color:var(--muted);font-variant-numeric:tabular-nums;font-size:8.5px;font-weight:600;background:var(--bg);border-radius:999px;padding:0 3px;min-width:11px;text-align:center;line-height:11px}&.active .n{color:var(--text)}}severity-chips>button.sev-chip{&.active{color:var(--text)}&.critical .sd{background:var(--critical)}&.high .sd{background:var(--high)}&.medium .sd{background:var(--medium)}&.low .sd{background:var(--low)}&.high_bug .sd{background:var(--high-bug)}&.bug .sd{background:var(--bug)}&.informational .sd{background:var(--info)}&.critical.active{background:rgb(from var(--critical) r g b / .25)}&.high.active{background:rgb(from var(--high) r g b / .25)}&.medium.active{background:rgb(from var(--medium) r g b / .25)}&.low.active{background:rgb(from var(--low) r g b / .25)}&.high_bug.active{background:rgb(from var(--high-bug) r g b / .25)}&.bug.active{background:rgb(from var(--bug) r g b / .25)}&.informational.active{background:rgb(from var(--info) r g b / .25)}}triage-filter{display:inline-flex;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);padding:3px;height:30px;gap:1px;& button{width:22px;height:22px;background:transparent;border:0;border-radius:var(--ui-radius, 4px);padding:0;display:grid;place-items:center;position:relative;transition:background .12s;&:hover{background:rgb(from var(--text) r g b / .06)}&.active{background:rgb(from var(--text) r g b / .08);box-shadow:0 0 0 1px var(--border)}}.td{width:12px;height:12px;border-radius:50%;border:1.5px solid currentcolor;background:transparent;transition:background .12s}& button.active .td{background:currentcolor}.td.none{border-style:dashed;color:var(--muted)}.td.r{color:#fc5855}.td.b{color:#30aff8}.td.g{color:#68c36d}.td.x{color:#6e7278}.count{position:absolute;top:-2px;right:-2px;background:var(--bg);color:var(--muted);font-size:8.5px;font-weight:600;border-radius:999px;padding:0 3px;min-width:11px;text-align:center;line-height:11px;font-variant-numeric:tabular-nums}}
|
|
5
|
-
`;var
|
|
6
|
-
\f\r]`,
|
|
7
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),qo=/'/g,Wo=/"/g,Zo=/^(?:script|style|textarea|title)$/i,io=e=>(t,...o)=>({_$litType$:e,strings:t,values:o}),$r=io(1),Mr=io(2),Sr=io(3),Ne=Symbol.for("lit-noChange"),me=Symbol.for("lit-nothing"),Yo=new WeakMap,it=rt.createTreeWalker(rt,129);function Jo(e,t){if(!no(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Go!==void 0?Go.createHTML(t):t}var Qo=(e,t)=>{let o=e.length-1,n=[],i,s=t===2?"<svg>":t===3?"<math>":"",l=bt;for(let g=0;g<o;g++){let p=e[g],u,d,r=-1,$=0;for(;$<p.length&&(l.lastIndex=$,d=l.exec(p),d!==null);)$=l.lastIndex,l===bt?d[1]==="!--"?l=jo:d[1]!==void 0?l=Xo:d[2]!==void 0?(Zo.test(d[2])&&(i=RegExp("</"+d[2],"g")),l=nt):d[3]!==void 0&&(l=nt):l===nt?d[0]===">"?(l=i??bt,r=-1):d[1]===void 0?r=-2:(r=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?nt:d[3]==='"'?Wo:qo):l===Wo||l===qo?l=nt:l===jo||l===Xo?l=bt:(l=nt,i=void 0);let y=l===nt&&e[g+1].startsWith("/>")?" ":"";s+=l===bt?p+mi:r>=0?(n.push(u),p.slice(0,r)+to+p.slice(r)+Xe+y):p+Xe+(r===-2?g:y)}return[Jo(e,s+(e[o]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]},vt=class e{constructor({strings:t,_$litType$:o},n){let i;this.parts=[];let s=0,l=0,g=t.length-1,p=this.parts,[u,d]=Qo(t,o);if(this.el=e.createElement(u,n),it.currentNode=this.el.content,o===2||o===3){let r=this.el.content.firstChild;r.replaceWith(...r.childNodes)}for(;(i=it.nextNode())!==null&&p.length<g;){if(i.nodeType===1){if(i.hasAttributes())for(let r of i.getAttributeNames())if(r.endsWith(to)){let $=d[l++],y=i.getAttribute(r).split(Xe),m=/([.?@])?(.*)/.exec($);p.push({type:1,index:s,name:m[2],strings:y,ctor:m[1]==="."?Rt:m[1]==="?"?Tt:m[1]==="@"?It:at}),i.removeAttribute(r)}else r.startsWith(Xe)&&(p.push({type:6,index:s}),i.removeAttribute(r));if(Zo.test(i.tagName)){let r=i.textContent.split(Xe),$=r.length-1;if($>0){i.textContent=St?St.emptyScript:"";for(let y=0;y<$;y++)i.append(r[y],_t()),it.nextNode(),p.push({type:2,index:++s});i.append(r[$],_t())}}}else if(i.nodeType===8)if(i.data===oo)p.push({type:2,index:s});else{let r=-1;for(;(r=i.data.indexOf(Xe,r+1))!==-1;)p.push({type:7,index:s}),r+=Xe.length-1}s++}}static createElement(t,o){let n=rt.createElement("template");return n.innerHTML=t,n}};function st(e,t,o=e,n){if(t===Ne)return t;let i=n!==void 0?o._$Co?.[n]:o._$Cl,s=xt(t)?void 0:t._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(e),i._$AT(e,o,n)),n!==void 0?(o._$Co??=[])[n]=i:o._$Cl=i),i!==void 0&&(t=st(e,i._$AS(e,t.values),i,n)),t}var At=class{constructor(t,o){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=o}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:o},parts:n}=this._$AD,i=(t?.creationScope??rt).importNode(o,!0);it.currentNode=i;let s=it.nextNode(),l=0,g=0,p=n[0];for(;p!==void 0;){if(l===p.index){let u;p.type===2?u=new yt(s,s.nextSibling,this,t):p.type===1?u=new p.ctor(s,p.name,p.strings,this,t):p.type===6&&(u=new Ct(s,this,t)),this._$AV.push(u),p=n[++g]}l!==p?.index&&(s=it.nextNode(),l++)}return it.currentNode=rt,i}p(t){let o=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,o),o+=n.strings.length-2):n._$AI(t[o])),o++}},yt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,o,n,i){this.type=2,this._$AH=me,this._$AN=void 0,this._$AA=t,this._$AB=o,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,o=this._$AM;return o!==void 0&&t?.nodeType===11&&(t=o.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,o=this){t=st(this,t,o),xt(t)?t===me||t==null||t===""?(this._$AH!==me&&this._$AR(),this._$AH=me):t!==this._$AH&&t!==Ne&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ko(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==me&&xt(this._$AH)?this._$AA.nextSibling.data=t:this.T(rt.createTextNode(t)),this._$AH=t}$(t){let{values:o,_$litType$:n}=t,i=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=vt.createElement(Jo(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(o);else{let s=new At(i,this),l=s.u(this.options);s.p(o),this.T(l),this._$AH=s}}_$AC(t){let o=Yo.get(t.strings);return o===void 0&&Yo.set(t.strings,o=new vt(t)),o}k(t){no(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,n,i=0;for(let s of t)i===o.length?o.push(n=new e(this.O(_t()),this.O(_t()),this,this.options)):n=o[i],n._$AI(s),i++;i<o.length&&(this._$AR(n&&n._$AB.nextSibling,i),o.length=i)}_$AR(t=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);t!==this._$AB;){let n=Vo(t).nextSibling;Vo(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},at=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,o,n,i,s){this.type=1,this._$AH=me,this._$AN=void 0,this.element=t,this.name=o,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=me}_$AI(t,o=this,n,i){let s=this.strings,l=!1;if(s===void 0)t=st(this,t,o,0),l=!xt(t)||t!==this._$AH&&t!==Ne,l&&(this._$AH=t);else{let g=t,p,u;for(t=s[0],p=0;p<s.length-1;p++)u=st(this,g[n+p],o,p),u===Ne&&(u=this._$AH[p]),l||=!xt(u)||u!==this._$AH[p],u===me?t=me:t!==me&&(t+=(u??"")+s[p+1]),this._$AH[p]=u}l&&!i&&this.j(t)}j(t){t===me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Rt=class extends at{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===me?void 0:t}},Tt=class extends at{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==me)}},It=class extends at{constructor(t,o,n,i,s){super(t,o,n,i,s),this.type=5}_$AI(t,o=this){if((t=st(this,t,o,0)??me)===Ne)return;let n=this._$AH,i=t===me&&n!==me||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==me&&(n===me||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Ct=class{constructor(t,o,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=o,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){st(this,t)}},en={M:to,P:Xe,A:oo,C:1,L:Qo,R:At,D:Ko,V:st,I:yt,H:at,N:Tt,U:It,B:Rt,F:Ct},bi=eo.litHtmlPolyfillSupport;bi?.(vt,yt),(eo.litHtmlVersions??=[]).push("3.3.3");var qe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Lt=e=>(...t)=>({_$litDirective$:e,values:t}),ft=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,o,n){this._$Ct=t,this._$AM=o,this._$Ci=n}_$AS(t,o){return this.update(t,o)}update(t,o){return this.render(...o)}};var{I:Tr}=en;var tn=e=>e.strings===void 0;var xi={},on=(e,t=xi)=>e._$AH=t;var nn=Lt(class extends ft{constructor(e){if(super(e),e.type!==qe.PROPERTY&&e.type!==qe.ATTRIBUTE&&e.type!==qe.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!tn(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Ne||t===me)return t;let o=e.element,n=e.name;if(e.type===qe.PROPERTY){if(t===o[n])return Ne}else if(e.type===qe.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(n))return Ne}else if(e.type===qe.ATTRIBUTE&&o.getAttribute(n)===t+"")return Ne;return on(e),t}});var wt=class extends ft{constructor(t){if(super(t),this.it=me,t.type!==qe.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===me||t==null)return this._t=void 0,this.it=t;if(t===Ne)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let o=[t];return o.raw=o,this._t={_$litType$:this.constructor.resultType,strings:o,values:[]}}};wt.directiveName="unsafeHTML",wt.resultType=1;var kt=Lt(wt);var rn='<svg class="file-icon" viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2 2 5v6l6 3 6-3V5L8 2Z"/><path d="M2 5l6 3 6-3"/><path d="M8 8v6"/></svg>';var sn='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="m4.5 4.5 7 2-5 5z"/><circle cx="4.5" cy="4.5" r="2" fill="currentColor"/><circle cx="11.5" cy="6.5" r="2" fill="currentColor"/><circle cx="6.5" cy="11.5" r="2" fill="currentColor"/></svg>',an='<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor" aria-hidden="true"><rect x="1" y="1.5" width="14" height="3" rx=".5"/><rect x="1" y="6.5" width="8" height="3" rx=".5"/><rect x="11" y="6.5" width="4" height="3" rx=".5"/><rect x="1" y="11.5" width="4" height="3" rx=".5"/><rect x="7" y="11.5" width="8" height="3" rx=".5"/></svg>',ln='<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M1 1h4v4H1zm5 5h4v4H6zm5 5h4v4h-4z"/><path d="M6 1h4v4H6zm5 0h4v4h-4zM1 6h4v4H1zm10 0h4v4h-4zM1 11h4v4H1zm5 0h4v4H6z" opacity=".35"/></svg>',cn='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="2.5" r="1.5" fill="currentColor"/><circle cx="3" cy="13" r="1.5" fill="currentColor"/><circle cx="8" cy="13" r="1.5" fill="currentColor"/><circle cx="13" cy="13" r="1.5" fill="currentColor"/><path d="M8 4v3M8 7H3m5 0h5M3 7v4M8 7v4M13 7v4"/></svg>';var dn='<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>',un='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" aria-hidden="true"><path d="M1 8h3.5m7 0H15"/><circle cx="8" cy="8" r="3.5"/></svg>';var Ce=["critical","high","medium","low","high_bug","bug","informational"];var ro=["revalidation","refuted","unreachable","confirmed","partial","unknown"],Gr=new Set(ro);var Kr=new TextEncoder,Zr=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});var is=Object.freeze({manage:"/manage","manage-bundles":"/manage/bundle","manage-scans":"/manage/scans","manage-reports":"/manage/report","manage-repos":"/manage/repositories","admin-users":"/manage/users","manage-teams":"/manage/team","manage-import":"/manage/import","manage-links":"/manage/links","manage-history":"/manage/history"});function so(e){return new RegExp(`(^|/)${e}/`,"u")}function Oi(e){return new RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,"u")}var $s=so("node_modules"),Ms=so("vendor"),ao="node_modules",Ss=so(ao),_s=Oi(ao);function Et(){return ao}function We(e){return typeof e!="number"||!Number.isFinite(e)?null:`${e.toLocaleString()} B`}function Fi(){return{showAll:!1,splitOwnDirs:!1,packagesView:!1,dependencyPackagesView:!1,bundleLayout:"graph",bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:"issues",edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:"",hidden:new Set,solo:null,graphState:null,layoutCache:null}}var Je=Fi(),w=new Proxy(Je,{get(e,t){return Je[t]},set(e,t,o){return Je[t]=o,!0},has(e,t){return t in Je},deleteProperty(e,t){return delete Je[t]},ownKeys(){return Reflect.ownKeys(Je)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(Je,t)}});function gn(){w.graphState?._cleanup&&w.graphState._cleanup(),w.graphState=null}function Ni(e){e&&(Je=e)}function Pt(e){if(!e)return null;let t=Et(),o=new RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,"u"),n=e.match(o);if(n)return n[1];let i=e.indexOf("/");return i>0?e.slice(0,i):"/"}var Bi=["#4e9af1","#f28e2b","#59a14f","#e15759","#76b7b2","#edc948","#b07aa1","#ff9da7","#9c755f","#5cd1e5","#f1ce63","#d37295","#a0cbe8","#86bcb6","#8cd17d","#b6992d","#499894","#e15759","#e879c7","#d4a6c8"],Hi=["#2f8aef","#d2691e","#2ea043","#e63946","#2e9a92","#b88817","#9560e8","#d24a9c","#8a5d40","#0891b2","#a07a14","#c14e8e","#1f7ad0","#549b94","#3fb95f","#a07a14","#2a8278","#cb2c40","#c026d3","#965f93"];function Di(){if(typeof document>"u")return!1;let e=document.body?.classList;return!!e&&(e.contains("theme-light")||e.contains("theme-pink")||e.contains("theme-paper"))}var lo=new Map;function he(e){let t=Di(),o=t?Hi:Bi,n=e??"__own__",i=`${t?"l":"d"}:${n}`;if(lo.has(i))return lo.get(i);let s=0;for(let u of n)s=s*37+u.codePointAt(0)|0;let g=((s%o.length+o.length)%o.length*7+3)%o.length,p=o[g];return lo.set(i,p),p}function zt(e){return e==="__own__"?"own source":typeof e!="string"?e:e.match(/^(?:.*\/)?vendor\/(.+)$/u)?.[1]??e}function hn(e){if(!e)return 0;let t=0;for(let o of Ce)t+=e[o]??0;return t}function mn(e){let t=new Map;for(let o=0;o<e.length;o++){let n=e[o];t.has(n.a)||t.set(n.a,[]),t.has(n.b)||t.set(n.b,[]),t.get(n.a).push(o),t.get(n.b).push(o)}return t}function bn(e){if(!e)return null;for(let t of Ce)if((e[t]??0)>0)return t;return null}function xn(e,t,o,n,i,s,l,g={}){let p=g.pkgOf??Pt,u=new Set(t),d=new Map,r=new Map;for(let v of t){let S=(e[v].imports??[]).filter(E=>u.has(E));d.set(v,S);for(let E of S)r.has(E)||r.set(E,[]),r.get(E).push(v)}let $=t.map(v=>{let S=o.get(v),E=n?.get(v)??null,U=hn(S),I=p(v)??"__own__",c=bn(S);return{id:v,file:v,pkg:I,x:0,y:0,deg:0,issue:c,totalIssues:U,own:S,subtree:E,size:typeof e[v]?.size=="number"?e[v].size:null,severitySet:i?.get(v)??null,colorSet:s?.get(v)??null,findings:l?.get(v)??null,isHub:!1,label:v.split("/").pop()??v}}),y=new Map($.map(v=>[v.file,v])),m=new Map;for(let v of t)for(let S of d.get(v)??[]){let[E,U]=v<S?[v,S]:[S,v],I=`${E}\0${U}`,c=m.get(I);if(!c){let R=y.get(E),T=y.get(U);if(!R||!T)continue;c={a:E,b:U,cross:R.pkg!==T.pkg,fromLo:!1,fromHi:!1},m.set(I,c),R.deg++,T.deg++}v===E?c.fromLo=!0:c.fromHi=!0}let L=[...m.values()],a=mn(L),x=new Map;for(let v of $)x.set(v.pkg,(x.get(v.pkg)??0)+1);let A=[...x.entries()].toSorted((v,S)=>S[1]-v[1]).map(([v])=>v),h=new Map;for(let v of $)h.has(v.pkg)||h.set(v.pkg,[]),h.get(v.pkg).push(v);let k={files:t,nodes:$,nodeByFile:y,edges:L,adj:a,importsOf:d,importedBy:r,packages:A,pkgCount:x,byPkg:h};return Ui(k),k}function Ui(e){for(let t of e.nodes)t.isHub=!1;for(let t of e.edges)t.cross&&(t.fromLo&&(e.nodeByFile.get(t.b).isHub=!0),t.fromHi&&(e.nodeByFile.get(t.a).isHub=!0));for(let t of e.nodes){let o=e.importedBy.get(t.file);(!o||o.length===0)&&(t.isHub=!0)}}function Ot(e){let t=e.packages.map(g=>{let p=e.byPkg.get(g)??[],u={};for(let a of Ce)u[a]=0;let d=new Set,r=new Set,$=[],y=0,m=0,L=!1;for(let a of p){if(y+=a.totalIssues,a.own)for(let x of Ce)u[x]+=a.own[x]??0;if(a.severitySet)for(let x of a.severitySet)d.add(x);if(a.colorSet)for(let x of a.colorSet)r.add(x);typeof a.size=="number"&&(m+=a.size,L=!0),$.push(a.file)}return{file:g,pkg:g,label:Be(g),fileCount:p.length,size:L?m:null,own:u,totalIssues:y,issue:bn(u),severitySet:d.size>0?d:null,colorSet:r.size>0?r:null,pathText:$.join(`
|
|
8
|
-
`).toLowerCase(),isHub:!0,x:0,y:0,deg:0}}),o=new Map(t.map(g=>[g.pkg,g])),n=new Map;for(let g of e.edges){if(!g.cross)continue;let p=e.nodeByFile.get(g.a)?.pkg,u=e.nodeByFile.get(g.b)?.pkg;if(!p||!u||p===u)continue;let[d,r]=p<u?[p,u]:[u,p],$=`${d}\0${r}`,y=n.get($);y||(y={a:d,b:r,cross:!0,count:0,fromLo:!1,fromHi:!1},n.set($,y),o.get(d).deg++,o.get(r).deg++),y.count++;let m=p===d;g.fromLo&&(m?y.fromLo=!0:y.fromHi=!0),g.fromHi&&(m?y.fromHi=!0:y.fromLo=!0)}let i=[...n.values()],s=mn(i),l=new Map(t.map(g=>[g.pkg,[]]));for(let g of i)g.fromLo&&l.get(g.a).push(g.b),g.fromHi&&l.get(g.b).push(g.a);return{nodes:t,byPkg:o,nodeByFile:o,edges:i,adj:s,importsOf:l}}function Be(e){return zt(e)}function Ft(e,t){if(!t||t==="/"||t==="__own__")return e;for(let o of["node_modules","dependencies",Et()]){let n=o+"/"+t+"/",i=e.indexOf(n);if(i>=0)return e.slice(i+n.length)}return e.startsWith(t+"/")?e.slice(t.length+1):e}var co=new WeakMap,uo=new WeakMap;function gt(e,t){return e.nodes.length<=100&&!t}function Nt(e,t){if(!gt(e,t))return Bt(e);if(uo.has(e))return uo.get(e);let o=new Map(e.nodes.map(s=>[s.file,[...new Set(e.importsOf.get(s.file)??[])]])),n=[];for(let[s,l]of o)for(let g of l)n.push({from:s,to:g});let i={...e,importsOf:o,directedEdges:n,fileLevel:!0};return uo.set(e,i),i}function Bt(e){if(co.has(e))return co.get(e);let t=Ot(e);if(e.layerRoots?.appImports?.length>0){if(!t.byPkg.has("__own__")){let o={file:"__own__",pkg:"__own__",label:"own source",fileCount:0,size:null,totalIssues:0,deg:0,x:0,y:0};t.nodes.push(o),t.byPkg.set(o.pkg,o)}t.importsOf.set("__own__",[...new Set([...t.importsOf.get("__own__")??[],...e.layerRoots.appImports])].filter(o=>o!=="__own__"&&t.byPkg.has(o)))}t.importedBy=new Map(t.nodes.map(o=>[o.pkg,[]])),t.directedEdges=[];for(let[o,n]of t.importsOf)for(let i of n)t.importedBy.get(i).push(o),t.directedEdges.push({from:o,to:i});for(let o of t.nodes)o.deg=(t.importsOf.get(o.pkg)?.length??0)+t.importedBy.get(o.pkg).length;return co.set(e,t),t}function go(e,t,o=null){let n=t.showBundleLayouts&&w.bundleLayout==="layers",i=t.showBundleLayouts&&w.bundleLayout==="matrix",s=t.showBundleLayouts&&w.bundleLayout==="dependencies",l=t.showBundleLayouts?O`<div class="g2-layout-tabs" role="group" aria-label="Bundle layout"><button type="button" data-g2-layout="graph" aria-label="Graph" aria-pressed="${String(!n&&!i&&!s)}">${kt(sn)}</button> <button type="button" data-g2-layout="layers" aria-label="Layers" aria-pressed="${String(!!n)}">${kt(an)}</button> <button type="button" data-g2-layout="matrix" aria-label="Matrix" aria-pressed="${String(!!i)}">${kt(ln)}</button> <button type="button" data-g2-layout="dependencies" aria-label="Dependencies" aria-pressed="${String(!!s)}">${kt(cn)}</button></div>`:null,g=t.extraTopRow,p=t.hideAllFiles??!1,u=t.triageCounts??{inprogress:0,fixed:0,invalid:0,deleted:0},d=t.triageStates??["inprogress","fixed","invalid","deleted"],r={};for(let E of Ce)r[E]=0;for(let E of e.nodes)if(E.severitySet)for(let U of E.severitySet)r[U]!==void 0&&r[U]++;let $=Ce.some(E=>r[E]>0||w.selectedSeverities.has(E)),y=["none","red","blue","green","gray"],m={none:0,red:0,blue:0,green:0,gray:0};for(let E of e.nodes)if(E.colorSet)for(let U of E.colorSet)m[U]!==void 0&&m[U]++;let L=y.some(E=>m[E]>0||w.selectedColors.has(E)),a=O`<triage-selector variant="graph" .counts="${u}" .states="${d}"></triage-selector>`,x=p?null:O`<mode-switch label="All files" .checked="${w.showAll}" data-g2-show-all></mode-switch>`,h=t.showSplitOwnDirs??!1?O`<mode-switch label="Split dirs" .checked="${w.splitOwnDirs}" data-g2-split-own></mode-switch>`:null,v=(s?e.nodes.length<=100:!n&&!i&&(t.showPackagesView??!1))?O`<mode-switch label="Packages" .checked="${s?w.dependencyPackagesView:w.packagesView}" data-g2-packages-view></mode-switch>`:null,S=e.reasons?.length>0?O`<label class="g2-reason-filter"><select aria-label="Filter files" .value="${nn(w.bundleReason??"")}" @change="${E=>E.currentTarget.dispatchEvent(new CustomEvent("bundle-graph-reason-change",{detail:{reason:E.currentTarget.value||null},bubbles:!0,composed:!0}))}"><option value="" ?selected="${w.bundleReason===null}">All</option>${e.reasons.map(E=>O`<option value="${E}" ?selected="${E===w.bundleReason}">${E}</option>`)}</select></label>`:null;return O`<div class="graph2-topbar">${g?O`<div class="graph2-topbar-row graph2-topbar-row-extra toolbar-row">${g} ${x} ${h} ${v}<div class="g2-spacer"></div>${a}</div>`:null}<div class="graph2-topbar-row graph2-topbar-row-main toolbar-row sev-row">${l} ${S} ${g?null:h} ${$?O`<severity-chips .counts="${r}" .selected="${[...w.selectedSeverities]}" kind="graph"></severity-chips>`:null} ${L?O`<triage-filter .counts="${m}" .selected="${[...w.selectedColors]}" kind="graph"></triage-filter>`:null}<div class="toolbar-search g2-path-filter-wrap"><svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg> <input type="text" class="g2-path-filter" id="g2-path-filter" placeholder="filter path/package…" .value="${w.pathFilter}"> <button type="button" class="g2-path-filter-clear" id="g2-path-filter-clear" aria-label="Clear filter">✕</button></div>${g?null:x} ${g?null:v} ${o}<div class="g2-spacer"></div>${g?null:a} <button type="button" class="g2-icon-btn" id="g2-fullscreen" aria-label="Toggle fullscreen">⛶</button></div></div>`}function Vi(e,t){let o=e.split("/").filter(Boolean),n=t.split("/").filter(Boolean),i=0;for(;i<o.length&&i<n.length&&o[i]===n[i];)i++;let s=o.length-i,l=n.slice(i).join("/");return s===0?"./"+l:"../".repeat(s)+l}function Gi(e,t){if(!t&&t!=="")return e;let o=Vi(t,e);return o.length<e.length?o:e}function po(e,t,o,n){let i=o.length;if(i===0)return O`<div class="g2-sel-section"><div class="g2-sel-section-label">${t} (${i})</div><div class="g2-sel-section-empty">none</div></div>`;let s=o.map(l=>({file:l,display:Gi(l,n)}));return s.sort((l,g)=>l.display.localeCompare(g.display)),O`<div class="g2-sel-section"><div class="g2-sel-section-label">${t} (${i})</div><ul class="g2-sel-file-list">${s.map(({file:l,display:g})=>{let p=e.nodeByFile.get(l),u=p?he(p.pkg):"#666";return O`<li><button type="button" class="g2-sel-file-link" data-g2-select="${l}"><span class="g2-sel-file-dot" style="${Ze({background:u})}"></span> <span class="g2-sel-file-path" data-tooltip-truncated data-tooltip="${l}">${g}</span></button></li>`})}</ul></div>`}function lt(e){if(!e)return O`<div class="g2-sel-section-empty">none</div>`;let o=["critical","high","medium","low","high_bug","bug","informational"].filter(n=>(e[n]??0)>0);return o.length===0?O`<div class="g2-sel-section-empty">none</div>`:O`<div class="tree-count-chips">${o.map(n=>O`<span class="${`tree-count-chip ${n}`}">${e[n]} ${n.replaceAll("_"," ")}</span>`)}</div>`}function vn(e){let t=0;for(let u of e.edges)u.cross&&t++;let o=e.edges.length-t,n=0;for(let u of e.nodes)n+=u.totalIssues;let i=e.supportsLayers&&w.bundleLayout==="dependencies"&&!w.focusedPkg?Nt(e,w.dependencyPackagesView):null,s=i?.nodes.length??e.nodes.length,l=i?.directedEdges.length??e.edges.length,g=s===0?"0.0":(l*2/s).toFixed(1),p=Be(w.focusedPkg);return O`<main class="graph2-stage"><canvas id="g2-canvas"></canvas>${w.focusedPkg?O`<div class="g2-stage-overlay"><button type="button" class="g2-back-btn" id="g2-back-to-full">← ${p}</button></div>`:null}<div id="g2-focus-overlay-slot" class="g2-stage-overlay-tr"></div><div class="g2-stage-stats">${!i||i.fileLevel?O`<span><b>${e.nodes.length}</b> files</span>`:null} <span><b>${i&&!i.fileLevel?i.nodes.length:e.packages.length}</b> packages</span> <span><b>${l}</b> ${i?"dependencies":O`edges (${o} intra · ${t} cross)`}</span> <span><b>${n}</b> issues</span> <span>avg degree <b>${g}</b></span></div><div class="g2-zoom-ctrl"><button id="g2-zoom-in" aria-label="Zoom in">+</button><div class="g2-zoom-pct" id="g2-zoom-pct">100%</div><button id="g2-zoom-out" aria-label="Zoom out">−</button> <button id="g2-zoom-fit" class="g2-zoom-fit-btn" aria-label="Fit to view">fit</button></div><div class="g2-tooltip" id="g2-tooltip"></div></main>`}function yn(e){if(e.supportsLayers&&w.bundleLayout==="dependencies")return null;let t=null;if(w.selected){let n=e.nodeByFile.get(w.selected);n&&(t=n.pkg)}else w.solo&&(t=w.solo);if(!t||(e.pkgCount.get(t)??0)<=1||w.focusedPkg===t)return null;let o=Be(t);return O`<button type="button" class="g2-focus-pkg-btn" data-g2-focus-pkg="${t}" aria-label="${`Focus on ${o}'s graph`}" data-tooltip="${`Focus on ${o}'s graph`}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8 4.6 L4 11 M8 4.6 L12 11 M5 11.4 L11 11.4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><circle cx="8" cy="3.6" r="2" fill="currentColor"/><circle cx="3.6" cy="11.4" r="2" fill="currentColor"/><circle cx="12.4" cy="11.4" r="2" fill="currentColor"/></svg></button>`}function wn(){return O`<aside class="graph2-right"><div class="g2-panel-title">Selection</div><div id="g2-selection-area"></div><div id="g2-top-pkgs-block"></div></aside>`}function kn(e){if(e.supportsLayers&&w.bundleLayout==="dependencies"&&!w.focusedPkg&&!gt(e,w.dependencyPackagesView)){let i=Bt(e),s=i.nodes.toSorted((l,g)=>i.importedBy.get(g.pkg).length-i.importedBy.get(l.pkg).length||l.pkg.localeCompare(g.pkg)).map(l=>l.pkg);return O`<div class="g2-panel-title">Packages · importers</div>${fo(i,s,!0)}`}let t=w.showAll&&e.nodes.length>0&&e.nodes.every(i=>typeof i.size=="number"),o=e.nodes.some(i=>i.totalIssues>0),n=w.topPkgsTab;return n==="size"&&!t&&(n="files"),n==="issues"&&!o&&(n="files"),O`<div class="g2-panel-title g2-panel-title-row"><span>Packages</span><div class="g2-mini-tabs">${o?O`<button type="button" class="${pt({"g2-mini-tab":!0,on:n==="issues"})}" data-g2-top-pkgs="issues">Issues</button>`:null} <button type="button" class="${pt({"g2-mini-tab":!0,on:n==="files"})}" data-g2-top-pkgs="files">Files</button> ${t?O`<button type="button" class="${pt({"g2-mini-tab":!0,on:n==="size"})}" data-g2-top-pkgs="size">Size</button>`:null}</div></div>${qi(e,n)}`}function $n(e,t={}){if(e.supportsLayers&&w.bundleLayout==="dependencies"&&!w.focusedPkg&&!gt(e,w.dependencyPackagesView))return Wi(Bt(e),w.solo);let o=w.selected;if(o){let n=e.nodeByFile.get(o);return n?ji(e,n,o,t):O`<div class="g2-empty-state"><strong>File not in current view</strong>Adjust filters or pick another file.</div>`}return w.solo?w.solo==="__own__"&&!e.pkgCount.has("__own__")&&e.layerRoots?.appImports.length>0?O`<div class="g2-empty-state"><strong>App</strong>App source is not included in this view. Connections come from its recorded imports.</div>`:Xi(e,w.solo):O`<div class="g2-empty-state">Click a node or a package row to inspect.</div>`}function ji(e,t,o,n){let i=he(t.pkg),s=Be(t.pkg),l=Ft(o,t.pkg),g=e.importedBy.get(o)??[],p=e.importsOf.get(o)??[],u=o.lastIndexOf("/"),d=u>=0?o.slice(0,u):"";return O`<div class="g2-selection-card"><div class="g2-sel-file-head"><div class="g2-sel-path">${l}</div><div class="g2-sel-pkg-row"><span class="g2-sel-dot" style="${Ze({"--dot":i,background:i})}"></span> <span class="g2-sel-pkg">${s}</span></div></div><div class="g2-sel-fullpath" data-tooltip-truncated data-tooltip="${o}">${o}</div>${We(t.size)?O`<div class="g2-sel-size">${We(t.size)}</div>`:null}<div class="g2-sel-section"><div class="g2-sel-section-label">Own findings</div>${lt(t.own)}</div><div class="g2-sel-section"><div class="g2-sel-section-label">Subtree findings</div>${lt(t.subtree)}</div><div class="g2-sel-jumps">${t.totalIssues>0?O`<button type="button" class="g2-sel-jump" data-g2-jump-findings="${o}">Findings →</button>`:null} ${n.isBundleContext?t.origFile?O`<button type="button" class="g2-sel-jump" data-bundle-view-source="${t.origFile}">View source →</button>`:null:O`<button type="button" class="g2-sel-jump" data-g2-jump-file="${o}">Files →</button>`}</div>${po(e,"Imported by",g,d)} ${po(e,"Imports",p,d)}</div>`}function Xi(e,t){let o=e.nodes.filter(r=>r.pkg===t),n=o.length;if(n===0)return O`<div class="g2-empty-state"><strong>Package has no files in view</strong> Toggle "All files" to widen the file set, or pick another package.</div>`;let i=he(t),s=Be(t),l={};for(let r of Ce)l[r]=0;for(let r of o)if(r.own)for(let $ of Ce)l[$]+=r.own[$]??0;let g=0,p=0;for(let r of e.edges){let $=e.nodeByFile.get(r.a),y=e.nodeByFile.get(r.b);!$||!y||($.pkg===t&&y.pkg===t?p++:($.pkg===t||y.pkg===t)&&g++)}let u=0;for(let r of o)r.isHub&&u++;let d=new Set;for(let r of o)for(let $ of e.importedBy.get(r.file)??[]){let y=e.nodeByFile.get($);y&&y.pkg!==t&&d.add($)}return O`<div class="g2-selection-card"><div class="g2-sel-head"><span class="g2-sel-dot" style="${Ze({"--dot":i,background:i})}"></span> <span class="g2-sel-id">${s}</span> <span class="g2-sel-grp">package</span></div><div class="g2-sel-body"><div class="g2-sel-row"><span class="k">Files</span><span class="v">${n}</span></div><div class="g2-sel-row"><span class="k">Hubs</span><span class="v">${u}</span></div><div class="g2-sel-row"><span class="k">Intra edges</span><span class="v">${p}</span></div><div class="g2-sel-row"><span class="k">Cross edges</span><span class="v">${g}</span></div></div><div class="g2-sel-section"><div class="g2-sel-section-label">Findings</div>${lt(l)}</div>${po(e,"Imported by",[...d])}</div>`}function qi(e,t){let o=e.nodes.length||1,n=t??w.topPkgsTab,i=w.selectedSeverities,s=w.selectedColors,l=i.size>0,g=s.size>0,p=l||g,u=new Map,d=new Map,r=0,$=0;for(let a of e.nodes){let x;if(p){if(x=0,a.findings)for(let A of a.findings)l&&!i.has(A.severity)||g&&!s.has(A.color)||x++}else x=a.totalIssues;u.set(a.pkg,(u.get(a.pkg)??0)+x),r+=x,typeof a.size=="number"&&(d.set(a.pkg,(d.get(a.pkg)??0)+a.size),$+=a.size)}let y;n==="issues"?y=e.packages.filter(a=>(u.get(a)??0)>0).toSorted((a,x)=>{let A=u.get(a)??0,h=u.get(x)??0;return h!==A?h-A:(e.pkgCount.get(x)??0)-(e.pkgCount.get(a)??0)}):n==="size"?y=e.packages.filter(a=>(d.get(a)??0)>0).toSorted((a,x)=>{let A=d.get(a)??0,h=d.get(x)??0;return h!==A?h-A:(e.pkgCount.get(x)??0)-(e.pkgCount.get(a)??0)}):y=[...e.packages].toSorted((a,x)=>{let A=e.pkgCount.get(a)??0,h=e.pkgCount.get(x)??0;return h!==A?h-A:(u.get(x)??0)-(u.get(a)??0)});let m=a=>n==="issues"?r>0?((u.get(a)??0)/r*100).toFixed(2):"0":n==="size"?$>0?((d.get(a)??0)/$*100).toFixed(2):"0":(e.pkgCount.get(a)/o*100).toFixed(2),L=n==="issues"?"No packages with issues":n==="size"?"No packages with size":"No packages";return O`<div class="g2-dist-bar">${e.packages.map(a=>{let x=he(a);return O`<span style="${Ze({background:x,width:`${m(a)}%`})}"></span>`})}</div><div class="g2-dist-list">${y.length===0?O`<div class="g2-dist-empty">${L}</div>`:null} ${Jt(y,a=>a,a=>{let x=he(a),A=e.pkgCount.get(a)??0,h=u.get(a)??0,k=d.get(a)??0,v=n==="issues"?h:n==="size"?We(k):A,S=n==="issues"?r>0?(h/r*100).toFixed(1):"0.0":n==="size"?$>0?(k/$*100).toFixed(1):"0.0":(A/o*100).toFixed(1),E=Be(a),U=w.solo===a;return O`<button type="button" class="${pt({"g2-dist-item":!0,on:U})}" data-g2-pkg="${a}"><span class="g2-dist-dot" style="${Ze({background:x})}"></span><span class="g2-dist-name" data-tooltip-truncated data-tooltip="${E}">${E}</span><span class="g2-dist-count">${v}</span><span class="g2-dist-pct">${S}%</span></button>`})}</div>`}function fo(e,t,o=!1){return O`<div class="g2-dist-list">${Jt(t,n=>n,n=>O`<button type="button" class="${pt({"g2-dist-item":!0,on:w.solo===n})}" data-g2-pkg="${n}"><span class="g2-dist-dot" style="${Ze({background:he(n)})}"></span> <span class="g2-dist-name">${Be(n)}</span> ${o?O`<span class="g2-dist-count">${e.importedBy.get(n).length}</span>`:null}</button>`)}</div>`}function Wi(e,t){let o=e.byPkg.get(t);if(!o)return O`<div class="g2-empty-state">Select a package to trace its importers and dependencies.</div>`;let n=e.importedBy.get(t)??[],i=e.importsOf.get(t)??[];return O`<div class="g2-selection-card"><div class="g2-sel-head"><span class="g2-sel-dot" style="${Ze({background:he(t)})}"></span> <span class="g2-sel-id">${o.label}</span></div>${o.totalIssues?O`<div class="g2-sel-section">${lt(o.own)}</div>`:null}<div class="g2-sel-section"><div class="g2-sel-section-label">Imported by (${n.length})</div>${fo(e,n.toSorted())}</div><div class="g2-sel-section"><div class="g2-sel-section-label">Dependencies (${i.length})</div>${fo(e,i.toSorted())}</div></div>`}function Mn(e){return typeof e=="string"&&/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u.test(e)?e:null}var He;function Yi(){return He||(He=document.createElement("div"),He.id="styled-tooltip",He.setAttribute("popover","manual"),document.body.append(He),He)}function Ki(e){typeof e.showPopover=="function"&&(e.matches(":popover-open")&&e.hidePopover(),e.showPopover())}var Dt=null,Sn="",Ut=null,Tn=0,In=0;document.addEventListener("mousemove",e=>{Tn=e.clientX,In=e.clientY},{passive:!0});var Zi=100,Ji=14,Qi=8,Ht=8;function er(e,{placement:t="cursor"}={}){t=e.dataset.tooltipPlacement??t;let o=Yi(),n=e.dataset.tooltip??"",i=e.dataset.tooltipRepo??"",s=Mn(e.dataset.tooltipCommit),l=["stasis","sourcemap"].includes(e.dataset.tooltipBundle)?e.dataset.tooltipBundle:"",g=e.dataset.tooltipStats??"",p=e.dataset.tooltipPackage??"",u=e.dataset.tooltipEcosystem??"",d=e.dataset.tooltipVersion??"",r=e.dataset.tooltipFiles??"",$=JSON.stringify([n,i,s,l,g,p,u,d,r]);if(!n||Dt===e&&Sn===$)return;if(o.textContent=n,p){let v=document.createElement("div");v.className="tooltip-package";let S=e.querySelector("svg")?.cloneNode(!0);S&&v.append(S);let E=document.createElement("span");E.className="tooltip-package-details";for(let U of[p,d,/^\d+$/u.test(r)?`${r} ${r==="1"?"file":"files"}`:""].filter(Boolean)){let I=document.createElement("span");I.textContent=U,E.append(I)}v.append(E),o.append(v)}if(i||s){let v=document.createElement("div");if(v.className="tooltip-repo",i){v.innerHTML=dn;let S=document.createElement("span");S.textContent=i,v.append(S)}if(s){let S=document.createElement("span");S.className="tooltip-commit",S.innerHTML=un;let E=document.createElement("span");E.textContent=s.slice(0,7),S.append(E),v.append(S)}o.append(v)}if(l||g){let v=document.createElement("div");if(v.className="tooltip-bundle",l==="stasis"){let U=document.createElement("img");U.src="./stasis.svg",U.alt="",v.append(U)}else v.innerHTML=rn;let S=document.createElement("span"),E=l==="stasis"?"Stasis":l==="sourcemap"?"Sourcemap":"";S.textContent=[E,g].filter(Boolean).join(" \xB7 "),v.append(S),o.append(v)}Ki(o),o.style.left="0px",o.style.top="0px",o.style.transform="none",o.classList.add("visible");let y=Tn,m=In+Ji;if(t==="right"||t==="right-start"){let v=e.getBoundingClientRect();y=v.right+Qi,m=v.top+(t==="right"?v.height/2:0)}let L=window.innerWidth-o.offsetWidth-Ht,a=Math.max(Ht,Math.min(y,L));o.style.left=`${Math.round(a)}px`;let x=o.offsetHeight,A=t==="right"?m-x/2:m,h=window.innerHeight-x-Ht,k=Math.max(Ht,Math.min(A,h));o.style.top=`${Math.round(k)}px`,Dt=e,Sn=$}function _n(){clearTimeout(Ut),Ut=null,He&&(He.classList.remove("visible"),typeof He.hidePopover=="function"&&He.matches(":popover-open")&&He.hidePopover()),Dt=null}function tr(e,{gate:t,placement:o}={}){Object.hasOwn(e.dataset,"tooltipTruncated")&&e.scrollWidth<=e.clientWidth&&e.scrollHeight<=e.clientHeight||t&&!t(e)||(clearTimeout(Ut),Ut=setTimeout(()=>{er(e,{placement:o})},Zi))}var An=new WeakSet;function Rn(e,t){for(let o of e.composedPath()){if(o===t)break;if(o.nodeType===1&&Object.hasOwn(o.dataset,"tooltip"))return o}return null}function Cn(e,t){!e||An.has(e)||(An.add(e),e.addEventListener("mouseover",o=>{let n=Rn(o,e);if(!n){_n();return}n!==Dt&&tr(n,t)}),e.addEventListener("mouseout",o=>{let n=Rn(o,e),i=o.relatedTarget?.closest?.("[data-tooltip]")??null;n&&n===i||_n()}))}var ho=class{constructor(t){this.nodes=[...t];for(let[o,n]of this.nodes.entries())n.position=o;for(let o=(this.nodes.length>>1)-1;o>=0;o--)this.down(o)}before(t,o){return Math.abs(t.balance)>Math.abs(o.balance)||Math.abs(t.balance)===Math.abs(o.balance)&&(t.balance>o.balance||t.balance===o.balance&&t.tie<o.tie)}swap(t,o){let n=this.nodes,i=n[t];n[t]=n[o],n[o]=i,n[t].position=t,n[o].position=o}down(t){let o=this.nodes;for(;2*t+1<o.length;){let n=2*t+1;if(n+1<o.length&&this.before(o[n+1],o[n])&&n++,!this.before(o[n],o[t]))break;this.swap(t,n),t=n}}update(t){if(t.position<0)return;let o=t.position;for(;o>0;){let n=o-1>>1;if(!this.before(t,this.nodes[n]))break;this.swap(o,n),o=n}this.down(o)}take(){let t=this.nodes[0],o=this.nodes.pop();return t.position=-1,this.nodes.length>0&&(this.nodes[0]=o,o.position=0,this.down(0)),t}};function or(e,t){for(let o=0;o<8;o++){let n=!1;for(let i=0;i<e.length-1;i++){let s=o%2?e.length-2-i:i,l=e[s],g=e[s+1];(t.get(g)?.get(l)?.count??0)<=(t.get(l)?.get(g)?.count??0)||(e[s]=g,e[s+1]=l,n=!0)}if(!n)break}return e}function nr(e){let t=[],o=new Set;for(let n of e.values())n.outgoing.sort((i,s)=>s[1]-i[1]||i[0].tie-s[0].tie);for(let n of e.values()){if(o.has(n))continue;let i=[{node:n,next:0}];for(o.add(n);i.length>0;){let s=i.at(-1);if(s.next===s.node.outgoing.length){t.push(s.node.id),i.pop();continue}let l=s.node.outgoing[s.next++][0];o.has(l)||(o.add(l),i.push({node:l,next:0}))}}return t.toReversed()}function mo(e,t){let o=new Map(e.map((i,s)=>[i,s])),n=0;for(let i of t.values())for(let[s,l]of i.outgoing)o.get(i.id)<o.get(s.id)&&(n+=l);return n}function ir(e,t){let o=mo(e,t),n=o,i=0;for(let s=0;s<e.length-1;s++)o-=t.get(e[s]).originalBalance,o>n&&(n=o,i=s+1);return[...e.slice(i),...e.slice(0,i)]}function Ln(e,t){if(e.length<2)return e;let o=new Map(e.map((p,u)=>[p,{id:p,tie:u,balance:0,incoming:[],outgoing:[]}]));for(let p of o.values())for(let u of t.get(p.id)?.values()??[]){let d=o.get(u.to);!d||d===p||(p.outgoing.push([d,u.count]),d.incoming.push([p,u.count]),p.balance+=u.count,d.balance-=u.count)}for(let p of o.values())p.originalBalance=p.balance;let n=[],i=new ho(o.values()),s=[];for(;i.nodes.length>0;){let p=i.take();p.balance>=0?n.push(p.id):s.push(p.id);for(let[u,d]of p.outgoing)u.position<0||(u.balance+=d,i.update(u));for(let[u,d]of p.incoming)u.position<0||(u.balance-=d,i.update(u))}let l=e,g=mo(e,o);for(let p of[[...n,...s.toReversed()],nr(o),e,e.toReversed()]){let u=or(ir(p,o),t),d=mo(u,o);d>g&&(l=u,g=d)}return l}function bo(e,t){let o=new Set(e),n=new Map(e.map(p=>[p,[]]));for(let[p,u]of t)for(let d of u)o.has(p)&&o.has(d)&&n.get(d).push(p);let i=[],s=new Set;for(let p of e){if(s.has(p))continue;s.add(p);let u=[[p,(t.get(p)??[])[Symbol.iterator]()]];for(;u.length>0;){let[d,r]=u.at(-1),$=r.next();if($.done){i.push(d),u.pop();continue}o.has($.value)&&!s.has($.value)&&(s.add($.value),u.push([$.value,(t.get($.value)??[])[Symbol.iterator]()]))}}let l=new Map,g=[];for(let p of i.toReversed()){if(l.has(p))continue;let u=[],d=g.length,r=[p];for(l.set(p,d);r.length>0;){let $=r.pop();u.push($);for(let y of n.get($))l.has(y)||(l.set(y,d),r.push(y))}g.push(u.toSorted())}return{groups:g,componentOf:l}}function xo(e,{expanded:t=new Set,order:o="structure",query:n="",neighborhood:i=null,cyclesOnly:s=!1}={}){let l=new Map,g=new Map;for(let f of e.nodes){let M=t.has(f.pkg),C=`${M?"f":"p"}:${M?f.file:f.pkg}`;l.has(C)||l.set(C,{id:C,pkg:f.pkg,file:M?f.file:null,label:M?f.file:zt(f.pkg),files:[],size:0,issues:0,incoming:0,outgoing:0});let Y=l.get(C);Y.files.push(f.file),Y.size+=f.size??0,Y.issues+=f.totalIssues??0,g.set(f.file,C)}let p=new Map,u=new Set,d=new Map([...l.keys()].map(f=>[f,new Set])),r=new Set,$=0;for(let[f,M]of e.importsOf){let C=g.get(f);if(C)for(let Y of new Set(M)){let W=g.get(Y);if(!W)continue;p.has(C)||p.set(C,new Map),p.get(C).has(W)||p.get(C).set(W,{from:C,to:W,count:0,examples:[]});let xe=p.get(C).get(W);xe.count++,xe.examples.length<80&&xe.examples.push([f,Y]),$++,l.get(C).outgoing++,l.get(W).incoming++,C!==W&&(r.add(C),u.add(W)),(C!==W||l.get(C).file)&&d.get(C).add(W)}}let y=[...l.keys()].toSorted(),{groups:m,componentOf:L}=bo(y,d),a=new Set(m.flatMap(f=>f.length>1||d.get(f[0]).has(f[0])?f:[]));for(let f of l.values())f.cyclic=a.has(f.id),f.component=L.get(f.id);let x=e.ownSourcePackages??new Set(e.layerRoots?.roots??[]),A=f=>f.pkg==="__own__"?0:x.has(f.pkg)?1:2,h=f=>u.has(f.id)&&r.has(f.id)?0:1,k=new Map(m.map((f,M)=>[M,f.reduce((C,Y)=>Math.min(C,A(l.get(Y))),2)])),v=(f,M)=>f.pkg.localeCompare(M.pkg)||f.label.localeCompare(M.label),S=new Map;if(o==="structure"){for(let f of m)if(!(f.length<2))for(let M of Map.groupBy(f,C=>A(l.get(C))).values()){let C=M.toSorted((Y,W)=>v(l.get(Y),l.get(W)));Ln(C,p).forEach((Y,W)=>S.set(Y,W))}}for(let[f,M]of p)for(let C of M.values())C.cyclic=a.has(f)&&L.get(f)===L.get(C.to)&&(f!==C.to||l.get(f).file!==null);let E=n.trim().toLowerCase(),U=new Set(y.filter(f=>!E||l.get(f).files.some(M=>M.toLowerCase().includes(E))||l.get(f).label.toLowerCase().includes(E))),I=new Set(i?[i]:U);if(E||i)for(let[f,M]of d)for(let C of M)(i?f===i:U.has(f))&&I.add(C),(i?C===i:U.has(C))&&I.add(f);let c=(f,M)=>{if(o==="structure"){let W=k.get(f.component)-k.get(M.component);if(W)return W;let xe=h(f)-h(M);if(xe)return xe;let Me=f.component-M.component;if(Me)return Me}let C=A(f)-A(M);if(C)return C;let Y=h(f)-h(M);if(Y)return Y;if(o==="structure"&&f.component===M.component){let W=(S.get(f.id)??0)-(S.get(M.id)??0);if(W)return W}return o==="importers"&&f.incoming!==M.incoming?M.incoming-f.incoming:o==="imports"&&f.outgoing!==M.outgoing?M.outgoing-f.outgoing:v(f,M)},R=[...l.values()].filter(f=>I.has(f.id)&&(!s||f.cyclic)).toSorted(c),T=new Map(R.map((f,M)=>[f.id,M])),F=[];for(let[f,M]of p)if(T.has(f))for(let C of M.values())T.has(C.to)&&F.push({...C,row:T.get(f),col:T.get(C.to)});return{rows:R,byId:l,cells:p,visibleCells:F,index:T,matches:U,importCount:$,totalRows:l.size,cycleCount:m.filter(f=>a.has(f[0])).length}}function vo(e,t,o){return Math.min(24,Math.max(1,t-196-12)/Math.max(1,e),Math.max(1,o-118-12)/Math.max(1,e))}function yo(e,t,o,n){return Math.max(Math.min(18,vo(t,o,n)),Math.min(27,e))}function Pn(e,t,o,n){let i=Math.floor((e-196+n.x)/n.cell),s=Math.floor((t-118+n.y)/n.cell);return e<196&&t>=118&&s>=0&&s<o.rows.length?{row:s,col:null}:t<118&&e>=196&&i>=0&&i<o.rows.length?{row:i,col:null}:e>=196&&t>=118&&s>=0&&i>=0&&s<o.rows.length&&i<o.rows.length?{row:s,col:i}:null}function En(e){if(!e.file)return e.label;let t=`node_modules/${e.pkg}/`;return e.file.includes(t)?e.file.slice(e.file.indexOf(t)+t.length):e.file}function zn(e,t,o,{width:n,height:i,theme:s,colorOf:l,hover:g,selected:p,dimmed:u}){let{cell:d,x:r,y:$}=o,{rows:y}=t,m=c=>196+c*d-r,L=c=>118+c*d-$,a=Math.max(0,Math.floor($/d)),x=Math.min(y.length,Math.ceil((i-118+$)/d)),A=Math.max(0,Math.floor(r/d)),h=Math.min(y.length,Math.ceil((n-196+r)/d)),k=g??p;e.clearRect(0,0,n,i),e.fillStyle=s.bg,e.fillRect(0,0,n,i),e.save(),e.beginPath(),e.rect(196,118,n-196,i-118),e.clip();let v=[];for(let c=0;c<y.length;c++){let R=v.at(-1),T=y[c];R&&R.component===T.component?R.end=c+1:v.push({component:T.component,start:c,end:c+1,cyclic:T.cyclic})}for(let c of v)c.cyclic&&(e.strokeStyle=s.cycle+"85",e.lineWidth=1,e.strokeRect(m(c.start),L(c.start),(c.end-c.start)*d,(c.end-c.start)*d));if(k&&(e.fillStyle=s.highlight,e.fillRect(196,L(k.row),n-196,d),e.fillRect(m(k.col??k.row),118,d,i-118)),e.strokeStyle=s.grid,e.lineWidth=1,d>=9){e.beginPath();for(let c=a;c<=x;c++)e.moveTo(196,L(c)+.5),e.lineTo(n,L(c)+.5);for(let c=A;c<=h;c++)e.moveTo(m(c)+.5,118),e.lineTo(m(c)+.5,i);e.stroke()}let S=t.visibleCells.reduce((c,R)=>Math.max(c,R.count),1),E=d>=8?2:.25;for(let c of t.visibleCells)c.row<a||c.row>=x||c.col<A||c.col>=h||(e.globalAlpha=u(y[c.row])&&u(y[c.col])?.12:.35+.65*Math.log1p(c.count)/Math.log1p(S),e.fillStyle=c.cyclic&&d<10?s.cycle:l(y[c.row].pkg),e.fillRect(m(c.col)+E,L(c.row)+E,Math.max(1,d-2*E),Math.max(1,d-2*E)),c.cyclic&&c.from!==c.to&&d>=10&&(e.fillStyle=s.cycle,e.fillRect(m(c.col)+d-5,L(c.row)+2,3,3)));e.globalAlpha=1,p&&(e.strokeStyle=s.text,e.lineWidth=2,p.col===null?e.strokeRect(197,L(p.row)+1,n-196-2,d-2):e.strokeRect(m(p.col)+1,L(p.row)+1,d-2,d-2)),e.restore(),e.fillStyle=s.surface,e.fillRect(0,0,n,118),e.fillRect(0,0,196,i),e.font="11px ui-monospace, monospace",e.textBaseline="middle";let U=Math.max(1,Math.ceil(14/d));for(let c=a;c<x;c++){if(c%U&&c!==k?.row)continue;e.save(),e.beginPath(),e.rect(5,111,186,i-118+7),e.clip();let R=L(c)+d/2;c===k?.row&&(e.fillStyle=s.highlight,e.fillRect(0,L(c),196,Math.max(d,14))),e.fillStyle=l(y[c].pkg),e.fillRect(8,R-3,5,6),e.fillStyle=c===k?.row||t.matches.size<t.totalRows&&t.matches.has(y[c].id)?s.text:s.muted,e.fillText(`${y[c].file?" ":""}${En(y[c])}`,20,R),e.restore()}let I=Math.max(1,Math.ceil(17/d));for(let c=A;c<h;c++)c%I&&c!==(k?.col??k?.row)||(e.save(),e.beginPath(),e.rect(189,22,n-196+7,96),e.clip(),e.translate(m(c)+d/2,108),e.rotate(-Math.PI/4),e.fillStyle=c===(k?.col??k?.row)?s.text:s.muted,e.fillText(En(y[c]),0,0,115),e.restore(),e.fillStyle=l(y[c].pkg),e.fillRect(m(c)+1,114,Math.max(1,d-2),3));e.fillStyle=s.muted,e.font="10px ui-monospace, monospace",e.fillText("IMPORTERS \u2193",14,104),e.fillText("DEPENDENCIES \u2192",204,12),e.strokeStyle=s.border,e.beginPath(),e.moveTo(196-.5,118),e.lineTo(196-.5,i),e.moveTo(196,118-.5),e.lineTo(n,118-.5),e.stroke(),y.length===0&&(e.fillStyle=s.muted,e.fillText("No matching dependencies",216,148))}var Qe=e=>e.toLocaleString("en-US");function Vt(e,t,o){return O`<button class="g2-dist-item matrix-row-link" @click="${()=>o(e.id)}"><span class="g2-dist-dot" style="${`background:${he(e.pkg)}`}"></span><span class="g2-dist-name" data-tooltip-truncated data-tooltip="${e.label}">${e.label}</span><span class="g2-dist-count">${Qe(t)}</span></button>`}function On(e,t,o,{select:n,expand:i,expanded:s,neighborhood:l,focus:g,clear:p}){let u=e.byId.get(o?.from),d=e.byId.get(o?.to);if(!u){let a=[...e.rows].toSorted((x,A)=>A.incoming-x.incoming).slice(0,15);return O`<div class="matrix-metrics"><span><b>${Qe(t.nodes.length)}</b>files</span><span><b>${Qe(t.packages.length)}</b>packages</span><span><b>${Qe(e.importCount)}</b>imports</span></div><p class="matrix-empty">Select a row to inspect a package.<br>Select a cell to see the files behind a dependency.</p><h4>Most imported</h4>${a.map(x=>Vt(x,x.incoming,n))} ${e.cycleCount?O`<h4>Cyclic groups <b>${e.cycleCount}</b></h4>${e.rows.filter(x=>x.cyclic).slice(0,12).map(x=>Vt(x,x.outgoing,n))}`:null}`}let r=d?e.cells.get(u.id)?.get(d.id):null,$=Map.groupBy(r?.examples??[],([,a])=>a),y=u.cyclic?[...e.byId.values()].filter(a=>a.component===u.component).length:0,m=[...e.cells.get(u.id)?.values()??[]].filter(a=>a.to!==u.id).toSorted((a,x)=>x.count-a.count),L=[...e.cells.values()].map(a=>a.get(u.id)).filter(a=>a&&a.from!==u.id).toSorted((a,x)=>x.count-a.count);return O`<div class="matrix-panel-head"><button class="matrix-selected-name" @click="${()=>n(u.id)}">${u.label}</button><button type="button" class="detail-action" @click="${p}" aria-label="Clear matrix selection">×</button></div>${d?O`<div class="matrix-direction">imports →</div><button class="matrix-selected-name" @click="${()=>n(d.id)}">${d.label}</button>`:null} ${(d?r?.cyclic:u.cyclic)?O`<span class="matrix-cycle-label">${d?"Import participates in a cycle":`Cyclic group \xB7 ${y} members`}</span>`:null}<div class="matrix-metrics"><span><b>${Qe(d?r?.count??0:u.files.length)}</b>${d?"file imports":"files"}</span><span><b>${We(u.size)}</b>source size</span></div><div class="matrix-actions">${u.file?O`<button @click="${()=>i(u.pkg)}">Collapse package</button><button data-bundle-view-source="${t.nodeByFile.get(u.file)?.origFile??u.file}">View source</button>`:O`<button @click="${()=>i(u.pkg)}">${s.has(u.pkg)?"Collapse files":"Expand files"}</button>`} <button aria-pressed="${String(l===u.id)}" @click="${()=>g(u.id)}">Neighborhood</button></div>${d?O`<h4>File imports</h4>${$.size>0?[...$].map(([a,x])=>O`<div class="matrix-import-group"><button class="matrix-import-target" data-bundle-view-source="${t.nodeByFile.get(a)?.origFile??a}" data-tooltip-truncated data-tooltip="${a}">${a}</button><ul class="matrix-import-sources" aria-label="Imported by">${x.map(([A])=>O`<li><button data-bundle-view-source="${t.nodeByFile.get(A)?.origFile??A}"><span aria-hidden="true">←</span><span data-tooltip-truncated data-tooltip="${A}">${A}</span></button></li>`)}</ul></div>`):O`<p class="matrix-empty">No direct imports in this direction.</p>`} ${r&&r.count>r.examples.length?O`<p class="matrix-empty">Showing ${r.examples.length} of ${Qe(r.count)} imports.</p>`:null} ${d.id!==u.id&&e.cells.get(d.id)?.has(u.id)?O`<h4>Reverse direction</h4><button class="g2-dist-item matrix-reverse-link" @click="${()=>n(d.id,u.id)}">← ${Qe(e.cells.get(d.id).get(u.id).count)} file imports</button>`:null}`:O`<h4>Imports <b>${m.length}</b></h4>${m.slice(0,60).map(a=>Vt(e.byId.get(a.to),a.count,x=>n(u.id,x)))} ${m.length>60?O`<p class="matrix-empty">Showing the 60 strongest of ${m.length} dependencies.</p>`:null}<h4>Imported by <b>${L.length}</b></h4>${L.slice(0,60).map(a=>Vt(e.byId.get(a.from),a.count,x=>n(x,u.id)))} ${L.length>60?O`<p class="matrix-empty">Showing the 60 strongest of ${L.length} importers.</p>`:null}`}`}var Fn=`:host{display:contents}*{box-sizing:border-box}button,select{font:inherit;color:var(--text);border:1px solid var(--border);background:var(--surface);border-radius:var(--ui-radius, 4px);padding:4px 7px;cursor:default}button:hover,button[aria-pressed=true]{background:var(--graph-hover-bg);border-color:var(--muted)}button:focus-visible,select:focus-visible,canvas:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.matrix-layout{display:contents;color:var(--text);font-size:12px}.matrix-stage{grid-area:stage;position:relative;overflow:hidden;min-width:0;min-height:0;background:var(--graph-canvas-bg)}.matrix-order{position:absolute;top:12px;left:14px;max-width:calc(var(--matrix-label-width) - 28px);height:30px;padding:3px 6px;border-radius:var(--ui-radius, 6px);font-size:11px}canvas{display:block;width:100%;height:100%;touch-action:none}.matrix-zoom{position:absolute;bottom:10px;right:10px;display:flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--border);border-radius:var(--ui-radius, 5px);background:var(--surface)}.matrix-zoom span{min-width:35px;text-align:center;font-size:11px;color:var(--muted)}.matrix-hover{position:absolute;bottom:10px;left:calc(var(--matrix-label-width) + 10px);max-width:max(0px,calc(100% - var(--matrix-label-width) - 160px));padding:5px 8px;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:var(--surface);pointer-events:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.matrix-panel{grid-area:right;min-height:0;overflow:auto;padding:12px;border-left:1px solid var(--border);background:var(--surface)}.matrix-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-right:var(--graph-fullscreen-inset, 0)}h4{margin:20px 0 7px;font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;display:flex;justify-content:space-between}.matrix-metrics{display:flex;gap:14px;margin:15px 0;color:var(--muted);font-size:10px}.matrix-metrics:first-child{margin-top:0;padding-right:var(--graph-fullscreen-inset, 0)}.matrix-metrics b{display:block;font-size:16px;font-weight:500;color:var(--text);font-variant-numeric:tabular-nums;margin-bottom:3px}.matrix-empty{color:var(--muted);font-size:11px;line-height:1.6;cursor:default;user-select:none;-webkit-user-select:none}.matrix-row-link{grid-template-columns:6px minmax(0,1fr) auto}.matrix-row-link .g2-dist-dot{width:6px;height:6px;border-radius:2px}.matrix-row-link .g2-dist-name{color:var(--text)}.matrix-row-link .g2-dist-count{color:var(--muted)}.matrix-reverse-link{grid-template-columns:1fr}.matrix-selected-name{display:block;background:transparent;border:0;text-align:left;padding:0;margin:14px 0 6px;font:12px/1.6 ui-monospace,monospace;overflow-wrap:anywhere}.matrix-panel-head .matrix-selected-name{min-width:0;margin:0}.matrix-panel-head button:last-child{flex-shrink:0}.matrix-direction{color:var(--muted);font-size:10px}.matrix-cycle-label{display:block;color:var(--matrix-cycle, #e879c7);font-size:10px;margin-top:10px}.matrix-actions{display:flex;gap:5px;margin:12px 0;font-size:11px}.matrix-actions button{white-space:nowrap}.matrix-import-group{padding:6px 0;border-bottom:1px solid var(--border)}.matrix-import-group button{display:flex;align-items:baseline;gap:6px;width:100%;min-height:20.5px;background:transparent;border:0;padding:2px 0;font:10px/1.6 ui-monospace,monospace;text-align:left;overflow-wrap:anywhere;color:var(--text)}.matrix-import-group .matrix-import-target{font-weight:600}.matrix-import-sources{margin:0 0 0 10px;padding:0;list-style:none}.matrix-import-sources button{color:var(--muted)}.matrix-import-sources span:last-child{min-width:0}
|
|
9
|
-
`;var
|
|
10
|
-
`;var wo=class extends ut{static properties={graph:{attribute:!1}};static styles=[Ue(Mt),Ue(Fn),Ue(Nn)];constructor(){super(),this.expanded=new Set,this.order="structure",this.cyclesOnly=!1,this.neighborhood=null,this.selection=null,this.hover=null,this.view={cell:18,x:0,y:0},this.width=0,this.height=0,this.dirty=!0,this.needsFit=!0,this.bridge={requestDraw:()=>this.requestUpdate(),_cleanup:()=>{}}}willUpdate(t){this.graph&&(t.has("graph")||this.query!==w.pathFilter||this.dirty)&&(this.query=w.pathFilter,this.model=xo(this.graph,{expanded:this.expanded,order:this.order,query:this.query,neighborhood:this.neighborhood,cyclesOnly:this.cyclesOnly}),this.neighborhood&&!this.model.byId.has(this.neighborhood)&&(this.neighborhood=null,this.model=xo(this.graph,{expanded:this.expanded,order:this.order,query:this.query,cyclesOnly:this.cyclesOnly})),this.selection&&!this.model.byId.has(this.selection.from)&&(this.selection=null),this.hover=null,this.dirty=!1,this.needsFit=!0)}firstUpdated(){let t=this.renderRoot.querySelector("canvas");this.canvas=t,this.resizeObserver=new ResizeObserver(()=>{let o=t.parentElement.getBoundingClientRect();this.width=o.width,this.height=o.height;let n=window.devicePixelRatio||1;t.width=Math.round(this.width*n),t.height=Math.round(this.height*n),this.clamp(),this.paint()}),this.resizeObserver.observe(t.parentElement),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.events=new AbortController,t.addEventListener("wheel",o=>{o.preventDefault(),o.ctrlKey||o.metaKey?this.zoom(Math.exp(-o.deltaY*.005),o.offsetX,o.offsetY):(this.view.x+=o.shiftKey?o.deltaY:o.deltaX,this.view.y+=o.shiftKey?0:o.deltaY,this.clamp(),this.hover=null,this.paint())},{passive:!1,signal:this.events.signal})}updated(){w.graphState=this.bridge;let t=JSON.stringify([this.cyclesOnly,this.model.cycleCount,this.expanded.size,!!this.neighborhood]);t!==this.controlsKey&&(this.controlsKey=t,this.dispatchEvent(new CustomEvent("matrix-controls-change",{detail:this.renderControls(),bubbles:!0,composed:!0}))),cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.paint())}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.themeObserver?.disconnect(),this.events?.abort(),cancelAnimationFrame(this.frame),w.graphState===this.bridge&&(w.graphState=null)}clamp(){this.view.cell=yo(this.view.cell,this.model.rows.length,this.width,this.height);let t=this.model.rows.length*this.view.cell;this.view.x=Math.max(0,Math.min(this.view.x,Math.max(0,t-this.width+196+12))),this.view.y=Math.max(0,Math.min(this.view.y,Math.max(0,t-this.height+118+12)))}fit(){this.view={cell:vo(this.model.rows.length,this.width,this.height),x:0,y:0},this.needsFit=!1,this.requestUpdate()}zoom(t,o=(this.width+196)/2,n=(this.height+118)/2){let i=this.view.cell,s=yo(i*t,this.model.rows.length,this.width,this.height);this.view.x=(this.view.x+o-196)*s/i-o+196,this.view.y=(this.view.y+n-118)*s/i-n+118,this.view.cell=s,this.clamp(),this.hover=null,this.requestUpdate()}select(t,o=null,n=!0){this.selection={from:t,to:o},n&&this.model.index.has(t)&&(this.view.cell=Math.max(16,this.view.cell),this.view.y=this.model.index.get(t)*this.view.cell-(this.height-118)/2,this.view.x=(this.model.index.get(o??t)??0)*this.view.cell-(this.width-196)/2,this.clamp()),this.requestUpdate()}expand(t){this.expanded.has(t)?this.expanded.delete(t):this.expanded.add(t),this.revealPkg=t,this.selection=null,this.neighborhood=null,this.dirty=!0,this.requestUpdate()}pointer(t){let o=this.canvas.getBoundingClientRect();return Pn(t.clientX-o.left,t.clientY-o.top,this.model,this.view)}move(t){if(this.drag){let n=t.clientX-this.drag.x,i=t.clientY-this.drag.y;if(Math.abs(n)+Math.abs(i)>3&&(this.drag.moved=!0),this.drag.moved){this.view.x=this.drag.ox-n,this.view.y=this.drag.oy-i,this.clamp(),this.hover=null,this.paint();return}}let o=this.pointer(t);(o?.row!==this.hover?.row||o?.col!==this.hover?.col)&&(this.hover=o,this.requestUpdate())}key(t){if(t.key==="Escape"){this.selection=null,this.hover=null,this.requestUpdate();return}if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"].includes(t.key)||this.model.rows.length===0)return;t.preventDefault();let o=this.model.index.get(this.selection?.from)??0,n=this.model.index.get(this.selection?.to)??o;if(t.key==="Enter"){this.expand(this.model.rows[o].pkg);return}t.key==="ArrowDown"&&o++,t.key==="ArrowUp"&&o--,t.key==="ArrowRight"&&n++,t.key==="ArrowLeft"&&n--;let i=s=>Math.max(0,Math.min(this.model.rows.length-1,s));this.select(this.model.rows[i(o)].id,this.model.rows[i(n)].id)}paint(){if(!this.canvas||!this.model||this.width<=196||this.height<=118)return;if(this.needsFit&&this.fit(),this.revealPkg){let d=this.model.rows.find(r=>r.pkg===this.revealPkg);this.revealPkg=null,d&&this.select(d.id)}let t=this.canvas.getContext("2d"),o=window.devicePixelRatio||1;t.setTransform(o,0,0,o,0,0);let n=getComputedStyle(this),i=d=>n.getPropertyValue(d).trim(),s=document.body.classList.contains("theme-paper"),l=s||document.body.classList.contains("theme-light")||document.body.classList.contains("theme-pink"),g={bg:i("--graph-canvas-bg")||"#0c0c0c",surface:i("--surface"),text:i("--text"),muted:i("--muted"),border:i("--border"),grid:l?"#0000000b":"#ffffff0b",highlight:s?"#fff":l?"#0969da18":"#ffffff12",cycle:s?"#000":l?"#a21caf":"#e879c7"};this.style.setProperty("--matrix-cycle",g.cycle);let p=this.model.index.get(this.selection?.to),u=this.model.index.get(this.selection?.from);zn(t,this.model,this.view,{width:this.width,height:this.height,theme:g,colorOf:he,hover:this.hover,selected:u===void 0?null:{row:u,col:p??null},dimmed:d=>!d.files.some(r=>{let $=this.graph.nodeByFile.get(r);return(w.selectedSeverities.size===0||[...w.selectedSeverities].some(y=>$.severitySet?.has(y)))&&(w.selectedColors.size===0||[...w.selectedColors].some(y=>$.colorSet?.has(y)))})})}renderControls(){return O`<div class="g2-matrix-controls"><mode-switch label="${`${this.model.cycleCount} ${this.model.cycleCount===1?"cycle":"cycles"}`}" .checked="${this.cyclesOnly}" @click="${()=>{this.cyclesOnly=!this.cyclesOnly,this.dirty=!0,this.requestUpdate()}}"></mode-switch>${this.expanded.size>0?O`<button @click="${()=>{this.expanded.clear(),this.selection=null,this.dirty=!0,this.requestUpdate()}}">Collapse all</button>`:null} ${this.neighborhood?O`<button @click="${()=>{this.neighborhood=null,this.dirty=!0,this.requestUpdate()}}">All dependencies</button>`:null}</div>`}render(){if(!this.model)return null;let t=this.model.rows[this.hover?.col],o=this.model.rows[this.hover?.row],n=t&&o?this.model.cells.get(o.id)?.get(t.id)?.count??0:0;return O`<div class="matrix-layout"><div class="matrix-stage" style="${`--matrix-label-width: ${196}px`}"><select class="matrix-order" aria-label="Matrix order" @change="${i=>{this.order=i.target.value,this.dirty=!0,this.requestUpdate()}}"><option value="structure" ?selected="${this.order==="structure"}">Structure ↓</option><option value="name" ?selected="${this.order==="name"}">Name ↓</option><option value="importers" ?selected="${this.order==="importers"}">Most imported ↓</option><option value="imports" ?selected="${this.order==="imports"}">Most imports ↓</option></select><canvas tabindex="0" role="img" aria-label="Dependency matrix. Rows import columns. Arrow keys select cells; Enter expands a package." @keydown="${i=>this.key(i)}" @pointermove="${i=>this.move(i)}" @pointerleave="${()=>{this.drag||(this.hover=null,this.requestUpdate())}}" @pointerdown="${i=>{i.button===0&&(this.canvas.setPointerCapture(i.pointerId),this.drag={x:i.clientX,y:i.clientY,ox:this.view.x,oy:this.view.y,moved:!1})}}" @pointercancel="${()=>{this.drag=null}}" @pointerup="${i=>{if(this.drag){if(!this.drag.moved){let s=this.pointer(i);s&&this.select(this.model.rows[s.row].id,s.col===null?null:this.model.rows[s.col].id,!1)}this.drag=null}}}" @dblclick="${i=>{let s=this.pointer(i);s&&this.expand(this.model.rows[s.row].pkg)}}"></canvas>${o&&(!t||n>0)?O`<div class="matrix-hover">${o.label}${t?` \u2192 ${t.label} \xB7 ${n} imports`:` \xB7 ${o.files.length} files`}</div>`:null}<div class="matrix-zoom"><button aria-label="Zoom out" @click="${()=>this.zoom(1/1.5)}">−</button><span>${Math.round(this.view.cell/18*100)}%</span><button aria-label="Zoom in" @click="${()=>this.zoom(1.5)}">+</button><button @click="${()=>this.fit()}">Fit</button></div></div><aside class="matrix-panel" aria-label="Matrix details" aria-live="polite">${On(this.model,this.graph,this.selection,{select:(i,s)=>this.select(i,s),expand:i=>this.expand(i),expanded:this.expanded,neighborhood:this.neighborhood,focus:i=>{this.neighborhood=this.neighborhood===i?null:i,this.dirty=!0,this.requestUpdate()},clear:()=>{this.selection=null,this.requestUpdate()}})}</aside></div>`}};customElements.define("dependency-matrix",wo);var Bn=`:host{display:inline-flex;flex-shrink:0;vertical-align:middle;--switch-track-width: 26px;--switch-track-height: 14px}button,.checkbox-mode{align-items:center;gap:8px;box-sizing:border-box;height:30px;margin:0;padding:0 .6rem;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:transparent;color:var(--muted);font:inherit;font-size:.78rem;font-weight:500;line-height:1;white-space:nowrap;cursor:default}button{display:var(--switch-button-display, inline-flex);&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .04)}&[aria-pressed=true]{color:var(--text)}&:disabled{opacity:.4}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.checkbox-mode{display:var(--switch-checkbox-display, none);border:0;color:var(--text);&:has(:disabled){opacity:.4}& input{width:.85rem;height:.85rem;margin:0;accent-color:var(--accent)}}.track{position:relative;flex-shrink:0;width:var(--switch-track-width);height:var(--switch-track-height);background:var(--border);border-radius:var(--ui-radius, 8px);transition:background .15s;&:after{content:"";position:absolute;top:2px;left:2px;width:calc(var(--switch-track-height) - 4px);height:calc(var(--switch-track-height) - 4px);border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}}button[aria-pressed=true] .track{background:color-mix(in oklch,var(--accent) 22%,transparent);&:after{transform:translate(calc(var(--switch-track-width) - var(--switch-track-height)));background:var(--accent)}}:host([borderless]) :is(button,.checkbox-mode){height:100%;border:0;border-radius:0}:host([compact]){--switch-track-width: 22px;--switch-track-height: 12px}:host([compact]) :is(button,.checkbox-mode){height:auto;gap:7px;padding:2px 8px;border-radius:var(--ui-radius, 6px);font-size:.68rem;line-height:1.2}
|
|
11
|
-
`;var ko=class extends ut{static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},label:{type:String},accessibleLabel:{type:String,attribute:"accessible-label"}};static styles=Ue(Bn);constructor(){super(),this.checked=!1,this.disabled=!1,this.label="",this.accessibleLabel=""}_checkboxClick(t){(this.disabled||t.target.tagName!=="INPUT")&&t.stopPropagation()}render(){return O`<button type="button" part="button" aria-pressed="${String(this.checked)}" aria-label="${this.accessibleLabel||this.label}" ?disabled="${this.disabled}"><span>${this.label}</span><span class="track" part="track" aria-hidden="true"></span></button> <label class="checkbox-mode" @click="${this._checkboxClick}"><input type="checkbox" part="checkbox" .checked="${this.checked}" ?disabled="${this.disabled}" aria-label="${this.accessibleLabel||this.label}"> <span>${this.label}</span></label>`}};customElements.get("mode-switch")||customElements.define("mode-switch",ko);var $o=class extends ut{static properties={graph:{attribute:!1},options:{attribute:!1},matrixControls:{state:!0}};static styles=[Ue(Uo),Ue(Do),Ue(Ho),Ue(Mt)];constructor(){super(),this.graph=null,this.options={},this.matrixControls=null}connectedCallback(){super.connectedCallback(),Cn(this.renderRoot)}willUpdate(){(!this.options.showBundleLayouts||w.bundleLayout!=="matrix")&&(this.matrixControls=null)}updated(){this.toggleAttribute("matrix",!!this.options.showBundleLayouts&&w.bundleLayout==="matrix")}render(){return this.graph?this.options.showBundleLayouts&&w.bundleLayout==="matrix"?O`<div class="graph2-layout g2-matrix-layout">${go(this.graph,this.options,this.matrixControls)}<dependency-matrix .graph="${this.graph}" @matrix-controls-change="${t=>{this.matrixControls=t.detail}}"></dependency-matrix></div>`:O`<div class="graph2-layout">${go(this.graph,this.options)} ${vn(this.graph)} ${wn()}</div>`:O``}};customElements.define("graph-layout",$o);function lr(e){let t=new Map;for(let[o,n]of e.importsOf){let i=e.nodeByFile.get(o);if(i)for(let s of n){let l=e.nodeByFile.get(s);l&&i.pkg!==l.pkg&&(t.set(i.pkg,(t.get(i.pkg)??0)+1),t.set(l.pkg,(t.get(l.pkg)??0)+1))}}return t}function cr(e){if(e.packages.length===0)return null;let t=new Set;for(let[o,n]of e.importedBy){let i=e.nodeByFile.get(o);if(i)for(let s of n){let l=e.nodeByFile.get(s);if(l&&l.pkg!==i.pkg){t.add(i.pkg);break}}}for(let o of e.packages)if(!t.has(o))return o;return null}var dr=5;function Hn(e,t){let o=new Map;for(let s of e.nodes)t.has(s.pkg)&&(o.has(s.pkg)||o.set(s.pkg,[]),o.get(s.pkg).push(s));for(let s of o.values())s.sort((l,g)=>l.isHub!==g.isHub?l.isHub?-1:1:g.deg-l.deg);let n=new Map,i=new Map;for(let[s,l]of t){let g=o.get(s);if(!g||g.length===0)continue;let p=g.length,u=0;for(let x of g)if(x.isHub)u++;else break;let d=u>0&&u<=dr,r=d?u:0,$=p-r,y=l.groupR,m=Array.from({length:p}),L=Array.from({length:p});for(let x=0;x<p;x++){let A=x*137.508*Math.PI/180,h;if(x<r)h=r<=1?0:Math.sqrt(x/(r-1))*.3*y;else{let k=x-r;h=$<=1?.4*y:(.4+Math.sqrt(k/($-1))*.6)*y}m[x]=l.x+Math.cos(A)*h,L[x]=l.y+Math.sin(A)*h}let a=Array.from({length:p},()=>!1);for(let x=0;x<p;x++){let A=g[x],h,k;d&&A.isHub?(k=0,h=r):d?(k=r,h=p):(k=0,h=p);let v=0,S=0,E=0,U=e.importsOf.get(A.file);if(U)for(let T of U){let F=n.get(T);F!==void 0&&(v+=F,S+=i.get(T),E++)}let I=e.importedBy.get(A.file);if(I)for(let T of I){let F=n.get(T);F!==void 0&&(v+=F,S+=i.get(T),E++)}let c=!1;if(E>0){v/=E,S/=E;let T=v-l.x,F=S-l.y;T*T+F*F>1&&(c=!0)}let R=-1;if(c){let T=1/0;for(let F=k;F<h;F++){if(a[F])continue;let f=m[F]-v,M=L[F]-S,C=f*f+M*M;C<T&&(T=C,R=F)}}else for(let T=k;T<h;T++)if(!a[T]){R=T;break}a[R]=!0,A.x=m[R],A.y=L[R],n.set(A.file,A.x),i.set(A.file,A.y)}}}function Dn(e,t,o){let n=t/2,i=o/2,s=Math.min(t,o)/2;if(e.packages.length===0)return;let g=cr(e),p=lr(e),u=(g?e.packages.filter(f=>f!==g):[...e.packages]).toSorted((f,M)=>{let C=(p.get(M)??0)-(p.get(f)??0);return C!==0?C:(e.pkgCount.get(M)??0)-(e.pkgCount.get(f)??0)}),d=u.length,r;d<=0?r=0:d<=6?r=.65:d<=20?r=.82:r=.95;let $=Math.max(1,Math.sqrt(50/Math.max(1,d))),y=.22,m=.12,L=.04,a=new Map,x;if(g){let f=e.pkgCount.get(g)??0,M=Math.min(y,(.012+Math.sqrt(f)*.004)*$);x=Math.max(d<=6?.4:d<=20?.36:.34,M+m+L),a.set(g,{x:n,y:i,size:f,groupR:M*s})}else d<=1?x=0:d<=6?x=.4:d<=20?x=.32:x=.3;if(d===0){Hn(e,a);return}let A=new Map;for(let f of e.edges){if(!f.cross)continue;let M=e.nodeByFile.get(f.a)?.pkg,C=e.nodeByFile.get(f.b)?.pkg;if(!M||!C||M===C)continue;A.has(M)||A.set(M,new Map),A.has(C)||A.set(C,new Map);let Y=A.get(M),W=A.get(C);Y.set(C,(Y.get(C)??0)+1),W.set(M,(W.get(M)??0)+1)}let h=Math.max(1,Math.min(10,Math.round(Math.sqrt(d)/1.2))),k=Array.from({length:h+1});for(let f=0;f<=h;f++)k[f]=Math.floor(f*f/(h*h)*d);k[h]=d;let v=.2,S=Array.from({length:h}),E=Array.from({length:h});for(let f=0;f<h;f++){let M=k[f],C=k[f+1];S[f]=C-M;let Y=0;for(let W=M;W<C;W++)Y+=e.pkgCount.get(u[W])??0;E[f]=Y}let U=Array.from({length:h});for(let f=0;f<h;f++){let M=(k[f]+k[f+1]-1)/2/Math.max(1,d-1);U[f]=Math.sqrt(Math.max(0,M))}let I=Array.from({length:h});I[0]=U[0];for(let f=1;f<h;f++){let M=S[f-1],C=E[f-1],Y=M>0?C/M:1,W=1+v*Math.sqrt(Math.max(0,Y-1));I[f]=I[f-1]+(U[f]-U[f-1])*W}let c=Array.from({length:h});for(let f=0;f<h;f++)c[f]=I[f]-U[f];let R=Array.from({length:d}),T=Array.from({length:d}),F=0;for(let f=0;f<d;f++){for(;F<h-1&&f>=k[F+1];)F++;let M=f*137.508%360*Math.PI/180,Y=(d<=1?0:Math.sqrt(f/(d-1)))+c[F],W=d===1?g?x:0:x+Y*(r-x);R[f]=n+Math.cos(M)*W*s,T[f]=i+Math.sin(M)*W*s}for(let f=0;f<h;f++){let M=k[f],C=k[f+1],Y=C-M;if(Y===0)continue;let W=Array.from({length:Y},()=>!1);for(let xe=M;xe<C;xe++){let Me=u[xe],N=A.get(Me),Q=0,te=0,K=0;if(N)for(let[de,ce]of N){let ye=a.get(de);ye&&(Q+=ye.x*ce,te+=ye.y*ce,K+=ce)}let q=!1;if(K>0){Q/=K,te/=K;let de=Q-n,ce=te-i;de*de+ce*ce>1&&(q=!0)}let J=-1;if(q){let de=1/0;for(let ce=0;ce<Y;ce++){if(W[ce])continue;let ye=M+ce,Se=R[ye]-Q,De=T[ye]-te,Le=Se*Se+De*De;Le<de&&(de=Le,J=ce)}}else for(let de=0;de<Y;de++)if(!W[de]){J=de;break}W[J]=!0;let ve=M+J,ge=e.pkgCount.get(Me)??0,Te=Math.min(m,(.012+Math.sqrt(ge)*.004)*$);a.set(Me,{x:R[ve],y:T[ve],size:ge,groupR:Te*s})}}Hn(e,a)}function Mo(e,t,o){let n=t/2,i=o/2,s=Math.min(t,o)/2,l=e.nodes.length;if(l===0)return;let g=[...e.nodes].toSorted((p,u)=>u.deg-p.deg);for(let p=0;p<l;p++){let u=g[p],d=p*137.508%360*Math.PI/180,r=l<=1?0:Math.sqrt(p/(l-1));u.x=n+Math.cos(d)*r*.85*s,u.y=i+Math.sin(d)*r*.85*s}}function So(e,t,o,n,{groupOf:i=Pt}={}){let s=e.length,l=n||760,g=o||1100,p=Math.sqrt(g*l/Math.max(s,1))*1.1,u=v=>{let S=0;for(let E of v)S=S*31+E.codePointAt(0)|0;return S},d=Math.ceil(Math.sqrt(s*g/l)),r=Math.ceil(s/d),$=l/(r+1),y=g/(d+1),m=e.map((v,S)=>{let E=S%d,U=Math.floor(S/d),I=u(v);return{file:v,x:(E+1)*y+(I%100-50)*y*.4,y:(U+1)*$+((I>>7)%100-50)*$*.4,dx:0,dy:0}}),L=new Map(m.map((v,S)=>[v.file,S])),a=[];for(let v of e)for(let S of t.get(v)??[])L.has(S)&&a.push([L.get(v),L.get(S)]);let x=new Map;for(let v=0;v<s;v++){let S=i(m[v].file)??"__own__";x.has(S)||x.set(S,[]),x.get(S).push(v)}let A=Math.min(500,Math.max(180,100+s*3)),h=Math.min(g,l)/6,k=.3;for(let v=0;v<A;v++){let S=h*Math.pow(k/h,v/A);for(let I of m)I.dx=0,I.dy=0;for(let I=0;I<s;I++)for(let c=I+1;c<s;c++){let R=m[I],T=m[c],F=R.x-T.x,f=R.y-T.y,M=Math.sqrt(F*F+f*f);if(M<.01){let Y=u(R.file+T.file);F=(Y%100-50)*.01||.5,f=((Y>>7)%100-50)*.01||.5,M=Math.sqrt(F*F+f*f)}let C=p*p/M;R.dx+=F/M*C,R.dy+=f/M*C,T.dx-=F/M*C,T.dy-=f/M*C}for(let[I,c]of a){let R=m[I],T=m[c],F=R.x-T.x,f=R.y-T.y,M=Math.sqrt(F*F+f*f)||.01,C=M*M/p;R.dx-=F/M*C,R.dy-=f/M*C,T.dx+=F/M*C,T.dy+=f/M*C}let E=.055*Math.min(1,S/(h*.3));for(let[,I]of x){if(I.length<2)continue;let c=0,R=0;for(let T of I)c+=m[T].x,R+=m[T].y;c/=I.length,R/=I.length;for(let T of I)m[T].dx+=(c-m[T].x)*E,m[T].dy+=(R-m[T].y)*E}let U=50;for(let I of m){let c=Math.sqrt(I.dx*I.dx+I.dy*I.dy)||.01;I.x+=I.dx/c*Math.min(c,S),I.y+=I.dy/c*Math.min(c,S),I.x=Math.max(U,Math.min(g-U,I.x)),I.y=Math.max(U,Math.min(l-U,I.y))}}return m}function _o(e,t,o,{statsHeight:n=0,left:i=0,right:s=i,top:l=0,bottom:g=l}={}){let p=Math.max(20,t*.04),u=Math.max(20,o*.04),d=Math.max(1,t-p*2-i-s),r=Math.max(1,o-u*2-n-l-g),$=-1/0,y=-1/0,m=1/0,L=1/0;for(let x of e)m=Math.min(m,x.x),$=Math.max($,x.x),L=Math.min(L,x.y),y=Math.max(y,x.y);if(e.length===0)return{k:1,tx:t/2,ty:(o-n)/2};let a=Math.min(4,d/Math.max(20,$-m),r/Math.max(20,y-L));return{k:a,tx:p+i+d/2-(m+$)/2*a,ty:u+l+r/2-(L+y)/2*a}}function Gt(e,t,o=!1){let n=o?t:1;return{min:t,max:n*9.99,percent:Math.round(e/n*100)}}function Un(e,t,o,{width:n=900,rowHeight:i=52,gap:s=42}={}){let l=new Map(e.map(h=>[h.id,h])),g=new Map,p=[];for(let h of o)l.has(h)&&!g.has(h)&&(g.set(h,0),p.push(h));for(let h=0;h<p.length;h++){let k=p[h];for(let v of t.get(k)??[])!l.has(v)||g.has(v)||(g.set(v,g.get(k)+1),p.push(v))}let u=new Map;for(let h of e){let k=g.get(h.id)??null;u.has(k)||u.set(k,[]),u.get(k).push(h)}let d=new Map(e.map(h=>[h.id,[]]));for(let[h,k]of t)if(l.has(h))for(let v of new Set(k))d.get(v)?.push(h);let r=[],$=new Map,y=[...u.keys()].toSorted((h,k)=>(h??1/0)-(k??1/0)),m=h=>Number.isFinite(h.size)&&h.size>0?h.size:0;for(let h of y){let k=u.get(h).slice(),v=new Map(k.map(c=>{let R=d.get(c.id).map(T=>$.get(T)).filter(T=>T&&h!==null&&T.level===h-1);return[c.id,R.length>0?R.reduce((T,F)=>T+F.x+F.width/2,0)/R.length:n/2]}));k.sort((c,R)=>v.get(c.id)-v.get(R.id)||String(c.id).localeCompare(String(R.id)));let S=0;for(let c=1;c<k.length;c++)m(k[c])>m(k[S])&&(S=c);S>0&&k.unshift(k.splice(S,1)[0]);let E=k.reduce((c,R)=>c+m(R),0),U=r.length*(i+s),I=0;for(let c of k){let R=n*(E>0?m(c)/E:1/k.length);$.set(c.id,{id:c.id,level:h,x:I,y:U,width:R,height:i}),I+=R}r.push({level:h,y:U,size:E,proportional:E>0,ids:k.map(c=>c.id)})}let L=[];for(let[h,k]of t)if($.has(h))for(let v of new Set(k))h!==v&&$.has(v)&&L.push({from:h,to:v});L.sort((h,k)=>String(h.from).localeCompare(String(k.from))||String(h.to).localeCompare(String(k.to)));let a=new Map,x=new Map;for(let h of L)x.has(h.from)||x.set(h.from,[]),a.has(h.to)||a.set(h.to,[]),x.get(h.from).push(h),a.get(h.to).push(h);for(let h of x.values())h.sort((k,v)=>$.get(k.to).x-$.get(v.to).x);for(let h of a.values())h.sort((k,v)=>$.get(k.from).x-$.get(v.from).x);for(let h of x.values())h.forEach((k,v)=>{k.sourcePort=(v+1)/(h.length+1)});for(let h of a.values())h.forEach((k,v)=>{k.targetPort=(v+1)/(h.length+1)});let A=r.reduce((h,k)=>h+k.size,0);for(let h of r)h.share=A>0?h.size/A:null;return{levels:r,rects:$,edges:L,depth:g,totalSize:A,width:n,height:r.length>0?r.length*(i+s)-s:0,gap:s}}function ur(e){let t=[1,3,5].map(n=>{let i=parseInt(e.slice(n,n+2),16)/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return t[0]*.2126+t[1]*.7152+t[2]*.0722>.18?"#000":"#fff"}function Vn(e,t,{theme:o,scale:n,colorOf:i,labelOf:s,sizeLabel:l,dimmed:g,selected:p,hovered:u}){let d=u??p,r=new Set([d]);for(let m of t.edges)m.from===d&&r.add(m.to),m.to===d&&r.add(m.from);let $=m=>m===d||m===p?1:g(m)?.13:d&&!r.has(m)?.22:1;e.save(),e.lineJoin="round";for(let m of t.edges){let L=t.rects.get(m.from),a=t.rects.get(m.to),x=m.from===d||m.to===d;e.globalAlpha=Math.min($(m.from),$(m.to))*(x?.9:.5),e.strokeStyle=i(m.from),e.fillStyle=i(m.from),e.lineWidth=(x?1.6:1)/n;let A=L.x+L.width*m.sourcePort,h=L.y+L.height,k=a.x+a.width*m.targetPort,v=a.y,S=0,E=1;if(e.beginPath(),e.moveTo(A,h),a.y>L.y){let I=(h+v)/2;e.bezierCurveTo(A,I,k,I,k,v)}else if(a.y===L.y){v=a.y+a.height;let I=h+t.gap*.65;e.bezierCurveTo(A,I,k,I,k,v),E=-1}else{k=a.x+a.width,v=a.y+a.height*m.targetPort;let I=t.width+16+m.sourcePort*20;e.bezierCurveTo(A,h+t.gap/2,I,h+t.gap/2,I,h),e.lineTo(I,v+8),e.quadraticCurveTo(I,v,k,v),S=-1,E=0}e.stroke();let U=3/n;e.beginPath(),e.moveTo(k,v),e.lineTo(k-S*U-E*U,v-E*U+S*U),e.lineTo(k-S*U+E*U,v-E*U-S*U),e.closePath(),e.fill()}e.globalAlpha=1,e.textBaseline="middle",e.textAlign="right",e.fillStyle=o.labelDefault,e.font="11px system-ui, sans-serif";let y=o.edgeIntra(.16);for(let m of t.levels){let a=m.y+26,x=18;e.strokeStyle=y,e.lineWidth=3,e.beginPath(),e.arc(-112,a,x,0,Math.PI*2),e.stroke(),m.share!==null&&m.share>0&&(e.strokeStyle=o.labelDefault,e.beginPath(),e.arc(-112,a,x,-Math.PI/2,-Math.PI/2+m.share*Math.PI*2),e.stroke()),e.textAlign="center",e.font="9px system-ui, sans-serif";let A=m.share===null?"\u2014":m.share>0&&m.share<.001?"<0.1%":`${Number((m.share*100).toFixed(1))}%`;e.fillText(A,-112,a),e.textAlign="right",e.font="11px system-ui, sans-serif",e.fillText(m.level===null?"Unreached":m.level===0?"App":`Level ${m.level}`,-12,m.y+19),e.font="10px system-ui, sans-serif",e.fillText(m.proportional?l(m.size):"No size data",-12,m.y+35),e.font="11px system-ui, sans-serif"}e.textAlign="left";for(let m of t.rects.values()){let{id:L,x:a,y:x,width:A,height:h}=m;if(A<=0)continue;let k=i(L),v=ur(k);if(e.globalAlpha=$(L),e.fillStyle=k,e.fillRect(a,x,A,h),e.strokeStyle=o.bg,e.lineWidth=1/n,e.strokeRect(a,x,A,h),L===p||L===u){e.strokeStyle=o.selectRing,e.lineWidth=1.5/n;let S=Math.min(A/2,.75/n);e.strokeRect(a+S,x+S,Math.max(0,A-S*2),h-S*2)}A*n<28||(e.save(),e.beginPath(),e.rect(a+7,x+4,Math.max(0,A-14),h-8),e.clip(),e.fillStyle=v,e.font="500 12px system-ui, sans-serif",e.fillText(s(L),a+9,x+21),e.fillStyle=v,e.font="10px system-ui, sans-serif",e.fillText(l(L),a+9,x+38),e.restore())}e.restore()}function Gn(e,t,o=[],{width:n=1200,height:i=800}={}){e=[...new Set(e)].toSorted();let s=new Set(e),l=new Map(e.map(N=>[N,[...new Set(t.get(N)??[])].filter(Q=>Q!==N&&s.has(Q)).toSorted()])),g=new Map(e.map(N=>[N,[]]));for(let[N,Q]of l)for(let te of Q)g.get(te).push(N);let{groups:p,componentOf:u}=bo(e,l),d=p.filter(N=>N.length>1),r=new Set(d.flat()),$=p.map(()=>new Set),y=p.map(()=>0);for(let[N,Q]of l)for(let te of Q){let K=u.get(N),q=u.get(te);K!==q&&!$[K].has(q)&&($[K].add(q),y[q]++)}let m=new Set(o.map(N=>u.get(N)).filter(N=>N!==void 0)),L=p.map(()=>0),a=[],x=new Set,A=N=>{x.has(N)||(x.add(N),a.push(N))};m.forEach(A),y.forEach((N,Q)=>{N||A(Q)});for(let N=0;N<a.length;N++){let Q=a[N];for(let te of $[Q])m.has(te)||(L[te]=Math.max(L[te],L[Q]+1)),--y[te]===0&&A(te)}let h=new Map(e.map(N=>[N,L[u.get(N)]])),k=new Map;for(let N of e){let Q=h.get(N);k.has(Q)||k.set(Q,[]),k.get(Q).push(N)}let v=[...k.keys()].toSorted((N,Q)=>N-Q),S=new Map,E=N=>N.forEach((Q,te)=>S.set(Q,(te+.5)/N.length));for(let N of k.values())E(N);for(let N=0;N<12;N++)for(let Q of N%2?v.toReversed():v){let te=k.get(Q),K=new Map(te.map(q=>{let J=(N%2?l:g).get(q);return[q,J.length>0?J.reduce((ve,ge)=>ve+S.get(ge),0)/J.length:S.get(q)]}));te.sort((q,J)=>K.get(q)-K.get(J)||S.get(q)-S.get(J)||q.localeCompare(J)),E(te)}let U=Math.max(.6,Math.min(2.4,n/Math.max(1,i))),I=Math.max(160,Math.sqrt(e.length*1100*U)),c=Math.max(120,I/U),R=v.at(-1)??0,T=new Map;for(let[N,Q]of k)Q.forEach((te,K)=>{let q=S.get(te)*I,J=(N+.5)/(R+1)*c;T.set(te,{id:te,x:q,y:J+(K%5-2)*9,anchorY:J,vx:0,vy:0,level:N,cycle:r.has(te),degree:l.get(te).length+g.get(te).length})});let F=[];for(let[N,Q]of l)for(let te of Q)F.push({from:N,to:te,cycle:r.has(N)&&u.get(N)===u.get(te)});let f=F.map(N=>{let Q=T.get(N.from),te=T.get(N.to),K=26+Math.sqrt(Math.max(Q.degree,te.degree))*5;return{a:Q,b:te,length:K,strength:.065/Math.sqrt(Math.min(Q.degree,te.degree)||1),cycle:N.cycle}}),M=[...T.values()],C=80;for(let N=0;N<240;N++){let Q=new Map,te=7*(1-N/240)+.15;for(let K=0;K<M.length;K++){let q=M[K];q.fx=(I/2-q.x)*.002,q.fy=(q.anchorY-q.y)*.018,q.gx=Math.floor(q.x/C),q.gy=Math.floor(q.y/C);let J=`${q.gx},${q.gy}`;Q.has(J)||Q.set(J,[]),Q.get(J).push(K)}for(let K=0;K<M.length;K++){let q=M[K];for(let J=q.gx-1;J<=q.gx+1;J++)for(let ve=q.gy-1;ve<=q.gy+1;ve++)for(let ge of Q.get(`${J},${ve}`)??[]){if(ge<=K)continue;let Te=M[ge],de=q.x-Te.x,ce=q.y-Te.y,ye=de*de+ce*ce;if(ye>C*C)continue;ye<.01&&(de=K%2?.1:-.1,ce=.1);let Se=Math.hypot(de,ce),De=Math.min(18,100/Se-100/C+Math.max(0,22-Se)*.6),Le=de/Se*De,dt=ce/Se*De;q.fx+=Le,q.fy+=dt,Te.fx-=Le,Te.fy-=dt}}for(let{a:K,b:q,length:J,strength:ve,cycle:ge}of f){let Te=q.x-K.x,de=q.y-K.y,ce=Math.hypot(Te,de)||1,ye=(ce-J)*ve,Se=Te/ce*ye,De=de/ce*ye;if(K.fx+=Se,K.fy+=De,q.fx-=Se,q.fy-=De,!ge&&de<22){let Le=(22-de)*.018;K.fy-=Le,q.fy+=Le}}for(let K of M){K.vx=(K.vx+K.fx)*.55,K.vy=(K.vy+K.fy)*.55;let q=Math.hypot(K.vx,K.vy)||1,J=Math.min(1,te/q);K.x+=K.vx*J,K.y+=K.vy*J}}let Y=-1/0,W=-1/0,xe=1/0,Me=1/0;for(let N of M)xe=Math.min(xe,N.x),Me=Math.min(Me,N.y),Y=Math.max(Y,N.x),W=Math.max(W,N.y);for(let N of M)N.x+=16-xe,N.y+=16-Me;return{nodes:T,edges:F,depth:h,incoming:g,links:l,cycles:d,roots:new Set(o.filter(N=>s.has(N))),width:M.length>0?Y-xe+32:32,height:M.length>0?W-Me+32:32}}function pr(e){return Math.max(2.5,Math.min(6,4.5*Math.sqrt(e)))}function jn(e,t,o,{theme:n,viewport:i,width:s,height:l,colorOf:g,dimmed:p,selected:u,hovered:d,query:r}){let{k:$,tx:y,ty:m}=i,L=pr($),a=d??u,x=new Set([a,...t.links.get(a)??[],...t.incoming.get(a)??[]]),A=new Map;for(let[c,R]of t.nodes){let T=o.nodeByFile.get(c);A.set(c,{x:R.x*$+y,y:R.y*$+m,color:g(T.pkg),n:T,p:R,dim:c===a||c===u?1:p(T)?.12:a&&!x.has(c)?.16:1})}e.save();let h=(c,R)=>{let T=A.get(c.from),F=A.get(c.to);if(Math.max(T.x,F.x)<-40||Math.min(T.x,F.x)>s+40||Math.max(T.y,F.y)<-80||Math.min(T.y,F.y)>l+80)return;e.globalAlpha=R?.85:Math.min(T.dim,F.dim)*(a?.12:.22),e.strokeStyle=R?T.color:n.labelDefault,e.lineWidth=R?1.4:.7,e.setLineDash(c.cycle?[3,3]:[]);let f=F.x-T.x,M=F.y-T.y,C=Math.hypot(f,M)||1,Y=f/C,W=M/C,xe=T.x+Y*(L+1),Me=T.y+W*(L+1),N=F.x-Y*(L+3),Q=F.y-W*(L+3),te=c.cycle?Math.min(18,C*.15):0,K=(xe+N)/2-W*te,q=(Me+Q)/2+Y*te;if(e.beginPath(),e.moveTo(xe,Me),e.quadraticCurveTo(K,q,N,Q),e.stroke(),R||$>=.85||o.nodes.length<=50){let J=Math.atan2(Q-q,N-K),ve=R?5:3.5;e.setLineDash([]),e.fillStyle=e.strokeStyle,e.beginPath(),e.moveTo(N,Q),e.lineTo(N-Math.cos(J-.5)*ve,Q-Math.sin(J-.5)*ve),e.lineTo(N-Math.cos(J+.5)*ve,Q-Math.sin(J+.5)*ve),e.closePath(),e.fill()}};for(let c of t.edges)c.from!==a&&c.to!==a&&h(c,!1);for(let c of t.edges)(c.from===a||c.to===a)&&h(c,!0);e.setLineDash([]);let k=new Map,v=c=>{let R=[];for(let T=Math.floor(c.x/64);T<=Math.floor((c.x+c.w)/64);T++)for(let F=Math.floor(c.y/24);F<=Math.floor((c.y+c.h)/24);F++)R.push(`${T},${F}`);return R},S=c=>{for(let R of v(c))k.has(R)||k.set(R,[]),k.get(R).push(c)},E=(c,R)=>c.x<R.x+R.w&&R.x<c.x+c.w&&c.y<R.y+R.h&&R.y<c.y+c.h,U=[...A.values()].filter(c=>c.x>=-10&&c.x<=s+10&&c.y>=-10&&c.y<=l+10);for(let c of U)e.globalAlpha=c.dim,e.fillStyle=c.color,e.beginPath(),e.arc(c.x,c.y,L,0,Math.PI*2),e.fill(),(c.p.cycle||c.n.totalIssues>0)&&(e.strokeStyle=c.p.cycle?"#c47ad7":c.color,e.lineWidth=1,e.beginPath(),e.arc(c.x,c.y,L+2.5,0,Math.PI*2),e.stroke()),(c.n.file===u||c.n.file===d)&&(e.strokeStyle=n.selectRing,e.lineWidth=1.5,e.beginPath(),e.arc(c.x,c.y,L+4,0,Math.PI*2),e.stroke()),S({x:c.x-L-2,y:c.y-L-2,w:L*2+4,h:L*2+4});e.font='11px SFMono-Regular, Consolas, "Liberation Mono", monospace',e.textBaseline="top",e.textAlign="center",U.sort((c,R)=>{let T=F=>F.n.file===a?1e9:F.n.file===u?1e8:r&&F.dim===1?1e7:a&&x.has(F.n.file)?1e6:t.roots.has(F.n.file)?1e5:F.n.deg;return T(R)-T(c)});let I=0;for(let c of U){let R=c.n.file===a||c.n.file===u;if(!R&&c.dim<.5||!R&&!r&&!a&&$<1&&I>=24)continue;let T=c.n.label.length>38?`${c.n.label.slice(0,36)}\u2026`:c.n.label,F=e.measureText(T).width+8,f={x:c.x-F/2,y:c.y+L+5,w:F,h:16};f.x<4||f.x+f.w>s-4||f.y+f.h>l-24||!R&&v(f).some(M=>k.get(M)?.some(C=>E(f,C)))||(S(f),I++,e.globalAlpha=.94,e.fillStyle=n.bg,e.fillRect(f.x,f.y-1,f.w,f.h),e.globalAlpha=1,e.fillStyle=R?n.labelSelected:n.labelDefault,e.fillText(T,c.x,f.y))}e.restore()}function Xn(e){let t=e.nodes.map(i=>({node:i})),o=new Map(t.map(i=>[i.node.file,i])),n=e.edges.flatMap(i=>{let s=o.get(i.a),l=o.get(i.b);return s&&l?[{edge:i,a:s,b:l}]:[]});return{nodes:t,edges:n,graph:e,selected:void 0,neighbors:new Set}}function qn(e,{viewport:t,selected:o,visible:n,dimmed:i,radius:s,color:l,paintKey:g}){if(g===void 0||e.paintKey!==g){let p=new Map;for(let u of e.nodes){let d=u.node;u.visible=n(d),u.visible&&(u.x=d.x*t.k+t.tx,u.y=d.y*t.k+t.ty,u.radius=s(d),u.dimmed=i(d),p.has(d.pkg)||p.set(d.pkg,l(d.pkg)),u.color=p.get(d.pkg))}e.paintKey=g}if(e.selected!==o){e.selected=o,e.neighbors.clear();for(let p of e.graph.adj.get(o)??[]){let u=e.graph.edges[p];e.neighbors.add(u.a),e.neighbors.add(u.b)}}}function Wn(e,t,o,n){if(e.paints&&e.edgeOpacity===t&&e.neutral===o&&e.edgeSelected===n)return e.paints;let i=g=>({opacity:Math.max(0,Math.min(255,Math.round(g*255)))/255,neutral:o(g*.7)}),s=n?t*.25:t,l=n?.85:Math.min(.9,t+.5);return e.paints={base:i(s),emphasis:i(l),baseDim:i(Math.min(s,.04)),emphasisDim:i(Math.min(l,.04))},e.edgeOpacity=t,e.neutral=o,e.edgeSelected=n,e.paints}function Yn(e,t){let{a:o,b:n}=e;return(!e.gradient||e.ax!==o.node.x||e.ay!==o.node.y||e.bx!==n.node.x||e.by!==n.node.y||e.colorA!==o.color||e.colorB!==n.color)&&(e.gradient=t.createLinearGradient(o.node.x,o.node.y,n.node.x,n.node.y),e.gradient.addColorStop(0,o.color),e.gradient.addColorStop(1,n.color),e.ax=o.node.x,e.ay=o.node.y,e.bx=n.node.x,e.by=n.node.y,e.colorA=o.color,e.colorB=n.color),e.gradient}function Kn(e,t,o){return(!e.halo||e.haloX!==e.x||e.haloY!==e.y||e.haloRadius!==t||e.haloColor!==e.color)&&(e.halo=o.createRadialGradient(e.x,e.y,0,e.x,e.y,t),e.halo.addColorStop(0,e.color+"55"),e.halo.addColorStop(1,e.color+"00"),e.haloX=e.x,e.haloY=e.y,e.haloRadius=t,e.haloColor=e.color),e.halo}function Zn(e,t,o,n){return e.x<-2&&t.x<-2||e.x>o+2&&t.x>o+2||e.y<-2&&t.y<-2||e.y>n+2&&t.y>n+2}function Ao(e,t,o,n,i){return e+o<-2||e-o>n+2||t+o<-2||t-o>i+2}function Jn(e){let o=new Map;for(let[n,i]of e.entries()){let s=Math.floor(i.x/32),l=Math.floor(i.y/32);o.has(s)||o.set(s,new Map);let g=o.get(s);g.has(l)||g.set(l,[]),g.get(l).push({node:i,index:n})}return(n,i,s,l,g,p)=>{let{k:u,tx:d,ty:r}=s,$=(l+6)/u+1e-7,y=(n-d)/u,m=(i-r)/u,L=Math.floor((y-$)/32),a=Math.floor((y+$)/32),x=Math.floor((m-$)/32),A=Math.floor((m+$)/32),h=null,k=1/0,v=1/0;for(let S=L;S<=a;S++){let E=o.get(S);if(E)for(let U=x;U<=A;U++)for(let{node:I,index:c}of E.get(U)??[]){if(!p(I))continue;let R=I.x*u+d-n,T=I.y*u+r-i,F=R*R+T*T,f=g(I)+6;F<f*f&&(F<k||F===k&&c<v)&&(h=I,k=F,v=c)}}return h}}function Qn(e,t,o,n,i){if(!e||e.key!==t.key)return null;let s=(t.tx-e.tx)*i,l=(t.ty-e.ty)*i;if(!Number.isInteger(s)||!Number.isInteger(l)||!Number.isInteger(s/i)||!Number.isInteger(l/i)||!s&&!l||Math.abs(s)>=o*i||Math.abs(l)>=n*i)return null;let g=s/i,p=l/i,u=[],d=2;return g>0&&u.push({x:0,y:0,w:Math.min(o,g+d),h:n}),g<0&&u.push({x:Math.max(0,o+g-d),y:0,w:Math.min(o,-g+d),h:n}),p>0&&u.push({x:0,y:0,w:o,h:Math.min(n,p+d)}),p<0&&u.push({x:0,y:Math.max(0,n+p-d),w:o,h:Math.min(n,-p+d)}),{dx:s,dy:l,rects:u}}function jt(e,t,o,n,i){return e&&e.rects.every(s=>n<s.x||t>s.x+s.w||i<s.y||o>s.y+s.h)}var fr={critical:"#ff5470",high:"#ff9d4a",medium:"#f4d35e",low:"#67c2ff",high_bug:"#a06c3f",bug:"#7a6d62",informational:"#218bff"},Xt={dark:{bg:"#0c0c0c",grid:"rgba(255, 255, 255, 0.022)",selectRing:"#ffffff",edgeIntra:e=>`rgba(180, 195, 215, ${e})`,hubRing:e=>`rgba(255, 255, 255, ${e})`,labelFill:"rgba(230, 233, 238, 0.78)",labelShadow:"rgba(12, 12, 12, 0.98)",labelOutline:"rgba(12, 12, 12, 0.9)",labelDefault:"rgba(200, 210, 225, 0.78)",labelHover:"rgba(230, 237, 243, 0.95)",labelSelected:"#fff"},light:{bg:"#f6f8fa",grid:"rgba(0, 0, 0, 0.04)",selectRing:"#0969da",edgeIntra:e=>`rgba(50, 70, 100, ${e})`,hubRing:e=>`rgba(0, 0, 0, ${e})`,labelFill:"rgba(40, 50, 70, 0.85)",labelShadow:"rgba(255, 255, 255, 0.95)",labelOutline:"rgba(255, 255, 255, 0.9)",labelDefault:"rgba(50, 60, 80, 0.85)",labelHover:"rgba(20, 25, 35, 0.95)",labelSelected:"#000"},pink:{bg:"#fff0f7",grid:"rgba(0, 0, 0, 0.04)",selectRing:"#0969da",edgeIntra:e=>`rgba(50, 70, 100, ${e})`,hubRing:e=>`rgba(0, 0, 0, ${e})`,labelFill:"rgba(40, 50, 70, 0.85)",labelShadow:"rgba(255, 255, 255, 0.95)",labelOutline:"rgba(255, 255, 255, 0.9)",labelDefault:"rgba(50, 60, 80, 0.85)",labelHover:"rgba(20, 25, 35, 0.95)",labelSelected:"#000"}},gr={...Xt.light,bg:"#fff",selectRing:"#000",edgeIntra:e=>`rgba(0, 0, 0, ${e})`,labelFill:"#000",labelShadow:"#fff",labelOutline:"#fff",labelDefault:"#000",labelHover:"#000"};function ei(){let e=document.body.classList;return e.contains("theme-paper")?gr:e.contains("theme-pink")?Xt.pink:e.contains("theme-light")?Xt.light:Xt.dark}var ti=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function Ro(e){e.sort((o,n)=>n.prio-o.prio);let t=[];for(let o of e){let n=!1;for(let i of t)if(ti(o,i)){n=!0;break}n||t.push(o)}return t}var hr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ge(e){let t=Math.max(0,Math.min(255,Math.round(e*255)));return hr[t]}function mr(e,t,o,n){let s=e.querySelector("graph-layout")?.shadowRoot;if(!s)return;let l=s.querySelector("#g2-canvas"),g=s.querySelector("#g2-tooltip"),p=s.querySelector(".graph2-stage"),u=s.querySelector(".g2-stage-stats"),d=s.querySelector("#g2-zoom-pct");if(!l)return;gn();let r=l.getContext("2d"),$=window.devicePixelRatio||1,y=0,m=0,L=0,a={tx:0,ty:0,k:1},x=null,A=0,h=0,k=!0,v=!0,S=new WeakMap,E=null,U=null,I=null,c=()=>t.supportsLayers&&w.bundleLayout==="layers"&&!w.focusedPkg,R=()=>t.supportsLayers&&w.bundleLayout==="dependencies"&&!w.focusedPkg,T=()=>R()&&!gt(t,w.dependencyPackagesView),F=()=>c()||w.bundleLayout==="graph"&&w.packagesView&&(t.canPackagesView??!1)&&!w.focusedPkg,f=null,M=null,C=null;function Y(){if(!C&&(C=Ot(t),c()&&t.layerRoots?.appImports.length>0)){if(!C.byPkg.has("__own__")){let b={file:"__own__",pkg:"__own__",label:"App (source not bundled)",size:null,fileCount:0,totalIssues:0};C.nodes.push(b),C.byPkg.set("__own__",b)}C.importsOf.set("__own__",[...new Set([...C.importsOf.get("__own__")??[],...t.layerRoots.appImports])])}return C}function W(){return Nt(t,w.dependencyPackagesView)}let xe=b=>b==="__own__"?"App":f?.depth.get(b)===0?`App \xB7 ${Be(b)}`:Be(b);function Me(b,_,H){if(b.nodes.length>50){Mo(b,_,H);return}let B=So(b.nodes.map(P=>P.pkg),b.importsOf,_,H,{groupOf:P=>P});N(b.nodes,new Map(B.map(P=>[P.file,P])))}function N(b,_){for(let H of b){let B=_.get(H.file);B&&(H.x=B.x,H.y=B.y)}}function Q(){if(!k)return;if(U=null,I=null,E=null,c()){let P=Y();f=Un(P.nodes.map(G=>({id:G.pkg,size:G.size})),P.importsOf,t.layerRoots?.roots??["__own__"],{width:Math.max(360,h-190)}),k=!1;return}if(R()){let P=W();M=Gn(P.nodes.map(G=>G.file),P.importsOf,P.fileLevel?[]:t.layerRoots?.roots??[],{width:h,height:A}),k=!1;return}let b=w.layoutCache,_=w.focusedPkg,H=F(),B=H?Y().nodes:t.nodes;if(b&&b.files===t.files&&b.w===h&&b.h===A&&b.focused===_&&(b.pkgView??!1)===H)N(B,b.pos);else{if(H)Me(Y(),h,A);else if(_)if(t.nodes.length>50)Mo(t,h,A);else{let G=So(t.files,t.importsOf,h,A);N(t.nodes,new Map(G.map(ee=>[ee.file,ee])))}else Dn(t,h,A);let P=new Map;for(let G of B)P.set(G.file,{x:G.x,y:G.y});w.layoutCache={files:t.files,w:h,h:A,pos:P,focused:_,pkgView:H}}k=!1}function te(){if(R()&&M){if(W().nodes.length<=100){let ie=12;r.save(),r.font='11px SFMono-Regular, Consolas, "Liberation Mono", monospace';for(let re of W().nodes){let X=re.label.length>38?`${re.label.slice(0,36)}\u2026`:re.label;ie=Math.max(ie,r.measureText(X).width/2+4)}return r.restore(),_o([...M.nodes.values()],m,y,{statsHeight:L,left:ie,top:12,bottom:27})}let V=Math.max(20,Math.min(m,y)*.04),j=Math.min((m-V*2)/M.width,(y-V*2-L)/M.height,2.5),Z=Math.max(.05,j);return{k:Z,tx:(m-M.width*Z)/2,ty:(y-L-M.height*Z)/2}}if(c()&&f){let V=Math.min((m-24)/(f.width+185),(y-70)/(f.height+f.gap),1.5),j=Math.max(.05,V);return{k:j,tx:(m-(f.width+185)*j)/2+145*j,ty:24+Math.max(0,(y-70-(f.height+f.gap)*j)/2)}}let b=F()?Y().nodes:t.nodes;if(b.length<=50){let V=0,j=0,Z=0;r.save(),r.font="600 11px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace";for(let ie of b){let re=F()?et(ie):(ie.isHub?6:4)*w.nodeSize,X=re*1.85+5;j=Math.max(j,X,r.measureText(ie.label).width/2+6),Z=Math.max(Z,X),V=Math.max(V,X,re+4+13+4)}return r.restore(),_o(b,m,y,{statsHeight:L,left:j,top:Z,bottom:V})}if(b.length===0)return{k:1,tx:m/2,ty:(y-L)/2};let _=-1/0,H=-1/0,B=1/0,P=1/0;for(let V of b)V.x<B&&(B=V.x),V.y<P&&(P=V.y),V.x>_&&(_=V.x),V.y>H&&(H=V.y);let G=Math.max(20,H-P),ee=Math.max(20,_-B),fe=(B+_)/2,ae=(P+H)/2,ue=Math.max(20,Math.min(m,y)*(w.focusedPkg?.04:.03)),D=Math.min((m-ue*2)/ee,(y-ue*2-L)/G,4),z=Math.max(.05,D);return{k:z,tx:m/2-fe*z,ty:(y-L)/2-ae*z}}function K(){let b=te();a.k=b.k,a.tx=b.tx,a.ty=b.ty}function q(){if(!R()){d&&(d.textContent=`${Math.round(a.k*100)}%`);return}let b=Gt(a.k,te().k,!0);d&&(d.textContent=`${b.percent}%`),Zt&&(Zt.disabled=a.k<=b.min*1.0001),Kt&&(Kt.disabled=a.k>=b.max*.9999)}function J(b,_){return[b*a.k+a.tx,_*a.k+a.ty]}function ve(b,_){return[(b-a.tx)/a.k,(_-a.ty)/a.k]}function ge(b){return!w.hidden.has(b.pkg)}function Te(b,_,H,B,P){let G=H+(B==="critical"?4.2:B==="high"?3.4:2.8),ee=B==="critical"?1.8:B==="high"?1.5:B==="medium"?1.3:1.1;r.strokeStyle=fr[B],r.globalAlpha=P,r.lineWidth=ee,r.beginPath(),r.arc(b,_,G,0,Math.PI*2),r.stroke(),r.globalAlpha=1}function de(b,_,H,B,P,G,ee){let ue=ee?.1:.9,D=2*(1-ue)*(H-b)+2*ue*(P-H),z=2*(1-ue)*(B-_)+2*ue*(G-B),V=Math.sqrt(D*D+z*z)||1,j=D/V,Z=z/V;r.beginPath(),ee?(r.moveTo(b,_),r.lineTo(b+j*7-Z*2.94,_+Z*7+j*2.94),r.lineTo(b+j*7+Z*2.94,_+Z*7-j*2.94)):(r.moveTo(P,G),r.lineTo(P-j*7+Z*2.94,G-Z*7-j*2.94),r.lineTo(P-j*7-Z*2.94,G-Z*7+j*2.94)),r.closePath()}function ce(b){if(w.selectedSeverities.size>0){let H=b.severitySet;if(!H)return!0;let B=!1;for(let P of w.selectedSeverities)if(H.has(P)){B=!0;break}if(!B)return!0}if(w.selectedColors.size>0){let H=b.colorSet;if(!H)return!0;let B=!1;for(let P of w.selectedColors)if(H.has(P)){B=!0;break}if(!B)return!0}if(w.solo&&b.pkg!==w.solo&&!F()&&!T())return!0;let _=w.pathFilter;if(_){let H=_.toLowerCase(),B=b.pathText?b.pathText.includes(H):b.file.toLowerCase().includes(H),P=b.pkg&&b.pkg.toLowerCase().includes(H),G=b.label&&b.label.toLowerCase().includes(H);if(!B&&!P&&!G)return!0}return!1}function ye(b){let _=(b.isHub?4.9:3.5)*w.nodeSize,H=Math.max(.6,Math.min(1.6,a.k));return _*H}function Se(){let b=p.getBoundingClientRect(),_=y,H=m;m=Math.max(80,b.width),y=Math.max(80,b.height),L=u?(parseFloat(getComputedStyle(u).lineHeight)||0)+8:0,$=window.devicePixelRatio||1,l.width=m*$,l.height=y*$,U=null,S.delete(t),C&&S.delete(C),l.style.width=m+"px",l.style.height=y+"px",r.setTransform($,0,0,$,0,0),(h===0||A===0)&&(h=m,A=y,k=!0),Q();let B=H>0&&(Math.abs(m-H)/H>.15||Math.abs(y-_)/_>.15);(v||B)&&(K(),v=!1),Ee()}let De=null,Le=!0,dt=!1,qt=!1;function Ee(){Le=!0,!(dt||qt)&&(dt=!0,De=requestAnimationFrame(()=>{dt=!1,Le&&!qt&&(Le=!1,ni())}))}function ni(){let b=F()?Y():t;if(I?.graph!==b){I={graph:b,x0:1/0,y0:1/0,x1:-1/0,y1:-1/0};for(let ee of b.nodes)I.x0=Math.min(I.x0,ee.x),I.x1=Math.max(I.x1,ee.x),I.y0=Math.min(I.y0,ee.y),I.y1=Math.max(I.y1,ee.y)}let _=ye({isHub:!0})*6+8,B=I.x0*a.k+a.tx>_&&I.y0*a.k+a.ty>_&&I.x1*a.k+a.tx<m-_&&I.y1*a.k+a.ty<y-_&&a.k<=1.4&&b.nodes.length>50&&!c()&&!R(),P={tx:a.tx,ty:a.ty,key:JSON.stringify([a.k,ei().bg,w.nodeSize,w.edgeOpacity,x,w.selected,w.solo,w.focusedPkg,F(),w.showAll,w.pathFilter,[...w.selectedSeverities],[...w.selectedColors],[...w.hidden]])},G=B?Qn(U,P,m,y,$):null;r.save();try{if(G){r.save(),r.setTransform(1,0,0,1,0,0),r.globalCompositeOperation="copy",r.drawImage(l,G.dx,G.dy),r.restore(),r.beginPath();for(let ee of G.rects)r.rect(ee.x,ee.y,ee.w,ee.h);r.clip()}ii(G),U=B?P:null}finally{r.restore()}}function ii(b){let _=ei();r.fillStyle=_.bg,r.fillRect(0,0,m,y),ri(_);let H=R(),B=F(),P=H?W():B?Y():t,G=T()||B?w.solo:w.selected,ee=G?P.nodeByFile.get(G):null,fe=ee?G:null;if(H){jn(r,M,P,{theme:_,viewport:a,width:m,height:y,colorOf:he,selected:fe,hovered:x,query:w.pathFilter,dimmed:X=>ce(X)}),q();return}if(c()){r.save(),r.translate(a.tx,a.ty),r.scale(a.k,a.k),Vn(r,f,{theme:_,scale:a.k,selected:fe,hovered:x,colorOf:he,labelOf:xe,sizeLabel:X=>We(typeof X=="number"?X:P.byPkg.get(X).size)||"Size unknown",dimmed:X=>ce(P.byPkg.get(X))}),r.restore(),q();return}if(B&&P.nodes.length<=50){ai(_);return}if(w.focusedPkg&&P.nodes.length<=50){si(_,fe,ee);return}S.has(P)||S.set(P,Xn(P));let ae=S.get(P),ue=JSON.stringify([a.k,a.tx,a.ty,w.nodeSize,_.bg,w.solo,w.pathFilter,[...w.selectedSeverities],[...w.selectedColors],[...w.hidden]]);qn(ae,{viewport:a,selected:fe,paintKey:ue,visible:ge,dimmed:ce,radius:ye,color:he});let D=Wn(ae,w.edgeOpacity,_.edgeIntra,!!fe),z=fe||x,V=.85/a.k,j=.55/a.k,Z=null,ie=null,re=null;r.save(),r.translate(a.tx,a.ty),r.scale(a.k,a.k);for(let X of ae.edges){let{edge:ne,a:oe,b:le}=X;if(!oe.visible||!le.visible||Zn(oe,le,m,y)||jt(b,Math.min(oe.x,le.x)-2,Math.min(oe.y,le.y)-2,Math.max(oe.x,le.x)+2,Math.max(oe.y,le.y)+2))continue;let be=z&&(ne.a===z||ne.b===z),pe=oe.dimmed&&le.dimmed?be?D.emphasisDim:D.baseDim:be?D.emphasis:D.base,we=ne.cross?Yn(X,r):pe.neutral,ke=ne.cross?pe.opacity:1,Pe=ne.cross?V:j;we!==ie&&(r.strokeStyle=we,ie=we),ke!==Z&&(r.globalAlpha=ke,Z=ke),Pe!==re&&(r.lineWidth=Pe,re=Pe),r.beginPath(),r.moveTo(oe.node.x,oe.node.y),r.lineTo(le.node.x,le.node.y),r.stroke()}r.restore();for(let X of ae.nodes){if(!X.visible)continue;let ne=X.node,oe=ne.file===x,le=ne.file===fe;if(!ne.isHub&&!oe&&!le||X.dimmed&&!oe&&!le)continue;let be=X.radius,pe=X.x,we=X.y,ke=be*(le?6:oe?4.5:3);Ao(pe,we,ke,m,y)||jt(b,pe-ke-2,we-ke-2,pe+ke+2,we+ke+2)||(r.fillStyle=Kn(X,ke,r),r.beginPath(),r.arc(pe,we,ke,0,Math.PI*2),r.fill())}for(let X of ae.nodes){if(!X.visible)continue;let ne=X.node,oe=X.radius,le=X.x,be=X.y;if(Ao(le,be,oe+6,m,y)||jt(b,le-oe-8,be-oe-8,le+oe+8,be+oe+8))continue;let pe=1,we=fe&&ne.file===fe;fe&&!we&&(pe=ae.neighbors.has(ne.file)?1:.25),!we&&X.dimmed&&(pe=Math.min(pe,.1)),r.fillStyle=X.color+Ge(pe),r.beginPath(),r.arc(le,be,oe,0,Math.PI*2),r.fill(),ne.isHub&&(r.strokeStyle=_.hubRing(.55*pe),r.lineWidth=.8,r.stroke()),ne.issue&&Te(le,be,oe,ne.issue,pe)}if(a.k>1.4){let ne=0;if(a.k<9&&!w.showLabels)for(let le of P.nodes){if(!ge(le))continue;let[be,pe]=J(le.x,le.y);if(!(be<0||be>m||pe<0||pe>y)&&(ne++,ne>=50))break}let oe=a.k>=9||ne<50;if(w.showLabels||oe){r.font="10px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",r.fillStyle=_.labelFill,r.textAlign="left",r.textBaseline="middle";let le=11,be=2,pe=250,we=(se,$e)=>se>-pe&&se<m+pe&&$e>-pe&&$e<y+pe,ke=[];for(let se of P.nodes){if(!ge(se))continue;let[$e,_e]=J(se.x,se.y);if(!we($e,_e))continue;let Ae=ye(se);ke.push({file:se.file,x0:$e-Ae,x1:$e+Ae,y0:_e-Ae,y1:_e+Ae})}let Pe=[];for(let se of P.nodes){if(!ge(se)||!se.isHub&&a.k<2.4)continue;let[$e,_e]=J(se.x,se.y);if(!we($e,_e))continue;let Ae=ye(se),Ie=$e+Ae+4,Re=_e+1,ze=r.measureText(se.label).width+be,Oe=se.file===fe,je=se.file===x,Ke=Oe?3:je?2:se.isHub?1:0;Pe.push({file:se.file,n:se,tx:Ie,ty:Re,prio:Ke,x0:Ie-be,x1:Ie+ze,y0:Re-le/2,y1:Re+le/2})}let Ye=Ro(Pe.filter(se=>!ke.some($e=>$e.file!==se.file&&ti(se,$e))));for(let se of Ye)r.fillText(se.n.label,se.tx,se.ty)}}if(ee&&ge(ee)){let[X,ne]=J(ee.x,ee.y),oe=ye(ee);r.strokeStyle=_.selectRing,r.lineWidth=1.5,r.beginPath(),r.arc(X,ne,oe+5,0,Math.PI*2),r.stroke()}q()}function ri(b){if(a.k<.4)return;let _=80,H=(a.tx%_+_)%_,B=(a.ty%_+_)%_;r.strokeStyle=b.grid,r.lineWidth=1,r.beginPath();for(let P=H;P<m;P+=_)r.moveTo(P,0),r.lineTo(P,y);for(let P=B;P<y;P+=_)r.moveTo(0,P),r.lineTo(m,P);r.stroke()}function si(b,_,H){let B=he(w.focusedPkg),P=b.hubRing(.55),G=new Set;if(x){G.add(x);for(let z of t.adj.get(x)??[]){let V=t.edges[z];G.add(V.a),G.add(V.b)}}let ee=z=>(z.isHub?6:4)*w.nodeSize;for(let z of t.edges){let V=t.nodeByFile.get(z.a),j=t.nodeByFile.get(z.b);if(!V||!j||!ge(V)||!ge(j))continue;let Z=z.fromLo&&z.fromHi,ie=!Z&&z.fromHi,re=ie?j:V,X=ie?V:j,ne=x&&(z.a===x||z.b===x),oe=_&&(z.a===_||z.b===_),le=(_||x)&&!ne&&!oe,be=ee(re),pe=ee(X),[we,ke]=J(re.x,re.y),[Pe,Ye]=J(X.x,X.y),se=Pe-we,$e=Ye-ke,_e=Math.sqrt(se*se+$e*$e)||1,Ae=se/_e,Ie=$e/_e,Re=we+Ae*(be+1.5),ze=ke+Ie*(be+1.5),Oe=Pe-Ae*(pe+3.5),je=Ye-Ie*(pe+3.5),Ke=Math.min(_e*.15,30),tt=(Re+Oe)/2-Ie*Ke,Fe=(ze+je)/2+Ae*Ke;r.beginPath(),r.moveTo(Re,ze),r.quadraticCurveTo(tt,Fe,Oe,je);let Ve;oe?Ve=.9:ne?Ve=.85:le?Ve=.05:Ve=Math.min(.85,w.edgeOpacity*3),r.strokeStyle=B+Ge(Ve),r.lineWidth=oe||ne?1.5:.85,r.stroke(),!le&&(de(Re,ze,tt,Fe,Oe,je,!1),r.fillStyle=B+Ge(Math.min(1,Ve+.15)),r.fill(),Z&&(de(Re,ze,tt,Fe,Oe,je,!0),r.fill()))}for(let z of t.nodes){if(!ge(z))continue;let[V,j]=J(z.x,z.y),Z=ee(z),ie=z.file===x,re=z.file===_,X=(_||x)&&!G.has(z.file)&&!re?.15:1;if(r.globalAlpha=X,re||ie||z.isHub){let ne=Z*(re?4:ie?3:2.4),oe=r.createRadialGradient(V,j,Z*.6,V,j,ne);oe.addColorStop(0,B+Ge(re?.4:.25)),oe.addColorStop(1,B+"00"),r.fillStyle=oe,r.beginPath(),r.arc(V,j,ne,0,Math.PI*2),r.fill()}r.fillStyle=B,r.beginPath(),r.arc(V,j,Z,0,Math.PI*2),r.fill(),z.isHub&&(r.strokeStyle=P,r.lineWidth=.9,r.stroke()),z.issue&&Te(V,j,Z,z.issue,X),r.globalAlpha=1}r.font="600 11px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",r.textAlign="center",r.textBaseline="top",r.lineJoin="round";let fe=13,ae=2,ue=[];for(let z of t.nodes){if(!ge(z))continue;let[V,j]=J(z.x,z.y),Z=ee(z),ie=j+Z+4,re=r.measureText(z.label).width/2+ae,X=z.file===_,ne=z.file===x,oe=X?3:ne?2:z.isHub?1:0;ue.push({n:z,sx:V,ty:ie,halfW:re,isSel:X,isHov:ne,prio:oe,x0:V-re,x1:V+re,y0:ie,y1:ie+fe})}let D=Ro(ue);for(let z of D){let{n:V,sx:j,ty:Z,isSel:ie,isHov:re}=z,X=(_||x)&&!G.has(V.file)&&!ie?.2:1;r.globalAlpha=X,r.shadowColor=b.labelShadow,r.shadowBlur=4,r.strokeStyle=b.labelOutline,r.lineWidth=3,r.strokeText(V.label,j,Z),r.shadowBlur=0,r.fillStyle=ie?b.labelSelected:re?b.labelHover:b.labelDefault,r.fillText(V.label,j,Z),r.globalAlpha=1}if(H&&ge(H)){let[z,V]=J(H.x,H.y),j=ee(H);r.strokeStyle=b.selectRing,r.lineWidth=1.8,r.beginPath(),r.arc(z,V,j+4,0,Math.PI*2),r.stroke()}q()}function et(b){return Math.min(26,5+Math.sqrt(b.fileCount)*1.7)*w.nodeSize}function ai(b){let _=Y(),H=w.solo&&_.byPkg.has(w.solo)?w.solo:null,B=x??H,P=new Set;if(B){P.add(B);for(let D of _.edges)D.a===B?P.add(D.b):D.b===B&&P.add(D.a)}let G=D=>{if(D.pkg===H||D.pkg===x)return 1;let z=1;return B&&!P.has(D.pkg)&&(z=.2),ce(D)&&(z=Math.min(z,.1)),z};for(let D of _.edges){let z=_.byPkg.get(D.a),V=_.byPkg.get(D.b);if(!z||!V||!ge(z)||!ge(V))continue;let j=D.fromLo&&D.fromHi,Z=!j&&D.fromHi,ie=Z?V:z,re=Z?z:V,X=B!==null&&(D.a===B||D.b===B),ne=ce(z)&&ce(V),oe=B!==null&&!X||ne,le=et(ie),be=et(re),[pe,we]=J(ie.x,ie.y),[ke,Pe]=J(re.x,re.y),Ye=ke-pe,se=Pe-we,$e=Math.sqrt(Ye*Ye+se*se)||1,_e=Ye/$e,Ae=se/$e,Ie=pe+_e*(le+1.5),Re=we+Ae*(le+1.5),ze=ke-_e*(be+3.5),Oe=Pe-Ae*(be+3.5),je=Math.min($e*.15,30),Ke=(Ie+ze)/2-Ae*je,tt=(Re+Oe)/2+_e*je,Fe;ne?Fe=.05:X?Fe=.9:oe?Fe=.06:Fe=.5;let Ve=r.createLinearGradient(Ie,Re,ze,Oe);Ve.addColorStop(0,he(ie.pkg)+Ge(Fe)),Ve.addColorStop(1,he(re.pkg)+Ge(Fe)),r.beginPath(),r.moveTo(Ie,Re),r.quadraticCurveTo(Ke,tt,ze,Oe),r.strokeStyle=Ve,r.lineWidth=Math.min(3.5,.8+Math.sqrt(D.count)*.3)*(X?1.3:1),r.stroke(),!oe&&(de(Ie,Re,Ke,tt,ze,Oe,!1),r.fillStyle=he(re.pkg)+Ge(Math.min(1,Fe+.15)),r.fill(),j&&(de(Ie,Re,Ke,tt,ze,Oe,!0),r.fillStyle=he(ie.pkg)+Ge(Math.min(1,Fe+.15)),r.fill()))}for(let D of _.nodes){if(!ge(D))continue;let[z,V]=J(D.x,D.y),j=et(D),Z=D.pkg===x,ie=D.pkg===H,re=he(D.pkg),X=G(D);if(ie||Z){let ne=j*(ie?2.6:2.2),oe=r.createRadialGradient(z,V,j*.6,z,V,ne);oe.addColorStop(0,re+Ge(ie?.4:.25)),oe.addColorStop(1,re+"00"),r.fillStyle=oe,r.beginPath(),r.arc(z,V,ne,0,Math.PI*2),r.fill()}r.fillStyle=re+Ge(X),r.beginPath(),r.arc(z,V,j,0,Math.PI*2),r.fill(),D.issue&&Te(z,V,j,D.issue,X)}r.font="600 11px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",r.textAlign="center",r.textBaseline="top",r.lineJoin="round";let ee=13,fe=2,ae=[];for(let D of _.nodes){if(!ge(D))continue;let[z,V]=J(D.x,D.y),j=et(D),Z=V+j+4,ie=r.measureText(D.label).width/2+fe,re=D.pkg===H,X=D.pkg===x,ne=re?1/0:X?1e9:D.fileCount;ae.push({p:D,sx:z,ty:Z,isSel:re,isHov:X,prio:ne,x0:z-ie,x1:z+ie,y0:Z,y1:Z+ee})}let ue=Ro(ae);for(let D of ue){let{p:z,sx:V,ty:j,isSel:Z,isHov:ie}=D;r.globalAlpha=Math.max(.25,G(z)),r.shadowColor=b.labelShadow,r.shadowBlur=4,r.strokeStyle=b.labelOutline,r.lineWidth=3,r.strokeText(z.label,V,j),r.shadowBlur=0,r.fillStyle=Z?b.labelSelected:ie?b.labelHover:b.labelDefault,r.fillText(z.label,V,j),r.globalAlpha=1}if(H){let D=_.byPkg.get(H),[z,V]=J(D.x,D.y);r.strokeStyle=b.selectRing,r.lineWidth=1.8,r.beginPath(),r.arc(z,V,et(D)+4,0,Math.PI*2),r.stroke()}q()}function To(b,_){if(R()){let[ae,ue]=ve(b,_),D=null,z=1/0;for(let[V,j]of M.nodes){let Z=(j.x-ae)**2+(j.y-ue)**2;Z<z&&Z<(14/Math.max(a.k,.1))**2&&(z=Z,D=W().nodeByFile.get(V))}return D}if(c()){let[ae,ue]=ve(b,_);for(let D of f.rects.values())if(D.width>0&&ae>=D.x&&ae<D.x+D.width&&ue>=D.y&&ue<=D.y+D.height)return Y().byPkg.get(D.id);return null}let H=F(),B=H?Y():t,P=H&&B.nodes.length<=50;if(B.nodes.length>50){E??=Jn(B.nodes);let ae=4.9*w.nodeSize*Math.max(.6,Math.min(1.6,a.k));return E(b,_,a,ae,ye,ge)}let G=null,ee=1/0,fe=6;for(let ae of B.nodes){if(!ge(ae))continue;let[ue,D]=J(ae.x,ae.y),z=ue-b,V=D-_,j=z*z+V*V,Z=(P?et(ae):ye(ae))+fe;j<Z*Z&&j<ee&&(ee=j,G=ae)}return G}function li(b,_,H){if(!g)return;let B=he(b.pkg),P=Be(b.pkg),G=Ft(b.file,b.pkg);ot(O`<div class="g2-tt-path">${G}</div><div class="g2-tt-head"><span class="g2-tt-dot" style="${`background:${B}`}"></span> <span class="g2-tt-pkg">${P}</span></div>${b.totalIssues>0?lt(b.own):null}`,g),Io(_,H)}function ci(b,_,H){if(!g)return;let B=he(b.pkg),P=We(b.size);ot(O`<div class="g2-tt-path">${c()?xe(b.pkg):b.label}</div>${R()?O`<div class="g2-tt-pkg">${W().importedBy.get(b.pkg).length} importers · ${W().importsOf.get(b.pkg)?.length??0} dependencies</div>`:null} ${c()?O`<div class="g2-tt-pkg">${f.depth.has(b.pkg)?`Level ${f.depth.get(b.pkg)} \xB7 shortest import distance from App`:"No known import path from App"}</div>`:null}<div class="g2-tt-head"><span class="g2-tt-dot" style="${`background:${B}`}"></span> <span class="g2-tt-pkg">${b.fileCount} ${b.fileCount===1?"file":"files"}${P?` \xB7 ${P}`:""}</span></div>${b.totalIssues>0?lt(b.own):null}`,g),Io(_,H)}function Io(b,_){let H=p.getBoundingClientRect();g.classList.add("show");let B=g.offsetWidth,P=g.offsetHeight,G=b-H.left,ee=_-H.top,fe=H.width,ae=H.height,ue=12,D=G+ue;D+B>fe-4&&(D=G-B-ue),D<4&&(D=4);let z=ee+ue;z+P>ae-4&&(z=ee-P-ue),z<4&&(z=4),g.style.left=`${D}px`,g.style.top=`${z}px`}function Wt(){g&&g.classList.remove("show")}let $t=!1,mt=null,Yt=!1,Co=b=>{b.button===0&&(b.target.closest(".g2-stage-overlay, .g2-stage-overlay-tr, .g2-zoom-ctrl")||($t=!0,Yt=!1,mt={x:b.clientX,y:b.clientY,tx:a.tx,ty:a.ty}))},Lo=b=>{let _=p.getBoundingClientRect(),H=b.clientX-_.left,B=b.clientY-_.top;if($t){let ee=b.clientX-mt.x,fe=b.clientY-mt.y;Math.abs(ee)+Math.abs(fe)>3&&(Yt=!0),a.tx=mt.tx+ee,a.ty=mt.ty+fe,Wt(),Ee();return}let P=To(H,B),G=x;x=P?.file??null,l.style.cursor=P?"default":"grab",P?F()||T()?ci(P,b.clientX,b.clientY):li(P,b.clientX,b.clientY):G&&Wt(),x!==G&&Ee()},Eo=b=>{if($t&&!Yt){let _=p.getBoundingClientRect(),H=b.clientX-_.left,B=b.clientY-_.top,P=To(H,B);F()||T()?(w.solo=P&&w.solo!==P.pkg?P.pkg:null,w.selected=null,o(),n?.()):(w.selected=P?.file??null,o()),Ee()}$t=!1},Po=()=>{let b=x!==null;x=null,Wt(),b&&Ee()},zo=b=>{b.preventDefault();let _=p.getBoundingClientRect(),H=b.clientX-_.left,B=b.clientY-_.top,P=Math.exp(-b.deltaY*.0015),G=te();if(P<1&&a.k<=G.k*1.0001){a.k=G.k;let D=Math.min(.4,(1-P)*3);a.tx+=(G.tx-a.tx)*D,a.ty+=(G.ty-a.ty)*D,Ee();return}let[ee,fe]=ve(H,B),ae=Gt(a.k,G.k,R()),ue=Math.max(ae.min,Math.min(ae.max,a.k*P));a.k=ue,a.tx=H-ee*a.k,a.ty=B-fe*a.k,Ee()};p.addEventListener("mousedown",Co),window.addEventListener("mousemove",Lo),window.addEventListener("mouseup",Eo),p.addEventListener("mouseleave",Po),p.addEventListener("wheel",zo,{passive:!1});function Oo(b){let _=Gt(a.k,te().k,R());b=Math.max(_.min,Math.min(_.max,b));let H=m/2,B=y/2,[P,G]=ve(H,B);a.k=b,a.tx=H-P*a.k,a.ty=B-G*a.k,Ee()}let Kt=s.querySelector("#g2-zoom-in"),Zt=s.querySelector("#g2-zoom-out"),di=s.querySelector("#g2-zoom-fit");Kt?.addEventListener("click",()=>Oo(a.k*1.4)),Zt?.addEventListener("click",()=>Oo(a.k/1.4)),di?.addEventListener("click",()=>{K(),Ee()}),Se();let Fo=new ResizeObserver(()=>Se());Fo.observe(p);let No=new MutationObserver(b=>{for(let _ of b){let H=(_.oldValue||"").includes("report-fullscreen"),B=document.body.classList.contains("report-fullscreen");if(H!==B){h=0,A=0,k=!0,v=!0,w.layoutCache=null,setTimeout(()=>Se(),80);return}Ee()}});No.observe(document.body,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}),Ee(),w.graphState={requestDraw:Ee,_cleanup:()=>{qt=!0,cancelAnimationFrame(De),Fo.disconnect(),No.disconnect(),p.removeEventListener("mousedown",Co),window.removeEventListener("mousemove",Lo),window.removeEventListener("mouseup",Eo),p.removeEventListener("mouseleave",Po),p.removeEventListener("wheel",zo)}}}function ml(e,t){let o=document.querySelector("graph-layout")?.shadowRoot;if(!o)return;let n=oi(e),i=o.querySelector("#g2-selection-area");i&&ot($n(n,t),i);let s=o.querySelector("#g2-focus-overlay-slot");s&&ot(yn(n),s)}function bl(e){let t=document.querySelector("graph-layout")?.shadowRoot;if(!t)return;let o=t.querySelector("#g2-top-pkgs-block");o&&ot(kn(oi(e)),o)}function oi(e){let t=xn(e.treeData,e.files,e.ownCounts,e.transitiveCounts,e.severitySets,e.colorSets,e.fileFindings,e.options);if(e.strippedToOrig)for(let o of t.nodes)o.origFile=e.strippedToOrig.get(o.file);return t.canPackagesView=e.canPackagesView??!1,t.supportsLayers=e.supportsLayers??!1,t.layerRoots=e.layerRoots,t.ownSourcePackages=e.ownSourcePackages,t.reasons=e.reasons??[],t}export{Ni as _swapGraph2Impl,mr as attachGraph2Interaction,oi as buildGraphFromPrep,ml as refreshSidebar,bl as refreshTopPkgs};
|
|
1
|
+
var Uo=globalThis[Symbol.for("@rray/frontend")];if(!Uo)throw new Error("@rray/frontend global not installed; view.js must run before lazy bundles import this wrapper");var{LitElement:pt,html:F,nothing:wi,unsafeCSS:je,render:it,StateElement:Ar,classMap:ft,repeat:Qt,styleMap:et}=Uo;var Vo=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:host{display:grid;grid-template-columns:1fr 300px;grid-template-rows:auto 1fr;grid-template-areas:"topbar right" "stage right";min-height:0;border:1px solid var(--border);border-radius:var(--ui-radius, 8px);overflow:hidden;background:var(--graph-canvas-bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,sans-serif;font-size:12px}.graph2-layout{display:contents}:host([matrix]){grid-template-columns:minmax(0,1fr) 320px}.graph2-topbar{grid-area:topbar;display:flex;flex-direction:column;gap:.5rem;padding:var(--graph-topbar-padding, .6rem .75rem .6rem var(--graph-topbar-left-padding, .75rem));font-size:.825rem;background:var(--surface);backdrop-filter:var(--glass-blur);border-bottom:1px solid var(--graph-divider)}.graph2-topbar-row{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;padding:0}.graph2-topbar .g2-spacer{flex:1}.g2-matrix-controls{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:11px;& button{height:30px;padding:4px 7px;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:var(--surface);color:var(--text);font:inherit}& button:hover,button[aria-pressed=true]{background:var(--graph-hover-bg);border-color:var(--muted)}}.graph2-topbar triage-selector{margin-left:auto}.g2-icon-btn{width:28px;height:28px;border-radius:var(--ui-radius, 5px);background:var(--graph-hover-bg);border:1px solid var(--border);color:var(--muted);display:grid;place-items:center;font-family:inherit;&:hover{color:var(--accent);border-color:var(--accent)}}.g2-path-filter-wrap{position:relative;flex:0 0 12rem;padding-right:22px}.g2-path-filter-wrap .g2-path-filter-clear{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:18px;height:18px;background:transparent;border:0;border-radius:var(--ui-radius, 50%);color:var(--muted);font:400 10px/1 inherit;font-family:inherit;&:hover{color:var(--text);background:var(--surface-active)}}.g2-path-filter:placeholder-shown~.g2-path-filter-clear{display:none}.g2-layout-tabs{display:inline-flex;flex-shrink:0;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);padding:2px;gap:2px;& button{position:relative;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:var(--ui-radius, 4px);background:transparent;color:var(--muted);font:inherit;font-size:11px;padding:5px 7px}& button[aria-pressed=true]{background:var(--graph-hover-bg);color:var(--text);box-shadow:var(--graph-layout-active-shadow, inset 0 0 0 1px var(--border))}}.g2-reason-filter{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:11px;& select{min-width:0;max-width:12rem;height:30px;padding:3px 6px;border:1px solid var(--border);border-radius:var(--ui-radius, 6px);background:var(--surface);color:var(--text);font:inherit}}.graph2-right{grid-area:right;border-left:1px solid var(--graph-divider);background:var(--surface);backdrop-filter:var(--glass-blur);display:flex;flex-direction:column;overflow:hidden;padding:14px}.g2-panel-title{font-family:inherit;font-weight:600;font-size:11px;line-height:1;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);opacity:.85;margin:14px 0 8px;display:flex;align-items:baseline;gap:6px;&:first-child{margin-top:0}}.g2-panel-title-row{justify-content:space-between;gap:8px}#g2-top-pkgs-block{margin-top:14px;flex:1 1 0;min-height:0;display:flex;flex-direction:column}.g2-mini-tabs{display:flex;gap:1px;background:var(--graph-mini-tabs-bg, var(--graph-divider));border-radius:var(--ui-radius, 4px);overflow:hidden}.g2-mini-tab{background:transparent;border:0;color:var(--muted);font-family:inherit;font-weight:500;font-size:11px;line-height:1.4;text-transform:none;letter-spacing:0;padding:2px 7px;&:hover{color:var(--text);background:var(--graph-hover-bg)}&.on{background:var(--surface-active);color:var(--accent);text-decoration:var(--graph-mini-tab-active-decoration, none);text-underline-offset:.2em}}.graph2-stage{grid-area:stage;position:relative;background:var(--graph-canvas-bg);overflow:hidden;cursor:grab;&:active{cursor:grabbing}& canvas{position:absolute;inset:0;width:100%;height:100%;display:block}}.g2-stage-overlay{position:absolute;top:12px;left:12px;z-index:3;display:flex;flex-direction:column;gap:4px;pointer-events:none;max-width:calc(100% - 60px)}.g2-stage-overlay>*{pointer-events:auto}.g2-stage-stats{position:absolute;bottom:10px;left:12px;z-index:2;display:flex;flex-wrap:wrap;gap:2px 14px;font:500 10px/1.4 ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;color:var(--muted);opacity:.7;text-transform:uppercase;letter-spacing:.06em;pointer-events:none;max-width:calc(100% - 80px);& b{font-weight:600;color:var(--text);opacity:1}}.g2-stage-overlay-tr{position:absolute;top:12px;right:12px;z-index:3;pointer-events:auto}.g2-focus-pkg-btn{width:28px;height:28px;display:grid;place-items:center;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);color:var(--accent);box-shadow:var(--shadow-glass);&:hover{border-color:var(--accent);background:var(--surface-active)}& svg{display:block}}.g2-back-btn{display:inline-flex;align-items:center;gap:4px;padding:6px 11px;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);color:var(--accent);font:500 11px/1 inherit;font-family:inherit;box-shadow:var(--shadow-glass);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-self:flex-start;&:hover{border-color:var(--accent);background:var(--surface-active)}}.g2-zoom-ctrl{position:absolute;right:12px;bottom:12px;display:flex;flex-direction:column;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);overflow:hidden;z-index:3;box-shadow:var(--shadow-glass);& button{width:28px;height:28px;background:transparent;border:0;color:var(--muted);border-bottom:1px solid var(--graph-divider);display:grid;place-items:center;font-family:inherit;font-size:13px;&:last-child{border-bottom:0}&:hover:not(:disabled){color:var(--accent);background:var(--surface-active)}&:disabled{opacity:.35}}}.g2-zoom-pct{font:500 9px/1 ui-monospace,monospace;color:var(--muted);padding:5px 0;text-align:center;border-bottom:1px solid var(--graph-divider)}.g2-zoom-ctrl .g2-zoom-fit-btn{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-weight:600;font-size:9px;line-height:1;letter-spacing:-.02em;text-transform:lowercase}.g2-tooltip{position:absolute;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 7px);padding:9px 11px;pointer-events:none;min-width:170px;max-width:260px;opacity:0;transition:opacity .12s;z-index:10;box-shadow:var(--shadow-glass);&.show{opacity:1}}.g2-tt-path{font:500 11px/1.3 ui-monospace,monospace;color:var(--text);word-break:break-all;margin-bottom:4px}.g2-tt-head{display:flex;align-items:center;gap:6px;margin-bottom:6px;flex-wrap:wrap}.g2-tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.g2-tt-pkg{font-size:10px;color:var(--muted);word-break:break-all}.g2-tooltip .tree-count-chips{margin-top:6px}:host-context(body.theme-light) .graph2-right .tree-count-chip.medium,:host-context(body.theme-light) .g2-tooltip .tree-count-chip.medium{color:#fff}.g2-selection-card{background:var(--graph-hover-bg);border:1px solid var(--border);border-radius:var(--ui-radius, 8px);overflow:hidden}.g2-sel-head{padding:11px 13px;border-bottom:1px solid var(--graph-divider);display:flex;align-items:center;gap:8px}.g2-sel-file-head{padding:11px 13px;border-bottom:1px solid var(--graph-divider);display:flex;flex-direction:column;gap:6px}.g2-sel-path{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-weight:600;font-size:12px;line-height:1.3;color:var(--text);word-break:break-all}.g2-sel-pkg-row{display:flex;align-items:center;gap:6px;min-width:0}.g2-sel-pkg{font-size:11px;color:var(--muted);word-break:break-all;min-width:0}.g2-sel-fullpath{padding:7px 13px;border-bottom:1px solid var(--graph-divider);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-size:10px;line-height:1.3;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.g2-sel-size{padding:5px 13px 7px;border-bottom:1px solid var(--graph-divider);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;font-size:10px;line-height:1.3;color:var(--muted);font-variant-numeric:tabular-nums}.g2-sel-dot{width:11px;height:11px;border-radius:50%;box-shadow:0 0 0 3px color-mix(in srgb,var(--dot) 22%,transparent);flex-shrink:0}.g2-sel-id{font:600 12px/1 ui-monospace,monospace;color:var(--text);word-break:break-all;flex:1;min-width:0}.g2-sel-grp{font:500 9px/1 ui-monospace,monospace;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;flex-shrink:0}.g2-sel-body{padding:11px 13px}.g2-sel-row{display:flex;justify-content:space-between;gap:12px;font-size:11px;padding:5px 0;border-bottom:1px solid var(--graph-divider);&:last-child{border-bottom:0}.k{color:var(--muted);flex-shrink:0}.v{color:var(--text);font-family:ui-monospace,monospace;word-break:break-all;text-align:right;min-width:0}}.g2-sel-section{padding:9px 13px;border-top:1px solid var(--graph-divider)}.g2-sel-section-label{font-family:inherit;font-weight:600;font-size:11px;line-height:1;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);opacity:.85;margin-bottom:5px}.g2-sel-section-empty{color:var(--muted);opacity:.55;font-size:11px;font-style:italic}.g2-sel-jumps{padding:11px 13px;display:flex;gap:5px;flex-wrap:wrap;border-top:1px solid var(--graph-divider)}.g2-sel-jump{background:var(--surface-active);border:1px solid var(--border);color:var(--accent);border-radius:var(--ui-radius, 4px);padding:2px 8px;font-family:inherit;font-weight:500;font-size:11px;line-height:1.3;&:hover{border-color:var(--accent)}}.g2-sel-file-list{list-style:none;margin:0;padding:0;max-height:110px;overflow:hidden auto;-webkit-app-region:no-drag;app-region:no-drag;&::-webkit-scrollbar{width:4px}&::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}& li{padding:0}}.g2-sel-file-link{display:flex;align-items:center;gap:6px;width:100%;background:transparent;border:0;border-radius:var(--ui-radius, 3px);padding:2px 6px;min-height:20.5px;font:400 11px/1.4 ui-monospace,SFMono-Regular,Menlo,Monaco,monospace;color:var(--accent);text-align:left;&:hover{background:var(--graph-hover-bg)}.g2-sel-file-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.g2-sel-file-path{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}.g2-empty-state,.g2-sel-section-empty,.g2-dist-empty{cursor:default;user-select:none;-webkit-user-select:none}.g2-empty-state{background:var(--graph-hover-bg);border:1px dashed var(--border);border-radius:var(--ui-radius, 8px);padding:18px 14px;text-align:center;color:var(--muted);font-size:11px;line-height:1.5;& strong{color:var(--text);display:block;margin-bottom:4px;font-weight:500}}.g2-dist-bar{width:100%;height:5px;border-radius:3px;overflow:hidden;display:flex;background:var(--surface-active);margin-bottom:8px;>span{display:block;height:100%}}.g2-dist-list{display:flex;flex-direction:column;gap:0;flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:none;-webkit-app-region:no-drag;app-region:no-drag;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--border) transparent;&::-webkit-scrollbar{width:5px}&::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}}.g2-dist-empty{color:var(--muted);opacity:.55;font-size:10px;font-style:italic;padding:6px 0;text-align:center}@media print{:host{display:none!important}}
|
|
2
|
+
`;var _t=`.g2-dist-item{display:grid;grid-template-columns:8px 1fr auto auto;gap:8px;align-items:center;font-size:10px;padding:2px 6px;min-height:20.5px;margin:0 -6px;background:transparent;border:0;border-radius:var(--ui-radius, 4px);font-family:inherit;text-align:left;width:calc(100% + 12px);&:hover{background:var(--graph-hover-bg)}&.on{background:var(--surface-active);.g2-dist-name{color:var(--accent)}}.g2-dist-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.g2-dist-name{color:var(--muted);font-family:ui-monospace,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.g2-dist-count{font-family:ui-monospace,monospace;color:var(--text)}.g2-dist-pct{font-family:ui-monospace,monospace;color:var(--muted);width:36px;text-align:right;opacity:.85}}
|
|
3
|
+
`;var Go=`.tree-count-chips{display:inline-flex;gap:.25rem;flex-wrap:wrap}.tree-count-chip{display:inline-block;font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;padding:.1rem .4rem;border-radius:3px;line-height:1.3;&.critical{background:var(--critical);color:#fff}&.high{background:var(--high);color:#fff}&.medium{background:var(--medium);color:#000}&.low{background:var(--low);color:var(--badge-low-text)}&.high_bug{background:var(--high-bug);color:#fff}&.bug{background:var(--bug);color:#fff}&.informational{background:var(--info);color:#fff}}
|
|
4
|
+
`;var Xo=`.toolbar{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem;padding:.6rem .75rem;background:var(--surface);backdrop-filter:var(--glass-blur);border:1px solid var(--border);border-radius:var(--ui-radius, 10px);box-shadow:var(--shadow-glass);font-size:.825rem;& label{color:var(--muted);margin-right:.15rem}& select{height:30px;box-sizing:border-box;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);padding:.25rem .4rem;font-size:.8rem;&:focus{border-color:var(--accent);outline:none}}& select.sort-select{padding:.3rem 1.7rem .3rem .55rem;min-width:8.5rem;font-weight:500;appearance:none;-webkit-appearance:none;background:transparent}:is(revalidate-filter,findings-sort){position:relative;display:inline-block;&:after{content:"";position:absolute;right:.7rem;top:50%;width:.35rem;height:.35rem;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:translateY(-70%) rotate(45deg);pointer-events:none}}& repo-filter{display:inline-block;min-width:0;max-width:100%}& analyzer-select{position:relative;display:inline-block}.analyzer-btn{display:inline-flex;align-items:center;gap:.45rem;height:30px;box-sizing:border-box;padding:.3rem .55rem;min-width:8.5rem;background:transparent;color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);font-family:inherit;font-size:.8rem;font-weight:500;&:hover{border-color:var(--accent)}&:focus-visible{border-color:var(--accent);outline:none}&.active{color:var(--accent)}.analyzer-btn-label{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:18rem}& svg{color:var(--muted);flex-shrink:0}}& range-slider{color:var(--accent);margin:0 .25rem}.conf-vals{color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.72rem;font-variant-numeric:tabular-nums;.dash{color:var(--muted);margin:0 .15rem}}& conf-filter{position:relative;display:inline-flex;align-items:center;height:30px;box-sizing:border-box;padding:0 .55rem;gap:.5rem;background:transparent;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);.conf-range-label{color:var(--muted);font-size:.7rem;font-weight:500;letter-spacing:.04em}& range-slider{margin:0}.conf-range{display:inline-flex;align-items:center;gap:.5rem}:is(.conf-range,.conf-range-label).replaced{visibility:hidden}:is(.conf-range,.conf-range-label).disabled{opacity:.35}& revalidate-filter{position:relative;display:inline-flex;align-items:center;flex:none;width:1.4rem;.sort-select{width:100%;border:0;height:auto;min-width:0;padding:0 .95rem 0 .2rem;font-size:.72rem;color:var(--muted);cursor:default;&:hover{color:var(--text)}}&:after{right:.25rem}&.replaces{position:static;.sort-select{position:absolute;inset:0 .55rem;width:auto;padding-left:0;color:var(--text)}&:after{right:.8rem}}.partial-cycle{position:absolute;right:1.75rem;top:50%;transform:translateY(-50%);z-index:1;padding:.1rem .3rem;border-radius:var(--ui-radius, 3px);font:inherit;font-size:.66rem;line-height:1.4;white-space:nowrap;cursor:default;--chip: var(--muted);color:var(--chip);border:1px solid rgb(from var(--chip) r g b / .45);background:rgb(from var(--chip) r g b / .1);&.included{--chip: var(--green)}&.excluded{--chip: var(--critical)}&.only{--chip: var(--yellow)}&:hover{background:rgb(from var(--chip) r g b / .22)}&:focus-visible{outline:1px solid var(--accent);outline-offset:1px}}}}& input[type=text]{background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);padding:.25rem .4rem;font-size:.8rem;flex:1;min-width:8rem;&:focus{border-color:var(--accent);outline:none}}.result-count{color:var(--muted);margin-left:auto}.checkbox-label{display:inline-flex;align-items:center;gap:.25rem;color:var(--muted);& input{margin:0}}}.analyzer-menu[popover]{position:fixed;inset:auto;margin:0;align-items:stretch;gap:.35rem;padding:.3rem;background:var(--bg);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);box-shadow:0 4px 12px #00000040;font-size:.825rem;-webkit-app-region:no-drag;app-region:no-drag}.analyzer-menu[popover]:not(:popover-open){display:none}.analyzer-menu[popover]:popover-open{display:flex}.analyzer-menu-sep{border-left:1px solid var(--border)}.analyzer-menu-col{display:flex;flex-direction:column;gap:1px;min-width:9rem;max-height:60vh;overflow-y:auto}.analyzer-menu-head{padding:.25rem .5rem .2rem;color:var(--muted);font-size:.68rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase}.analyzer-menu-item{display:flex;align-items:center;gap:.45rem;background:transparent;border:0;border-radius:var(--ui-radius, 3px);padding:.3rem .5rem;color:var(--text);text-align:left;font-family:inherit;font-size:.78rem;&:before{content:"";width:.8rem;flex-shrink:0}&.active:before{content:"\\2713";color:var(--accent)}&:hover{background:var(--surface)}&.zero{opacity:.45}.analyzer-menu-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:16rem}.analyzer-menu-count{color:var(--muted);font-size:.7rem;font-weight:600;font-variant-numeric:tabular-nums}}download-button{display:contents}.toolbar-export-btn{height:30px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;padding:0 .55rem;background:transparent;color:var(--muted);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);font-family:inherit;transition:background .12s,color .12s;&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}& svg{display:block}}.trash-btn{height:30px;box-sizing:border-box;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius, 4px);padding:.25rem .55rem;font-size:.8rem;font-family:inherit;&:hover{border-color:var(--accent)}&.active{border-color:var(--critical);color:var(--critical)}}.toolbar .trash-btn{margin-left:auto}triage-selector,slide-triage-tabs{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}.toolbar triage-selector{margin-left:auto}.toolbar-end{display:flex;align-items:center;gap:.75rem;margin-left:auto;&:not(:has(.toolbar-export-btn,annotation-filter,revalidation-switch)){display:none}}revalidation-switch{display:inline-flex;align-items:center;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}.revalidation-toggle{height:100%;&:has(+.revalidation-detail){border-right:1px solid var(--border)}}.revalidation-conflicts{padding:0 .6rem;background:transparent;border:none;color:var(--text);font:inherit;font-size:.78rem;cursor:default;&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.revalidation-detail{display:inline-flex;align-items:center;justify-content:center;width:30px;height:100%;box-sizing:border-box;padding:0;background:transparent;border:none;color:var(--muted);cursor:default;transition:background .12s,color .12s,opacity .12s;&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .06)}&.on{color:var(--accent);background:var(--surface-active)}&:disabled{opacity:.4;cursor:default}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.revalidation-upstream{display:inline-flex;align-items:center;justify-content:center;width:30px;height:100%;box-sizing:border-box;padding:0;background:transparent;border:none;color:var(--muted);cursor:default;transition:background .12s,color .12s;&:not(:first-child){border-left:1px solid var(--border)}&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .06)}&.on{color:var(--accent);background:var(--surface-active)}&:disabled{opacity:.4;cursor:default}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}triage-selector.is-empty{display:none}.triage-state-btn{background:transparent;border:none;color:var(--muted);padding:0 .55rem;display:inline-flex;align-items:center;gap:.35rem;transition:background .12s,color .12s;font-family:inherit;font-size:.8rem;cursor:default;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{background:var(--surface-active)}}.triage-state-btn.active.triage-state-deleted{color:var(--critical)}.triage-state-btn.active.triage-state-fixed{color:var(--green, #4ade80)}.triage-state-btn.active.triage-state-inprogress{color:var(--warning, #d97706)}.triage-state-btn.active.triage-state-invalid{color:var(--muted)}.triage-state-btn.active.triage-state-ignored{color:var(--accent, #2563eb)}entity-search{display:contents}view-mode-buttons{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden;.view-mode-btn{background:transparent;border:none;color:var(--muted);padding:.28rem .5rem;display:inline-flex;align-items:center;justify-content:center;transition:background .12s,color .12s;font-family:inherit;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{color:var(--accent);background:var(--surface-active)}& svg{display:block}}}:is(.revalidation-detail,.revalidation-upstream,.view-mode-btn){position:relative}:is(.revalidation-detail.on,.revalidation-upstream.on,.view-mode-btn.active,.g2-layout-tabs button[aria-pressed=true]):before{content:var(--selected-icon-ring-content, none);position:absolute;left:50%;top:50%;width:22px;height:22px;box-sizing:border-box;border:1px solid currentcolor;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}source-filter{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden;.source-chip{background:transparent;border:none;color:var(--muted);padding:0 .55rem;display:inline-flex;align-items:center;transition:background .12s,color .12s;font-family:inherit;font-size:.75rem;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{color:var(--accent);background:var(--surface-active)}}}severity-mode-switch{display:inline-flex;align-items:center;gap:.4rem;height:30px;box-sizing:border-box;.severity-mode-label{color:var(--muted);font-size:.7rem;font-weight:500;letter-spacing:.04em}.severity-mode-chips{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}.severity-mode-chip{background:transparent;border:none;color:var(--muted);padding:0 .55rem;display:inline-flex;align-items:center;transition:background .12s,color .12s;font-family:inherit;font-size:.75rem;cursor:default;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.active{color:var(--accent);background:var(--surface-active)}}}annotation-filter{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden;.annotation-chip{position:relative;background:transparent;border:none;color:var(--muted);padding:0 .45rem;display:inline-flex;align-items:center;transition:background .12s,color .12s;cursor:default;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}&.sel-with,&.sel-without{color:var(--accent);background:var(--surface-active)}&.sel-with .flag-cloth{fill:var(--accent)}&.sel-without:after{content:"";position:absolute;left:18%;right:18%;top:50%;height:1.5px;background:currentcolor;border-radius:1px;transform:rotate(-20deg);transform-origin:center;pointer-events:none}& svg{display:block}}}.toolbar-row{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center}.search-row{display:inline-flex;align-items:center;gap:.65rem;flex:1 1 14rem;min-width:12rem}toolbar-search,.toolbar-search{display:inline-flex;align-items:center;gap:.5rem;flex:1;min-width:0;height:30px;box-sizing:border-box;padding:0 .65rem;background:var(--bg);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);&:has(input:focus){border-color:var(--accent)}>svg{color:var(--muted);flex-shrink:0}&[kind] input[type=text],&.toolbar-search input[type=text]{flex:1;min-width:0;background:transparent;border:0;outline:none;color:var(--text);font:inherit;font-size:.8rem;padding:0;&:focus{border:0}&::placeholder{color:var(--muted)}&:focus::placeholder{color:transparent}&::-webkit-search-cancel-button{display:none}}}.search-negate-btn{flex-shrink:0;width:20px;height:20px;display:grid;place-items:center;background:transparent;color:var(--muted);border:0;border-radius:var(--ui-radius, 3px);padding:0;transition:background .12s,color .12s;& svg{width:13px;height:13px}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .08)}&.active{color:var(--accent);background:rgb(from var(--text) r g b / .1)}}@media(width<=1200px){.toolbar-row.sev-row .search-row{flex-basis:100%}}severity-chips{display:inline-flex;height:30px;box-sizing:border-box;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);overflow:hidden}severity-chips>.sev-chip{display:inline-flex;align-items:center;gap:.35rem;background:transparent;border:0;padding:0 .4rem;color:var(--muted);font-family:inherit;font-size:.8rem;transition:background .12s,color .12s;&:not(:last-child){border-right:1px solid var(--border)}&:hover{color:var(--text);background:rgb(from var(--text) r g b / .06)}.sd{width:8px;height:8px;border-radius:2px;flex-shrink:0;background:currentcolor}}:is(.sev-chip,.triage-state-btn){.n{align-self:flex-start;margin:1px -5px 0;color:var(--muted);font-variant-numeric:tabular-nums;font-size:8.5px;font-weight:600;background:var(--bg);border-radius:999px;padding:0 3px;min-width:11px;text-align:center;line-height:11px}&.active .n{color:var(--text)}}severity-chips>button.sev-chip{&.active{color:var(--text)}&.critical .sd{background:var(--critical)}&.high .sd{background:var(--high)}&.medium .sd{background:var(--medium)}&.low .sd{background:var(--low)}&.high_bug .sd{background:var(--high-bug)}&.bug .sd{background:var(--bug)}&.informational .sd{background:var(--info)}&.critical.active{background:rgb(from var(--critical) r g b / .25)}&.high.active{background:rgb(from var(--high) r g b / .25)}&.medium.active{background:rgb(from var(--medium) r g b / .25)}&.low.active{background:rgb(from var(--low) r g b / .25)}&.high_bug.active{background:rgb(from var(--high-bug) r g b / .25)}&.bug.active{background:rgb(from var(--bug) r g b / .25)}&.informational.active{background:rgb(from var(--info) r g b / .25)}}triage-filter{display:inline-flex;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:var(--ui-radius, 6px);padding:3px;height:30px;gap:1px;& button{width:22px;height:22px;background:transparent;border:0;border-radius:var(--ui-radius, 4px);padding:0;display:grid;place-items:center;position:relative;transition:background .12s;&:hover{background:rgb(from var(--text) r g b / .06)}&.active{background:rgb(from var(--text) r g b / .08);box-shadow:0 0 0 1px var(--border)}}.td{width:12px;height:12px;border-radius:50%;border:1.5px solid currentcolor;background:transparent;transition:background .12s}& button.active .td{background:currentcolor}.td.none{border-style:dashed;color:var(--muted)}.td.r{color:#fc5855}.td.b{color:#30aff8}.td.g{color:#68c36d}.td.x{color:#6e7278}.count{position:absolute;top:-2px;right:-2px;background:var(--bg);color:var(--muted);font-size:8.5px;font-weight:600;border-radius:999px;padding:0 3px;min-width:11px;text-align:center;line-height:11px;font-variant-numeric:tabular-nums}}
|
|
5
|
+
`;var to=globalThis,qo=e=>e,At=to.trustedTypes,Wo=At?At.createPolicy("lit-html",{createHTML:e=>e}):void 0,oo="$lit$",Ye=`lit$${Math.random().toFixed(9).slice(2)}$`,no="?"+Ye,_i=`<${no}>`,at=document,Rt=()=>at.createComment(""),vt=e=>e===null||typeof e!="object"&&typeof e!="function",io=Array.isArray,en=e=>io(e)||typeof e?.[Symbol.iterator]=="function",eo=`[
|
|
6
|
+
\f\r]`,xt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yo=/-->/g,Ko=/>/g,rt=RegExp(`>|${eo}(?:([^\\s"'>=/]+)(${eo}*=${eo}*(?:[^
|
|
7
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Zo=/'/g,Jo=/"/g,tn=/^(?:script|style|textarea|title)$/i,ro=e=>(t,...o)=>({_$litType$:e,strings:t,values:o}),Er=ro(1),Pr=ro(2),zr=ro(3),Ne=Symbol.for("lit-noChange"),xe=Symbol.for("lit-nothing"),Qo=new WeakMap,st=at.createTreeWalker(at,129);function on(e,t){if(!io(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wo!==void 0?Wo.createHTML(t):t}var nn=(e,t)=>{let o=e.length-1,n=[],i,s=t===2?"<svg>":t===3?"<math>":"",l=xt;for(let g=0;g<o;g++){let p=e[g],d,u,r=-1,S=0;for(;S<p.length&&(l.lastIndex=S,u=l.exec(p),u!==null);)S=l.lastIndex,l===xt?u[1]==="!--"?l=Yo:u[1]!==void 0?l=Ko:u[2]!==void 0?(tn.test(u[2])&&(i=RegExp("</"+u[2],"g")),l=rt):u[3]!==void 0&&(l=rt):l===rt?u[0]===">"?(l=i??xt,r=-1):u[1]===void 0?r=-2:(r=l.lastIndex-u[2].length,d=u[1],l=u[3]===void 0?rt:u[3]==='"'?Jo:Zo):l===Jo||l===Zo?l=rt:l===Yo||l===Ko?l=xt:(l=rt,i=void 0);let y=l===rt&&e[g+1].startsWith("/>")?" ":"";s+=l===xt?p+_i:r>=0?(n.push(d),p.slice(0,r)+oo+p.slice(r)+Ye+y):p+Ye+(r===-2?g:y)}return[on(e,s+(e[o]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]},yt=class e{constructor({strings:t,_$litType$:o},n){let i;this.parts=[];let s=0,l=0,g=t.length-1,p=this.parts,[d,u]=nn(t,o);if(this.el=e.createElement(d,n),st.currentNode=this.el.content,o===2||o===3){let r=this.el.content.firstChild;r.replaceWith(...r.childNodes)}for(;(i=st.nextNode())!==null&&p.length<g;){if(i.nodeType===1){if(i.hasAttributes())for(let r of i.getAttributeNames())if(r.endsWith(oo)){let S=u[l++],y=i.getAttribute(r).split(Ye),m=/([.?@])?(.*)/.exec(S);p.push({type:1,index:s,name:m[2],strings:y,ctor:m[1]==="."?Ct:m[1]==="?"?Tt:m[1]==="@"?Lt:ct}),i.removeAttribute(r)}else r.startsWith(Ye)&&(p.push({type:6,index:s}),i.removeAttribute(r));if(tn.test(i.tagName)){let r=i.textContent.split(Ye),S=r.length-1;if(S>0){i.textContent=At?At.emptyScript:"";for(let y=0;y<S;y++)i.append(r[y],Rt()),st.nextNode(),p.push({type:2,index:++s});i.append(r[S],Rt())}}}else if(i.nodeType===8)if(i.data===no)p.push({type:2,index:s});else{let r=-1;for(;(r=i.data.indexOf(Ye,r+1))!==-1;)p.push({type:7,index:s}),r+=Ye.length-1}s++}}static createElement(t,o){let n=at.createElement("template");return n.innerHTML=t,n}};function lt(e,t,o=e,n){if(t===Ne)return t;let i=n!==void 0?o._$Co?.[n]:o._$Cl,s=vt(t)?void 0:t._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(e),i._$AT(e,o,n)),n!==void 0?(o._$Co??=[])[n]=i:o._$Cl=i),i!==void 0&&(t=lt(e,i._$AS(e,t.values),i,n)),t}var It=class{constructor(t,o){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=o}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:o},parts:n}=this._$AD,i=(t?.creationScope??at).importNode(o,!0);st.currentNode=i;let s=st.nextNode(),l=0,g=0,p=n[0];for(;p!==void 0;){if(l===p.index){let d;p.type===2?d=new wt(s,s.nextSibling,this,t):p.type===1?d=new p.ctor(s,p.name,p.strings,this,t):p.type===6&&(d=new Et(s,this,t)),this._$AV.push(d),p=n[++g]}l!==p?.index&&(s=st.nextNode(),l++)}return st.currentNode=at,i}p(t){let o=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,o),o+=n.strings.length-2):n._$AI(t[o])),o++}},wt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,o,n,i){this.type=2,this._$AH=xe,this._$AN=void 0,this._$AA=t,this._$AB=o,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,o=this._$AM;return o!==void 0&&t?.nodeType===11&&(t=o.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,o=this){t=lt(this,t,o),vt(t)?t===xe||t==null||t===""?(this._$AH!==xe&&this._$AR(),this._$AH=xe):t!==this._$AH&&t!==Ne&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):en(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==xe&&vt(this._$AH)?this._$AA.nextSibling.data=t:this.T(at.createTextNode(t)),this._$AH=t}$(t){let{values:o,_$litType$:n}=t,i=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=yt.createElement(on(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(o);else{let s=new It(i,this),l=s.u(this.options);s.p(o),this.T(l),this._$AH=s}}_$AC(t){let o=Qo.get(t.strings);return o===void 0&&Qo.set(t.strings,o=new yt(t)),o}k(t){io(this._$AH)||(this._$AH=[],this._$AR());let o=this._$AH,n,i=0;for(let s of t)i===o.length?o.push(n=new e(this.O(Rt()),this.O(Rt()),this,this.options)):n=o[i],n._$AI(s),i++;i<o.length&&(this._$AR(n&&n._$AB.nextSibling,i),o.length=i)}_$AR(t=this._$AA.nextSibling,o){for(this._$AP?.(!1,!0,o);t!==this._$AB;){let n=qo(t).nextSibling;qo(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ct=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,o,n,i,s){this.type=1,this._$AH=xe,this._$AN=void 0,this.element=t,this.name=o,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=xe}_$AI(t,o=this,n,i){let s=this.strings,l=!1;if(s===void 0)t=lt(this,t,o,0),l=!vt(t)||t!==this._$AH&&t!==Ne,l&&(this._$AH=t);else{let g=t,p,d;for(t=s[0],p=0;p<s.length-1;p++)d=lt(this,g[n+p],o,p),d===Ne&&(d=this._$AH[p]),l||=!vt(d)||d!==this._$AH[p],d===xe?t=xe:t!==xe&&(t+=(d??"")+s[p+1]),this._$AH[p]=d}l&&!i&&this.j(t)}j(t){t===xe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Ct=class extends ct{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===xe?void 0:t}},Tt=class extends ct{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==xe)}},Lt=class extends ct{constructor(t,o,n,i,s){super(t,o,n,i,s),this.type=5}_$AI(t,o=this){if((t=lt(this,t,o,0)??xe)===Ne)return;let n=this._$AH,i=t===xe&&n!==xe||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==xe&&(n===xe||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Et=class{constructor(t,o,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=o,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){lt(this,t)}},rn={M:oo,P:Ye,A:no,C:1,L:nn,R:It,D:en,V:lt,I:wt,H:ct,N:Tt,U:Lt,B:Ct,F:Et},Ai=to.litHtmlPolyfillSupport;Ai?.(yt,wt),(to.litHtmlVersions??=[]).push("3.3.3");var Ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Pt=e=>(...t)=>({_$litDirective$:e,values:t}),gt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,o,n){this._$Ct=t,this._$AM=o,this._$Ci=n}_$AS(t,o){return this.update(t,o)}update(t,o){return this.render(...o)}};var{I:Br}=rn;var sn=e=>e.strings===void 0;var Ri={},an=(e,t=Ri)=>e._$AH=t;var ln=Pt(class extends gt{constructor(e){if(super(e),e.type!==Ke.PROPERTY&&e.type!==Ke.ATTRIBUTE&&e.type!==Ke.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!sn(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Ne||t===xe)return t;let o=e.element,n=e.name;if(e.type===Ke.PROPERTY){if(t===o[n])return Ne}else if(e.type===Ke.BOOLEAN_ATTRIBUTE){if(!!t===o.hasAttribute(n))return Ne}else if(e.type===Ke.ATTRIBUTE&&o.getAttribute(n)===t+"")return Ne;return an(e),t}});var kt=class extends gt{constructor(t){if(super(t),this.it=xe,t.type!==Ke.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===xe||t==null)return this._t=void 0,this.it=t;if(t===Ne)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let o=[t];return o.raw=o,this._t={_$litType$:this.constructor.resultType,strings:o,values:[]}}};kt.directiveName="unsafeHTML",kt.resultType=1;var $t=Pt(kt);var cn='<svg class="file-icon" viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2 2 5v6l6 3 6-3V5L8 2Z"/><path d="M2 5l6 3 6-3"/><path d="M8 8v6"/></svg>';var dn='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="m4.5 4.5 7 2-5 5z"/><circle cx="4.5" cy="4.5" r="2" fill="currentColor"/><circle cx="11.5" cy="6.5" r="2" fill="currentColor"/><circle cx="6.5" cy="11.5" r="2" fill="currentColor"/></svg>',un='<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor" aria-hidden="true"><rect x="1" y="1.5" width="14" height="3" rx=".5"/><rect x="1" y="6.5" width="8" height="3" rx=".5"/><rect x="11" y="6.5" width="4" height="3" rx=".5"/><rect x="1" y="11.5" width="4" height="3" rx=".5"/><rect x="7" y="11.5" width="8" height="3" rx=".5"/></svg>',pn='<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M1 1h4v4H1zm5 5h4v4H6zm5 5h4v4h-4z"/><path d="M6 1h4v4H6zm5 0h4v4h-4zM1 6h4v4H1zm10 0h4v4h-4zM1 11h4v4H1zm5 0h4v4H6z" opacity=".35"/></svg>',fn='<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="8" cy="2.5" r="1.5" fill="currentColor"/><circle cx="3" cy="13" r="1.5" fill="currentColor"/><circle cx="8" cy="13" r="1.5" fill="currentColor"/><circle cx="13" cy="13" r="1.5" fill="currentColor"/><path d="M8 4v3M8 7H3m5 0h5M3 7v4M8 7v4M13 7v4"/></svg>';var gn='<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>',hn='<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" aria-hidden="true"><path d="M1 8h3.5m7 0H15"/><circle cx="8" cy="8" r="3.5"/></svg>';var Ee=["critical","high","medium","low","high_bug","bug","informational"];var so=["revalidation","refuted","unreachable","confirmed","partial","unknown"],ts=new Set(so);var as=new TextEncoder,ls=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});var hs=Object.freeze({manage:"/manage","manage-bundles":"/manage/bundle","manage-scans":"/manage/scans","manage-reports":"/manage/report","manage-repos":"/manage/repositories","admin-users":"/manage/users","manage-teams":"/manage/team","manage-import":"/manage/import","manage-links":"/manage/links","manage-deduplication":"/manage/deduplication","manage-history":"/manage/history"});function ao(e){return new RegExp(`(^|/)${e}/`,"u")}function Xi(e){return new RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,"u")}var Os=ao("node_modules"),Fs=ao("vendor"),lo="node_modules",Ns=ao(lo),Bs=Xi(lo);function zt(){return lo}function Ze(e){return typeof e!="number"||!Number.isFinite(e)?null:`${e.toLocaleString()} B`}function qi(){return{showAll:!1,packagesView:!1,dependencyPackagesView:!1,bundleLayout:"graph",bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:"issues",edgeOpacity:.22,nodeSize:1,showLabels:!1,selectedSeverities:new Set,selectedColors:new Set,pathFilter:"",hidden:new Set,solo:null,graphState:null,layoutCache:null}}var tt=qi(),$=new Proxy(tt,{get(e,t){return tt[t]},set(e,t,o){return tt[t]=o,!0},has(e,t){return t in tt},deleteProperty(e,t){return delete tt[t]},ownKeys(){return Reflect.ownKeys(tt)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(tt,t)}});function xn(){$.graphState?._cleanup&&$.graphState._cleanup(),$.graphState=null}function Wi(e){e&&(tt=e)}function Ot(e){if(!e)return null;let t=zt(),o=new RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,"u"),n=e.match(o);return n?n[1]:"__own__"}var Yi=["#4e9af1","#f28e2b","#59a14f","#e15759","#76b7b2","#edc948","#b07aa1","#ff9da7","#9c755f","#5cd1e5","#f1ce63","#d37295","#a0cbe8","#86bcb6","#8cd17d","#b6992d","#499894","#e15759","#e879c7","#d4a6c8"],Ki=["#2f8aef","#d2691e","#2ea043","#e63946","#2e9a92","#b88817","#9560e8","#d24a9c","#8a5d40","#0891b2","#a07a14","#c14e8e","#1f7ad0","#549b94","#3fb95f","#a07a14","#2a8278","#cb2c40","#c026d3","#965f93"];function Zi(){if(typeof document>"u")return!1;let e=document.body?.classList;return!!e&&(e.contains("theme-light")||e.contains("theme-pink")||e.contains("theme-paper"))}var co=new Map;function be(e){let t=Zi(),o=t?Ki:Yi,n=e??"__own__",i=`${t?"l":"d"}:${n}`;if(co.has(i))return co.get(i);let s=0;for(let d of n)s=s*37+d.codePointAt(0)|0;let g=((s%o.length+o.length)%o.length*7+3)%o.length,p=o[g];return co.set(i,p),p}function vn(e,{packageDir:t=null}={}){if(t){if(t!=="."){let o=t.match(/(?:^|\/)node_modules\/(@[^/]+\/[^/]+|[^/]+)$/u);return o&&o[1]!==".pnpm"?o[1]:t}}else{let o=/(?:^|\/)(?:node_modules|dependencies)\/(@[^/]+\/[^/]+|[^/]+)/gu,n;for(;(n=o.exec(e))!==null;)if(n[1]!==".pnpm")return n[1]}return"__own__"}function Ft(e){return e==="__own__"?"Own source":typeof e!="string"?e:e.match(/^(?:.*\/)?vendor\/(.+)$/u)?.[1]??e}function yn(e){if(!e)return 0;let t=0;for(let o of Ee)t+=e[o]??0;return t}function wn(e){let t=new Map;for(let o=0;o<e.length;o++){let n=e[o];t.has(n.a)||t.set(n.a,[]),t.has(n.b)||t.set(n.b,[]),t.get(n.a).push(o),t.get(n.b).push(o)}return t}function kn(e){if(!e)return null;for(let t of Ee)if((e[t]??0)>0)return t;return null}function $n(e,t,o,n,i,s,l,g={}){let p=g.pkgOf??Ot,d=new Set(t),u=new Map,r=new Map;for(let x of t){let _=(e[x].imports??[]).filter(j=>d.has(j));u.set(x,_);for(let j of _)r.has(j)||r.set(j,[]),r.get(j).push(x)}let S=t.map(x=>{let _=o.get(x),j=n?.get(x)??null,U=yn(_),I=p(x)??"__own__",c=kn(_);return{id:x,file:x,pkg:I,x:0,y:0,deg:0,issue:c,totalIssues:U,own:_,subtree:j,size:typeof e[x]?.size=="number"?e[x].size:null,severitySet:i?.get(x)??null,colorSet:s?.get(x)??null,findings:l?.get(x)??null,isHub:!1,label:x.split("/").pop()??x}}),y=new Map(S.map(x=>[x.file,x])),m=new Map;for(let x of t)for(let _ of u.get(x)??[]){let[j,U]=x<_?[x,_]:[_,x],I=`${j}\0${U}`,c=m.get(I);if(!c){let R=y.get(j),E=y.get(U);if(!R||!E)continue;c={a:j,b:U,cross:R.pkg!==E.pkg,fromLo:!1,fromHi:!1},m.set(I,c),R.deg++,E.deg++}x===j?c.fromLo=!0:c.fromHi=!0}let T=[...m.values()],a=wn(T),v=new Map;for(let x of S)v.set(x.pkg,(v.get(x.pkg)??0)+1);let k=[...v.entries()].toSorted((x,_)=>_[1]-x[1]).map(([x])=>x),f=new Map;for(let x of S)f.has(x.pkg)||f.set(x.pkg,[]),f.get(x.pkg).push(x);let w={files:t,nodes:S,nodeByFile:y,edges:T,adj:a,importsOf:u,importedBy:r,packages:k,pkgCount:v,byPkg:f};return Ji(w),w}function Ji(e){for(let t of e.nodes)t.isHub=!1;for(let t of e.edges)t.cross&&(t.fromLo&&(e.nodeByFile.get(t.b).isHub=!0),t.fromHi&&(e.nodeByFile.get(t.a).isHub=!0));for(let t of e.nodes){let o=e.importedBy.get(t.file);(!o||o.length===0)&&(t.isHub=!0)}}function Nt(e){let t=e.packages.map(g=>{let p=e.byPkg.get(g)??[],d={};for(let a of Ee)d[a]=0;let u=new Set,r=new Set,S=[],y=0,m=0,T=!1;for(let a of p){if(y+=a.totalIssues,a.own)for(let v of Ee)d[v]+=a.own[v]??0;if(a.severitySet)for(let v of a.severitySet)u.add(v);if(a.colorSet)for(let v of a.colorSet)r.add(v);typeof a.size=="number"&&(m+=a.size,T=!0),S.push(a.file)}return{file:g,pkg:g,label:Be(g),fileCount:p.length,size:T?m:null,own:d,totalIssues:y,issue:kn(d),severitySet:u.size>0?u:null,colorSet:r.size>0?r:null,pathText:S.join(`
|
|
8
|
+
`).toLowerCase(),isHub:!0,x:0,y:0,deg:0}}),o=new Map(t.map(g=>[g.pkg,g])),n=new Map;for(let g of e.edges){if(!g.cross)continue;let p=e.nodeByFile.get(g.a)?.pkg,d=e.nodeByFile.get(g.b)?.pkg;if(!p||!d||p===d)continue;let[u,r]=p<d?[p,d]:[d,p],S=`${u}\0${r}`,y=n.get(S);y||(y={a:u,b:r,cross:!0,count:0,fromLo:!1,fromHi:!1},n.set(S,y),o.get(u).deg++,o.get(r).deg++),y.count++;let m=p===u;g.fromLo&&(m?y.fromLo=!0:y.fromHi=!0),g.fromHi&&(m?y.fromHi=!0:y.fromLo=!0)}let i=[...n.values()],s=wn(i),l=new Map(t.map(g=>[g.pkg,[]]));for(let g of i)g.fromLo&&l.get(g.a).push(g.b),g.fromHi&&l.get(g.b).push(g.a);return{nodes:t,byPkg:o,nodeByFile:o,edges:i,adj:s,importsOf:l}}function Be(e){return Ft(e)}function Bt(e,t){if(!t||t==="/"||t==="__own__")return e;for(let o of["node_modules","dependencies",zt()]){let n=o+"/"+t+"/",i=e.indexOf(n);if(i>=0)return e.slice(i+n.length)}return e.startsWith(t+"/")?e.slice(t.length+1):e}var Mn={package:"@babel/core",path:/^lib\/config\//u},uo={package:"@babel/core",path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},An=Object.freeze([{id:"react-native-codegen-discovery",reason:"Codegen discovers package metadata and React Native configuration.",from:{package:"react-native",path:/^scripts\/codegen\/generate-artifacts-executor\.js$/u},to:{path:/(?:^|\/)(?:package\.json|react-native\.config\.js)$/u}},{id:"react-native-release-version",reason:"The CLI release checker reads the installed React Native version.",from:{package:"@react-native-community/cli-tools",path:/^build\/releaseChecker\/index\.js$/u},to:{package:"react-native",path:/^package\.json$/u}},{id:"react-native-platform-config",reason:"React Native configuration loads platform CLIs supplied by the host project.",from:{package:"react-native",path:/^react-native\.config\.js$/u},to:{package:/^@react-native-community\/cli-platform-(?:android|ios)$/u,path:/^build\/index\.js$/u}},{id:"babel-project-config",reason:"Babel discovers project configuration.",from:Mn,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:"babel-typescript-preset",reason:"Babel configuration loads the TypeScript preset.",from:Mn,to:{package:"@babel/preset-typescript",path:/./u}},{id:"babel-react-native-preset",reason:"Babel config loaders load the configured React Native preset.",from:uo,to:{package:"@react-native/babel-preset",path:/^(?:src\/)?index\.js$/u}},{id:"babel-reanimated-plugin",reason:"Babel config loaders load the configured Reanimated plugin, including scoped copies.",from:uo,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:"babel-transform-plugin",reason:"Babel config loaders load configured transform plugins.",from:uo,to:{package:/^@babel\/plugin-transform-[^/]+$/u,path:/^lib\/index\.js$/u}},{id:"cosmiconfig-config",reason:"Cosmiconfig loads discovered configuration, including dependency configuration.",from:{package:"cosmiconfig",path:/^dist\/loaders\.js$/u},to:{path:/\.config\.js$/u}},{id:"import-fresh-own-config",reason:"import-fresh loads host-project configuration.",from:{package:"import-fresh",path:/./u},to:{path:/\.config\.js$/u},ownSourceOnly:!0}].map(e=>Object.freeze({...e,from:Object.freeze(e.from),to:Object.freeze(e.to)})));function Sn(e){return typeof e=="string"&&!e.includes("\\")&&!e.includes(":")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."&&t!=="node_modules")}function _n(e,t){let o=e.package;return o!==void 0&&t.ownSource===!0?!1:(o===void 0||(typeof o=="string"?o===t.package:o.test(t.package??"")))&&e.path.test(t.path)}function po(e,t){if(!(e?.ownSource===!0||!Sn(e?.path)||!Sn(t?.path)))return An.find(o=>(!o.ownSourceOnly||t.ownSource===!0)&&_n(o.from,e)&&_n(o.to,t))}function Rn(e,t){let n=e.split(/(?:^|\/)node_modules\//u).slice(1).at(-1)?.match(/^(@[^/]+\/[^/]+|[^/]+)\/(.+)$/u);return{package:n?.[1],path:n?.[2]??e.replace(/^\/+/u,""),ownSource:t??vn(e)==="__own__"}}function Mt(e,t,o,n){return!po(Rn(e,n),Rn(t,o))}function fo(e,t=o=>o.file){let o=new Map(e.nodes.map(i=>[i.file,i])),n=new Map(e.nodes.map(i=>[t(i),new Set]));for(let[i,s]of e.importsOf){let l=o.get(i);if(l)for(let g of s){let p=o.get(g);p&&Mt(l.origFile??i,p.origFile??g,e.ownSourceFiles?.has(g),e.ownSourceFiles?.has(i))&&n.get(t(l)).add(t(p))}}return n}var go=new WeakMap,ho=new WeakMap;function ht(e,t){return e.nodes.length<=100&&!t}function Ht(e,t){if(!ht(e,t))return Dt(e);if(ho.has(e))return ho.get(e);let o=new Map(e.nodes.map(s=>[s.file,[...new Set(e.importsOf.get(s.file)??[])]])),n=[];for(let[s,l]of o)for(let g of l)n.push({from:s,to:g});let i={...e,importsOf:o,cycleImportsOf:fo(e),directedEdges:n,fileLevel:!0};return ho.set(e,i),i}function Dt(e){if(go.has(e))return go.get(e);let t=Nt(e);if(t.cycleImportsOf=fo(e,o=>o.pkg),e.layerRoots?.appImports?.length>0){if(!t.byPkg.has("__own__")){let o={file:"__own__",pkg:"__own__",label:"own source",fileCount:0,size:null,totalIssues:0,deg:0,x:0,y:0};t.nodes.push(o),t.byPkg.set(o.pkg,o)}t.importsOf.set("__own__",[...new Set([...t.importsOf.get("__own__")??[],...e.layerRoots.appImports])].filter(o=>o!=="__own__"&&t.byPkg.has(o))),t.cycleImportsOf.set("__own__",new Set([...t.cycleImportsOf.get("__own__")??[],...e.layerRoots.appImports].filter(o=>o!=="__own__"&&t.byPkg.has(o))))}t.importedBy=new Map(t.nodes.map(o=>[o.pkg,[]])),t.directedEdges=[];for(let[o,n]of t.importsOf)for(let i of n)t.importedBy.get(i).push(o),t.directedEdges.push({from:o,to:i});for(let o of t.nodes)o.deg=(t.importsOf.get(o.pkg)?.length??0)+t.importedBy.get(o.pkg).length;return go.set(e,t),t}function xo(e,t,o=null){let n=t.showBundleLayouts&&$.bundleLayout==="layers",i=t.showBundleLayouts&&$.bundleLayout==="matrix",s=t.showBundleLayouts&&$.bundleLayout==="dependencies",l=t.showBundleLayouts?F`<div class="g2-layout-tabs" role="group" aria-label="Bundle layout"><button type="button" data-g2-layout="graph" aria-label="Graph" aria-pressed="${String(!n&&!i&&!s)}">${$t(dn)}</button> <button type="button" data-g2-layout="layers" aria-label="Layers" aria-pressed="${String(!!n)}">${$t(un)}</button> <button type="button" data-g2-layout="matrix" aria-label="Matrix" aria-pressed="${String(!!i)}">${$t(pn)}</button> <button type="button" data-g2-layout="dependencies" aria-label="Dependencies" aria-pressed="${String(!!s)}">${$t(fn)}</button></div>`:null,g=t.extraTopRow,p=t.hideAllFiles??!1,d=t.triageCounts??{inprogress:0,fixed:0,invalid:0,deleted:0,ignored:0},u=t.triageStates??["inprogress","fixed","invalid","deleted","ignored"],r={};for(let x of Ee)r[x]=0;for(let x of e.nodes)if(x.severitySet)for(let _ of x.severitySet)r[_]!==void 0&&r[_]++;let S=Ee.some(x=>r[x]>0||$.selectedSeverities.has(x)),y=["none","red","blue","green","gray"],m={none:0,red:0,blue:0,green:0,gray:0};for(let x of e.nodes)if(x.colorSet)for(let _ of x.colorSet)m[_]!==void 0&&m[_]++;let T=y.some(x=>m[x]>0||$.selectedColors.has(x)),a=F`<triage-selector variant="graph" .counts="${d}" .states="${u}"></triage-selector>`,v=p?null:F`<mode-switch label="All files" .checked="${$.showAll}" data-g2-show-all></mode-switch>`,f=(s?e.nodes.length<=100:!n&&!i&&(t.showPackagesView??!1))?F`<mode-switch label="Packages" .checked="${s?$.dependencyPackagesView:$.packagesView}" data-g2-packages-view></mode-switch>`:null,w=e.reasons?.length>0?F`<label class="g2-reason-filter"><select aria-label="Filter files" .value="${ln($.bundleReason??"")}" @change="${x=>x.currentTarget.dispatchEvent(new CustomEvent("bundle-graph-reason-change",{detail:{reason:x.currentTarget.value||null},bubbles:!0,composed:!0}))}"><option value="" ?selected="${$.bundleReason===null}">All</option>${e.reasons.map(x=>F`<option value="${x}" ?selected="${x===$.bundleReason}">${x}</option>`)}</select></label>`:null;return F`<div class="graph2-topbar">${g?F`<div class="graph2-topbar-row graph2-topbar-row-extra toolbar-row">${g} ${v} ${f}<div class="g2-spacer"></div>${a}</div>`:null}<div class="graph2-topbar-row graph2-topbar-row-main toolbar-row sev-row">${l} ${w} ${S?F`<severity-chips .counts="${r}" .selected="${[...$.selectedSeverities]}" kind="graph"></severity-chips>`:null} ${T?F`<triage-filter .counts="${m}" .selected="${[...$.selectedColors]}" kind="graph"></triage-filter>`:null}<div class="toolbar-search g2-path-filter-wrap"><svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg> <input type="text" class="g2-path-filter" id="g2-path-filter" placeholder="filter path/package…" .value="${$.pathFilter}"> <button type="button" class="g2-path-filter-clear" id="g2-path-filter-clear" aria-label="Clear filter">✕</button></div>${g?null:v} ${g?null:f} ${o}<div class="g2-spacer"></div>${g?null:a} <button type="button" class="g2-icon-btn" id="g2-fullscreen" aria-label="Toggle fullscreen">⛶</button></div></div>`}function Qi(e,t){let o=e.split("/").filter(Boolean),n=t.split("/").filter(Boolean),i=0;for(;i<o.length&&i<n.length&&o[i]===n[i];)i++;let s=o.length-i,l=n.slice(i).join("/");return s===0?"./"+l:"../".repeat(s)+l}function er(e,t){if(!t&&t!=="")return e;let o=Qi(t,e);return o.length<e.length?o:e}function mo(e,t,o,n){let i=o.length;if(i===0)return F`<div class="g2-sel-section"><div class="g2-sel-section-label">${t} (${i})</div><div class="g2-sel-section-empty">none</div></div>`;let s=o.map(l=>({file:l,display:er(l,n)}));return s.sort((l,g)=>l.display.localeCompare(g.display)),F`<div class="g2-sel-section"><div class="g2-sel-section-label">${t} (${i})</div><ul class="g2-sel-file-list">${s.map(({file:l,display:g})=>{let p=e.nodeByFile.get(l),d=p?be(p.pkg):"#666";return F`<li><button type="button" class="g2-sel-file-link" data-g2-select="${l}"><span class="g2-sel-file-dot" style="${et({background:d})}"></span> <span class="g2-sel-file-path" data-tooltip-truncated data-tooltip="${l}">${g}</span></button></li>`})}</ul></div>`}function dt(e){if(!e)return F`<div class="g2-sel-section-empty">none</div>`;let o=["critical","high","medium","low","high_bug","bug","informational"].filter(n=>(e[n]??0)>0);return o.length===0?F`<div class="g2-sel-section-empty">none</div>`:F`<div class="tree-count-chips">${o.map(n=>F`<span class="${`tree-count-chip ${n}`}">${e[n]} ${n.replaceAll("_"," ")}</span>`)}</div>`}function In(e){let t=0;for(let d of e.edges)d.cross&&t++;let o=e.edges.length-t,n=0;for(let d of e.nodes)n+=d.totalIssues;let i=e.supportsLayers&&$.bundleLayout==="dependencies"&&!$.focusedPkg?Ht(e,$.dependencyPackagesView):null,s=i?.nodes.length??e.nodes.length,l=i?.directedEdges.length??e.edges.length,g=s===0?"0.0":(l*2/s).toFixed(1),p=Be($.focusedPkg);return F`<main class="graph2-stage"><canvas id="g2-canvas"></canvas>${$.focusedPkg?F`<div class="g2-stage-overlay"><button type="button" class="g2-back-btn" id="g2-back-to-full">← ${p}</button></div>`:null}<div id="g2-focus-overlay-slot" class="g2-stage-overlay-tr"></div><div class="g2-stage-stats">${!i||i.fileLevel?F`<span><b>${e.nodes.length}</b> files</span>`:null} <span><b>${i&&!i.fileLevel?i.nodes.length:e.packages.length}</b> packages</span> <span><b>${l}</b> ${i?"dependencies":F`edges (${o} intra · ${t} cross)`}</span> <span><b>${n}</b> issues</span> <span>avg degree <b>${g}</b></span></div><div class="g2-zoom-ctrl"><button id="g2-zoom-in" aria-label="Zoom in">+</button><div class="g2-zoom-pct" id="g2-zoom-pct">100%</div><button id="g2-zoom-out" aria-label="Zoom out">−</button> <button id="g2-zoom-fit" class="g2-zoom-fit-btn" aria-label="Fit to view">fit</button></div><div class="g2-tooltip" id="g2-tooltip"></div></main>`}function Cn(e){if(e.supportsLayers&&$.bundleLayout==="dependencies")return null;let t=null;if($.selected){let n=e.nodeByFile.get($.selected);n&&(t=n.pkg)}else $.solo&&(t=$.solo);if(!t||(e.pkgCount.get(t)??0)<=1||$.focusedPkg===t)return null;let o=Be(t);return F`<button type="button" class="g2-focus-pkg-btn" data-g2-focus-pkg="${t}" aria-label="${`Focus on ${o}'s graph`}" data-tooltip="${`Focus on ${o}'s graph`}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8 4.6 L4 11 M8 4.6 L12 11 M5 11.4 L11 11.4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><circle cx="8" cy="3.6" r="2" fill="currentColor"/><circle cx="3.6" cy="11.4" r="2" fill="currentColor"/><circle cx="12.4" cy="11.4" r="2" fill="currentColor"/></svg></button>`}function Tn(){return F`<aside class="graph2-right"><div class="g2-panel-title">Selection</div><div id="g2-selection-area"></div><div id="g2-top-pkgs-block"></div></aside>`}function Ln(e){if(e.supportsLayers&&$.bundleLayout==="dependencies"&&!$.focusedPkg&&!ht(e,$.dependencyPackagesView)){let i=Dt(e),s=i.nodes.toSorted((l,g)=>i.importedBy.get(g.pkg).length-i.importedBy.get(l.pkg).length||l.pkg.localeCompare(g.pkg)).map(l=>l.pkg);return F`<div class="g2-panel-title">Packages · importers</div>${bo(i,s,!0)}`}let t=$.showAll&&e.nodes.length>0&&e.nodes.every(i=>typeof i.size=="number"),o=e.nodes.some(i=>i.totalIssues>0),n=$.topPkgsTab;return n==="size"&&!t&&(n="files"),n==="issues"&&!o&&(n="files"),F`<div class="g2-panel-title g2-panel-title-row"><span>Packages</span><div class="g2-mini-tabs">${o?F`<button type="button" class="${ft({"g2-mini-tab":!0,on:n==="issues"})}" data-g2-top-pkgs="issues">Issues</button>`:null} <button type="button" class="${ft({"g2-mini-tab":!0,on:n==="files"})}" data-g2-top-pkgs="files">Files</button> ${t?F`<button type="button" class="${ft({"g2-mini-tab":!0,on:n==="size"})}" data-g2-top-pkgs="size">Size</button>`:null}</div></div>${nr(e,n)}`}function En(e,t={}){if(e.supportsLayers&&$.bundleLayout==="dependencies"&&!$.focusedPkg&&!ht(e,$.dependencyPackagesView))return ir(Dt(e),$.solo);let o=$.selected;if(o){let n=e.nodeByFile.get(o);return n?tr(e,n,o,t):F`<div class="g2-empty-state"><strong>File not in current view</strong>Adjust filters or pick another file.</div>`}return $.solo?$.solo==="__own__"&&!e.pkgCount.has("__own__")&&e.layerRoots?.appImports.length>0?F`<div class="g2-empty-state"><strong>App</strong>App source is not included in this view. Connections come from its recorded imports.</div>`:or(e,$.solo):F`<div class="g2-empty-state">Click a node or a package row to inspect.</div>`}function tr(e,t,o,n){let i=be(t.pkg),s=Be(t.pkg),l=Bt(o,t.pkg),g=e.importedBy.get(o)??[],p=e.importsOf.get(o)??[],d=o.lastIndexOf("/"),u=d>=0?o.slice(0,d):"";return F`<div class="g2-selection-card"><div class="g2-sel-file-head"><div class="g2-sel-path">${l}</div><div class="g2-sel-pkg-row"><span class="g2-sel-dot" style="${et({"--dot":i,background:i})}"></span> <span class="g2-sel-pkg">${s}</span></div></div><div class="g2-sel-fullpath" data-tooltip-truncated data-tooltip="${o}">${o}</div>${Ze(t.size)?F`<div class="g2-sel-size">${Ze(t.size)}</div>`:null}<div class="g2-sel-section"><div class="g2-sel-section-label">Own findings</div>${dt(t.own)}</div><div class="g2-sel-section"><div class="g2-sel-section-label">Subtree findings</div>${dt(t.subtree)}</div><div class="g2-sel-jumps">${t.totalIssues>0?F`<button type="button" class="g2-sel-jump" data-g2-jump-findings="${o}">Findings →</button>`:null} ${n.isBundleContext?t.origFile?F`<button type="button" class="g2-sel-jump" data-bundle-view-source="${t.origFile}">View source →</button>`:null:F`<button type="button" class="g2-sel-jump" data-g2-jump-file="${o}">Files →</button>`}</div>${mo(e,"Imported by",g,u)} ${mo(e,"Imports",p,u)}</div>`}function or(e,t){let o=e.nodes.filter(r=>r.pkg===t),n=o.length;if(n===0)return F`<div class="g2-empty-state"><strong>Package has no files in view</strong> Toggle "All files" to widen the file set, or pick another package.</div>`;let i=be(t),s=Be(t),l={};for(let r of Ee)l[r]=0;for(let r of o)if(r.own)for(let S of Ee)l[S]+=r.own[S]??0;let g=0,p=0;for(let r of e.edges){let S=e.nodeByFile.get(r.a),y=e.nodeByFile.get(r.b);!S||!y||(S.pkg===t&&y.pkg===t?p++:(S.pkg===t||y.pkg===t)&&g++)}let d=0;for(let r of o)r.isHub&&d++;let u=new Set;for(let r of o)for(let S of e.importedBy.get(r.file)??[]){let y=e.nodeByFile.get(S);y&&y.pkg!==t&&u.add(S)}return F`<div class="g2-selection-card"><div class="g2-sel-head"><span class="g2-sel-dot" style="${et({"--dot":i,background:i})}"></span> <span class="g2-sel-id">${s}</span> <span class="g2-sel-grp">package</span></div><div class="g2-sel-body"><div class="g2-sel-row"><span class="k">Files</span><span class="v">${n}</span></div><div class="g2-sel-row"><span class="k">Hubs</span><span class="v">${d}</span></div><div class="g2-sel-row"><span class="k">Intra edges</span><span class="v">${p}</span></div><div class="g2-sel-row"><span class="k">Cross edges</span><span class="v">${g}</span></div></div><div class="g2-sel-section"><div class="g2-sel-section-label">Findings</div>${dt(l)}</div>${mo(e,"Imported by",[...u])}</div>`}function nr(e,t){let o=e.nodes.length||1,n=t??$.topPkgsTab,i=$.selectedSeverities,s=$.selectedColors,l=i.size>0,g=s.size>0,p=l||g,d=new Map,u=new Map,r=0,S=0;for(let a of e.nodes){let v;if(p){if(v=0,a.findings)for(let k of a.findings)l&&!i.has(k.severity)||g&&!s.has(k.color)||v++}else v=a.totalIssues;d.set(a.pkg,(d.get(a.pkg)??0)+v),r+=v,typeof a.size=="number"&&(u.set(a.pkg,(u.get(a.pkg)??0)+a.size),S+=a.size)}let y;n==="issues"?y=e.packages.filter(a=>(d.get(a)??0)>0).toSorted((a,v)=>{let k=d.get(a)??0,f=d.get(v)??0;return f!==k?f-k:(e.pkgCount.get(v)??0)-(e.pkgCount.get(a)??0)}):n==="size"?y=e.packages.filter(a=>(u.get(a)??0)>0).toSorted((a,v)=>{let k=u.get(a)??0,f=u.get(v)??0;return f!==k?f-k:(e.pkgCount.get(v)??0)-(e.pkgCount.get(a)??0)}):y=[...e.packages].toSorted((a,v)=>{let k=e.pkgCount.get(a)??0,f=e.pkgCount.get(v)??0;return f!==k?f-k:(d.get(v)??0)-(d.get(a)??0)});let m=a=>n==="issues"?r>0?((d.get(a)??0)/r*100).toFixed(2):"0":n==="size"?S>0?((u.get(a)??0)/S*100).toFixed(2):"0":(e.pkgCount.get(a)/o*100).toFixed(2),T=n==="issues"?"No packages with issues":n==="size"?"No packages with size":"No packages";return F`<div class="g2-dist-bar">${e.packages.map(a=>{let v=be(a);return F`<span style="${et({background:v,width:`${m(a)}%`})}"></span>`})}</div><div class="g2-dist-list">${y.length===0?F`<div class="g2-dist-empty">${T}</div>`:null} ${Qt(y,a=>a,a=>{let v=be(a),k=e.pkgCount.get(a)??0,f=d.get(a)??0,w=u.get(a)??0,x=n==="issues"?f:n==="size"?Ze(w):k,_=n==="issues"?r>0?(f/r*100).toFixed(1):"0.0":n==="size"?S>0?(w/S*100).toFixed(1):"0.0":(k/o*100).toFixed(1),j=Be(a),U=$.solo===a;return F`<button type="button" class="${ft({"g2-dist-item":!0,on:U})}" data-g2-pkg="${a}"><span class="g2-dist-dot" style="${et({background:v})}"></span><span class="g2-dist-name" data-tooltip-truncated data-tooltip="${j}">${j}</span><span class="g2-dist-count">${x}</span><span class="g2-dist-pct">${_}%</span></button>`})}</div>`}function bo(e,t,o=!1){return F`<div class="g2-dist-list">${Qt(t,n=>n,n=>F`<button type="button" class="${ft({"g2-dist-item":!0,on:$.solo===n})}" data-g2-pkg="${n}"><span class="g2-dist-dot" style="${et({background:be(n)})}"></span> <span class="g2-dist-name">${Be(n)}</span> ${o?F`<span class="g2-dist-count">${e.importedBy.get(n).length}</span>`:null}</button>`)}</div>`}function ir(e,t){let o=e.byPkg.get(t);if(!o)return F`<div class="g2-empty-state">Select a package to trace its importers and dependencies.</div>`;let n=e.importedBy.get(t)??[],i=e.importsOf.get(t)??[];return F`<div class="g2-selection-card"><div class="g2-sel-head"><span class="g2-sel-dot" style="${et({background:be(t)})}"></span> <span class="g2-sel-id">${o.label}</span></div>${o.totalIssues?F`<div class="g2-sel-section">${dt(o.own)}</div>`:null}<div class="g2-sel-section"><div class="g2-sel-section-label">Imported by (${n.length})</div>${bo(e,n.toSorted())}</div><div class="g2-sel-section"><div class="g2-sel-section-label">Dependencies (${i.length})</div>${bo(e,i.toSorted())}</div></div>`}function Pn(e){return typeof e=="string"&&/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u.test(e)?e:null}var He;function rr(){return He||(He=document.createElement("div"),He.id="styled-tooltip",He.setAttribute("popover","manual"),document.body.append(He),He)}function sr(e){typeof e.showPopover=="function"&&(e.matches(":popover-open")&&e.hidePopover(),e.showPopover())}var Ut=null,zn="",Vt=null,Bn=0,Hn=0;document.addEventListener("mousemove",e=>{Bn=e.clientX,Hn=e.clientY},{passive:!0});var ar=100,lr=14,cr=8,jt=8;function dr(e,{placement:t="cursor"}={}){t=e.dataset.tooltipPlacement??t;let o=rr(),n=e.dataset.tooltip??"",i=e.dataset.tooltipRepo??"",s=Pn(e.dataset.tooltipCommit),l=["stasis","sourcemap"].includes(e.dataset.tooltipBundle)?e.dataset.tooltipBundle:"",g=e.dataset.tooltipStats??"",p=e.dataset.tooltipBuilt==="true",d=e.dataset.tooltipPackage??"",u=e.dataset.tooltipEcosystem??"",r=e.dataset.tooltipVersion??"",S=e.dataset.tooltipFiles??"",y=JSON.stringify([n,i,s,l,g,p,d,u,r,S]);if(!n||Ut===e&&zn===y)return;if(o.textContent=n,d){let _=document.createElement("div");_.className="tooltip-package";let j=(e.querySelector("[data-tooltip-package-icon] svg")??e.querySelector("svg"))?.cloneNode(!0);j&&_.append(j);let U=document.createElement("span");U.className="tooltip-package-details";for(let I of[d,r,/^\d+$/u.test(S)?`${S} ${S==="1"?"file":"files"}`:""].filter(Boolean)){let c=document.createElement("span");c.textContent=I,U.append(c)}_.append(U),o.append(_)}if(i||s){let _=document.createElement("div");if(_.className="tooltip-repo",i){_.innerHTML=gn;let j=document.createElement("span");j.textContent=i,_.append(j)}if(s){let j=document.createElement("span");j.className="tooltip-commit",j.innerHTML=hn;let U=document.createElement("span");U.textContent=s.slice(0,7),j.append(U),_.append(j)}o.append(_)}if(l||g||p){let _=document.createElement("div");if(_.className="tooltip-bundle",l==="stasis"){let I=document.createElement("img");I.src="./stasis.svg",I.alt="",_.append(I)}else _.innerHTML=cn;let j=document.createElement("span"),U=l==="stasis"?"Stasis":l==="sourcemap"?"Sourcemap":"";j.textContent=[U,p?"Built on server":"",g].filter(Boolean).join(" \xB7 "),_.append(j),o.append(_)}sr(o),o.style.left="0px",o.style.top="0px",o.style.transform="none",o.classList.add("visible");let m=Bn,T=Hn+lr;if(t==="right"||t==="right-start"){let _=e.getBoundingClientRect();m=_.right+cr,T=_.top+(t==="right"?_.height/2:0)}let a=window.innerWidth-o.offsetWidth-jt,v=Math.max(jt,Math.min(m,a));o.style.left=`${Math.round(v)}px`;let k=o.offsetHeight,f=t==="right"?T-k/2:T,w=window.innerHeight-k-jt,x=Math.max(jt,Math.min(f,w));o.style.top=`${Math.round(x)}px`,Ut=e,zn=y}function On(){clearTimeout(Vt),Vt=null,He&&(He.classList.remove("visible"),typeof He.hidePopover=="function"&&He.matches(":popover-open")&&He.hidePopover()),Ut=null}function ur(e,{gate:t,placement:o}={}){Object.hasOwn(e.dataset,"tooltipTruncated")&&e.scrollWidth<=e.clientWidth&&e.scrollHeight<=e.clientHeight||t&&!t(e)||(clearTimeout(Vt),Vt=setTimeout(()=>{dr(e,{placement:o})},ar))}var Fn=new WeakSet;function Nn(e,t){for(let o of e.composedPath()){if(o===t)break;if(o.nodeType===1&&Object.hasOwn(o.dataset,"tooltip"))return o}return null}function Dn(e,t){!e||Fn.has(e)||(Fn.add(e),e.addEventListener("mouseover",o=>{let n=Nn(o,e);if(!n){On();return}n!==Ut&&ur(n,t)}),e.addEventListener("mouseout",o=>{let n=Nn(o,e),i=o.relatedTarget?.closest?.("[data-tooltip]")??null;n&&n===i||On()}))}var vo=class{constructor(t){this.nodes=[...t];for(let[o,n]of this.nodes.entries())n.position=o;for(let o=(this.nodes.length>>1)-1;o>=0;o--)this.down(o)}before(t,o){return Math.abs(t.balance)>Math.abs(o.balance)||Math.abs(t.balance)===Math.abs(o.balance)&&(t.balance>o.balance||t.balance===o.balance&&t.tie<o.tie)}swap(t,o){let n=this.nodes,i=n[t];n[t]=n[o],n[o]=i,n[t].position=t,n[o].position=o}down(t){let o=this.nodes;for(;2*t+1<o.length;){let n=2*t+1;if(n+1<o.length&&this.before(o[n+1],o[n])&&n++,!this.before(o[n],o[t]))break;this.swap(t,n),t=n}}update(t){if(t.position<0)return;let o=t.position;for(;o>0;){let n=o-1>>1;if(!this.before(t,this.nodes[n]))break;this.swap(o,n),o=n}this.down(o)}take(){let t=this.nodes[0],o=this.nodes.pop();return t.position=-1,this.nodes.length>0&&(this.nodes[0]=o,o.position=0,this.down(0)),t}};function pr(e,t){for(let o=0;o<8;o++){let n=!1;for(let i=0;i<e.length-1;i++){let s=o%2?e.length-2-i:i,l=e[s],g=e[s+1];(t.get(g)?.get(l)?.cycleCount??0)<=(t.get(l)?.get(g)?.cycleCount??0)||(e[s]=g,e[s+1]=l,n=!0)}if(!n)break}return e}function fr(e){let t=[],o=new Set;for(let n of e.values())n.outgoing.sort((i,s)=>s[1]-i[1]||i[0].tie-s[0].tie);for(let n of e.values()){if(o.has(n))continue;let i=[{node:n,next:0}];for(o.add(n);i.length>0;){let s=i.at(-1);if(s.next===s.node.outgoing.length){t.push(s.node.id),i.pop();continue}let l=s.node.outgoing[s.next++][0];o.has(l)||(o.add(l),i.push({node:l,next:0}))}}return t.toReversed()}function yo(e,t){let o=new Map(e.map((i,s)=>[i,s])),n=0;for(let i of t.values())for(let[s,l]of i.outgoing)o.get(i.id)<o.get(s.id)&&(n+=l);return n}function gr(e,t){let o=yo(e,t),n=o,i=0;for(let s=0;s<e.length-1;s++)o-=t.get(e[s]).originalBalance,o>n&&(n=o,i=s+1);return[...e.slice(i),...e.slice(0,i)]}function jn(e,t){if(e.length<2)return e;let o=new Map(e.map((p,d)=>[p,{id:p,tie:d,balance:0,incoming:[],outgoing:[]}]));for(let p of o.values())for(let d of t.get(p.id)?.values()??[]){let u=o.get(d.to);!u||u===p||!d.cycleCount||(p.outgoing.push([u,d.cycleCount]),u.incoming.push([p,d.cycleCount]),p.balance+=d.cycleCount,u.balance-=d.cycleCount)}for(let p of o.values())p.originalBalance=p.balance;let n=[],i=new vo(o.values()),s=[];for(;i.nodes.length>0;){let p=i.take();p.balance>=0?n.push(p.id):s.push(p.id);for(let[d,u]of p.outgoing)d.position<0||(d.balance+=u,i.update(d));for(let[d,u]of p.incoming)d.position<0||(d.balance-=u,i.update(d))}let l=e,g=yo(e,o);for(let p of[[...n,...s.toReversed()],fr(o),e,e.toReversed()]){let d=pr(gr(p,o),t),u=yo(d,o);u>g&&(l=d,g=u)}return l}function wo(e,t){let o=new Set(e),n=new Map(e.map(p=>[p,[]]));for(let[p,d]of t)for(let u of d)o.has(p)&&o.has(u)&&n.get(u).push(p);let i=[],s=new Set;for(let p of e){if(s.has(p))continue;s.add(p);let d=[[p,(t.get(p)??[])[Symbol.iterator]()]];for(;d.length>0;){let[u,r]=d.at(-1),S=r.next();if(S.done){i.push(u),d.pop();continue}o.has(S.value)&&!s.has(S.value)&&(s.add(S.value),d.push([S.value,(t.get(S.value)??[])[Symbol.iterator]()]))}}let l=new Map,g=[];for(let p of i.toReversed()){if(l.has(p))continue;let d=[],u=g.length,r=[p];for(l.set(p,u);r.length>0;){let S=r.pop();d.push(S);for(let y of n.get(S))l.has(y)||(l.set(y,u),r.push(y))}g.push(d.toSorted())}return{groups:g,componentOf:l}}function ko(e,{expanded:t=new Set,order:o="structure",query:n="",neighborhood:i=null,cyclesOnly:s=!1}={}){let l=new Map,g=new Map,p=new Map;for(let h of e.nodes){let P=t.has(h.pkg),L=`${P?"f":"p"}:${P?h.file:h.pkg}`;l.has(L)||l.set(L,{id:L,pkg:h.pkg,file:P?h.file:null,label:P?h.file:Ft(h.pkg),files:[],size:0,issues:0,incoming:0,outgoing:0});let K=l.get(L);K.files.push(h.file),K.size+=h.size??0,K.issues+=h.totalIssues??0,g.set(h.file,L),p.set(h.file,h.origFile??h.file)}let d=new Map,u=new Set,r=new Set,S=new Map([...l.keys()].map(h=>[h,new Set])),y=0;for(let[h,P]of e.importsOf){let L=g.get(h);if(L)for(let K of new Set(P)){let ae=g.get(K);if(!ae)continue;d.has(L)||d.set(L,new Map),d.get(L).has(ae)||d.get(L).set(ae,{from:L,to:ae,count:0,cycleCount:0,examples:[]});let ye=d.get(L).get(ae);ye.count++;let he=Mt(p.get(h),p.get(K),e.ownSourceFiles?.has(K),e.ownSourceFiles?.has(h));ye.examples.length<80&&(!s||he)&&ye.examples.push([h,K]),y++,l.get(L).outgoing++,l.get(ae).incoming++,L!==ae&&(r.add(L),u.add(ae)),he&&(ye.cycleCount++,(L!==ae||l.get(L).file)&&S.get(L).add(ae))}}let m=[...l.keys()].toSorted(),{groups:T,componentOf:a}=wo(m,S),v=new Set(T.flatMap(h=>h.length>1||S.get(h[0]).has(h[0])?h:[]));for(let h of l.values())h.cyclic=v.has(h.id),h.component=a.get(h.id);let k=e.ownSourcePackages??new Set(e.layerRoots?.roots??[]),f=h=>h.pkg==="__own__"?0:k.has(h.pkg)?1:2,w=h=>u.has(h.id)&&r.has(h.id)?0:1,x=new Map(T.map((h,P)=>[P,h.reduce((L,K)=>Math.min(L,f(l.get(K))),2)])),_=(h,P)=>h.pkg.localeCompare(P.pkg)||h.label.localeCompare(P.label),j=new Map;if(o==="structure"){for(let h of T)if(!(h.length<2))for(let P of Map.groupBy(h,L=>f(l.get(L))).values()){let L=P.toSorted((K,ae)=>_(l.get(K),l.get(ae)));jn(L,d).forEach((K,ae)=>j.set(K,ae))}}if(s){y=0,u.clear(),r.clear();for(let h of l.values())h.incoming=0,h.outgoing=0}for(let[h,P]of d){for(let L of P.values())if(L.cyclic=L.cycleCount>0&&v.has(h)&&a.get(h)===a.get(L.to)&&(h!==L.to||l.get(h).file!==null),!!s){if(!L.cyclic){P.delete(L.to);continue}L.count=L.cycleCount,y+=L.count,l.get(h).outgoing+=L.count,l.get(L.to).incoming+=L.count,h!==L.to&&(r.add(h),u.add(L.to))}P.size===0&&d.delete(h)}let U=n.trim().toLowerCase(),I=new Set(m.filter(h=>!U||l.get(h).files.some(P=>P.toLowerCase().includes(U))||l.get(h).label.toLowerCase().includes(U))),c=new Set(i?[i]:I);if(U||i)for(let[h,P]of d)for(let L of P.keys())(i?h===i:I.has(h))&&c.add(L),(i?L===i:I.has(L))&&c.add(h);let R=(h,P)=>{if(o==="structure"){let ae=x.get(h.component)-x.get(P.component);if(ae)return ae;let ye=w(h)-w(P);if(ye)return ye;let he=h.component-P.component;if(he)return he}let L=f(h)-f(P);if(L)return L;let K=w(h)-w(P);if(K)return K;if(o==="structure"&&h.component===P.component){let ae=(j.get(h.id)??0)-(j.get(P.id)??0);if(ae)return ae}return o==="importers"&&h.incoming!==P.incoming?P.incoming-h.incoming:o==="imports"&&h.outgoing!==P.outgoing?P.outgoing-h.outgoing:_(h,P)},E=[...l.values()].filter(h=>c.has(h.id)&&(!s||h.cyclic)).toSorted(R),N=new Map(E.map((h,P)=>[h.id,P])),M=[];for(let[h,P]of d)if(N.has(h))for(let L of P.values())N.has(L.to)&&M.push({...L,row:N.get(h),col:N.get(L.to)});return{rows:E,byId:l,cells:d,visibleCells:M,index:N,matches:I,importCount:y,totalRows:l.size,cycleCount:T.filter(h=>v.has(h[0])).length}}function $o(e,t,o){return Math.min(24,Math.max(1,t-196-12)/Math.max(1,e),Math.max(1,o-118-12)/Math.max(1,e))}function Mo(e,t,o,n){return Math.max(Math.min(18,$o(t,o,n)),Math.min(27,e))}function Vn(e,t,o,n){let i=Math.floor((e-196+n.x)/n.cell),s=Math.floor((t-118+n.y)/n.cell);return e<196&&t>=118&&s>=0&&s<o.rows.length?{row:s,col:null}:t<118&&e>=196&&i>=0&&i<o.rows.length?{row:i,col:null}:e>=196&&t>=118&&s>=0&&i>=0&&s<o.rows.length&&i<o.rows.length?{row:s,col:i}:null}function Un(e){if(!e.file)return e.label;let t=`node_modules/${e.pkg}/`;return e.file.includes(t)?e.file.slice(e.file.indexOf(t)+t.length):e.file}function Gn(e,t,o,{width:n,height:i,theme:s,colorOf:l,hover:g,selected:p,dimmed:d}){let{cell:u,x:r,y:S}=o,{rows:y}=t,m=c=>196+c*u-r,T=c=>118+c*u-S,a=Math.max(0,Math.floor(S/u)),v=Math.min(y.length,Math.ceil((i-118+S)/u)),k=Math.max(0,Math.floor(r/u)),f=Math.min(y.length,Math.ceil((n-196+r)/u)),w=g??p;e.clearRect(0,0,n,i),e.fillStyle=s.bg,e.fillRect(0,0,n,i),e.save(),e.beginPath(),e.rect(196,118,n-196,i-118),e.clip();let x=[];for(let c=0;c<y.length;c++){let R=x.at(-1),E=y[c];R&&R.component===E.component?R.end=c+1:x.push({component:E.component,start:c,end:c+1,cyclic:E.cyclic})}for(let c of x)c.cyclic&&(e.strokeStyle=s.cycle+"85",e.lineWidth=1,e.strokeRect(m(c.start),T(c.start),(c.end-c.start)*u,(c.end-c.start)*u));if(w&&(e.fillStyle=s.highlight,e.fillRect(196,T(w.row),n-196,u),e.fillRect(m(w.col??w.row),118,u,i-118)),e.strokeStyle=s.grid,e.lineWidth=1,u>=9){e.beginPath();for(let c=a;c<=v;c++)e.moveTo(196,T(c)+.5),e.lineTo(n,T(c)+.5);for(let c=k;c<=f;c++)e.moveTo(m(c)+.5,118),e.lineTo(m(c)+.5,i);e.stroke()}let _=t.visibleCells.reduce((c,R)=>Math.max(c,R.count),1),j=u>=8?2:.25;for(let c of t.visibleCells)c.row<a||c.row>=v||c.col<k||c.col>=f||(e.globalAlpha=d(y[c.row])&&d(y[c.col])?.12:.35+.65*Math.log1p(c.count)/Math.log1p(_),e.fillStyle=c.cyclic&&u<10?s.cycle:l(y[c.row].pkg),e.fillRect(m(c.col)+j,T(c.row)+j,Math.max(1,u-2*j),Math.max(1,u-2*j)),c.cyclic&&c.from!==c.to&&u>=10&&(e.fillStyle=s.cycle,e.fillRect(m(c.col)+u-5,T(c.row)+2,3,3)));e.globalAlpha=1,p&&(e.strokeStyle=s.text,e.lineWidth=2,p.col===null?e.strokeRect(197,T(p.row)+1,n-196-2,u-2):e.strokeRect(m(p.col)+1,T(p.row)+1,u-2,u-2)),e.restore(),e.fillStyle=s.surface,e.fillRect(0,0,n,118),e.fillRect(0,0,196,i),e.font="11px ui-monospace, monospace",e.textBaseline="middle";let U=Math.max(1,Math.ceil(14/u));for(let c=a;c<v;c++){if(c%U&&c!==w?.row)continue;e.save(),e.beginPath(),e.rect(5,111,186,i-118+7),e.clip();let R=T(c)+u/2;c===w?.row&&(e.fillStyle=s.highlight,e.fillRect(0,T(c),196,Math.max(u,14))),e.fillStyle=l(y[c].pkg),e.fillRect(8,R-3,5,6),e.fillStyle=c===w?.row||t.matches.size<t.totalRows&&t.matches.has(y[c].id)?s.text:s.muted,e.fillText(`${y[c].file?" ":""}${Un(y[c])}`,20,R),e.restore()}let I=Math.max(1,Math.ceil(17/u));for(let c=k;c<f;c++)c%I&&c!==(w?.col??w?.row)||(e.save(),e.beginPath(),e.rect(189,22,n-196+7,96),e.clip(),e.translate(m(c)+u/2,108),e.rotate(-Math.PI/4),e.fillStyle=c===(w?.col??w?.row)?s.text:s.muted,e.fillText(Un(y[c]),0,0,115),e.restore(),e.fillStyle=l(y[c].pkg),e.fillRect(m(c)+1,114,Math.max(1,u-2),3));e.fillStyle=s.muted,e.font="10px ui-monospace, monospace",e.fillText("IMPORTERS \u2193",14,104),e.fillText("DEPENDENCIES \u2192",204,12),e.strokeStyle=s.border,e.beginPath(),e.moveTo(196-.5,118),e.lineTo(196-.5,i),e.moveTo(196,118-.5),e.lineTo(n,118-.5),e.stroke(),y.length===0&&(e.fillStyle=s.muted,e.fillText("No matching dependencies",216,148))}var Ve=e=>e.toLocaleString("en-US");function Gt(e,t,o){return F`<button class="g2-dist-item matrix-row-link" @click="${()=>o(e.id)}"><span class="g2-dist-dot" style="${`background:${be(e.pkg)}`}"></span><span class="g2-dist-name" data-tooltip-truncated data-tooltip="${e.label}">${e.label}</span><span class="g2-dist-count">${Ve(t)}</span></button>`}function Xn(e,t,o,{select:n,expand:i,expanded:s,neighborhood:l,focus:g,clear:p}){let d=e.byId.get(o?.from),u=e.byId.get(o?.to);if(!d){let k=[...e.rows].toSorted((f,w)=>w.incoming-f.incoming).slice(0,15);return F`<div class="matrix-metrics"><span><b>${Ve(t.nodes.length)}</b>files</span><span><b>${Ve(t.packages.length)}</b>packages</span><span><b>${Ve(e.importCount)}</b>imports</span></div><p class="matrix-empty">Select a row to inspect a package.<br>Select a cell to see the files behind a dependency.</p><h4>Most imported</h4>${k.map(f=>Gt(f,f.incoming,n))} ${e.cycleCount?F`<h4>Cyclic groups <b>${e.cycleCount}</b></h4>${e.rows.filter(f=>f.cyclic).slice(0,12).map(f=>Gt(f,f.outgoing,n))}`:null}`}let r=u?e.cells.get(d.id)?.get(u.id):null,S=k=>t.nodeByFile.get(k)?.origFile??k,y=r?.cycleCount<r?.count?`${Ve(r.cycleCount)} of ${Ve(r.count)} file imports participate in a cycle`:"Import participates in a cycle",m=Map.groupBy(r?.examples??[],([,k])=>k),T=d.cyclic?[...e.byId.values()].filter(k=>k.component===d.component).length:0,a=[...e.cells.get(d.id)?.values()??[]].filter(k=>k.to!==d.id).toSorted((k,f)=>f.count-k.count),v=[...e.cells.values()].map(k=>k.get(d.id)).filter(k=>k&&k.from!==d.id).toSorted((k,f)=>f.count-k.count);return F`<div class="matrix-panel-head"><button class="matrix-selected-name" @click="${()=>n(d.id)}">${d.label}</button><button type="button" class="detail-action" @click="${p}" aria-label="Clear matrix selection">×</button></div>${u?F`<div class="matrix-direction">imports →</div><button class="matrix-selected-name" @click="${()=>n(u.id)}">${u.label}</button>`:null} ${(u?r?.cyclic:d.cyclic)?F`<span class="matrix-cycle-label">${u?y:`Cyclic group \xB7 ${T} members`}</span>`:null}<div class="matrix-metrics"><span><b>${Ve(u?r?.count??0:d.files.length)}</b>${u?"file imports":"files"}</span><span><b>${Ze(d.size)}</b>source size</span></div><div class="matrix-actions">${d.file?F`<button @click="${()=>i(d.pkg)}">Collapse package</button><button data-bundle-view-source="${t.nodeByFile.get(d.file)?.origFile??d.file}">View source</button>`:F`<button @click="${()=>i(d.pkg)}">${s.has(d.pkg)?"Collapse files":"Expand files"}</button>`} <button aria-pressed="${String(l===d.id)}" @click="${()=>g(d.id)}">Neighborhood</button></div>${u?F`<h4>File imports</h4>${m.size>0?[...m].map(([k,f])=>F`<div class="matrix-import-group"><button class="matrix-import-target" data-bundle-view-source="${t.nodeByFile.get(k)?.origFile??k}" data-tooltip-truncated data-tooltip="${k}">${k}</button><ul class="matrix-import-sources" aria-label="Imported by">${f.map(([w])=>F`<li><button data-bundle-view-source="${t.nodeByFile.get(w)?.origFile??w}"><span aria-hidden="true">←</span><span data-tooltip-truncated data-tooltip="${w}">${w}</span></button> ${Mt(S(w),S(k),t.ownSourceFiles?.has(k),t.ownSourceFiles?.has(w))?null:F`<span class="matrix-import-excluded">Excluded from cycles</span>`}</li>`)}</ul></div>`):F`<p class="matrix-empty">No direct imports in this direction.</p>`} ${r&&r.count>r.examples.length?F`<p class="matrix-empty">Showing ${r.examples.length} of ${Ve(r.count)} imports.</p>`:null} ${u.id!==d.id&&e.cells.get(u.id)?.has(d.id)?F`<h4>Reverse direction</h4><button class="g2-dist-item matrix-reverse-link" @click="${()=>n(u.id,d.id)}">← ${Ve(e.cells.get(u.id).get(d.id).count)} file imports</button>`:null}`:F`<h4>Imports <b>${a.length}</b></h4>${a.slice(0,60).map(k=>Gt(e.byId.get(k.to),k.count,f=>n(d.id,f)))} ${a.length>60?F`<p class="matrix-empty">Showing the 60 strongest of ${a.length} dependencies.</p>`:null}<h4>Imported by <b>${v.length}</b></h4>${v.slice(0,60).map(k=>Gt(e.byId.get(k.from),k.count,f=>n(f,d.id)))} ${v.length>60?F`<p class="matrix-empty">Showing the 60 strongest of ${v.length} importers.</p>`:null}`}`}var qn=`:host{display:contents}*{box-sizing:border-box}button,select{font:inherit;color:var(--text);border:1px solid var(--border);background:var(--surface);border-radius:var(--ui-radius, 4px);padding:4px 7px;cursor:default}button:hover,button[aria-pressed=true]{background:var(--graph-hover-bg);border-color:var(--muted)}button:focus-visible,select:focus-visible,canvas:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.matrix-layout{display:contents;color:var(--text);font-size:12px}.matrix-stage{grid-area:stage;position:relative;overflow:hidden;min-width:0;min-height:0;background:var(--graph-canvas-bg)}.matrix-order{position:absolute;top:12px;left:14px;max-width:calc(var(--matrix-label-width) - 28px);height:30px;padding:3px 6px;border-radius:var(--ui-radius, 6px);font-size:11px}canvas{display:block;width:100%;height:100%;touch-action:none}.matrix-zoom{position:absolute;bottom:10px;right:10px;display:flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--border);border-radius:var(--ui-radius, 5px);background:var(--surface)}.matrix-zoom span{min-width:35px;text-align:center;font-size:11px;color:var(--muted)}.matrix-hover{position:absolute;bottom:10px;left:calc(var(--matrix-label-width) + 10px);max-width:max(0px,calc(100% - var(--matrix-label-width) - 160px));padding:5px 8px;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:var(--surface);pointer-events:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.matrix-panel{grid-area:right;min-height:0;overflow:auto;padding:12px;border-left:1px solid var(--border);background:var(--surface)}.matrix-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-right:var(--graph-fullscreen-inset, 0)}h4{margin:20px 0 7px;font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;display:flex;justify-content:space-between}.matrix-metrics{display:flex;gap:14px;margin:15px 0;color:var(--muted);font-size:10px}.matrix-metrics:first-child{margin-top:0;padding-right:var(--graph-fullscreen-inset, 0)}.matrix-metrics b{display:block;font-size:16px;font-weight:500;color:var(--text);font-variant-numeric:tabular-nums;margin-bottom:3px}.matrix-empty{color:var(--muted);font-size:11px;line-height:1.6;cursor:default;user-select:none;-webkit-user-select:none}.matrix-row-link{grid-template-columns:6px minmax(0,1fr) auto}.matrix-row-link .g2-dist-dot{width:6px;height:6px;border-radius:2px}.matrix-row-link .g2-dist-name{color:var(--text)}.matrix-row-link .g2-dist-count{color:var(--muted)}.matrix-reverse-link{grid-template-columns:1fr}.matrix-selected-name{display:block;background:transparent;border:0;text-align:left;padding:0;margin:14px 0 6px;font:12px/1.6 ui-monospace,monospace;overflow-wrap:anywhere}.matrix-panel-head .matrix-selected-name{min-width:0;margin:0}.matrix-panel-head button:last-child{flex-shrink:0}.matrix-direction{color:var(--muted);font-size:10px}.matrix-cycle-label{display:block;color:var(--matrix-cycle, #e879c7);font-size:10px;margin-top:10px}.matrix-actions{display:flex;gap:5px;margin:12px 0;font-size:11px}.matrix-actions button{white-space:nowrap}.matrix-import-group{padding:6px 0;border-bottom:1px solid var(--border)}.matrix-import-group button{display:flex;align-items:baseline;gap:6px;width:100%;min-height:20.5px;background:transparent;border:0;padding:2px 0;font:10px/1.6 ui-monospace,monospace;text-align:left;overflow-wrap:anywhere;color:var(--text)}.matrix-import-group .matrix-import-target{font-weight:600}.matrix-import-sources{margin:0 0 0 10px;padding:0;list-style:none}.matrix-import-sources button{color:var(--muted)}.matrix-import-sources span:last-child{min-width:0}.matrix-import-excluded{display:block;margin-left:12px;color:var(--muted);font-size:10px}
|
|
9
|
+
`;var Wn=`.detail-action{width:22px;height:22px;display:grid;place-items:center;padding:0;background:transparent;border:0;border-radius:var(--ui-radius, 4px);color:var(--muted);font:500 16px/1 ui-monospace,monospace;cursor:default;&:hover{color:var(--accent);background:var(--surface-active)}&:focus-visible{outline:2px solid var(--accent);outline-offset:1px}}
|
|
10
|
+
`;var So=class extends pt{static properties={graph:{attribute:!1}};static styles=[je(_t),je(qn),je(Wn)];constructor(){super(),this.expanded=new Set,this.order="structure",this.cyclesOnly=!1,this.neighborhood=null,this.selection=null,this.hover=null,this.view={cell:18,x:0,y:0},this.width=0,this.height=0,this.dirty=!0,this.needsFit=!0,this.bridge={requestDraw:()=>this.requestUpdate(),_cleanup:()=>{}}}willUpdate(t){if(this.graph&&(t.has("graph")||this.query!==$.pathFilter||this.dirty)){let o=this.model?.rows;this.query=$.pathFilter,this.model=ko(this.graph,{expanded:this.expanded,order:this.order,query:this.query,neighborhood:this.neighborhood,cyclesOnly:this.cyclesOnly}),this.neighborhood&&!this.model.byId.has(this.neighborhood)&&(this.neighborhood=null,this.model=ko(this.graph,{expanded:this.expanded,order:this.order,query:this.query,cyclesOnly:this.cyclesOnly})),this.selection&&(!this.model.index.has(this.selection.from)||this.selection.to&&(!this.model.index.has(this.selection.to)||this.cyclesOnly&&!this.model.cells.get(this.selection.from)?.has(this.selection.to)))&&(this.selection=null),this.hover=null,this.dirty=!1,this.needsFit||=!o||o.length!==this.model.rows.length||this.model.rows.some((n,i)=>n.id!==o[i].id)}}firstUpdated(){let t=this.renderRoot.querySelector("canvas");this.canvas=t,this.resizeObserver=new ResizeObserver(()=>{let o=t.parentElement.getBoundingClientRect();this.width=o.width,this.height=o.height;let n=window.devicePixelRatio||1;t.width=Math.round(this.width*n),t.height=Math.round(this.height*n),this.clamp(),this.paint()}),this.resizeObserver.observe(t.parentElement),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.events=new AbortController,t.addEventListener("wheel",o=>{o.preventDefault(),o.ctrlKey||o.metaKey?this.zoom(Math.exp(-o.deltaY*.005),o.offsetX,o.offsetY):(this.view.x+=o.shiftKey?o.deltaY:o.deltaX,this.view.y+=o.shiftKey?0:o.deltaY,this.clamp(),this.hover=null,this.paint())},{passive:!1,signal:this.events.signal})}updated(){$.graphState=this.bridge;let t=JSON.stringify([this.cyclesOnly,this.model.cycleCount,this.expanded.size,!!this.neighborhood]);t!==this.controlsKey&&(this.controlsKey=t,this.dispatchEvent(new CustomEvent("matrix-controls-change",{detail:this.renderControls(),bubbles:!0,composed:!0}))),cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(()=>this.paint())}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.themeObserver?.disconnect(),this.events?.abort(),cancelAnimationFrame(this.frame),$.graphState===this.bridge&&($.graphState=null)}clamp(){this.view.cell=Mo(this.view.cell,this.model.rows.length,this.width,this.height);let t=this.model.rows.length*this.view.cell;this.view.x=Math.max(0,Math.min(this.view.x,Math.max(0,t-this.width+196+12))),this.view.y=Math.max(0,Math.min(this.view.y,Math.max(0,t-this.height+118+12)))}fit(){this.view={cell:$o(this.model.rows.length,this.width,this.height),x:0,y:0},this.needsFit=!1,this.requestUpdate()}zoom(t,o=(this.width+196)/2,n=(this.height+118)/2){let i=this.view.cell,s=Mo(i*t,this.model.rows.length,this.width,this.height);this.view.x=(this.view.x+o-196)*s/i-o+196,this.view.y=(this.view.y+n-118)*s/i-n+118,this.view.cell=s,this.clamp(),this.hover=null,this.requestUpdate()}select(t,o=null,n=!0){this.selection={from:t,to:o},n&&this.model.index.has(t)&&(this.view.cell=Math.max(16,this.view.cell),this.view.y=this.model.index.get(t)*this.view.cell-(this.height-118)/2,this.view.x=(this.model.index.get(o??t)??0)*this.view.cell-(this.width-196)/2,this.clamp()),this.requestUpdate()}expand(t){this.expanded.has(t)?this.expanded.delete(t):this.expanded.add(t),this.revealPkg=t,this.selection=null,this.neighborhood=null,this.dirty=!0,this.requestUpdate()}pointer(t){let o=this.canvas.getBoundingClientRect();return Vn(t.clientX-o.left,t.clientY-o.top,this.model,this.view)}move(t){if(this.drag){let n=t.clientX-this.drag.x,i=t.clientY-this.drag.y;if(Math.abs(n)+Math.abs(i)>3&&(this.drag.moved=!0),this.drag.moved){this.view.x=this.drag.ox-n,this.view.y=this.drag.oy-i,this.clamp(),this.hover=null,this.paint();return}}let o=this.pointer(t);(o?.row!==this.hover?.row||o?.col!==this.hover?.col)&&(this.hover=o,this.requestUpdate())}key(t){if(t.key==="Escape"){this.selection=null,this.hover=null,this.requestUpdate();return}if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"].includes(t.key)||this.model.rows.length===0)return;t.preventDefault();let o=this.model.index.get(this.selection?.from)??0,n=this.model.index.get(this.selection?.to)??o;if(t.key==="Enter"){this.expand(this.model.rows[o].pkg);return}t.key==="ArrowDown"&&o++,t.key==="ArrowUp"&&o--,t.key==="ArrowRight"&&n++,t.key==="ArrowLeft"&&n--;let i=s=>Math.max(0,Math.min(this.model.rows.length-1,s));this.select(this.model.rows[i(o)].id,this.model.rows[i(n)].id)}paint(){if(!this.canvas||!this.model||this.width<=196||this.height<=118)return;if(this.needsFit&&this.fit(),this.revealPkg){let u=this.model.rows.find(r=>r.pkg===this.revealPkg);this.revealPkg=null,u&&this.select(u.id)}let t=this.canvas.getContext("2d"),o=window.devicePixelRatio||1;t.setTransform(o,0,0,o,0,0);let n=getComputedStyle(this),i=u=>n.getPropertyValue(u).trim(),s=document.body.classList.contains("theme-paper"),l=s||document.body.classList.contains("theme-light")||document.body.classList.contains("theme-pink"),g={bg:i("--graph-canvas-bg")||"#0c0c0c",surface:i("--surface"),text:i("--text"),muted:i("--muted"),border:i("--border"),grid:l?"#0000000b":"#ffffff0b",highlight:s?"#fff":l?"#0969da18":"#ffffff12",cycle:s?"#000":l?"#a21caf":"#e879c7"};this.style.setProperty("--matrix-cycle",g.cycle);let p=this.model.index.get(this.selection?.to),d=this.model.index.get(this.selection?.from);Gn(t,this.model,this.view,{width:this.width,height:this.height,theme:g,colorOf:be,hover:this.hover,selected:d===void 0?null:{row:d,col:p??null},dimmed:u=>!u.files.some(r=>{let S=this.graph.nodeByFile.get(r);return($.selectedSeverities.size===0||[...$.selectedSeverities].some(y=>S.severitySet?.has(y)))&&($.selectedColors.size===0||[...$.selectedColors].some(y=>S.colorSet?.has(y)))})})}renderControls(){return F`<div class="g2-matrix-controls"><mode-switch label="${`${this.model.cycleCount} ${this.model.cycleCount===1?"cycle":"cycles"}`}" .checked="${this.cyclesOnly}" @click="${()=>{this.cyclesOnly=!this.cyclesOnly,this.dirty=!0,this.requestUpdate()}}"></mode-switch>${this.expanded.size>0?F`<button @click="${()=>{this.expanded.clear(),this.selection=null,this.dirty=!0,this.requestUpdate()}}">Collapse all</button>`:null} ${this.neighborhood?F`<button @click="${()=>{this.neighborhood=null,this.dirty=!0,this.requestUpdate()}}">All dependencies</button>`:null}</div>`}render(){if(!this.model)return null;let t=this.model.rows[this.hover?.col],o=this.model.rows[this.hover?.row],n=t&&o?this.model.cells.get(o.id)?.get(t.id)?.count??0:0;return F`<div class="matrix-layout"><div class="matrix-stage" style="${`--matrix-label-width: ${196}px`}"><select class="matrix-order" aria-label="Matrix order" @change="${i=>{this.order=i.target.value,this.dirty=!0,this.requestUpdate()}}"><option value="structure" ?selected="${this.order==="structure"}">Structure ↓</option><option value="name" ?selected="${this.order==="name"}">Name ↓</option><option value="importers" ?selected="${this.order==="importers"}">Most imported ↓</option><option value="imports" ?selected="${this.order==="imports"}">Most imports ↓</option></select><canvas tabindex="0" role="img" aria-label="Dependency matrix. Rows import columns. Arrow keys select cells; Enter expands a package." @keydown="${i=>this.key(i)}" @pointermove="${i=>this.move(i)}" @pointerleave="${()=>{this.drag||(this.hover=null,this.requestUpdate())}}" @pointerdown="${i=>{i.button===0&&(this.canvas.setPointerCapture(i.pointerId),this.drag={x:i.clientX,y:i.clientY,ox:this.view.x,oy:this.view.y,moved:!1})}}" @pointercancel="${()=>{this.drag=null}}" @pointerup="${i=>{if(this.drag){if(!this.drag.moved){let s=this.pointer(i);s&&this.select(this.model.rows[s.row].id,s.col===null?null:this.model.rows[s.col].id,!1)}this.drag=null}}}" @dblclick="${i=>{let s=this.pointer(i);s&&this.expand(this.model.rows[s.row].pkg)}}"></canvas>${o&&(!t||n>0)?F`<div class="matrix-hover">${o.label}${t?` \u2192 ${t.label} \xB7 ${n} imports`:` \xB7 ${o.files.length} files`}</div>`:null}<div class="matrix-zoom"><button aria-label="Zoom out" @click="${()=>this.zoom(1/1.5)}">−</button><span>${Math.round(this.view.cell/18*100)}%</span><button aria-label="Zoom in" @click="${()=>this.zoom(1.5)}">+</button><button @click="${()=>this.fit()}">Fit</button></div></div><aside class="matrix-panel" aria-label="Matrix details" aria-live="polite">${Xn(this.model,this.graph,this.selection,{select:(i,s)=>this.select(i,s),expand:i=>this.expand(i),expanded:this.expanded,neighborhood:this.neighborhood,focus:i=>{this.neighborhood=this.neighborhood===i?null:i,this.dirty=!0,this.requestUpdate()},clear:()=>{this.selection=null,this.requestUpdate()}})}</aside></div>`}};customElements.define("dependency-matrix",So);var Yn=`:host{display:inline-flex;flex-shrink:0;vertical-align:middle;--switch-track-width: 26px;--switch-track-height: 14px}button,.checkbox-mode{align-items:center;gap:8px;box-sizing:border-box;height:30px;margin:0;padding:0 .6rem;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:transparent;color:var(--muted);font:inherit;font-size:.78rem;font-weight:500;line-height:1;white-space:nowrap;cursor:default}button{display:var(--switch-button-display, inline-flex);&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .04)}&[aria-pressed=true]{color:var(--text)}&:disabled{opacity:.4}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.checkbox-mode{display:var(--switch-checkbox-display, none);border:0;color:var(--text);&:has(:disabled){opacity:.4}& input{width:.85rem;height:.85rem;margin:0;accent-color:var(--accent)}}.track{position:relative;flex-shrink:0;width:var(--switch-track-width);height:var(--switch-track-height);background:var(--border);border-radius:var(--ui-radius, 8px);transition:background .15s;&:after{content:"";position:absolute;top:2px;left:2px;width:calc(var(--switch-track-height) - 4px);height:calc(var(--switch-track-height) - 4px);border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}}button[aria-pressed=true] .track{background:color-mix(in oklch,var(--accent) 22%,transparent);&:after{transform:translate(calc(var(--switch-track-width) - var(--switch-track-height)));background:var(--accent)}}:host([borderless]) :is(button,.checkbox-mode){height:100%;border:0;border-radius:0}:host([compact]){--switch-track-width: 22px;--switch-track-height: 12px}:host([compact]) :is(button,.checkbox-mode){height:auto;gap:7px;padding:2px 8px;border-radius:var(--ui-radius, 6px);font-size:.68rem;line-height:1.2}
|
|
11
|
+
`;var _o=class extends pt{static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},label:{type:String},accessibleLabel:{type:String,attribute:"accessible-label"}};static styles=je(Yn);constructor(){super(),this.checked=!1,this.disabled=!1,this.label="",this.accessibleLabel=""}_checkboxClick(t){(this.disabled||t.target.tagName!=="INPUT")&&t.stopPropagation()}render(){return F`<button type="button" part="button" aria-pressed="${String(this.checked)}" aria-label="${this.accessibleLabel||this.label}" ?disabled="${this.disabled}"><span>${this.label}</span><span class="track" part="track" aria-hidden="true"></span></button> <label class="checkbox-mode" @click="${this._checkboxClick}"><input type="checkbox" part="checkbox" .checked="${this.checked}" ?disabled="${this.disabled}" aria-label="${this.accessibleLabel||this.label}"> <span>${this.label}</span></label>`}};customElements.get("mode-switch")||customElements.define("mode-switch",_o);var Ao=class extends pt{static properties={graph:{attribute:!1},options:{attribute:!1},matrixControls:{state:!0}};static styles=[je(Xo),je(Go),je(Vo),je(_t)];constructor(){super(),this.graph=null,this.options={},this.matrixControls=null}connectedCallback(){super.connectedCallback(),Dn(this.renderRoot)}willUpdate(){(!this.options.showBundleLayouts||$.bundleLayout!=="matrix")&&(this.matrixControls=null)}updated(){this.toggleAttribute("matrix",!!this.options.showBundleLayouts&&$.bundleLayout==="matrix")}render(){return this.graph?this.options.showBundleLayouts&&$.bundleLayout==="matrix"?F`<div class="graph2-layout g2-matrix-layout">${xo(this.graph,this.options,this.matrixControls)}<dependency-matrix .graph="${this.graph}" @matrix-controls-change="${t=>{this.matrixControls=t.detail}}"></dependency-matrix></div>`:F`<div class="graph2-layout">${xo(this.graph,this.options)} ${In(this.graph)} ${Tn()}</div>`:F``}};customElements.define("graph-layout",Ao);function xr(e){let t=new Map;for(let[o,n]of e.importsOf){let i=e.nodeByFile.get(o);if(i)for(let s of n){let l=e.nodeByFile.get(s);l&&i.pkg!==l.pkg&&(t.set(i.pkg,(t.get(i.pkg)??0)+1),t.set(l.pkg,(t.get(l.pkg)??0)+1))}}return t}function vr(e){if(e.packages.length===0)return null;let t=new Set;for(let[o,n]of e.importedBy){let i=e.nodeByFile.get(o);if(i)for(let s of n){let l=e.nodeByFile.get(s);if(l&&l.pkg!==i.pkg){t.add(i.pkg);break}}}for(let o of e.packages)if(!t.has(o))return o;return null}var yr=5;function Kn(e,t){let o=new Map;for(let s of e.nodes)t.has(s.pkg)&&(o.has(s.pkg)||o.set(s.pkg,[]),o.get(s.pkg).push(s));for(let s of o.values())s.sort((l,g)=>l.isHub!==g.isHub?l.isHub?-1:1:g.deg-l.deg);let n=new Map,i=new Map;for(let[s,l]of t){let g=o.get(s);if(!g||g.length===0)continue;let p=g.length,d=0;for(let v of g)if(v.isHub)d++;else break;let u=d>0&&d<=yr,r=u?d:0,S=p-r,y=l.groupR,m=Array.from({length:p}),T=Array.from({length:p});for(let v=0;v<p;v++){let k=v*137.508*Math.PI/180,f;if(v<r)f=r<=1?0:Math.sqrt(v/(r-1))*.3*y;else{let w=v-r;f=S<=1?.4*y:(.4+Math.sqrt(w/(S-1))*.6)*y}m[v]=l.x+Math.cos(k)*f,T[v]=l.y+Math.sin(k)*f}let a=Array.from({length:p},()=>!1);for(let v=0;v<p;v++){let k=g[v],f,w;u&&k.isHub?(w=0,f=r):u?(w=r,f=p):(w=0,f=p);let x=0,_=0,j=0,U=e.importsOf.get(k.file);if(U)for(let E of U){let N=n.get(E);N!==void 0&&(x+=N,_+=i.get(E),j++)}let I=e.importedBy.get(k.file);if(I)for(let E of I){let N=n.get(E);N!==void 0&&(x+=N,_+=i.get(E),j++)}let c=!1;if(j>0){x/=j,_/=j;let E=x-l.x,N=_-l.y;E*E+N*N>1&&(c=!0)}let R=-1;if(c){let E=1/0;for(let N=w;N<f;N++){if(a[N])continue;let M=m[N]-x,h=T[N]-_,P=M*M+h*h;P<E&&(E=P,R=N)}}else for(let E=w;E<f;E++)if(!a[E]){R=E;break}a[R]=!0,k.x=m[R],k.y=T[R],n.set(k.file,k.x),i.set(k.file,k.y)}}}function Zn(e,t,o){let n=t/2,i=o/2,s=Math.min(t,o)/2;if(e.packages.length===0)return;let g=vr(e),p=xr(e),d=(g?e.packages.filter(M=>M!==g):[...e.packages]).toSorted((M,h)=>{let P=(p.get(h)??0)-(p.get(M)??0);return P!==0?P:(e.pkgCount.get(h)??0)-(e.pkgCount.get(M)??0)}),u=d.length,r;u<=0?r=0:u<=6?r=.65:u<=20?r=.82:r=.95;let S=Math.max(1,Math.sqrt(50/Math.max(1,u))),y=.22,m=.12,T=.04,a=new Map,v;if(g){let M=e.pkgCount.get(g)??0,h=Math.min(y,(.012+Math.sqrt(M)*.004)*S);v=Math.max(u<=6?.4:u<=20?.36:.34,h+m+T),a.set(g,{x:n,y:i,size:M,groupR:h*s})}else u<=1?v=0:u<=6?v=.4:u<=20?v=.32:v=.3;if(u===0){Kn(e,a);return}let k=new Map;for(let M of e.edges){if(!M.cross)continue;let h=e.nodeByFile.get(M.a)?.pkg,P=e.nodeByFile.get(M.b)?.pkg;if(!h||!P||h===P)continue;k.has(h)||k.set(h,new Map),k.has(P)||k.set(P,new Map);let L=k.get(h),K=k.get(P);L.set(P,(L.get(P)??0)+1),K.set(h,(K.get(h)??0)+1)}let f=Math.max(1,Math.min(10,Math.round(Math.sqrt(u)/1.2))),w=Array.from({length:f+1});for(let M=0;M<=f;M++)w[M]=Math.floor(M*M/(f*f)*u);w[f]=u;let x=.2,_=Array.from({length:f}),j=Array.from({length:f});for(let M=0;M<f;M++){let h=w[M],P=w[M+1];_[M]=P-h;let L=0;for(let K=h;K<P;K++)L+=e.pkgCount.get(d[K])??0;j[M]=L}let U=Array.from({length:f});for(let M=0;M<f;M++){let h=(w[M]+w[M+1]-1)/2/Math.max(1,u-1);U[M]=Math.sqrt(Math.max(0,h))}let I=Array.from({length:f});I[0]=U[0];for(let M=1;M<f;M++){let h=_[M-1],P=j[M-1],L=h>0?P/h:1,K=1+x*Math.sqrt(Math.max(0,L-1));I[M]=I[M-1]+(U[M]-U[M-1])*K}let c=Array.from({length:f});for(let M=0;M<f;M++)c[M]=I[M]-U[M];let R=Array.from({length:u}),E=Array.from({length:u}),N=0;for(let M=0;M<u;M++){for(;N<f-1&&M>=w[N+1];)N++;let h=M*137.508%360*Math.PI/180,L=(u<=1?0:Math.sqrt(M/(u-1)))+c[N],K=u===1?g?v:0:v+L*(r-v);R[M]=n+Math.cos(h)*K*s,E[M]=i+Math.sin(h)*K*s}for(let M=0;M<f;M++){let h=w[M],P=w[M+1],L=P-h;if(L===0)continue;let K=Array.from({length:L},()=>!1);for(let ae=h;ae<P;ae++){let ye=d[ae],he=k.get(ye),Me=0,O=0,Q=0;if(he)for(let[me,pe]of he){let ge=a.get(me);ge&&(Me+=ge.x*pe,O+=ge.y*pe,Q+=pe)}let ee=!1;if(Q>0){Me/=Q,O/=Q;let me=Me-n,pe=O-i;me*me+pe*pe>1&&(ee=!0)}let G=-1;if(ee){let me=1/0;for(let pe=0;pe<L;pe++){if(K[pe])continue;let ge=h+pe,Se=R[ge]-Me,De=E[ge]-O,Ae=Se*Se+De*De;Ae<me&&(me=Ae,G=pe)}}else for(let me=0;me<L;me++)if(!K[me]){G=me;break}K[G]=!0;let Y=h+G,te=e.pkgCount.get(ye)??0,Te=Math.min(m,(.012+Math.sqrt(te)*.004)*S);a.set(ye,{x:R[Y],y:E[Y],size:te,groupR:Te*s})}}Kn(e,a)}function Ro(e,t,o){let n=t/2,i=o/2,s=Math.min(t,o)/2,l=e.nodes.length;if(l===0)return;let g=[...e.nodes].toSorted((p,d)=>d.deg-p.deg);for(let p=0;p<l;p++){let d=g[p],u=p*137.508%360*Math.PI/180,r=l<=1?0:Math.sqrt(p/(l-1));d.x=n+Math.cos(u)*r*.85*s,d.y=i+Math.sin(u)*r*.85*s}}function Io(e,t,o,n,{groupOf:i=Ot}={}){let s=e.length,l=n||760,g=o||1100,p=Math.sqrt(g*l/Math.max(s,1))*1.1,d=x=>{let _=0;for(let j of x)_=_*31+j.codePointAt(0)|0;return _},u=Math.ceil(Math.sqrt(s*g/l)),r=Math.ceil(s/u),S=l/(r+1),y=g/(u+1),m=e.map((x,_)=>{let j=_%u,U=Math.floor(_/u),I=d(x);return{file:x,x:(j+1)*y+(I%100-50)*y*.4,y:(U+1)*S+((I>>7)%100-50)*S*.4,dx:0,dy:0}}),T=new Map(m.map((x,_)=>[x.file,_])),a=[];for(let x of e)for(let _ of t.get(x)??[])T.has(_)&&a.push([T.get(x),T.get(_)]);let v=new Map;for(let x=0;x<s;x++){let _=i(m[x].file)??"__own__";v.has(_)||v.set(_,[]),v.get(_).push(x)}let k=Math.min(500,Math.max(180,100+s*3)),f=Math.min(g,l)/6,w=.3;for(let x=0;x<k;x++){let _=f*Math.pow(w/f,x/k);for(let I of m)I.dx=0,I.dy=0;for(let I=0;I<s;I++)for(let c=I+1;c<s;c++){let R=m[I],E=m[c],N=R.x-E.x,M=R.y-E.y,h=Math.sqrt(N*N+M*M);if(h<.01){let L=d(R.file+E.file);N=(L%100-50)*.01||.5,M=((L>>7)%100-50)*.01||.5,h=Math.sqrt(N*N+M*M)}let P=p*p/h;R.dx+=N/h*P,R.dy+=M/h*P,E.dx-=N/h*P,E.dy-=M/h*P}for(let[I,c]of a){let R=m[I],E=m[c],N=R.x-E.x,M=R.y-E.y,h=Math.sqrt(N*N+M*M)||.01,P=h*h/p;R.dx-=N/h*P,R.dy-=M/h*P,E.dx+=N/h*P,E.dy+=M/h*P}let j=.055*Math.min(1,_/(f*.3));for(let[,I]of v){if(I.length<2)continue;let c=0,R=0;for(let E of I)c+=m[E].x,R+=m[E].y;c/=I.length,R/=I.length;for(let E of I)m[E].dx+=(c-m[E].x)*j,m[E].dy+=(R-m[E].y)*j}let U=50;for(let I of m){let c=Math.sqrt(I.dx*I.dx+I.dy*I.dy)||.01;I.x+=I.dx/c*Math.min(c,_),I.y+=I.dy/c*Math.min(c,_),I.x=Math.max(U,Math.min(g-U,I.x)),I.y=Math.max(U,Math.min(l-U,I.y))}}return m}function Co(e,t,o,{statsHeight:n=0,left:i=0,right:s=i,top:l=0,bottom:g=l}={}){let p=Math.max(20,t*.04),d=Math.max(20,o*.04),u=Math.max(1,t-p*2-i-s),r=Math.max(1,o-d*2-n-l-g),S=-1/0,y=-1/0,m=1/0,T=1/0;for(let v of e)m=Math.min(m,v.x),S=Math.max(S,v.x),T=Math.min(T,v.y),y=Math.max(y,v.y);if(e.length===0)return{k:1,tx:t/2,ty:(o-n)/2};let a=Math.min(4,u/Math.max(20,S-m),r/Math.max(20,y-T));return{k:a,tx:p+i+u/2-(m+S)/2*a,ty:d+l+r/2-(T+y)/2*a}}function Xt(e,t,o=!1){let n=o?t:1;return{min:t,max:n*9.99,percent:Math.round(e/n*100)}}function Jn(e,t,o,{width:n=900,rowHeight:i=52,gap:s=42}={}){let l=new Map(e.map(f=>[f.id,f])),g=new Map,p=[];for(let f of o)l.has(f)&&!g.has(f)&&(g.set(f,0),p.push(f));for(let f=0;f<p.length;f++){let w=p[f];for(let x of t.get(w)??[])!l.has(x)||g.has(x)||(g.set(x,g.get(w)+1),p.push(x))}let d=new Map;for(let f of e){let w=g.get(f.id)??null;d.has(w)||d.set(w,[]),d.get(w).push(f)}let u=new Map(e.map(f=>[f.id,[]]));for(let[f,w]of t)if(l.has(f))for(let x of new Set(w))u.get(x)?.push(f);let r=[],S=new Map,y=[...d.keys()].toSorted((f,w)=>(f??1/0)-(w??1/0)),m=f=>Number.isFinite(f.size)&&f.size>0?f.size:0;for(let f of y){let w=d.get(f).slice(),x=new Map(w.map(c=>{let R=u.get(c.id).map(E=>S.get(E)).filter(E=>E&&f!==null&&E.level===f-1);return[c.id,R.length>0?R.reduce((E,N)=>E+N.x+N.width/2,0)/R.length:n/2]}));w.sort((c,R)=>x.get(c.id)-x.get(R.id)||String(c.id).localeCompare(String(R.id)));let _=0;for(let c=1;c<w.length;c++)m(w[c])>m(w[_])&&(_=c);_>0&&w.unshift(w.splice(_,1)[0]);let j=w.reduce((c,R)=>c+m(R),0),U=r.length*(i+s),I=0;for(let c of w){let R=n*(j>0?m(c)/j:1/w.length);S.set(c.id,{id:c.id,level:f,x:I,y:U,width:R,height:i}),I+=R}r.push({level:f,y:U,size:j,proportional:j>0,ids:w.map(c=>c.id)})}let T=[];for(let[f,w]of t)if(S.has(f))for(let x of new Set(w))f!==x&&S.has(x)&&T.push({from:f,to:x});T.sort((f,w)=>String(f.from).localeCompare(String(w.from))||String(f.to).localeCompare(String(w.to)));let a=new Map,v=new Map;for(let f of T)v.has(f.from)||v.set(f.from,[]),a.has(f.to)||a.set(f.to,[]),v.get(f.from).push(f),a.get(f.to).push(f);for(let f of v.values())f.sort((w,x)=>S.get(w.to).x-S.get(x.to).x);for(let f of a.values())f.sort((w,x)=>S.get(w.from).x-S.get(x.from).x);for(let f of v.values())f.forEach((w,x)=>{w.sourcePort=(x+1)/(f.length+1)});for(let f of a.values())f.forEach((w,x)=>{w.targetPort=(x+1)/(f.length+1)});let k=r.reduce((f,w)=>f+w.size,0);for(let f of r)f.share=k>0?f.size/k:null;return{levels:r,rects:S,edges:T,depth:g,totalSize:k,width:n,height:r.length>0?r.length*(i+s)-s:0,gap:s}}function wr(e){let t=[1,3,5].map(n=>{let i=parseInt(e.slice(n,n+2),16)/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return t[0]*.2126+t[1]*.7152+t[2]*.0722>.18?"#000":"#fff"}function Qn(e,t,{theme:o,scale:n,colorOf:i,labelOf:s,sizeLabel:l,dimmed:g,selected:p,hovered:d}){let u=d??p,r=new Set([u]);for(let m of t.edges)m.from===u&&r.add(m.to),m.to===u&&r.add(m.from);let S=m=>m===u||m===p?1:g(m)?.13:u&&!r.has(m)?.22:1;e.save(),e.lineJoin="round";for(let m of t.edges){let T=t.rects.get(m.from),a=t.rects.get(m.to),v=m.from===u||m.to===u;e.globalAlpha=Math.min(S(m.from),S(m.to))*(v?.9:.5),e.strokeStyle=i(m.from),e.fillStyle=i(m.from),e.lineWidth=(v?1.6:1)/n;let k=T.x+T.width*m.sourcePort,f=T.y+T.height,w=a.x+a.width*m.targetPort,x=a.y,_=0,j=1;if(e.beginPath(),e.moveTo(k,f),a.y>T.y){let I=(f+x)/2;e.bezierCurveTo(k,I,w,I,w,x)}else if(a.y===T.y){x=a.y+a.height;let I=f+t.gap*.65;e.bezierCurveTo(k,I,w,I,w,x),j=-1}else{w=a.x+a.width,x=a.y+a.height*m.targetPort;let I=t.width+16+m.sourcePort*20;e.bezierCurveTo(k,f+t.gap/2,I,f+t.gap/2,I,f),e.lineTo(I,x+8),e.quadraticCurveTo(I,x,w,x),_=-1,j=0}e.stroke();let U=3/n;e.beginPath(),e.moveTo(w,x),e.lineTo(w-_*U-j*U,x-j*U+_*U),e.lineTo(w-_*U+j*U,x-j*U-_*U),e.closePath(),e.fill()}e.globalAlpha=1,e.textBaseline="middle",e.textAlign="right",e.fillStyle=o.labelDefault,e.font="11px system-ui, sans-serif";let y=o.edgeIntra(.16);for(let m of t.levels){let a=m.y+26,v=18;e.strokeStyle=y,e.lineWidth=3,e.beginPath(),e.arc(-112,a,v,0,Math.PI*2),e.stroke(),m.share!==null&&m.share>0&&(e.strokeStyle=o.labelDefault,e.beginPath(),e.arc(-112,a,v,-Math.PI/2,-Math.PI/2+m.share*Math.PI*2),e.stroke()),e.textAlign="center",e.font="9px system-ui, sans-serif";let k=m.share===null?"\u2014":m.share>0&&m.share<.001?"<0.1%":`${Number((m.share*100).toFixed(1))}%`;e.fillText(k,-112,a),e.textAlign="right",e.font="11px system-ui, sans-serif",e.fillText(m.level===null?"Unreached":m.level===0?"App":`Level ${m.level}`,-12,m.y+19),e.font="10px system-ui, sans-serif",e.fillText(m.proportional?l(m.size):"No size data",-12,m.y+35),e.font="11px system-ui, sans-serif"}e.textAlign="left";for(let m of t.rects.values()){let{id:T,x:a,y:v,width:k,height:f}=m;if(k<=0)continue;let w=i(T),x=wr(w);if(e.globalAlpha=S(T),e.fillStyle=w,e.fillRect(a,v,k,f),e.strokeStyle=o.bg,e.lineWidth=1/n,e.strokeRect(a,v,k,f),T===p||T===d){e.strokeStyle=o.selectRing,e.lineWidth=1.5/n;let _=Math.min(k/2,.75/n);e.strokeRect(a+_,v+_,Math.max(0,k-_*2),f-_*2)}k*n<28||(e.save(),e.beginPath(),e.rect(a+7,v+4,Math.max(0,k-14),f-8),e.clip(),e.fillStyle=x,e.font="500 12px system-ui, sans-serif",e.fillText(s(T),a+9,v+21),e.fillStyle=x,e.font="10px system-ui, sans-serif",e.fillText(l(T),a+9,v+38),e.restore())}e.restore()}function ei(e,t,o=[],{width:n=1200,height:i=800,cycleImportsOf:s=t}={}){e=[...new Set(e)].toSorted();let l=new Set(e),g=new Map(e.map(O=>[O,[...new Set(t.get(O)??[])].filter(Q=>Q!==O&&l.has(Q)).toSorted()])),p=new Map(e.map(O=>[O,new Set(s.get(O)??[])])),d=new Map(e.map(O=>[O,[]]));for(let[O,Q]of g)for(let ee of Q)d.get(ee).push(O);let{groups:u,componentOf:r}=wo(e,p),S=u.filter(O=>O.length>1),y=new Set(S.flat()),m=u.map(()=>new Set),T=u.map(()=>0);for(let[O,Q]of g)for(let ee of Q){if(!p.get(O).has(ee))continue;let G=r.get(O),Y=r.get(ee);G!==Y&&!m[G].has(Y)&&(m[G].add(Y),T[Y]++)}let a=new Set(o.map(O=>r.get(O)).filter(O=>O!==void 0)),v=u.map(()=>0),k=[],f=new Set,w=O=>{f.has(O)||(f.add(O),k.push(O))};a.forEach(w),T.forEach((O,Q)=>{O||w(Q)});for(let O=0;O<k.length;O++){let Q=k[O];for(let ee of m[Q])a.has(ee)||(v[ee]=Math.max(v[ee],v[Q]+1)),--T[ee]===0&&w(ee)}let x=new Map(e.map(O=>[O,v[r.get(O)]])),_=new Map;for(let O of e){let Q=x.get(O);_.has(Q)||_.set(Q,[]),_.get(Q).push(O)}let j=[..._.keys()].toSorted((O,Q)=>O-Q),U=new Map,I=O=>O.forEach((Q,ee)=>U.set(Q,(ee+.5)/O.length));for(let O of _.values())I(O);for(let O=0;O<12;O++)for(let Q of O%2?j.toReversed():j){let ee=_.get(Q),G=new Map(ee.map(Y=>{let te=(O%2?g:d).get(Y);return[Y,te.length>0?te.reduce((Te,me)=>Te+U.get(me),0)/te.length:U.get(Y)]}));ee.sort((Y,te)=>G.get(Y)-G.get(te)||U.get(Y)-U.get(te)||Y.localeCompare(te)),I(ee)}let c=Math.max(.6,Math.min(2.4,n/Math.max(1,i))),R=Math.max(160,Math.sqrt(e.length*1100*c)),E=Math.max(120,R/c),N=j.at(-1)??0,M=new Map;for(let[O,Q]of _)Q.forEach((ee,G)=>{let Y=U.get(ee)*R,te=(O+.5)/(N+1)*E;M.set(ee,{id:ee,x:Y,y:te+(G%5-2)*9,anchorY:te,vx:0,vy:0,level:O,cycle:y.has(ee),degree:g.get(ee).length+d.get(ee).length})});let h=[];for(let[O,Q]of g)for(let ee of Q)h.push({from:O,to:ee,cycle:p.get(O).has(ee)&&y.has(O)&&r.get(O)===r.get(ee)});let P=h.map(O=>{let Q=M.get(O.from),ee=M.get(O.to),G=26+Math.sqrt(Math.max(Q.degree,ee.degree))*5;return{a:Q,b:ee,length:G,strength:.065/Math.sqrt(Math.min(Q.degree,ee.degree)||1),cycle:O.cycle}}),L=[...M.values()],K=80;for(let O=0;O<240;O++){let Q=new Map,ee=7*(1-O/240)+.15;for(let G=0;G<L.length;G++){let Y=L[G];Y.fx=(R/2-Y.x)*.002,Y.fy=(Y.anchorY-Y.y)*.018,Y.gx=Math.floor(Y.x/K),Y.gy=Math.floor(Y.y/K);let te=`${Y.gx},${Y.gy}`;Q.has(te)||Q.set(te,[]),Q.get(te).push(G)}for(let G=0;G<L.length;G++){let Y=L[G];for(let te=Y.gx-1;te<=Y.gx+1;te++)for(let Te=Y.gy-1;Te<=Y.gy+1;Te++)for(let me of Q.get(`${te},${Te}`)??[]){if(me<=G)continue;let pe=L[me],ge=Y.x-pe.x,Se=Y.y-pe.y,De=ge*ge+Se*Se;if(De>K*K)continue;De<.01&&(ge=G%2?.1:-.1,Se=.1);let Ae=Math.hypot(ge,Se),Xe=Math.min(18,100/Ae-100/K+Math.max(0,22-Ae)*.6),qe=ge/Ae*Xe,_e=Se/Ae*Xe;Y.fx+=qe,Y.fy+=_e,pe.fx-=qe,pe.fy-=_e}}for(let{a:G,b:Y,length:te,strength:Te,cycle:me}of P){let pe=Y.x-G.x,ge=Y.y-G.y,Se=Math.hypot(pe,ge)||1,De=(Se-te)*Te,Ae=pe/Se*De,Xe=ge/Se*De;if(G.fx+=Ae,G.fy+=Xe,Y.fx-=Ae,Y.fy-=Xe,!me&&ge<22){let qe=(22-ge)*.018;G.fy-=qe,Y.fy+=qe}}for(let G of L){G.vx=(G.vx+G.fx)*.55,G.vy=(G.vy+G.fy)*.55;let Y=Math.hypot(G.vx,G.vy)||1,te=Math.min(1,ee/Y);G.x+=G.vx*te,G.y+=G.vy*te}}let ae=-1/0,ye=-1/0,he=1/0,Me=1/0;for(let O of L)he=Math.min(he,O.x),Me=Math.min(Me,O.y),ae=Math.max(ae,O.x),ye=Math.max(ye,O.y);for(let O of L)O.x+=16-he,O.y+=16-Me;return{nodes:M,edges:h,depth:x,incoming:d,links:g,cycles:S,roots:new Set(o.filter(O=>l.has(O))),width:L.length>0?ae-he+32:32,height:L.length>0?ye-Me+32:32}}function kr(e){return Math.max(2.5,Math.min(6,4.5*Math.sqrt(e)))}function ti(e,t,o,{theme:n,viewport:i,width:s,height:l,colorOf:g,dimmed:p,selected:d,hovered:u,query:r}){let{k:S,tx:y,ty:m}=i,T=kr(S),a=u??d,v=new Set([a,...t.links.get(a)??[],...t.incoming.get(a)??[]]),k=new Map;for(let[c,R]of t.nodes){let E=o.nodeByFile.get(c);k.set(c,{x:R.x*S+y,y:R.y*S+m,color:g(E.pkg),n:E,p:R,dim:c===a||c===d?1:p(E)?.12:a&&!v.has(c)?.16:1})}e.save();let f=(c,R)=>{let E=k.get(c.from),N=k.get(c.to);if(Math.max(E.x,N.x)<-40||Math.min(E.x,N.x)>s+40||Math.max(E.y,N.y)<-80||Math.min(E.y,N.y)>l+80)return;e.globalAlpha=R?.85:Math.min(E.dim,N.dim)*(a?.12:.22),e.strokeStyle=R?E.color:n.labelDefault,e.lineWidth=R?1.4:.7,e.setLineDash(c.cycle?[3,3]:[]);let M=N.x-E.x,h=N.y-E.y,P=Math.hypot(M,h)||1,L=M/P,K=h/P,ae=E.x+L*(T+1),ye=E.y+K*(T+1),he=N.x-L*(T+3),Me=N.y-K*(T+3),O=c.cycle?Math.min(18,P*.15):0,Q=(ae+he)/2-K*O,ee=(ye+Me)/2+L*O;if(e.beginPath(),e.moveTo(ae,ye),e.quadraticCurveTo(Q,ee,he,Me),e.stroke(),R||S>=.85||o.nodes.length<=50){let G=Math.atan2(Me-ee,he-Q),Y=R?5:3.5;e.setLineDash([]),e.fillStyle=e.strokeStyle,e.beginPath(),e.moveTo(he,Me),e.lineTo(he-Math.cos(G-.5)*Y,Me-Math.sin(G-.5)*Y),e.lineTo(he-Math.cos(G+.5)*Y,Me-Math.sin(G+.5)*Y),e.closePath(),e.fill()}};for(let c of t.edges)c.from!==a&&c.to!==a&&f(c,!1);for(let c of t.edges)(c.from===a||c.to===a)&&f(c,!0);e.setLineDash([]);let w=new Map,x=c=>{let R=[];for(let E=Math.floor(c.x/64);E<=Math.floor((c.x+c.w)/64);E++)for(let N=Math.floor(c.y/24);N<=Math.floor((c.y+c.h)/24);N++)R.push(`${E},${N}`);return R},_=c=>{for(let R of x(c))w.has(R)||w.set(R,[]),w.get(R).push(c)},j=(c,R)=>c.x<R.x+R.w&&R.x<c.x+c.w&&c.y<R.y+R.h&&R.y<c.y+c.h,U=[...k.values()].filter(c=>c.x>=-10&&c.x<=s+10&&c.y>=-10&&c.y<=l+10);for(let c of U)e.globalAlpha=c.dim,e.fillStyle=c.color,e.beginPath(),e.arc(c.x,c.y,T,0,Math.PI*2),e.fill(),(c.p.cycle||c.n.totalIssues>0)&&(e.strokeStyle=c.p.cycle?"#c47ad7":c.color,e.lineWidth=1,e.beginPath(),e.arc(c.x,c.y,T+2.5,0,Math.PI*2),e.stroke()),(c.n.file===d||c.n.file===u)&&(e.strokeStyle=n.selectRing,e.lineWidth=1.5,e.beginPath(),e.arc(c.x,c.y,T+4,0,Math.PI*2),e.stroke()),_({x:c.x-T-2,y:c.y-T-2,w:T*2+4,h:T*2+4});e.font='11px SFMono-Regular, Consolas, "Liberation Mono", monospace',e.textBaseline="top",e.textAlign="center",U.sort((c,R)=>{let E=N=>N.n.file===a?1e9:N.n.file===d?1e8:r&&N.dim===1?1e7:a&&v.has(N.n.file)?1e6:t.roots.has(N.n.file)?1e5:N.n.deg;return E(R)-E(c)});let I=0;for(let c of U){let R=c.n.file===a||c.n.file===d;if(!R&&c.dim<.5||!R&&!r&&!a&&S<1&&I>=24)continue;let E=c.n.label.length>38?`${c.n.label.slice(0,36)}\u2026`:c.n.label,N=e.measureText(E).width+8,M={x:c.x-N/2,y:c.y+T+5,w:N,h:16};M.x<4||M.x+M.w>s-4||M.y+M.h>l-24||!R&&x(M).some(h=>w.get(h)?.some(P=>j(M,P)))||(_(M),I++,e.globalAlpha=.94,e.fillStyle=n.bg,e.fillRect(M.x,M.y-1,M.w,M.h),e.globalAlpha=1,e.fillStyle=R?n.labelSelected:n.labelDefault,e.fillText(E,c.x,M.y))}e.restore()}function oi(e){let t=e.nodes.map(i=>({node:i})),o=new Map(t.map(i=>[i.node.file,i])),n=e.edges.flatMap(i=>{let s=o.get(i.a),l=o.get(i.b);return s&&l?[{edge:i,a:s,b:l}]:[]});return{nodes:t,edges:n,graph:e,selected:void 0,neighbors:new Set}}function ni(e,{viewport:t,selected:o,visible:n,dimmed:i,radius:s,color:l,paintKey:g}){if(g===void 0||e.paintKey!==g){let p=new Map;for(let d of e.nodes){let u=d.node;d.visible=n(u),d.visible&&(d.x=u.x*t.k+t.tx,d.y=u.y*t.k+t.ty,d.radius=s(u),d.dimmed=i(u),p.has(u.pkg)||p.set(u.pkg,l(u.pkg)),d.color=p.get(u.pkg))}e.paintKey=g}if(e.selected!==o){e.selected=o,e.neighbors.clear();for(let p of e.graph.adj.get(o)??[]){let d=e.graph.edges[p];e.neighbors.add(d.a),e.neighbors.add(d.b)}}}function ii(e,t,o,n){if(e.paints&&e.edgeOpacity===t&&e.neutral===o&&e.edgeSelected===n)return e.paints;let i=g=>({opacity:Math.max(0,Math.min(255,Math.round(g*255)))/255,neutral:o(g*.7)}),s=n?t*.25:t,l=n?.85:Math.min(.9,t+.5);return e.paints={base:i(s),emphasis:i(l),baseDim:i(Math.min(s,.04)),emphasisDim:i(Math.min(l,.04))},e.edgeOpacity=t,e.neutral=o,e.edgeSelected=n,e.paints}function ri(e,t){let{a:o,b:n}=e;return(!e.gradient||e.ax!==o.node.x||e.ay!==o.node.y||e.bx!==n.node.x||e.by!==n.node.y||e.colorA!==o.color||e.colorB!==n.color)&&(e.gradient=t.createLinearGradient(o.node.x,o.node.y,n.node.x,n.node.y),e.gradient.addColorStop(0,o.color),e.gradient.addColorStop(1,n.color),e.ax=o.node.x,e.ay=o.node.y,e.bx=n.node.x,e.by=n.node.y,e.colorA=o.color,e.colorB=n.color),e.gradient}function si(e,t,o){return(!e.halo||e.haloX!==e.x||e.haloY!==e.y||e.haloRadius!==t||e.haloColor!==e.color)&&(e.halo=o.createRadialGradient(e.x,e.y,0,e.x,e.y,t),e.halo.addColorStop(0,e.color+"55"),e.halo.addColorStop(1,e.color+"00"),e.haloX=e.x,e.haloY=e.y,e.haloRadius=t,e.haloColor=e.color),e.halo}function ai(e,t,o,n){return e.x<-2&&t.x<-2||e.x>o+2&&t.x>o+2||e.y<-2&&t.y<-2||e.y>n+2&&t.y>n+2}function To(e,t,o,n,i){return e+o<-2||e-o>n+2||t+o<-2||t-o>i+2}function li(e){let o=new Map;for(let[n,i]of e.entries()){let s=Math.floor(i.x/32),l=Math.floor(i.y/32);o.has(s)||o.set(s,new Map);let g=o.get(s);g.has(l)||g.set(l,[]),g.get(l).push({node:i,index:n})}return(n,i,s,l,g,p)=>{let{k:d,tx:u,ty:r}=s,S=(l+6)/d+1e-7,y=(n-u)/d,m=(i-r)/d,T=Math.floor((y-S)/32),a=Math.floor((y+S)/32),v=Math.floor((m-S)/32),k=Math.floor((m+S)/32),f=null,w=1/0,x=1/0;for(let _=T;_<=a;_++){let j=o.get(_);if(j)for(let U=v;U<=k;U++)for(let{node:I,index:c}of j.get(U)??[]){if(!p(I))continue;let R=I.x*d+u-n,E=I.y*d+r-i,N=R*R+E*E,M=g(I)+6;N<M*M&&(N<w||N===w&&c<x)&&(f=I,w=N,x=c)}}return f}}function ci(e,t,o,n,i){if(!e||e.key!==t.key)return null;let s=(t.tx-e.tx)*i,l=(t.ty-e.ty)*i;if(!Number.isInteger(s)||!Number.isInteger(l)||!Number.isInteger(s/i)||!Number.isInteger(l/i)||!s&&!l||Math.abs(s)>=o*i||Math.abs(l)>=n*i)return null;let g=s/i,p=l/i,d=[],u=2;return g>0&&d.push({x:0,y:0,w:Math.min(o,g+u),h:n}),g<0&&d.push({x:Math.max(0,o+g-u),y:0,w:Math.min(o,-g+u),h:n}),p>0&&d.push({x:0,y:0,w:o,h:Math.min(n,p+u)}),p<0&&d.push({x:0,y:Math.max(0,n+p-u),w:o,h:Math.min(n,-p+u)}),{dx:s,dy:l,rects:d}}function qt(e,t,o,n,i){return e&&e.rects.every(s=>n<s.x||t>s.x+s.w||i<s.y||o>s.y+s.h)}var $r={critical:"#ff5470",high:"#ff9d4a",medium:"#f4d35e",low:"#67c2ff",high_bug:"#a06c3f",bug:"#7a6d62",informational:"#218bff"},Wt={dark:{bg:"#0c0c0c",grid:"rgba(255, 255, 255, 0.022)",selectRing:"#ffffff",edgeIntra:e=>`rgba(180, 195, 215, ${e})`,hubRing:e=>`rgba(255, 255, 255, ${e})`,labelFill:"rgba(230, 233, 238, 0.78)",labelShadow:"rgba(12, 12, 12, 0.98)",labelOutline:"rgba(12, 12, 12, 0.9)",labelDefault:"rgba(200, 210, 225, 0.78)",labelHover:"rgba(230, 237, 243, 0.95)",labelSelected:"#fff"},light:{bg:"#f6f8fa",grid:"rgba(0, 0, 0, 0.04)",selectRing:"#0969da",edgeIntra:e=>`rgba(50, 70, 100, ${e})`,hubRing:e=>`rgba(0, 0, 0, ${e})`,labelFill:"rgba(40, 50, 70, 0.85)",labelShadow:"rgba(255, 255, 255, 0.95)",labelOutline:"rgba(255, 255, 255, 0.9)",labelDefault:"rgba(50, 60, 80, 0.85)",labelHover:"rgba(20, 25, 35, 0.95)",labelSelected:"#000"},pink:{bg:"#fff0f7",grid:"rgba(0, 0, 0, 0.04)",selectRing:"#0969da",edgeIntra:e=>`rgba(50, 70, 100, ${e})`,hubRing:e=>`rgba(0, 0, 0, ${e})`,labelFill:"rgba(40, 50, 70, 0.85)",labelShadow:"rgba(255, 255, 255, 0.95)",labelOutline:"rgba(255, 255, 255, 0.9)",labelDefault:"rgba(50, 60, 80, 0.85)",labelHover:"rgba(20, 25, 35, 0.95)",labelSelected:"#000"}},Mr={...Wt.light,bg:"#fff",selectRing:"#000",edgeIntra:e=>`rgba(0, 0, 0, ${e})`,labelFill:"#000",labelShadow:"#fff",labelOutline:"#fff",labelDefault:"#000",labelHover:"#000"};function di(){let e=document.body.classList;return e.contains("theme-paper")?Mr:e.contains("theme-pink")?Wt.pink:e.contains("theme-light")?Wt.light:Wt.dark}var ui=(e,t)=>e.x0<t.x1&&t.x0<e.x1&&e.y0<t.y1&&t.y0<e.y1;function Lo(e){e.sort((o,n)=>n.prio-o.prio);let t=[];for(let o of e){let n=!1;for(let i of t)if(ui(o,i)){n=!0;break}n||t.push(o)}return t}var Sr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ge(e){let t=Math.max(0,Math.min(255,Math.round(e*255)));return Sr[t]}function _r(e,t,o,n){let s=e.querySelector("graph-layout")?.shadowRoot;if(!s)return;let l=s.querySelector("#g2-canvas"),g=s.querySelector("#g2-tooltip"),p=s.querySelector(".graph2-stage"),d=s.querySelector(".g2-stage-stats"),u=s.querySelector("#g2-zoom-pct");if(!l)return;xn();let r=l.getContext("2d"),S=window.devicePixelRatio||1,y=0,m=0,T=0,a={tx:0,ty:0,k:1},v=null,k=0,f=0,w=!0,x=!0,_=new WeakMap,j=null,U=null,I=null,c=()=>t.supportsLayers&&$.bundleLayout==="layers"&&!$.focusedPkg,R=()=>t.supportsLayers&&$.bundleLayout==="dependencies"&&!$.focusedPkg,E=()=>R()&&!ht(t,$.dependencyPackagesView),N=()=>c()||$.bundleLayout==="graph"&&$.packagesView&&(t.canPackagesView??!1)&&!$.focusedPkg,M=null,h=null,P=null;function L(){if(!P&&(P=Nt(t),c()&&t.layerRoots?.appImports.length>0)){if(!P.byPkg.has("__own__")){let b={file:"__own__",pkg:"__own__",label:"App (source not bundled)",size:null,fileCount:0,totalIssues:0};P.nodes.push(b),P.byPkg.set("__own__",b)}P.importsOf.set("__own__",[...new Set([...P.importsOf.get("__own__")??[],...t.layerRoots.appImports])])}return P}function K(){return Ht(t,$.dependencyPackagesView)}let ae=b=>b==="__own__"?"App":M?.depth.get(b)===0?`App \xB7 ${Be(b)}`:Be(b);function ye(b,A,H){if(b.nodes.length>50){Ro(b,A,H);return}let B=Io(b.nodes.map(C=>C.pkg),b.importsOf,A,H,{groupOf:C=>C});he(b.nodes,new Map(B.map(C=>[C.file,C])))}function he(b,A){for(let H of b){let B=A.get(H.file);B&&(H.x=B.x,H.y=B.y)}}function Me(){if(!w)return;if(U=null,I=null,j=null,c()){let C=L();M=Jn(C.nodes.map(X=>({id:X.pkg,size:X.size})),C.importsOf,t.layerRoots?.roots??["__own__"],{width:Math.max(360,f-190)}),w=!1;return}if(R()){let C=K();h=ei(C.nodes.map(X=>X.file),C.importsOf,C.fileLevel?[]:t.layerRoots?.roots??[],{width:f,height:k,cycleImportsOf:C.cycleImportsOf}),w=!1;return}let b=$.layoutCache,A=$.focusedPkg,H=N(),B=H?L().nodes:t.nodes;if(b&&b.files===t.files&&b.w===f&&b.h===k&&b.focused===A&&(b.pkgView??!1)===H)he(B,b.pos);else{if(H)ye(L(),f,k);else if(A)if(t.nodes.length>50)Ro(t,f,k);else{let X=Io(t.files,t.importsOf,f,k);he(t.nodes,new Map(X.map(J=>[J.file,J])))}else Zn(t,f,k);let C=new Map;for(let X of B)C.set(X.file,{x:X.x,y:X.y});$.layoutCache={files:t.files,w:f,h:k,pos:C,focused:A,pkgView:H}}w=!1}function O(){if(R()&&h){if(K().nodes.length<=100){let ie=12;r.save(),r.font='11px SFMono-Regular, Consolas, "Liberation Mono", monospace';for(let re of K().nodes){let W=re.label.length>38?`${re.label.slice(0,36)}\u2026`:re.label;ie=Math.max(ie,r.measureText(W).width/2+4)}return r.restore(),Co([...h.nodes.values()],m,y,{statsHeight:T,left:ie,top:12,bottom:27})}let V=Math.max(20,Math.min(m,y)*.04),q=Math.min((m-V*2)/h.width,(y-V*2-T)/h.height,2.5),Z=Math.max(.05,q);return{k:Z,tx:(m-h.width*Z)/2,ty:(y-T-h.height*Z)/2}}if(c()&&M){let V=Math.min((m-24)/(M.width+185),(y-70)/(M.height+M.gap),1.5),q=Math.max(.05,V);return{k:q,tx:(m-(M.width+185)*q)/2+145*q,ty:24+Math.max(0,(y-70-(M.height+M.gap)*q)/2)}}let b=N()?L().nodes:t.nodes;if(b.length<=50){let V=0,q=0,Z=0;r.save(),r.font="600 11px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace";for(let ie of b){let re=N()?ot(ie):(ie.isHub?6:4)*$.nodeSize,W=re*1.85+5;q=Math.max(q,W,r.measureText(ie.label).width/2+6),Z=Math.max(Z,W),V=Math.max(V,W,re+4+13+4)}return r.restore(),Co(b,m,y,{statsHeight:T,left:q,top:Z,bottom:V})}if(b.length===0)return{k:1,tx:m/2,ty:(y-T)/2};let A=-1/0,H=-1/0,B=1/0,C=1/0;for(let V of b)V.x<B&&(B=V.x),V.y<C&&(C=V.y),V.x>A&&(A=V.x),V.y>H&&(H=V.y);let X=Math.max(20,H-C),J=Math.max(20,A-B),fe=(B+A)/2,le=(C+H)/2,de=Math.max(20,Math.min(m,y)*($.focusedPkg?.04:.03)),D=Math.min((m-de*2)/J,(y-de*2-T)/X,4),z=Math.max(.05,D);return{k:z,tx:m/2-fe*z,ty:(y-T)/2-le*z}}function Q(){let b=O();a.k=b.k,a.tx=b.tx,a.ty=b.ty}function ee(){if(!R()){u&&(u.textContent=`${Math.round(a.k*100)}%`);return}let b=Xt(a.k,O().k,!0);u&&(u.textContent=`${b.percent}%`),Jt&&(Jt.disabled=a.k<=b.min*1.0001),Zt&&(Zt.disabled=a.k>=b.max*.9999)}function G(b,A){return[b*a.k+a.tx,A*a.k+a.ty]}function Y(b,A){return[(b-a.tx)/a.k,(A-a.ty)/a.k]}function te(b){return!$.hidden.has(b.pkg)}function Te(b,A,H,B,C){let X=H+(B==="critical"?4.2:B==="high"?3.4:2.8),J=B==="critical"?1.8:B==="high"?1.5:B==="medium"?1.3:1.1;r.strokeStyle=$r[B],r.globalAlpha=C,r.lineWidth=J,r.beginPath(),r.arc(b,A,X,0,Math.PI*2),r.stroke(),r.globalAlpha=1}function me(b,A,H,B,C,X,J){let de=J?.1:.9,D=2*(1-de)*(H-b)+2*de*(C-H),z=2*(1-de)*(B-A)+2*de*(X-B),V=Math.sqrt(D*D+z*z)||1,q=D/V,Z=z/V;r.beginPath(),J?(r.moveTo(b,A),r.lineTo(b+q*7-Z*2.94,A+Z*7+q*2.94),r.lineTo(b+q*7+Z*2.94,A+Z*7-q*2.94)):(r.moveTo(C,X),r.lineTo(C-q*7+Z*2.94,X-Z*7-q*2.94),r.lineTo(C-q*7-Z*2.94,X-Z*7+q*2.94)),r.closePath()}function pe(b){if($.selectedSeverities.size>0){let H=b.severitySet;if(!H)return!0;let B=!1;for(let C of $.selectedSeverities)if(H.has(C)){B=!0;break}if(!B)return!0}if($.selectedColors.size>0){let H=b.colorSet;if(!H)return!0;let B=!1;for(let C of $.selectedColors)if(H.has(C)){B=!0;break}if(!B)return!0}if($.solo&&b.pkg!==$.solo&&!N()&&!E())return!0;let A=$.pathFilter;if(A){let H=A.toLowerCase(),B=b.pathText?b.pathText.includes(H):b.file.toLowerCase().includes(H),C=b.pkg&&b.pkg.toLowerCase().includes(H),X=b.label&&b.label.toLowerCase().includes(H);if(!B&&!C&&!X)return!0}return!1}function ge(b){let A=(b.isHub?4.9:3.5)*$.nodeSize,H=Math.max(.6,Math.min(1.6,a.k));return A*H}function Se(){let b=p.getBoundingClientRect(),A=y,H=m;m=Math.max(80,b.width),y=Math.max(80,b.height),T=d?(parseFloat(getComputedStyle(d).lineHeight)||0)+8:0,S=window.devicePixelRatio||1,l.width=m*S,l.height=y*S,U=null,_.delete(t),P&&_.delete(P),l.style.width=m+"px",l.style.height=y+"px",r.setTransform(S,0,0,S,0,0),(f===0||k===0)&&(f=m,k=y,w=!0),Me();let B=H>0&&(Math.abs(m-H)/H>.15||Math.abs(y-A)/A>.15);(x||B)&&(Q(),x=!1),_e()}let De=null,Ae=!0,Xe=!1,qe=!1;function _e(){Ae=!0,!(Xe||qe)&&(Xe=!0,De=requestAnimationFrame(()=>{Xe=!1,Ae&&!qe&&(Ae=!1,fi())}))}function fi(){let b=N()?L():t;if(I?.graph!==b){I={graph:b,x0:1/0,y0:1/0,x1:-1/0,y1:-1/0};for(let J of b.nodes)I.x0=Math.min(I.x0,J.x),I.x1=Math.max(I.x1,J.x),I.y0=Math.min(I.y0,J.y),I.y1=Math.max(I.y1,J.y)}let A=ge({isHub:!0})*6+8,B=I.x0*a.k+a.tx>A&&I.y0*a.k+a.ty>A&&I.x1*a.k+a.tx<m-A&&I.y1*a.k+a.ty<y-A&&a.k<=1.4&&b.nodes.length>50&&!c()&&!R(),C={tx:a.tx,ty:a.ty,key:JSON.stringify([a.k,di().bg,$.nodeSize,$.edgeOpacity,v,$.selected,$.solo,$.focusedPkg,N(),$.showAll,$.pathFilter,[...$.selectedSeverities],[...$.selectedColors],[...$.hidden]])},X=B?ci(U,C,m,y,S):null;r.save();try{if(X){r.save(),r.setTransform(1,0,0,1,0,0),r.globalCompositeOperation="copy",r.drawImage(l,X.dx,X.dy),r.restore(),r.beginPath();for(let J of X.rects)r.rect(J.x,J.y,J.w,J.h);r.clip()}gi(X),U=B?C:null}finally{r.restore()}}function gi(b){let A=di();r.fillStyle=A.bg,r.fillRect(0,0,m,y),hi(A);let H=R(),B=N(),C=H?K():B?L():t,X=E()||B?$.solo:$.selected,J=X?C.nodeByFile.get(X):null,fe=J?X:null;if(H){ti(r,h,C,{theme:A,viewport:a,width:m,height:y,colorOf:be,selected:fe,hovered:v,query:$.pathFilter,dimmed:W=>pe(W)}),ee();return}if(c()){r.save(),r.translate(a.tx,a.ty),r.scale(a.k,a.k),Qn(r,M,{theme:A,scale:a.k,selected:fe,hovered:v,colorOf:be,labelOf:ae,sizeLabel:W=>Ze(typeof W=="number"?W:C.byPkg.get(W).size)||"Size unknown",dimmed:W=>pe(C.byPkg.get(W))}),r.restore(),ee();return}if(B&&C.nodes.length<=50){bi(A);return}if($.focusedPkg&&C.nodes.length<=50){mi(A,fe,J);return}_.has(C)||_.set(C,oi(C));let le=_.get(C),de=JSON.stringify([a.k,a.tx,a.ty,$.nodeSize,A.bg,$.solo,$.pathFilter,[...$.selectedSeverities],[...$.selectedColors],[...$.hidden]]);ni(le,{viewport:a,selected:fe,paintKey:de,visible:te,dimmed:pe,radius:ge,color:be});let D=ii(le,$.edgeOpacity,A.edgeIntra,!!fe),z=fe||v,V=.85/a.k,q=.55/a.k,Z=null,ie=null,re=null;r.save(),r.translate(a.tx,a.ty),r.scale(a.k,a.k);for(let W of le.edges){let{edge:ne,a:oe,b:ce}=W;if(!oe.visible||!ce.visible||ai(oe,ce,m,y)||qt(b,Math.min(oe.x,ce.x)-2,Math.min(oe.y,ce.y)-2,Math.max(oe.x,ce.x)+2,Math.max(oe.y,ce.y)+2))continue;let ve=z&&(ne.a===z||ne.b===z),ue=oe.dimmed&&ce.dimmed?ve?D.emphasisDim:D.baseDim:ve?D.emphasis:D.base,we=ne.cross?ri(W,r):ue.neutral,ke=ne.cross?ue.opacity:1,Pe=ne.cross?V:q;we!==ie&&(r.strokeStyle=we,ie=we),ke!==Z&&(r.globalAlpha=ke,Z=ke),Pe!==re&&(r.lineWidth=Pe,re=Pe),r.beginPath(),r.moveTo(oe.node.x,oe.node.y),r.lineTo(ce.node.x,ce.node.y),r.stroke()}r.restore();for(let W of le.nodes){if(!W.visible)continue;let ne=W.node,oe=ne.file===v,ce=ne.file===fe;if(!ne.isHub&&!oe&&!ce||W.dimmed&&!oe&&!ce)continue;let ve=W.radius,ue=W.x,we=W.y,ke=ve*(ce?6:oe?4.5:3);To(ue,we,ke,m,y)||qt(b,ue-ke-2,we-ke-2,ue+ke+2,we+ke+2)||(r.fillStyle=si(W,ke,r),r.beginPath(),r.arc(ue,we,ke,0,Math.PI*2),r.fill())}for(let W of le.nodes){if(!W.visible)continue;let ne=W.node,oe=W.radius,ce=W.x,ve=W.y;if(To(ce,ve,oe+6,m,y)||qt(b,ce-oe-8,ve-oe-8,ce+oe+8,ve+oe+8))continue;let ue=1,we=fe&&ne.file===fe;fe&&!we&&(ue=le.neighbors.has(ne.file)?1:.25),!we&&W.dimmed&&(ue=Math.min(ue,.1)),r.fillStyle=W.color+Ge(ue),r.beginPath(),r.arc(ce,ve,oe,0,Math.PI*2),r.fill(),ne.isHub&&(r.strokeStyle=A.hubRing(.55*ue),r.lineWidth=.8,r.stroke()),ne.issue&&Te(ce,ve,oe,ne.issue,ue)}if(a.k>1.4){let ne=0;if(a.k<9&&!$.showLabels)for(let ce of C.nodes){if(!te(ce))continue;let[ve,ue]=G(ce.x,ce.y);if(!(ve<0||ve>m||ue<0||ue>y)&&(ne++,ne>=50))break}let oe=a.k>=9||ne<50;if($.showLabels||oe){r.font="10px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",r.fillStyle=A.labelFill,r.textAlign="left",r.textBaseline="middle";let ce=11,ve=2,ue=250,we=(se,$e)=>se>-ue&&se<m+ue&&$e>-ue&&$e<y+ue,ke=[];for(let se of C.nodes){if(!te(se))continue;let[$e,Re]=G(se.x,se.y);if(!we($e,Re))continue;let Ie=ge(se);ke.push({file:se.file,x0:$e-Ie,x1:$e+Ie,y0:Re-Ie,y1:Re+Ie})}let Pe=[];for(let se of C.nodes){if(!te(se)||!se.isHub&&a.k<2.4)continue;let[$e,Re]=G(se.x,se.y);if(!we($e,Re))continue;let Ie=ge(se),Le=$e+Ie+4,Ce=Re+1,ze=r.measureText(se.label).width+ve,Oe=se.file===fe,We=se.file===v,Qe=Oe?3:We?2:se.isHub?1:0;Pe.push({file:se.file,n:se,tx:Le,ty:Ce,prio:Qe,x0:Le-ve,x1:Le+ze,y0:Ce-ce/2,y1:Ce+ce/2})}let Je=Lo(Pe.filter(se=>!ke.some($e=>$e.file!==se.file&&ui(se,$e))));for(let se of Je)r.fillText(se.n.label,se.tx,se.ty)}}if(J&&te(J)){let[W,ne]=G(J.x,J.y),oe=ge(J);r.strokeStyle=A.selectRing,r.lineWidth=1.5,r.beginPath(),r.arc(W,ne,oe+5,0,Math.PI*2),r.stroke()}ee()}function hi(b){if(a.k<.4)return;let A=80,H=(a.tx%A+A)%A,B=(a.ty%A+A)%A;r.strokeStyle=b.grid,r.lineWidth=1,r.beginPath();for(let C=H;C<m;C+=A)r.moveTo(C,0),r.lineTo(C,y);for(let C=B;C<y;C+=A)r.moveTo(0,C),r.lineTo(m,C);r.stroke()}function mi(b,A,H){let B=be($.focusedPkg),C=b.hubRing(.55),X=new Set;if(v){X.add(v);for(let z of t.adj.get(v)??[]){let V=t.edges[z];X.add(V.a),X.add(V.b)}}let J=z=>(z.isHub?6:4)*$.nodeSize;for(let z of t.edges){let V=t.nodeByFile.get(z.a),q=t.nodeByFile.get(z.b);if(!V||!q||!te(V)||!te(q))continue;let Z=z.fromLo&&z.fromHi,ie=!Z&&z.fromHi,re=ie?q:V,W=ie?V:q,ne=v&&(z.a===v||z.b===v),oe=A&&(z.a===A||z.b===A),ce=(A||v)&&!ne&&!oe,ve=J(re),ue=J(W),[we,ke]=G(re.x,re.y),[Pe,Je]=G(W.x,W.y),se=Pe-we,$e=Je-ke,Re=Math.sqrt(se*se+$e*$e)||1,Ie=se/Re,Le=$e/Re,Ce=we+Ie*(ve+1.5),ze=ke+Le*(ve+1.5),Oe=Pe-Ie*(ue+3.5),We=Je-Le*(ue+3.5),Qe=Math.min(Re*.15,30),nt=(Ce+Oe)/2-Le*Qe,Fe=(ze+We)/2+Ie*Qe;r.beginPath(),r.moveTo(Ce,ze),r.quadraticCurveTo(nt,Fe,Oe,We);let Ue;oe?Ue=.9:ne?Ue=.85:ce?Ue=.05:Ue=Math.min(.85,$.edgeOpacity*3),r.strokeStyle=B+Ge(Ue),r.lineWidth=oe||ne?1.5:.85,r.stroke(),!ce&&(me(Ce,ze,nt,Fe,Oe,We,!1),r.fillStyle=B+Ge(Math.min(1,Ue+.15)),r.fill(),Z&&(me(Ce,ze,nt,Fe,Oe,We,!0),r.fill()))}for(let z of t.nodes){if(!te(z))continue;let[V,q]=G(z.x,z.y),Z=J(z),ie=z.file===v,re=z.file===A,W=(A||v)&&!X.has(z.file)&&!re?.15:1;if(r.globalAlpha=W,re||ie||z.isHub){let ne=Z*(re?4:ie?3:2.4),oe=r.createRadialGradient(V,q,Z*.6,V,q,ne);oe.addColorStop(0,B+Ge(re?.4:.25)),oe.addColorStop(1,B+"00"),r.fillStyle=oe,r.beginPath(),r.arc(V,q,ne,0,Math.PI*2),r.fill()}r.fillStyle=B,r.beginPath(),r.arc(V,q,Z,0,Math.PI*2),r.fill(),z.isHub&&(r.strokeStyle=C,r.lineWidth=.9,r.stroke()),z.issue&&Te(V,q,Z,z.issue,W),r.globalAlpha=1}r.font="600 11px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",r.textAlign="center",r.textBaseline="top",r.lineJoin="round";let fe=13,le=2,de=[];for(let z of t.nodes){if(!te(z))continue;let[V,q]=G(z.x,z.y),Z=J(z),ie=q+Z+4,re=r.measureText(z.label).width/2+le,W=z.file===A,ne=z.file===v,oe=W?3:ne?2:z.isHub?1:0;de.push({n:z,sx:V,ty:ie,halfW:re,isSel:W,isHov:ne,prio:oe,x0:V-re,x1:V+re,y0:ie,y1:ie+fe})}let D=Lo(de);for(let z of D){let{n:V,sx:q,ty:Z,isSel:ie,isHov:re}=z,W=(A||v)&&!X.has(V.file)&&!ie?.2:1;r.globalAlpha=W,r.shadowColor=b.labelShadow,r.shadowBlur=4,r.strokeStyle=b.labelOutline,r.lineWidth=3,r.strokeText(V.label,q,Z),r.shadowBlur=0,r.fillStyle=ie?b.labelSelected:re?b.labelHover:b.labelDefault,r.fillText(V.label,q,Z),r.globalAlpha=1}if(H&&te(H)){let[z,V]=G(H.x,H.y),q=J(H);r.strokeStyle=b.selectRing,r.lineWidth=1.8,r.beginPath(),r.arc(z,V,q+4,0,Math.PI*2),r.stroke()}ee()}function ot(b){return Math.min(26,5+Math.sqrt(b.fileCount)*1.7)*$.nodeSize}function bi(b){let A=L(),H=$.solo&&A.byPkg.has($.solo)?$.solo:null,B=v??H,C=new Set;if(B){C.add(B);for(let D of A.edges)D.a===B?C.add(D.b):D.b===B&&C.add(D.a)}let X=D=>{if(D.pkg===H||D.pkg===v)return 1;let z=1;return B&&!C.has(D.pkg)&&(z=.2),pe(D)&&(z=Math.min(z,.1)),z};for(let D of A.edges){let z=A.byPkg.get(D.a),V=A.byPkg.get(D.b);if(!z||!V||!te(z)||!te(V))continue;let q=D.fromLo&&D.fromHi,Z=!q&&D.fromHi,ie=Z?V:z,re=Z?z:V,W=B!==null&&(D.a===B||D.b===B),ne=pe(z)&&pe(V),oe=B!==null&&!W||ne,ce=ot(ie),ve=ot(re),[ue,we]=G(ie.x,ie.y),[ke,Pe]=G(re.x,re.y),Je=ke-ue,se=Pe-we,$e=Math.sqrt(Je*Je+se*se)||1,Re=Je/$e,Ie=se/$e,Le=ue+Re*(ce+1.5),Ce=we+Ie*(ce+1.5),ze=ke-Re*(ve+3.5),Oe=Pe-Ie*(ve+3.5),We=Math.min($e*.15,30),Qe=(Le+ze)/2-Ie*We,nt=(Ce+Oe)/2+Re*We,Fe;ne?Fe=.05:W?Fe=.9:oe?Fe=.06:Fe=.5;let Ue=r.createLinearGradient(Le,Ce,ze,Oe);Ue.addColorStop(0,be(ie.pkg)+Ge(Fe)),Ue.addColorStop(1,be(re.pkg)+Ge(Fe)),r.beginPath(),r.moveTo(Le,Ce),r.quadraticCurveTo(Qe,nt,ze,Oe),r.strokeStyle=Ue,r.lineWidth=Math.min(3.5,.8+Math.sqrt(D.count)*.3)*(W?1.3:1),r.stroke(),!oe&&(me(Le,Ce,Qe,nt,ze,Oe,!1),r.fillStyle=be(re.pkg)+Ge(Math.min(1,Fe+.15)),r.fill(),q&&(me(Le,Ce,Qe,nt,ze,Oe,!0),r.fillStyle=be(ie.pkg)+Ge(Math.min(1,Fe+.15)),r.fill()))}for(let D of A.nodes){if(!te(D))continue;let[z,V]=G(D.x,D.y),q=ot(D),Z=D.pkg===v,ie=D.pkg===H,re=be(D.pkg),W=X(D);if(ie||Z){let ne=q*(ie?2.6:2.2),oe=r.createRadialGradient(z,V,q*.6,z,V,ne);oe.addColorStop(0,re+Ge(ie?.4:.25)),oe.addColorStop(1,re+"00"),r.fillStyle=oe,r.beginPath(),r.arc(z,V,ne,0,Math.PI*2),r.fill()}r.fillStyle=re+Ge(W),r.beginPath(),r.arc(z,V,q,0,Math.PI*2),r.fill(),D.issue&&Te(z,V,q,D.issue,W)}r.font="600 11px ui-monospace, SFMono-Regular, Menlo, Monaco, monospace",r.textAlign="center",r.textBaseline="top",r.lineJoin="round";let J=13,fe=2,le=[];for(let D of A.nodes){if(!te(D))continue;let[z,V]=G(D.x,D.y),q=ot(D),Z=V+q+4,ie=r.measureText(D.label).width/2+fe,re=D.pkg===H,W=D.pkg===v,ne=re?1/0:W?1e9:D.fileCount;le.push({p:D,sx:z,ty:Z,isSel:re,isHov:W,prio:ne,x0:z-ie,x1:z+ie,y0:Z,y1:Z+J})}let de=Lo(le);for(let D of de){let{p:z,sx:V,ty:q,isSel:Z,isHov:ie}=D;r.globalAlpha=Math.max(.25,X(z)),r.shadowColor=b.labelShadow,r.shadowBlur=4,r.strokeStyle=b.labelOutline,r.lineWidth=3,r.strokeText(z.label,V,q),r.shadowBlur=0,r.fillStyle=Z?b.labelSelected:ie?b.labelHover:b.labelDefault,r.fillText(z.label,V,q),r.globalAlpha=1}if(H){let D=A.byPkg.get(H),[z,V]=G(D.x,D.y);r.strokeStyle=b.selectRing,r.lineWidth=1.8,r.beginPath(),r.arc(z,V,ot(D)+4,0,Math.PI*2),r.stroke()}ee()}function Eo(b,A){if(R()){let[le,de]=Y(b,A),D=null,z=1/0;for(let[V,q]of h.nodes){let Z=(q.x-le)**2+(q.y-de)**2;Z<z&&Z<(14/Math.max(a.k,.1))**2&&(z=Z,D=K().nodeByFile.get(V))}return D}if(c()){let[le,de]=Y(b,A);for(let D of M.rects.values())if(D.width>0&&le>=D.x&&le<D.x+D.width&&de>=D.y&&de<=D.y+D.height)return L().byPkg.get(D.id);return null}let H=N(),B=H?L():t,C=H&&B.nodes.length<=50;if(B.nodes.length>50){j??=li(B.nodes);let le=4.9*$.nodeSize*Math.max(.6,Math.min(1.6,a.k));return j(b,A,a,le,ge,te)}let X=null,J=1/0,fe=6;for(let le of B.nodes){if(!te(le))continue;let[de,D]=G(le.x,le.y),z=de-b,V=D-A,q=z*z+V*V,Z=(C?ot(le):ge(le))+fe;q<Z*Z&&q<J&&(J=q,X=le)}return X}function xi(b,A,H){if(!g)return;let B=be(b.pkg),C=Be(b.pkg),X=Bt(b.file,b.pkg);it(F`<div class="g2-tt-path">${X}</div><div class="g2-tt-head"><span class="g2-tt-dot" style="${`background:${B}`}"></span> <span class="g2-tt-pkg">${C}</span></div>${b.totalIssues>0?dt(b.own):null}`,g),Po(A,H)}function vi(b,A,H){if(!g)return;let B=be(b.pkg),C=Ze(b.size);it(F`<div class="g2-tt-path">${c()?ae(b.pkg):b.label}</div>${R()?F`<div class="g2-tt-pkg">${K().importedBy.get(b.pkg).length} importers · ${K().importsOf.get(b.pkg)?.length??0} dependencies</div>`:null} ${c()?F`<div class="g2-tt-pkg">${M.depth.has(b.pkg)?`Level ${M.depth.get(b.pkg)} \xB7 shortest import distance from App`:"No known import path from App"}</div>`:null}<div class="g2-tt-head"><span class="g2-tt-dot" style="${`background:${B}`}"></span> <span class="g2-tt-pkg">${b.fileCount} ${b.fileCount===1?"file":"files"}${C?` \xB7 ${C}`:""}</span></div>${b.totalIssues>0?dt(b.own):null}`,g),Po(A,H)}function Po(b,A){let H=p.getBoundingClientRect();g.classList.add("show");let B=g.offsetWidth,C=g.offsetHeight,X=b-H.left,J=A-H.top,fe=H.width,le=H.height,de=12,D=X+de;D+B>fe-4&&(D=X-B-de),D<4&&(D=4);let z=J+de;z+C>le-4&&(z=J-C-de),z<4&&(z=4),g.style.left=`${D}px`,g.style.top=`${z}px`}function Yt(){g&&g.classList.remove("show")}let St=!1,bt=null,Kt=!1,zo=b=>{b.button===0&&(b.target.closest(".g2-stage-overlay, .g2-stage-overlay-tr, .g2-zoom-ctrl")||(St=!0,Kt=!1,bt={x:b.clientX,y:b.clientY,tx:a.tx,ty:a.ty}))},Oo=b=>{let A=p.getBoundingClientRect(),H=b.clientX-A.left,B=b.clientY-A.top;if(St){let J=b.clientX-bt.x,fe=b.clientY-bt.y;Math.abs(J)+Math.abs(fe)>3&&(Kt=!0),a.tx=bt.tx+J,a.ty=bt.ty+fe,Yt(),_e();return}let C=Eo(H,B),X=v;v=C?.file??null,l.style.cursor=C?"default":"grab",C?N()||E()?vi(C,b.clientX,b.clientY):xi(C,b.clientX,b.clientY):X&&Yt(),v!==X&&_e()},Fo=b=>{if(St&&!Kt){let A=p.getBoundingClientRect(),H=b.clientX-A.left,B=b.clientY-A.top,C=Eo(H,B);N()||E()?($.solo=C&&$.solo!==C.pkg?C.pkg:null,$.selected=null,o(),n?.()):($.selected=C?.file??null,o()),_e()}St=!1},No=()=>{let b=v!==null;v=null,Yt(),b&&_e()},Bo=b=>{b.preventDefault();let A=p.getBoundingClientRect(),H=b.clientX-A.left,B=b.clientY-A.top,C=Math.exp(-b.deltaY*.0015),X=O();if(C<1&&a.k<=X.k*1.0001){a.k=X.k;let D=Math.min(.4,(1-C)*3);a.tx+=(X.tx-a.tx)*D,a.ty+=(X.ty-a.ty)*D,_e();return}let[J,fe]=Y(H,B),le=Xt(a.k,X.k,R()),de=Math.max(le.min,Math.min(le.max,a.k*C));a.k=de,a.tx=H-J*a.k,a.ty=B-fe*a.k,_e()};p.addEventListener("mousedown",zo),window.addEventListener("mousemove",Oo),window.addEventListener("mouseup",Fo),p.addEventListener("mouseleave",No),p.addEventListener("wheel",Bo,{passive:!1});function Ho(b){let A=Xt(a.k,O().k,R());b=Math.max(A.min,Math.min(A.max,b));let H=m/2,B=y/2,[C,X]=Y(H,B);a.k=b,a.tx=H-C*a.k,a.ty=B-X*a.k,_e()}let Zt=s.querySelector("#g2-zoom-in"),Jt=s.querySelector("#g2-zoom-out"),yi=s.querySelector("#g2-zoom-fit");Zt?.addEventListener("click",()=>Ho(a.k*1.4)),Jt?.addEventListener("click",()=>Ho(a.k/1.4)),yi?.addEventListener("click",()=>{Q(),_e()}),Se();let Do=new ResizeObserver(()=>Se());Do.observe(p);let jo=new MutationObserver(b=>{for(let A of b){let H=(A.oldValue||"").includes("report-fullscreen"),B=document.body.classList.contains("report-fullscreen");if(H!==B){f=0,k=0,w=!0,x=!0,$.layoutCache=null,setTimeout(()=>Se(),80);return}_e()}});jo.observe(document.body,{attributes:!0,attributeFilter:["class"],attributeOldValue:!0}),_e(),$.graphState={requestDraw:_e,_cleanup:()=>{qe=!0,cancelAnimationFrame(De),Do.disconnect(),jo.disconnect(),p.removeEventListener("mousedown",zo),window.removeEventListener("mousemove",Oo),window.removeEventListener("mouseup",Fo),p.removeEventListener("mouseleave",No),p.removeEventListener("wheel",Bo)}}}function Bl(e,t){let o=document.querySelector("graph-layout")?.shadowRoot;if(!o)return;let n=pi(e),i=o.querySelector("#g2-selection-area");i&&it(En(n,t),i);let s=o.querySelector("#g2-focus-overlay-slot");s&&it(Cn(n),s)}function Hl(e){let t=document.querySelector("graph-layout")?.shadowRoot;if(!t)return;let o=t.querySelector("#g2-top-pkgs-block");o&&it(Ln(pi(e)),o)}function pi(e){let t=$n(e.treeData,e.files,e.ownCounts,e.transitiveCounts,e.severitySets,e.colorSets,e.fileFindings,e.options);if(e.strippedToOrig)for(let o of t.nodes)o.origFile=e.strippedToOrig.get(o.file);return t.canPackagesView=e.canPackagesView??!1,t.supportsLayers=e.supportsLayers??!1,t.layerRoots=e.layerRoots,t.ownSourcePackages=e.ownSourcePackages,t.ownSourceFiles=e.ownSourceFiles,t.reasons=e.reasons??[],t}export{Wi as _swapGraph2Impl,_r as attachGraph2Interaction,pi as buildGraphFromPrep,Bl as refreshSidebar,Hl as refreshTopPkgs};
|
|
12
12
|
/*! Bundled license information:
|
|
13
13
|
|
|
14
14
|
lit-html/lit-html.js:
|