@preventive/triage 1.0.0-alpha.54 → 1.0.0-alpha.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/common/finding-repo.d.ts +5 -0
  2. package/common/finding-repo.js +67 -0
  3. package/common/managed/report-filter.ts +17 -6
  4. package/common/managed/routes.js +6 -2
  5. package/common/managed/team-filters.js +26 -0
  6. package/common/repo-commit.d.ts +4 -0
  7. package/common/repo-commit.js +30 -0
  8. package/out/activity.js +1 -1
  9. package/out/chunk-3K56AIDY.js +244 -0
  10. package/out/chunk-4TQKM3JC.js +42 -0
  11. package/out/chunk-5AXC5J2C.js +6 -0
  12. package/out/{chunk-VZMELPVL.js → chunk-CV74F3PY.js} +1 -1
  13. package/out/{chunk-L4CTEMRG.js → chunk-EVPQPPBG.js} +1 -1
  14. package/out/{chunk-I47TYPXO.js → chunk-EXL3LU6T.js} +1 -1
  15. package/out/{chunk-WHVXTJHK.js → chunk-HJG6J5O2.js} +1 -1
  16. package/out/{chunk-2K6UN3PC.js → chunk-IZ6MYRYB.js} +1 -1
  17. package/out/{chunk-DTM47KGS.js → chunk-J2FWBXFV.js} +1 -1
  18. package/out/{chunk-UBOCLLF2.js → chunk-MEVBIFRP.js} +1 -1
  19. package/out/chunk-PTFQKLKO.js +1 -0
  20. package/out/{chunk-ORIP5INC.js → chunk-SWJYGMWI.js} +1 -1
  21. package/out/{chunk-VC72ZO3P.js → chunk-VNEOBPBV.js} +1 -1
  22. package/out/client-managed-import.js +1 -1
  23. package/out/client-managed.js +2 -2
  24. package/out/compare.js +1 -1
  25. package/out/dialogs.js +1 -1
  26. package/out/graph.js +8 -8
  27. package/out/index.html +8 -8
  28. package/out/scan.js +1 -1
  29. package/out/view.js +4 -4
  30. package/package.json +8 -3
  31. package/server-managed/bundle-build-worker.js +56 -35
  32. package/server-managed/github-issues.ts +5 -2
  33. package/server-managed/http.ts +9 -2
  34. package/server-managed/report-sources.ts +8 -1
  35. package/server-managed/stasis-config.ts +9 -0
  36. package/server-managed/team-reports.ts +5 -1
  37. package/out/chunk-FHIVVVUA.js +0 -6
  38. package/out/chunk-HT2SSA3V.js +0 -1
  39. package/out/chunk-J7A5OSZE.js +0 -244
  40. package/out/chunk-WNSVBOSO.js +0 -41
