@preventive/triage 1.0.0-alpha.66 → 1.0.0-alpha.68
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/common/bundle-imports.js +20 -0
- package/common/bundle-metadata.js +1 -1
- package/common/bundle-reasons.d.ts +4 -0
- package/common/bundle-reasons.js +38 -1
- package/common/bundle-sources.d.ts +1 -0
- package/common/bundle-sources.js +22 -0
- package/common/managed/npm-packages.js +3 -3
- package/common/managed/routes.js +37 -18
- package/common/managed/stasis-config.ts +7 -0
- package/out/activity.js +4 -4
- package/out/{chunk-J2FWBXFV.js → chunk-2F3CYNPZ.js} +1 -1
- package/out/chunk-2HGKTQ5Q.js +52 -0
- package/out/chunk-4RS3NDOG.js +1 -0
- package/out/chunk-CGRIZ5M5.js +1 -0
- package/out/{chunk-Z6VEV2QL.js → chunk-D37M7J4B.js} +1 -1
- package/out/chunk-GZ46SSTF.js +1 -0
- package/out/{chunk-IZ6MYRYB.js → chunk-HETCVNO4.js} +1 -1
- package/out/chunk-MPXVKVPF.js +3 -0
- package/out/{chunk-24AKGEH3.js → chunk-NB4JBTKK.js} +1 -1
- package/out/{chunk-OVGR4D3M.js → chunk-OAWY4T6R.js} +1 -1
- package/out/chunk-QPGM3DTI.js +42 -0
- package/out/chunk-SCN2TBP2.js +247 -0
- package/out/chunk-VG5RH6KN.js +2 -0
- package/out/chunk-WFDXHPT2.js +12 -0
- package/out/client-managed-import.js +2 -2
- package/out/client-managed.js +19 -19
- package/out/compare.js +12 -12
- package/out/dialogs.js +38 -38
- package/out/graph.js +8 -8
- package/out/index.html +9 -9
- package/out/scan.js +2 -2
- package/out/view.css +1 -1
- package/out/view.js +15 -15
- package/package.json +11 -8
- package/server-managed/activity.ts +21 -12
- package/server-managed/bundle-build-diagnostics.d.ts +1 -1
- package/server-managed/bundle-build-worker.js +140 -19
- package/server-managed/bundle-build.ts +102 -21
- package/server-managed/bundle-cache.ts +28 -6
- package/server-managed/bundle-dependency-reviews.ts +38 -22
- package/server-managed/commit-lockfiles.ts +2 -1
- package/server-managed/db-neon.ts +5 -2
- package/server-managed/dependency-review-comments.ts +38 -16
- package/server-managed/dependency-reviews.ts +17 -14
- package/server-managed/http.ts +178 -70
- package/server-managed/locked-packages.ts +34 -14
- package/server-managed/lockfile-scope.ts +10 -1
- package/server-managed/npm-kept.ts +10 -0
- package/server-managed/npm-patch.ts +188 -53
- package/server-managed/public-workspace.ts +3 -2
- package/server-managed/pull-dependencies.ts +58 -37
- package/server-managed/pull-dependency-reviews.ts +35 -22
- package/server-managed/report-sources.ts +6 -3
- package/server-managed/repository-dependency-reviews.ts +4 -2
- package/server-managed/repository-issues.ts +14 -11
- package/server-managed/stasis-dependencies.ts +170 -0
- package/out/chunk-65PLAG3I.js +0 -12
- package/out/chunk-DCBXCBLL.js +0 -52
- package/out/chunk-F3UI65ZI.js +0 -42
- package/out/chunk-FAG6E5RC.js +0 -3
- package/out/chunk-OBZWBTZL.js +0 -247
- package/out/chunk-PTFQKLKO.js +0 -1
- package/out/chunk-QVKFY4FA.js +0 -1
- package/out/chunk-SYXT3SFP.js +0 -2
- package/out/chunk-WL3SPQB4.js +0 -1
- /package/out/{chunk-WCPJDAYA.js → chunk-D6NVKGGG.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e,e as t,k as n,l as r}from"./chunk-7GJNLCXF.js";import{
|
|
1
|
+
import{c as e,e as t,k as n,l as r}from"./chunk-7GJNLCXF.js";import{l as i}from"./chunk-WFDXHPT2.js";function a(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}var o=(e,t)=>`${`../`.repeat(e.base.split(`/`).length-1)}${t}`;function s({root:e,paths:t},n,r){if(!e||n===`.`)return n;for(let e of r){let r=t.get(`${n}/${e}`);if(r?.endsWith(`/${e}`))return r.slice(0,-e.length-1)}let i=a(e,`${n}/`);return i===null?o(e,n):i.slice(0,-1)||`.`}function c(e,t){if(!e)return{prefix:t,from:null,to:null};let n=t.startsWith(e.other)?t:``;return{prefix:n,from:`./${e.base}${n.slice(e.other.length)}`,to:`./${n||e.other}`}}function l(e){let t=i(e),n=new Map;for(let[r,i]of Object.entries(e?.bundle?.reason??{})){let e=new Set(Array.isArray(i)?i.filter(e=>t.has(e)):[]);e.size>0&&n.set(r,e)}return{stasis:e?.kind===`stasis`,files:t,trees:n}}var u=[[`extra`,`add`],[`metro`,`bundle:metro`]];function d(e){if(e.length!==2)return e;let t=(t,n)=>e.find((r,i)=>r.trees.has(n)&&!r.trees.has(t)&&e[1-i].trees.has(t)&&!e[1-i].trees.has(n)),n=e.map(()=>new Map);for(let[r,i]of u){let a=t(r,i);a&&n[e.indexOf(a)].set(i,r)}let r=t(`metro`,`bundle:metro`);return r&&t(`run`,`bundle`)===r&&n[e.indexOf(r)].set(`bundle`,`run`),e.map((e,t)=>n[t].size===0?e:{...e,trees:new Map([...e.trees].map(([e,r])=>[n[t].get(e)??e,r])),actual:new Map([...n[t]].map(([e,t])=>[t,e]))})}function f(e,t){if(!e.stasis||e.trees.size!==1)return null;let[[n,r]]=e.trees;return r.size===e.files.size&&!t.some(t=>t!==e&&t.trees.has(n))?n:null}var p=e=>e.trees.size===0||e.trees.size===1&&[...e.trees.values()][0].size===e.files.size,m=`reasons:`,h=(e,t)=>`${m}${JSON.stringify([e,t].toSorted())}`;function g(e){if(!e.startsWith(m))return null;try{let t=JSON.parse(e.slice(m.length));return Array.isArray(t)&&t.length===2&&t.every(e=>typeof e==`string`)?t:null}catch{return null}}function _(...e){let t=d(e.map(l));if(t.length===2&&!t.some(p)){let[e,n]=t.map(e=>[...e.trees.keys()].toSorted()),r=e.filter(e=>n.includes(e)),[i,a]=[e,n].map(e=>e.filter(e=>!r.includes(e)));if(i.length>0&&a.length>0)return[...r.map(e=>({id:`reason:${e}`,label:e})),...i.flatMap(e=>a.map(t=>({id:h(e,t),label:`${e} \u2192 ${t}`})))]}let n=t.filter(e=>f(e,t)===null),r=new Set(n.flatMap(e=>[...e.trees.keys()])),i=e=>n.some(t=>t.stasis&&(t.trees.get(e)?.size??0)<t.files.size);return[...r].some(i)?[...r].toSorted().map(e=>({id:`reason:${e}`,label:e})):[]}function v(e,t,n=``){if(!n)return[``,``];let r=g(n),i=d([e,t].map(l)),a=n.startsWith(`reason:`)?n.slice(7):null;return i.map(e=>{let t=r?r.find(t=>e.trees.has(t)):f(e,i)??a;return t==null?n:`reason:${e.actual?.get(t)??t}`})}function y(e,t=``){let n=i(e);if(!t||e?.kind!==`stasis`)return n;let r=e?.bundle?.reason?.[t.replace(/^reason:/u,``)],a=new Set(Array.isArray(r)?r:[]);return new Map([...n].filter(([e])=>a.has(e)))}function b(e,t,n,r){return JSON.stringify([e,t,n,r])}function x(e,t=``){let n=new Map;if(e?.kind!==`stasis`||!e.bundle)return n;let r=t?i(e):null,a=t?y(e,t):null;for(let[t,i]of e.bundle.imports)for(let[e,o]of i)for(let[i,s]of o){let o=typeof s==`string`?[[null,s]]:s;for(let[s,c]of o){if(a&&!a.has(e)&&(r.has(e)||!a.has(c)))continue;let o=b(e,i,t,s);n.set(o,{key:o,parent:e,specifier:i,conditions:t,platform:s,target:c})}}return n}var S=(e,{lo:t,start:n},r)=>e[n+(r-t)/2];function C(e,t,{low:n,high:r},i,a){return e===-t||e-1<n||e!==t&&e+1<=r&&S(i,a,e-1)<S(i,a,e+1)?e+1:e-1}function w(e,t,n,{first:r,n:i,m:a,d:o,...s}){e.a.fill(1,0,r).fill(1,i),e.b.fill(1,0,r).fill(1,a);let c=i,l=a;for(let r=o;r>0;r--){let i=c-l,a=C(i,r,s,t,n[r]),o=S(t,n[r],a);for(let t=a>i?o:o+1;t<c;t++)e.a[t]=e.b[t-i]=1;c=o,l=c-a}for(let t=r;t<c;t++)e.a[t]=e.b[t]=1}function T(e,t,n){let r=0,i=t.length,a=e.length,o=2*(a+i);for(;r<a&&r<i&&e[r]===t[r];)r++;for(;a>r&&i>r&&e[a-1]===t[i-1];)a--,i--;let s={high:a-r,low:r-i},c=[r],l=[{lo:1,start:0}];for(let u=0;u<=s.high-s.low;u++){let d=l[u],f=Math.min(u,s.high),p=Math.max(-u,s.low+(s.low+u&1));l.push({lo:p,start:c.length});for(let m=p;m<=f;m+=2){let f=C(m,u,s,c,d),p=S(c,d,f),h=f>m?p:p+1,g=h;for(;h<a&&h-m<i&&e[h]===t[h-m];)h++;if(o+=2+h-g,c.push(h),h>=a&&h-m>=i)return w(n,c,l,{first:r,n:a,m:i,d:u,...s}),o}}throw Error(`no edit script between two lines`)}var E=/[\p{L}\p{N}_$]+|\s+|[^\p{L}\p{N}_$\s]/gu,ee=2e3,D=800,O=.6;function k(e,t){if(e.length>ee)return null;let n=e.match(E)??[];return n.length>D?null:{line:e,tokens:n,words:n.map(e=>(t.has(e)||t.set(e,t.size),t.get(e)))}}function A({tokens:e,line:t},n){let r=[];for(let i=0,a=0;a<e.length;i+=e[a++].length){if(n[a])continue;let o=r.at(-1);o&&/^\s*$/u.test(t.slice(o[1],i))?o[1]=i+e[a].length:r.push([i,i+e[a].length])}return r}var j=(e,t)=>e.reduce((e,[t,n])=>e+n-t,0)/Math.max(1,t.length);function M(e,t){let n={a:e.words.map(()=>0),b:t.words.map(()=>0)},r=T(e.words,t.words,n),i={a:A(e,n.a),b:A(t,n.b)};return{ranges:i,share:n.a.includes(1)?Math.min(j(i.a,e.line),j(i.b,t.line)):1,steps:r}}function N(e,t){if(e===t)return{a:[],b:[]};let n=new Map,r=k(e,n),i=k(t,n);if(r===null||i===null)return null;let{ranges:a,share:o}=M(r,i);return o<=O?a:null}var P=200,te=5e6,F=6,I=60,L=3;function R(e){let t=new Map;for(let n of e?.tokens??[])t.set(n,(t.get(n)??0)+1);return t}function z(e,t){let n=new Map,r=[e,t].map(e=>e.map(e=>k(e,n))),i=r.map(e=>e.map(R)),a=0,o=(e,t,n)=>{let r=0;for(let[i,o]of e)if(a+=L,(r+=i.length*Math.max(0,o-(t.get(i)??0)))>O*n.length)return 1/0;return r/Math.max(1,n.length)},s=(n,a)=>r[0][n]===null||r[1][a]===null?1/0:Math.min(o(i[0][n],i[1][a],e[n]),o(i[1][a],i[0][n],t[a])),c=(e,t)=>{if(a+=I,s(e,t)===1/0)return 1/0;let{share:n,steps:i}=M(r[0][e],r[1][t]);return a+=i,n<=O?n:1/0},l=new Float64Array(e.length*t.length).fill(NaN);return{share:(n,r)=>{let i=n*t.length+r;return Number.isNaN(l[i])&&(l[i]=e[n]===t[r]?0:c(n,r)),l[i]},floor:s,spent:()=>a}}function B(e,t,{share:n,spent:r}){let i=Array.from({length:e+1},()=>new Float64Array(t+1)),a=(e,t)=>n(e,t)===1/0?-1/0:1e3-n(e,t)+i[e][t];for(let n=0;n<e;n++)for(let e=0;e<t;e++)if(i[n+1][e+1]=Math.max(i[n][e+1],i[n+1][e],a(n,e)),r()>te)return null;let o=[];for(let n=e,r=t;n>0&&r>0;)i[n][r]===i[n][r-1]?r--:i[n][r]===i[n-1][r]?n--:o.push([--n,--r]);return o.toReversed()}function V(e,t,{share:n,floor:r}){let i=[];for(let a=0,o=0;a<e&&o<t;a++){let e=null,s=1/0,c=Array.from({length:Math.min(t,o+F)-o},(e,t)=>[o+t,r(a,o+t)]);for(let[t,r]of c.toSorted((e,t)=>e[1]-t[1]||e[0]-t[0])){if(r>s)break;(n(a,t)<s||n(a,t)===s&&t<e)&&([e,s]=[t,n(a,t)])}e!==null&&(i.push([a,e]),o=e+1)}return i}function H(e,t){if(e.length>P||t.length>P)return[];let n=z(e,t);return B(e.length,t.length,n)??V(e.length,t.length,n)}var U=(e,t,r)=>n(e,t,{...r,discard:!1});function W(t){if(t===null)return``;let n=t.type===`symlink`?t.target:t.data;if(typeof n==`string`)return n.includes(`\0`)?void 0:n;if(!n.includes(0))try{return e(n)}catch{return}}var G=new Set([`none`,`all`,`change`,`trailing`]);function K({horizon:e=1/0,whitespace:t=`none`,ignoreCase:n=!1}={}){if(e!==1/0&&!(Number.isSafeInteger(e)&&e>=0))throw RangeError(`horizon must be a whole number or Infinity, not ${e}`);if(!G.has(t))throw RangeError(`whitespace must be 'none', 'all', 'change' or 'trailing', not ${t}`);if(typeof n!=`boolean`)throw TypeError(`ignoreCase must be a boolean, not ${typeof n}`);return{horizon:e,whitespace:t,ignoreCase:n}}var q=e=>e.reduce((e,{a0:t,a1:n,b0:r,b1:i})=>e+n-t+i-r,0),J=e=>e===``?[]:e.split(/(?<=\n)/u),Y=e=>({...e,ignoreCase:!1,whitespace:`none`}),X=e=>(e.whitespace??`none`)!==`none`||!!e.ignoreCase;function Z(e,n,i,{whitespace:a,ignoreCase:o}){try{return r(e,n,i,{format:`normal`,ignoreCase:o,whitespace:a}),!0}catch(e){if(e instanceof t)return!1;throw e}}function ne(e,t,n,r,i){let a=J(e),o=J(t),s=(e,t,n,r)=>({a0:e,a1:t,b0:n,b1:r,remove:a.slice(e,t),insert:o.slice(n,r)}),c=i.flatMap(({a0:e,a1:t,b0:r,b1:i})=>e===t||r===i?[s(e,t,r,i)]:U(a.slice(e,t).join(``),o.slice(r,i).join(``),n).map(t=>s(e+t.a0,e+t.a1,r+t.b0,r+t.b1))),l=q(c)<q(r)&&Z(e,t,c,n)?c:r;return q(l)<q(i)?l:i}function re(e,t,n){let r=U(e,t,n);return X(n)?ne(e,t,n,r,U(e,t,Y(n))):r}function ie(e,t,n){let r=W(e),i=W(t);if(r===void 0||i===void 0)return{binary:!0,blocks:[],insertions:null,deletions:null};let a=r===i?[]:re(r,i,n),o=0,s=0;for(let{a0:e,a1:t,b0:n,b1:r}of a)s+=r-n,o+=t-e;return{binary:!1,blocks:a,insertions:s,deletions:o}}function ae(e,t,n,r){return Z(e,t,n,K(r))}var Q=/[ \t\n\v\f\r]/u,$=e=>{let t=e.split(`
|
|
2
2
|
`);return t.at(-1)===``&&t.pop(),t};function oe(e,t){for(let n=0,r=0;;n++,r++){let i=``,a=``;for(;n<e.length&&Q.test(e[n]);)i+=e[n++];for(;r<t.length&&Q.test(t[r]);)a+=t[r++];if(i!==a&&new Set(i+a).size>1)return!0;if(n>=e.length||r>=t.length)return!1}}function se(e,t,n){try{if(!ae(e,t,n,{whitespace:`all`}))return!0}catch{return!0}let r=$(e),i=$(t),a=0,o=0;for(let e=0;e<=n.length;e++){let t=e<n.length?n[e].a0:r.length;for(;a<t;a++,o++)if(r[a]!==i[o]&&oe(r[a],i[o]))return!0;e<n.length&&({a1:a,b1:o}=n[e])}return!1}function ce(e,t,{extension:n=!0}={}){let r=e.split(`/`),i=t.split(`/`),a=0;for(;a<r.length-1&&a<i.length-1&&r[a]===i[a];)a++;let o=0;for(;o<r.length-a-1&&o<i.length-a-1&&r.at(-1-o)===i.at(-1-o);)o++;let s={head:a?`${r.slice(0,a).join(`/`)}/`:``,from:r.slice(a,r.length-o).join(`/`),to:i.slice(a,i.length-o).join(`/`),tail:o?`/${r.slice(-o).join(`/`)}`:``},c=s.from.lastIndexOf(`.`);return n&&!s.from.includes(`/`)&&!s.to.includes(`/`)&&c>0&&s.to.lastIndexOf(`.`)===c&&s.from.slice(0,c)===s.to.slice(0,c)?{...s,head:s.head+s.from.slice(0,c),from:s.from.slice(c),to:s.to.slice(c)}:s}export{N as a,H as b,W as c,K as d,ie as e,se as f,ce as g,a as h,o as i,s as j,c as k,_ as l,v as m,y as n,b as o,x as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Db as e,Eb as t,Fb as n,Hb as r,Ib as i,Jb as a,Ob as o,dc as s,jc as c,w as l}from"./chunk-SCN2TBP2.js";import{k as u,l as d}from"./chunk-QPGM3DTI.js";import{e as f,f as p,g as m,j as h}from"./chunk-QRKFPLA4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.md-quote,.md-alert{margin:0;&:not(:first-child),+*{margin-top:.5lh}>:first-child{margin-top:0}>:last-child{margin-bottom:0}}.md-quote{padding-inline-start:.85em;border-inline-start:.25em solid rgb(from currentcolor r g b / .3);color:rgb(from currentcolor r g b / calc(alpha*.78));.md-quote{color:inherit}}.md-alert{--md-alert: var(--info);padding:.35lh .85em;border-inline-start:.25em solid var(--md-alert);background:rgb(from var(--md-alert) r g b / .06);border-radius:0 var(--ui-radius, 4px) var(--ui-radius, 4px) 0}.md-alert-tip{--md-alert: var(--green)}.md-alert-important{--md-alert: var(--purple)}.md-alert-warning{--md-alert: var(--warning)}.md-alert-caution{--md-alert: var(--critical)}.md-alert-title{display:flex;align-items:center;gap:.45em;margin-bottom:.2lh;color:var(--md-alert);font-weight:600}.md-alert-icon{flex:none;width:1.05em;height:1.05em}
|
|
2
2
|
`,v=`.token.comment,.token.prolog,.token.cdata{color:var(--code-comment);font-style:italic}.token.punctuation{color:var(--muted)}.token.string,.token.attr-value,.token.char,.token.regex{color:var(--code-string)}.token.number,.token.boolean,.token.constant,.token.symbol{color:var(--code-number)}.token.keyword,.token.builtin,.token.important,.token.atrule{color:var(--code-keyword)}.token.function,.token.class-name,.token.tag{color:var(--code-function)}.token.operator,.token.entity,.token.url,.token.attr-name,.token.selector{color:var(--code-operator)}.token.variable,.token.property,.token.parameter{color:var(--code-variable)}.token.annotation{color:var(--code-function)}.token.deleted{color:var(--code-deleted)}.token.inserted{color:var(--code-inserted)}.token.italic{font-style:italic}.token.bold{font-weight:700}.code-control{padding:0 .3em;margin:0 .1em;border-radius:3px;font-size:.8em;line-height:0;font-style:normal;font-weight:400;color:var(--warning);background:rgb(from var(--warning) r g b / .14);box-shadow:inset 0 0 0 1px rgb(from var(--warning) r g b / .45);white-space:nowrap;user-select:none}
|
|
3
3
|
`,y=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,b=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="5" width="20.4" height="14" rx="2"/><path d="M5.6 15.6V8.4l3.1 3.6 3.1-3.6v7.2"/><path d="M16.9 8.4v7.2m-2.6-2.9 2.6 2.9 2.6-2.9"/></svg>`,x=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>`;function S(e,t){let n=u.find(t=>t.value===e)?.label??e;return d(e)?.includes(`partial`)?t===`exclude`?`${n} (full only)`:t===`only`?`${n} (partial only)`:n:n}function C(e){return h.filter(t=>e.has(t)).map(e=>f[e]??e).join(`, `)}function w(r=l){let i=[];if(r.filterSeverities.size>0&&i.push({key:`severity`,label:`Severity`,value:C(r.filterSeverities),clear:{filterSeverities:new Set}}),r.filterColors.size>0&&i.push({key:`marks`,label:`Marks`,value:[...r.filterColors].map(e=>m[e]??e).join(`, `),clear:{filterColors:new Set}}),r.filterSources.size===1&&i.push({key:`source`,label:`Source`,value:r.filterSources.has(`own`)?`Sources only`:`Dependencies only`,clear:{filterSources:new Set}}),r.filterAnalyzer&&i.push({key:`analyzer`,label:`Analyzer`,value:r.filterAnalyzer===e?`(none)`:r.filterAnalyzer,clear:{filterAnalyzer:``}}),r.filterModel&&i.push({key:`model`,label:`Model`,value:r.filterModel===n?`(none)`:r.filterModel,clear:{filterModel:``}}),r.filterValidationModel&&i.push({key:`validationModel`,label:`Validation model`,value:r.filterValidationModel===n?`(none)`:r.filterValidationModel,clear:{filterValidationModel:``}}),r.filterRepo&&i.push({key:`repo`,label:`Repository`,value:r.filterRepo===t?`(no repo)`:r.filterRepo,clear:{filterRepo:``}}),d(r.filterRevalidate)&&i.push({key:`revalidate`,label:`Revalidation`,value:S(r.filterRevalidate,r.filterPartial),clear:{filterRevalidate:``,filterPartial:``}}),!r.filterRevalidate&&(r.filterConfMin>0||r.filterConfMax<10)){let e;e=r.filterConfMin>0&&r.filterConfMax<10?`${r.filterConfMin}\u2013${r.filterConfMax}`:r.filterConfMin>0?`\u2265 ${r.filterConfMin}`:`\u2264 ${r.filterConfMax}`,i.push({key:`confidence`,label:`Confidence`,value:e,clear:{filterConfMin:0,filterConfMax:10}})}r.filterInclude&&i.push({key:`search`,label:r.filterIncludeNegate?`Excluding`:`Search`,value:`"${r.filterInclude}"`,clear:{filterInclude:``,filterIncludeNegate:!1}});for(let[e,t]of[[`filterComment`,`comment`],[`filterIssue`,`issue`],[`filterFix`,`fix`],[`filterFlagged`,`flag`]]){let n=r[e];n&&i.push({key:`annotation:${t}`,label:`Annotation`,value:`${n===`with`?`With`:`Without`} ${t}`,clear:{[e]:``}})}return!l.currentWorkspace&&r.filterDuplicates&&i.push({key:`duplicates`,label:`Duplicates`,value:r.filterDuplicates===`with`?`Only rows linked to other reports`:`Exclude rows linked to other reports`,clear:{filterDuplicates:``}}),r.filterCrossContext&&i.push({key:`cross-context`,label:`Context`,value:r.filterCrossContext===`with`?`Only rows across multiple repos or packages`:`Exclude rows across multiple repos or packages`,clear:{filterCrossContext:``}}),r.filterAppStacked&&i.push({key:`app-stacked`,label:`App stack`,value:r.filterAppStacked===`with`?`Only rows with multiple App findings`:`Exclude rows with multiple App findings`,clear:{filterAppStacked:``}}),r.filterSecurity&&i.push({key:`security`,label:`Security`,value:r.filterSecurity===`with`?`Only security-related rows`:`Exclude security-related rows`,clear:{filterSecurity:``}}),i}function T(){return c().filter(e=>s(e).commonTriage===l.shownTriage)}function E(){return l.shownTriage?p[l.shownTriage]??l.shownTriage:null}function D(e,t=r()){let n=T(),s=n.length;i(t);let c;try{c=o(n).length}finally{a()}return{included:c,total:s,excluded:s-c,fields:t,filters:w(t),bucketLabel:E(),focusedOnly:e===`print`&&l.viewMode===`focus`}}var O=`.managed-comment{container:managed-comment / inline-size;white-space:normal}.managed-comment-row{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto;align-items:start;gap:.35rem .65rem;line-height:1.5}.managed-comment-author{grid-column:1;grid-row:1;display:flex;align-items:center;gap:.45rem;min-width:0;max-width:14rem;& strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}}.managed-comment-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.3rem;height:1.3rem;overflow:hidden;border-radius:50%;background:rgb(from var(--muted) r g b / .15);color:var(--muted);font-size:.65rem;font-weight:600;& img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}& img[hidden]{display:none}}.managed-comment-body{grid-column:2;grid-row:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;& a{color:var(--accent);text-decoration:none}& a:hover{text-decoration:underline}& a.comment-self-ref{text-decoration:underline dotted;text-underline-offset:2px}& a.comment-self-ref:hover{text-decoration:underline solid}}.managed-comment-time{color:var(--muted);font-size:.7rem;font-weight:400;white-space:nowrap;text-align:right}.managed-comment-meta{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:.5rem;min-height:1.3rem}.managed-comment-actions{display:flex;align-items:center;gap:.15rem}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr) auto;.managed-comment-body{grid-column:1}.managed-comment-meta{grid-column:2}}@container managed-comment (max-width: 28rem){.managed-comment-row:has(.managed-comment-meta){grid-template-columns:minmax(0,max-content) minmax(0,1fr);.managed-comment-meta{grid-column:1 / -1;grid-row:1}.managed-comment-author,.managed-comment-body{grid-row:2}}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr)}.managed-comment-author{max-width:9rem}}
|
|
4
4
|
`;export{_ as a,v as b,y as c,b as d,x as e,w as f,T as g,E as h,D as i,O as j};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import{b as e,h as t}from"./chunk-HETCVNO4.js";import{a as n}from"./chunk-D6NVKGGG.js";import{a as r,b as i,e as a}from"./chunk-IYPY47MC.js";import{A as o,B as s,D as c,E as l,b as u,c as d,d as f,j as p,m,p as h,s as g,t as _,w as v,z as y}from"./chunk-QRKFPLA4.js";import{B as b,b as x,c as S,i as C,x as ee,z as w}from"./chunk-74AEKRES.js";import{a as T,b as E,c as D}from"./chunk-C4Z6ZBXV.js";import{c as O,f as k,g as A,i as te}from"./chunk-2XUEZHIP.js";var ne=E(class extends D{constructor(e){if(super(e),e.type!==T.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return k}});function re(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function ie(e){return re(e?.commit)}function j(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function ae(e,t){return j(t,c(e))?ie(e?.repo):``}function oe(e,t){let n=e?.advisory?.package,r=e?.repo?.github;if(typeof n!=`string`||n===``||typeof r!=`string`||r===``)return!1;let i=c({repo:{github:r}}),a=i?.split(`/`)[1].toLowerCase();return a!==n.toLowerCase()&&a!==n.replace(/^@[^/]+\//u,``).toLowerCase()?!1:!j(i,typeof t==`string`&&t!==``?c({repo:{github:t}})??t:``)}function se(e,t){if(!oe(e,t))return e;let{repo:n,...r}=e;return{...r,_repoIgnored:!0}}var ce=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`),le=e=>x(e)?e:ce(S(String(e))),M=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:le,createScriptURL:e=>{let t=new URL(e,globalThis.location.href);if(t.origin!==globalThis.location.origin)throw TypeError(`Not a same-origin script: ${t.href}`);return t.href}}),N=e=>M?M.createHTML(e):le(e),ue=e=>M?M.createScriptURL(String(e)):e,P={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,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,keptViewport:null};function de({keepViewport:e=!1}={}){P.graphState?._cleanup?P.graphState._cleanup({keepViewport:e}):e||(P.keptViewport=null),P.graphState=null}function F(e){return e.id??String(e._id)}function fe(e){let t=h(e);return t!==``&&t!==`revalidation`}var pe=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}];function me(e){return pe.find(t=>t.value===e)?.kinds??null}var he=[``,`exclude`,`only`];function ge(e,t){let n=me(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function I(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var _e=e=>e.confidence!==void 0||e.critical===!0;function ve(e){return e.every(e=>e.every(e=>I(e)!==void 0))&&e.some(e=>e.some(_e))}function ye(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:I(e);return r===void 0?t===0:r>=t})}function be(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>I(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(I(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i-1)===r(i);)i--;return i}function xe(e,t){return ve(e)?t:0}function Se(e,t,n){let r=new Set(e.ruledOutIds??[]);for(let t of e)for(let e of t)[`refuted`,`unreachable`].includes(n(e))&&r.add(F(e));for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>ge(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(F(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function Ce(e,t,n,r){let i=xe(e,t),a=e.filter(e=>ye(e,i,r));if(a.length===0)return!1;let o=new Set(ge(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(F(e)))):!1}function we(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=Se(e,t,n);if(!Ce(i,be(e,t),a,n))return!1;let o=xe(i,6);return i.every(e=>!ye(e,o,n)||!e.some(e=>m(e,r)!==`low`)||e.every(e=>a.has(F(e))))}function Te(e){if(!e)return e;let t="`".repeat(Math.max(0,...[...e.matchAll(/`+/gu)].map(e=>e[0].length))+1),n=/^`|`$/u.test(e)||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${t}${n}${e}${n}${t}`}var L=!0;function Ee(e,t=!1){L=e!==!1&&!t}function De(){return L}function R(e){return L?h(e):``}function Oe(e){return h(e)!==``}function ke(e){return e.some(e=>(e.groups??[]).some(e=>e.some(fe)))}function Ae(e){let t=R(e);return t&&t!==`revalidation`?t:null}function je(e){return R(e)===`revalidation`}var Me=new Set([`refuted`,`unreachable`]);function Ne(e){return Me.has(R(e))}function Pe(e){return Me.has(R(e))}function Fe(e){let t=new Set(e);return pe.filter(e=>e.kinds.some(e=>t.has(e)))}function z(e){return RegExp(`(^|/)${e}/`,`u`)}function Ie(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Le=z(`node_modules`),Re=z(`vendor`),B=`node_modules`,ze=z(B),Be=Ie(B);function Ve(e){e!==B&&(B=e,ze=z(e),Be=Ie(e))}var He=null;function Ue(t){He?.length===t.length&&He.every((e,n)=>e===t[n])||(He=[...t],Ve(e(t)))}function We(){return B}function V(e){return ze.test(e)}var Ge=new WeakSet;function Ke(e){let t=!1;for(let n of e??[])for(let e of n.groups??[])for(let n of e){if(n.isApp!==!1)continue;let e=Ge.has(n);`isUpstream`in n&&!e||(V(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,Ge.add(n)):e&&(t=!0,delete n.isUpstream,Ge.delete(n)))}return t}function qe(e){let t=typeof e==`string`?e:``;return Le.test(t)||Re.test(t)||ze.test(t)}var Je=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function Ye(e){return Je.exec(typeof e==`string`?e:``)?.[1]??null}function Xe(e){if(typeof e!=`object`||!e)return null;for(let[t,n]of Object.entries(e))if(typeof n?.name==`string`&&n.name!==``)return`${t}:${n.name}@${typeof n.version==`string`?n.version:``}`;return null}var Ze=null,Qe={byRoot:new Map,byPackage:new Map},$e=e=>`${e?._managedReportId??``}\0${e?._reportName??``}`,et=(e,t)=>`${$e(e)}\0${t}`,tt=e=>c({repo:{github:e.id}})??e.id;function nt(e,t){if(e===null)return null;let n=U(t),r=U(e),[i,a]=[r.commit.toLowerCase(),n.commit.toLowerCase()];return!j(tt(r),tt(n))||r.prefix!==n.prefix||!(i.startsWith(a)||a.startsWith(i))?null:a.length>i.length?t:e}function rt(e){let t=Array.isArray(e)?e:[];if(Ze?.length===t.length&&Ze.every(([e,n],r)=>e===t[r]&&n===e?.groups))return;Ze=t.map(e=>[e,e?.groups]);let n=new Map,r=new Map,i=(e,t,n)=>e.set(t,e.has(t)?nt(e.get(t),n):n);for(let e of t)for(let t of e?.groups??[])for(let e of t){if(!e||e._repoIgnored||oe(e,e._repoFallback))continue;let t=U(e.repo);if(!t.id||!t.commit)continue;let a=Ye(e.file),o=Xe(e.package);if(a!==null){let t=et(e,a),n=r.get(t),i=n===void 0?e.repo:n&&n.pkg===o?nt(n.repo,e.repo):null;r.set(t,i&&{repo:i,pkg:o})}o!==null&&!o.endsWith(`@`)&&i(n,o,e.repo)}Qe={byRoot:r,byPackage:n}}function it(e){return typeof e!=`number`||!Number.isFinite(e)?null:n(e)}function at(e){if(e.length<=1)return{prefix:``,stripped:[...e]};let t=e.map(e=>e.split(`/`)),n=Math.min(...t.map(e=>e.length)),r=0;for(let e=0;e<n-1&&t.every(n=>n[e]===t[0][e]);e++)r=e+1;return r>0&&t[0][r-1].startsWith(`@`)&&r--,r>0&&t[0][r-1]===`node_modules`&&r--,r===0?{prefix:``,stripped:[...e]}:{prefix:`${t[0].slice(0,r).join(`/`)}/`,stripped:t.map(e=>e.slice(r).join(`/`))}}function ot(e){return e.match(Be)?.[1]??e}var H={on:new WeakMap,off:new WeakMap};function st(e){let t=L?H.on:H.off,n=t.get(e);if(n===void 0){let r=L?[Ae(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,tn(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
|
|
2
|
+
`).toLowerCase(),t.set(e,n)}return n}function ct(e){H.on.delete(e),H.off.delete(e)}function lt(e){return[typeof e?.category==`string`?e.category.trim():``,g(e,L)].filter(Boolean).join(` · `)}function ut(e){if(e.length===0)return``;let t=e[0];for(let n=1;n<e.length;n++){for(;t&&!e[n].startsWith(t);)t=t.slice(0,-1);if(!t)return``}return t}function dt(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function ft(e){if(!e)return null;let t=e.trim().replace(/\/$/u,``);return t?/^https?:\/\//iu.test(t)?t:/^github\.com\//iu.test(t)?`https://${t}`:`https://github.com/${t}`:null}var pt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function mt(e){return pt.test(e||``)}function U(e){if(e==null||typeof e==`string`)return{id:e??``,prefix:``,commit:``};let t=l(e);return{id:typeof e.github==`string`?e.github:``,prefix:t?`${t}/`:``,commit:ie(e)}}function ht(e,t,n,r=``){if(mt(e))return null;let i=U(t),a=U(n),o=re(r);if(i.id){let t=c({repo:{github:i.id}}),n=ft(t??i.id),r=j(t,c({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!qe(e)?o:``)||`HEAD`}/${i.prefix}${ot(e)}`}if(V(e))return null;let s=ft(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function gt(e,t){let n=e?.file??``,r=W(e,t);return r?O`<a href="${_t(r)}" target="_blank" rel="noopener">${n}</a>`:n}function _t(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,``)}function vt({start:e,end:t}){return t>e?`#L${e}-L${t}`:`#L${e}`}function W(e,t){if(!e)return null;if(s(e.location))return e.location;let n=ht(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=q(e.line);if(r)return`${n}${vt(r)}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var yt=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,bt=/#L(\d+)(?:-L?(\d+))?$/u;function xt(e){let t=typeof e==`string`?yt.exec(e):null;if(!t)return``;let n=t[2],r=bt.exec(n);if(!r)return`${t[1]}/${n}`;n=n.slice(0,r.index);let i=r[2]?`${r[1]}-${r[2]}`:r[1];return`${t[1]}/${n}:${i}`}var St=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function Ct(e){return e.split(/(\n{2,})/u).map(e=>{if(/^\n+$/u.test(e))return e;let t=e.split(`
|
|
3
|
+
`);return t.some(e=>St.test(e)||K.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function wt(e,t,n){let r=t?/^\n*/u.exec(e)[0]:``,i=e.slice(r.length),a=n?/\n*$/u.exec(i)[0]:``;return r+Ct(i.slice(0,i.length-a.length))+a}function Tt(e){if(!e)return e;let t=e.replaceAll(`\r
|
|
4
|
+
`,`
|
|
5
|
+
`),n=u(t);if(n.length===0)return Ct(t);let r=[],i=0;for(let[e,a]of n)e>i&&r.push(wt(t.slice(i,e),i>0,!0)),r.push(t.slice(e,a)),i=a;return i<t.length&&r.push(wt(t.slice(i),!0,!1)),r.join(``)}var Et=/^( *)(`{3,}|~{3,})(.*)$/u,Dt=/^[a-z0-9+#._-]{1,20}$/u;function Ot(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function kt(e){let t=e.split(`
|
|
6
|
+
`),n=Et.exec(t[0]),r=(n?.[2]??"```").slice(0,3),i=(n?.[3]??``).trim().split(/\s+/u)[0].toLowerCase(),a=!!(t.length>1?Et.exec(t.at(-1)):null)?.[2].startsWith(r),o=n?.[1].length??0,s=t.slice(1,a?-1:void 0);return{lang:Dt.test(i)?i:``,code:(o>0?s.map(e=>Ot(e,o)):s).join(`
|
|
7
|
+
`)}}function At(e){let t=u(e||``);if(t.length===0)return[e];let n=[],r=0,i=(e,t)=>{let r=(t?e.replace(/^\n+/u,``):e).replace(/\n+$/u,``);r&&n.push(r)};for(let[a,o]of t)a>r&&i(e.slice(r,a),r>0),n.push(kt(e.slice(a,o))),r=o;return r<e.length&&i(e.slice(r),!0),n}var G=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,K=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u;function jt(e){return/^ */u.exec(e)[0].length}function Mt(e){let t=e.length;for(;t>0&&!e[t-1].trim();)t--;return e.slice(0,t).join(`
|
|
8
|
+
`)}function Nt(e){let t=[],n=0;for(let r of e)t.push(n),n+=r.length+1;return t}function Pt(e){let t=typeof e==`string`?e:``;if(!t)return[e];let n=u(t),r=t.split(`
|
|
9
|
+
`),i=Nt(r),a=e=>!d(n,i[e])&&!K.test(r[e])&&G.test(r[e]),o=[],s=0,c=0,l=e=>{let t=r.slice(s,e).join(`
|
|
10
|
+
`).replace(/^\n+/u,``).replace(/\n+$/u,``);t.trim()&&o.push(t)};for(;c<r.length;){if(!a(c)){c++;continue}l(c);let e=G.exec(r[c]),t=!!e[2],u=[],f=null,p=!1;for(;c<r.length;){let e=r[c];if(!d(n,i[c])){if(!e.trim()){f.lines.push(``),p=!0,c++;continue}let n=jt(e),r=K.test(e)?null:G.exec(e);if(r&&(!f||n<f.column)){if(!!r[2]!==t)break;f&&u.push(Mt(f.lines)),f={column:r[0].length,lines:[e.slice(r[0].length)]},p=!1,c++;continue}if(n<f.column&&(p||Ft.test(e)||K.test(e)||Rt.test(e)))break}f.lines.push(Ot(e,f.column)),p=!1,c++}f&&u.push(Mt(f.lines)),o.push({ordered:t,start:t?Number(e[2]):null,items:u}),s=c}return o.length===0?[e]:(l(r.length),o)}var Ft=/^ {0,3}(#{1,6})[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/u,It=/^ {0,3}-+[ \t]*$/u;function Lt(e){let t=e.split(`
|
|
11
|
+
`),n=[],r=0,i=e=>{let i=t.slice(r,e).join(`
|
|
12
|
+
`).replaceAll(/^(?:[ \t]*\n)+|(?:\n[ \t]*)+$/gu,``);i.trim()&&n.push(i)};return t.forEach((e,a)=>{let o=Ft.exec(e),s=K.test(e)&&(a===r||!t[a-1].trim()||!It.test(e));!o&&!s||(i(a),n.push(o?{level:o[1].length,text:o[2]}:{rule:!0}),r=a+1)}),n.length===0?[e]:(i(t.length),n)}var Rt=/^ {0,3}>/u,zt=/^ {0,3}> ?/u,Bt=/^[ \t]*\[!(note|tip|important|warning|caution)\][ \t]*$/iu,Vt=/^ {0,3}(?:`{3}|~{3})/u,Ht=/^(?: {0,3}> ?| *(?:[-*+]|\d{1,9}[.)])(?: +|$))*/u,Ut=16,Wt=e=>Ft.test(e)||K.test(e)||Vt.test(e);function Gt(e,t){let n=Et.exec(t);return n?e?n[2][0]===e[0]&&n[2].length>=e.length&&!n[3].trim()?``:e:n[2][0]==="`"&&n[3].includes("`")?``:n[2]:e}function Kt(e){let t=0,n=e.length;for(;t<n&&!e[t].trim();)t++;for(;n>t&&!e[n-1].trim();)n--;return e.slice(t,n).join(`
|
|
13
|
+
`)}function qt(e,{alerts:t=!0}={}){let n=typeof e==`string`?e:``;if(!/^ {0,3}>/mu.test(n))return[e];let r=u(n),i=n.split(`
|
|
14
|
+
`),a=Nt(i),o=e=>Rt.test(i[e])&&!d(r,a[e]),s=[],c=0,l=0;for(;l<i.length;){if(!o(l)){l++;continue}l>c&&s.push(i.slice(c,l).join(`
|
|
15
|
+
`));let e=[],n=``,r=!1;for(;l<i.length;l++){let t=i[l];if(o(l)){let i=t.replace(zt,``),a=n!==``;n=Gt(n,i);let o=i.replace(Ht,``);r=!a&&!n&&o.trim()!==``&&!Wt(o),e.push(i)}else if(r&&t.trim()&&!Wt(t)&&!G.test(t))e.push(t);else break}let a=t?Bt.exec(e[0]):null,u=a?Kt(e.slice(1)):``;s.push({quote:!0,alert:u?a[1].toLowerCase():null,body:u||Kt(e)}),c=l}return c<i.length&&s.push(i.slice(c).join(`
|
|
16
|
+
`)),s}function Jt(e,t=Ut){return t<=0?e:qt(e).map(e=>typeof e==`string`?e:Jt(e.body,t-1)).join(`
|
|
17
|
+
`)}var Yt=/^(\d+)(?:\s*-\s*(\d+))?$/u;function q(e){if(typeof e==`number`)return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=Yt.exec(String(e??``).trim());if(!t)return null;let n=parseInt(t[1],10),r=t[2]===void 0?n:parseInt(t[2],10);return!Number.isFinite(n)||n<1||!Number.isFinite(r)||r<1?null:{start:Math.min(n,r),end:Math.max(n,r)}}function Xt(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:``}function Zt(e){if(e&&typeof e==`object`){let t=q(e.start);if(!t)return null;let n=q(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return q(e)}function Qt(e,t,n=4){let r=typeof e==`string`&&e!==``?e.split(`
|
|
18
|
+
`):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=Zt(t),a=i&&{start:Math.min(i.start,r.length),end:Math.min(i.end,r.length)},o=a?Math.max(1,a.start-n):1,s=a?Math.min(r.length,a.end+n):Math.min(r.length,n*2+1),c=r.slice(o-1,s);return{text:c.join(`
|
|
19
|
+
`),startLine:o,lines:c}}function $t(e,t,n,r,i=null){if(s(e?.url))return e.url;let a=e?.file;if(typeof a!=`string`||a===``)return null;let o=t?.file??``,c=t?.repo?.github,l=t?.auditedCommit,u=()=>c?W({file:a,line:e?.line,repo:t.repo,auditedCommit:l},n):null;if(r===0&&a===o)return W(String(e?.line??``).trim()===String(t?.line??``).trim()?t:{file:a,line:e?.line,repo:t.repo,auditedCommit:l},n);if(U(e?.repo).id)return W({file:a,line:e?.line,repo:e.repo},n);let d=Ye(a),f=Xe(e?.package),p=f===null?d!==null&&d===Ye(o):f===Xe(t?.package);if(c&&p)return u();let m=d===null?null:Qe.byRoot.get(et(t,d)),h=(f===null?null:Qe.byPackage.get(f))??(m&&(f===null||m.pkg===f)?m.repo:null);if(h)return W({file:a,line:e?.line,repo:h},n);if(qe(a)){let t=i?.(e);return t?W({file:t.file,line:e?.line,repo:t.repo},n):null}return c&&!qe(o)?u():W({file:a,line:e?.line,auditedCommit:l},n)}function en(e,{spaced:t=!1,link:n=e=>e.url,lineLinks:r=!1}={}){let i=Array.isArray(e?.evidence)?e.evidence:[];return i.length===0?``:i.map((e,t)=>{let i=y(e),a=n(e,t),s=[`${t+1}. ${a?`[${i}](${a})`:r?Te(i):i}`],c=r?rn(o(e),a):o(e);if(c)for(let e of c.split(`
|
|
20
|
+
`))s.push(` ${e}`);return s.join(`
|
|
21
|
+
`)}).join(t?`
|
|
22
|
+
|
|
23
|
+
`:`
|
|
24
|
+
`)}function tn(e,{repoFallback:t,shipped:n=null}={}){let r=t!==void 0,i=en(e,{link:r?(r,i)=>$t(r,e,t,i,n):void 0,lineLinks:r});return i?`**Evidence:**
|
|
25
|
+
${i}`:``}var nn=/\(\s*(?:lines?|L)\s*(\d+)(?:\s*(?:-|–|—|to)\s*L?(\d+))?\s*\)/giu;function rn(e,t){if(!e||!t||!yt.test(t)||!/\(\s*(?:lines?|L)\s*\d/iu.test(e))return e;let n=_t(t),r=e=>{let t=an(e);return e.replaceAll(nn,(e,r,i,a)=>{let o=d(t,a)?null:q(i?`${r}-${i}`:r);return o?`([${e.slice(1,-1).trim()}](${n}${vt(o)}))`:e})},i=``,a=0;for(let[t,n]of u(e))i+=r(e.slice(a,t))+e.slice(t,n),a=n;return i+r(e.slice(a))}function an(e){let t=[],n=[...e.matchAll(/`+/gu)].map(e=>[e.index,e.index+e[0].length]),r=[],i=new Map;for(let e=n.length-1;e>=0;e--){let t=n[e][1]-n[e][0];r[e]=i.get(t),i.set(t,e)}for(let e=0;e<n.length;e++)r[e]!==void 0&&(t.push([n[e][0],n[r[e]][1]]),e=r[e]);let[a,o,s,c]=[`
|
|
26
|
+
`,`]`,`)`,`>`].map(t=>{let n=Array.from({length:e.length+1},()=>1/0);for(let r=e.length-1;r>=0;r--)n[r]=e[r]===t?r:n[r+1];return n}),l=t.length,u=0;for(let n=0;n<e.length;n++){for(;u<l&&t[u][1]<=n;)u++;if(u<l&&t[u][0]<=n){n=t[u][1]-1;continue}let r=-1;if(e[n]===`[`&&o[n+1]<a[n]){r=o[n+1]+1;let t=e[r]===`(`?s[r]:e[r]===`[`?o[r+1]:1/0;t<a[r]&&(r=t+1)}else if(e[n]===`<`&&c[n+1]<a[n])r=c[n+1]+1;else if((e[n]===`h`||e[n]===`H`)&&/^https?:\/\//iu.test(e.slice(n,n+8))&&!/\w/u.test(e[n-1]??``))for(r=n;r<e.length&&!/\s/u.test(e[r]);)r++;r>n&&(t.push([n,r]),n=r-1)}t.sort((e,t)=>e[0]-t[0]);let d=[];for(let[e,n]of t){let t=d.at(-1);t&&e<t[1]?t[1]=Math.max(t[1],n):d.push([e,n])}return d}function on(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!s(t[2])?null:{label:f(t[1].trim())||t[2],url:t[2]}}function sn(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return A;let r=W(e,t),i=`line ${n}`;return r?O`<a href="${r}" target="_blank" rel="noopener">${i}</a>`:i}function cn(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,``):`https://github.com/${e}`}/commit/${t}`}var ln=[[`Impact`,`impact`],[`Reproduction`,`reproduction`],[`Recommendation`,`recommendation`],[`Confidence reason`,`confidenceReason`],[`Revalidation verdict`,`revalidateVerdict`],[`Revalidation recommendation`,`revalidateRecommendation`]];function un(e,t){let n=[];t&&n.push(`Repo: ${t}`);let r=y(e);r&&n.push(`Location: ${r}`),e?.confidence!=null&&n.push(`Confidence: ${e.confidence}/10`);let i=R(e);i&&n.push(`Revalidation: ${i}`);let a=[];n.length>0&&a.push(n.join(`
|
|
27
|
+
`));let{title:o,body:s}=v(e);o&&a.push(`# ${o}`),s&&a.push(s.trim());let c=en(e,{spaced:!0});c&&a.push(`# Evidence
|
|
28
|
+
|
|
29
|
+
${c}`);for(let[t,n]of ln){if(!L&&n.startsWith(`revalidate`))continue;let r=_(e?.[n],e)?.trim();r&&a.push(`# ${t}
|
|
30
|
+
|
|
31
|
+
${r}`)}return a.join(`
|
|
32
|
+
|
|
33
|
+
`)}function dn(e,{title:t,body:n,labels:r=[]}={}){let i=ft(e);if(!i)return null;let a;try{a=new URL(i).host.toLowerCase()}catch{return null}if(a!==`github.com`)return null;let o=new URLSearchParams;t&&o.set(`title`,t),n&&o.set(`body`,n),r.length>0&&o.set(`labels`,r.join(`,`));let s=o.toString();return s?`${i}/issues/new?${s}`:`${i}/issues/new`}var fn=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,pn=/^[a-zA-Z\d._-]+$/u,mn=/^[1-9]\d{0,9}$/u,hn=/^[a-fA-F\d]{7,40}$/u,gn=/^#[\w-]+$/u,_n=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function vn(e){return e.length<=39&&fn.test(e)}function yn(e){return e.length<=100&&e!==`.`&&e!==`..`&&pn.test(e)}function bn(e){let t;try{t=new URL(e)}catch{return null}if(t.href!==e||t.protocol!==`https:`||t.hostname.toLowerCase()!==`github.com`||t.port||t.username||t.password)return null;let n=t.pathname.split(`/`);if(n.at(-1)===``&&n.pop(),n.length===3&&n[1]===`advisories`){let e=n[2];return _n.test(e)?{url:`https://github.com/advisories/${e}`,label:e}:null}if(n.length===6&&n[3]===`security`&&n[4]===`advisories`){let[,e,t,,,r]=n;return!vn(e)||!yn(t)||!_n.test(r)?null:{url:`https://github.com/${e}/${t}/security/advisories/${r}`,label:r}}if(n.length!==5)return null;let[,r,i,a,o]=n;if(!vn(r)||!yn(i))return null;let s;if(a===`issues`||a===`pull`){if(!mn.test(o))return null;s=`${r}/${i}#${o}`}else if(a===`commit`){if(!hn.test(o))return null;s=`${r}/${i}@${o.slice(0,7)}`}else return null;return{url:`https://github.com/${r}/${i}/${a}/${o}${gn.test(t.hash)?t.hash:``}`,label:s}}var xn=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function Sn(e){if(typeof e!=`string`)return null;let t=Cn(e);return t!==e||xn.test(e)?t.slice(0,8):null}function Cn(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function wn(e,n){let r=t(e,{managed:n});if(!r)return null;let i=Sn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var Tn=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,En=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function Dn(e){let t=e.length;for(;t>0&&En.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function On(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;Tn.lastIndex=0;let i;for(;(i=Tn.exec(e))!==null;){let a=Dn(i[0]),o=a?bn(a)??wn(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,Tn.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var kn={commit:w},An=8;function jn(e){let t;try{t=e?JSON.parse(e):null}catch{return null}let n=e=>typeof e==`string`&&e?e:null;return t&&{tags:Array.isArray(t.tags)?t.tags.filter(n):[],details:typeof t.title==`string`?{title:t.title,authorName:n(t.authorName),authorLogin:n(t.authorLogin),date:Number.isSafeInteger(t.date)?t.date:null}:null}}function Mn({title:e,authorName:t,authorLogin:n,date:r}){let i=document.createElement(`div`);i.className=`tooltip-commit-details`;let a=document.createElement(`span`);a.className=`tooltip-commit-message`,a.textContent=e;let o=document.createElement(`span`);return o.className=`tooltip-commit-meta`,o.textContent=[t&&n&&t!==n?`${t} (@${n})`:t??(n&&`@${n}`),r===null?``:new Date(r).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})].filter(Boolean).join(` · `),i.append(...e?[a]:[],o),i}var J;function Nn(){return J||(J=document.createElement(`div`),J.id=`styled-tooltip`,J.setAttribute(`popover`,`manual`),document.body.append(J),J)}function Pn(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var Y=null,Fn=``,X=null,Z=null,In=0,Ln=0,Rn=!1;function zn(){if(!Rn){Rn=!0,document.addEventListener(`mousemove`,e=>{In=e.clientX,Ln=e.clientY},{passive:!0});for(let e of[`pointerdown`,`wheel`,`scroll`])document.addEventListener(e,()=>$(),{capture:!0,passive:!0});document.addEventListener(`keydown`,e=>{e.key===`Escape`&&$()}),window.addEventListener(`blur`,()=>$())}}var Bn=100,Vn=14,Hn=8,Q=8;function Un(e,{placement:t=`cursor`}={}){zn(),clearTimeout(X),X=null,Z=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=Nn(),i=e.dataset.tooltip??``,a=Object.hasOwn(kn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,o=e.dataset.tooltipRepo??``,s=r(e.dataset.tooltipCommit),c=jn(e.dataset.tooltipCommitInfo),l=[`stasis`,`sourcemap`].includes(e.dataset.tooltipBundle)?e.dataset.tooltipBundle:``,u=e.dataset.tooltipStats??``,d=e.dataset.tooltipBuilt===`true`,f=e.dataset.tooltipPackage??``,p=e.dataset.tooltipEcosystem??``,m=e.dataset.tooltipVersion??``,h=e.dataset.tooltipFiles??``,g=e.dataset.tooltipLoc??``,_=e.dataset.tooltipSize??``,v=e.tooltipContent??null,y=v??JSON.stringify([i,a,o,s,c,l,u,d,f,p,m,h,g,_]);if(!i){$();return}if(Y===e&&Fn===y)return;if(n.textContent=a||v?``:i,v){let e=document.createElement(`div`);e.className=`tooltip-rich`,te(v,e),n.append(e)}if(a){let e=document.createElement(`span`);e.className=`tooltip-text`,e.innerHTML=N(kn[a]);let t=document.createElement(`span`);t.textContent=i,e.append(t),n.append(e)}if(f){let t=document.createElement(`div`);t.className=`tooltip-package`;let r=(e.querySelector(`[data-tooltip-package-icon] svg`)??e.querySelector(`svg`))?.cloneNode(!0);r&&t.append(r);let i=document.createElement(`span`);i.className=`tooltip-package-details`;let a=(e,t)=>/^\d+$/u.test(e)?`${Number(e).toLocaleString()} ${t}`:``;for(let e of[f,m,a(h,h===`1`?`file`:`files`),a(g,`LoC`),_].filter(Boolean)){let t=document.createElement(`span`);t.textContent=e,i.append(t)}t.append(i),n.append(t)}if(o||s){let e=document.createElement(`div`);if(e.className=`tooltip-repo`,o){e.innerHTML=N(ee);let t=document.createElement(`span`);t.textContent=o,e.append(t)}if(s){let t=document.createElement(`span`);t.className=`tooltip-commit`,t.innerHTML=N(w);let n=document.createElement(`span`);n.textContent=s.slice(0,7),t.append(n),e.append(t)}if(n.append(e),s&&c?.tags.length){let e=document.createElement(`div`);e.className=`tooltip-tags`;for(let t of c.tags.slice(0,An)){let n=document.createElement(`span`);n.className=`tooltip-tag`,n.innerHTML=N(b);let r=document.createElement(`span`);r.textContent=t,n.append(r),e.append(n)}if(c.tags.length>An){let t=document.createElement(`span`);t.className=`tooltip-tag-more`,t.textContent=`+${(c.tags.length-An).toLocaleString()} more`,e.append(t)}n.append(e)}}if(c?.details&&n.append(Mn(c.details)),l||u||d){let e=document.createElement(`div`);if(e.className=`tooltip-bundle`,l===`stasis`){let t=document.createElement(`img`);t.src=`./stasis.svg`,t.alt=``,e.append(t)}else e.innerHTML=N(C);let t=document.createElement(`span`);t.textContent=[l===`stasis`?`Stasis`:l===`sourcemap`?`Sourcemap`:``,d?`Built on server`:``,u].filter(Boolean).join(` · `),e.append(t),n.append(e)}Pn(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let x=In,S=Ln+Vn;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();x=n.right+Hn,S=n.top+(t===`right`?n.height/2:0)}let T=window.innerWidth-n.offsetWidth-Q,E=Math.max(Q,Math.min(x,T));n.style.left=`${Math.round(E)}px`;let D=n.offsetHeight,O=t===`right`?S-D/2:S,k=window.innerHeight-D-Q,A=Math.max(Q,Math.min(O,k));n.style.top=`${Math.round(A)}px`,Y=e,Fn=y}function $(e){e&&!e.contains(Y)&&!e.contains(Z)||(clearTimeout(X),X=null,Z=null,J&&(J.classList.remove(`visible`),typeof J.hidePopover==`function`&&J.matches(`:popover-open`)&&J.hidePopover()),Y=null)}function Wn(e,{gate:t,placement:n}={}){zn();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));r()?e===Y||e===Z||($(),Z=e,X=setTimeout(()=>{X=null,Z=null,r()&&Un(e,{placement:n})},Bn)):$()}var Gn=new WeakSet;function Kn(e,t){for(let n of e.composedPath()){if(n===t)break;if(n.nodeType===1&&Object.hasOwn(n.dataset,`tooltip`))return n}return null}function qn(e,t){!e||Gn.has(e)||(Gn.add(e),e.ownerDocument&&zn(),e.addEventListener(`mouseover`,n=>{if(n.buttons){$();return}let r=Kn(n,e);r?r!==Y&&Wn(r,t):$()}),e.addEventListener(`mouseout`,t=>{let n=Kn(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||$()}),e.addEventListener(`scroll`,()=>$(e),{capture:!0,passive:!0}))}var Jn=!1;function Yn(){Jn||(Jn=!0,zn(),document.addEventListener(`tooltip-root-connected`,e=>{qn(e.composedPath()[0]?.shadowRoot)}),document.body.addEventListener(`mouseover`,e=>{if(e.target.closest(`[data-tooltip-managed]`))return;if(e.buttons){$();return}let t=e.target.closest(`[data-tooltip]`);!t||t===Y||Wn(t)}),document.body.addEventListener(`mouseout`,e=>{e.target.closest(`[data-tooltip-managed]`)||e.relatedTarget?.closest?.(`[data-tooltip-managed]`)||!Y&&!X||(Y??Z)?.contains(e.relatedTarget)||$()}))}function Xn(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var Zn=()=>Object.fromEntries(p.map(e=>[e,0]));function Qn(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,Zn());let r=n.get(e.file),i=m(e,t);r[i]!==void 0&&r[i]++}return n}var $n={trees:[],merged:null};function er(e){let t=e.map(e=>e?.tree??null);return t.length===$n.trees.length&&t.every((e,t)=>e===$n.trees[t])||($n={trees:t,merged:tr(e)}),$n.merged}function tr(e){let t=null;for(let n of e)if(n?.tree){t||={};for(let e of Object.keys(n.tree)){let r=n.tree[e];if(!t[e]){t[e]={...r,imports:[...r.imports??[]]};continue}let i=new Set(t[e].imports);for(let n of r.imports??[])i.has(n)||(i.add(n),t[e].imports.push(n));t[e].size==null&&r.size!=null&&(t[e].size=r.size)}}return t}function nr(e,t){let n=Object.keys(e),r=new Map(n.map((e,t)=>[e,t])),i=n.map(()=>Zn()),a=n.map(()=>[]);for(let[t,i]of n.entries())for(let n of e[i].imports??[]){let e=r.get(n);e!==void 0&&a[e].push(t)}let o=new Uint32Array(n.length),s=0;for(let[e,n]of t){let t=r.get(e);if(t===void 0||!n)continue;let c=p.map(e=>[e,n[e]??0]).filter(([,e])=>e!==0);if(c.length===0)continue;let l=++s,u=[],d=e=>{o[e]!==l&&(o[e]=l,u.push(e))};for(let e of a[t])d(e);for(;u.length>0;){let e=u.pop();for(let[t,n]of c)i[e][t]+=n;for(let t of a[e])d(t)}}return new Map(n.map((e,t)=>[e,i[t]]))}function rr(e,t,n){let r=t.get(e),i=n.get(e);return ir(r)>0||ir(i)>0}function ir(e){if(!e)return 0;let t=0;for(let n of p)t+=e[n]??0;return t}function ar(e){if(!e)return null;let t=We(),n=RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,`u`),r=e.match(n);return r?r[1]:`__own__`}function or(e){return new Set(e.filter(e=>!V(e)))}var sr=[`#4e9af1`,`#f28e2b`,`#59a14f`,`#e15759`,`#76b7b2`,`#edc948`,`#b07aa1`,`#ff9da7`,`#9c755f`,`#5cd1e5`,`#f1ce63`,`#d37295`,`#a0cbe8`,`#86bcb6`,`#8cd17d`,`#b6992d`,`#499894`,`#e15759`,`#e879c7`,`#d4a6c8`],cr=[`#2f8aef`,`#d2691e`,`#2ea043`,`#e63946`,`#2e9a92`,`#b88817`,`#9560e8`,`#d24a9c`,`#8a5d40`,`#0891b2`,`#a07a14`,`#c14e8e`,`#1f7ad0`,`#549b94`,`#3fb95f`,`#a07a14`,`#2a8278`,`#cb2c40`,`#c026d3`,`#965f93`];function lr(){if(typeof document>`u`)return!1;let e=document.body?.classList;return!!e&&(e.contains(`theme-light`)||e.contains(`theme-pink`)||e.contains(`theme-w95`)||e.contains(`theme-paper`))}var ur=new Map;function dr(e){let t=lr()?cr:sr;return t[e%t.length]}var fr=()=>lr()?`#8c959f`:`#6e7681`;function pr(e){let t=lr(),n=t?cr:sr,r=e??`__own__`,i=`${t?`l`:`d`}:${r}`;if(ur.has(i))return ur.get(i);let a=0;for(let e of r)a=a*37+e.codePointAt(0)|0;let o=n[((a%n.length+n.length)%n.length*7+3)%n.length];return ur.set(i,o),o}function mr(e,t){if(!t||t===`/`||t===`__own__`)return e;for(let n of[`node_modules`,`dependencies`,We()]){let r=n+`/`+t+`/`,i=e.indexOf(r);if(i>=0)return e.slice(i+r.length)}return e.startsWith(t+`/`)?e.slice(t.length+1):e}function hr(e){let t=e.origFile??e.file,n=mr(t,e.pkg),r=n===t?t:`${a(e.pkg)}/${n}`;return r===t?e.file:r}var gr={package:`@babel/core`,path:/^lib\/config\//u},_r={package:`@babel/core`,path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},vr=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:gr,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:`babel-typescript-preset`,reason:`Babel configuration loads the TypeScript preset.`,from:gr,to:{package:`@babel/preset-typescript`,path:/./u}},{id:`babel-react-native-preset`,reason:`Babel config loaders load the configured React Native preset.`,from:_r,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:_r,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:`babel-transform-plugin`,reason:`Babel config loaders load configured transform plugins.`,from:_r,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 yr(e){return typeof e==`string`&&!e.includes(`\\`)&&!e.includes(`:`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`)}function br(e,t){let n=e.package;return n!==void 0&&t.ownSource===!0?!1:(n===void 0||(typeof n==`string`?n===t.package:n.test(t.package??``)))&&e.path.test(t.path)}function xr(e,t){if(e?.ownSource!==!0&&yr(e?.path)&&yr(t?.path))return vr.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&br(n.from,e)&&br(n.to,t))}function Sr(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??i(e)===`__own__`}}function Cr(e,t,n,r){return!xr(Sr(e,r),Sr(t,n))}function wr(e,t=e=>e.file){let n=new Map(e.nodes.map(e=>[e.file,e])),r=new Map(e.nodes.map(e=>[t(e),new Set]));for(let[i,a]of e.importsOf){let o=n.get(i);if(o)for(let s of a){let a=n.get(s);a&&Cr(o.origFile??i,a.origFile??s,e.ownSourceFiles?.has(s),e.ownSourceFiles?.has(i))&&r.get(t(o)).add(t(a))}}return r}var Tr=class{constructor(e){this.nodes=[...e];for(let[e,t]of this.nodes.entries())t.position=e;for(let e=(this.nodes.length>>1)-1;e>=0;e--)this.down(e)}before(e,t){return Math.abs(e.balance)>Math.abs(t.balance)||Math.abs(e.balance)===Math.abs(t.balance)&&(e.balance>t.balance||e.balance===t.balance&&e.tie<t.tie)}swap(e,t){let n=this.nodes,r=n[e];n[e]=n[t],n[t]=r,n[e].position=e,n[t].position=t}down(e){let t=this.nodes;for(;2*e+1<t.length;){let n=2*e+1;if(n+1<t.length&&this.before(t[n+1],t[n])&&n++,!this.before(t[n],t[e]))break;this.swap(e,n),e=n}}update(e){if(e.position<0)return;let t=e.position;for(;t>0;){let n=t-1>>1;if(!this.before(e,this.nodes[n]))break;this.swap(t,n),t=n}this.down(t)}take(){let e=this.nodes[0],t=this.nodes.pop();return e.position=-1,this.nodes.length>0&&(this.nodes[0]=t,t.position=0,this.down(0)),e}};function Er(e,t){for(let n=0;n<8;n++){let r=!1;for(let i=0;i<e.length-1;i++){let a=n%2?e.length-2-i:i,o=e[a],s=e[a+1];(t.get(s)?.get(o)?.cycleCount??0)<=(t.get(o)?.get(s)?.cycleCount??0)||(e[a]=s,e[a+1]=o,r=!0)}if(!r)break}return e}function Dr(e){let t=[],n=new Set;for(let t of e.values())t.outgoing.sort((e,t)=>t[1]-e[1]||e[0].tie-t[0].tie);for(let r of e.values()){if(n.has(r))continue;let e=[{node:r,next:0}];for(n.add(r);e.length>0;){let r=e.at(-1);if(r.next===r.node.outgoing.length){t.push(r.node.id),e.pop();continue}let i=r.node.outgoing[r.next++][0];n.has(i)||(n.add(i),e.push({node:i,next:0}))}}return t.toReversed()}function Or(e,t){let n=new Map(e.map((e,t)=>[e,t])),r=0;for(let e of t.values())for(let[t,i]of e.outgoing)n.get(e.id)<n.get(t.id)&&(r+=i);return r}function kr(e,t){let n=Or(e,t),r=n,i=0;for(let a=0;a<e.length-1;a++)n-=t.get(e[a]).originalBalance,n>r&&(r=n,i=a+1);return[...e.slice(i),...e.slice(0,i)]}function Ar(e,t){if(e.length<2)return e;let n=new Map(e.map((e,t)=>[e,{id:e,tie:t,balance:0,incoming:[],outgoing:[]}]));for(let e of n.values())for(let r of t.get(e.id)?.values()??[]){let t=n.get(r.to);!t||t===e||!r.cycleCount||(e.outgoing.push([t,r.cycleCount]),t.incoming.push([e,r.cycleCount]),e.balance+=r.cycleCount,t.balance-=r.cycleCount)}for(let e of n.values())e.originalBalance=e.balance;let r=[],i=new Tr(n.values()),a=[];for(;i.nodes.length>0;){let e=i.take();e.balance>=0?r.push(e.id):a.push(e.id);for(let[t,n]of e.outgoing)t.position<0||(t.balance+=n,i.update(t));for(let[t,n]of e.incoming)t.position<0||(t.balance-=n,i.update(t))}let o=e,s=Or(e,n);for(let i of[[...r,...a.toReversed()],Dr(n),e,e.toReversed()]){let e=Er(kr(i,n),t),r=Or(e,n);r>s&&(o=e,s=r)}return o}function jr(e,t){let n=new Set(e),r=new Map(e.map(e=>[e,[]]));for(let[e,i]of t)for(let t of i)n.has(e)&&n.has(t)&&r.get(t).push(e);let i=[],a=new Set;for(let r of e){if(a.has(r))continue;a.add(r);let e=[[r,(t.get(r)??[])[Symbol.iterator]()]];for(;e.length>0;){let[r,o]=e.at(-1),s=o.next();s.done?(i.push(r),e.pop()):n.has(s.value)&&!a.has(s.value)&&(a.add(s.value),e.push([s.value,(t.get(s.value)??[])[Symbol.iterator]()]))}}let o=new Map,s=[];for(let e of i.toReversed()){if(o.has(e))continue;let t=[],n=s.length,i=[e];for(o.set(e,n);i.length>0;){let e=i.pop();t.push(e);for(let t of r.get(e))o.has(t)||(o.set(t,n),i.push(t))}s.push(t.toSorted())}return{groups:s,componentOf:o}}function Mr(e,{expanded:t=new Set,order:n=`structure`,query:r=``,neighborhood:i=null,cyclesOnly:o=!1}={}){let s=new Map,c=new Map,l=new Map;for(let n of e.nodes){let e=t.has(n.pkg),r=`${e?`f`:`p`}:${e?n.file:n.pkg}`;s.has(r)||s.set(r,{id:r,pkg:n.pkg,file:e?n.file:null,label:e?hr(n):a(n.pkg),files:[],size:0,issues:0,incoming:0,outgoing:0,importers:0,dependencies:0});let i=s.get(r);i.files.push(n.file),i.size+=n.size??0,i.issues+=n.totalIssues??0,c.set(n.file,r),l.set(n.file,n.origFile??n.file)}let u=new Map,d=new Set,f=new Set,p=new Map([...s.keys()].map(e=>[e,new Set])),m=0;for(let[t,n]of e.importsOf){let r=c.get(t);if(r)for(let i of new Set(n)){let n=c.get(i);if(!n)continue;u.has(r)||u.set(r,new Map),u.get(r).has(n)||u.get(r).set(n,{from:r,to:n,count:0,cycleCount:0,examples:[]});let a=u.get(r).get(n);a.count++;let h=Cr(l.get(t),l.get(i),e.ownSourceFiles?.has(i),e.ownSourceFiles?.has(t));a.examples.length<80&&(!o||h)&&a.examples.push([t,i]),m++,s.get(r).outgoing++,s.get(n).incoming++,r!==n&&(f.add(r),d.add(n)),h&&(a.cycleCount++,(r!==n||s.get(r).file)&&p.get(r).add(n))}}let h=[...s.keys()].toSorted(),{groups:g,componentOf:_}=jr(h,p),v=new Set(g.flatMap(e=>e.length>1||p.get(e[0]).has(e[0])?e:[]));for(let e of s.values())e.cyclic=v.has(e.id),e.component=_.get(e.id);let y=e.ownSourcePackages??new Set(e.layerRoots?.roots??[]),b=e=>e.pkg===`__own__`?0:y.has(e.pkg)?1:2,x=e=>d.has(e.id)&&f.has(e.id)?0:1,S=new Map(g.map((e,t)=>[t,e.reduce((e,t)=>Math.min(e,b(s.get(t))),2)])),C=(e,t)=>e.pkg.localeCompare(t.pkg)||e.label.localeCompare(t.label),ee=new Map;if(n===`structure`){for(let e of g)if(!(e.length<2))for(let t of Map.groupBy(e,e=>b(s.get(e))).values())Ar(t.toSorted((e,t)=>C(s.get(e),s.get(t))),u).forEach((e,t)=>ee.set(e,t))}if(o){m=0,d.clear(),f.clear();for(let e of s.values())e.incoming=0,e.outgoing=0}for(let[e,t]of u){for(let n of t.values())if(n.cyclic=n.cycleCount>0&&v.has(e)&&_.get(e)===_.get(n.to)&&(e!==n.to||s.get(e).file!==null),o){if(!n.cyclic){t.delete(n.to);continue}n.count=n.cycleCount,m+=n.count,s.get(e).outgoing+=n.count,s.get(n.to).incoming+=n.count,e!==n.to&&(f.add(e),d.add(n.to))}t.size===0&&u.delete(e)}for(let[e,t]of u)for(let n of t.keys())e!==n&&(s.get(e).dependencies++,s.get(n).importers++);let w=r.trim().toLowerCase(),T=new Set(h.filter(e=>!w||s.get(e).files.some(e=>e.toLowerCase().includes(w))||s.get(e).label.toLowerCase().includes(w))),E=new Set(i?[i]:T);if(w||i)for(let[e,t]of u)for(let n of t.keys())(i?e===i:T.has(e))&&E.add(n),(i?n===i:T.has(n))&&E.add(e);let D=(e,t)=>{if(n===`structure`){let n=S.get(e.component)-S.get(t.component);if(n)return n;let r=x(e)-x(t);if(r)return r;let i=e.component-t.component;if(i)return i}let r=b(e)-b(t);if(r)return r;if(n===`importers`)return t.importers-e.importers||C(e,t);if(n===`imports`)return t.dependencies-e.dependencies||C(e,t);let i=x(e)-x(t);if(i)return i;if(n===`structure`&&e.component===t.component){let n=(ee.get(e.id)??0)-(ee.get(t.id)??0);if(n)return n}return C(e,t)},O=[...s.values()].filter(e=>E.has(e.id)&&(!o||e.cyclic)).toSorted(D),k=new Map(O.map((e,t)=>[e.id,t])),A=[];for(let[e,t]of u)if(k.has(e))for(let n of t.values())k.has(n.to)&&A.push({...n,row:k.get(e),col:k.get(n.to)});return{rows:O,byId:s,cells:u,visibleCells:A,index:k,matches:T,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{ne as a,ae as b,oe as c,se as d,N as e,ue as f,P as g,de as h,F as i,fe as j,pe as k,me as l,he as m,ge as n,I as o,ve as p,be as q,Se as r,Ce as s,we as t,Te as u,Ee as v,De as w,R as x,Oe as y,ke as z,Ae as A,je as B,Ne as C,Pe as D,Fe as E,Ue as F,We as G,V as H,Ke as I,rt as J,it as K,at as L,st as M,ct as N,lt as O,ut as P,dt as Q,gt as R,W as S,xt as T,Tt as U,At as V,Pt as W,Lt as X,Ut as Y,qt as Z,Jt as _,q as $,Xt as aa,Qt as ba,$t as ca,tn as da,on as ea,sn as fa,cn as ga,un as ha,dn as ia,Sn as ja,Cn as ka,On as la,Un as ma,$ as na,Wn as oa,qn as pa,Yn as qa,Xn as ra,Qn as sa,er as ta,nr as ua,rr as va,ir as wa,ar as xa,or as ya,dr as za,fr as Aa,pr as Ba,Ar as Ca,mr as Da,hr as Ea,Cr as Fa,wr as Ga,jr as Ha,Mr as Ia};
|
|
34
|
+
/*! Bundled license information:
|
|
35
|
+
|
|
36
|
+
lit-html/directives/class-map.js:
|
|
37
|
+
(**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2018 Google LLC
|
|
40
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
+
*)
|
|
42
|
+
*/
|