@preventive/triage 1.0.0-alpha.74 → 1.0.0-alpha.76
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/finding-duplicates.js +4 -4
- package/common/finding-filters.js +11 -13
- package/common/managed/roles.ts +6 -0
- package/common/managed/routes.js +4 -3
- package/common/managed/team-app.d.ts +2 -0
- package/common/managed/team-app.js +31 -14
- package/out/activity.js +1 -1
- package/out/{chunk-C6OPCPCA.js → chunk-24LZZYAP.js} +1 -1
- package/out/{chunk-VRAJCPV5.js → chunk-EYTPAODY.js} +2 -2
- package/out/chunk-ITUKKCCK.js +10 -0
- package/out/{chunk-BLPHP4U3.js → chunk-IVDE66N5.js} +1 -1
- package/out/{chunk-VS7RV24Z.js → chunk-MFAB7P3T.js} +2 -2
- package/out/chunk-O6FA2R5G.js +53 -0
- package/out/chunk-OCE6KQGJ.js +40 -0
- package/out/{chunk-YI4D6XVX.js → chunk-RHOQDAU4.js} +1 -1
- package/out/{chunk-2IHCVA3Y.js → chunk-T6EXDRB7.js} +1 -1
- package/out/chunk-UZC7POI4.js +255 -0
- package/out/chunk-WGQ7D5DB.js +1 -0
- package/out/client-managed-import.js +1 -1
- package/out/client-managed.js +30 -30
- package/out/compare.js +4 -4
- package/out/dialogs.js +1 -1
- package/out/graph.js +6 -6
- package/out/index.html +8 -8
- package/out/prism.js +1 -1
- package/out/scan.js +1 -1
- package/out/view.css +1 -1
- package/out/view.js +4 -4
- package/package.json +5 -2
- package/risk/files/characters.js +142 -8
- package/risk/files/hosts.js +4 -3
- package/risk/files/readability.js +18 -13
- package/risk/files/runs-code.js +41 -80
- package/risk/files/script.js +210 -48
- package/risk/index.d.ts +4 -2
- package/risk/npm/assess.js +1 -1
- package/risk/npm/tarball.js +35 -19
- package/server-managed/dependency-review-comments.ts +22 -10
- package/server-managed/http.ts +74 -25
- package/server-managed/locked-packages.ts +62 -5
- package/server-managed/npm-packages.ts +7 -5
- package/server-managed/queue.ts +8 -7
- package/server-managed/repository-browser.ts +6 -3
- package/server-managed/repository-code.ts +3 -2
- package/server-managed/repository-risk-caches.ts +37 -0
- package/server-managed/repository-risk-read.ts +41 -18
- package/server-managed/repository-risk-stasis.ts +61 -0
- package/server-managed/repository-risk-turn.ts +97 -0
- package/server-managed/repository-risk.ts +128 -102
- package/server-managed/scan-downloads.ts +44 -10
- package/server-managed/team-app-summaries.ts +3 -1
- package/server-managed/team-app.ts +4 -2
- package/server-managed/team-reports.ts +8 -3
- package/out/chunk-5YP7P5KA.js +0 -1
- package/out/chunk-74AEKRES.js +0 -10
- package/out/chunk-DQJEVHRE.js +0 -52
- package/out/chunk-ESJZZF2Y.js +0 -255
- package/out/chunk-GV5U7OLP.js +0 -40
package/out/chunk-GV5U7OLP.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{b as e,h as t}from"./chunk-BLPHP4U3.js";import{a as n}from"./chunk-74JZTGTO.js";import{a as r,b as i,e as a}from"./chunk-IYPY47MC.js";import{B as o,b as s,c,i as l,x as u,z as d}from"./chunk-74AEKRES.js";import{a as f,b as p,c as m}from"./chunk-C4Z6ZBXV.js";import{A as h,B as g,D as _,E as v,b as y,c as b,d as x,j as S,m as C,p as w,s as T,t as E,w as D,z as O}from"./chunk-QRKFPLA4.js";import{c as k,f as A,g as ee,i as te}from"./chunk-2XUEZHIP.js";var ne=p(class extends m{constructor(e){if(super(e),e.type!==f.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 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 ae(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function oe(e,t){return ae(t,_(e))?ie(e?.repo):``}function se(e,t){let n=e?.advisory?.package,r=e?.repo?.github;if(typeof n!=`string`||n===``||typeof r!=`string`||r===``)return!1;let i=_({repo:{github:r}}),a=i?.split(`/`)[1].toLowerCase();return a!==n.toLowerCase()&&a!==n.replace(/^@[^/]+\//u,``).toLowerCase()?!1:!ae(i,typeof t==`string`&&t!==``?_({repo:{github:t}})??t:``)}function ce(e,t){if(!se(e,t))return e;let{repo:n,...r}=e;return{...r,_repoIgnored:!0}}var le=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`),ue=e=>s(e)?e:le(c(String(e))),j=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:ue,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}}),de=e=>j?j.createHTML(e):ue(e),fe=e=>j?j.createScriptURL(String(e)):e,M={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:`issues`,selectedSeverities:new Set,selectedColors:new Set,pathFilter:``,hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function pe({keepViewport:e=!1}={}){M.graphState?._cleanup?M.graphState._cleanup({keepViewport:e}):e||(M.keptViewport=null),M.graphState=null}function N(e){return e.id??String(e._id)}function me(e){let t=w(e);return t!==``&&t!==`revalidation`}var he=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}],ge={value:`unrevalidated`,label:`Not revalidated`,kinds:[``]},_e=[...he,ge];function ve(e){return _e.find(t=>t.value===e)}function ye(e){return ve(e)?.kinds??null}var be=[``,`exclude`,`only`];function xe(e,t){let n=ye(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function P(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var Se=e=>e.confidence!==void 0||e.critical===!0;function Ce(e){return e.every(e=>e.every(e=>P(e)!==void 0))&&e.some(e=>e.some(Se))}function we(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:P(e);return r===void 0?t===0:r>=t})}function Te(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>P(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(P(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i)===0;)i--;for(;i>0&&r(i-1)===r(i);)i--;return i}function Ee(e,t){return Ce(e)?t:0}function De(e,t,n){let r=new Set(e.ruledOutIds??[]),i=new Map;for(let t of e)for(let e of t)[`refuted`,`unreachable`].includes(n(e))&&r.add(N(e)),i.set(N(e),i.get(N(e))!==!1&&e._confirmedDefault===!0);for(let[e,t]of i)t&&r.add(e);for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>xe(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(N(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function Oe(e,t,n,r){let i=Ee(e,t),a=e.filter(e=>we(e,i,r)),o=new Set(xe(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(N(e)))):!1}function ke(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=De(e,t,n);if(!Oe(i,Te(e,t),a,n))return!1;let o=Ee(i,6);return i.every(e=>!we(e,o,n)||!e.some(e=>C(e,r)!==`low`)||e.every(e=>a.has(N(e))))}function Ae(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 F=!0;function je(e,t=!1){F=e!==!1&&!t}function Me(){return F}function I(e){return F?w(e):``}function Ne(e){return w(e)!==``}function Pe(e){return e.some(e=>(e.groups??[]).some(e=>e.some(me)))}function Fe(e){let t=I(e);return t&&t!==`revalidation`?t:null}function Ie(e){return I(e)===`revalidation`}var Le=new Set([`refuted`,`unreachable`]);function Re(e){return Le.has(I(e))}function ze(e,t=!1){let n=new Set(e);n.delete(``);let r=he.filter(e=>e.kinds.some(e=>n.has(e)));return t&&n.size>0?[...r,ge]:r}function Be(e){return RegExp(`(^|/)${e}/`,`u`)}function Ve(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var He=Be(`node_modules`),Ue=Be(`vendor`),L=`node_modules`,We=Be(L),Ge=Ve(L),Ke=(e,t)=>e?.length===t.length&&e.every((e,n)=>e===t[n]),qe=null;function Je(t){if(Ke(qe,t))return;qe=[...t];let n=e(t);n!==L&&(L=n,We=Be(n),Ge=Ve(n))}function Ye(){return L}function Xe(e){return We.test(e)}var Ze=new WeakSet;function Qe(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=Ze.has(n);`isUpstream`in n&&!e||(Xe(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,Ze.add(n)):e&&(t=!0,delete n.isUpstream,Ze.delete(n)))}return t}function $e(e){let t=typeof e==`string`?e:``;return He.test(t)||Ue.test(t)||We.test(t)}var et=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function tt(e){return et.exec(typeof e==`string`?e:``)?.[1]??null}function nt(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 rt=null,it={byRoot:new Map,byPackage:new Map},at=e=>`${e?._managedReportId??``}\0${e?._reportName??``}`,ot=(e,t)=>`${at(e)}\0${t}`,st=e=>_({repo:{github:e.id}})??e.id;function ct(e,t){if(e===null)return null;let n=z(t),r=z(e),[i,a]=[r.commit.toLowerCase(),n.commit.toLowerCase()];return!ae(st(r),st(n))||r.prefix!==n.prefix||!(i.startsWith(a)||a.startsWith(i))?null:a.length>i.length?t:e}function lt(e){let t=Array.isArray(e)?e:[],n=t.flatMap(e=>[e,e?.groups]);if(Ke(rt,n))return;rt=n;let r=new Map,i=new Map,a=(e,t,n)=>e.set(t,e.has(t)?ct(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||se(e,e._repoFallback))continue;let t=z(e.repo);if(!t.id||!t.commit)continue;let n=tt(e.file),o=nt(e.package);if(n!==null){let t=ot(e,n),r=i.get(t),a=r===void 0?e.repo:r&&r.pkg===o?ct(r.repo,e.repo):null;i.set(t,a&&{repo:a,pkg:o})}o!==null&&!o.endsWith(`@`)&&a(r,o,e.repo)}it={byRoot:i,byPackage:r}}function ut(e){return Number.isFinite(e)?n(e):null}function dt(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(;r<n-1&&t.every(e=>e[r]===t[0][r]);)r++;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 ft(e){return e.match(Ge)?.[1]??e}var R={on:new WeakMap,off:new WeakMap};function pt(e){let t=F?R.on:R.off,n=t.get(e);if(n===void 0){let r=F?[Fe(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,sn(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
|
|
2
|
-
`).toLowerCase(),t.set(e,n)}return n}function mt(e){R.on.delete(e),R.off.delete(e)}function ht(e){return[typeof e?.category==`string`?e.category.trim():``,T(e,F)].filter(Boolean).join(` · `)}function gt(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 _t(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function vt(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 yt=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function bt(e){return yt.test(e||``)}function z(e){if(e==null||typeof e==`string`)return{id:e??``,prefix:``,commit:``};let t=v(e);return{id:typeof e.github==`string`?e.github:``,prefix:t?`${t}/`:``,commit:ie(e)}}function xt(e,t,n,r=``){if(bt(e))return null;let i=z(t),a=z(n),o=re(r);if(i.id){let t=_({repo:{github:i.id}}),n=vt(t??i.id),r=ae(t,_({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!$e(e)?o:``)||`HEAD`}/${i.prefix}${ft(e)}`}if(Xe(e))return null;let s=vt(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function St(e,t){let n=e?.file??``,r=B(e,t);return r?k`<a href="${Ct(r)}" target="_blank" rel="noopener">${n}</a>`:n}function Ct(e){return e.replace(Et,``)}function wt({start:e,end:t}){return t>e?`#L${e}-L${t}`:`#L${e}`}function B(e,t){if(!e)return null;if(g(e.location))return e.location;let n=xt(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=W(e.line);if(r)return`${n}${wt(r)}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var Tt=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,Et=/#L(\d+)(?:-L?(\d+))?$/u;function Dt(e){let t=typeof e==`string`?Tt.exec(e):null;if(!t)return``;let n=Et.exec(t[2]);return n?`${t[1]}/${t[2].slice(0,n.index)}:${n[2]?`${n[1]}-${n[2]}`:n[1]}`:`${t[1]}/${t[2]}`}function Ot(e,t){let n=[],r=0;for(let[i,a]of t)n.push(e.slice(r,i),e.slice(i,a)),r=a;return n.push(e.slice(r)),n}var kt=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function At(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=>kt.test(e)||H.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function jt(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+At(i.slice(0,i.length-a.length))+a}function Mt(e){if(!e)return e;let t=e.replaceAll(`\r
|
|
4
|
-
`,`
|
|
5
|
-
`),n=y(t);if(n.length===0)return At(t);let r=Ot(t,n);return r.map((e,t)=>t%2||!e?e:jt(e,t>0,t<r.length-1)).join(``)}var Nt=/^( *)(`{3,}|~{3,})(.*)$/u,Pt=/^[a-z0-9+#._-]{1,20}$/u;function Ft(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function It(e){let t=e.split(`
|
|
6
|
-
`),n=Nt.exec(t[0]),r=(n?.[2]??"```").slice(0,3),i=(n?.[3]??``).trim().split(/\s+/u)[0].toLowerCase(),a=!!(t.length>1?Nt.exec(t.at(-1)):null)?.[2].startsWith(r),o=n?.[1].length??0,s=t.slice(1,a?-1:void 0);return{lang:Pt.test(i)?i:``,code:(o>0?s.map(e=>Ft(e,o)):s).join(`
|
|
7
|
-
`)}}function Lt(e){let t=y(e||``);return t.length===0?[e]:Ot(e,t).flatMap((e,t)=>{if(t%2)return[It(e)];let n=(t>0?e.replace(/^\n+/u,``):e).replace(/\n+$/u,``);return n?[n]:[]})}var V=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,H=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u;function Rt(e){return/^ */u.exec(e)[0].length}function zt(e){let t=y(e),n=e.split(`
|
|
8
|
-
`),r=[],i=0;for(let e of n)r.push(i),i+=e.length+1;return{lines:n,inCode:e=>b(t,r[e])}}function Bt(e){let t=typeof e==`string`?e:``;if(!t)return[e];let{lines:n,inCode:r}=zt(t),i=e=>!r(e)&&!H.test(n[e])&&V.test(n[e]),a=[],o=0,s=0,c=e=>{let t=n.slice(o,e).join(`
|
|
9
|
-
`).replace(/^\n+/u,``).replace(/\n+$/u,``);t.trim()&&a.push(t)};for(;s<n.length;){if(!i(s)){s++;continue}c(s);let e=V.exec(n[s]),t=!!e[2],l=[],u=null,d=!1;for(;s<n.length;){let e=n[s];if(!r(s)){if(!e.trim()){u.lines.push(``),d=!0,s++;continue}let n=Rt(e),r=H.test(e)?null:V.exec(e);if(r&&(!u||n<u.column)){if(!!r[2]!==t)break;u&&l.push(U(u.lines)),u={column:r[0].length,lines:[e.slice(r[0].length)]},d=!1,s++;continue}if(n<u.column&&(d||Vt.test(e)||H.test(e)||Wt.test(e)))break}u.lines.push(Ft(e,u.column)),d=!1,s++}u&&l.push(U(u.lines)),a.push({ordered:t,start:t?Number(e[2]):null,items:l}),o=s}return a.length===0?[e]:(c(n.length),a)}var Vt=/^ {0,3}(#{1,6})[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/u,Ht=/^ {0,3}-+[ \t]*$/u;function Ut(e){let t=e.split(`
|
|
10
|
-
`),n=[],r=0,i=e=>{let i=t.slice(r,e).join(`
|
|
11
|
-
`).replaceAll(/^(?:[ \t]*\n)+|(?:\n[ \t]*)+$/gu,``);i.trim()&&n.push(i)};return t.forEach((e,a)=>{let o=Vt.exec(e),s=H.test(e)&&(a===r||!t[a-1].trim()||!Ht.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 Wt=/^ {0,3}>/u,Gt=/^ {0,3}> ?/u,Kt=/^[ \t]*\[!(note|tip|important|warning|caution)\][ \t]*$/iu,qt=/^ {0,3}(?:`{3}|~{3})/u,Jt=/^(?: {0,3}> ?| *(?:[-*+]|\d{1,9}[.)])(?: +|$))*/u,Yt=16,Xt=e=>Vt.test(e)||H.test(e)||qt.test(e);function Zt(e,t){let n=Nt.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 U(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(`
|
|
12
|
-
`)}function Qt(e,{alerts:t=!0}={}){let n=typeof e==`string`?e:``;if(!/^ {0,3}>/mu.test(n))return[e];let{lines:r,inCode:i}=zt(n),a=e=>Wt.test(r[e])&&!i(e),o=[],s=0,c=0;for(;c<r.length;){if(!a(c)){c++;continue}c>s&&o.push(r.slice(s,c).join(`
|
|
13
|
-
`));let e=[],n=``,i=!1;for(;c<r.length;c++){let t=r[c];if(a(c)){let r=t.replace(Gt,``),a=n!==``;n=Zt(n,r);let o=r.replace(Jt,``);i=!a&&!n&&o.trim()!==``&&!Xt(o),e.push(r)}else if(i&&t.trim()&&!Xt(t)&&!V.test(t))e.push(t);else break}let l=t?Kt.exec(e[0]):null,u=l?U(e.slice(1)):``;o.push({quote:!0,alert:u?l[1].toLowerCase():null,body:u||U(e)}),s=c}return s<r.length&&o.push(r.slice(s).join(`
|
|
14
|
-
`)),o}function $t(e,t=Yt){return t<=0?e:Qt(e).map(e=>typeof e==`string`?e:$t(e.body,t-1)).join(`
|
|
15
|
-
`)}var en=/^(\d+)(?:\s*-\s*(\d+))?$/u;function W(e){if(typeof e==`number`)return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=en.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 tn(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:``}function nn(e){if(e&&typeof e==`object`){let t=W(e.start);if(!t)return null;let n=W(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return W(e)}function rn(e,t,n=4){let r=typeof e==`string`&&e!==``?e.split(`
|
|
16
|
-
`):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=nn(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(`
|
|
17
|
-
`),startLine:o,lines:c}}function an(e,t,n,r,i=null){if(g(e?.url))return e.url;let a=e?.file;if(typeof a!=`string`||a===``)return null;let o=t?.file??``,s=t?.repo?.github,c=t?.auditedCommit,l=t=>B({file:a,line:e?.line,...t},n);if(r===0&&a===o)return String(e?.line??``).trim()===String(t?.line??``).trim()?B(t,n):l({repo:t.repo,auditedCommit:c});if(z(e?.repo).id)return l({repo:e.repo});let u=tt(a),d=nt(e?.package),f=d===null?u!==null&&u===tt(o):d===nt(t?.package);if(s&&f)return l({repo:t.repo,auditedCommit:c});let p=u===null?null:it.byRoot.get(ot(t,u)),m=(d===null?null:it.byPackage.get(d))??(p&&(d===null||p.pkg===d)?p.repo:null);if(m)return l({repo:m});if($e(a)){let t=i?.(e);return t?l({file:t.file,repo:t.repo}):null}return s&&!$e(o)?l({repo:t.repo,auditedCommit:c}):l({auditedCommit:c})}function on(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=O(e),a=n(e,t),o=[`${t+1}. ${a?`[${i}](${a})`:r?Ae(i):i}`],s=r?ln(h(e),a):h(e);if(s)for(let e of s.split(`
|
|
18
|
-
`))o.push(` ${e}`);return o.join(`
|
|
19
|
-
`)}).join(t?`
|
|
20
|
-
|
|
21
|
-
`:`
|
|
22
|
-
`)}function sn(e,{repoFallback:t,shipped:n=null}={}){let r=t!==void 0,i=on(e,{link:r?(r,i)=>an(r,e,t,i,n):void 0,lineLinks:r});return i?`**Evidence:**
|
|
23
|
-
${i}`:``}var cn=/\(\s*(?:lines?|L)\s*(\d+)(?:\s*(?:-|–|—|to)\s*L?(\d+))?\s*\)/giu;function ln(e,t){if(!e||!t||!Tt.test(t)||!/\(\s*(?:lines?|L)\s*\d/iu.test(e))return e;let n=Ct(t),r=e=>{let t=un(e);return e.replaceAll(cn,(e,r,i,a)=>{let o=b(t,a)?null:W(i?`${r}-${i}`:r);return o?`([${e.slice(1,-1).trim()}](${n}${wt(o)}))`:e})};return Ot(e,y(e)).map((e,t)=>t%2?e:r(e)).join(``)}function un(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]=[`
|
|
24
|
-
`,`]`,`)`,`>`].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 dn(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!g(t[2])?null:{label:x(t[1].trim())||t[2],url:t[2]}}function fn(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return ee;let r=B(e,t),i=`line ${n}`;return r?k`<a href="${r}" target="_blank" rel="noopener">${i}</a>`:i}function pn(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,``):`https://github.com/${e}`}/commit/${t}`}var mn=[[`Impact`,`impact`],[`Reproduction`,`reproduction`],[`Recommendation`,`recommendation`],[`Confidence reason`,`confidenceReason`],[`Revalidation verdict`,`revalidateVerdict`],[`Revalidation recommendation`,`revalidateRecommendation`]];function hn(e,t){let n=[];t&&n.push(`Repo: ${t}`);let r=O(e);r&&n.push(`Location: ${r}`),e?.confidence!=null&&n.push(`Confidence: ${e.confidence}/10`);let i=I(e);i&&n.push(`Revalidation: ${i}`);let a=[];n.length>0&&a.push(n.join(`
|
|
25
|
-
`));let{title:o,body:s}=D(e);o&&a.push(`# ${o}`),s&&a.push(s.trim());let c=on(e,{spaced:!0});c&&a.push(`# Evidence
|
|
26
|
-
|
|
27
|
-
${c}`);for(let[t,n]of mn){if(!F&&n.startsWith(`revalidate`))continue;let r=E(e?.[n],e)?.trim();r&&a.push(`# ${t}
|
|
28
|
-
|
|
29
|
-
${r}`)}return a.join(`
|
|
30
|
-
|
|
31
|
-
`)}function gn(e,{title:t,body:n,labels:r=[]}={}){let i=vt(e);if(!i)return null;try{if(new URL(i).host.toLowerCase()!==`github.com`)return null}catch{return null}let a=new URLSearchParams;t&&a.set(`title`,t),n&&a.set(`body`,n),r.length>0&&a.set(`labels`,r.join(`,`));let o=a.toString();return o?`${i}/issues/new?${o}`:`${i}/issues/new`}var _n=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,vn=/^[a-zA-Z\d._-]+$/u,yn=/^[1-9]\d{0,9}$/u,bn=/^[a-fA-F\d]{7,40}$/u,xn=/^#[\w-]+$/u,Sn=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function Cn(e){return e.length<=39&&_n.test(e)}function wn(e){return e.length<=100&&e!==`.`&&e!==`..`&&vn.test(e)}function Tn(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 Sn.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!Cn(e)||!wn(t)||!Sn.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(!Cn(r)||!wn(i))return null;let s=a===`commit`?bn.test(o)&&`@${o.slice(0,7)}`:(a===`issues`||a===`pull`)&&yn.test(o)&&`#${o}`;return s?{url:`https://github.com/${r}/${i}/${a}/${o}${xn.test(t.hash)?t.hash:``}`,label:`${r}/${i}${s}`}:null}var En=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function Dn(e){if(typeof e!=`string`)return null;let t=On(e);return t!==e||En.test(e)?t.slice(0,8):null}function On(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function kn(e,n){let r=t(e,{managed:n});if(!r)return null;let i=Dn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var An=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,jn=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function Mn(e){let t=e.length;for(;t>0&&jn.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function Nn(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;An.lastIndex=0;let i;for(;(i=An.exec(e))!==null;){let a=Mn(i[0]),o=a?Tn(a)??kn(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,An.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var Pn={commit:d},Fn=8;function In(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 G(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n!==void 0&&(r.textContent=n),r}function K(e,t,n,r){let i=G(e,t);return i.innerHTML=de(n),i.append(G(`span`,``,r)),i}function Ln({title:e,authorName:t,authorLogin:n,date:r}){let i=G(`span`,`tooltip-commit-meta`,[t&&n&&t!==n?`${t} (@${n})`:t??(n&&`@${n}`),r===null?``:new Date(r).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})].filter(Boolean).join(` · `)),a=G(`div`,`tooltip-commit-details`);return a.append(...e?[G(`span`,`tooltip-commit-message`,e)]:[],i),a}var q;function Rn(){return q||(q=document.createElement(`div`),q.id=`styled-tooltip`,q.setAttribute(`popover`,`manual`),document.body.append(q),q)}function zn(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var J=null,Bn=``,Y=null,X=null,Vn=0,Hn=0,Un=!1;function Wn(){if(!Un){Un=!0,document.addEventListener(`mousemove`,e=>{Vn=e.clientX,Hn=e.clientY},{passive:!0});for(let e of[`pointerdown`,`wheel`,`scroll`])document.addEventListener(e,()=>Z(),{capture:!0,passive:!0});document.addEventListener(`keydown`,e=>{e.key===`Escape`&&Z()}),window.addEventListener(`blur`,()=>Z())}}var Gn=100,Kn=14,qn=8,Jn=8;function Yn(e,{placement:t=`cursor`}={}){Wn(),clearTimeout(Y),Y=null,X=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=Rn(),i=e.dataset.tooltip??``,a=Object.hasOwn(Pn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,s=e.dataset.tooltipRepo??``,c=r(e.dataset.tooltipCommit),f=In(e.dataset.tooltipCommitInfo),p=[`stasis`,`sourcemap`].includes(e.dataset.tooltipBundle)?e.dataset.tooltipBundle:``,m=e.dataset.tooltipStats??``,h=e.dataset.tooltipBuilt===`true`,g=e.dataset.tooltipPackage??``,_=e.dataset.tooltipEcosystem??``,v=e.dataset.tooltipVersion??``,y=e.dataset.tooltipFiles??``,b=e.dataset.tooltipLoc??``,x=e.dataset.tooltipSize??``,S=e.tooltipContent??null,C=S??JSON.stringify([i,a,s,c,f,p,m,h,g,_,v,y,b,x]);if(!i){Z();return}if(J===e&&Bn===C)return;if(n.textContent=a||S?``:i,S){let e=G(`div`,`tooltip-rich`);te(S,e),n.append(e)}if(a&&n.append(K(`span`,`tooltip-text`,Pn[a],i)),g){let t=G(`div`,`tooltip-package`),r=(e.querySelector(`[data-tooltip-package-icon] svg`)??e.querySelector(`svg`))?.cloneNode(!0);r&&t.append(r);let i=G(`span`,`tooltip-package-details`),a=(e,t)=>/^\d+$/u.test(e)?`${Number(e).toLocaleString()} ${t}`:``;for(let e of[g,v,a(y,y===`1`?`file`:`files`),a(b,`LoC`),x].filter(Boolean))i.append(G(`span`,``,e));t.append(i),n.append(t)}if(s||c){let e=s?K(`div`,`tooltip-repo`,u,s):G(`div`,`tooltip-repo`);if(c&&e.append(K(`span`,`tooltip-commit`,d,c.slice(0,7))),n.append(e),c&&f?.tags.length){let e=G(`div`,`tooltip-tags`);for(let t of f.tags.slice(0,Fn))e.append(K(`span`,`tooltip-tag`,o,t));f.tags.length>Fn&&e.append(G(`span`,`tooltip-tag-more`,`+${(f.tags.length-Fn).toLocaleString()} more`)),n.append(e)}}if(f?.details&&n.append(Ln(f.details)),p||m||h){let e=[p===`stasis`?`Stasis`:p===`sourcemap`?`Sourcemap`:``,h?`Built on server`:``,m].filter(Boolean).join(` · `);if(p===`stasis`){let t=G(`div`,`tooltip-bundle`),r=document.createElement(`img`);r.src=`./stasis.svg`,r.alt=``,t.append(r,G(`span`,``,e)),n.append(t)}else n.append(K(`div`,`tooltip-bundle`,l,e))}zn(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let w=Vn,T=Hn+Kn;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();w=n.right+qn,T=n.top+(t===`right`?n.height/2:0)}let E=window.innerWidth-n.offsetWidth-Jn,D=Math.max(Jn,Math.min(w,E));n.style.left=`${Math.round(D)}px`;let O=n.offsetHeight,k=t===`right`?T-O/2:T,A=window.innerHeight-O-Jn,ee=Math.max(Jn,Math.min(k,A));n.style.top=`${Math.round(ee)}px`,J=e,Bn=C}function Z(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 Xn(e,{gate:t,placement:n}={}){Wn();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));r()?e===J||e===X||(Z(),X=e,Y=setTimeout(()=>{Y=null,X=null,r()&&Yn(e,{placement:n})},Gn)):Z()}var Zn=new WeakSet;function Qn(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 $n(e,t){!e||Zn.has(e)||(Zn.add(e),e.ownerDocument&&Wn(),e.addEventListener(`mouseover`,n=>{if(n.buttons){Z();return}let r=Qn(n,e);r?r!==J&&Xn(r,t):Z()}),e.addEventListener(`mouseout`,t=>{let n=Qn(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||Z()}),e.addEventListener(`scroll`,()=>Z(e),{capture:!0,passive:!0}))}var er=!1;function tr(){er||(er=!0,Wn(),document.addEventListener(`tooltip-root-connected`,e=>{$n(e.composedPath()[0]?.shadowRoot)}),document.body.addEventListener(`mouseover`,e=>{if(e.target.closest(`[data-tooltip-managed]`))return;if(e.buttons){Z();return}let t=e.target.closest(`[data-tooltip]`);!t||t===J||Xn(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)||Z()}))}function nr(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var rr=()=>Object.fromEntries(S.map(e=>[e,0]));function ir(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,rr());let r=n.get(e.file),i=C(e,t);r[i]!==void 0&&r[i]++}return n}var Q={trees:[],merged:null};function ar(e){let t=e.map(e=>e?.tree??null);return t.length===Q.trees.length&&t.every((e,t)=>e===Q.trees[t])||(Q={trees:t,merged:or(e)}),Q.merged}function or(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 sr(e,t){let n=Object.keys(e),r=new Map(n.map((e,t)=>[e,t])),i=n.map(()=>rr()),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=S.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 cr(e,t,n){return lr(t.get(e))>0||lr(n.get(e))>0}function lr(e){return e?S.reduce((t,n)=>t+(e[n]??0),0):0}var ur={dark:`#0c0c0c`,light:`#f6f8fa`,pink:`#fff0f7`,w95:`#fff`,paper:`#fff`};function $(){let e=typeof document>`u`?null:document.body?.classList;return[`paper`,`pink`,`w95`,`light`].find(t=>e?.contains(`theme-${t}`))??`dark`}var dr=()=>ur[$()];function fr(e){let t=[1,3,5].map(t=>{let n=parseInt(e.slice(t,t+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4});return t[0]*.2126+t[1]*.7152+t[2]*.0722>.18?`#000`:`#fff`}function pr(e){if(!e)return null;let t=e.match(RegExp(`^(?:.*/)?${Ye()}/(@[^/]+/[^/]+|[^/]+)`,`u`));return t?t[1]:`__own__`}function mr(e){return new Set(e.filter(e=>!Xe(e)))}var hr=[`#4e9af1`,`#f28e2b`,`#59a14f`,`#e15759`,`#76b7b2`,`#edc948`,`#b07aa1`,`#ff9da7`,`#9c755f`,`#5cd1e5`,`#f1ce63`,`#d37295`,`#a0cbe8`,`#86bcb6`,`#8cd17d`,`#b6992d`,`#499894`,`#e15759`,`#e879c7`,`#d4a6c8`],gr=[`#2f8aef`,`#d2691e`,`#2ea043`,`#e63946`,`#2e9a92`,`#b88817`,`#9560e8`,`#d24a9c`,`#8a5d40`,`#0891b2`,`#a07a14`,`#c14e8e`,`#1f7ad0`,`#549b94`,`#3fb95f`,`#a07a14`,`#2a8278`,`#cb2c40`,`#c026d3`,`#965f93`],_r=()=>$()===`dark`?hr:gr,vr=new Map;function yr(e){let t=_r();return t[e%t.length]}var br=()=>$()===`dark`?`#6e7681`:`#8c959f`;function xr(e){let t=_r(),n=e??`__own__`,r=`${t===gr?`l`:`d`}:${n}`;if(vr.has(r))return vr.get(r);let i=0;for(let e of n)i=i*37+e.codePointAt(0)|0;let a=t[((i%t.length+t.length)%t.length*7+3)%t.length];return vr.set(r,a),a}function Sr(e,t){if(!t||t===`/`||t===`__own__`)return e;for(let n of[`node_modules`,`dependencies`,Ye()]){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 Cr(e){let t=e.origFile??e.file,n=Sr(t,e.pkg),r=n===t?t:`${a(e.pkg)}/${n}`;return r===t?e.file:r}var wr={package:`@babel/core`,path:/^lib\/config\//u},Tr={package:`@babel/core`,path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},Er=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:wr,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:`babel-typescript-preset`,reason:`Babel configuration loads the TypeScript preset.`,from:wr,to:{package:`@babel/preset-typescript`,path:/./u}},{id:`babel-react-native-preset`,reason:`Babel config loaders load the configured React Native preset.`,from:Tr,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:Tr,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:`babel-transform-plugin`,reason:`Babel config loaders load configured transform plugins.`,from:Tr,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 Dr(e){return typeof e==`string`&&!e.includes(`\\`)&&!e.includes(`:`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`)}function Or(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 kr(e,t){if(e?.ownSource!==!0&&Dr(e?.path)&&Dr(t?.path))return Er.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&Or(n.from,e)&&Or(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 jr(e,t,n,r){return!kr(Ar(e,r),Ar(t,n))}function Mr(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&&jr(o.origFile??i,a.origFile??s,e.ownSourceFiles?.has(s),e.ownSourceFiles?.has(i))&&r.get(t(o)).add(t(a))}}return r}var Nr=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 Pr(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 Fr(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 Ir(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 Lr(e,t){let n=Ir(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 Rr(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 Nr(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=Ir(e,n);for(let i of[[...r,...a.toReversed()],Fr(n),e,e.toReversed()]){let e=Pr(Lr(i,n),t),r=Ir(e,n);r>s&&(o=e,s=r)}return o}function zr(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 Br(e,t){let{groups:n,componentOf:r}=zr(e,t),i=n.map(()=>0),a=n.map(()=>new Set);for(let[e,n]of t)for(let t of n){let n=r.get(e),o=r.get(t);n!==o&&!a[n].has(o)&&(a[n].add(o),i[o]++)}let o=[...i],s=[];o.forEach((e,t)=>{e||s.push(t)});for(let e of s)for(let t of a[e])--o[t]===0&&s.push(t);return{groups:n,componentOf:r,next:a,incoming:i,order:s}}function Vr(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?Cr(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=jr(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:_}=zr(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())Rr(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])),ee=[];for(let[e,t]of u)if(A.has(e))for(let n of t.values())A.has(n.to)&&ee.push({...n,row:A.get(e),col:A.get(n.to)});return{rows:k,byId:s,cells:u,visibleCells:ee,index:A,matches:E,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{ne as a,oe as b,se as c,ce as d,de as e,fe as f,M as g,pe as h,N as i,me as j,ge as k,ve as l,ye as m,be as n,xe as o,P as p,Ce as q,Te as r,De as s,Oe as t,ke as u,Ae as v,je as w,Me as x,I as y,Ne as z,Pe as A,Fe as B,Ie as C,Re as D,ze as E,Je as F,Ye as G,Xe as H,Qe as I,lt as J,ut as K,dt as L,pt as M,mt as N,ht as O,gt as P,_t as Q,St as R,B as S,Dt as T,Mt as U,Lt as V,Bt as W,Ut as X,Yt as Y,Qt as Z,$t as _,W as $,tn as aa,rn as ba,an as ca,sn as da,dn as ea,fn as fa,pn as ga,hn as ha,gn as ia,Dn as ja,On as ka,Nn as la,Yn as ma,Z as na,Xn as oa,$n as pa,tr as qa,nr as ra,ir as sa,ar as ta,sr as ua,cr as va,lr as wa,ur as xa,$ as ya,dr as za,fr as Aa,pr as Ba,mr as Ca,yr as Da,br as Ea,xr as Fa,Rr as Ga,Sr as Ha,Cr as Ia,jr as Ja,Mr as Ka,zr as La,Br as Ma,Vr as Na};
|
|
32
|
-
/*! Bundled license information:
|
|
33
|
-
|
|
34
|
-
lit-html/directives/class-map.js:
|
|
35
|
-
(**
|
|
36
|
-
* @license
|
|
37
|
-
* Copyright 2018 Google LLC
|
|
38
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*)
|
|
40
|
-
*/
|