@@ -1,41 +0,0 @@
1
- import{b as e,h as t}from"./chunk-2K6UN3PC.js";import{a as n}from"./chunk-WCPJDAYA.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 w,z as T}from"./chunk-74AEKRES.js";import{a as E,b as D,c as O}from"./chunk-C4Z6ZBXV.js";import{c as k,f as A,g as j,i as ee}from"./chunk-2XUEZHIP.js";var te=D(class extends O{constructor(e){if(super(e),e.type!==E.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 A}});function ne(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function re(e){return ne(e?.commit)}function ie(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function ae(e,t){return ie(t,c(e))?re(e?.repo):``}var oe=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`),se=e=>x(e)?e:oe(S(String(e))),M=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:se,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):se(e),ce=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 le({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 ue(e){let t=h(e);return t!==``&&t!==`revalidation`}var de=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}];function fe(e){return de.find(t=>t.value===e)?.kinds??null}var pe=[``,`exclude`,`only`];function me(e,t){let n=fe(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 he=e=>e.confidence!==void 0||e.critical===!0;function ge(e){return e.every(e=>e.every(e=>I(e)!==void 0))&&e.some(e=>e.some(he))}function _e(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 ve(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 ye(e,t){return ge(e)?t:0}function be(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=>me(`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 xe(e,t,n,r){let i=ye(e,t),a=e.filter(e=>_e(e,i,r));if(a.length===0)return!1;let o=new Set(me(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(F(e)))):!1}function Se(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=be(e,t,n);if(!xe(i,ve(e,t),a,n))return!1;let o=ye(i,6);return i.every(e=>!_e(e,o,n)||!e.some(e=>m(e,r)!==`low`)||e.every(e=>a.has(F(e))))}var L=!0;function Ce(e,t=!1){L=e!==!1&&!t}function we(){return L}function R(e){return L?h(e):``}function Te(e){return h(e)!==``}function Ee(e){return e.some(e=>(e.groups??[]).some(e=>e.some(ue)))}function De(e){let t=R(e);return t&&t!==`revalidation`?t:null}function Oe(e){return R(e)===`revalidation`}var ke=new Set([`refuted`,`unreachable`]);function Ae(e){return ke.has(R(e))}function je(e){return ke.has(R(e))}function Me(e){let t=new Set(e);return de.filter(e=>e.kinds.some(e=>t.has(e)))}function z(e){return RegExp(`(^|/)${e}/`,`u`)}function Ne(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Pe=z(`node_modules`),Fe=z(`vendor`),B=`node_modules`,Ie=z(B),Le=Ne(B);function Re(e){e!==B&&(B=e,Ie=z(e),Le=Ne(e))}var ze=null;function Be(t){ze?.length===t.length&&ze.every((e,n)=>e===t[n])||(ze=[...t],Re(e(t)))}function Ve(){return B}function V(e){return Ie.test(e)}var He=new WeakSet;function Ue(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=He.has(n);`isUpstream`in n&&!e||(V(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,He.add(n)):e&&(t=!0,delete n.isUpstream,He.delete(n)))}return t}function We(e){let t=typeof e==`string`?e:``;return Pe.test(t)||Fe.test(t)||Ie.test(t)}var Ge=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function Ke(e){return Ge.exec(typeof e==`string`?e:``)?.[1]??null}function qe(e){return typeof e!=`number`||!Number.isFinite(e)?null:n(e)}function Je(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 Ye(e){return e.match(Le)?.[1]??e}var H={on:new WeakMap,off:new WeakMap};function Xe(e){let t=L?H.on:H.off,n=t.get(e);if(n===void 0){let r=L?[De(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,Wt(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
2
- `).toLowerCase(),t.set(e,n)}return n}function Ze(e){H.on.delete(e),H.off.delete(e)}function Qe(e){return[typeof e?.category==`string`?e.category.trim():``,g(e,L)].filter(Boolean).join(` · `)}function $e(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 et(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function tt(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 nt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function rt(e){return nt.test(e||``)}function it(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:re(e)}}function at(e,t,n,r=``){if(rt(e))return null;let i=it(t),a=it(n),o=ne(r);if(i.id){let t=c({repo:{github:i.id}}),n=tt(t??i.id),r=ie(t,c({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!We(e)?o:``)||`HEAD`}/${i.prefix}${Ye(e)}`}if(V(e))return null;let s=tt(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function ot(e,t){let n=e?.file??``,r=U(e,t);return r?k`<a href="${st(r)}" target="_blank" rel="noopener">${n}</a>`:n}function st(e){return e.replace(/#L\d+(?:-L?\d+)?$/u,``)}function U(e,t){if(!e)return null;if(s(e.location))return e.location;let n=at(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=K(e.line);if(r&&r.end>r.start)return`${n}#L${r.start}-L${r.end}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var ct=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,lt=/#L(\d+)(?:-L?(\d+))?$/u;function ut(e){let t=typeof e==`string`?ct.exec(e):null;if(!t)return``;let n=t[2],r=lt.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 dt=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function ft(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=>dt.test(e)||G.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function pt(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+ft(i.slice(0,i.length-a.length))+a}function mt(e){if(!e)return e;let t=e.replaceAll(`\r
4
- `,`
5
- `),n=u(t);if(n.length===0)return ft(t);let r=[],i=0;for(let[e,a]of n)e>i&&r.push(pt(t.slice(i,e),i>0,!0)),r.push(t.slice(e,a)),i=a;return i<t.length&&r.push(pt(t.slice(i),!0,!1)),r.join(``)}var ht=/^( *)(`{3,}|~{3,})(.*)$/u,gt=/^[a-z0-9+#._-]{1,20}$/u;function _t(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function vt(e){let t=e.split(`
6
- `),n=ht.exec(t[0]),r=(n?.[2]??"```").slice(0,3),i=(n?.[3]??``).trim().split(/\s+/u)[0].toLowerCase(),a=!!(t.length>1?ht.exec(t.at(-1)):null)?.[2].startsWith(r),o=n?.[1].length??0,s=t.slice(1,a?-1:void 0);return{lang:gt.test(i)?i:``,code:(o>0?s.map(e=>_t(e,o)):s).join(`
7
- `)}}function yt(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(vt(e.slice(a,o))),r=o;return r<e.length&&i(e.slice(r),!0),n}var W=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,G=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u;function bt(e){return/^ */u.exec(e)[0].length}function xt(e){let t=e.length;for(;t>0&&!e[t-1].trim();)t--;return e.slice(0,t).join(`
8
- `)}function St(e){let t=[],n=0;for(let r of e)t.push(n),n+=r.length+1;return t}function Ct(e){let t=typeof e==`string`?e:``;if(!t)return[e];let n=u(t),r=t.split(`
9
- `),i=St(r),a=e=>!d(n,i[e])&&!G.test(r[e])&&W.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=W.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=bt(e),r=G.test(e)?null:W.exec(e);if(r&&(!f||n<f.column)){if(!!r[2]!==t)break;f&&u.push(xt(f.lines)),f={column:r[0].length,lines:[e.slice(r[0].length)]},p=!1,c++;continue}if(n<f.column&&(p||wt.test(e)||G.test(e)||Dt.test(e)))break}f.lines.push(_t(e,f.column)),p=!1,c++}f&&u.push(xt(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 wt=/^ {0,3}(#{1,6})[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/u,Tt=/^ {0,3}-+[ \t]*$/u;function Et(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=wt.exec(e),s=G.test(e)&&(a===r||!t[a-1].trim()||!Tt.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 Dt=/^ {0,3}>/u,Ot=/^ {0,3}> ?/u,kt=/^[ \t]*\[!(note|tip|important|warning|caution)\][ \t]*$/iu,At=/^ {0,3}(?:`{3}|~{3})/u,jt=/^(?: {0,3}> ?| *(?:[-*+]|\d{1,9}[.)])(?: +|$))*/u,Mt=16,Nt=e=>wt.test(e)||G.test(e)||At.test(e);function Pt(e,t){let n=ht.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 Ft(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 It(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=St(i),o=e=>Dt.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(Ot,``),a=n!==``;n=Pt(n,i);let o=i.replace(jt,``);r=!a&&!n&&o.trim()!==``&&!Nt(o),e.push(i)}else if(r&&t.trim()&&!Nt(t)&&!W.test(t))e.push(t);else break}let a=t?kt.exec(e[0]):null,u=a?Ft(e.slice(1)):``;s.push({quote:!0,alert:u?a[1].toLowerCase():null,body:u||Ft(e)}),c=l}return c<i.length&&s.push(i.slice(c).join(`
16
- `)),s}function Lt(e,t=Mt){return t<=0?e:It(e).map(e=>typeof e==`string`?e:Lt(e.body,t-1)).join(`
17
- `)}var Rt=/^(\d+)(?:\s*-\s*(\d+))?$/u;function K(e){if(typeof e==`number`)return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=Rt.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 zt(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:``}function Bt(e){if(e&&typeof e==`object`){let t=K(e.start);if(!t)return null;let n=K(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return K(e)}function Vt(e,t,n=4){let r=typeof e==`string`&&e!==``?e.split(`
18
- `):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=Bt(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 Ht(e,t,n,r){if(s(e?.url))return e.url;let i=e?.file;if(typeof i!=`string`||i===``)return null;let a=t?.file??``,o=t?.repo?.github,c=t?.auditedCommit,l=()=>o?U({file:i,line:e?.line,repo:t.repo,auditedCommit:c},n):null;if(r===0&&i===a)return l();let u=Ke(i);return u!==null&&u===Ke(a)?l():We(i)?null:o&&!We(a)?l():U({file:i,line:e?.line,auditedCommit:c},n)}function Ut(e,{spaced:t=!1,link:n=e=>e.url}={}){let r=Array.isArray(e?.evidence)?e.evidence:[];return r.length===0?``:r.map((e,t)=>{let r=y(e),i=n(e,t),a=[`${t+1}. ${i?`[${r}](${i})`:r}`],s=o(e);if(s)for(let e of s.split(`
20
- `))a.push(` ${e}`);return a.join(`
21
- `)}).join(t?`
22
-
23
- `:`
24
- `)}function Wt(e,{repoFallback:t}={}){let n=Ut(e,{link:t===void 0?void 0:(n,r)=>Ht(n,e,t,r)});return n?`**Evidence:**
25
- ${n}`:``}function Gt(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!s(t[2])?null:{label:f(t[1].trim())||t[2],url:t[2]}}function Kt(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return j;let r=U(e,t),i=`line ${n}`;return r?k`<a href="${r}" target="_blank" rel="noopener">${i}</a>`:i}function qt(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,``):`https://github.com/${e}`}/commit/${t}`}var Jt=[[`Impact`,`impact`],[`Reproduction`,`reproduction`],[`Recommendation`,`recommendation`],[`Confidence reason`,`confidenceReason`],[`Revalidation verdict`,`revalidateVerdict`],[`Revalidation recommendation`,`revalidateRecommendation`]];function Yt(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(`
26
- `));let{title:o,body:s}=v(e);o&&a.push(`# ${o}`),s&&a.push(s.trim());let c=Ut(e,{spaced:!0});c&&a.push(`# Evidence
27
-
28
- ${c}`);for(let[t,n]of Jt){if(!L&&n.startsWith(`revalidate`))continue;let r=_(e?.[n],e)?.trim();r&&a.push(`# ${t}
29
-
30
- ${r}`)}return a.join(`
31
-
32
- `)}function Xt(e,{title:t,body:n,labels:r=[]}={}){let i=tt(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 Zt=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,Qt=/^[a-zA-Z\d._-]+$/u,$t=/^[1-9]\d{0,9}$/u,en=/^[a-fA-F\d]{7,40}$/u,tn=/^#[\w-]+$/u,nn=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function rn(e){return e.length<=39&&Zt.test(e)}function an(e){return e.length<=100&&e!==`.`&&e!==`..`&&Qt.test(e)}function on(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 nn.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!rn(e)||!an(t)||!nn.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(!rn(r)||!an(i))return null;let s;if(a===`issues`||a===`pull`){if(!$t.test(o))return null;s=`${r}/${i}#${o}`}else if(a===`commit`){if(!en.test(o))return null;s=`${r}/${i}@${o.slice(0,7)}`}else return null;return{url:`https://github.com/${r}/${i}/${a}/${o}${tn.test(t.hash)?t.hash:``}`,label:s}}var sn=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function cn(e){if(typeof e!=`string`)return null;let t=ln(e);return t!==e||sn.test(e)?t.slice(0,8):null}function ln(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function un(e,n){let r=t(e,{managed:n});if(!r)return null;let i=cn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var dn=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,fn=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function pn(e){let t=e.length;for(;t>0&&fn.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function mn(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;dn.lastIndex=0;let i;for(;(i=dn.exec(e))!==null;){let a=pn(i[0]),o=a?on(a)??un(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,dn.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var hn={commit:T},gn=8;function _n(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 vn({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 q;function yn(){return q||(q=document.createElement(`div`),q.id=`styled-tooltip`,q.setAttribute(`popover`,`manual`),document.body.append(q),q)}function bn(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var J=null,xn=``,Y=null,X=null,Sn=0,Cn=0,wn=!1;function Z(){if(!wn){wn=!0,document.addEventListener(`mousemove`,e=>{Sn=e.clientX,Cn=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 Tn=100,En=14,Dn=8,Q=8;function On(e,{placement:t=`cursor`}={}){Z(),clearTimeout(Y),Y=null,X=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=yn(),i=e.dataset.tooltip??``,a=Object.hasOwn(hn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,o=e.dataset.tooltipRepo??``,s=r(e.dataset.tooltipCommit),c=_n(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(J===e&&xn===y)return;if(n.textContent=a||v?``:i,v){let e=document.createElement(`div`);e.className=`tooltip-rich`,ee(v,e),n.append(e)}if(a){let e=document.createElement(`span`);e.className=`tooltip-text`,e.innerHTML=N(hn[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(w);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(T);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,gn)){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>gn){let t=document.createElement(`span`);t.className=`tooltip-tag-more`,t.textContent=`+${(c.tags.length-gn).toLocaleString()} more`,e.append(t)}n.append(e)}}if(c?.details&&n.append(vn(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)}bn(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let x=Sn,S=Cn+En;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();x=n.right+Dn,S=n.top+(t===`right`?n.height/2:0)}let E=window.innerWidth-n.offsetWidth-Q,D=Math.max(Q,Math.min(x,E));n.style.left=`${Math.round(D)}px`;let O=n.offsetHeight,k=t===`right`?S-O/2:S,A=window.innerHeight-O-Q,j=Math.max(Q,Math.min(k,A));n.style.top=`${Math.round(j)}px`,J=e,xn=y}function $(e){e&&!e.contains(J)&&!e.contains(X)||(clearTimeout(Y),Y=null,X=null,q&&(q.classList.remove(`visible`),typeof q.hidePopover==`function`&&q.matches(`:popover-open`)&&q.hidePopover()),J=null)}function kn(e,{gate:t,placement:n}={}){Z();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));if(!r()){$();return}e===J||e===X||($(),X=e,Y=setTimeout(()=>{Y=null,X=null,r()&&On(e,{placement:n})},Tn))}var An=new WeakSet;function jn(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 Mn(e,t){!e||An.has(e)||(An.add(e),e.ownerDocument&&Z(),e.addEventListener(`mouseover`,n=>{if(n.buttons){$();return}let r=jn(n,e);if(!r){$();return}r!==J&&kn(r,t)}),e.addEventListener(`mouseout`,t=>{let n=jn(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||$()}),e.addEventListener(`scroll`,()=>$(e),{capture:!0,passive:!0}))}var Nn=!1;function Pn(){Nn||(Nn=!0,Z(),document.addEventListener(`tooltip-root-connected`,e=>{Mn(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===J||kn(t)}),document.body.addEventListener(`mouseout`,e=>{e.target.closest(`[data-tooltip-managed]`)||e.relatedTarget?.closest?.(`[data-tooltip-managed]`)||!J&&!Y||(J??X)?.contains(e.relatedTarget)||$()}))}function Fn(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var In=()=>Object.fromEntries(p.map(e=>[e,0]));function Ln(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,In());let r=n.get(e.file),i=m(e,t);r[i]!==void 0&&r[i]++}return n}var Rn={trees:[],merged:null};function zn(e){let t=e.map(e=>e?.tree??null);return t.length===Rn.trees.length&&t.every((e,t)=>e===Rn.trees[t])||(Rn={trees:t,merged:Bn(e)}),Rn.merged}function Bn(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 Vn(e,t){let n=Object.keys(e),r=new Map(n.map((e,t)=>[e,t])),i=n.map(()=>In()),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 Hn(e,t,n){let r=t.get(e),i=n.get(e);return Un(r)>0||Un(i)>0}function Un(e){if(!e)return 0;let t=0;for(let n of p)t+=e[n]??0;return t}function Wn(e){if(!e)return null;let t=Ve(),n=RegExp(`^(?:.*/)?${t}/(@[^/]+/[^/]+|[^/]+)`,`u`),r=e.match(n);return r?r[1]:`__own__`}function Gn(e){return new Set(e.filter(e=>!V(e)))}var Kn=[`#4e9af1`,`#f28e2b`,`#59a14f`,`#e15759`,`#76b7b2`,`#edc948`,`#b07aa1`,`#ff9da7`,`#9c755f`,`#5cd1e5`,`#f1ce63`,`#d37295`,`#a0cbe8`,`#86bcb6`,`#8cd17d`,`#b6992d`,`#499894`,`#e15759`,`#e879c7`,`#d4a6c8`],qn=[`#2f8aef`,`#d2691e`,`#2ea043`,`#e63946`,`#2e9a92`,`#b88817`,`#9560e8`,`#d24a9c`,`#8a5d40`,`#0891b2`,`#a07a14`,`#c14e8e`,`#1f7ad0`,`#549b94`,`#3fb95f`,`#a07a14`,`#2a8278`,`#cb2c40`,`#c026d3`,`#965f93`];function Jn(){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 Yn=new Map;function Xn(e){let t=Jn()?qn:Kn;return t[e%t.length]}var Zn=()=>Jn()?`#8c959f`:`#6e7681`;function Qn(e){let t=Jn(),n=t?qn:Kn,r=e??`__own__`,i=`${t?`l`:`d`}:${r}`;if(Yn.has(i))return Yn.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 Yn.set(i,o),o}var $n={package:`@babel/core`,path:/^lib\/config\//u},er={package:`@babel/core`,path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},tr=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:$n,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:`babel-typescript-preset`,reason:`Babel configuration loads the TypeScript preset.`,from:$n,to:{package:`@babel/preset-typescript`,path:/./u}},{id:`babel-react-native-preset`,reason:`Babel config loaders load the configured React Native preset.`,from:er,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:er,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:`babel-transform-plugin`,reason:`Babel config loaders load configured transform plugins.`,from:er,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 nr(e){return typeof e==`string`&&!e.includes(`\\`)&&!e.includes(`:`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`)}function rr(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 ir(e,t){if(e?.ownSource!==!0&&nr(e?.path)&&nr(t?.path))return tr.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&rr(n.from,e)&&rr(n.to,t))}function ar(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 or(e,t,n,r){return!ir(ar(e,r),ar(t,n))}function sr(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&&or(o.origFile??i,a.origFile??s,e.ownSourceFiles?.has(s),e.ownSourceFiles?.has(i))&&r.get(t(o)).add(t(a))}}return r}var cr=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 lr(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 ur(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 dr(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 fr(e,t){let n=dr(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 pr(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 cr(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=dr(e,n);for(let i of[[...r,...a.toReversed()],ur(n),e,e.toReversed()]){let e=lr(fr(i,n),t),r=dr(e,n);r>s&&(o=e,s=r)}return o}function mr(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();if(s.done){i.push(r),e.pop();continue}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 hr(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?n.file: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=or(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:_}=mr(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),w=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())pr(t.toSorted((e,t)=>C(s.get(e),s.get(t))),u).forEach((e,t)=>w.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 T=r.trim().toLowerCase(),E=new Set(h.filter(e=>!T||s.get(e).files.some(e=>e.toLowerCase().includes(T))||s.get(e).label.toLowerCase().includes(T))),D=new Set(i?[i]:E);if(T||i)for(let[e,t]of u)for(let n of t.keys())(i?e===i:E.has(e))&&D.add(n),(i?n===i:E.has(n))&&D.add(e);let O=(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=(w.get(e.id)??0)-(w.get(t.id)??0);if(n)return n}return C(e,t)},k=[...s.values()].filter(e=>D.has(e.id)&&(!o||e.cyclic)).toSorted(O),A=new Map(k.map((e,t)=>[e.id,t])),j=[];for(let[e,t]of u)if(A.has(e))for(let n of t.values())A.has(n.to)&&j.push({...n,row:A.get(e),col:A.get(n.to)});return{rows:k,byId:s,cells:u,visibleCells:j,index:A,matches:E,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{te as a,ae as b,N as c,ce as d,P as e,le as f,F as g,ue as h,de as i,fe as j,pe as k,me as l,I as m,ge as n,ve as o,be as p,xe as q,Se as r,Ce as s,we as t,R as u,Te as v,Ee as w,De as x,Oe as y,Ae as z,je as A,Me as B,Be as C,Ve as D,V as E,Ue as F,qe as G,Je as H,Xe as I,Ze as J,Qe as K,$e as L,et as M,ot as N,U as O,ut as P,mt as Q,yt as R,Ct as S,Et as T,Mt as U,It as V,Lt as W,K as X,zt as Y,Vt as Z,Ht as _,Wt as $,Gt as aa,Kt as ba,qt as ca,Yt as da,Xt as ea,cn as fa,ln as ga,mn as ha,On as ia,$ as ja,kn as ka,Mn as la,Pn as ma,Fn as na,Ln as oa,zn as pa,Vn as qa,Hn as ra,Un as sa,Wn as ta,Gn as ua,Xn as va,Zn as wa,Qn as xa,pr as ya,or as za,sr as Aa,mr as Ba,hr as Ca};
33
- /*! Bundled license information:
34
-
35
- lit-html/directives/class-map.js:
36
- (**
37
- * @license
38
- * Copyright 2018 Google LLC
39
- * SPDX-License-Identifier: BSD-3-Clause
40
- *)
41
- */