@preventive/triage 1.0.0-alpha.72 → 1.0.0-alpha.74
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-compare-diff.d.ts +4 -1
- package/common/bundle-compare-diff.js +4 -3
- package/common/bundle-sources.d.ts +2 -0
- package/common/bundle-sources.js +22 -3
- package/common/finding-duplicates.js +5 -0
- package/common/finding-filters.js +45 -4
- package/common/line-diff.d.ts +2 -2
- package/common/line-diff.js +20 -8
- package/common/managed/finding-detail.js +1 -1
- package/common/managed/review-view-routes.js +23 -0
- package/common/managed/risk-routes.js +30 -0
- package/common/managed/routes.js +11 -6
- package/common/managed/team-app.d.ts +8 -6
- package/common/managed/team-app.js +15 -3
- package/common/stasis-files.d.ts +5 -0
- package/common/stasis-files.js +20 -0
- package/common/stasis-tgz.d.ts +6 -0
- package/common/stasis-tgz.js +27 -0
- package/common/workspace-app.js +20 -0
- package/out/activity.js +2 -4
- package/out/{chunk-2F3CYNPZ.js → chunk-2IHCVA3Y.js} +1 -1
- package/out/{chunk-HAZKDK4M.js → chunk-2V6Q4ZOZ.js} +1 -1
- package/out/{chunk-RRBIJL2B.js → chunk-4IW3VD3H.js} +1 -1
- package/out/chunk-4YZOXAXR.js +2 -0
- package/out/chunk-5YP7P5KA.js +1 -0
- package/out/chunk-62QT2RXR.js +6 -0
- package/out/chunk-6VOB5WXX.js +2 -0
- package/out/chunk-A4BBBHQU.js +1 -0
- package/out/{chunk-4ISO5F7Y.js → chunk-ADMVRLNP.js} +1 -1
- package/out/{chunk-HETCVNO4.js → chunk-BLPHP4U3.js} +1 -1
- package/out/{chunk-Y5ZHFNBD.js → chunk-BXQCCW7F.js} +1 -1
- package/out/chunk-C6OPCPCA.js +1 -0
- package/out/{chunk-JFL7WLRV.js → chunk-CU3FPB3P.js} +1 -1
- package/out/chunk-DQJEVHRE.js +52 -0
- package/out/chunk-ESJZZF2Y.js +255 -0
- package/out/{chunk-M37X4LCF.js → chunk-EXQQ5VQJ.js} +1 -1
- package/out/{chunk-NXATZJQ2.js → chunk-GSNSP3EF.js} +1 -1
- package/out/chunk-GV5U7OLP.js +40 -0
- package/out/{chunk-JOXLZXMI.js → chunk-GX5UXWT4.js} +1 -1
- package/out/chunk-HLMQ7QYS.js +1 -0
- package/out/{chunk-YF4M5OCI.js → chunk-I6UQQKAH.js} +1 -1
- package/out/{chunk-UCP3JRE2.js → chunk-LVW7WWV4.js} +1 -1
- package/out/chunk-NEFCZAIY.js +11 -0
- package/out/{chunk-TOXMUOIW.js → chunk-OQS2USZM.js} +1 -1
- package/out/chunk-PLF4LBLE.js +1 -0
- package/out/chunk-QBFT2DDR.js +1 -0
- package/out/{chunk-QMVOEBWC.js → chunk-S2ZIKK45.js} +1 -1
- package/out/chunk-S5HSDGTP.js +8 -0
- package/out/chunk-SSPDMA6D.js +1 -0
- package/out/{chunk-4XIH7YTX.js → chunk-UH6NZBSU.js} +1 -1
- package/out/{chunk-M3Y6SLC4.js → chunk-UJP4PQJA.js} +1 -1
- package/out/{chunk-PAD2JHZT.js → chunk-UJSJMXEG.js} +1 -1
- package/out/chunk-VRAJCPV5.js +3 -0
- package/out/chunk-VS7RV24Z.js +4 -0
- package/out/{chunk-E3LFSUDJ.js → chunk-VYYUMYVW.js} +1 -1
- package/out/chunk-W5PRH5D7.js +2 -0
- package/out/{chunk-VRX2APNA.js → chunk-XVKDPU4D.js} +1 -1
- package/out/{chunk-WKFBZYJX.js → chunk-YI4D6XVX.js} +1 -1
- package/out/client-managed-import.js +3 -3
- package/out/client-managed.js +30 -28
- package/out/compare.js +16 -23
- package/out/dialogs.js +38 -38
- package/out/graph.js +14 -14
- package/out/index.html +31 -51
- package/out/scan.js +2 -2
- package/out/terminal.js +239 -240
- package/out/view.css +1 -1
- package/out/view.js +15 -15
- package/package.json +21 -13
- package/risk/actions/resolve.js +47 -16
- package/risk/actions/uses.js +27 -9
- package/risk/actions/workflow.js +75 -2
- package/risk/files/hosts.js +4 -4
- package/risk/files/readability.js +5 -2
- package/risk/files/runs-code.js +12 -25
- package/risk/files/script.js +141 -19
- package/risk/index.d.ts +24 -7
- package/risk/index.js +1 -0
- package/risk/npm/assess.js +1 -1
- package/risk/npm/compare.js +5 -4
- package/risk/npm/diff.js +1 -1
- package/risk/npm/held.js +6 -2
- package/risk/npm/registry.js +5 -2
- package/risk/npm/tarball.js +79 -22
- package/server-managed/bundle-advisories.ts +12 -36
- package/server-managed/bundle-build-worker.js +29 -11
- package/server-managed/bundle-build.ts +4 -3
- package/server-managed/bundle-cache.ts +53 -13
- package/server-managed/bundle.ts +45 -13
- package/server-managed/comparison.ts +7 -6
- package/server-managed/db-methods.ts +54 -17
- package/server-managed/db-neon.ts +9 -2
- package/server-managed/db-schema.ts +12 -2
- package/server-managed/db.ts +4 -1
- package/server-managed/dependency-reviews.ts +8 -5
- package/server-managed/github-errors.ts +22 -0
- package/server-managed/github-requests.ts +4 -2
- package/server-managed/http.ts +238 -27
- package/server-managed/management.ts +10 -4
- package/server-managed/npm-delta.ts +1 -1
- package/server-managed/npm-loads.ts +2 -2
- package/server-managed/npm-packages.ts +34 -29
- package/server-managed/npm-patch-paths.ts +57 -0
- package/server-managed/npm-patch.ts +77 -82
- package/server-managed/package-entry-points.ts +54 -6
- package/server-managed/rename-diff-worker.js +11 -7
- package/server-managed/rename-diff.ts +5 -4
- package/server-managed/report-opening.ts +77 -0
- package/server-managed/report-sources.ts +2 -1
- package/server-managed/repository-aliases.ts +34 -0
- package/server-managed/repository-browser.ts +87 -32
- package/server-managed/repository-code.ts +14 -8
- package/server-managed/repository-dependency-reviews.ts +21 -0
- package/server-managed/repository-risk-read.ts +71 -4
- package/server-managed/repository-risk.ts +9 -2
- package/server-managed/stasis-config.ts +97 -5
- package/server-managed/team-reports.ts +5 -3
- package/server-managed/type-only-proof.js +26 -4
- package/server-managed/upstream-cache.ts +18 -12
- package/server-managed/workspace-shares.ts +4 -4
- package/out/chunk-27Y75UQR.js +0 -4
- package/out/chunk-4RS3NDOG.js +0 -1
- package/out/chunk-4XSH6ZLT.js +0 -1
- package/out/chunk-7CHIFYQW.js +0 -42
- package/out/chunk-CZ3U2LI4.js +0 -2
- package/out/chunk-ETL5ZPPR.js +0 -259
- package/out/chunk-L6VIWL2Y.js +0 -1
- package/out/chunk-OSHR3N4S.js +0 -3
- package/out/chunk-UD33S2MG.js +0 -52
- package/out/chunk-VG5RH6KN.js +0 -2
- package/out/chunk-WFDXHPT2.js +0 -12
- package/out/chunk-WMFDQS2L.js +0 -11
- package/out/chunk-WREU7JAG.js +0 -1
- /package/out/{chunk-4LZK6C6N.js → chunk-74JZTGTO.js} +0 -0
- /package/out/{chunk-JMG5DXII.js → chunk-7HP2VYIC.js} +0 -0
- /package/out/{chunk-HOB3YPS5.js → chunk-K4XJHM2T.js} +0 -0
- /package/out/{chunk-4EMM6UCD.js → chunk-QI66YA4F.js} +0 -0
- /package/out/{chunk-G3LY2FV4.js → chunk-WCDYSIKG.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,b as t,c as n,d as r}from"./chunk-
|
|
1
|
+
import{a as e,b as t,c as n,d as r}from"./chunk-UJP4PQJA.js";import{a as i,b as a,c as o,d as s,e as c}from"./chunk-UJSJMXEG.js";import{C as l,F as u,H as d,J as f,M as p,O as m,Q as h,S as g,e as _,f as v,h as y,k as b,m as x,n as S,o as C,p as w,u as T,v as E,w as D,x as O,z as k}from"./chunk-LVW7WWV4.js";import{b as ee}from"./chunk-DEVAORP2.js";import{d as te}from"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as ne,d as A,h as j,i as M,j as N,k as P,l as re,o as ie,p as F,r as ae,s as I,t as oe}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var se=[`name`,`version`,`uid`,`resolved`,`integrity`,`dependencies`,`optionalDependencies`];function ce(e,t){let n=e.indexOf(`@`,1);if(n===-1)throw new A(`${j(e)} is not a pattern of the form name@range`,t);return{name:O(e.slice(0,n),t),range:e.slice(n+1)}}function le(e){if(!e.startsWith(`npm:`))return;let t=e.slice(4),n=t.indexOf(`@`,1);return n===-1?{name:t,range:``}:{name:t.slice(0,n),range:t.slice(n+1)}}var ue=new Set([`github.com`,`gitlab.com`,`bitbucket.com`,`bitbucket.org`]);function L(e){if(/^(?:git:|git\+.+:|ssh:|https?:.+\.git(?:$|#.))/u.test(e))return!0;let t=URL.parse(e);return t!==null&&ue.has(t.hostname)&&`${t.pathname}${t.search}`.split(`/`).filter(Boolean).length===2}var de=/^[^:@%/\s.-][^:@%/\s]*\/[^:@\s/%][^:@\s/%#]*(?:#.*)?$/u;function R(e){return L(e)?`git`:/^https?:\/\//u.test(e)||!e.includes(`@`)&&/\.(?:tgz|tar\.gz)$/u.test(e)?`tarball`:e.startsWith(`github:`)||de.test(e)?`github`:/^(?:file:|\.{1,2}\/|\/)/u.test(e)?`file`:/^(link|gitlab|gist|bitbucket):/u.exec(e)?.[1]??`registry`}var fe={github:{host:`github.com`,archive:e=>[`https://codeload.github.com/${e}/tar.gz/`,``]},gitlab:{host:`gitlab.com`,archive:e=>[`https://gitlab.com/${e}/repository/archive.tar.gz?ref=`,``]},bitbucket:{host:`bitbucket.org`,archive:e=>[`https://bitbucket.org/${e}/get/`,`.tar.gz`]}};function pe(e){let t=e.split(`@`),n=(t.length>2?`${t[1]}@${t[2]}`:e).replace(/#.*/u,``).replace(/^.*:/u,``).replace(/.git$/u,``).split(`/`);return n.length<2?void 0:n.slice(-2).join(`/`)}function z(e){let t=e.replace(/^(?:file|link):/u,``);return t.startsWith(`/`)?`/${t.split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`)}`:u(`.`,t)}function me(e,t,n){let r=k(e,t);if(n!==void 0&&n.valid(r)===null)throw new A(`${j(r)} is not a version semver reads`,t);return r}function he(e,t,n,r,i){if(e.startsWith(`file:`))l(e.slice(e.startsWith(`file:./`)?7:5),r);else if(!h(e))throw new A(`${j(e)} is not an http(s) URL, a file: path or a git URL`,r);if(t!==void 0&&!f(t))throw new A(`${j(t)} is not the hex sha1 of a tarball`,r);let a=n===void 0?void 0:m(n,i).get(`sha1`);if(t!==void 0&&a!==void 0&&a.slice(5)!==te(ee(t)))throw new A(`${j(a)} is not the sha1 after the "#" of resolved`,i);return{type:`tarball`,tarball:e,sha1:t,integrity:n}}function ge(e,t){let n=M(t,`resolved`),r=M(t,`integrity`);if(e.resolved===void 0){if(e.integrity!==void 0)throw new A(`an integrity, with nothing resolved`,r);return}let[i,a,...o]=S(e.resolved,n).split(`#`);if(o.length>0)throw new A(`more than one "#", of which yarn reads the first alone`,n);if(!L(i))return he(i,a,e.integrity,n,r);if(e.integrity!==void 0)throw new A(`an integrity, which yarn does not check for a git repository`,r);if(a===void 0||!d(a))throw new A(`expected a full commit hash after the "#" of ${j(i)}`,n);return{type:`git`,repo:p(i,n),commit:a}}function B(e){if(e!==void 0)return e.type===`git`?`${e.repo}#${e.commit}`:e.tarball.replace(/^file:\.\//u,`file:`)}var _e=e=>e===void 0?`nothing, as for a directory`:e.type===`git`?`a git repository`:`a file: tarball`;function ve(e,t,n){let[r]=e,i=e.find(e=>e.name!==r.name);if(i!==void 0)throw new A(`${j(r.key)} and ${j(i.key)} give it two names, of which yarn installs it under one alone`,n);if(t.name!==void 0){let e=y(t.name,M(n,`name`)),i=e===r.name?`the name its patterns give, which yarn does not write`:`yarn installs this as ${j(e)}, and leaves ${j(r.name)} out, which its patterns ask for`;throw new A(i,M(n,`name`))}let a=e.filter(e=>e.source===`registry`).map(({key:e,name:t,alias:r})=>[e,r===void 0?t:O(r.name,n)]),o=a.find(([,e])=>e!==a[0][1]);if(o!==void 0)throw new A(`${j(a[0][0])} and ${j(o[0])} ask for two packages, ${j(a[0][1])} and ${j(o[1])}`,n);return a[0]?.[1]}function ye({range:e,source:t},n){let r=e.split(`#`)[0];if(t===`file`||t===`link`)return n===void 0;if(t===`tarball`)return n?.tarball===r;if(t===`git`)return n?.repo===r;if(t===`gist`)return n?.repo===`https://gist.github.com/${r.slice(5)}.git`;let{host:i,archive:a}=fe[t],o=pe(e);if(o===void 0||n===void 0)return!1;if(n.type===`git`)return n.repo===`git+ssh://git@${i}/${o}.git`;let[s,c]=a(o),{tarball:l}=n;return l.startsWith(s)&&l.endsWith(c)&&d(l.slice(s.length,l.length-c.length))}function be(e,t){let[n,...r]=e.filter(e=>e.source===`file`||e.source===`link`),i=r.find(e=>n.source===`link`||e.source===`link`||z(e.range)!==z(n.range));if(i!==void 0)throw new A(`${j(n.key)} and ${j(i.key)} share an entry, where yarn writes one for each`,t)}function xe(e,t,{asks:n,version:r},i){let a=e.filter(e=>e.source!==`registry`),o=a.find(e=>!ye(e,t));if(o!==void 0)throw new A(`${j(o.key)} resolves to another source than it names`,M(i,`resolved`));be(e,i);let s=e.find(e=>e.source===`registry`);if((a.length===0||a.some(e=>e.source===`tarball`))&&t?.type===`tarball`&&t.sha1===void 0&&t.integrity===void 0)throw new A(`a tarball with no hash, neither a sha1 after "#" nor an integrity, where yarn writes the sha1`,M(i,`resolved`));if(s!==void 0){if(a.length>0)return{registry:s.key,sources:a.map(e=>e.key)};if(t===void 0&&e.length===1)return{registry:s.key,sources:[]};if(t?.type!==`tarball`||t.tarball.startsWith(`file:`))throw new A(`${j(s.key)} asks for the registry, and resolves to ${_e(t)}`,i);g(t.tarball,n,r,M(i,`resolved`))}}function Se(e,t,n){let r=Object.create(null);for(let[i,a,o]of v(b(e),t)){let e=`${O(i,o)}@${y(a,o)}`;r[i]=e,n.push({targets:r,name:i,range:a,pattern:e,where:o})}return r}function Ce({keys:e,fields:n},r,i){_(n,r,se);let a=e.map(e=>{let{name:t,range:n}=ce(e,M(``,e));return{key:e,name:t,range:n,source:R(n),alias:le(n)}}),o=ve(a,n,r),s=me(n.version,M(r,`version`),i),c=ge(n,r),l=xe(a,c,{asks:o,version:s},r),u=[],{dependencies:d,optionalDependencies:f}=t(n,r,(e,t)=>Se(e,t,u)),p=x(n,`uid`,r,y);if(p===s)throw new A(`the version, which yarn does not write as a uid`,M(r,`uid`));return{pkg:{patterns:e,name:a[0].name,version:s,uid:p,resolution:c,dependencies:d,optionalDependencies:f},patterns:a,handed:l,requests:u}}var we=/^(?![vV=]?\d|[xX*](?:\.|$))[A-Za-z][\w.-]*$/u;function V(e,t){return t===void 0?!/[:/@#]/u.test(e)&&!we.test(e):t.validRange(e)!==null}function Te(e,t,n,r,i){let a=e=>e.source===`registry`&&V(e.range,r),o=t.find(a)??n.patterns.find(a);if(o!==void 0)throw new A(`is ${e.name} ${e.version}, as ${j(n.key)} is, and yarn gives ${j(o.key)} whichever it resolves first`,i)}var H=({integrity:e})=>e===void 0?new Map:m(e),U=e=>JSON.stringify(Object.entries(e).sort(([e],[t])=>e<t?-1:1));function W(e,t,n,r){for(let i of[`dependencies`,`optionalDependencies`])if(U(e[i])!==U(t[i]))throw new A(`other ${i} ${n}`,M(r,i))}function Ee(e,t,n){let r=`than ${j(t.patterns[0])}, of the same ${e.resolution.type===`git`?`commit`:`tarball`}`;if(e.version!==t.version)throw new A(`another version ${r}`,M(n,`version`));W(e,t,r,n);let[i,a]=[e.resolution,t.resolution];if(i.sha1!==void 0&&a.sha1!==void 0&&i.sha1!==a.sha1)throw new A(`another sha1 ${r}`,M(n,`resolved`));let o=H(a);for(let[e,t]of H(i))if(o.has(e)&&o.get(e)!==t)throw new A(`another ${e} integrity ${r}`,M(n,`integrity`))}function De(e,t){let n=Object.create(null),r=[],i=[],a=[],o=new Map,s=new Map,c=new Map;for(let l of e){let[e]=l.keys,u=M(``,e),d=Ce(l,u,t),{pkg:f}=d;for(let e of l.keys)n[e]=f;r.push(...d.patterns),i.push(...d.requests),d.handed!==void 0&&a.push({pkg:f,...d.handed});let p=d.patterns.find(e=>e.source===`file`),m=l.fields.resolved??(p===void 0?void 0:`
|
|
2
2
|
${z(p.range)}`),h=m===void 0?void 0:`${f.name}
|
|
3
3
|
${m}`;if(o.has(h))throw new A(`resolves as ${j(o.get(h))} does, which yarn writes as one entry`,u);h!==void 0&&o.set(h,e);let g=B(f.resolution);if(g!==void 0){let e=s.get(g)??s.set(g,[]).get(g);e.length>0&&Ee(f,e[0],u),e.push(f)}if(d.handed?.sources.length===0)continue;let _=`${f.name}
|
|
4
4
|
${f.version}`,v=c.get(_);v===void 0?c.set(_,{key:e,patterns:d.patterns}):Te(f,d.patterns,v,t,u)}for(let e of a)e.other=s.get(B(e.pkg.resolution))?.find(t=>t!==e.pkg);return{packages:n,patterns:r,requests:i,mixed:a}}var G=`manifests`;function Oe(e,t,n){let r=/^(?:file|link):/u.exec(e)?.[0];if(r===void 0&&!e.startsWith(`/`))return e;let i=e.slice(r?.length??0);if(i.startsWith(`/`)||/^[A-Za-z]:/u.test(i))throw new A(`${j(e)} is an absolute path`,n);let a=l(u(t,i),n);return`${r}${a!==`.`&&/^\.(?:\/|$)/u.test(i)&&!/^\.{0,2}\//u.test(a)?`./`:``}${a}`}var K=(e,t,n)=>n===void 0?e.version===t||void 0:n.satisfies(e.version,t,{loose:!0});function q({name:e,range:t,pattern:n,where:r},i,a){let o=i.get(e);if(o!==void 0&&K(o,t,a)===!0)throw new A(`${j(n)} is satisfied by the workspace ${j(o.dir)}, which yarn links instead`,r)}function J({name:e,range:t,pattern:n,where:r},i,a){let o=i?.get(e);if(o===void 0)throw new A(`${j(n)} is not a pattern of the lockfile${i===void 0?`, nor a workspace's, as only the manifests may say`:``}`,r);if(K(o,t,a)===!1)throw new A(`${j(n)} is not a pattern of the lockfile, nor satisfied by the workspace ${j(o.dir)}, ${o.version}`,r);return`link:${o.dir}`}function Y(e,t,n,r){for(let i of e)i.pattern in t||(i.targets[i.name]=J(i,n,r))}function X(e,{packages:t,workspaces:n,semver:r}){return e.pattern in t?(q(e,n,r),e.pattern):J(e,n,r)}var ke=[`optionalDependencies`,`dependencies`,`devDependencies`];function Ae(t,n,r,i){let a=new Map;for(let e of ke)for(let[n,i,o]of v(b(t[e]),M(r,e))){if(n===`//`)continue;let t=y(i,o),r=a.get(n)??a.set(n,{kind:e,value:t,here:o,range:void 0}).get(n);r.range===void 0&&t!==``&&t!==`*`&&(r.range=t)}let o=Object.create(null);for(let t of e)o[t]=Object.create(null);for(let[e,{kind:t,value:r,here:s,range:c}]of a){let a=Oe(c??r,n,s);o[t][e]=X({name:e,range:a,pattern:`${O(e,s)}@${a}`,where:s},i)}return o}function je(e,t,n){let r=[];for(let[a,o,s]of v(b(e),t)){if(a===`//`)continue;if(/\/$|\/\/|\*$/u.test(a))throw new A(`${j(a)} is a path yarn ignores`,s);let e=a.match(/(?:@[^/]+\/)?[^/]+/gu)??[a],t=i(e.length===1?`**/${a}`:a,s),c=O(e.at(-1),s),l=e.slice(0,-1).find(e=>e!==`**`&&!D(e.replaceAll(/[*?]/gu,`x`)));if(l!==void 0)throw new A(`${j(l)} is not a package name, or a glob of one`,s);let u=y(o,s);if(R(u)===`registry`&&!V(u,n))throw new A(`${j(u)} is a range yarn ignores in a resolution: neither a semver range nor a source`,s);r.push({path:a,tests:t,name:c,range:u,pattern:`${c}@${u}`,where:s})}return r}function Me(t,r,i){let a=Object.values(t).flatMap(t=>e.map(e=>t[e])),o=n([i.map(e=>e.pattern).filter(e=>e in r),...a],r);if(o!==void 0)throw new A(`nothing asks for it: no manifest, no package and no resolution`,M(``,o))}function Ne(e,t){let n=e.workspaces;if(n===void 0)return[];let r=M(t,`workspaces`),a=n;Array.isArray(n)||(_(n,r,[`packages`,`nohoist`]),x(n,`nohoist`,r,C),a=n.packages===void 0?[]:n.packages,r=M(r,`packages`));let o=C(a,r);if(o.length>0&&e.private!==!0)throw new A(`expected true, as yarn has workspaces in a private project alone`,M(t,`private`));return o.map((e,t)=>i(e.replace(/^(?:\.\/)+/u,``).replace(/(?<!\/)\/+$/u,``),`${r}[${t}]`))}var Pe={__proto__:null,depdenencies:`dependencies`,dependancies:`dependencies`,dependecies:`dependencies`,depends:`dependencies`,"dev-dependencies":`devDependencies`,devDependences:`devDependencies`,devDepenencies:`devDependencies`,devEependencies:`devDependencies`,devdependencies:`devDependencies`},Fe=/^[\s\dA-Za-z.+=-]{1,256}$/u;function Ie(e,t,n){let r=S(e,t);if(!Fe.test(r))throw new A(`${j(r)} is not a version`,t);if(n===void 0)return r;let i=n.clean(r,{loose:!0});if(i===null)throw new A(`${j(r)} is not a version semver reads`,t);return i}function Le(e,t,n,r,i){for(let e of Object.keys(Pe))if(Object.hasOwn(t,e))throw new A(`a field yarn does not read, for ${j(Pe[e])}`,M(n,e));if(l(e,n)===`.`)return;if(r.length===0)throw new A(`expected workspaces, as there are manifests of workspaces`,M(M(G,`.`),`workspaces`));if(e.split(`/`).includes(`node_modules`)||!r.some(t=>c(t,e)))throw new A("not a workspace the root's `workspaces` finds",n);if(t.resolutions!==void 0)throw new A(`a workspace's, which yarn does not read`,M(n,`resolutions`));let a=M(n,`name`),o=O(y(t.name,a),a);if(t.version===void 0)throw new A(`expected a version, without which yarn ignores the workspace`,M(n,`version`));return{name:o,dir:e,version:Ie(t.version,M(n,`version`),i)}}function Re(e,t,n,r){_(e,G);let i=M(G,`.`),a=e[`.`];if(a===void 0)throw new A(`expected the manifest beside the lockfile, "."`,G);let o=Ne(_(a,i),i),s=new Map;for(let[t,n,i]of v(e,G)){let e=Le(t,_(n,i),i,o,r);if(e!==void 0){if(s.has(e.name))throw new A(`the name of the workspace ${j(s.get(e.name).dir)} too`,M(i,`name`));s.set(e.name,e)}}for(let e of n)e.pattern in t&&q(e,s,r);Y(n,t,s,r);let c={packages:t,workspaces:s,semver:r},l=w(e,G,(e,t,n)=>Ae(e,n,t,c)),u=je(a.resolutions,M(i,`resolutions`),r);for(let e of u){if(!(e.pattern in t)&&!s.has(e.name))throw new A(`${j(e.pattern)} is not a pattern of the lockfile, where yarn records every resolution's`,e.where);e.target=X(e,c)}return Me(l,t,u),{importers:l,workspaces:s,rules:u,aggregated:Array.isArray(a.workspaces?.packages??a.workspaces)}}var ze=`workspace-aggregator-00000000-0000-0000-0000-000000000000`;function Be(t,{importers:n,workspaces:r,rules:i,aggregated:c},l){let u=i.map(e=>e.tests),d=(e,t)=>t.split(`/`).reduce((e,t)=>e.map((e,n)=>o(u[n],e,t)),e),f=e=>e.startsWith(`link:`)?n[e.slice(5)]:t[e],p=(e,t,r,i)=>{let a=e.patterns===void 0?M(G,Object.keys(n).find(t=>n[t]===e)):M(``,e.patterns[0]);return new A(`${j(e[t][r])} ${i}`,M(M(a,t),r))},m=new Map,h=[],g=new Set,_=new Map,v=(e,t,n,r)=>{let i=e[t][n],a=r===void 0||r.pattern===i,o=a?_.get(i):g.has(i)?r:void 0;if(o!==void 0)throw p(e,t,n,`is asked for both where the resolution ${j(o.path)} applies and where none does, and yarn writes one entry for both`);a?g.add(i):_.set(i,r)},y=new Set,x=(e,t)=>{if(y.has(e))return;let n=m.get(e)??new Set,r=t.join();n.has(r)||(m.set(e,n.add(r)),h.push([e,t]))},S=n[`.`],C=u.map(e=>a(e,1)),w=d(C,ze),T=new Map,E=[],D=(e,n)=>t[e.target]===n||l.get(n)?.sources[0]===e.target,O=(e,n,a,o)=>{let m=e[n][a],h=d(o,a),g=t[m],_=l.get(g),y=_===void 0?``:`the resolution ${j(_.rule.path)} resolves to`,b=e===S&&(!c||r.has(a)),C=e===S&&!b?d(w,a):h,O=i.find((e,t)=>e.name===a&&s(u[t],C[t]));if(b){if(_!==void 0)throw p(e,n,a,`is given what ${y}, which yarn applies to no dependency of the root's own`);if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)} as the resolution ${j(O.path)} says, which yarn ignores for the root's own dependencies`);return v(e,n,a,void 0),x(f(m),h)}if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)}, which the resolution ${j(O.path)} resolves it to`);if(_?.sources.includes(m))throw p(e,n,a,`asks for what ${y}, as a dependency of its own`);if(_!==void 0&&!_.sources.includes(O?.target))throw p(e,n,a,`is given what ${y}, which yarn does not apply to it here`);v(e,n,a,O),e===S&&O!==void 0&&T.set(m,O),O===void 0?x(f(m),h):O.target.startsWith(`link:`)&&E.push([e[n],a,O.target])},k=()=>{for(;h.length>0;){let[t,n]=h.pop();for(let r of e)for(let e of Object.keys(b(t[r])))O(t,r,e,n)}};for(let e of i)e.pattern in t&&(g.add(e.pattern),x(t[e.pattern],d(C,e.name)));k(),y=new Set(m.keys());for(let t of e)for(let e of Object.keys(S[t]))O(S,t,e,C);for(let[e,{dir:t}]of r)x(n[t],d(w,e));k();for(let[e,t,n]of E)e[t]=n;return{plain:g,own:T}}function Ve(e,t,n,r,i){for(let{key:a,range:o,source:s,alias:c}of t){let t=n?.own.get(a);if(s!==`registry`||t===void 0&&n?.plain.has(a)===!1)continue;let l=c?.range??o,{version:u}=e[a];if(l===``||r.satisfies(u,l)||r.validRange(l)===null)continue;let d=i?`and no resolution gives it`:`which only a resolution may excuse, as the manifests would say`;throw t!==void 0&&(d=`which the root asks for before the resolution ${j(t.path)} applies, so yarn takes it as outdated`),new A(`${u} does not satisfy ${j(l)}, ${d}`,M(``,a))}}function He(e,t,n){let r=t?.workspaces.get(e.name);if(r===void 0)return;let i=t.rules.find(e=>e.target===`link:${r.dir}`);if(i===void 0)return;let a=`than the workspace ${j(r.dir)}, which the resolution ${j(i.path)} gives it`;if(e.version!==r.version)throw new A(`another version ${a}, ${r.version}`,M(n,`version`));return W(e,t.importers[r.dir],a,n),i}function Ue({packages:e,patterns:t,mixed:n},r,i){let a=new Map;for(let{pkg:e,registry:t,sources:i,other:o}of n){let n=M(``,e.patterns[0]);if(i.length===0){let i=He(e,r,n);if(i===void 0)throw new A(`${j(t)} asks for the registry, and resolves to nothing, ${r===void 0?`which only a resolution to a workspace may, as the manifests would say`:`as for a directory`}`,n);a.set(e,{sources:[i.target],rule:i});continue}if(r===void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(i[0])} names, which only a resolution may, as the manifests would say`,n);let s=i.find(e=>!r.rules.some(t=>t.pattern===e));if(s!==void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(s)} names, which no resolution does`,n);let c=r.rules.find(e=>i.includes(e.pattern));if(o!==void 0)throw new A(`asks for what the resolution ${j(c.path)} resolves to, as a dependency of its own`,M(``,o.patterns[0]));a.set(e,{sources:i,rule:c})}let o=r!==void 0&&r.rules.length>0?Be(e,r,a):void 0;i!==void 0&&Ve(e,t,o,i,r!==void 0);for(let[t,{sources:n}]of a)n[0].startsWith(`link:`)&&delete e[t.patterns[0]]}var We=[`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.`,`# yarn lockfile v1`],Ge=/^# yarn lockfile v(\d+)$/u,Ke=/[:\s\\",[\]]/u,qe=e=>e.startsWith(`true`)||e.startsWith(`false`)||Ke.test(e)||!/^[A-Za-z]/u.test(e),Je=/[A-Za-z][^\s:\\",[\]]*/uy;function Ye(e,t,n){let[r,i]=oe(e,t,n);if(r.includes(`\\"`))throw N(`${j(r)} is a string yarn reads to another quote`,n);let a=P.exec(r)?.[0];if(a!==void 0)throw N(`an escape for ${ne(a)}, which is not allowed`,n);if(!qe(r))throw N(`${j(r)} is quoted, where yarn writes it bare`,n);return[r,i]}function Xe(e,t,n){if(e[t]===`"`)return Ye(e,t,n);Je.lastIndex=t;let r=Je.exec(e)?.[0];if(r===void 0)throw N(`expected a string, found ${ie(e,t)}`,n);if(qe(r))throw N(`${j(r)} is bare, where yarn quotes it`,n);return[r,t+r.length]}function Z(e,t,n){let[r,i]=Xe(e,t,n);if(r===``)throw N(`an empty key, which yarn does not read`,n);return[r,i]}function Ze(e,t,n){let[r,i]=Xe(e,t,n);if(r.startsWith(`null`)&&e[t]!==`"`)throw N(`${j(r)} is bare, and read as null by some readers`,n);return Q(e,i,n),r}function Q(e,t,n){if(t!==e.length)throw N(`expected the end of the line, found ${j(e.slice(t))}`,n)}function Qe(e,t){if(e.line!==t)throw N(`expected yarn's header, ${j(t)}`,e.number);I(e)}function $e(e){Qe(e,We[0]);let t=Ge.exec(e.line??``)?.[1];if(t!==void 0&&t!==`1`)throw N(`unsupported version: expected "1", found ${j(t)}`,e.number);for(Qe(e,We[1]);e.line?.startsWith(`#`);I(e)){if(/^yarn lockfile v\d+$/u.test(e.line.slice(1).trim()))throw N(`a second lockfile version`,e.number);if(e.line===`#`)throw N(`a comment of "#" alone, which @yarnpkg/parsers does not read`,e.number)}}function $(e,t,n,r,i){let a=Object.create(null);for(let n=e.line;n?.startsWith(` `)&&F(n)>t-2;n=e.line){if(F(n)!==t)throw N(`expected ${t} spaces of indentation, found ${F(n)}`,e.number);let[r,o]=Z(n,t,e.number);i(a,r,o,n,e.number)}if(Object.keys(a).length===0)throw N(n,r);return a}var et=(e,t,n)=>$(e,4,`expected what ${j(t)} holds below it`,n,(n,r,i,a,o)=>{if(a[i]!==` `)throw N(`expected a space and a range after ${j(r)}`,o);let s=Ze(a,i+1,o);if(r in n)throw N(`${j(r)} is in ${j(t)} twice`,o);n[r]=s,I(e)}),tt=(e,t)=>$(e,2,`expected the fields of the entry below it`,t,(t,n,r,i,a)=>{if(n in t)throw N(`the field ${j(n)} twice`,a);if(i[r]===`:`)Q(i,r+1,a),I(e),t[n]=et(e,n,a);else{if(i[r]!==` `)throw N(`expected a space and a value, or ":", after ${j(n)}`,a);t[n]=Ze(i,r+1,a),I(e)}});function nt(e,t){let{line:n,number:r}=e,i=[];for(let e=0;;){let[a,o]=Z(n,e,r);if(t.has(a))throw N(`${j(a)} is a key ${t.get(a)===r?`twice`:`at line ${t.get(a)+1} too`}`,r);if(t.set(a,r),i.push(a),n[o]===`:`){Q(n,o+1,r);break}if(!n.startsWith(`, `,o))throw N(`expected ", " and a pattern, or ":", after ${j(a)}`,r);e=o+2}return I(e),{keys:i,fields:tt(e,r)}}function rt(e){re(e,`yarn`);let t=ae(e,P);I(t),$e(t);let n=[],r=new Map,i;for(let e=t.line;e!==void 0;e=t.line)if(e===``)n.length>0&&(i??=t.number),I(t);else{if(e.startsWith(` `))throw i===void 0?N(`expected an entry, at column 0`,t.number):N(`a blank line within an entry`,i);if(e.startsWith(`#`))throw N(`a comment, which yarn writes in the header alone`,t.number);i=void 0,n.push(nt(t,r))}return n}var it=[`manifests`,`checkVersions`,`semver`],at=[`clean`,`satisfies`,`valid`,`validRange`];function ot(e,t){let n=t===void 0?()=>({dev:void 0,optional:void 0,devOptional:void 0}):r(e,t);for(let t of new Set(Object.values(e)))Object.assign(t,n(t))}function st(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{manifests:n,semver:r}=T(t,it);E(t,at);let i=De(rt(e),r),{packages:a,requests:o}=i;n===void 0&&Y(o,a);let s=n===void 0?void 0:Re(n,a,o,r);return Ue(i,s,r),ot(a,s?.importers),{packages:a,importers:s?.importers}}export{A as LockfileError,st as parseYarn1Lockfile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t,d as n,e as r,h as i,i as a,j as o,k as s,m as c,o as l,q as u,r as d,s as ee}from"./chunk-JFL7WLRV.js";import{a as f,c as p,e as m,f as h,h as te,j as g,k as _,l as v,m as ne,n as re,o as ie,p as ae}from"./chunk-JOXLZXMI.js";import{D as oe,H as y,M as se,l as ce,m as b,p as le,t as x}from"./chunk-UCP3JRE2.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as ue,c as de,e as fe,g as pe}from"./chunk-E3LFSUDJ.js";import{d as S,e as me,h as C,i as w}from"./chunk-JMG5DXII.js";import"./chunk-OOJM4CTU.js";function T(e,t,n=[`https:`,`http:`,`file:`]){let r=URL.parse(h(e,t));if(r===null||r.href!==e||!n.includes(r.protocol))throw new S(`${C(e)} is not a URL in normal form, of ${n.map(e=>e.slice(0,-1)).join(`, `)}`,t);if(r.username!==``||r.password!==``)throw new S(`${C(e)} has credentials in it, which uv does not write`,t);return r}var E=g(e=>/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,9})?Z$/u.test(e)&&de(e),`a UTC timestamp`),D=v(i),O=(e,t,n)=>re(e,t,i,n),he={__proto__:null,md5:32,sha256:64,sha384:96,sha512:128,blake2b:64};function k(e){return e.type===`url`?new URL(e.url).pathname:e.type===`path`||e.type===`git`?e.path:void 0}var A=e=>e===void 0?void 0:e.endsWith(`.whl`)?`wheel`:`sdist`;function ge(e,t){return e.type===`registry`?e.url===void 0?[`url`,`path`]:[`url`]:t?e.type===`url`?[`url`]:[`filename`]:[]}function j(e,t,n,r){let i=ge(n,r),a=n.type===`registry`;p(e,t,[...i,`hash`,...a?[`size`,`upload-time`,`upload_time`]:[]]);let o=i.filter(t=>e[t]!==void 0);if(i.length>0&&o.length!==1)throw new S(o.length===0?`expected ${i.join(` or `)}`:`a url and a path, of which uv reads the url alone`,t);if(e[`upload-time`]!==void 0&&e.upload_time!==void 0)throw new S(`upload-time and upload_time, which are one field to uv`,t);let s=b(e,`url`,t,T),c={url:s?.href,path:b(e,`path`,t,u),filename:b(e,`filename`,t,h),hash:b(e,`hash`,t,(e,t)=>l(e,t,he)),size:b(e,`size`,t,te),uploadTime:b(e,e.upload_time===void 0?`upload-time`:`upload_time`,t,E)};if(!a&&c.hash===void 0)throw new S(`expected a hash, which uv writes for a file of a ${n.type} source`,t);return{file:c,pathname:s?.pathname}}function _e(e,t,n){if(e===void 0)return;let r=A(k(n));if(n.type!==`registry`&&r!==`sdist`)throw new S(`an sdist, which a ${n.type} source${r===`wheel`?` of a wheel`:``} has none of`,t);let{url:i,path:a,hash:o,size:s,uploadTime:c}=j(e,t,n,!1).file;return{url:i,path:a,hash:o,size:s,uploadTime:c}}function ve(t,n,r){if(t===void 0)return[];let{source:i}=r,a=A(k(i)),o=m(t,n);if(i.type!==`registry`&&(a!==`wheel`||o.length!==1))throw new S(a===`wheel`?`expected the one wheel the source is`:`wheels, which a ${i.type} source${a===`sdist`?` of an sdist`:``} has none of`,n);let c=new Set;return o.map((t,a)=>{let o=`${n}[${a}]`,{file:l,pathname:u}=j(t,o,i,!0),d=ee({name:l.filename,path:l.path,pathname:u}),f=d===void 0?void 0:s(d);if(f===void 0)throw new S(`${C(String(d))} is not the name of a wheel`,o);if(c.has(d))throw new S(`${C(d)} is listed twice`,o);if(c.add(d),f.name!==r.name)throw new S(`${C(d)} is a wheel of ${C(f.name)}, not of ${C(r.name)}`,o);if(r.versionKey!==void 0&&r.versionKey!==e(f.version)&&r.versionKey!==e({...f.version,local:void 0}))throw new S(`${C(d)} is a wheel of another version than ${C(r.version)}`,o);if(i.type===`url`&&l.url!==i.url)throw new S(`${C(l.url)} is not the URL the source names`,w(o,`url`));return{...l,filename:d}})}var M=[`registry`,`git`,`url`,`path`,`directory`,`editable`,`virtual`],ye=new Set([`directory`,`editable`,`virtual`]),N=new Set([`branch`,`tag`,`rev`]),be=new Set([...N,`subdirectory`,`path`,`lfs`]),P=(e,t,n)=>new S(`${C(e)} is not a git source: ${t}`,n),F=`expected "#" and the full commit it resolved to`;function I(e,t){let n=T(se(e,t),t,[`https:`,`http:`,`ssh:`,`file:`]),r=[...n.searchParams],i=r.find(([e])=>!be.has(e));if(i!==void 0)throw P(e,`uv does not read ${C(i[0])}`,t);if(new Set(r.map(([e])=>e)).size!==r.length)throw P(e,`a key twice in the query`,t);let a=r.filter(([e])=>N.has(e));if(a.length>1)throw P(e,`more than one of branch=, tag= and rev=`,t);let o=Object.fromEntries(r);if(o.lfs!==void 0&&o.lfs!==`true`)throw P(e,`lfs= other than true, which uv does not write`,t);for(let e of[`subdirectory`,`path`])o[e]!==void 0&&oe(o[e],t);let s=n.hash===``?void 0:n.hash.slice(1);if(s!==void 0&&!y(s))throw P(e,F,t);let c=o.rev?.toLowerCase();if(c!==void 0&&s!==void 0&&y(c)&&c!==s)throw P(e,`rev= names another commit than the one it resolved to`,t);return n.search=``,n.hash=``,{type:`git`,url:e,repository:n.href,reference:a.length===0?void 0:{kind:a[0][0],name:a[0][1]},commit:s,subdirectory:o.subdirectory,path:o.path,lfs:o.lfs===`true`}}function xe(e,t){return/^[A-Za-z][\dA-Za-z+.-]+:/u.test(h(e,t))?{type:`registry`,url:T(e,t).href,path:void 0}:{type:`registry`,url:void 0,path:u(e,t)}}function Se(e,t,n,r){let i=w(r,e);if(e===`registry`)return xe(t,i);if(e===`git`){let e=I(t,i);if(e.commit===void 0)throw P(t,F,i);return e}if(e===`url`){if(T(t,i,[`https:`,`http:`]).hash!==``)throw new S(`${C(t)} has a fragment, which uv drops`,i);return{type:e,url:t,subdirectory:ce(d)(n,w(r,`subdirectory`))}}return{type:e,path:u(t,i)}}function L(e,t){p(e,t,[...M,`subdirectory`]);let n=ie(e,M,t);if(e.subdirectory!==void 0&&n!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let r=Se(n,e[n],e.subdirectory,t);return{...r,id:Ce(r)}}function Ce(e){return e.type===`registry`?`registry+${e.url??e.path}`:e.type===`git`?`git+${e.url}`:e.type===`url`?`direct+${e.url}${e.subdirectory===void 0?``:`#subdirectory=${e.subdirectory}`}`:`${e.type}+${e.path}`}var R=e=>ye.has(e.type);function z(e,t){if(p(e,t,[`package`,`extra`,`group`]),e.extra!==void 0&&e.group!==void 0)throw new S(`an extra and a group, of which uv takes one`,t);return{package:i(e.package,w(t,`package`)),extra:b(e,`extra`,t,i),group:b(e,`group`,t,i)}}var B=[`git`,`url`,`path`,`directory`,`editable`,`virtual`],V=[`specifier`,`index`,`conflict`],H=[`name`,`extras`,`groups`,`marker`,`subdirectory`,...B,...V];function we(e,t){let n=B.filter(t=>e[t]!==void 0),i=V.filter(t=>e[t]!==void 0);if(n.length+ +(i.length>0)>1)throw new S(`more than one source: ${[...n,...i].join(`, `)}`,t);if(e.subdirectory!==void 0&&n[0]!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let[a=`registry`]=n,o=w(t,a);return a===`registry`?{type:a,specifier:b(e,`specifier`,t,r),index:b(e,`index`,t,T)?.href,conflict:b(e,`conflict`,t,z)}:a===`git`?I(e.git,o):a===`url`?{type:a,url:T(e.url,o,[`https:`,`http:`]).href,subdirectory:b(e,`subdirectory`,t,d)}:{type:a,path:u(e[a],o)}}function U(e,t,n=H){p(e,t,n);let r=b(e,`extras`,t,D)??[],o=b(e,`groups`,t,D)??[];if(r.length>0&&o.length>0)throw new S(`extras and groups, of which uv takes one`,t);return{name:i(e.name,w(t,`name`)),extras:r,groups:o,marker:b(e,`marker`,t,a),source:we(e,t)}}function Te(e,t){return{...U(e,t,[...H,`hashes`]),hashes:b(e,`hashes`,t,v((e,t)=>l(e,t,c)))??[]}}var W=_(U),G=(e,t)=>O(e,t,W);function Ee(e,t){return p(e,t,[`name`,`version`,`requires-dist`,`requires-python`,`provides-extras`]),{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),requiresDist:b(e,`requires-dist`,t,v(o))??[],requiresPython:b(e,`requires-python`,t,r),providesExtras:b(e,`provides-extras`,t,D)??[]}}var De=_((e,t)=>{if(fe(e)&&Object.hasOwn(e,`package`))throw new S(`an override of one package's dependencies, which is not read here`,t);return U(e,t)}),Oe=[`members`,`requirements`,`constraints`,`overrides`,`excludes`,`build-constraints`,`dependency-groups`,`dependency-metadata`];function ke(e=Object.create(null)){let t=`manifest`;p(e,t,Oe);let n=(n,r)=>b(e,n,t,r)??[];return{members:n(`members`,D),requirements:n(`requirements`,W),constraints:n(`constraints`,W),overrides:n(`overrides`,De),excludes:n(`excludes`,D),buildConstraints:n(`build-constraints`,_(Te)),dependencyGroups:G(e[`dependency-groups`],w(t,`dependency-groups`)),dependencyMetadata:n(`dependency-metadata`,_(Ee))}}function Ae(e=Object.create(null),t){return p(e,t,[`requires-dist`,`provides-extras`,`requires-dev`]),{requiresDist:b(e,`requires-dist`,t,W)??[],providesExtras:b(e,`provides-extras`,t,D)??[],requiresDev:G(e[`requires-dev`],w(t,`requires-dev`))}}var K=(...e)=>(t,n)=>{if(!e.includes(h(t,n)))throw new S(`expected one of ${e.join(`, `)}`,n);return t},q=K(`disallow`,`allow`,`if-necessary`,`explicit`,`if-necessary-or-explicit`),J=g(e=>/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d{1,9})?S)?)?$/u.test(e),`an ISO 8601 duration`);function je(e,t){return e===!1?!1:typeof e==`string`?{timestamp:E(e,t),span:void 0}:(p(e,t,[`timestamp`,`span`]),{timestamp:E(e.timestamp,w(t,`timestamp`)),span:J(e.span,w(t,`span`))})}function Me(e,t){p(e,t,[`glibc`,`musl`]);let n=g(e=>/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u.test(e),`a libc version`);return{glibc:b(e,`glibc`,t,n),musl:b(e,`musl`,t,n)}}var Ne=[`resolution-mode`,`prerelease-mode`,`fork-strategy`,`exclude-newer`,`exclude-newer-span`,`exclude-newer-package`,`prerelease-package`,`minimum-libc-version`];function Pe(e=Object.create(null)){let t=`options`;p(e,t,Ne);let n=b(e,`exclude-newer`,t,E);return{resolutionMode:b(e,`resolution-mode`,t,K(`highest`,`lowest`,`lowest-direct`))??`highest`,prereleaseMode:b(e,`prerelease-mode`,t,q)??`if-necessary-or-explicit`,forkStrategy:b(e,`fork-strategy`,t,K(`fewest`,`requires-python`))??`requires-python`,excludeNewer:e[`exclude-newer-span`]===void 0?n:void 0,excludeNewerSpan:b(e,`exclude-newer-span`,t,J),excludeNewerPackage:O(e[`exclude-newer-package`],w(t,`exclude-newer-package`),je),prereleasePackage:O(e[`prerelease-package`],w(t,`prerelease-package`),q),minimumLibcVersion:b(e,`minimum-libc-version`,t,Me)}}var Fe=_((e,t)=>{let n=_(z)(e,t);if(n.length<2)throw new S(`a set of conflicts of fewer than two, which uv refuses`,t);return n}),Ie=[`version`,`revision`,`requires-python`,`resolution-markers`,`supported-markers`,`required-markers`,`conflicts`,`options`,`manifest`,`package`],Le={distribution:"`distribution` is what uv 0.2 and older wrote for `package`, which is not read here"},Re=[`name`,`version`,`source`,`resolution-markers`,`dependencies`,`sdist`,`wheels`,`optional-dependencies`,`dev-dependencies`,`metadata`],ze={"dependency-groups":"`dependency-groups` is an older spelling of `dev-dependencies`, which uv no longer writes"},Be=[`name`,`version`,`source`,`extra`,`marker`];function Ve(e,t){if(e===void 0)return 0;if(e===1||e===2||e===3)return e;throw new S(`unsupported revision: expected 1, 2 or 3, found ${f(e)}`,t)}function He(e,t){if(e===1)return e;throw e===void 0?new S("no `version`: a lockfile of uv 0.2 or older, which is not read here",t):new S(`unsupported version: expected 1, found ${f(e)}`,t)}var Y=(e,t)=>e===void 0?[]:ne(e,t,a),X=(e,t,n)=>`${e}${t===void 0?``:`==${t}`} @ ${n}`;function Ue(e,t){p(e,t,Be);let r=b(e,`extra`,t,D)??[],o=x(r);if(o!==void 0)throw new S(`${C(o)} is listed twice`,w(t,`extra`));return{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),source:b(e,`source`,t,L),extras:r,marker:b(e,`marker`,t,a),where:t}}var Z=(e,t)=>e===void 0?[]:m(e,t).map((e,n)=>Ue(e,`${t}[${n}]`));function We(e,r){p(e,r,Re,ze);let a=i(e.name,w(r,`name`)),o=L(e.source,w(r,`source`)),s=b(e,`version`,r,n);if(s===void 0&&!R(o))throw new S(`expected a version, which uv writes of any but a source tree's package`,r);let c={key:X(a,s,o.id),name:a,version:s,versionKey:s===void 0?void 0:t(s),source:o};return{...c,resolutionMarkers:Y(e[`resolution-markers`],w(r,`resolution-markers`)),sdist:_e(e.sdist,w(r,`sdist`),o),wheels:ve(e.wheels,w(r,`wheels`),c),edges:Z(e.dependencies,w(r,`dependencies`)),extraEdges:O(e[`optional-dependencies`],w(r,`optional-dependencies`),Z),groupEdges:O(e[`dev-dependencies`],w(r,`dev-dependencies`),Z),metadata:Ae(e.metadata,w(r,`metadata`))}}var Q=(e,t,n)=>`${e} ${t} ${n}`;function Ge(e,n){let r=t=>me(t,e.where),i=n.byName.get(e.name)??r(`${C(e.name)} names no package in the lockfile`),a=i.length===1?i[0]:void 0,o=e.source?.id??a?.source.id??r(`${C(e.name)} could be any of ${i.length} packages, and names no source`);e.version===void 0&&a===void 0&&!R(e.source)&&r(`${C(e.name)} could be any of ${i.length} versions, and names none`);let s=e.version===void 0?a?.versionKey:t(e.version),c=n.byId.get(Q(e.name,s,o))??r(`names a package the lockfile does not hold: ${C(X(e.name,e.version,o))}`);e.version!==void 0&&e.version!==c.version&&r(`${C(e.version)}, where the package is ${C(c.version)}`);for(let t of e.extras)t in c.extraEdges||r(`${C(t)}, an extra ${C(c.key)} has no dependencies for, which uv drops`);return{package:c.key,extras:e.extras,marker:e.marker}}function Ke(e,t,n){let r=e.map(e=>Ge(e,t)),i=x(r,e=>JSON.stringify([e.package,[...e.extras].sort(),e.marker]));if(i!==void 0)throw new S(`${C(i.package)} is listed twice alike`,n);return r}var $=(e,t,n)=>le(e,n,(e,n)=>Ke(e,t,n));function qe(e,t,n){return e.members.length===0?t.filter(e=>R(e.source)&&e.source.path===`.`).map(e=>e.key):e.members.map((e,t)=>{let r=(n.byName.get(e)??[]).filter(e=>R(e.source));if(r.length!==1)throw new S(`${C(e)} is ${r.length===0?`no package`:`more than one package`} of a directory in the lockfile`,`manifest.members[${t}]`);return r[0].key})}function Je(e){let t=p(pe(e),void 0,Ie,Le),n=He(t.version,`version`),i=Ve(t.revision,`revision`),a=r(t[`requires-python`],`requires-python`),o=m(t.package??[],`package`).map((e,t)=>We(e,`package[${t}]`)),s=ae(o,e=>Q(e.name,e.versionKey,e.source.id),e=>e.key),c={byName:Map.groupBy(o,e=>e.name),byId:new Map([...s].map(([e,t])=>[e,o[t]]))},l=Object.create(null);for(let[e,t]of o.entries()){let n=`package[${e}]`;l[t.key]={name:t.name,version:t.version,source:t.source,resolutionMarkers:t.resolutionMarkers,dependencies:Ke(t.edges,c,w(n,`dependencies`)),optionalDependencies:$(t.extraEdges,c,w(n,`optional-dependencies`)),devDependencies:$(t.groupEdges,c,w(n,`dev-dependencies`)),sdist:t.sdist,wheels:t.wheels,metadata:t.metadata}}let u=ke(t.manifest);return{version:n,revision:i,requiresPython:a,resolutionMarkers:Y(t[`resolution-markers`],`resolution-markers`),supportedMarkers:Y(t[`supported-markers`],`supported-markers`),requiredMarkers:Y(t[`required-markers`],`required-markers`),conflicts:b(t,`conflicts`,``,Fe)??[],options:Pe(t.options),manifest:u,members:qe(u,o,c),packages:l}}export{S as LockfileError,ue as TomlError,Je as parseUvLock};
|
|
1
|
+
import{a as e,b as t,d as n,e as r,h as i,i as a,j as o,k as s,m as c,o as l,q as u,r as d,s as ee}from"./chunk-CU3FPB3P.js";import{a as f,c as p,e as m,f as h,h as te,j as g,k as _,l as v,m as ne,n as re,o as ie,p as ae}from"./chunk-GX5UXWT4.js";import{D as oe,H as y,M as se,l as ce,m as b,p as le,t as x}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{a as ue,c as de,e as fe,g as pe}from"./chunk-VYYUMYVW.js";import{d as S,e as me,h as C,i as w}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";function T(e,t,n=[`https:`,`http:`,`file:`]){let r=URL.parse(h(e,t));if(r===null||r.href!==e||!n.includes(r.protocol))throw new S(`${C(e)} is not a URL in normal form, of ${n.map(e=>e.slice(0,-1)).join(`, `)}`,t);if(r.username!==``||r.password!==``)throw new S(`${C(e)} has credentials in it, which uv does not write`,t);return r}var E=g(e=>/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,9})?Z$/u.test(e)&&de(e),`a UTC timestamp`),D=v(i),O=(e,t,n)=>re(e,t,i,n),he={__proto__:null,md5:32,sha256:64,sha384:96,sha512:128,blake2b:64};function k(e){return e.type===`url`?new URL(e.url).pathname:e.type===`path`||e.type===`git`?e.path:void 0}var A=e=>e===void 0?void 0:e.endsWith(`.whl`)?`wheel`:`sdist`;function ge(e,t){return e.type===`registry`?e.url===void 0?[`url`,`path`]:[`url`]:t?e.type===`url`?[`url`]:[`filename`]:[]}function j(e,t,n,r){let i=ge(n,r),a=n.type===`registry`;p(e,t,[...i,`hash`,...a?[`size`,`upload-time`,`upload_time`]:[]]);let o=i.filter(t=>e[t]!==void 0);if(i.length>0&&o.length!==1)throw new S(o.length===0?`expected ${i.join(` or `)}`:`a url and a path, of which uv reads the url alone`,t);if(e[`upload-time`]!==void 0&&e.upload_time!==void 0)throw new S(`upload-time and upload_time, which are one field to uv`,t);let s=b(e,`url`,t,T),c={url:s?.href,path:b(e,`path`,t,u),filename:b(e,`filename`,t,h),hash:b(e,`hash`,t,(e,t)=>l(e,t,he)),size:b(e,`size`,t,te),uploadTime:b(e,e.upload_time===void 0?`upload-time`:`upload_time`,t,E)};if(!a&&c.hash===void 0)throw new S(`expected a hash, which uv writes for a file of a ${n.type} source`,t);return{file:c,pathname:s?.pathname}}function _e(e,t,n){if(e===void 0)return;let r=A(k(n));if(n.type!==`registry`&&r!==`sdist`)throw new S(`an sdist, which a ${n.type} source${r===`wheel`?` of a wheel`:``} has none of`,t);let{url:i,path:a,hash:o,size:s,uploadTime:c}=j(e,t,n,!1).file;return{url:i,path:a,hash:o,size:s,uploadTime:c}}function ve(t,n,r){if(t===void 0)return[];let{source:i}=r,a=A(k(i)),o=m(t,n);if(i.type!==`registry`&&(a!==`wheel`||o.length!==1))throw new S(a===`wheel`?`expected the one wheel the source is`:`wheels, which a ${i.type} source${a===`sdist`?` of an sdist`:``} has none of`,n);let c=new Set;return o.map((t,a)=>{let o=`${n}[${a}]`,{file:l,pathname:u}=j(t,o,i,!0),d=ee({name:l.filename,path:l.path,pathname:u}),f=d===void 0?void 0:s(d);if(f===void 0)throw new S(`${C(String(d))} is not the name of a wheel`,o);if(c.has(d))throw new S(`${C(d)} is listed twice`,o);if(c.add(d),f.name!==r.name)throw new S(`${C(d)} is a wheel of ${C(f.name)}, not of ${C(r.name)}`,o);if(r.versionKey!==void 0&&r.versionKey!==e(f.version)&&r.versionKey!==e({...f.version,local:void 0}))throw new S(`${C(d)} is a wheel of another version than ${C(r.version)}`,o);if(i.type===`url`&&l.url!==i.url)throw new S(`${C(l.url)} is not the URL the source names`,w(o,`url`));return{...l,filename:d}})}var M=[`registry`,`git`,`url`,`path`,`directory`,`editable`,`virtual`],ye=new Set([`directory`,`editable`,`virtual`]),N=new Set([`branch`,`tag`,`rev`]),be=new Set([...N,`subdirectory`,`path`,`lfs`]),P=(e,t,n)=>new S(`${C(e)} is not a git source: ${t}`,n),F=`expected "#" and the full commit it resolved to`;function I(e,t){let n=T(se(e,t),t,[`https:`,`http:`,`ssh:`,`file:`]),r=[...n.searchParams],i=r.find(([e])=>!be.has(e));if(i!==void 0)throw P(e,`uv does not read ${C(i[0])}`,t);if(new Set(r.map(([e])=>e)).size!==r.length)throw P(e,`a key twice in the query`,t);let a=r.filter(([e])=>N.has(e));if(a.length>1)throw P(e,`more than one of branch=, tag= and rev=`,t);let o=Object.fromEntries(r);if(o.lfs!==void 0&&o.lfs!==`true`)throw P(e,`lfs= other than true, which uv does not write`,t);for(let e of[`subdirectory`,`path`])o[e]!==void 0&&oe(o[e],t);let s=n.hash===``?void 0:n.hash.slice(1);if(s!==void 0&&!y(s))throw P(e,F,t);let c=o.rev?.toLowerCase();if(c!==void 0&&s!==void 0&&y(c)&&c!==s)throw P(e,`rev= names another commit than the one it resolved to`,t);return n.search=``,n.hash=``,{type:`git`,url:e,repository:n.href,reference:a.length===0?void 0:{kind:a[0][0],name:a[0][1]},commit:s,subdirectory:o.subdirectory,path:o.path,lfs:o.lfs===`true`}}function xe(e,t){return/^[A-Za-z][\dA-Za-z+.-]+:/u.test(h(e,t))?{type:`registry`,url:T(e,t).href,path:void 0}:{type:`registry`,url:void 0,path:u(e,t)}}function Se(e,t,n,r){let i=w(r,e);if(e===`registry`)return xe(t,i);if(e===`git`){let e=I(t,i);if(e.commit===void 0)throw P(t,F,i);return e}if(e===`url`){if(T(t,i,[`https:`,`http:`]).hash!==``)throw new S(`${C(t)} has a fragment, which uv drops`,i);return{type:e,url:t,subdirectory:ce(d)(n,w(r,`subdirectory`))}}return{type:e,path:u(t,i)}}function L(e,t){p(e,t,[...M,`subdirectory`]);let n=ie(e,M,t);if(e.subdirectory!==void 0&&n!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let r=Se(n,e[n],e.subdirectory,t);return{...r,id:Ce(r)}}function Ce(e){return e.type===`registry`?`registry+${e.url??e.path}`:e.type===`git`?`git+${e.url}`:e.type===`url`?`direct+${e.url}${e.subdirectory===void 0?``:`#subdirectory=${e.subdirectory}`}`:`${e.type}+${e.path}`}var R=e=>ye.has(e.type);function z(e,t){if(p(e,t,[`package`,`extra`,`group`]),e.extra!==void 0&&e.group!==void 0)throw new S(`an extra and a group, of which uv takes one`,t);return{package:i(e.package,w(t,`package`)),extra:b(e,`extra`,t,i),group:b(e,`group`,t,i)}}var B=[`git`,`url`,`path`,`directory`,`editable`,`virtual`],V=[`specifier`,`index`,`conflict`],H=[`name`,`extras`,`groups`,`marker`,`subdirectory`,...B,...V];function we(e,t){let n=B.filter(t=>e[t]!==void 0),i=V.filter(t=>e[t]!==void 0);if(n.length+ +(i.length>0)>1)throw new S(`more than one source: ${[...n,...i].join(`, `)}`,t);if(e.subdirectory!==void 0&&n[0]!==`url`)throw new S(`a subdirectory, which uv reads of a URL alone`,w(t,`subdirectory`));let[a=`registry`]=n,o=w(t,a);return a===`registry`?{type:a,specifier:b(e,`specifier`,t,r),index:b(e,`index`,t,T)?.href,conflict:b(e,`conflict`,t,z)}:a===`git`?I(e.git,o):a===`url`?{type:a,url:T(e.url,o,[`https:`,`http:`]).href,subdirectory:b(e,`subdirectory`,t,d)}:{type:a,path:u(e[a],o)}}function U(e,t,n=H){p(e,t,n);let r=b(e,`extras`,t,D)??[],o=b(e,`groups`,t,D)??[];if(r.length>0&&o.length>0)throw new S(`extras and groups, of which uv takes one`,t);return{name:i(e.name,w(t,`name`)),extras:r,groups:o,marker:b(e,`marker`,t,a),source:we(e,t)}}function Te(e,t){return{...U(e,t,[...H,`hashes`]),hashes:b(e,`hashes`,t,v((e,t)=>l(e,t,c)))??[]}}var W=_(U),G=(e,t)=>O(e,t,W);function Ee(e,t){return p(e,t,[`name`,`version`,`requires-dist`,`requires-python`,`provides-extras`]),{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),requiresDist:b(e,`requires-dist`,t,v(o))??[],requiresPython:b(e,`requires-python`,t,r),providesExtras:b(e,`provides-extras`,t,D)??[]}}var De=_((e,t)=>{if(fe(e)&&Object.hasOwn(e,`package`))throw new S(`an override of one package's dependencies, which is not read here`,t);return U(e,t)}),Oe=[`members`,`requirements`,`constraints`,`overrides`,`excludes`,`build-constraints`,`dependency-groups`,`dependency-metadata`];function ke(e=Object.create(null)){let t=`manifest`;p(e,t,Oe);let n=(n,r)=>b(e,n,t,r)??[];return{members:n(`members`,D),requirements:n(`requirements`,W),constraints:n(`constraints`,W),overrides:n(`overrides`,De),excludes:n(`excludes`,D),buildConstraints:n(`build-constraints`,_(Te)),dependencyGroups:G(e[`dependency-groups`],w(t,`dependency-groups`)),dependencyMetadata:n(`dependency-metadata`,_(Ee))}}function Ae(e=Object.create(null),t){return p(e,t,[`requires-dist`,`provides-extras`,`requires-dev`]),{requiresDist:b(e,`requires-dist`,t,W)??[],providesExtras:b(e,`provides-extras`,t,D)??[],requiresDev:G(e[`requires-dev`],w(t,`requires-dev`))}}var K=(...e)=>(t,n)=>{if(!e.includes(h(t,n)))throw new S(`expected one of ${e.join(`, `)}`,n);return t},q=K(`disallow`,`allow`,`if-necessary`,`explicit`,`if-necessary-or-explicit`),J=g(e=>/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+W)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d{1,9})?S)?)?$/u.test(e),`an ISO 8601 duration`);function je(e,t){return e===!1?!1:typeof e==`string`?{timestamp:E(e,t),span:void 0}:(p(e,t,[`timestamp`,`span`]),{timestamp:E(e.timestamp,w(t,`timestamp`)),span:J(e.span,w(t,`span`))})}function Me(e,t){p(e,t,[`glibc`,`musl`]);let n=g(e=>/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u.test(e),`a libc version`);return{glibc:b(e,`glibc`,t,n),musl:b(e,`musl`,t,n)}}var Ne=[`resolution-mode`,`prerelease-mode`,`fork-strategy`,`exclude-newer`,`exclude-newer-span`,`exclude-newer-package`,`prerelease-package`,`minimum-libc-version`];function Pe(e=Object.create(null)){let t=`options`;p(e,t,Ne);let n=b(e,`exclude-newer`,t,E);return{resolutionMode:b(e,`resolution-mode`,t,K(`highest`,`lowest`,`lowest-direct`))??`highest`,prereleaseMode:b(e,`prerelease-mode`,t,q)??`if-necessary-or-explicit`,forkStrategy:b(e,`fork-strategy`,t,K(`fewest`,`requires-python`))??`requires-python`,excludeNewer:e[`exclude-newer-span`]===void 0?n:void 0,excludeNewerSpan:b(e,`exclude-newer-span`,t,J),excludeNewerPackage:O(e[`exclude-newer-package`],w(t,`exclude-newer-package`),je),prereleasePackage:O(e[`prerelease-package`],w(t,`prerelease-package`),q),minimumLibcVersion:b(e,`minimum-libc-version`,t,Me)}}var Fe=_((e,t)=>{let n=_(z)(e,t);if(n.length<2)throw new S(`a set of conflicts of fewer than two, which uv refuses`,t);return n}),Ie=[`version`,`revision`,`requires-python`,`resolution-markers`,`supported-markers`,`required-markers`,`conflicts`,`options`,`manifest`,`package`],Le={distribution:"`distribution` is what uv 0.2 and older wrote for `package`, which is not read here"},Re=[`name`,`version`,`source`,`resolution-markers`,`dependencies`,`sdist`,`wheels`,`optional-dependencies`,`dev-dependencies`,`metadata`],ze={"dependency-groups":"`dependency-groups` is an older spelling of `dev-dependencies`, which uv no longer writes"},Be=[`name`,`version`,`source`,`extra`,`marker`];function Ve(e,t){if(e===void 0)return 0;if(e===1||e===2||e===3)return e;throw new S(`unsupported revision: expected 1, 2 or 3, found ${f(e)}`,t)}function He(e,t){if(e===1)return e;throw e===void 0?new S("no `version`: a lockfile of uv 0.2 or older, which is not read here",t):new S(`unsupported version: expected 1, found ${f(e)}`,t)}var Y=(e,t)=>e===void 0?[]:ne(e,t,a),X=(e,t,n)=>`${e}${t===void 0?``:`==${t}`} @ ${n}`;function Ue(e,t){p(e,t,Be);let r=b(e,`extra`,t,D)??[],o=x(r);if(o!==void 0)throw new S(`${C(o)} is listed twice`,w(t,`extra`));return{name:i(e.name,w(t,`name`)),version:b(e,`version`,t,n),source:b(e,`source`,t,L),extras:r,marker:b(e,`marker`,t,a),where:t}}var Z=(e,t)=>e===void 0?[]:m(e,t).map((e,n)=>Ue(e,`${t}[${n}]`));function We(e,r){p(e,r,Re,ze);let a=i(e.name,w(r,`name`)),o=L(e.source,w(r,`source`)),s=b(e,`version`,r,n);if(s===void 0&&!R(o))throw new S(`expected a version, which uv writes of any but a source tree's package`,r);let c={key:X(a,s,o.id),name:a,version:s,versionKey:s===void 0?void 0:t(s),source:o};return{...c,resolutionMarkers:Y(e[`resolution-markers`],w(r,`resolution-markers`)),sdist:_e(e.sdist,w(r,`sdist`),o),wheels:ve(e.wheels,w(r,`wheels`),c),edges:Z(e.dependencies,w(r,`dependencies`)),extraEdges:O(e[`optional-dependencies`],w(r,`optional-dependencies`),Z),groupEdges:O(e[`dev-dependencies`],w(r,`dev-dependencies`),Z),metadata:Ae(e.metadata,w(r,`metadata`))}}var Q=(e,t,n)=>`${e} ${t} ${n}`;function Ge(e,n){let r=t=>me(t,e.where),i=n.byName.get(e.name)??r(`${C(e.name)} names no package in the lockfile`),a=i.length===1?i[0]:void 0,o=e.source?.id??a?.source.id??r(`${C(e.name)} could be any of ${i.length} packages, and names no source`);e.version===void 0&&a===void 0&&!R(e.source)&&r(`${C(e.name)} could be any of ${i.length} versions, and names none`);let s=e.version===void 0?a?.versionKey:t(e.version),c=n.byId.get(Q(e.name,s,o))??r(`names a package the lockfile does not hold: ${C(X(e.name,e.version,o))}`);e.version!==void 0&&e.version!==c.version&&r(`${C(e.version)}, where the package is ${C(c.version)}`);for(let t of e.extras)t in c.extraEdges||r(`${C(t)}, an extra ${C(c.key)} has no dependencies for, which uv drops`);return{package:c.key,extras:e.extras,marker:e.marker}}function Ke(e,t,n){let r=e.map(e=>Ge(e,t)),i=x(r,e=>JSON.stringify([e.package,[...e.extras].sort(),e.marker]));if(i!==void 0)throw new S(`${C(i.package)} is listed twice alike`,n);return r}var $=(e,t,n)=>le(e,n,(e,n)=>Ke(e,t,n));function qe(e,t,n){return e.members.length===0?t.filter(e=>R(e.source)&&e.source.path===`.`).map(e=>e.key):e.members.map((e,t)=>{let r=(n.byName.get(e)??[]).filter(e=>R(e.source));if(r.length!==1)throw new S(`${C(e)} is ${r.length===0?`no package`:`more than one package`} of a directory in the lockfile`,`manifest.members[${t}]`);return r[0].key})}function Je(e){let t=p(pe(e),void 0,Ie,Le),n=He(t.version,`version`),i=Ve(t.revision,`revision`),a=r(t[`requires-python`],`requires-python`),o=m(t.package??[],`package`).map((e,t)=>We(e,`package[${t}]`)),s=ae(o,e=>Q(e.name,e.versionKey,e.source.id),e=>e.key),c={byName:Map.groupBy(o,e=>e.name),byId:new Map([...s].map(([e,t])=>[e,o[t]]))},l=Object.create(null);for(let[e,t]of o.entries()){let n=`package[${e}]`;l[t.key]={name:t.name,version:t.version,source:t.source,resolutionMarkers:t.resolutionMarkers,dependencies:Ke(t.edges,c,w(n,`dependencies`)),optionalDependencies:$(t.extraEdges,c,w(n,`optional-dependencies`)),devDependencies:$(t.groupEdges,c,w(n,`dev-dependencies`)),sdist:t.sdist,wheels:t.wheels,metadata:t.metadata}}let u=ke(t.manifest);return{version:n,revision:i,requiresPython:a,resolutionMarkers:Y(t[`resolution-markers`],`resolution-markers`),supportedMarkers:Y(t[`supported-markers`],`supported-markers`),requiredMarkers:Y(t[`required-markers`],`required-markers`),conflicts:b(t,`conflicts`,``,Fe)??[],options:Pe(t.options),manifest:u,members:qe(u,o,c),packages:l}}export{S as LockfileError,ue as TomlError,Je as parseUvLock};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,c as t}from"./chunk-7YFJUT2P.js";var n=new Uint8Array,r=e=>e.every(e=>e<128),i=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function a(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}var o=class extends Error{constructor(e,t,{limited:n=!1}={}){super(t===void 0?e:`${e} at byte ${t}`),this.name=`ArchiveError`,this.offset=t,this.limited=n}};function s(e,t){try{return e()}catch(e){throw!(e instanceof o)||e.offset!==void 0?e:new o(e.message,t,{limited:e.limited})}}var c=class extends o{constructor(e,{bytes:t,limited:n=!1,cause:r}){super(e,void 0,{limited:n}),this.name=`CompressionError`,this.bytes=t,this.cause=r}};function l(e){try{return[CompressionStream,DecompressionStream].every(t=>new t(e))}catch{return!1}}function u(e){if(!(e instanceof Uint8Array))throw new o(`the data is not a Uint8Array`)}async function d(e,t,n,r,i,o){let s=new t(n),l=s.writable.getWriter();l.write(e).catch(()=>{}),l.close().catch(()=>{});let u=s.readable.getReader(),d=[],f=0,p=()=>o?o.subarray(0,f):d.length===1?d[0]:a(d);try{for(let e=await u.read();!e.done;e=await u.read()){let t=e.value;if(!(f+t.length<=r))throw RangeError(`output past ${r} bytes`);o&&f+t.length>o.length&&(d.push(o.subarray(0,f)),o=void 0),o?o.set(t,f):d.push(t),f+=t.length}}catch(e){u.cancel().catch(()=>{});let t=e instanceof RangeError;throw new c(t?`the data ${i}es past ${r} bytes`:`the data does not ${i}`,{bytes:p(),limited:t,cause:e})}return p()}async function f(e,t,{limit:n=1/0}={}){return u(e),await d(e,CompressionStream,t,n,`compress`)}var p=16;function m(e,t){if(e.length<18)return 0;let n=new DataView(e.buffer,e.byteOffset+e.length-4,4).getUint32(0,!0);return n<=t&&n<=e.length*p?n:0}var h=(e,t,n,r=0)=>d(e,DecompressionStream,t,n,`decompress`,r?new Uint8Array(r):void 0);async function g(e,t,{limit:n=1/0}={}){u(e);let r=t===`gzip`;try{return await h(e,t,n,r?m(e,n):0)}catch(i){if(!r||!(i instanceof c)||i.limited||e.at(-1)!==0)throw i;let a=e.findLastIndex(e=>e!==0);for(let r=a+1;r<=Math.min(a+10,e.length-1);r++)try{return await h(e.subarray(0,r),t,n)}catch(e){if(!(e instanceof c)||e.limited)throw e}throw i}}var _=(e,t,n)=>d(e,DecompressionStream,t,n.length,`decompress`,n);function v(e){return e.length<=200?JSON.stringify(e):JSON.stringify(`${e.slice(0,e.codePointAt(199)>65535?199:200)}\u2026`)}var ee=/[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control}]/u,y=(e,t)=>ee.test(e)||t&&e.includes(`\\`);function b(e,t){if(typeof e!=`string`)throw new o(`${t} is not a string`);if(!e.isWellFormed())throw new o(`${t} is not well-formed Unicode`)}var x=(t,n)=>t.length>n||t.length*3>n&&e(t).length>n;function S(e,n,r){try{return t(e)}catch{throw new o(`${n} is not valid UTF-8`,r)}}var te={file:420,directory:493,symlink:511},C=e=>e===`file`||e===`contiguous-file`,ne=e=>e.type===`directory`?`${e.name}/`:e.name;function re(e,t){if(typeof e!=`object`||!e)throw new o(`an entry is not an object`);let r=e.type??`file`;if(typeof r!=`string`)throw new o(`entry type is not a string`);if(!Object.hasOwn(t,r))throw new o(`entry type ${v(r)} is not one this package writes`);let{name:i}=e;b(i,`entry name`);let a=e.data??n;if(!(a instanceof Uint8Array))throw new o(`data of ${v(i)} is not a Uint8Array`);if(a.length!==0&&!C(r))throw new o(`a ${r} cannot carry data (${v(i)})`);let s=e.linkname??``;if(b(s,`link target of ${v(i)}`),s!==``&&r!==`hardlink`&&r!==`symlink`)throw new o(`a ${r} cannot have a link target (${v(i)})`);return{name:i,type:r,data:a,linkname:s}}var w=4096,ie=255;function ae(e,t){if(b(e,t),e===``)throw new o(`${t} is empty`);if(y(e,!0))throw new o(`${t} ${v(e)} holds a control or formatting character, or a backslash`);if(e.startsWith(`/`))throw new o(`${t} ${v(e)} is absolute`);let n=e.split(`/`);if(/^[a-zA-Z]:/u.test(n.find(e=>e!==`.`)??``))throw new o(`${t} ${v(e)} starts with a drive letter`);if(x(e,w))throw new o(`${t} ${v(e)} is longer than ${w} bytes`);if(n.some(e=>x(e,ie)))throw new o(`${t} ${v(e)} has a segment longer than ${ie} bytes`);return n}function oe(e,t,n=!1){let r=ae(e,t);if(r.at(-1)===``){if(!n)throw new o(`${t} ${v(e)} ends in a slash but is not a directory`);r.pop()}let i=r.filter(e=>e!==`.`),a=i.find(e=>e===``||e===`..`);if(a!==void 0)throw new o(`${t} ${v(e)} has ${a?`a .. segment`:`an empty segment`}`);if(i.length===0){if(!n)throw new o(`${t} ${v(e)} names the archive root but is not a directory`);return`.`}let s=i.join(`/`);if(x(s,w-+!!n))throw new o(`${t} ${v(e)} is longer than ${w} bytes`);return s}function se(e=0){if(!(Number.isSafeInteger(e)&&e>=0))throw new o(`symlinksAbove ${String(e)} is not a whole number of levels`);return e}function ce(e,t,n=0){let r=ae(t,`symlink target of ${v(e)}`).filter(e=>e!==``&&e!==`.`),i=e.split(`/`).length-1;for(let a of r)if(i+=a===`..`?-1:1,i<-n){let r=n===0?`outside the archive`:`more than ${n} level${n===1?``:`s`} above the archive`;throw new o(`symlink ${v(e)} points ${r}, to ${v(t)}`)}return r}function T(e,t,n,r=0){let i=oe(e,`entry name`,t===`directory`);return t===`symlink`&&ce(i,n,r),{name:i,linkname:t===`hardlink`?oe(n,`hard link target of ${v(i)}`):n}}var le=()=>({kind:void 0,entry:void 0,symlink:void 0,first:void 0,firstNode:void 0,rest:void 0});function E(e,t,n=!0){if(e.first===t)return e.firstNode;let r=e.rest?.get(t);return r!==void 0||!n||(r=le(),e.first===void 0?Object.assign(e,{first:t,firstNode:r}):(e.rest??=new Map).set(t,r)),r}var D=[`type`,`mode`,`uid`,`gid`,`mtime`,`uname`,`gname`,`linkname`,`devmajor`,`devminor`],O=class{#e=le();#t;#n;constructor(e=!1,t=0){this.#t=e,this.#n=se(t)}get above(){return this.#n}add(e){let{name:t,type:n}=e,r=n===`symlink`?e.linkname:void 0;if(n===`hardlink`){let n=this.#o(e.linkname);if(n?.kind!==`entry`)throw new o(`hard link ${v(t)} targets ${v(e.linkname)}, which is not an earlier non-directory entry`);r=n.symlink,r!==void 0&&this.#r(t,r,`hard link ${v(t)} to symlink ${v(e.linkname)}`)}let a=t.split(`/`),s=this.#a(a),c=s.at(-1);if(c.kind!==void 0&&c.kind!==`implied`){let n=D.find(t=>c.entry[t]!==e[t]);if(n!==void 0)throw new o(`duplicate entry ${v(t)} differs in ${n}`);if(c.entry.data===void 0)throw new o(`duplicate entry ${v(t)}, which only the in-memory call can compare with the earlier one`);if(!i(c.entry.data,e.data))throw new o(`duplicate entry ${v(t)} differs in data`);return}let l=n===`directory`?`directory`:`entry`;if(c.kind!==void 0&&l!==`directory`)throw new o(`${v(t)} is already a directory, so it cannot be a ${n}`);for(let e=1;e<a.length;e++)this.#i(s[e],()=>`${v(t)} is inside ${v(a.slice(0,e).join(`/`))}, which is not a directory`);c.kind=l,c.symlink=r,c.entry=this.#t?e:Object.fromEntries(D.map(t=>[t,e[t]])),n===`symlink`&&this.#r(t,e.linkname,`symlink ${v(t)}`)}#r(e,t,n){let r=ce(e,t,this.#n),i=e.split(`/`).slice(0,-1),a=this.#a(i);for(let[e,t]of r.entries()){if(t===`..`){if(i.length===0)return;i.pop(),a.pop()}else i.push(t),a.push(E(a.at(-1),t));e<r.length-1&&i.length&&this.#i(a.at(-1),()=>`the target of ${n} passes through ${v(i.join(`/`))}, which is not a directory`)}}#i(e,t){if(e.kind===`entry`)throw new o(t());e.kind??=`implied`}#a(e){let t=[this.#e];for(let n of e)t.push(E(t.at(-1),n));return t}#o(e){return e.split(`/`).reduce((e,t)=>e&&E(e,t,!1),this.#e)}},k=512,A=e=>e===`character-device`||e===`block-device`,j={file:48,hardlink:49,symlink:50,"character-device":51,"block-device":52,directory:53,fifo:54,"contiguous-file":55},M={pax:120,global:103,longname:76,longlink:75},N=100,P=155,F=32,ue=0,I=[[`mode`,100,8],[`uid`,108,8],[`gid`,116,8],[`size`,124,12],[`mtime`,136,12]],L=148,de=156,R=157,z=257,B=265,V=297,H=329,U=337,W=345,fe=386,pe=495,me=`ustar\x0000`,he=`ustar \0`,G=e=>Uint8Array.from(e,e=>e.codePointAt(0)),K=e=>String.fromCodePoint(...e),q=(e,t,n,r)=>e.subarray(t,t+n).set(r),J=(e,t,n)=>ve(e.subarray(t,t+n)),ge=e=>8**(e-1)-1,_e=(e,t)=>e>=0&&e<=ge(t);function Y(e,t,n,r,i){if(_e(r,n)){q(e,t,n,G(r.toString(8).padStart(n-1,`0`)));return}if(!i)throw new o(`${r} does not fit an octal field of ${n-1} digits`);e[t]=r<0?255:128;let a=BigInt.asUintN((n-1)*8,BigInt(r));for(let r=t+n-1;r>t;r--)e[r]=Number(a&255n),a>>=8n}function X(e,t,n,r,i,a=!1){let s=e[t];if(s===128||s===255){let c=0n;for(let r=t+1;r<t+n;r++)c=c<<8n|BigInt(e[r]);if(s===255&&(c=BigInt.asIntN((n-1)*8,c)),c<0n&&!a)throw new o(`the ${r} field is negative`,i);if(!Number.isSafeInteger(Number(c)))throw new o(`the ${r} field is too large`,i);return Number(c)}let c=/^ *([0-7]*) *$/u.exec(K(J(e,t,n)));if(!c)throw new o(`the ${r} field is not an octal number`,i);return c[1]===``?0:Number.parseInt(c[1],8)}function ve(e){let t=e.indexOf(0);return t===-1?e:e.subarray(0,t)}function ye(e){let t=256;for(let n=0;n<L;n++)t+=e[n];for(let n=L+8;n<k;n++)t+=e[n];return t}var Z=e=>e.every(e=>e===0);function be(e){let t=new Uint8Array(k);q(t,ue,N,e.name);for(let[n,r,i]of I)Y(t,r,i,e[n],e.gnu);return t[de]=e.typeflag,q(t,R,N,e.linkname),q(t,z,8,G(e.gnu?he:me)),q(t,B,F-1,e.uname),q(t,V,F-1,e.gname),e.devmajor!==null&&Y(t,H,8,e.devmajor,e.gnu),e.devminor!==null&&Y(t,U,8,e.devminor,e.gnu),q(t,W,P,e.prefix),q(t,L,8,G(`${ye(t).toString(8).padStart(6,`0`)}\0 `)),t}var xe=(e,t,n)=>/^ *[0-7]+ *$/u.test(K(J(e,t,n)));function Se(e,t){if(ye(e)!==X(e,L,8,`checksum`,t))throw new o(`header checksum does not match`,t);let r=K(e.subarray(z,z+8)),i=r===he;if(!i&&r!==me)throw new o(`header is not in the ustar, pax or gnu format`,t);if(i&&!Z(e.subarray(fe,pe)))throw new o(`header carries an old GNU sparse map or real size`,t);let a=e[de],s=a===j[`character-device`]||a===j[`block-device`],c=[[`checksum`,L,8],...I,...s?[[`devmajor`,H,8],[`devminor`,U,8]]:[]];return{gnu:i,typeflag:a,name:J(e,ue,N),prefix:i?n:J(e,W,P),linkname:J(e,R,N),uname:J(e,B,F),gname:J(e,V,F),...Object.fromEntries(I.map(([n,r,i])=>[n,X(e,r,i,n,t,n===`mtime`)])),devmajor:s?X(e,H,8,`devmajor`,t):0,devminor:s?X(e,U,8,`devminor`,t):0,octal:c.every(([,t,n])=>xe(e,t,n))}}function Ce(t,n){let r=e(` ${t}=${n}
|
|
2
|
+
`),i=r.length+1;for(;r.length+String(i).length!==i;)i++;return a([e(String(i)),r])}var we=e=>a(e.map(([e,t])=>Ce(e,t))),Q=`pax records cannot be changed`,Te=class extends Map{set(){throw TypeError(Q)}delete(){throw TypeError(Q)}clear(){throw TypeError(Q)}};function Ee(e,t){let n=new Te;for(let r=0;r<e.length;){let i=r,a=0;for(;i<e.length&&e[i]>=48&&e[i]<=57;i++)a=a*10+(e[i]-48);if(i===r||e[r]===48||e[i]!==32)throw new o(`a pax record does not begin with its length`,t);let s=r+a;if(s>e.length||e[s-1]!==10)throw new o(`a pax record is not as long as it says`,t);let c=e.indexOf(61,i+1);if(c===-1||c>=s-1)throw new o(`a pax record has no keyword=value`,t);let l=S(e.subarray(i+1,c),`a pax record`,t);if(l===``||y(l,!1)||l.includes(` `))throw new o(`pax keyword ${v(l)} is malformed`,t);if(n.has(l))throw new o(`pax keyword ${l} repeats`,t);Map.prototype.set.call(n,l,S(e.subarray(c+1,s-1),`a pax record`,t)),r=s}return n}var De=e=>Object.entries(e).map(([e,t])=>[t,e]),Oe=new Map([...De(j),[0,`file`]]),ke=new Map(De(M)),Ae=1<<20,je=new Te,Me=Object.freeze([]),Ne=e=>e.gnu?`gnu`:`ustar`,Pe=e=>Math.ceil(e/k)*k,Fe=new Set([`SCHILY.realsize`,`SUN.holesdata`]);function Ie(e,t){if(e.some(e=>e.startsWith(`GNU.sparse.`)||Fe.has(e)))throw new o(`sparse entries are not supported`,t)}function Le(e,t,n){if(!/^(?:0|[1-9][0-9]*)$/u.test(e)||!Number.isSafeInteger(Number(e)))throw new o(`pax ${t}=${v(e)} is not a whole number this package can hold`,n);return Number(e)}function Re(e,t,n){let r=/^(-?)([0-9]+)(?:\.([0-9]+))?$/u.exec(e);if(!r)throw new o(`pax ${t}=${v(e)} is not a time`,n);let[,i,a,s=``]=r,c=Number(i+a)-(i&&/[1-9]/u.test(s)?1:0);if(!Number.isSafeInteger(c))throw new o(`pax ${t}=${v(e)} is out of range`,n);return c}function ze(e,t){let n=S(e.name,`entry name`,t);return e.prefix.length?`${S(e.prefix,`name prefix`,t)}/${n}`:n}var Be=class{#e=[];#t=0;#n=0;#r=0;#i;#a={pax:null,longname:null,longlink:null};#o=[];#s=null;#c=null;#l=0;#u=!1;#d=0;#f;#p;constructor(e,{symlinksAbove:t,maxEntries:n=1/0,trailingGlobal:r=!1}={}){if(n!==1/0&&!(Number.isSafeInteger(n)&&n>=0))throw new o(`maxEntries ${String(n)} is not a whole number of entries`);if(typeof r!=`boolean`)throw new o(`trailingGlobal ${String(r)} is not a boolean`);this.#i=new O(e,t),this.#f=n,this.#p=r}*push(e){if(!(e instanceof Uint8Array))throw new o(`a chunk is not a Uint8Array`);for(e.length&&(this.#e.push(e),this.#n+=e.length);!this.#u;){let e=this.#m(this.#c?Pe(this.#c.size):k);if(e===null)return;let t=this.#c?this.#g(e):this.#h(e);t&&(yield t)}let t=this.#r;if(!Z(this.#m(this.#n)))throw new o(`data after the end of the archive`,t)}end(){if(!this.#u)throw this.#r===0&&this.#n===0?new o(`the archive is empty`):this.#c===null&&this.#n===0?new o(this.#l?`the archive ends with a lone zero block`:`the archive has no end marker`,this.#r):new o(`the archive is truncated`,this.#r)}#m(e){if(this.#n<e)return null;if(e===0)return n;let t,r=this.#t+e;if(r<=this.#e[0].length)t=this.#e[0].subarray(this.#t,r);else{let e=0;for(;r>this.#e[e].length;)r-=this.#e[e++].length;t=a([this.#e[0].subarray(this.#t),...this.#e.slice(1,e),this.#e[e].subarray(0,r)]),this.#e.splice(0,e)}return this.#t=r,r===this.#e[0].length&&(this.#e.shift(),this.#t=0),this.#n-=e,this.#r+=e,t}#h(e){let t=this.#r-k;if(Z(e)){if(this.#o.some(({kind:e})=>e!==`global`||!this.#p))throw new o(`an extended header is not followed by an entry`,t);this.#u=++this.#l===2;return}if(this.#l)throw new o(`a lone zero block where a header should be`,t);let n=Se(e,t),r=ke.get(n.typeflag);if(r===void 0){if(++this.#d>this.#f)throw new o(`the archive holds more than ${this.#f} entries`,t,{limited:!0});this.#c={at:t,...this.#_(n,t)}}else{if(n.size>Ae)throw new o(`a ${r} header of ${n.size} bytes is longer than any tar writes`,t);this.#c={at:t,size:n.size,extended:Object.freeze({kind:r,magic:Ne(n),octal:n.octal})}}}#g(e){let{at:t,size:n,entry:r,extended:i}=this.#c;if(this.#c=null,!Z(e.subarray(n)))throw new o(`the padding after an entry is not zero`,t);let a=e.subarray(0,n);if(r)return r.data=a,s(()=>this.#i.add(r),t),r;let{kind:c}=i;if(c===`global`){this.#s=Ee(a,t);let e=[`path`,`linkpath`,`size`].find(e=>this.#s.has(e));if(e!==void 0)throw new o(`a global header sets ${e}`,t);Ie(this.#s.keys(),t)}else{if(this.#a[c]!==null)throw new o(`two ${c} headers ahead of one entry`,t);this.#a[c]=c===`pax`?Ee(a,t):S(ve(a),`a ${c} header`,t)}this.#o.push(i)}#_(e,t){let r=Oe.get(e.typeflag);if(r===void 0)throw new o(`entry type ${v(String.fromCodePoint(e.typeflag))} is not one this package reads`,t);let{pax:i,longname:a,longlink:c}=this.#a;this.#a={pax:null,longname:null,longlink:null};let l=e=>i?.get(e)??this.#s?.get(e);if(i!==null&&Ie(i.keys(),t),a!==null&&l(`path`)!==void 0)throw new o(`both a long name header and a pax path name one entry`,t);if(c!==null&&l(`linkpath`)!==void 0)throw new o(`both a long link header and a pax linkpath name one entry`,t);let u=a??l(`path`)??ze(e,t),d=c??l(`linkpath`)??S(e.linkname,`link target`,t),{name:f,linkname:p}=s(()=>T(u,r,d,this.#i.above),t),m=(n,r=Le)=>{let i=l(n);return i===void 0?e[n]:r(i,n,t)},h=m(`size`);if(h!==0&&!C(r))throw new o(`a ${r} entry has a size`,t);if(p!==``&&r!==`hardlink`&&r!==`symlink`)throw new o(`a ${r} entry has a link target`,t);let g=n=>{let r=l(n)??S(e[n],n,t);if(y(r,!1))throw new o(`${n} ${v(r)} holds a control or formatting character`,t);return r},_=A(r),ee={name:f,type:r,mode:e.mode&4095,uid:m(`uid`),gid:m(`gid`),mtime:m(`mtime`,Re),uname:g(`uname`),gname:g(`gname`),linkname:p,devmajor:_?m(`devmajor`):0,devminor:_?m(`devminor`):0,data:n,storedName:u,storedLinkname:d,pax:i??je,globalPax:this.#s??je,extended:this.#o.length?Object.freeze(this.#o):Me,magic:Ne(e),typeflag:String.fromCodePoint(e.typeflag),storedMode:e.mode,octal:e.octal};return this.#o=[],{entry:ee,size:h}}};function Ve(e,t){let n=new Be(!0,t),r=[...n.push(e)];return n.end(),r}var He=new Set([`gnu`,`ustar`,`pax`]),Ue=47;function $(e,t,n=!1){if(!Number.isSafeInteger(e)||!n&&e<0)throw new o(`${t} ${String(e)} is not ${n?`an integer`:`a non-negative integer`}`);return e}function We(e,t){if(b(e,t),y(e,!1))throw new o(`${t} ${v(e)} holds a control or formatting character`);return e}function Ge(e,t){let n=re(e,j),{name:r,type:i,linkname:a}=n,s=$(e.devmajor??0,`devmajor`),c=$(e.devminor??0,`devminor`);if((s!==0||c!==0)&&!A(i))throw new o(`a ${i} cannot have device numbers (${v(r)})`);let l=$(e.mode??te[i]??420,`mode`);if(l>4095)throw new o(`mode ${l.toString(8)} has bits beyond the permission bits`);return{...n,mode:l,uid:$(e.uid??0,`uid`),gid:$(e.gid??0,`gid`),mtime:$(e.mtime??0,`mtime`,!0),uname:We(e.uname??``,`uname`),gname:We(e.gname??``,`gname`),devmajor:s,devminor:c,...T(r,i,a,t)}}function Ke(e,t=e.length){let n=new Uint8Array(Math.ceil(t/k)*k);return n.set(e),n}var qe=(t,r,i,a,o)=>be({gnu:o,name:e(t).subarray(0,N),prefix:n,linkname:n,uname:n,gname:n,typeflag:a,mode:420,uid:0,gid:0,size:r,mtime:i,devmajor:null,devminor:null}),Je=(e,t)=>[qe(`././@LongLink`,e.length+1,0,t,!0),Ke(e,e.length+1)];function Ye(e,t){let n=we(t),r=e.name.lastIndexOf(`/`);return[qe(r===-1?`./PaxHeaders/${e.name}`:`${e.name.slice(0,r)}/PaxHeaders/${e.name.slice(r+1)}`,n.length,Math.max(0,Math.min(e.mtime,ge(12))),M.pax,!1),Ke(n)]}function Xe(e,t){let{length:n}=e;if(n>P+N+1)throw new o(`name ${v(t)} is longer than 256 bytes, which ustar cannot hold`);let r=n>P+1?P+1:e[n-1]===Ue?n-1:n,i=e.lastIndexOf(Ue,r-1),a=n-i-1;if(i<=0||a>N||a===0)throw new o(`name ${v(t)} cannot be split into ustar's prefix and name fields`);return{prefix:e.subarray(0,i),name:e.subarray(i+1)}}function Ze(t,i){let a=i===`gnu`,s=[],c=[],l=ne(t),u=e(l),d=n,f=e(t.linkname);if(f.length>N){if(a)c.push(...Je(f,M.longlink));else if(i===`pax`)s.push([`linkpath`,t.linkname]);else throw new o(`link target of ${v(t.name)} is longer than 100 bytes, which ustar cannot hold`);f=f.subarray(0,N)}i===`pax`&&(u.length>N||!r(u))&&s.push([`path`,l]),u.length>N&&(a?c.push(...Je(u,M.longname)):i===`ustar`&&({prefix:d,name:u}=Xe(u,t.name)),u.length>N&&(u=u.subarray(0,N)));let p=(e,n,r)=>{if(a||_e(n,r))return n;if(i!==`pax`)throw new o(`${e} ${n} of ${v(t.name)} does not fit the ustar format`);return s.push([e,String(n)]),0},m=(n,a)=>{let c=e(a);if(c.length<F&&(i!==`pax`||r(c)))return c;if(i!==`pax`)throw new o(`${n} of ${v(t.name)} is longer than 31 bytes, which the ${i} format cannot hold`);return s.push([n,a]),c.subarray(0,F-1)},h=A(t.type),g={gnu:a,name:u,prefix:d,linkname:f,typeflag:j[t.type],mode:t.mode,uid:p(`uid`,t.uid,8),gid:p(`gid`,t.gid,8),size:p(`size`,t.data.length,12),mtime:p(`mtime`,t.mtime,12),devmajor:h?p(`devmajor`,t.devmajor,8):null,devminor:h?p(`devminor`,t.devminor,8):null,uname:m(`uname`,t.uname),gname:m(`gname`,t.gname)};return s.length&&c.push(...Ye(t,s)),c.push(be(g)),t.data.length&&c.push(t.data),t.data.length%k&&c.push(new Uint8Array(k-t.data.length%k)),c}function Qe({format:e=`gnu`,blocking:t=20,symlinksAbove:n}={},r=!1){if(!He.has(e))throw new o(`format ${v(String(e))} is not gnu, ustar or pax`);if(!Number.isSafeInteger(t)||t<1)throw new o(`blocking is not a positive integer`);let i=new O(r,n),a=0;return{add(t){let n=Ge(t,i.above);i.add(n);let r=Ze(n,e);for(let e of r)a+=e.length;return r},end(){let e=t*k;return[new Uint8Array(Math.ceil((a+2*k)/e)*e-a)]}}}function $e(e,t){let n=Qe(t,!0),r=[];for(let t of e)r.push(...n.add(t));return a([...r,...n.end()])}export{n as a,r as b,i as c,a as d,o as e,s as f,c as g,l as h,f as i,g as j,_ as k,v as l,S as m,te as n,ne as o,re as p,T as q,O as r,$e as s,Ve as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./chunk-QRKFPLA4.js";var t=new Set([`overview`,`graph`,`treemap`,`compare`,`advisories`,`issues`,`code`,`search`,`terminal`]),n=/^\d+$/u;function r(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n<32||n===127)return!0}return!1}var i=512;function a(e){return typeof e==`string`&&e.length>0&&e.length<=i&&!r(e)}function o(e){return a(e)&&!n.test(e)}function s(e){return e===`completed`||e===`not_planned`||e===`duplicate`?e:`unknown`}function c(e){let[t,n,r]=e.split(`/`);return r===void 0&&t!==void 0&&n!==void 0&&t.length<=39&&/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u.test(t)&&n.length<=100&&n!==`.`&&n!==`..`&&/^[a-zA-Z\d._-]+$/u.test(n)}function l(e,t){if(typeof e!=`string`||e.length>2048)return null;let n;try{n=new URL(e)}catch{return null}if(n.href!==e||n.origin!==`https://github.com`||n.username||n.password)return null;let r=t.exec(n.pathname);if(!r)return null;let i=`${r[1]}/${r[2]}`,a=Number(r[3]);return!c(i)||!Number.isSafeInteger(a)||a<=0?null:{repo:i,number:a}}function u(e){return l(e,/^\/([^/]+)\/([^/]+)\/pull\/(\d+)(?:\/(?:files|commits|checks))?\/?$/u)}function d(e){return l(e,/^\/([^/]+)\/([^/]+)\/issues\/(\d+)\/?$/u)}function f(e){let t=u(e);if(t)return{...t,kind:`pull`};let n=d(e);return n?{...n,kind:`issue`}:null}function p(e){return`${e.repo.toLowerCase()}#${e.kind}:${e.number}`}var m=/^(?=.{1,214}$)(?:@[\w.-]+\/[\w-]|[\dA-Za-z])[\w.-]*$/u,h=/^(?=.{1,256}$)[\dA-Za-z][\w.+-]*$/u,ee=/^@[\da-z~-][\w.~-]*$/u,g=/^[\da-f]{64}$/u;function _(e){return typeof e==`string`&&m.test(e)}function v(e){return typeof e==`string`&&h.test(e)}function y(e){return typeof e==`string`&&g.test(e)}function b(e){return typeof e==`string`&&e.length>0&&e.length<=1024&&!/[\p{Cc}\\]/u.test(e)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}function te(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase(),n=t.startsWith(`@`)?t:`@${t}`;return n.length<=214&&ee.test(n)?n:null}var x=Object.freeze({all:`all`,team:`team`,repo:`repository`}),S=(e,t)=>e===`team`?typeof t==`string`&&/^[A-Za-z0-9_-]+$/u.test(t):e===`repo`&&Number.isSafeInteger(t)&&t>0;function ne(e){let t=e.riskScope??`team`,n=e.riskTarget??null;return!Object.hasOwn(x,t)||n!=null&&!S(t,n)?null:`/manage/risk/${x[t]}${n==null?``:`/${n}`}`}function C(e){if(e===`/manage/risk/team`||e===`/manage/repositories/risk`)return{view:`manage-repo-risk`};if(!e.startsWith(`/manage/risk/`))return;let t=/^\/manage\/risk\/(?:(all)|(team)\/([A-Za-z0-9_-]+)|repository(?:\/([1-9]\d*))?)$/u.exec(e);if(!t)return null;if(t[1])return{view:`manage-repo-risk`,riskScope:`all`};let[n,r]=t[2]?[`team`,t[3]]:[`repo`,t[4]==null?null:Number(t[4])];return r!=null&&!S(n,r)?null:{view:`manage-repo-risk`,riskScope:n,...r==null?{}:{riskTarget:r}}}var w=[[`whitespace`,`hideWhitespace`],[`type-only`,`hideTypes`]],T=[[`on`,`indented`],[`folded`,`folded`]];function E(e){let t=w.filter(([,t])=>e[t]===!0).map(([e])=>e),n=T.find(([,t])=>t===e.pretty)?.[0];return[...t.length>0?[`hide=${t.join(`,`)}`]:[],...n?[`pretty=${n}`]:[]]}function D(e){let t=new Set(e.getAll(`hide`).flatMap(e=>e.split(`,`))),n=T.find(([t])=>t===e.get(`pretty`))?.[1];return{...Object.fromEntries(w.filter(([e])=>t.has(e)).map(([,e])=>[e,!0])),...n?{pretty:n}:{}}}var O=e=>typeof e==`string`&&e.length>0&&e.length<=256&&!/[\p{Cc}]/u.test(e);function re(t){let n=t.get(`repo`),r=new Set((t.get(`severity`)??``).split(`,`)),i=e.filter(e=>r.has(e)),a={...O(n)?{repo:n}:{},...i.length>0?{severities:i}:{}};return Object.keys(a).length>0?{filters:a}:{}}function ie(t){let n=e.filter(e=>t?.severities?.includes(e)),r=[...O(t?.repo)?[`repo=${encodeURIComponent(t.repo).replaceAll(`%2F`,`/`)}`]:[],...n.length>0?[`severity=${n.join(`,`)}`]:[]];return r.length>0?`?${r.join(`&`)}`:``}var k=new Set([`code`,`diff`]),A=e=>k.has(e)?`code`:`overview`,j=e=>k.has(e)?{compareMode:`code`}:{},M=e=>k.has(e)?`/code`:``,N=Object.freeze({manage:`/manage`,"manage-bundles":`/manage/bundle`,"manage-scans":`/manage/scans`,"manage-reports":`/manage/report`,"manage-repos":`/manage/repositories`,"manage-repo-risk":`/manage/risk`,"admin-users":`/manage/users`,"manage-teams":`/manage/team`,"manage-import":`/manage/import`,"manage-links":`/manage/links`,"manage-deduplication":`/manage/deduplication`,"manage-history":`/manage/history`}),P=new Set([`workspace-reports`,`workspace-bundles`,`workspace-repositories`,`workspace-dependencies`]),F=new Set([`pulls`,`versions`,`branch`,`reviews`]),I=e=>e.view===`workspace-dependencies`&&e.dependencyTab!=null?{dependencyTab:e.dependencyTab}:{};function L(e){if(!o(e)||e===`.`||e===`..`)return null;try{return`/finding/${encodeURIComponent(e)}`}catch{return null}}function ae(e){if(!e)return null;if(e.view===`home`)return`/`;if(e.view===`reviews`)return`/my/reviews`;if(e.view===`profile`)return`/my/profile`;if(e.view===`npm`)return B(e);if(e.view===`repository-code`)return se(e);if(P.has(e.view)){let t=I(e).dependencyTab??`pulls`;return!/^[A-Za-z0-9_-]+$/u.test(e.teamSlug??``)||!F.has(t)?null:`/team/${e.teamSlug}/${e.view.slice(10)}${t===`pulls`?``:`/${t}`}`}if(e.view===`bundles`){if(!/^[A-Za-z0-9_-]+$/u.test(e.bundleSlug??``)||[e.teamSlug,e.compareSlug].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e)))return null;let n=e.bundleTab??`overview`;if(!t.has(n))return null;let r=e.teamSlug?`/team/${e.teamSlug}`:`/manage`,i=n===`code`&&Z(e.file)?`/${e.file}`:``,a=i&&Z(e.line)?`#L${e.line}${Z(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``,o=n===`compare`&&e.compareSlug!=null?`/${e.compareSlug}${M(e.compareMode)}`:``;return`${r}/bundle/${e.bundleSlug}${n===`overview`?``:`/${n}`}${i}${o}${a}`}if(e.view===`manage-repo-risk`)return ne(e);if(Object.hasOwn(N,e.view)){let t=N[e.view];return e.view===`manage-deduplication`&&e.linkId?`${t}?report=${encodeURIComponent(e.linkId)}`:e.view===`manage-bundles`&&Number.isSafeInteger(e.createRepoId)&&e.createRepoId>0?`${t}?createRepo=${e.createRepoId}`:e.view===`manage-scans`&&e.scanMode===`link`?`${t}?mode=link`:e.view===`manage-scans`&&e.bundleId?`${t}?bundle=${encodeURIComponent(e.bundleId)}${e.scanMode===`dependencies`?`&mode=dependencies`:``}`:e.view===`manage-history`&&e.actor?`${t}?actor=${encodeURIComponent(e.actor)}`:t}if(![`findings`,`files`].includes(e.view)||!e.teamSlug||[e.teamSlug,e.reportSlug].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e)))return null;let n=`/team/${encodeURIComponent(e.teamSlug)}`,r=e.reportSlug?`/report/${encodeURIComponent(e.reportSlug)}`:``;if(e.finding){let t=L(e.finding.id);return e.view===`findings`&&t?`${n}${r}${t}`:null}return e.view===`files`?`${n}${r}/files`:`${n}${r}${r?``:ie(e.filters)}`}var R=new Set([`overview`,`code`,`search`,`compare`,`review`,`treemap`]),z=e=>y(e?.hash)&&(e.repoId==null?e.commit==null&&e.path==null:(J(e.repoId)||typeof e.repoId==`string`&&c(e.repoId))&&q.test(e.commit??``)&&(e.path==null||b(e.path)));function B(e){if(e.packageName==null)return`/npm`;let t=e.bundleTab??`overview`;if(!_(e.packageName)||e.packageSpec!=null&&!v(e.packageSpec)||!R.has(t)||e.compareSpec!=null&&!v(e.compareSpec))return null;if(t===`review`){if(e.reviewPackage!=null&&!_(e.reviewPackage)||e.reviewSpec!=null&&!v(e.reviewSpec)||e.patch!=null&&!z(e.patch)||e.basePatch!=null&&(!y(e.basePatch)||e.reviewPackage==null))return null;let t=e.reviewPackage==null?``:`/${e.reviewPackage}${e.reviewSpec==null?``:`@${e.reviewSpec}`}`,{patch:n}=e,r=[...n==null?[]:[`patch=${n.hash}`],...n?.repoId==null?[]:[`repo=${n.repoId}&commit=${n.commit}`],...n?.path==null?[]:[`path=${n.path.split(`/`).map(encodeURIComponent).join(`/`)}`],...e.basePatch==null?[]:[`basePatch=${e.basePatch}`],...E(e)].join(`&`);return`/npm/${e.packageName}${e.packageSpec==null?``:`@${e.packageSpec}`}/review${t}${r?`?${r}`:``}`}let n=t===`code`&&Z(e.file)?`/${e.file}`:``,r=n&&Z(e.line)?`#L${e.line}${Z(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``,i=t===`compare`&&e.compareSpec!=null?`/${e.compareSpec}${M(e.compareMode)}`:``;return`/npm/${e.packageName}${e.packageSpec==null?``:`@${e.packageSpec}`}${t===`overview`?``:`/${t}`}${n}${i}${r}`}function V(e,t,n){let r=/^\/npm\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?\/review(?:\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?)?$/u.exec(e);if(r){if(!_(r[1])||r[2]!=null&&!v(r[2])||r[3]!=null&&!_(r[3])||r[4]!=null&&!v(r[4]))return null;let e=r[3]&&/^\d+\.\d+\.\d+(?:[-+].*)?$/u.test(r[3])&&r[4]==null,t=[`repo`,`commit`,`path`].some(e=>n.has(e))?{repoId:/^[1-9]\d*$/u.test(n.get(`repo`)??``)?Number(n.get(`repo`)):n.get(`repo`),commit:n.get(`commit`)}:{},i=n.has(`patch`)?{hash:n.get(`patch`),...t,...n.has(`path`)?{path:n.get(`path`)}:{}}:null,a=n.get(`basePatch`);return i&&!z(i)||a!==null&&(!y(a)||!r[3])?null:{view:`npm`,packageName:r[1],packageSpec:r[2]??null,bundleTab:`review`,...r[3]?{reviewPackage:e?r[1]:r[3],reviewSpec:e?r[3]:r[4]??null}:{},...i?{patch:i}:{},...a?{basePatch:a}:{},...D(n)}}let i=/^\/npm(?:\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(code|search|compare|treemap)(?:\/([^/]+)(?:\/([a-z]+))?)?)?)?$/u.exec(e);if(!i)return;if(i[1]==null)return{view:`npm`};if(!_(i[1])||i[2]!=null&&!v(i[2]))return null;let a={view:`npm`,packageName:i[1],packageSpec:i[2]??null,bundleTab:i[3]??`overview`};if(i[4]==null)return a;if(a.bundleTab===`compare`)return v(i[4])&&(i[5]==null||k.has(i[5]))?{...a,compareSpec:i[4],...j(i[5])}:null;if(a.bundleTab!==`code`)return null;let o=Number(i[4]);return!i[5]&&/^[1-9]\d*$/u.test(i[4])&&Number.isSafeInteger(o)?{...a,file:o,...Q(t)}:null}var H=new Set([`code`,`search`,`treemap`,`compare`,`commits`,`issues`,`pulls`,`agents`,`pulse`,`replay`]),U=new Set([`commits`,`issues`,`pulls`,`agents`,`pulse`,`replay`]),W=new Map([[`issues`,new Set([`closed`])],[`pulls`,new Set([`closed`])],[`pulse`,new Set([`week`,`quarter`,`year`])],[`replay`,new Set([`100`,`1000`])]]),G=/^[a-z][a-z\d-]{0,31}$/u,K=(e,t)=>e===`agents`?typeof t==`string`&&G.test(t)&&t!==`all`:W.get(e)?.has(t)===!0,q=/^[a-f\d]{40}$/u,oe=500,J=e=>Number.isSafeInteger(e)&&e>0;function Y(e){return typeof e==`string`&&(e===``||e.length<=oe&&!/[\p{Cc}\\]/u.test(e)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e===e.trim()))}function se(e){let t=e.bundleTab??`code`,n=e.path??``;if(!J(e.repoId)||e.commit!=null&&!q.test(e.commit)||!Y(n)||!H.has(t)||e.compareCommit!=null&&!q.test(e.compareCommit))return null;let r=n?`?path=${n.split(`/`).map(encodeURIComponent).join(`/`)}`:``;if(e.commit==null)return`/repo/${e.repoId}${r}`;let i=t===`code`&&Z(e.file)?`/code/${e.file}`:t===`code`?``:`/${t}`,a=t===`compare`&&e.compareCommit!=null?`/${e.compareCommit}${M(e.compareMode)}`:``,o=K(t,e.subtab)?`/${e.subtab}`:``,s=t===`code`&&Z(e.file)&&Z(e.line)?`#L${e.line}${Z(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``;return`/repo/${e.repoId}/${e.commit}${i}${a}${o}${r}${s}`}function X(e){let t=/^\/(?:repo|manage\/code)\/([1-9]\d*)(?:\/([a-f\d]{40})(?:\/(code|search|treemap|compare|commits|history|issues|pulls|agents|pulse|replay)(?:\/([^/]+)(?:\/([a-z]+))?)?)?)?$/u.exec(e.pathname.replace(/\/$/u,``));if(!t)return;let n=Number(t[1]),r=e.searchParams.get(`path`)??``,i=t[3]===`history`?`commits`:t[3]??`code`;if(!J(n)||!Y(r))return null;let a={view:`repository-code`,repoId:n,commit:t[2]??null,path:r,bundleTab:i};if(t[4]==null)return a;if(i===`compare`)return q.test(t[4])&&(t[5]==null||k.has(t[5]))?{...a,compareCommit:t[4],...j(t[5])}:null;if(U.has(i))return t[5]==null&&K(i,t[4])?{...a,subtab:t[4]}:null;let o=Number(t[4]);return i===`code`&&t[5]==null&&/^[1-9]\d*$/u.test(t[4])&&Number.isSafeInteger(o)?{...a,file:o,...Q(e.hash)}:null}function Z(e){return Number.isSafeInteger(e)&&e>0}function Q(e){let t=/^#L([1-9]\d*)(?:-L([1-9]\d*))?$/u.exec(e),[n,r]=t?[Number(t[1]),Number(t[2]??t[1])]:[];return!Z(n)||!Z(r)?{}:n===r?{line:n}:{line:Math.min(n,r),endLine:Math.max(n,r)}}function ce(e){let n=e.pathname.replace(/\/$/u,``)||`/`;if(n===`/`||n===`/index.html`)return{view:`home`};if(n===`/my/reviews`)return{view:`reviews`};if(n===`/my/profile`){let t=e.searchParams.get(`link-error`);return{view:`profile`,...t&&/^[a-z-]{1,64}$/u.test(t)?{linkError:t}:{}}}let r=Object.keys(N).find(e=>N[e]===n);if(r){let t=Number(e.searchParams.get(`createRepo`));return{view:r,...r===`manage-deduplication`&&e.searchParams.get(`report`)?{linkId:e.searchParams.get(`report`)}:{},...r===`manage-bundles`&&Number.isSafeInteger(t)&&t>0?{createRepoId:t}:{},...r===`manage-history`&&e.searchParams.get(`actor`)?{actor:e.searchParams.get(`actor`)}:{},...r===`manage-scans`?e.searchParams.get(`mode`)===`link`?{scanMode:`link`}:e.searchParams.get(`bundle`)?{bundleId:e.searchParams.get(`bundle`),...e.searchParams.get(`mode`)===`dependencies`?{scanMode:`dependencies`}:{}}:{}:{}}}let a=/^(?:\/team\/([A-Za-z0-9_-]+)|\/manage)\/bundle\/([A-Za-z0-9_-]+)(?:\/([a-z]+)(?:\/([A-Za-z0-9_-]+)(?:\/([a-z]+))?)?)?$/u.exec(n);if(a){let n=a[3]??`overview`;if(!t.has(n))return null;let r={view:`bundles`,teamSlug:a[1]??null,bundleSlug:a[2],bundleTab:n};if(a[4]==null)return r;if(n===`compare`)return a[5]==null||k.has(a[5])?{...r,compareSlug:a[4],...j(a[5])}:null;let i=Number(a[4]);return n!==`code`||a[5]||!/^[1-9]\d*$/u.test(a[4])||!Number.isSafeInteger(i)?null:{...r,file:i,...Q(e.hash)}}let o=V(n,e.hash,e.searchParams);if(o!==void 0)return o;let s=X(e);if(s!==void 0)return s;let c=/^\/team\/([A-Za-z0-9_-]+)\/(reports|bundles|repositories|dependencies)$/u.exec(n);if(c)return{view:`workspace-${c[2]}`,teamSlug:c[1]};let l=/^\/team\/([A-Za-z0-9_-]+)\/dependencies\/([a-z]+)$/u.exec(n);if(l)return F.has(l[2])?{view:`workspace-dependencies`,teamSlug:l[1],dependencyTab:l[2]}:null;let u=/^\/team\/([^/]+)(?:\/report\/([^/]+))?(?:\/(files)|\/finding\/([^/]+))?$/u.exec(n);if(!u)return C(n)??null;try{let t=decodeURIComponent(u[1]),n=u[2]?decodeURIComponent(u[2]):null;if([t,n].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e))||u[4]?.length>i*9)return null;let r=u[4]?decodeURIComponent(u[4]):null;return r!=null&&!L(r)?null:u[3]?{view:`files`,teamSlug:t,reportSlug:n}:r==null?{view:`findings`,teamSlug:t,reportSlug:n,...n==null?re(e.searchParams):{}}:{view:`findings`,teamSlug:t,reportSlug:n,finding:{id:r}}}catch{return null}}function $(e,t,n=[]){if(P.has(e.view)){let n=t.filter(t=>t.slug===e.teamSlug);return n.length===1?{view:e.view,teamId:n[0].id,...I(e)}:null}if(e.view===`bundles`){let{teamSlug:r,bundleSlug:i,compareSlug:a,compareMode:o,...s}=e,c=r==null?[]:t.filter(e=>e.slug===r);if(r!=null&&c.length!==1)return null;let l=c[0],u=r==null?n:t.flatMap(e=>e.bundles??[]),d=e=>new Set(u.filter(t=>t.slug===e).map(e=>e.id)),f=d(i),p=(l?.bundles??n).find(e=>e.slug===i);if(!i||!p||f.size!==1)return null;let m=a==null?null:d(a),h=m?.size===1?{compareId:[...m][0],...j(o)}:{};return{...s,teamId:l?.id??null,bundleId:p.id,...h}}if(![`findings`,`files`].includes(e.view))return e;let{teamSlug:r,reportSlug:i,...a}=e,o=t.filter(e=>e.slug===r),s=r&&o.length===1?o[0]:null,c=new Set(t.flatMap(e=>e.reports??[]).filter(e=>e.slug===i).map(e=>e.id)),l=i!=null&&c.size===1?[...c][0]:null;return a.finding?{...a,teamId:s?.id??null,reportId:l,teamOnly:i==null}:s?i==null?{...a,teamId:s.id,reportId:null}:(s.reports??[]).some(e=>e.id===l)?{...a,teamId:s.id,reportId:l}:null:null}function le(e,t,n=[]){if(P.has(e.view)){let n=t.find(t=>t.id===e.teamId),r={view:e.view,teamSlug:n?.slug,...I(e)};return n?.slug&&$(r,t)?r:null}if(e.view===`bundles`){let{teamId:r,bundleId:i,compareId:a,compareMode:o,...s}=e,c=t.find(e=>e.id===r);if(r!=null&&!c?.slug)return null;let l=(c?.bundles??n).find(e=>e.id===i);if(!l?.slug)return null;let u=a==null?null:(r==null?n:t.flatMap(e=>e.bundles??[])).find(e=>e.id===a),d={...s,teamSlug:c?.slug??null,bundleSlug:l.slug,...u?.slug?{compareSlug:u.slug,...j(o)}:{}},f=$(d,t,n);if(!f)return null;if(d.compareSlug!=null&&f.compareId!==a){let{compareSlug:e,compareMode:t,...n}=d;return n}return d}if(![`findings`,`files`].includes(e.view))return e;let{teamId:r,reportId:i,...a}=e,o=t.find(e=>e.id===r),s=i==null?null:o?.reports?.find(e=>e.id===i);if(!o?.slug||i!=null&&!s?.slug)return null;let c={...a,teamSlug:o.slug,reportSlug:s?.slug??null},l=$(c,t);return l?.teamId===o.id&&l.reportId===(s?.id??null)?c:null}export{t as a,i as b,o as c,s as d,u as e,d as f,f as g,p as h,_ as i,v as j,y as k,b as l,te as m,A as n,j as o,N as p,F as q,ae as r,R as s,H as t,U as u,K as v,ce as w,$ as x,le as y};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{b as e}from"./chunk-S5HSDGTP.js";import{a as t}from"./chunk-IYPY47MC.js";import{a as n}from"./chunk-QRKFPLA4.js";import{b as r}from"./chunk-TUII34K2.js";var i=/^webpack(?:-internal)?:\/\/[^/]*\//u,a=/^[a-z][\d+.a-z-]*:/iu,o=/^file:/iu,s=/^(?:file|ftp|https?|wss?):/iu,c=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,l=e=>c.exec(e)[0],u=e=>l(e).includes(`://`),d=e=>e.replace(u(e)?/[#?].*$/su:/\?.*$/su,``),f=e=>e.slice(e.lastIndexOf(`/`)+1),p=(e,t)=>URL.parse(e,t)?.href??null;function m(e){let t=l(e),n=t.includes(`://`)&&p(e);if(n)return n;let r=[];for(let n of e.slice(t.length).split(`/`))n===``||n===`.`||(n===`..`?r.length>0&&r.at(-1)!==`..`?r.pop():t||r.push(`..`):r.push(n));let i=/^[a-z]:\/$/iu.test(t)?t.toUpperCase():t.startsWith(`//`)?t.toLowerCase():t;return i?i.replace(/\/?$/u,`/`)+r.join(`/`):r.join(`/`)||`.`}function h(e,t){let n=l(t);return u(e)&&!n.includes(`:`)?p(t,e)??m(`${e}/../${t}`):m(n===`/`?l(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function ee(e){try{return decodeURIComponent(e)}catch{return e}}function g(e,t){let n=e.replaceAll(`\\`,`/`);if(i.test(n))return m(n.replace(i,``));let r=s.test(n)?p(n)??n:n,c=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(c){let[,e,t]=c;return m(ee(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(a.test(r)&&!l(r).includes(`:`))return r;if(t===void 0)return m(r);if(o.test(t)&&!l(r))return g(p(r,t)??r);let d=g(t);return l(r)&&!u(d)?m(r):h(d,r)}var te=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function _(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return te.test(t)?t:null}var ne=new Set([`.pnpm`,`.bun`,`.deno`]),re=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function ie(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return re.test(r)?r:null}function ae(e){let t=d(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:_(t.slice(n+1).join(`/`));if(r===null)return null;let i=n+1+r.split(`/`).length;if(i>=t.length||t.slice(i).includes(``))return null;let a=t.slice(0,i).join(`/`);return{name:r,version:ne.has(t[n-2])?ie(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var oe=new Map([[`js`,`jsx`],[`mjs`,`jsx`],[`cjs`,`jsx`],[`jsx`,`jsx`],[`es`,`jsx`],[`es6`,`jsx`],[`ts`,`ts`],[`mts`,`ts`],[`cts`,`ts`],[`tsx`,`tsx`],[`json`,`json`]]);function se(e){let t=f(d(e));return/^[\w-]+$/u.test(t)?`jsx`:oe.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var ce=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],le=[`.ios`,`.android`,`.web`];function ue(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(f(d(e.path??``)))?.[0]),[[n,r],[,i]]=le.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var de=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),fe=[`index`,`main`,`browser`,`node`],pe=[``,`src/`,`lib/`,`dist/`,`build/`],me=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*he(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of de.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of ce)for(let r of t)yield n+r+e;if(n)for(let r of t.filter(Boolean))yield e.slice(0,-n.length)+r+n}function*ge(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!me.has(t.slice(0,n)))return;t=t.slice(n+1)}}function _e(e){let t=new Map,n=new Map,r=new Map;for(let i of e)i.path!==null&&t.set(i.path,i),i.package&&(n.set(i.package.name,(n.get(i.package.name)??new Set).add(i.package.root)),(r.get(i.package.root)??r.set(i.package.root,[]).get(i.package.root)).push(i));return{byPath:t,roots:n,byRoot:r,platforms:ue(e),found:new Map}}function v(e,t){if(!e.found.has(t)){let n=d(t),r=he(n,e.platforms).map(e=>e+t.slice(n.length));e.found.set(t,e.byPath.get(r.find(t=>e.byPath.has(t)))??null)}return e.found.get(t)}function ve(e,t,n){let r=e.roots.get(n);if(!r)return null;let i=t.path.split(`/`);for(let e=i.length-1;e>=0;e--){let t=[...i.slice(0,e),`node_modules`,n].join(`/`);if(r.has(t))return t}return r.size===1?[...r][0]:null}var ye=new Set(`assert.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.domain.events.fs.http.http2.https.inspector.module.net.os.path.perf_hooks.process.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.trace_events.tty.url.util.v8.vm.wasi.worker_threads.zlib._http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert/strict.dns/promises.fs/promises.inspector/promises.path/posix.path/win32.readline/promises.stream/consumers.stream/promises.stream/web.timers/promises.util/types`.split(`.`));function be(e){if(e.startsWith(`node:`)||ye.has(e))return{builtin:!0};let t=_(d(e));return t===null?{}:{package:t}}function xe(){let e=[],t=new Map,n=(n,r,i)=>{let a=t.get(n)??t.set(n,new Set).get(n);a.has(r)||(a.add(r),e.push(i))};return{edges:e,add:n,link:(e,t,r)=>{e&&t&&t!==e&&n(e,t,{from:e,to:t,kind:r})}}}function Se(e,t){for(let n of fe)for(let r of pe){let i=v(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function Ce(e,t,n,r){return/^\/[^?]/u.test(n)?v(e,t+n)??ge(n.slice(1)).map(n=>v(e,`${t}/${n}`)).find(Boolean):v(e,t+n)??r(e,t)}function we(e,t,n,r=Se){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,o=s.test(i);if(o||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||u(i)){let n=o?g(i):h(t.path,i),r=v(e,n);return r?{to:r}:{to:null,path:n}}if(a.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let c=_(d(n)),l=c===null?null:ve(e,t,c);if(l===null)return{to:null,...be(n)};let f=Ce(e,l,n.slice(c.length),r);return f?{to:f}:{to:null,package:c}}var y=class extends Error{name=`SourceMapError`},Te=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())Te[t.codePointAt(0)]=e;function b(e){let t=new Int32Array(e.length*2);return t.set(e),t}function Ee(e){let{starts:t,columns:n,sources:r,names:i}=e;for(let e=0;e+1<t.length;e++){let[a,o]=[t[e],t[e+1]],s=a+1;for(;s<o&&n[s-1]<=n[s];)s++;if(s>=o)continue;let c=Array.from(n.subarray(a,o),(e,t)=>[e,r[a+t],i[a+t]]).sort((e,t)=>e[0]-t[0]);for(let[e,[t,o,s]]of c.entries())[n[a+e],r[a+e],i[a+e]]=[t,o,s]}return e}function De(e){let t=[0],n=new Int32Array(1024),r=new Int32Array(1024),i=new Int32Array(1024),a=0;for(let{mappings:o,files:s,line:c,column:l,names:u,nameCount:d}of e){if(typeof o!=`string`)throw new y(`mappings is not a string`);for(;t.length<=c;)t.push(a);let e=[0,0,0,0,0],f=0,p=0,m=1,h=l;for(let c=0;c<=o.length;c++){let l=c<o.length?Te[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new y(`mappings: a segment of more than 5 fields at ${c}`);e[f++]+=p%2?(1-p)/2:p/2,p=0,m=1}else if(l<64){if(p+=(l-32)*m,m*=32,m>2**30)throw new y(`mappings: a value at ${c} runs past 32 bits`)}else{if(l===255)throw new y(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new y(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new y(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new y(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new y(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[b(n),b(r),b(i)]),n[a]=e[0]+h,r[a]=t,i[a++]=f===5&&e[4]>=0&&e[4]<d?u+e[4]:-1,f=0}l===65&&(t.push(a),e[0]=0,h=0)}}}return t.push(a),Ee({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var x=new WeakMap,S=e=>x.get(e),C=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function w(e,t){if(!e)throw new y(t)}function T(e,t){if(e===void 0)return[];w(Array.isArray(e),`${t} is not an array`);for(let n of e)w(typeof n==`string`||n===null,`${t} holds ${JSON.stringify(n)}`);return e}function Oe(e,t,n,r){let i=e.bySource.get(t);if(i!==void 0)return e.files[i].content??=n,e.files[i].ignored||=r,i;let a=t===null?null:g(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:ae(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function E(e,t,n,r){w(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),w(e.sourceRoot===void 0||typeof e.sourceRoot==`string`,`sourceRoot is not a string`);let i=T(e.sources,`sources`),a=T(e.sourcesContent,`sourcesContent`),o=e.ignoreList??e.x_google_ignoreList??[];w(Array.isArray(o)&&o.every(e=>Number.isInteger(e)&&e>=0&&e<i.length),`ignoreList is not a list of indices into sources`);let s=new Set(o),c=e.sourceRoot?e.sourceRoot.replace(/\/?$/u,`/`):``,l=i.map((e,n)=>Oe(t,e===null?null:c+e,a[n]??null,s.has(n))),u=Array.isArray(e.names)?e.names:[];t.parts.push({mappings:e.mappings,files:l,line:n,column:r,names:t.names.length,nameCount:u.length}),t.names.push(...u)}function ke(e,t){w(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),w(Array.isArray(e.sections),`sections is not an array`);for(let[n,r]of e.sections.entries()){let{offset:i,map:a}=C(r)?r:{};w(C(i)&&[i.line,i.column].every(e=>Number.isInteger(e)&&e>=0),`sections[${n}].offset is not a line and a column`),w(C(a)&&a.sections===void 0,`sections[${n}].map is not a plain source map`);let o=e.sections[n-1]?.offset;w(!o||o.line<i.line||o.line===i.line&&o.column<=i.column,`sections[${n}] starts before sections[${n-1}]`),E(a,t,i.line,i.column)}}function Ae(e,t={}){if(!C(t))throw TypeError(`readSourceMap: options is not an object`);if(t.path!==void 0&&typeof t.path!=`string`)throw TypeError(`readSourceMap: options.path is not a string`);let n=e;if(typeof e==`string`||e instanceof Uint8Array)try{let t=typeof e==`string`?e:new TextDecoder(`utf-8`,{fatal:!0}).decode(e);n=JSON.parse(t.replace(/^\)\]\}'[^\n]*\n/u,``))}catch(e){throw new y(`not JSON: ${e.message}`,{cause:e})}w(C(n),`not a JSON object`);let r={files:[],bySource:new Map,mapPath:t.path,parts:[],names:[]};n.sections===void 0?E(n,r,0,0):ke(n,r);let i={files:r.files};return x.set(i,{...De(r.parts),nameList:r.names}),i}var je=/\r\n?|[\n\u2028\u2029]/gu;function Me(e){let t=[0];for(let n of e.matchAll(je))t.push(n.index+n[0].length);return t}function D(e,t,n,r){let[i,a]=[t,n];for(;i<a;){let t=i+a>>1;e[t]<=r?i=t+1:a=t}return i-1}function O(e,t){let n=D(e,0,e.length,t);return[n,t-e[n]]}function Ne(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=D(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Pe(e,t,n,r){let i=S(e),a=O(t,n),[o,s]=O(t,r),c=new Map,l=Ne(i,a);for(let e=a[0];e<=o&&e<i.starts.length-1;e++){let t=e===a[0]&&l>=0?l:i.starts[e];for(let n=t;n<i.starts[e+1];n++){let t=i.sources[n];if(e===o&&i.columns[n]>=s)break;t>=0&&c.set(t,(c.get(t)??0)+1)}}let[u]=[...c].reduce((e,t)=>t[1]>e[1]?t:e,[-1,0]);return u<0?null:e.files[u]}var k=/\s+/uy,A=`
|
|
2
|
+
\r\u2028\u2029`,j=/[\n\r\u2028\u2029]/gu,Fe=/[\n\r\u2028\u2029]/u,M=/[\w$\u0080-]+/uy,Ie=new Set([`return`,`typeof`,`instanceof`,`in`,`of`,`new`,`delete`,`void`,`throw`,`case`,`default`,`extends`,`do`,`else`,`yield`,`await`]),Le=new Set([`if`,`while`,`for`,`with`]),Re=new Set([`break`,`continue`,`debugger`]),ze=new Set([`(`,`[`,"${",`,`,`=`,`:`,`?`,`!`,`~`,`+`,`-`,`*`,`/`,`%`,`&`,`|`,`^`,`<`,`>`]);function Be(e,t){return e?.type===`word`?t&&[`return`,`yield`].includes(e.value)?!1:Ie.has(e.value)&&![`do`,`else`].includes(e.value):ze.has(e?.value)}function Ve(e){let t=e.at(-1);return t?.type===`word`&&(Le.has(t.value)||t.value===`await`&&e.at(-2)?.value===`for`)}function He(e){return e?e.type===`word`?Ie.has(e.value)||Re.has(e.value)||e.label===!0:e.value===`)`?e.control:e.value===`}`?!e.object:e.type===`punctuator`&&![`++`,`--`,`]`].includes(e.value):!0}var Ue=(e,t)=>e.startsWith(`\r
|
|
3
|
+
`,t+1)?3:2,We=/\\(?:u\{([\da-f]+)\}|u([\da-f]{4})|x([\da-f]{2})|([0-3][0-7]{0,2}|[4-7][0-7]?)|(\r\n|[\n\r\u2028\u2029])|(.))/giu,Ge={b:`\b`,f:`\f`,n:`
|
|
4
|
+
`,r:`\r`,t:` `,v:`\v`};function Ke(e){return e.includes(`\\`)?e.replace(We,(e,t,n,r,i,a,o)=>{if(a!==void 0)return``;if(i!==void 0)return String.fromCodePoint(Number.parseInt(i,8));let s=Number.parseInt(t??n??r,16);return Number.isNaN(s)?Ge[o]??o:String.fromCodePoint(Math.min(s,1114111))}):e}function qe(e,t){let n=e[t],r=t+1;for(;r<e.length&&e[r]!==n&&!A.includes(e[r]);)r+=e[r]===`\\`?Ue(e,r):1;return[e[r]===n?Ke(e.slice(t+1,r)):null,r+1]}function Je(e,t){let n=t+1,r=!1;for(;n<e.length&&!A.includes(e[n])&&(r||e[n]!==`/`);)e[n]===`\\`?n++:e[n]===`[`?r=!0:e[n]===`]`&&(r=!1),n++;return M.lastIndex=n+1,M.test(e)?M.lastIndex:n+1}function Ye(e,t,n){for(let r=t;r<e.length;r++)if(e[r]===`\\`)r++;else{if(e[r]==="`")return r+1;if(e[r]===`$`&&e[r+1]===`{`)return n.push(`template`),r+2}return e.length}function Xe(e){let t=[],n=[],r=[],i=0,a=0;for(;i<e.length;){let o=t.length;if(k.lastIndex=i,k.test(e)&&(i=k.lastIndex),i>=e.length)break;let s=e[i],c=e[i+1];if(M.lastIndex=i,s===`/`&&c===`/`)j.lastIndex=i+2,i=j.test(e)?j.lastIndex-1:e.length;else if(s===`/`&&c===`*`){let t=e.indexOf(`*/`,i+2);i=t<0?e.length:t+2}else if(s===`"`||s===`'`){let[n,r]=qe(e,i);t.push({type:`string`,value:n}),i=r}else if(s==="`"||s===`}`&&n.at(-1)===`template`){s===`}`&&n.pop();let r=n.length,a=Ye(e,i+1,n),o=s==="`"&&n.length===r&&e[a-1]==="`";t.push({type:`string`,value:o?Ke(e.slice(i+1,a-1)):null}),n.length>r&&t.push({type:`punctuator`,value:"${"}),i=a}else if(s===`/`&&He(t.at(-1)))i=Je(e,i),t.push({type:`regex`});else if(M.test(e)){let n=Re.has(t.at(-1)?.value)&&!Fe.test(e.slice(a,i));t.push({type:`word`,value:e.slice(i,M.lastIndex),...n&&{label:n}}),i=M.lastIndex}else{s===`{`&&n.push(Be(t.at(-1),Fe.test(e.slice(a,i)))?`object`:`block`);let o=s===`}`?n.pop():void 0;s===`(`&&r.push(Ve(t));let l=(s===`+`||s===`-`)&&c===s||s===`=`&&c===`>`?s+c:s;t.push({type:`punctuator`,value:l,...s===`)`&&{control:r.pop()===!0},...s===`}`&&{object:o===`object`}}),i+=l.length}t.length>o&&(a=i)}return t}var N=e=>e?.type===`string`&&e.value!==null,Ze=new Set([`type`,`typeof`]),Qe=(e,t)=>e[t+1]?.type===`word`&&(e[t+1].value!==`as`||e[t+2]?.type!==`word`||e[t+2].value===`as`);function $e(e,t){let n=!1;for(let r=t+1;r<e.length&&e[r].value!==`}`;r++)if(!(r>t+1&&e[r-1].value!==`,`)){if(!Ze.has(e[r].value)||!Qe(e,r))return!1;n=!0}return n}function et(e,t){for(let n=t;n<e.length;n++){let{value:r}=e[n];if(r===`;`||n>t&&(r===`import`||r===`export`))return null;if(r===`from`&&N(e[n+1]))return e[n+1].value}return null}function tt(e,t){let[n,r,i]=[e[t].value,e[t+1],e[t+2]],a=n===`import`?`import`:`export-from`;if(n===`import`&&N(r))return{kind:a,specifier:r.value};if(Ze.has(r?.value)&&![`,`,`from`].includes(i?.value)||r?.value===`{`&&$e(e,t+1)||n===`export`&&![`{`,`*`].includes(r?.value)||n===`import`&&r?.type!==`word`&&![`{`,`*`].includes(r?.value))return null;let o=et(e,t+1);return o===null?null:{kind:a,specifier:o}}function nt(e,t){let[n,r]=[e[t+2],e[t+3]];if(n?.value!==`)`)return N(n)&&[`)`,`,`].includes(r?.value)?n.value:null}function rt(e,t=new Set){let n=Xe(e),r=[];for(let[e,i]of n.entries()){if(i.type!==`word`||[`.`,`#`,`function`].includes(n[e-1]?.value)||n[e-1]?.value===`=`&&n[e-3]?.value===`type`&&n[e-4]?.value===`import`)continue;let a=n[e+1]?.value===`(`,o=a?nt(n,e):void 0;if((i.value===`require`||t.has(i.value))&&o!==void 0)r.push({kind:`require`,specifier:o,...i.value!==`require`&&{callee:i.value}});else if(i.value===`import`&&a)o!==void 0&&r.push({kind:`dynamic-import`,specifier:o});else if(i.value===`import`||i.value===`export`){let t=tt(n,e);t&&r.push(t)}}return r}var it=/^[\w$]*__d\(/gmu,at=([e,t,n,...r])=>(typeof e==`number`||typeof e==`string`)&&(t===void 0||typeof t==`object`)&&(n===void 0||typeof n==`string`)&&r.length===0;function ot(e){let t=/\);?\s*$/u.exec(e)?.index,n=null,r=t===void 0?-1:e.lastIndexOf(`},`,t);for(;r>=0&&/[\d"]/u.test(e[r+2]);){let i;try{i=JSON.parse(`[${e.slice(r+2,t)}]`)}catch{break}if(!at(i))break;n=i,r=r>0?e.lastIndexOf(`},`,r-1):-1}return n}function st(e){let t=/^[^(]*\(\s*(?:function\s*[\w$]*\s*)?\(([^)]*)\)/u.exec(e)?.[1].split(`,`).slice(1,4).map(e=>e.trim().replaceAll(`$`,`\\$`));if(!t?.length)return[];let n=e.matchAll(RegExp(`(?<=[^\\w$.#]|\\.\\.\\.)(?:${t.join(`|`)})\\((\\d+|"(?:[^"\\\\]|\\\\.)*")[,)]`,`gu`));return[...new Set([...n].map(e=>JSON.parse(e[1])))]}function ct(e,t){if(Array.isArray(e))return e;let n=Object.entries(e??{}).filter(([e])=>/^\d+$/u.test(e)).map(([,e])=>e);return n.length>0?n:st(t)}function lt(e,t){let n=new Map(t.files.map((e,t)=>[e,t])),r=e.flatMap((e,t)=>e.file?[{k:t,at:n.get(e.file)}]:[]);for(let n=0;n<(r[0]?.k??0);n++)e[n].file=t.files[r[0].at-r[0].k+n]??null;for(let[n,{k:i,at:a}]of r.entries()){let o=r[n+1];if(!(o&&o.at-a!==o.k-i))for(let n=i+1;n<(o?.k??e.length);n++)e[n].file=t.files[a+n-i]??null}}function ut(e,t){let n=[...e.matchAll(it)].map(e=>e.index);if(n.length===0)return null;let r=Me(e),i=t=>e.slice(r[t],r[t+1]),a=[];for(let[o,s]of n.entries()){let[c]=O(r,s),[l]=O(r,(n[o+1]??e.length)-1),u=ot(i(l));for(;!u&&l>c;)u=ot(i(--l));if(!u)throw Error(`bundleEdges: the Metro module at line ${c+1} ends in no define params`);let d=r[l+1]??e.length;a.push({id:u[0],file:Pe(t,r,s,d),dependencies:ct(u[1],e.slice(s,d))})}lt(a,t);let o=new Map(a.map(e=>[e.id,e])),{edges:s,link:c}=xe();for(let{file:e,dependencies:t}of a)for(let n of t)c(e,o.get(n)?.file,`dependency`);return s}var dt=e=>e.path!==null&&![`json`,null].includes(se(e.path)),ft=e=>e.path!==null&&se(e.path)===null;function pt(e){let t=/^_([A-Za-z]+)\d+$/u.exec(e)?.[1];if(t)return[t,`interopRequireDefault`];let n=/^_(interopRequire(?:Default|Wildcard)|jsx(?:Dev)?Runtime|callSuper)$/u.exec(e)?.[1];return n===`callSuper`?[`getPrototypeOf`,`possibleConstructorReturn`,`interopRequireDefault`]:n?[n]:[]}var mt={jsxRuntime:`react/jsx-runtime`,jsxDevRuntime:`react/jsx-dev-runtime`};function ht(e){let{sources:t,names:n,nameList:r}=S(e),i=new Map,a=new Map,o=e.files.map(()=>new Set);for(let e=0;e<n.length;e++)n[e]<0||t[e]<0||(a.has(n[e])||a.set(n[e],pt(r[n[e]]).length>0),a.get(n[e])&&o[t[e]].add(r[n[e]]));for(let[t,n]of o.entries()){if(n.size===0)continue;let r=e.files[t],a=new Set(Array.from((r.content??``).matchAll(/(?:function|var|let|const)\s+(_[A-Za-z]+\d*)\b/gu),e=>e[1])),o=[...n].filter(e=>!a.has(e)&&!a.has(e.replace(/\d+$/u,``))).flatMap(pt);o.length>0&&i.set(r,o.map(e=>mt[e]??`@babel/runtime/helpers/${e}`))}return i}function gt(e,t){let n=new Map;for(let[r,i]of e){let e=n.get(r)??n.set(r,new Map).get(r);for(let n of i)e.set(n,we(t,r,n,()=>null))}let r=new Set([...n.values()].flatMap(e=>[...e.values()].map(e=>e.to))),i=(e,n)=>t.byRoot.get(n).find(e=>!r.has(e))??t.byRoot.get(n)[0];return(e,r)=>{let a=n.get(e)?.get(r);return a?.to?a:we(t,e,r,i)}}var _t=e=>/(?:^|\/)__prelude__$/u.test(e.source??``),vt=e=>e?.package?.name===`metro-runtime`&&e.package.path===`src/polyfills/require.js`;function yt(e){if(!e.files.some(_t)&&!vt(e.files[0]))return null;if(!e.files.some(e=>e.content!==null&&!_t(e)&&!vt(e)))throw Error("bundleEdges: the Metro map carries no sourcesContent, which its edges are read from; pass the bundle as `code`");let t=_e(e.files),n=e.files[e.files.findIndex(ft)+1],r=e.files.find(e=>e.package?.name===`metro-runtime`&&e.package.path===`src/modules/asyncRequire.js`),i=new Map(e.files.filter(e=>e.content!==null&&dt(e)).map(e=>[e,rt(e.content)])),a=ht(e),o=gt([...[...i].map(([e,t])=>[e,t.flatMap(({specifier:e})=>e===null?[]:[e])]),...a],t),{edges:s,add:c,link:l}=xe();for(let t of e.files){ft(t)&&l(t,n,`dependency`);for(let{kind:e,specifier:n}of i.get(t)??[]){let i=n===null?{to:null}:o(t,n);i.to!==t&&c(t,`${e}\0${JSON.stringify(n)}`,{from:t,kind:e,specifier:n,...i}),e===`dynamic-import`&&l(t,r,`dependency`)}for(let e of a.get(t)??[])l(t,o(t,e).to,`dependency`)}return s}var bt=(e,t)=>t==null?yt(e):ut(t,e);function xt(e,t){let n=bt(e,t);if(!n)throw Error(`bundleEdges: not a Metro ${t==null?`map`:`bundle`}; edges-lite.js reads only those, edges.js reads others`);return{edges:n}}function St(e){let t=JSON.parse(e.replace(/^\)\]\}'[^\n]*\n/u,``)),n=Ae(t),r=t.sections?t.sections.reduce((e,t)=>e+(t.map.names?.length??0),0):t.names?.length??null;return{json:{version:t.version,file:t.file,sourceRoot:t.sourceRoot},map:n,namesCount:r}}function P(e){if(e.map)return e.map.files.flatMap(e=>e.source===null?[]:[[e.source,e.content]]);let t=e.json?.sourcesContent??[];return(e.json?.sources??[]).map((e,n)=>[e,t[n]??null])}function Ct(e,t){let n=new Map;for(let{from:r,to:i,specifier:a}of t(e).edges){if(r.source===null||i?.source==null||i.source===r.source)continue;let e=typeof a==`string`?[r.source,i.source,a]:[r.source,i.source];n.set(e.join(`\0`),e)}return[...n.values()]}function wt(e){try{return xt(e)}catch{return{edges:[]}}}var Tt=Object.freeze([]);function F(e){return e?.edges?e.edges:e?.map?(e.edges=Ct(e.map,wt),e.edges):Tt}var I=new WeakMap,L=new WeakMap;function Et(e){let t=F(e);if(!I.has(t)){let e=new Map;for(let[n,r]of t)e.has(n)||e.set(n,new Set),e.get(n).add(r);I.set(t,e)}return I.get(t)}function Dt(e){let t=F(e);if(!L.has(t)){let e=new Map;for(let[n,r,i]of t)i!==void 0&&(e.has(n)||e.set(n,new Map),e.get(n).set(i,r));L.set(t,e)}return L.get(t)}var R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap;function W(t){if(t?.metadataOnly)return new Map;let n=t?.bundle??t?.json;if(n&&R.has(n))return R.get(n);let r=new Map;if(!t)return r;if(t.kind===`stasis`){if(!t.bundle)return r;let n=t.bundle.formats;for(let[i,a]of t.bundle.sources)typeof a==`string`&&(e.isResourceFormat(n?.get(i))||r.set(i,a))}else if(t.kind===`sourcemap`)for(let[e,n]of P(t))typeof n==`string`&&r.set(e,n);return n&&R.set(n,r),r}function Ot(e){let t=1;for(let n=e.indexOf(`
|
|
5
|
+
`);n!==-1;n=e.indexOf(`
|
|
6
|
+
`,n+1))t++;return t}var kt=new WeakMap;function At(e){let t=kt.get(e);if(!t){let n=[...e.keys()].toSorted();t={paths:n,numbers:new Map(n.map((e,t)=>[e,t+1]))},kt.set(e,t)}return t}function jt(e,t,n){let r=Array.isArray(t)?t:[];return{integrity:e.integrity,kind:`sourcemap`,size:e.size,...Array.isArray(n)?{npmExecutable:new Set(n.filter(e=>typeof e==`string`))}:{},json:{version:3,sources:r.map(([e])=>e),sourcesContent:r.map(([,,e])=>typeof e==`string`?e:null)},fileSizes:new Map(r.map(([e,t])=>[e,t])),npmBinaries:new Map(r.filter(([,,e,t])=>typeof e!=`string`&&typeof t==`string`).map(([e,t,,n,r])=>[e,{size:t,digest:n,...typeof r==`string`?{link:r}:{}}]))}}var Mt=(e,t)=>e?.npmBinaries?.get(t)?.link;function Nt(e,t){if(t.startsWith(`/`))return null;let n=e.split(`/`).slice(0,-1);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e!==`..`)n.push(e);else if(n.pop()===void 0)return null}return n.join(`/`)}function G(e){let t=e?.bundle??e?.json;if(t&&z.has(t))return z.get(t);let n=new Map(W(e));for(let[t,r]of e?.npmBinaries??[])n.set(t,{format:`digest`,...r});if(e?.kind===`stasis`&&e.bundle){let t=e.bundle.formats;for(let[r,i]of e.bundle.sources){if(typeof i!=`string`)continue;let e=t?.get(r);e===`resource`?n.set(r,i):e===`resource:base64`&&n.set(r,{format:`base64`,data:i})}}return t&&z.set(t,n),n}var Pt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function Ft(e){let t=e.endsWith(`=`);if(t?e.length%4!=0||e.at(-3)===`=`:e.length%4==1)return null;let n=t?e.slice(0,e.endsWith(`==`)?-2:-1):e;if(/[^A-Za-z0-9+/]/u.test(n))return null;let r=n.length%4;return r>1&&Pt.indexOf(n.at(-1))&(r===2?15:3)?null:Math.floor(n.length*3/4)}function It(e){return typeof e==`string`?r(e):e?.format===`digest`?e.size:e?.format===`base64`?Ft(e.data):null}function K(e){if(e?.fileSizes)return e.fileSizes;let t=e?.bundle??e?.json;if(t&&B.has(t))return B.get(t);let n=new Map,r=G(e),i=e?.kind===`stasis`?e.bundle?.sources.keys():e&&P(e).map(([e])=>e);for(let e of i??[])n.set(e,It(r.get(e)));return t&&B.set(t,n),n}function Lt(e){if(e?.metadataOnly)return e.unsizedFiles??new Set;let t=K(e);if(U.has(t))return U.get(t);let n=new Set;for(let r of G(e).keys())t.get(r)===null&&n.add(r);return U.set(t,n),n}function Rt(t){let n=K(t);if(H.has(n))return H.get(n);let r=Lt(t),i=t?.kind===`stasis`?t.bundle?.formats:null,a=new Map;for(let[o,s]of n)s===null&&!r.has(o)||a.set(o,e.isResourceFormat(i?.get(o))||t?.npmBinaries?.has(o)?`resource`:`source`);return H.set(n,a),a}function zt(t){let n=K(t),r=t?.kind===`stasis`?t.bundle?.formats:null;if(!r||r.size===0)return n;if(V.has(n))return V.get(n);let i=new Map;for(let[t,a]of n)e.isResourceFormat(r.get(t))||i.set(t,a);return V.set(n,i),i}var q=new WeakMap;function Bt(e){if(e?.kind!==`stasis`||!e.bundle?.modules)return null;if(q.has(e.bundle))return q.get(e.bundle);let t=new Map;for(let[n,r]of e.bundle.modules)for(let e of Object.keys(r.files))t.set(n===`.`?e:`${n}/${e}`,n);return q.set(e.bundle,t),t}function Vt(e,n=null){let r=new Map;if(e?.kind!==`stasis`||!e.bundle?.modules)return r;for(let[i,a]of e.bundle.modules){if(i===`.`||n&&!n.has(i))continue;let e=a?.repo?.github,o=t(a?.repo?.commit);if(typeof e!=`string`||e===``||!o)continue;let s=typeof a.repo.directory==`string`?a.repo.directory:``;r.set(i,{github:e,...s?{directory:s}:{},commit:o})}return r}function Ht(e,t=null,n=(e,t)=>t.name){let r=new Map;if(e?.kind!==`stasis`||!e.bundle?.modules)return r;let i=t===null?null:Bt(e),a=t===null?null:new Set([...t].map(e=>i?.get(e)));for(let[t,i]of e.bundle.modules){if(a&&!a.has(t)||!t.includes(`node_modules`)||!i?.name||typeof i.version!=`string`||!i.version)continue;let e=n(t,i),o=r.get(e);o||(o=new Set,r.set(e,o)),o.add(i.version)}return r}var Ut={__proto__:null,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,json:`json`,css:`css`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,md:`markdown`,markdown:`markdown`,sol:`solidity`,php:`php`,phtml:`php`,rs:`rust`,rb:`ruby`,py:`python`,pyw:`python`,pyi:`python`,java:`java`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,"c++":`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,"h++":`cpp`,h:`cpp`,c:`c`,m:`objectivec`,mm:`objectivec`},Wt={__proto__:null,module:`javascript`,commonjs:`javascript`,"module-typescript":`typescript`,"commonjs-typescript":`typescript`,json:`json`,solidity:`solidity`,php:`php`,shell:`bash`,rust:`rust`,java:`java`,objc:`objectivec`,objcpp:`objectivec`,c:`c`,"c-header":`c`,cpp:`cpp`,"cpp-header":`cpp`,ruby:`ruby`,podspec:`ruby`,podfile:`ruby`,fastlane:`ruby`,"podfile-lock":`yaml`,xml:`markup`};function Gt(e){if(typeof e!=`string`)return!1;let t=e.length-1,n=0;for(;n<t&&/\s/u.test(e[n]);)n++;for(;t>n&&/\s/u.test(e[t]);)t--;return n<t&&e[n]===`{`&&e[t]===`}`}function J(e,t,n){if(typeof t==`string`&&Wt[t])return Wt[t];if(typeof e!=`string`)return null;let r=e.slice(e.lastIndexOf(`/`)+1),i=r.lastIndexOf(`.`);if(i<=0)return null;let a=r.slice(i+1).toLowerCase();return a===`map`?Gt(n)?`json`:null:Ut[a]??null}var Kt=Object.freeze({javascript:`JavaScript`,jsx:`JSX`,typescript:`TypeScript`,tsx:`TSX`,json:`JSON`,css:`CSS`,markup:`HTML`,yaml:`YAML`,bash:`Shell`,markdown:`Markdown`,solidity:`Solidity`,php:`PHP`,rust:`Rust`,ruby:`Ruby`,java:`Java`,cpp:`C++`,c:`C`,objectivec:`Objective-C`,python:`Python`,go:`Go`,kotlin:`Kotlin`,swift:`Swift`,dart:`Dart`,sql:`SQL`,lua:`Lua`,csharp:`C#`,scala:`Scala`,vue:`Vue`,svelte:`Svelte`}),qt=Object.freeze({py:`python`,pyw:`python`,go:`go`,kt:`kotlin`,kts:`kotlin`,swift:`swift`,dart:`dart`,sql:`sql`,lua:`lua`,cs:`csharp`,scala:`scala`,sc:`scala`,vue:`vue`,svelte:`svelte`});function Jt(e){let t=typeof e==`string`?e.slice(e.lastIndexOf(`/`)+1):``,n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1).trim().toLowerCase():``,i=J(e)??qt[r];return i?{key:i,label:Kt[i]??i}:r?{key:`extension:${r}`,label:`.${r}`}:{key:`other`,label:`Other`}}function Y(e,t){let n=new Map,r=0,i=0;for(let[a,o]of e){let e=Jt(a),s=n.get(e.key)??{...e,files:0,lines:0,bytes:0};s.files++,s.lines+=o,s.bytes+=t.get(a)??0,n.set(e.key,s),i+=o,r+=t.get(a)??0}return{files:e.size,lines:i,bytes:r,languages:[...n.values()].toSorted((e,t)=>t.lines-e.lines||e.label.localeCompare(t.label))}}var X=6,Z=new WeakMap,Yt=new Set([`terminal`,`code`,`search`,`compare`]);function Xt(e,t=null){return!!t||Yt.has(e)}var Zt=/^sha512-[A-Za-z0-9+/]{86}==$/u;function Qt(e){if(e.fileHashes)return Promise.resolve(e.fileHashes);if(Z.has(e))return Z.get(e);let t=(async()=>{let t=[...W(e)],r=new Map;for(let e=0;e<t.length;e+=32){let i=await Promise.all(t.slice(e,e+32).map(async([e,t])=>[e,await n(t)]));for(let[e,t]of i)r.set(e,t)}return e.fileHashes=r,r})();return Z.set(e,t),t.catch(()=>Z.delete(e)),t}function $t(e){if(typeof e!=`string`)return 0;let t=/\S/gu,n=/[\r\n]/gu,r=0;for(;t.test(e)&&(r++,n.lastIndex=t.lastIndex,n.test(e));)t.lastIndex=n.lastIndex;return r}function Q(e){return e.lineCounts??=new Map([...W(e)].map(([e,t])=>[e,$t(t)]))}function $(e){return e instanceof Map?Object.fromEntries([...e].map(([e,t])=>[e,$(t)])):e}async function en(e){let t=await Qt(e),n=K(e),i=Q(e),a={version:X,integrity:e.integrity,kind:e.kind,size:e.size,codeStats:Y(i,n),files:[...n].map(([e,n])=>[e,n,t.get(e)??null,i.get(e)??null])},o=Lt(e);if(o.size>0&&(a.unsized=[...o]),e.kind===`sourcemap`){let{version:t,file:n,sourceRoot:i,names:o}=e.json,s=P(e);a.json={version:t,file:n,sourceRoot:i,sources:s.map(([e])=>e)},a.sourceSizes=s.map(([,e])=>typeof e==`string`?r(e):null),a.namesCount=e.namesCount??o?.length??null;let c=new Map(a.files.map(([e],t)=>[e,t]));a.edges=F(e).map(([e,t,...n])=>[c.get(e),c.get(t),...n])}else{let t=e.bundle,r={version:t.version,config:t.config,repo:t.repo,package:t.package,formats:$(t.formats),imports:$(t.imports),reason:t.reason,executable:[...t.executable]};if(t.version===0)r.sources=Object.fromEntries([...n.keys()].map(e=>[e,null]));else{let e={},n={};for(let[r,i]of t.modules){let t=r.split(`/`).includes(`node_modules`)?e:n;Object.defineProperty(t,r,{enumerable:!0,value:{name:i.name,version:i.version,ecosystem:i.ecosystem,repo:i.repo,files:Object.fromEntries(Object.keys(i.files).map(e=>[e,null]))}})}r.modules=e,t.config.scope===`full`&&(r.sources=n,r.entries=[...t.entries])}a.bundle=r}return a}function tn(t,n){if(![1,2,3,4,5,X].includes(t?.version)||t.integrity!==n||![`stasis`,`sourcemap`].includes(t.kind)||!Number.isSafeInteger(t.size)||t.size<0||!Array.isArray(t.files))throw Error(`Invalid bundle metadata`);let r=t.version!==X,i=t.version===1,a=new Map,o=new Map,s=new Map;for(let e of t.files){if(!Array.isArray(e)||e.length!==4&&!(i&&e.length===3))throw Error(`Invalid bundle metadata file`);let[t,n,r,c]=e;if(typeof t!=`string`||o.has(t)||n!==null&&(!Number.isSafeInteger(n)||n<0)||r!==null&&(typeof r!=`string`||!Zt.test(r))||n===null&&r!==null||i&&n!==null&&r===null||c!=null&&(!Number.isSafeInteger(c)||c<0))throw Error(`Invalid bundle metadata file`);o.set(t,n),r!==null&&a.set(t,r),c!=null&&s.set(t,c)}let c=new Set(t.unsized??[]);if(t.unsized!==void 0&&(i||!Array.isArray(t.unsized)||c.size!==t.unsized.length)||[...c].some(e=>typeof e!=`string`||!o.has(e)||o.get(e)!==null))throw Error(`Invalid bundle metadata`);let l={integrity:n,kind:t.kind,size:t.size,metadataOnly:!0,fileSizes:o,fileHashes:a,lineCounts:s,unsizedFiles:c,stale:r};if(t.kind===`stasis`){l.bundle=e.fromJSON(t.bundle);let n=l.bundle.sources;if(n.size!==o.size||[...n.keys()].some(e=>!o.has(e)))throw Error(`Invalid bundle metadata inventory`);let r=l.bundle.formats;if(!i&&[...o].some(([t,n])=>a.has(t)!==(n!==null&&!e.isResourceFormat(r.get(t))))||[...c].some(e=>r.get(e)!==`resource:base64`))throw Error(`Invalid bundle metadata inventory`)}else{if(!t.json||typeof t.json!=`object`||![null,void 0].includes(t.namesCount)&&(!Number.isSafeInteger(t.namesCount)||t.namesCount<0))throw Error(`Invalid sourcemap metadata`);if(!Array.isArray(t.json.sources)||t.json.sources.some(e=>!o.has(e))||!Array.isArray(t.sourceSizes)||t.sourceSizes.length!==t.json.sources.length||t.sourceSizes.some(e=>e!==null&&(!Number.isSafeInteger(e)||e<0))||[...o].some(([e,t])=>a.has(e)!==(t!==null))||c.size>0)throw Error(`Invalid sourcemap inventory`);l.json=t.json,l.sourceSizes=t.sourceSizes,l.namesCount=t.namesCount,t.edges!==void 0&&(l.edges=nn(t.edges,t.files))}if(t.codeStats===void 0)l.codeStats=Y(s,o);else{let e=t.codeStats,n=e=>Number.isSafeInteger(e)&&e>=0;if(!e||![e.files,e.lines,e.bytes].every(n)||!Array.isArray(e.languages)||e.languages.some(e=>!e||typeof e.key!=`string`||typeof e.label!=`string`||![e.files,e.lines,e.bytes].every(n)))throw Error(`Invalid bundle code stats`);l.codeStats=e}return l}function nn(e,t){if(!Array.isArray(e))throw TypeError(`Invalid sourcemap edges`);return e.map(e=>{if(!Array.isArray(e)||![2,3].includes(e.length)||e[0]===e[1]||e.length===3&&typeof e[2]!=`string`||e.slice(0,2).some(e=>!Number.isSafeInteger(e)||e<0||e>=t.length))throw Error(`Invalid sourcemap edges`);return[t[e[0]][0],t[e[1]][0],...e.slice(2)]})}function rn(t,{integrity:n,kind:r,size:i}){if(r===`stasis`)return{integrity:n,kind:r,size:i,bundle:e.parse(t)};if(r!==`sourcemap`)throw Error(`Unsupported bundle format`);return{integrity:n,kind:r,size:i,...St(t)}}export{J as a,Y as b,F as c,Et as d,Dt as e,W as f,Ot as g,At as h,jt as i,Mt as j,Nt as k,G as l,It as m,K as n,Rt as o,zt as p,Bt as q,Vt as r,Ht as s,Xt as t,Qt as u,$t as v,Q as w,en as x,tn as y,rn as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=`:host{display:flex;flex-direction:column;position:relative;padding:0 clamp(1rem,3vw,3rem) 3rem;color:var(--text);container-type:inline-size;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:.875rem;line-height:1.5;--page-width: 76rem;--panel:color-mix(in srgb, var(--bg) 50%, var(--surface));--panel-hover:color-mix(in srgb, var(--text) 3%, var(--panel))}*,*:before,*:after{box-sizing:border-box}button,summary,select,label,legend,h1,h2,h3,.section-heading,.ui-hint,.page-intro>.intro,.count,.result-count,.repository-count,.breadcrumb-separator,.list-head,.report-list-head,.history-head,.bundle-group-head,.drop-copy,.local-import-copy,.location-field>span,.empty:not(.error,[role=alert]),.msg:not(.error,[role=alert]),.local-import-message:not(.error,[role=status]),.data-empty,.revision-empty{cursor:default;user-select:none;-webkit-user-select:none}input:not([type=checkbox],[type=radio]),textarea,[contenteditable],pre,code,.mono{cursor:text;user-select:text;-webkit-user-select:text}.wrap{width:100%;max-width:var(--page-width);margin:0 auto;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:none;scrollbar-gutter:stable}.manage-header{position:sticky;top:0;z-index:2}.wrap:has(>.manage-list){display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.wrap:has(>.manage-list)>:not(.manage-list){flex:none}.manage-list{position:relative;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.manage-list.has-intro{margin-top:calc(-.45rem - 1px);padding-top:calc(.45rem + 1px)}.manage-nav button{flex:0 0 auto;position:relative;min-height:3.7rem;padding:.9rem 0;border:0;border-radius:0;color:var(--muted);background:none;font-size:.8rem;font-weight:500;white-space:nowrap}.manage-nav button:hover,.manage-nav button[aria-current=page]{color:var(--text)}.manage-nav button[aria-current=page]:after{content:"";position:absolute;bottom:.6rem;inset-inline:0;height:2px;background:var(--accent);border-radius:var(--ui-radius, 2px)}.manage-nav button:focus-visible{outline-offset:-3px}.head{display:flex;align-items:center;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem}h1,.head h1{margin:0;font-size:1.9rem;font-weight:600;letter-spacing:-.045em;line-height:1.2}.count{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;padding:.12rem .5rem;border:1px solid var(--border);border-radius:6px;color:var(--muted);background:var(--surface);font-size:.73rem;font-weight:500;font-variant-numeric:tabular-nums}button,input,select{font:inherit}button,a,input,select{-webkit-app-region:no-drag}button,a{transition:background .15s,color .15s,border-color .15s}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}input:not([type=checkbox],[type=radio]):focus{outline:none;border-color:var(--accent)}button:disabled,select:disabled{opacity:.45}input:not([type=checkbox]),select{min-width:0;min-height:2.25rem;padding:.45rem .65rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--bg);color:var(--text);font-size:.8rem}input::placeholder{color:var(--muted)}input[type=checkbox]{accent-color:var(--accent);cursor:default}.btn,.drop-browse{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.25rem;height:auto;padding:.45rem .8rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--surface);color:var(--text);font-size:.8rem;font-weight:500;text-decoration:none;white-space:nowrap}.btn:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--surface-active);border-color:var(--muted)}.btn.primary,.drop-browse{color:var(--bg);background:var(--accent);border-color:var(--accent)}.btn.primary:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}.btn svg,.icon-btn svg{width:1rem;height:1rem}.icon-btn{display:inline-grid;place-items:center;flex:0 0 auto;width:2rem;height:2rem;padding:0;border:1px solid transparent;border-radius:var(--ui-radius, 5px);color:var(--muted);background:transparent}.icon-btn:hover:not(:disabled){color:var(--text);background:var(--surface-active)}.icon-btn.danger:hover:not(:disabled){color:var(--critical);background:rgb(from var(--critical) r g b / .1)}.avatar{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--bg));border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border))}.avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.avatar img.broken{display:none}.breadcrumb{display:flex;align-items:center;flex-basis:100%;gap:.4rem;margin-bottom:.8rem}.breadcrumb-manage{padding:.1rem 0;border:0;background:transparent;color:var(--muted);font-size:.78rem}.breadcrumb-manage:hover{color:var(--text)}.breadcrumb-separator{color:var(--muted)}.breadcrumb .breadcrumb-current{margin:0;color:var(--text);font-size:.85rem;font-weight:500}.msg{margin:1rem 0;padding:1.1rem 1.25rem;border:1px solid var(--border);border-radius:var(--ui-radius, 9px);color:var(--muted);font-size:.85rem}.msg.error{color:var(--critical);border-color:color-mix(in srgb,var(--critical) 35%,var(--border))}.empty{padding:3.5rem 1.5rem;border:1px dashed var(--border);border-radius:var(--ui-radius, 10px);color:var(--muted);text-align:center}.empty strong{display:block;margin-bottom:.4rem;color:var(--text);font-size:.95rem;font-weight:500}.empty p{margin:0;font-size:.85rem}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@container (max-width: 35rem){.drop-copy>span{display:none}.manage-nav button{min-height:3.25rem}h1,.head h1{font-size:1.65rem}}@media(prefers-reduced-motion:reduce){button,a{transition:none}}.collection-toolbar input{flex:1;max-width:26rem;min-width:10rem}.collection-toolbar select{min-width:10rem}.result-count{text-align:right;white-space:nowrap;margin-left:auto;color:var(--muted);font-size:.75rem;font-variant-numeric:tabular-nums}@container (max-width: 35rem){.collection-toolbar input{flex-basis:100%;max-width:none}}.manage-nav{display:flex;gap:1.35rem;align-items:stretch;overflow-x:auto;scrollbar-width:thin;border-bottom:1px solid var(--border);margin-bottom:1.5rem;padding:0 .1rem}.wrap>:not(.manage-header),.manage-nav{-webkit-app-region:no-drag;app-region:no-drag}@media(display-mode:window-controls-overlay){.manage-header{display:flow-root}.manage-header:before{content:"";float:right;width:var(--wco-right-toolbar, 0px);height:var(--wco-titlebar-height)}.manage-nav{width:max-content;max-width:100%;border-bottom:0}.manage-nav button{min-height:var(--wco-titlebar-height);padding-block:.35rem}.manage-nav button[aria-current=page]:after{bottom:0}}.intro{margin:0 0 1.25rem;max-width:46rem;color:var(--muted);font-size:.875rem;line-height:1.65}.collection-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-bottom:.85rem}.page-intro{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1rem;margin-bottom:1.25rem}.page-intro .intro{margin:0}.page-intro>.btn{margin-block:calc(-.45rem - 1px)}a{cursor:default}.loading-rows{border:1px solid var(--border);border-radius:var(--ui-radius, 10px);overflow:hidden}.loading-row{display:grid;align-content:center;gap:.6rem;min-height:4.25rem;padding:.85rem 1rem}.loading-row+.loading-row{border-top:1px solid var(--border)}.loading-row span{width:40%;height:.65rem;border-radius:3px;background:color-mix(in srgb,var(--muted) 15%,transparent)}.loading-row span+span{width:65%;height:.5rem}.dropzone{position:absolute;inset:.6rem;z-index:5;display:grid;place-items:center;border:2px dashed var(--accent);border-radius:var(--ui-radius, 10px);background:rgb(from var(--bg) r g b / .94);color:var(--accent);font-weight:600;pointer-events:none}.drop-card{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem;padding:.7rem .85rem;border:1px dashed color-mix(in srgb,var(--muted) 35%,var(--border));border-radius:var(--ui-radius, 8px);background:var(--panel)}.drop-icon{display:grid;place-items:center;flex-shrink:0;width:1.8rem;height:1.8rem;color:var(--muted)}.drop-icon svg{width:1.1rem;height:1.1rem}.drop-copy{min-width:0;display:flex;align-items:baseline;flex-wrap:wrap;gap:.2rem .6rem}.drop-copy strong{font-size:.8rem;font-weight:500}.drop-copy>span{color:var(--muted);font-size:.75rem}.drop-browse{min-width:7rem;margin-left:auto;flex-shrink:0}.content-hidden .filename,.content-hidden .report-name,.content-hidden .report-uploader{color:var(--muted)}.status{display:inline-flex;align-items:center;gap:.3rem;width:fit-content;padding:.1rem .4rem;border:1px solid var(--border);border-radius:5px;color:var(--muted);font-size:.65rem}.status:before{content:"";width:.25rem;height:.25rem;border-radius:50%;background:currentcolor}.status.visible{color:var(--green);border-color:rgb(from var(--green) r g b / .2);background:rgb(from var(--green) r g b / .06)}:host-context(body.theme-w95) *{overscroll-behavior:none}
|
|
2
|
+
`;export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e({importers:e={},packages:n={}},{name:r,versions:i=[]}){let a=new Map,o=new Map,s=new Map,c=[...Object.entries(e).map(([e,t])=>[`link:${e}`,t]),...Object.entries(n)];for(let[t,{name:n=``,version:r=``}]of c){let i=t.startsWith(`link:`)&&Object.hasOwn(e,t.slice(5));s.set(t,{id:t,name:i?t.slice(5)===`.`?`Project`:t.slice(5):n,ecosystem:i?``:`npm`,version:r,own:i,root:i})}let l=e=>s.has(e)?e:e.startsWith(`link:`)&&s.has(e.slice(5))?e.slice(5):null;for(let[e,{dependencies:t=[]}]of c)for(let n of t.map(l))n===null||n===e||((o.get(e)??o.set(e,new Set).get(e)).add(n),(a.get(n)??a.set(n,new Set).get(n)).add(e));return t(s,o,a,e=>e.name===r&&(i.length===0||i.includes(e.version)))}function t(e,t,n,r){let i=[];for(let t of e.values())!t.own&&r(t)&&(t.target=!0,i.push(t.id));let a=new Set(i),o=[...i];for(let e=0;e<o.length;e++)for(let t of n.get(o[e])??[])a.has(t)||(a.add(t),o.push(t));let s=e=>new Map([...a].map(t=>[t,new Set([...e.get(t)??[]].filter(e=>a.has(e)))]));return{nodes:new Map([...e].filter(([e])=>a.has(e))),imports:s(t),importedBy:s(n),targets:i}}export{e as a,t as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-QI66YA4F.js";import{C as t,H as n,J as r,K as i,L as a,R as o,a as s,c,d as l,e as u,g as d,h as f,i as p,m,p as h,u as ee}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as g,f as te,h as _,i as v,j as ne,m as re,n as ie}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var y=e=>e.replace(/^[ \t\n\r\0\v]+|[ \t\n\r\0\v]+$/gu,``),b=e=>e.replace(/[A-Z]+/gu,e=>e.toLowerCase()),x=e=>e===void 0||e===``||e===`0`,S=e=>e!==void 0&&e>=`0`&&e<=`9`,ae=e=>S(e)||/^[A-Za-z]$/u.test(e??``);function oe(e){let t=e[0];for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1],a=t.at(-1)===`.`?``:`.`;r===`-`||r===`_`||r===`+`?t+=a:!S(i)&&i!==`.`&&S(r)||S(i)&&!S(r)&&r!==`.`?t+=`${a}${r}`:ae(r)?t+=r:t+=a}return t.endsWith(`.`)?t.slice(0,-1):t}var se=[[`dev`,0],[`alpha`,1],[`a`,1],[`beta`,2],[`b`,2],[`RC`,3],[`rc`,3],[`#`,4],[`pl`,5],[`p`,5]],C=e=>se.find(([t])=>e.startsWith(t))?.[1]??-1,w=e=>e>0?1:e<0?-1:0,T=2n**63n-1n,ce=e=>e<=T&&e>=-T-1n,le=e=>{let t=BigInt(/^\d+/u.exec(e)[0]);return t>T?T:t};function ue(e,t){return S(e[0])&&S(t[0])?w(Number(le(e)-le(t))):!S(e[0])&&!S(t[0])?w(C(e)-C(t)):S(e[0])?w(C(`#N#`)-C(t)):w(C(e)-C(`#N#`))}var de=new TextEncoder,fe=e=>/^[\0-\u007F]*$/u.test(e)?e:String.fromCodePoint(...de.encode(e));function pe(e,t){if(e===``||t===``)return e===t?0:e===``?-1:1;let n=e[0]===`#`?e:oe(e),r=t[0]===`#`?t:oe(t),[i,a,o,s,c]=[0,0,0,0,0];for(;i<n.length&&a<r.length&&o!==-1&&s!==-1&&(o=n.indexOf(`.`,i),s=r.indexOf(`.`,a),c=ue(n.slice(i,o===-1?void 0:o),r.slice(a,s===-1?void 0:s)),c===0);)o!==-1&&(i=o+1),s!==-1&&(a=s+1);return c===0?o===-1?s===-1?0:S(r[a])?-1:pe(`#N#`,r.slice(a)):S(n[i])?1:pe(n.slice(i),`#N#`):c}var me=(e,t)=>pe(fe(e),fe(t)),he={"==":e=>e===0,"!=":e=>e!==0,"<":e=>e<0,"<=":e=>e<=0,">":e=>e>0,">=":e=>e>=0},ge=(e,t,n)=>he[n](me(e,t)),E=(t,n)=>w(e(t,n)),_e=/^[ \t\n\r\v\f]*[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[ \t\n\r\v\f]*$/u;function ve(e){if(!_e.test(e))return;let t=e.trim();if(!/[.eE]/u.test(t)){let e=BigInt(t);return ce(e)?{long:e}:{double:Number(t),overflow:e>0n?1:-1}}return{double:Number(t),overflow:0}}function ye(e,t){let n=ve(e),r=ve(t);return n===void 0||r===void 0||n.overflow!==void 0&&n.overflow!==0&&n.overflow===r.overflow&&n.double-r.double===0?E(e,t):n.double!==void 0||r.double!==void 0?n.double===void 0?r.overflow===0?w(Number(n.long)-r.double):-r.overflow:r.double===void 0?n.overflow===0?w(n.double-Number(r.long)):n.overflow:n.double===r.double&&!Number.isFinite(n.double)?E(e,t):w(n.double-r.double):w(Number(n.long-r.long))}var be=/^(?:0|-?[1-9]\d*)$/u;function xe(e){if(!be.test(e))return e;let t=BigInt(e);return ce(t)?t:e}function Se(e,t){let n=xe(e),r=xe(t);if(typeof n==`bigint`&&typeof r==`bigint`)return n>r?1:-1;if(typeof n==`string`&&typeof r==`string`)return ye(n,r);let[i,a,o]=typeof n==`bigint`?[n,r,1]:[r,n,-1],s=ve(a);return s?.long===void 0?s?.double===void 0?o*E(String(i),a):o*w(Number(i)-s.double):o*w(Number(i-s.long))}var D=511,Ce=new WeakMap,O=e=>Ce.get(e)??Object.keys(e),we=e=>c(e)&&O(e).length===0,Te=e=>e.every((e,t)=>e===String(t)),k=(e,t)=>{let n=1;for(let r=e.indexOf(`
|
|
2
2
|
`);r!==-1&&r<t;r=e.indexOf(`
|
|
3
3
|
`,r+1))n++;return n},A=(e,t,n=e.pos)=>ne(t,k(e.text,n)-1);function j(e){let{text:t,pos:n}=e;if(n>=t.length)return`the end of the file`;if(t[n]===`
|
|
4
4
|
`)return`an LF line end`;if(t.startsWith(`\r
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as e,c as t,r as n,w as r}from"./chunk-
|
|
1
|
+
import{b as e,c as t,r as n,w as r}from"./chunk-5YP7P5KA.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
|
|
2
2
|
`,workspace:`deepview/finding-link/workspace/v1
|
|
3
3
|
`},d=new Map;function f(e,t){return`${e}\0${t}`}function p(e){return typeof e==`string`&&s.test(e)}async function m(e,t){let n=u[e];if(!n||typeof t!=`string`||!t)return null;let r=f(e,t),o=d.get(r);if(o!==void 0)return o;let s;try{let e=await crypto.subtle.digest(`SHA-256`,i(n+t));s=new Uint8Array(e).slice(0,a).toBase64({alphabet:`base64url`,omitPadding:!0})}catch{return null}return d.set(r,s),s}function h(e,t){return typeof t!=`string`||!t?null:d.get(f(e,t))??null}function g(e,t){let n=[];for(let[r,i]of[[`report`,e],[`workspace`,t]])if(i==null||i===``)n.push(l);else{if(!p(i))throw TypeError(`encodeFindingRef: ${r} must be a link hint token, not a name`);n.push(i)}return n.every(e=>e===l)?null:n[0]===l?`w${n[1]}`:n.join(``)}function _(e){let t=[e.slice(0,o),e.slice(o)].map(e=>e===l?null:e);return{report:t[0],workspace:t[1]}}function v({id:e,report:n,workspace:r}={}){if(!t(e))throw TypeError(`encodeFindingRef: a persistent finding id is required`);let i=[`finding=${encodeURIComponent(e)}`],a=g(n,r);return a&&i.push(`v=${a}`),i.join(`&`)}function y(e,t){let n=v(e);return typeof location>`u`?`${t??``}#${n}`:`${location.origin}${t??location.pathname}#${n}`}function b(n){let r=typeof n==`string`?n:typeof location>`u`?``:location.hash;if(!r)return null;let i=r.replace(/^#/u,``);if(!i)return null;let a={id:null,report:null,workspace:null};for(let n of i.split(`&`)){let r=n.indexOf(`=`);if(r<0)continue;let i=n.slice(0,r),o=n.slice(r+1);if(!o)continue;if(i===`v`){if(o.length===5&&o[0]===`w`&&p(o.slice(1))){let e=o.slice(1);Object.assign(a,{report:null,workspace:e===l?null:e});continue}if(!c.test(o))continue;Object.assign(a,_(o));continue}if(i!==`finding`||o.length>e*3)continue;let s;try{s=decodeURIComponent(o)}catch{continue}t(s)&&(a.id=s)}return a.id?a:null}function x(e,{managed:t=!1}={}){if(typeof location>`u`)return null;let i;try{i=new URL(e)}catch{return null}if(i.href!==e||i.protocol!==location.protocol||i.host!==location.host||i.username||i.password)return null;let a=r(i);if(a?.finding)return{id:a.finding.id,fragment:v(a.finding),path:n(a)};if(t&&a?.view!==`home`&&!/\/(?:index|view)\.html$/u.test(i.pathname))return null;let o=b(i.hash);if(!o)return null;let s=v(o);return{id:o.id,fragment:s,path:`/#${s}`}}function S(e,t){if(typeof e!=`string`)return!1;let n=e.replaceAll(`\\`,`/`);return n.startsWith(`${t}/`)||n.includes(`/${t}/`)}function C(e){let t=!1;for(let n of e){for(let e of n.groups??[])for(let n of e){if(S(n.file,`node_modules`))return`node_modules`;S(n.file,`vendor`)&&(t=!0)}let e=n.tree?w(n.tree):n.treeDependencies;if(e===`node_modules`)return`node_modules`;e===`vendor`&&(t=!0)}return t?`vendor`:`dependencies`}function w(e){let t=!1;for(let n of Object.keys(e??{})){if(S(n,`node_modules`))return`node_modules`;S(n,`vendor`)&&(t=!0)}return t?`vendor`:null}export{S as a,C as b,m as c,h as d,v as e,y as f,b as g,x as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,b as t,c as n,d as r,e as i,f as a}from"./chunk-
|
|
1
|
+
import{a as e,b as t,c as n,d as r,e as i,f as a}from"./chunk-WCDYSIKG.js";import{a as o}from"./chunk-QI66YA4F.js";import{C as s,H as c,K as l,L as u,Q as d,m as f}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import"./chunk-PXK7EU4V.js";import{d as p,h as m,i as h,j as g,k as ee,p as te,r as ne,s as _}from"./chunk-7HP2VYIC.js";import"./chunk-OOJM4CTU.js";var re=e=>/^[A-Za-z\d][\w.-]*$/u.test(e)&&/[A-Za-z]/u.test(e);function ie(e){let t=e.split(`-`);for(;t.at(-1)===``;)t.pop();return t}var v=()=>{},ae={3:[[/aix(\d+)?/u,`aix`],[/cygwin/u,`cygwin`,v],[/darwin(\d+)?/u,`darwin`],[/^macruby$/u,`macruby`,v],[/freebsd(\d+)?/u,`freebsd`],[/^(?:java|jruby)$/u,`java`,v],[/^java([\d.]*)/u,`java`],[/^dalvik(\d+)?$/u,`dalvik`],[/^dotnet$/u,`dotnet`,v],[/^dotnet([\d.]*)/u,`dotnet`],[/linux-?(\w+)?/u,`linux`],[/mingw32/u,`mingw32`,v],[/mingw-?(\w+)?/u,`mingw`],[/(mswin\d+)(_(\d+))?/u,void 0,e=>e[3]],[/netbsdelf/u,`netbsdelf`,v],[/openbsd(\d+\.\d+)?/u,`openbsd`],[/solaris(\d+\.\d+)?/u,`solaris`],[/wasi/u,`wasi`,v],[/^(\w+_platform)(\d+)?/u,void 0,e=>e[2]]],4:[[/aix-?(\d+)?/u,`aix`],[/cygwin/u,`cygwin`,v],[/darwin-?(\d+)?/u,`darwin`],[/^macruby$/u,`macruby`,v],[/^macruby-?(\d+(?:\.\d+)*)?/u,`macruby`],[/freebsd-?(\d+)?/u,`freebsd`],[/^(?:java|jruby)$/u,`java`,v],[/^java-?(\d+(?:\.\d+)*)?/u,`java`],[/^dalvik-?(\d+)?$/u,`dalvik`],[/^dotnet$/u,`dotnet`,v],[/^dotnet-?(\d+(?:\.\d+)*)?/u,`dotnet`],[/linux-?(\w+)?/u,`linux`],[/mingw32/u,`mingw32`,v],[/mingw-?(\w+)?/u,`mingw`],[/(mswin\d+)(?:[_-](\d+))?/u,void 0,e=>e[2]],[/netbsdelf/u,`netbsdelf`,v],[/openbsd-?(\d+\.\d+)?/u,`openbsd`],[/solaris-?(\d+\.\d+)?/u,`solaris`],[/wasi/u,`wasi`,v],[/^(\w+_platform)-?(\d+)?/u,void 0,e=>e[2]]]};function oe(e,t){if(e===void 0)return[`unknown`,void 0,void 0];for(let[n,r,i=e=>e[1]]of ae[t]){let t=n.exec(e);if(t===null)continue;let a=r??t[1];return[a,i(t),/^mswin\d*32$/u.test(a)?`x86`:void 0]}return[`unknown`,void 0,void 0]}function y(e){let t=ie(e);if(t.length>2&&!/\d$/u.test(t.at(-1))){let e=t.pop();t[t.length-1]+=`-${e}`}let n=t.shift();return t.length===2&&/^\d+(?:\.\d+)?$/u.test(t[1])?{cpu:n,os:t[0],version:t[1]}:{cpu:n,os:t[0]}}function b(e){let t=e.length;for(;e[t-1]===`-`;)t--;let n=e.slice(0,t),r=n.indexOf(`-`);return r===-1?{cpu:n||void 0}:{cpu:n.slice(0,r),os:n.slice(r+1)}}function x(e,t){let{cpu:n,os:r,version:i}=t===3?y(e):b(e),a=n!==void 0&&/i\d86/u.test(n)?`x86`:n;if(i!==void 0)return[a,r,i];let[o,s,c]=oe(r??n,t);return[r===void 0?c:a,o,s]}function S(e,t){let n=x(e,t);return n.filter(e=>e!==void 0).join(t===4&&n[0]===void 0?``:`-`)}var C=e=>e!==`ruby`&&e!==`current`&&/^[\w.-]+$/u.test(e)&&S(e,3)===e&&S(e,4)===e;function w(e){let t=e?.replace(/^gnu/u,``).replace(/eabi(?:hf)?$/u,``);return t===``?void 0:t}var T=Symbol(`all`),E=Symbol(`arm`);function se(e){let t=new Map;for(let n of e){if(n===`ruby`)continue;let[e,r,i]=x(n,3),a=t.get(r)??t.set(r,new Map).get(r);for(let t of[e,T,...e?.startsWith(`arm`)?[E]:[]]){let e=a.get(t)??a.set(t,{versions:new Set,libcs:new Set}).get(t);e.versions.add(i),e.libcs.add(w(i))}}return t}function ce(e,t,n){return e===void 0?!1:n===void 0||e.versions.has(void 0)||e.versions.has(n)?!0:t===`linux`&&(e.libcs.has(w(n))||[`musl`,`musleabi`,`musleabihf`].some(t=>e.versions.has(`${t}${n}`)))}function le(e,t){if(t===`java`||t===`mswin64`)return[void 0,t];if(t===`mswin32`&&e===`x86`)return[e,t];if(t===`mingw32`)return[e===`universal`||e===`x64`?e:e===`x86_64`?`x64`:`x86`,t]}function D(e,t,n,r){let i=e.get(n),a=t===void 0||t===`universal`?[T]:[t,void 0,`universal`,...t===`arm`?[E]:[]];return i!==void 0&&a.some(e=>ce(i.get(e),n,r))?!0:n.startsWith(`mingw`)&&[`mingw`,`mingw32`].some(n=>e.get(n)?.has(t===`universal`?T:`universal`))}function ue(e,t){let[n,r,i]=x(t,3),a=le(n,r);return D(e,n,r,i)||a!==void 0&&D(e,...a,void 0)}var de={GIT:{order:[`remote`,`revision`,`ref`,`branch`,`tag`,`submodules`,`glob`],required:2},PATH:{order:[`remote`,`glob`],required:1},GEM:{order:[`remote`],required:0}},fe=`{,*,*/*}.gemspec`;function pe({type:e,number:t,options:n}){let{order:r,required:i}=de[e],a=Object.create(null),o=0;for(let{key:t,value:i,number:s}of n){let n=r.indexOf(t);if(n===-1)throw g(`${m(t)} is not an option Bundler writes for a ${e} source`,s);if(t in a)throw g(e===`GEM`?`a second remote: Bundler fetches each gem of the source from either, and the lockfile does not say which`:`a second ${t}`,s);if(n<o)throw g(`${t} after ${r[o-1]}, where Bundler writes it before`,s);if(i.trim()!==i)throw g(`${m(i)} has a space at an end, which no ${t} Bundler writes has`,s);o=n+1,a[t]=i}let s=r.slice(0,i).find(e=>!(e in a));if(s!==void 0)throw g(`a ${e} source without its ${s}`,t);return a}var O=/\\|(?:^|[/{,])\.\.(?=$|[/},])|(?:^|[{,])(?:\/|[A-Za-z]:)/u;function k(e,t){if(e===fe)throw new p(`${m(e)}, which Bundler reads by where none is written, and does not write`,t);if(e!==void 0&&O.test(e))throw new p(`${m(e)} reaches out of the source, which Bundler globs its gemspecs from`,t);return e}function A(e,t){let{remote:n}=e;if(n.endsWith(`/`))throw new p(`${m(n)} ends in "/", which Bundler 2.4 and later drop as they read it, and 2.2 and 2.3 keep`,h(t,`remote`));u(n,h(t,`remote`));let{revision:r,ref:i}=e;if(!c(r))throw new p(`${m(r)} is not a full commit hash`,h(t,`revision`));if(i!==void 0&&/\s/u.test(i))throw new p(`${m(i)} is not a reference git reads`,h(t,`ref`));if(i?.startsWith(`-`))throw new p(`${m(i)} starts with "-", which git reads as an option`,h(t,`ref`));if(i!==void 0&&c(i)&&i!==r)throw new p(`the commit ${i}, and the revision another`,h(t,`ref`));if(e.submodules!==void 0&&e.submodules!==`true`)throw new p(`expected "true", found ${m(e.submodules)}`,h(t,`submodules`));return{type:`git`,remote:n,revision:r,ref:i,branch:f(e,`branch`,t,l),tag:f(e,`tag`,t,l),submodules:e.submodules===`true`,glob:k(e.glob,h(t,`glob`))}}function j(e,t){let n=h(t,`path`);if(e.remote.startsWith(`/`))throw new p(`${m(e.remote)} is an absolute path, which is the path on one machine alone`,n);if(e.remote.startsWith(`~`))throw new p(`${m(e.remote)} is a path from a home directory, which Bundler writes from the lockfile's`,n);return{type:`path`,path:s(e.remote,n),glob:k(e.glob,h(t,`glob`))}}function M(e){let t=URL.parse(e);return t!==null&&t.href===e&&(t.protocol===`file:`?t.host===``:t.protocol===`s3:`&&t.host!==``)}function N(e,t){let{remote:n}=e;if(n===void 0)return{type:`gem`,remote:n};if(!d(n)&&!M(n))throw new p(`${m(n)} is not an http(s) URL, or a file: or s3: URL in normal form`,h(t,`remote`));if(!n.endsWith(`/`))throw new p(`${m(n)} does not end in "/", as Bundler writes a source`,h(t,`remote`));return{type:`gem`,remote:n}}var P={GIT:A,PATH:j,GEM:N};function F(e){if(e.type===`gem`)return;if(e.type===`path`)return`source at \`${e.path}\``;let t=/^([A-Za-z][\w+.-]*):\/\/([^/]*)/u.exec(e.remote);return t!==null&&(/[A-Z]/u.test(t[1])||t[2].includes(`@`))?void 0:`${e.remote} (`}var I=e=>`the ${e.type} source ${m(e.remote??e.path)}`;function L(e,t){let n;for(let[r,i]of e.entries()){let e=F(i);if(e!==void 0){if(n!==void 0&&o(e,n.key)<0)throw g(`${I(i)} after ${I(n.source)}, where Bundler sorts them the other way`,t[r].number);n={key:e,source:i}}}}function R(e,t){let n=e.findIndex(e=>e.type===`gem`);if(n===-1)throw new p(`no GEM source, which Bundler always writes`);let r=e[n].remote===void 0,i=e.findIndex((e,t)=>t>n&&e.type===`gem`&&e.remote===void 0);if(i!==-1)throw g(r?`a second GEM source of no remote, where Bundler writes one, the Gemfile's own`:`a GEM source of no remote after one of a remote, where Bundler writes it first`,t[i].number);return r?n:-1}function z(e){let t=e.map((e,t)=>P[e.type](pe(e),`sources[${t}]`));return L(t,e),{sources:t,local:R(t,e)}}var B=/<<<<<<<|=======|>>>>>>>|\|{7}/u,me=new Set([`GIT`,`PATH`,`GEM`]),V={PLATFORMS:[2],DEPENDENCIES:[2],CHECKSUMS:[2],"RUBY VERSION":[2,3],"BUNDLED WITH":[2,3]},H=Object.keys(V);function U(e,t,n){let r=te(e);if(!t.includes(r))throw g(`expected ${t.join(` or `)} spaces of indentation, found ${r}`,n);return e.slice(r)}var he=/^([^\s()]+) \(([^\s()]+)\)(?: (\S+))?$/u;function W(e,t,n){let r=he.exec(e);if(r===null||!n&&r[3]!==void 0)throw g(`expected a gem as "name (version)", found ${m(e)}`,t);let[,i,a,o]=r,s=a.indexOf(`-`);return{name:i,version:s===-1?a:a.slice(0,s),platform:s===-1?void 0:a.slice(s+1),checksum:o,number:t}}var ge=/^([^\s()!]+)(?: \(([^()]+)\))?(!)?$/u;function G(e,t,n){let r=ge.exec(e);if(r===null||!n&&r[3]!==void 0)throw g(`expected a dependency as "name" or "name (requirement)", found ${m(e)}`,t);return{name:r[1],requirements:r[2]?.split(`, `)??[],pinned:r[3]!==void 0}}var _e=/^ {2}([a-z]+): (.+)$/u;function ve(e){let{line:t,number:n}=e,r=[];for(_(e);;_(e)){let t=_e.exec(e.line??``);if(t===null)break;r.push({key:t[1],value:t[2],number:e.number})}if(e.line!==` specs:`)throw g(`expected an option, "key: value", or "specs:", two spaces in, found ${e.line===void 0?`the end of the file`:m(e.line)}`,e.number);let i=[];for(_(e);e.line?.startsWith(` `);_(e)){let t=U(e.line,[4,6],e.number);if(e.line.length-t.length===4)i.push({...W(t,e.number,!1),dependencies:[]});else{if(i.length===0)throw g(`a dependency before any spec`,e.number);i.at(-1).dependencies.push(G(t,e.number,!1))}}return{type:t,number:n,options:r,specs:i}}function ye(e,t){let n=[];for(_(e);e.line?.startsWith(` `);_(e)){let r=U(e.line,t,e.number);n.push({text:r,indent:e.line.length-r.length,number:e.number})}return n}function be(e){let[t,n]=[`RUBY VERSION`,`BUNDLED WITH`].map(t=>e.get(t)?.lines[0]);if(t!==void 0&&n!==void 0&&t.indent!==n.indent)throw g(`${t.indent} spaces of indentation, and ${n.indent} under BUNDLED WITH`,t.number)}function xe(e){let t=B.exec(e)?.[0];if(t!==void 0)throw new p(`${m(t)}, which Bundler reads as a merge conflict`);if(e===``)throw new p(`an empty lockfile, which Bundler reads as none`);if(!e.endsWith(`
|
|
2
2
|
`))throw new p(`no line end after the last line, where Bundler ends every line`);let n=ne(e,ee),r=[],i=new Map,a;for(_(n);n.line!==void 0;){let{line:e,number:t}=n;if(e===``||e.startsWith(` `))throw g(e===``?`a blank line, where Bundler writes one between sections alone`:`expected a section, at column 0`,t);if(e===`PLUGIN SOURCE`)throw g(`a plugin source, which only its plugin can read, and which is not read here`,t);if(me.has(e)){if(a!==void 0)throw g(`a ${e} source after ${a}, where Bundler writes the sources first`,t);if(e!==`GEM`&&r.at(-1)?.type===`GEM`)throw g(`a ${e} source after a GEM one, where Bundler writes the GEM sources last`,t);r.push(ve(n))}else{let r=H.indexOf(e);if(r===-1)throw g(`${m(e)} is not a section Bundler writes`,t);if(i.has(e))throw g(`a second ${e}`,t);if(r<H.indexOf(a))throw g(`${e} after ${a}, where Bundler writes it before`,t);a=e,i.set(e,{number:t,lines:ye(n,V[e])})}if(n.line===void 0)break;if(n.line!==``)throw g(`expected a blank line before ${m(n.line)}`,n.number);if(_(n),n.line===void 0)throw g(`a blank line at the end, where Bundler writes none`,n.number)}return be(i),{sources:r,sections:i}}function K(e,t){if(!re(e))throw new p(`${m(e)} is not a gem name`,t);return e}var q=({name:e,version:t,platform:n=`ruby`})=>n===`ruby`?`${e}-${t}`:`${e}-${t}-${n}`;function J({name:t,version:n,platform:r},i){if(K(t,i),!e(n))throw new p(`${m(n)} is not a version as RubyGems writes one`,i);if(r===`ruby`)throw new p(`the platform ruby, which Bundler leaves out of a gem of no platform`,i);if(r!==void 0&&!C(r))throw new p(`${m(r)} is not a platform as RubyGems writes one`,i);return{name:t,version:n,platform:r??`ruby`}}function Se(e,r){for(let[t,i]of e.entries()){if(n(i)===void 0)throw new p(`${m(i)} is not a requirement as Bundler writes one, "op version"`,r);if(t>0&&i>e[t-1])throw new p(`${m(i)} after ${m(e[t-1])}, where Bundler sorts them backwards`,r)}let[i]=e;if(e.length===1&&i.startsWith(`>= `)&&t(i.slice(3),`0`)===0)throw new p(`${m(i)}, which Bundler leaves out, as any version`,r);return e}function Y(e,t,n,r=e=>e){let i=Object.create(null),a;for(let o of e){let e=h(t,o.name);if(K(o.name,e),a!==void 0&&o.name<=a)throw new p(`${o.name===a?`listed twice`:`after ${m(a)}`}, where Bundler sorts ${n} by name`,e);a=o.name,i[o.name]=r(Se(o.requirements,e),o)}return i}function Ce(e,t){let n=Object.create(null);for(let[r,{specs:i}]of e.entries()){let e;for(let a of i){let i=q(a),o=h(`specs`,i),{name:s,version:c,platform:l}=J(a,o);if(s===`bundler`)throw new p(`Bundler itself, which Bundler leaves out of the sources`,o);if(i in n)throw new p(`listed twice, of which Bundler keeps the last alone, at line ${a.number+1}`,o);if(e!==void 0&&i<e)throw new p(`after ${m(e)}, where Bundler sorts a source's gems by full name`,o);if(e=i,r===t)throw new p(`from sources[${r}], which has no remote: Bundler takes it from the gems installed where it runs`,o);n[i]={name:s,version:c,platform:l,source:r,dependencies:Y(a.dependencies,h(o,`dependencies`),`a gem's dependencies`),checksum:void 0}}}return n}var we=/^sha256=[\da-f]{64}$/u;function X(e,t){if(!we.test(e))throw new p(`${m(e)} is not a checksum as Bundler writes one, "sha256=" and the hex digest`,t);return e}function Te(e,t,n){let r,i,a=new Set;for(let{text:o,number:s}of e){if(i!==void 0&&o<=i)throw g(`${m(o)} after ${m(i)}, where Bundler sorts the checksums, each once`,s);i=o;let e=W(o,s,!0);if(e.name===`bundler`&&e.platform===void 0&&r===void 0){let{version:t}=J(e,`bundlerChecksum`);if(e.checksum===void 0)throw g(`Bundler itself, without the checksum Bundler writes it with`,s);r={version:t,checksum:X(e.checksum,h(`bundlerChecksum`,`checksum`))};continue}let c=q(e),l=m(o.split(` `,2).join(` `));if(!(c in t))throw g(`${l} is no gem of the sources`,s);if(a.has(c))throw g(`${l} a second time, where Bundler lists each gem once`,s);a.add(c);let u=t[c];if(e.checksum===void 0)continue;let d=h(h(`specs`,c),`checksum`);if(n[u.source].type!==`gem`)throw new p(`a checksum of a gem from a ${n[u.source].type} source, which has no .gem to check`,d);u.checksum=X(e.checksum,d)}let o=Object.keys(t).find(e=>!a.has(e));if(o!==void 0)throw new p(`not in CHECKSUMS, where Bundler lists every gem`,h(`specs`,o));return r}function Z(e,t){let n=e.get(t);if(n===void 0)throw new p(`no ${t}, which Bundler always writes`);return n}function Ee(e){let t=e.lines.map(({text:e})=>e);if(t.length===0)throw g(`no platform under PLATFORMS`,e.number);for(let[e,n]of t.entries()){let r=`platforms[${e}]`;if(n!==`ruby`&&!C(n))throw new p(`${m(n)} is not a platform as RubyGems writes one`,r);if(e>0&&n<=t[e-1])throw new p(`${m(n)} after ${m(t[e-1])}, where Bundler sorts the platforms, each once`,r)}return t}function De(e,t){let n=se(t);for(let[t,{platform:r}]of Object.entries(e))if(r!==`ruby`&&!ue(n,r))throw new p(`of the platform ${m(r)}, which no platform of PLATFORMS takes, where Bundler locks a gem for one`,h(`specs`,t))}function Oe(e){return Y(e.lines.map(({text:e,number:t})=>G(e,t,!0)),`dependencies`,`the dependencies`,(e,{pinned:t})=>({requirements:e,pinned:t}))}var ke=/^ruby \d+\.\d+\.\d+(?:\.[\dA-Za-z]+)*(?:p(?:-1|0|[1-9]\d*))?(?: \((?!ruby )[\w.-]+ [\w.-]+\))?$/u;function Ae(e,t){if(e.lines.length!==1)throw g(`expected one line under ${t}, found ${e.lines.length}`,e.number);return e.lines[0].text}var je=/^(?:2\.[2-7]|4\.0)\./u;function Q(t){let[n,r]=[`RUBY VERSION`,`BUNDLED WITH`].map(e=>t.has(e)?Ae(t.get(e),e):void 0);if(n!==void 0&&!ke.test(n))throw new p(`${m(n)} is not a Ruby as Bundler writes one, "ruby 3.3.6p108"`,`rubyVersion`);if(r!==void 0&&!e(r))throw new p(`${m(r)} is not a version as RubyGems writes one`,`bundledWith`);if(r!==void 0&&!je.test(r))throw new p(`${m(r)} is not a version of Bundler from 2.2 to 4.0, which this reader reads`,`bundledWith`);return{rubyVersion:n,bundledWith:r}}function Me(e){let t=Object.create(null),n=new Map;for(let[r,i]of Object.entries(e)){let a=t[i.name]??=[],[o]=a;if(o!==void 0&&e[o].source!==i.source)throw new p(`from sources[${i.source}], and ${m(o)} from sources[${e[o].source}], where Bundler takes a gem from one source`,h(`specs`,r));let s=n.get(`${i.name} ${i.platform}`);if(s!==void 0)throw new p(`for the platform of ${m(s)}, where Bundler locks one version of a gem for each`,h(`specs`,r));n.set(`${i.name} ${i.platform}`,r),a.push(r)}return t}function Ne({specs:e,gems:t,dependencies:n,sources:r,local:i}){let a;for(let[o,{pinned:s}]of Object.entries(n)){if(s||t[o]===void 0)continue;let n=h(`dependencies`,o),c=e[t[o][0]].source,{type:l}=r[c];if(l===`git`)throw new p(`from a git source, without the "!" Bundler writes of it`,n);if(l===`gem`&&i!==-1)throw new p(`from sources[${c}], where Bundler takes what the Gemfile names no source of from its default, sources[${i}], of no remote`,n);if(a??={name:o,index:c},c!==a.index)throw new p(`from sources[${c}], and ${m(a.name)} from sources[${a.index}], where Bundler takes what the Gemfile names no source of from its default alone`,n)}}function $(e,t,{specs:i,gems:o,versions:s},c){let l=s.get(e);if(!(l===void 0||t.every(e=>a(l,n(e)))))for(let a of o[e]){let e=t.find(e=>!r(i[a].version,n(e)));if(e!==void 0)throw new p(`${m(e)} is not met by ${m(a)}`,c)}}function Pe({specs:e,gems:t,dependencies:n}){let r={specs:e,gems:t,versions:new Map(Object.entries(t).map(([t,n])=>[t,i(n.map(t=>e[t].version))]))},a=new Set,o=[],s=e=>{e in t&&!a.has(e)&&o.push(e),a.add(e)};for(let[e,{requirements:t}]of Object.entries(n))$(e,t,r,h(`dependencies`,e)),s(e);for(;o.length>0;)for(let n of t[o.pop()]){let i=h(h(`specs`,n),`dependencies`);for(let[a,o]of Object.entries(e[n].dependencies)){let e=h(i,a);if(a!==`bundler`&&!(a in t))throw new p(`names no gem of the sources`,e);$(a,o,r,e),s(a)}}let c=Object.keys(t).find(e=>!a.has(e));if(c!==void 0)throw new p(`nothing depends on it, and Bundler locks what it resolves alone`,h(`specs`,t[c][0]))}function Fe(e){if(typeof e!=`string`)throw TypeError(`expected a string`);let{sources:t,sections:n}=xe(e),{sources:r,local:i}=z(t),a=Ce(t,i),o=Ee(Z(n,`PLATFORMS`));De(a,o);let s=Oe(Z(n,`DEPENDENCIES`)),c=Me(a);Ne({sources:r,local:i,specs:a,gems:c,dependencies:s}),Pe({specs:a,gems:c,dependencies:s});let l=n.get(`CHECKSUMS`),u=l===void 0?void 0:Te(l.lines,a,r);return{sources:r,specs:a,gems:c,platforms:o,dependencies:s,checksums:l!==void 0,bundlerChecksum:u,...Q(n)}}export{p as LockfileError,Fe as parseGemfileLock};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Mf as e,Of as t,Qf as n,oe as r,pe as i,qa as a}from"./chunk-ESJZZF2Y.js";import{a as o}from"./chunk-DQJEVHRE.js";import{c as s,d as c,g as l}from"./chunk-2XUEZHIP.js";var u=e(c`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`),d=e(c`<circle class="fill" cx="8" cy="8" r="3"/>`),f=e(c`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`),p=e(c`<circle class="dotted" cx="8" cy="8" r="5.5"/>`),m=e(c`<path d="M2.6 3.2h7.6v5.3H6.3L4 10.4V8.5H2.6z"/><path d="M12.2 6.2h1.2v5.3H12v1.9l-2.3-1.9H7"/>`),h={approved:[`approved`,n.approved[1],`Approved`],changes:[`changes`,n.changes[1],`Changes requested`],commented:[`commented`,t,`Commented`],dismissed:[`dismissed`,t,`Review dismissed`]},g={done:[`reviewed`,u,`Reviewed`],running:[`running`,d,`Reviewing`],failed:[`failed`,f,`Review failed`],requested:[`requested`,p,`Asked to review again`]},_=[`requested`,p,`Review requested`],v=e=>e.slice(0,7),y=e=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),b=(e,t,n=!1)=>`${e.toLocaleString(`en-US`)}${n?`+`:``} ${t}${e===1&&!n?``:`s`}`;function x(e){return e?e.failed?g.failed:e.requested?g.requested:g[e.code?.status]??null:null}function S(e){let t=x(e.codex),n=e.codex?.code?.commit??null;return[...t?[{who:a(e.codex.login,`Codex`),standing:t,commit:n,stale:n!==null&&n!==e.head}]:[],...e.reviewers.map(t=>({who:a(t.login,t.login??`someone`),standing:h[t.state]??_,requested:t.requested&&!!h[t.state],workflow:t.workflow??null,commit:t.commit,at:t.at,stale:t.commit!==null&&t.commit!==e.head}))]}var C=e=>(e.moreReviews??0)+(e.moreRequests??0),w=e=>[e.moreReviews>0?b(e.moreReviews,`more review`):null,e.moreRequests>0?b(e.moreRequests,`more review request`):null].filter(Boolean).join(` and `);function T(e){if(!e.head)return!0;let t=e.codex?.code;return t?.status===`done`&&t.commit===e.head||e.reviewers.some(t=>h[t.state]&&t.state!==`dismissed`&&t.commit===e.head)?!0:e.moreReviews>0&&null}var E=e=>e?s`<span class="${`review-severity is-${e}`}">${e.toUpperCase()}</span>`:l;function D(e){if(!e)return l;let t=S(e),{open:n,more:r,severity:i}=e.threads,a=n>0?`${b(n,`open review thread`,r)}${i?`, the gravest ${i.toUpperCase()}`:``}`:r?`No open review thread among those read; more on GitHub`:null,o=T(e);return s`<span class="issue-reviews">${t.map(({who:e,standing:[t,n,r],commit:i,stale:a,requested:o})=>{let c=`${r}${o?`, and requested again`:``}${a?`, on an earlier commit (${v(i)})`:i?`, on the latest commit`:``}`;return s`<span class="${`review-mark is-${t}${a?` is-stale`:``}`}"><span class="review-glyph" role="img" aria-label="${c}" data-tooltip="${c}">${n}</span><span class="review-who">${e}</span></span>`})} ${C(e)>0?s`<span class="review-more" data-tooltip="${`${w(e)}, on GitHub`}">+${C(e)}</span>`:l} ${a?s`<span class="review-threads" role="img" aria-label="${a}" data-tooltip="${a}">${m}<span>${n}${r?`+`:``}</span>${E(i)}</span>`:l} ${o===!1?s`<span class="review-unreviewed" data-tooltip="${t.length>0?`No review is on the latest commit`:`No reviews yet`}">Unreviewed</span>`:o===null?s`<span class="review-unreviewed" data-tooltip="No review read is on the latest commit; more on GitHub">Unreviewed?</span>`:l}</span>`}function O(e,t,n){if(!e)return l;let r=s`<code>${v(e)}</code>`;return s`<span class="review-on">on ${n?s`<a href="${`https://github.com/${n}/commit/${e}`}" target="_blank" rel="noopener noreferrer">${r}</a>`:r}${e===t?`, the latest commit`:`, an earlier commit`}</span>`}function k(e,t){if(!e)return l;let{head:n,codex:r}=e,i=(e,[i,o,c],l)=>s`<li class="review-row">${a(r.login,`Codex`)} <span class="${`review-state is-${i}`}">${o}${l}: ${c.toLowerCase()}</span>${O(e.commit,n,t)}</li>`,o=[...r?.code?[i(r.code,x(r)??g.done,`Code review`)]:[],...r?.security?[i(r.security,g[r.security.status]??g.done,`Security review`)]:[],...S({...e,codex:null}).map(({who:e,standing:[r,i,a],commit:o,at:c,requested:u,workflow:d})=>s`<li class="review-row">${e} <span class="${`review-state is-${r}`}">${i}${a}${u?`, requested again`:``}</span>${d?s`<span class="review-on">by the workflow <code>${d}</code></span>`:l}${O(o,n,t)}${c?s`<time datetime="${new Date(c).toISOString()}">${y(c)}</time>`:l}</li>`)],{open:c,resolved:u,more:d,list:f=[]}=e.threads;return s`<section class="repo-item-section"><h4>Reviews</h4>${o.length>0?s`<ul>${o}</ul>`:s`<p class="repo-item-quiet">No reviews yet.</p>`} ${C(e)>0?s`<p class="repo-item-quiet">And ${w(e)}, on GitHub.</p>`:l} ${T(e)===null?s`<p class="repo-item-quiet">No review read is on the latest commit, <code>${v(n)}</code>; one of those on GitHub may be.</p>`:o.length>0&&!T(e)?s`<p class="repo-item-quiet">No review is on the latest commit, <code>${v(n)}</code>.</p>`:l}</section>${c>0||u>0?s`<section class="repo-item-section"><h4>Open threads</h4>${f.length>0?s`<ul>${f.map(e=>s`<li><a class="repo-item-row review-thread" href="${e.url??l}" target="_blank" rel="noopener noreferrer">${E(e.severity)}<span class="repo-item-title">${e.title||`(no comment)`}</span> ${e.path?s`<code class="review-path">${e.path}${e.line?`:${e.line}`:``}</code>`:l} ${e.outdated?s`<span class="repo-item-quiet">outdated</span>`:l}</a></li>`)}</ul>`:s`<p class="repo-item-quiet">${d?`None open among those read.`:`None open.`}</p>`} ${u>0||d?s`<p class="repo-item-quiet">${u>0?`${b(u,`thread`)} resolved`:``}${d?`${u>0?`; `:``}more on GitHub`:``}.</p>`:l}</section>`:l}`}var A=o({items:new Map,changes:0}),j=i(A.items),M=(e,t,n)=>`${e}\0${t}\0${n}`,N=e=>Number.isSafeInteger(e?.readAt)&&e.readAt>0?e.readAt:Date.now();function P(e,t,n,i=null){j();let a=r(),o=!1;for(let r of t){let t=M(a,e,r.number),s=A.items.get(t);if(s&&s.readAt>n)continue;let c=s&&R(s.item),l=!c||c===R(r)?s?.moved??null:{from:c,before:s.readAt};A.items.set(t,{item:{...r,kind:r.kind??i??s?.item.kind??null},readAt:n,moved:l}),o=!0}o&&A.changes++}var F=(e,t)=>A.items.get(M(r(),e,t))??null;function I(e,t){let n=M(r(),e,``);return A.changes,[...A.items].flatMap(([e,r])=>e.startsWith(n)&&r.item.kind===t?[r]:[])}var L=()=>A.changes,R=e=>e.state===`open`?`open`:`closed`;function z(e,t){let n=R(e.item);if(e.readAt<=t||!e.moved)return n;if(e.moved.before>=t)return e.moved.from;let r=e.item.closedAt??e.item.mergedAt??null;return n===`closed`&&r!==null&&r>t?e.moved.from:n}export{D as a,k as b,N as c,P as d,F as e,I as f,L as g,R as h,z as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,i as t,j as n}from"./chunk-
|
|
1
|
+
import{f as e,i as t,j as n}from"./chunk-GX5UXWT4.js";import{C as r,D as i,Q as a,s as o}from"./chunk-LVW7WWV4.js";import{d as s,f as c,h as l}from"./chunk-7HP2VYIC.js";var u=`[0-9]+`,d=`[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(${u})?`,f=`-(${u})|[-_.]?(post|rev|r)[-_.]?(${u})?`,p=`[-_.]?dev[-_.]?(${u})?`,ee=RegExp(`^v?(?:(${u})!)?(${u}(?:\\.${u})*)(?:${d})?(?:${f})?(?:(${p}))?(?:\\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$`,`iu`),m={__proto__:null,alpha:`a`,a:`a`,beta:`b`,b:`b`,preview:`rc`,pre:`rc`,c:`rc`,rc:`rc`},h=e=>e.replace(/^0+(?=\d)/u,``);function g(e){let t=/^[\0-\u007F]*$/u.test(e)?ee.exec(e):null;if(t===null)return;let[,n,r,i,a,o,s,c,l,u,d]=t;return{epoch:h(n??`0`),release:r.split(`.`).map(h),pre:i===void 0?void 0:`${m[i.toLowerCase()]}${h(a??`0`)}`,post:o===void 0&&s===void 0?void 0:h(o??c??`0`),dev:l===void 0?void 0:h(u??`0`),local:d?.toLowerCase().split(/[-_.]/u).map(e=>/^\d+$/u.test(e)?h(e):e)}}function _({epoch:e,release:t,pre:n,post:r,dev:i,local:a}){let o=e===`0`?``:`${e}!`;return o+=t.join(`.`),n!==void 0&&(o+=n),r!==void 0&&(o+=`.post${r}`),i!==void 0&&(o+=`.dev${i}`),a!==void 0&&(o+=`+${a.join(`.`)}`),o}function v(e){let t=e.release.length;for(;t>1&&e.release[t-1]===`0`;)t--;return _({...e,release:e.release.slice(0,t)})}var y=e=>v(g(e)),b=n(e=>g(e)!==void 0,`a version`);function x(e,t){let n=_(g(b(e,t)));if(n!==e)throw new s(`${l(e)} is not a version in normal form, ${l(n)}`,t);return e}function S(e){let[t,n]=[0,e.length];for(;t<n&&(e[t]===` `||e[t]===` `);)t++;for(;n>t&&(e[n-1]===` `||e[n-1]===` `);)n--;return e.slice(t,n)}var C=/^v?(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*\.\*$/iu,w=/^(===|~=|==|!=|<=|>=|<|>)[ \t]*(.*)$/su;function te(e){let t=w.exec(e);if(t===null)return!1;let[,n,r]=t;if(n===`===`)return/^[^\s;)]+$/u.test(r);if((n===`==`||n===`!=`)&&C.test(r))return!0;let i=g(r);return i!==void 0&&(n!==`~=`||i.release.length>=2)&&(i.local===void 0||n===`==`||n===`!=`)}var T=e=>e.split(`,`).every(e=>te(S(e))),E=n(T,`a list of version specifiers`),D=/^(?:[\dA-Za-z]|[\dA-Za-z][\w.-]*[\dA-Za-z])$/u,O=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,k=e=>D.test(e),A=e=>e.toLowerCase().replace(/[-_.]+/gu,`-`),j=n(k,`a package name`);function M(t,n){if(!O.test(e(t,n)))throw new s(k(t)?`${l(t)} is not a name in normal form, ${l(A(t))}`:`${l(t)} is not a name`,n);return t}var N=new Set([`python_version`,`python_full_version`,`os_name`,`sys_platform`,`platform_release`,`platform_system`,`platform_version`,`platform_machine`,`platform_python_implementation`,`implementation_name`,`implementation_version`,`extra`,`extras`,`dependency_groups`]),P=new Set([`and`,`or`,`in`,`not`]),F=/[ \t]*(?:([()])|('[^']*'|"[^"]*")|(===|==|!=|<=|>=|~=|<|>)|([A-Za-z_][\w.]*)|(.|$))/gsuy,I=64;function L(e){let t=[];for(let[,n,r,i,a,o]of e.matchAll(F)){if(o===``)break;if(n!==void 0)t.push(n);else if(r!==void 0)t.push(`string`);else if(i!==void 0)t.push(`op`);else if(P.has(a))t.push(a);else if(N.has(a))t.push(`variable`);else return}return t}function R(e,t,n){let r=B(e,t,n);for(;r!==-1&&(e[r]===`and`||e[r]===`or`);)r=B(e,r+1,n);return r}var z=(e,t)=>e===`variable`&&t===`string`||e===`string`&&t===`variable`;function B(e,t,n){if(e[t]===`(`){if(n>=I)return-1;let r=R(e,t+1,n+1);return r!==-1&&e[r]===`)`?r+1:-1}let r=e[t+1],i=r===`op`||r===`in`?1:r===`not`&&e[t+2]===`in`?2:0;return i>0&&z(e[t],e[t+1+i])?t+1+i+1:-1}function V(e){let t=/[[\p{Cc}\p{Zl}\p{Zp}]--\t]/v.test(e)?void 0:L(e);return t!==void 0&&t.length>0&&R(t,0,0)===t.length}var H=n(V,`an environment marker`),U=/^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?[ \t]*(?:\[([^\]]*)\])?[ \t]*(.*)$/su;function W(e){let[,t,n]=U.exec(e)??[];if(n===void 0||t!==void 0&&S(t)!==``&&!t.split(`,`).every(e=>k(S(e))))return!1;if(n.startsWith(`@`)){let[,e,t]=/^@[ \t]*([^ \t]*)(.*)$/su.exec(n),r=/^(?:[ \t]+;[ \t]*(.*))?$/su.exec(t);return URL.canParse(e)&&r!==null&&(r[1]===void 0||V(r[1]))}let r=n.indexOf(`;`),i=S(r===-1?n:n.slice(0,r));if(i.startsWith(`(`)){if(!i.endsWith(`)`))return!1;i=i.slice(1,-1)}return(i===``||T(i))&&(r===-1||V(S(n.slice(r+1))))}var G=n(W,`a requirement`),K=/^([\w.]+)-([^-]*)(?:-\d[^-]*)?-[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?:-\w+(?:\.\w+)*){2}\.whl$/u;function q(e){let[,t,n]=K.exec(e)??[];if(t===void 0||t.includes(`__`))return;let r=g(n);return r===void 0?void 0:{name:A(t),version:r}}function J(e){let t=/^(.*)\.(?:tar\.gz|zip)$/su.exec(e)?.[1],n=t?.lastIndexOf(`-`)??-1;if(n===-1)return;let r=g(t.slice(n+1));return r===void 0?void 0:{name:A(t.slice(0,n)),version:r}}var Y={__proto__:null,md5:32,sha1:40,sha224:56,sha256:64,sha384:96,sha512:128,sha3_224:56,sha3_256:64,sha3_384:96,sha3_512:128,blake2b:128,blake2s:64};function X(e,t,n,r){if(t.length!==n||!/^[\da-f]*$/u.test(t))throw new s(`${l(t)} is not a ${e} digest in lowercase hex`,r);return t}function Z(t,n,r){let i=e(t,n).indexOf(`:`),a=t.slice(0,i);if(i===-1||!Object.hasOwn(r,a))throw new s(`${l(t)} is not a hash of ${Object.keys(r).join(`, `)}`,n);return X(a,t.slice(i+1),r[a],n),t}var ne=o(t)(a,`an http(s) URL`);function Q(t,n){if(/^(?:\/|\\|[A-Za-z]:)/u.test(e(t,n)))throw new s(`${l(t)} is absolute, and only reads on the machine that wrote it`,n);return r(t,n)}var re=(e,t)=>i(Q(e,t),t),$=e=>e.slice(e.lastIndexOf(`/`)+1);function ie({name:e,path:t,pathname:n}){return e===void 0?t===void 0?c(()=>decodeURIComponent($(n)),()=>{}):$(t):e}export{v as a,y as b,b as c,x as d,E as e,A as f,j as g,M as h,H as i,G as j,q as k,J as l,Y as m,X as n,Z as o,ne as p,Q as q,re as r,ie as s};
|