@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.
Files changed (138) hide show
  1. package/common/bundle-compare-diff.d.ts +4 -1
  2. package/common/bundle-compare-diff.js +4 -3
  3. package/common/bundle-sources.d.ts +2 -0
  4. package/common/bundle-sources.js +22 -3
  5. package/common/finding-duplicates.js +5 -0
  6. package/common/finding-filters.js +45 -4
  7. package/common/line-diff.d.ts +2 -2
  8. package/common/line-diff.js +20 -8
  9. package/common/managed/finding-detail.js +1 -1
  10. package/common/managed/review-view-routes.js +23 -0
  11. package/common/managed/risk-routes.js +30 -0
  12. package/common/managed/routes.js +11 -6
  13. package/common/managed/team-app.d.ts +8 -6
  14. package/common/managed/team-app.js +15 -3
  15. package/common/stasis-files.d.ts +5 -0
  16. package/common/stasis-files.js +20 -0
  17. package/common/stasis-tgz.d.ts +6 -0
  18. package/common/stasis-tgz.js +27 -0
  19. package/common/workspace-app.js +20 -0
  20. package/out/activity.js +2 -4
  21. package/out/{chunk-2F3CYNPZ.js → chunk-2IHCVA3Y.js} +1 -1
  22. package/out/{chunk-HAZKDK4M.js → chunk-2V6Q4ZOZ.js} +1 -1
  23. package/out/{chunk-RRBIJL2B.js → chunk-4IW3VD3H.js} +1 -1
  24. package/out/chunk-4YZOXAXR.js +2 -0
  25. package/out/chunk-5YP7P5KA.js +1 -0
  26. package/out/chunk-62QT2RXR.js +6 -0
  27. package/out/chunk-6VOB5WXX.js +2 -0
  28. package/out/chunk-A4BBBHQU.js +1 -0
  29. package/out/{chunk-4ISO5F7Y.js → chunk-ADMVRLNP.js} +1 -1
  30. package/out/{chunk-HETCVNO4.js → chunk-BLPHP4U3.js} +1 -1
  31. package/out/{chunk-Y5ZHFNBD.js → chunk-BXQCCW7F.js} +1 -1
  32. package/out/chunk-C6OPCPCA.js +1 -0
  33. package/out/{chunk-JFL7WLRV.js → chunk-CU3FPB3P.js} +1 -1
  34. package/out/chunk-DQJEVHRE.js +52 -0
  35. package/out/chunk-ESJZZF2Y.js +255 -0
  36. package/out/{chunk-M37X4LCF.js → chunk-EXQQ5VQJ.js} +1 -1
  37. package/out/{chunk-NXATZJQ2.js → chunk-GSNSP3EF.js} +1 -1
  38. package/out/chunk-GV5U7OLP.js +40 -0
  39. package/out/{chunk-JOXLZXMI.js → chunk-GX5UXWT4.js} +1 -1
  40. package/out/chunk-HLMQ7QYS.js +1 -0
  41. package/out/{chunk-YF4M5OCI.js → chunk-I6UQQKAH.js} +1 -1
  42. package/out/{chunk-UCP3JRE2.js → chunk-LVW7WWV4.js} +1 -1
  43. package/out/chunk-NEFCZAIY.js +11 -0
  44. package/out/{chunk-TOXMUOIW.js → chunk-OQS2USZM.js} +1 -1
  45. package/out/chunk-PLF4LBLE.js +1 -0
  46. package/out/chunk-QBFT2DDR.js +1 -0
  47. package/out/{chunk-QMVOEBWC.js → chunk-S2ZIKK45.js} +1 -1
  48. package/out/chunk-S5HSDGTP.js +8 -0
  49. package/out/chunk-SSPDMA6D.js +1 -0
  50. package/out/{chunk-4XIH7YTX.js → chunk-UH6NZBSU.js} +1 -1
  51. package/out/{chunk-M3Y6SLC4.js → chunk-UJP4PQJA.js} +1 -1
  52. package/out/{chunk-PAD2JHZT.js → chunk-UJSJMXEG.js} +1 -1
  53. package/out/chunk-VRAJCPV5.js +3 -0
  54. package/out/chunk-VS7RV24Z.js +4 -0
  55. package/out/{chunk-E3LFSUDJ.js → chunk-VYYUMYVW.js} +1 -1
  56. package/out/chunk-W5PRH5D7.js +2 -0
  57. package/out/{chunk-VRX2APNA.js → chunk-XVKDPU4D.js} +1 -1
  58. package/out/{chunk-WKFBZYJX.js → chunk-YI4D6XVX.js} +1 -1
  59. package/out/client-managed-import.js +3 -3
  60. package/out/client-managed.js +30 -28
  61. package/out/compare.js +16 -23
  62. package/out/dialogs.js +38 -38
  63. package/out/graph.js +14 -14
  64. package/out/index.html +31 -51
  65. package/out/scan.js +2 -2
  66. package/out/terminal.js +239 -240
  67. package/out/view.css +1 -1
  68. package/out/view.js +15 -15
  69. package/package.json +21 -13
  70. package/risk/actions/resolve.js +47 -16
  71. package/risk/actions/uses.js +27 -9
  72. package/risk/actions/workflow.js +75 -2
  73. package/risk/files/hosts.js +4 -4
  74. package/risk/files/readability.js +5 -2
  75. package/risk/files/runs-code.js +12 -25
  76. package/risk/files/script.js +141 -19
  77. package/risk/index.d.ts +24 -7
  78. package/risk/index.js +1 -0
  79. package/risk/npm/assess.js +1 -1
  80. package/risk/npm/compare.js +5 -4
  81. package/risk/npm/diff.js +1 -1
  82. package/risk/npm/held.js +6 -2
  83. package/risk/npm/registry.js +5 -2
  84. package/risk/npm/tarball.js +79 -22
  85. package/server-managed/bundle-advisories.ts +12 -36
  86. package/server-managed/bundle-build-worker.js +29 -11
  87. package/server-managed/bundle-build.ts +4 -3
  88. package/server-managed/bundle-cache.ts +53 -13
  89. package/server-managed/bundle.ts +45 -13
  90. package/server-managed/comparison.ts +7 -6
  91. package/server-managed/db-methods.ts +54 -17
  92. package/server-managed/db-neon.ts +9 -2
  93. package/server-managed/db-schema.ts +12 -2
  94. package/server-managed/db.ts +4 -1
  95. package/server-managed/dependency-reviews.ts +8 -5
  96. package/server-managed/github-errors.ts +22 -0
  97. package/server-managed/github-requests.ts +4 -2
  98. package/server-managed/http.ts +238 -27
  99. package/server-managed/management.ts +10 -4
  100. package/server-managed/npm-delta.ts +1 -1
  101. package/server-managed/npm-loads.ts +2 -2
  102. package/server-managed/npm-packages.ts +34 -29
  103. package/server-managed/npm-patch-paths.ts +57 -0
  104. package/server-managed/npm-patch.ts +77 -82
  105. package/server-managed/package-entry-points.ts +54 -6
  106. package/server-managed/rename-diff-worker.js +11 -7
  107. package/server-managed/rename-diff.ts +5 -4
  108. package/server-managed/report-opening.ts +77 -0
  109. package/server-managed/report-sources.ts +2 -1
  110. package/server-managed/repository-aliases.ts +34 -0
  111. package/server-managed/repository-browser.ts +87 -32
  112. package/server-managed/repository-code.ts +14 -8
  113. package/server-managed/repository-dependency-reviews.ts +21 -0
  114. package/server-managed/repository-risk-read.ts +71 -4
  115. package/server-managed/repository-risk.ts +9 -2
  116. package/server-managed/stasis-config.ts +97 -5
  117. package/server-managed/team-reports.ts +5 -3
  118. package/server-managed/type-only-proof.js +26 -4
  119. package/server-managed/upstream-cache.ts +18 -12
  120. package/server-managed/workspace-shares.ts +4 -4
  121. package/out/chunk-27Y75UQR.js +0 -4
  122. package/out/chunk-4RS3NDOG.js +0 -1
  123. package/out/chunk-4XSH6ZLT.js +0 -1
  124. package/out/chunk-7CHIFYQW.js +0 -42
  125. package/out/chunk-CZ3U2LI4.js +0 -2
  126. package/out/chunk-ETL5ZPPR.js +0 -259
  127. package/out/chunk-L6VIWL2Y.js +0 -1
  128. package/out/chunk-OSHR3N4S.js +0 -3
  129. package/out/chunk-UD33S2MG.js +0 -52
  130. package/out/chunk-VG5RH6KN.js +0 -2
  131. package/out/chunk-WFDXHPT2.js +0 -12
  132. package/out/chunk-WMFDQS2L.js +0 -11
  133. package/out/chunk-WREU7JAG.js +0 -1
  134. /package/out/{chunk-4LZK6C6N.js → chunk-74JZTGTO.js} +0 -0
  135. /package/out/{chunk-JMG5DXII.js → chunk-7HP2VYIC.js} +0 -0
  136. /package/out/{chunk-HOB3YPS5.js → chunk-K4XJHM2T.js} +0 -0
  137. /package/out/{chunk-4EMM6UCD.js → chunk-QI66YA4F.js} +0 -0
  138. /package/out/{chunk-G3LY2FV4.js → chunk-WCDYSIKG.js} +0 -0
@@ -1 +0,0 @@
1
- import{a as e,cf as t,ef as n,gf as r,sa as i,w as a}from"./chunk-ETL5ZPPR.js";import{c as o,d as s,g as c}from"./chunk-2XUEZHIP.js";var l=t(s`<path d="M3.5 8.4l2.9 2.9 6.1-6.6"/>`),u=t(s`<circle class="fill" cx="8" cy="8" r="3"/>`),d=t(s`<path d="M4.2 4.2l7.6 7.6M11.8 4.2l-7.6 7.6"/>`),f=t(s`<circle class="dotted" cx="8" cy="8" r="5.5"/>`),p=t(s`<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"/>`),m={approved:[`approved`,r.approved[1],`Approved`],changes:[`changes`,r.changes[1],`Changes requested`],commented:[`commented`,n,`Commented`],dismissed:[`dismissed`,n,`Review dismissed`]},h={done:[`reviewed`,l,`Reviewed`],running:[`running`,u,`Reviewing`],failed:[`failed`,d,`Review failed`],requested:[`requested`,f,`Asked to review again`]},g=[`requested`,f,`Review requested`],_=e=>e.slice(0,7),v=e=>new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),y=(e,t,n=!1)=>`${e.toLocaleString(`en-US`)}${n?`+`:``} ${t}${e===1&&!n?``:`s`}`;function b(e){return e?e.failed?h.failed:e.requested?h.requested:h[e.code?.status]??null:null}function x(e){let t=b(e.codex),n=e.codex?.code?.commit??null;return[...t?[{who:i(e.codex.login,`Codex`),standing:t,commit:n,stale:n!==null&&n!==e.head}]:[],...e.reviewers.map(t=>({who:i(t.login,t.login??`someone`),standing:m[t.state]??g,requested:t.requested&&!!m[t.state],workflow:t.workflow??null,commit:t.commit,at:t.at,stale:t.commit!==null&&t.commit!==e.head}))]}var S=e=>(e.moreReviews??0)+(e.moreRequests??0),C=e=>[e.moreReviews>0?y(e.moreReviews,`more review`):null,e.moreRequests>0?y(e.moreRequests,`more review request`):null].filter(Boolean).join(` and `);function w(e){if(!e.head)return!0;let t=e.codex?.code;return t?.status===`done`&&t.commit===e.head||e.reviewers.some(t=>m[t.state]&&t.state!==`dismissed`&&t.commit===e.head)?!0:e.moreReviews>0&&null}var T=e=>e?o`<span class="${`review-severity is-${e}`}">${e.toUpperCase()}</span>`:c;function E(e){if(!e)return c;let t=x(e),{open:n,more:r,severity:i}=e.threads,a=n>0?`${y(n,`open review thread`,r)}${i?`, the gravest ${i.toUpperCase()}`:``}`:r?`No open review thread among those read; more on GitHub`:null,s=w(e);return o`<span class="issue-reviews">${t.map(({who:e,standing:[t,n,r],commit:i,stale:a,requested:s})=>{let c=`${r}${s?`, and requested again`:``}${a?`, on an earlier commit (${_(i)})`:i?`, on the latest commit`:``}`;return o`<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>`})} ${S(e)>0?o`<span class="review-more" data-tooltip="${`${C(e)}, on GitHub`}">+${S(e)}</span>`:c} ${a?o`<span class="review-threads" role="img" aria-label="${a}" data-tooltip="${a}">${p}<span>${n}${r?`+`:``}</span>${T(i)}</span>`:c} ${s===!1?o`<span class="review-unreviewed" data-tooltip="${t.length>0?`No review is on the latest commit`:`No reviews yet`}">Unreviewed</span>`:s===null?o`<span class="review-unreviewed" data-tooltip="No review read is on the latest commit; more on GitHub">Unreviewed?</span>`:c}</span>`}function D(e,t,n){if(!e)return c;let r=o`<code>${_(e)}</code>`;return o`<span class="review-on">on ${n?o`<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 O(e,t){if(!e)return c;let{head:n,codex:r}=e,a=(e,[a,s,c],l)=>o`<li class="review-row">${i(r.login,`Codex`)} <span class="${`review-state is-${a}`}">${s}${l}: ${c.toLowerCase()}</span>${D(e.commit,n,t)}</li>`,s=[...r?.code?[a(r.code,b(r)??h.done,`Code review`)]:[],...r?.security?[a(r.security,h[r.security.status]??h.done,`Security review`)]:[],...x({...e,codex:null}).map(({who:e,standing:[r,i,a],commit:s,at:l,requested:u,workflow:d})=>o`<li class="review-row">${e} <span class="${`review-state is-${r}`}">${i}${a}${u?`, requested again`:``}</span>${d?o`<span class="review-on">by the workflow <code>${d}</code></span>`:c}${D(s,n,t)}${l?o`<time datetime="${new Date(l).toISOString()}">${v(l)}</time>`:c}</li>`)],{open:l,resolved:u,more:d,list:f=[]}=e.threads;return o`<section class="repo-item-section"><h4>Reviews</h4>${s.length>0?o`<ul>${s}</ul>`:o`<p class="repo-item-quiet">No reviews yet.</p>`} ${S(e)>0?o`<p class="repo-item-quiet">And ${C(e)}, on GitHub.</p>`:c} ${w(e)===null?o`<p class="repo-item-quiet">No review read is on the latest commit, <code>${_(n)}</code>; one of those on GitHub may be.</p>`:s.length>0&&!w(e)?o`<p class="repo-item-quiet">No review is on the latest commit, <code>${_(n)}</code>.</p>`:c}</section>${l>0||u>0?o`<section class="repo-item-section"><h4>Open threads</h4>${f.length>0?o`<ul>${f.map(e=>o`<li><a class="repo-item-row review-thread" href="${e.url??c}" target="_blank" rel="noopener noreferrer">${T(e.severity)}<span class="repo-item-title">${e.title||`(no comment)`}</span> ${e.path?o`<code class="review-path">${e.path}${e.line?`:${e.line}`:``}</code>`:c} ${e.outdated?o`<span class="repo-item-quiet">outdated</span>`:c}</a></li>`)}</ul>`:o`<p class="repo-item-quiet">${d?`None open among those read.`:`None open.`}</p>`} ${u>0||d?o`<p class="repo-item-quiet">${u>0?`${y(u,`thread`)} resolved`:``}${d?`${u>0?`; `:``}more on GitHub`:``}.</p>`:c}</section>`:c}`}var k=e({items:new Map,changes:0}),A=null,j=()=>a.managedSession?`${a.managedSession.id}\0${a.managedSession.role}`:null,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,r=null){let i=j();i!==A&&(k.items.clear(),A=i);let a=!1;for(let o of t){let t=M(i,e,o.number),s=k.items.get(t);if(s&&s.readAt>n)continue;let c=s&&(s.item.state===`open`?`open`:`closed`),l=!c||c===(o.state===`open`?`open`:`closed`)?s?.moved??null:{from:c,before:s.readAt};k.items.set(t,{item:{...o,kind:o.kind??r??s?.item.kind??null},readAt:n,moved:l}),a=!0}a&&k.changes++}var F=(e,t)=>k.items.get(M(j(),e,t))??null;function I(e,t){let n=M(j(),e,``);return k.changes,[...k.items].flatMap(([e,r])=>e.startsWith(n)&&r.item.kind===t?[r]:[])}var L=()=>k.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{E as a,O as b,N as c,P as d,F as e,I as f,L as g,R as h,z as i};
@@ -1,3 +0,0 @@
1
- import{a as e}from"./chunk-6CCSTJWB.js";import{b as t,c as n,e as r,f as i,g as a}from"./chunk-UD33S2MG.js";import{p as o}from"./chunk-4RS3NDOG.js";import{J as s}from"./chunk-QRKFPLA4.js";import{a as c}from"./chunk-TUII34K2.js";var l=[`dependencies`,`security`],u={dependencies:`Dependencies`,security:`Security`},d=e(),f=Object.freeze(d.models),p=d.defaultModel,m=`x-upload-encryption`,h=1,g=1,_={name:`X25519`},v=34,y=1048576,b=65536,x=`deepview-managed-upload.v1.content-key`;function S(e,t){let n=new Uint8Array(12);return new DataView(n.buffer).setUint32(7,e),n[11]=+!!t,n}async function C(e,t,n){let r=await crypto.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveKey`]);return await crypto.subtle.deriveKey({name:`HKDF`,hash:`SHA-256`,salt:t,info:c(x)},r,{name:`AES-GCM`,length:256},!1,[n])}async function w(e){let t=new Uint8Array(await e.slice(0,b).arrayBuffer());if(t.includes(0))return!1;try{return new TextDecoder(`utf-8`,{fatal:!0}).decode(t,{stream:!0}),!0}catch{return!1}}async function T(e,t,n){let r=await w(e),[i,a]=await Promise.all([crypto.subtle.importKey(`raw`,t,_,!1,[]),crypto.subtle.generateKey(_,!1,[`deriveBits`])]),o=new Uint8Array(v);o[0]=h,o[1]=r?g:0,o.set(new Uint8Array(await crypto.subtle.exportKey(`raw`,a.publicKey)),2);let s=await C(await crypto.subtle.deriveBits({name:`X25519`,public:i},a.privateKey,256),o,`encrypt`),c=[new Blob([o])],l=new Uint8Array(y),u=0,d=0,f=async e=>{c.push(new Blob([await crypto.subtle.encrypt({name:`AES-GCM`,iv:S(d++,e)},s,l.subarray(0,u))])),u=0},p=(r?e.stream().pipeThrough(new CompressionStream(`gzip`)):e.stream()).getReader();try{for(let e=await p.read();!e.done;e=await p.read()){n?.throwIfAborted();for(let t=0;t<e.value.length;){u===y&&await f(!1);let n=Math.min(y-u,e.value.length-t);l.set(e.value.subarray(t,t+n),u),u+=n,t+=n}}}catch(e){throw await p.cancel(e).catch(()=>{}),e}return await f(!0),new Blob(c)}var E=null,D=0;function O(){return E?.user.role??null}function ee(e){if(e!==null&&!i(e))throw TypeError(`Unknown managed preview role: ${e}. Expected ${r.join(`, `)}.`);D++,E=e===null?null:{user:{id:`preview:${e}`,login:e,name:e[0].toUpperCase()+e.slice(1),role:e,avatarUrl:null,lastSeenAt:Date.now(),lastActivityAt:null},csrfToken:null}}function te(e,t){let n=new URL(e,`http://managed-preview.invalid`).pathname,r=(t?.method??`GET`).toUpperCase();if(r===`POST`&&n===`/api/auth/logout`)return Response.json({ok:!0});if(r!==`GET`)throw Error(`Changes are not saved in the managed UI preview`);if(n===`/api/auth/session`)return Response.json(E);if(n===`/api/teams`)return Response.json({teams:[]});if(n.startsWith(`/api/admin/`)&&!a(E.user.role,`manage`)||[`/api/admin/users`,`/api/admin/teams`,`/api/admin/repositories`,`/api/admin/repositories/aliases`,`/api/admin/repositories/risk`].includes(n)&&E.user.role!==`admin`)return Response.json({error:`forbidden`},{status:403});if(n===`/api/admin/repositories/risk`)return new Response(`{"type":"repos","repos":[]}
2
- {"type":"done"}
3
- `,{headers:{"content-type":`application/x-ndjson`}});let i={"/api/admin/users":{users:[E.user]},"/api/admin/teams":{teams:[],users:[E.user],repos:[],permissions:l},"/api/admin/links":{shares:[]},"/api/admin/repositories":{repositories:[],total:0,connectedCount:0,installUrl:null,tokenMissing:!1},"/api/admin/repositories/aliases":{aliases:[],repos:[]},"/api/admin/repositories/resolve":{location:null},"/api/admin/reports":{reports:[],repos:[],maxBytes:26214400},"/api/admin/bundles":{bundles:[],repos:[],maxBytes:209715200},"/api/admin/history":{history:[],total:0,page:1,limit:100,filters:{repos:[],users:[]}},"/api/admin/scan/models":{models:f,defaultModel:p},"/api/admin/scan-results":{bundles:[],results:[]},"/api/auth/profile":{profile:{login:E.user.login,name:E.user.name,githubName:E.user.name,nameAccount:null,avatarAccount:null,accounts:[]}}};return Object.hasOwn(i,n)?Response.json(i[n]):Response.json({error:`not-found`},{status:404})}var k=3145728,A=new Set([`/api/admin/reports`,`/api/admin/bundles`,`/api/admin/deduplication`]);async function j(e,t){let n=await t(`/api/admin/uploads/key`,{credentials:`same-origin`,signal:e.signal});if(n.status===404||n.status===405)return e;if(!n.ok)return n;let r=(await n.json())?.key;if(typeof r!=`string`)throw TypeError(`The server sent an invalid upload key`);let i=new Headers(e.headers);return i.set(m,`1`),{...e,headers:i,body:await T(e.body,Uint8Array.fromBase64(r,{alphabet:`base64url`}),e.signal)}}async function M(e,t,n){let r=null;if(e!==`/api/admin/deduplication`&&t.body.size>k){let i=await n(`/api/config`,{credentials:`same-origin`,signal:t.signal});if(!i.ok)return i;let a=(await i.json()).managed,o=a?.uploadMaxBytes?.[e.endsWith(`/reports`)?`reports`:`bundles`];if(Number.isSafeInteger(o)&&o>0&&t.body.size>o)return Response.json({error:`too-large`},{status:413});let s=a?.uploadChunkBytes;Number.isSafeInteger(s)&&s>0&&s<=k&&(r=s)}let i=await j(t,n);return i instanceof Response?i:r==null||i.body.size<=k?await n(e,i):await P(e,i,n,r)}var N=3;async function P(e,t,n,r){let i=t.body,a=crypto.randomUUID(),o=e.endsWith(`/reports`)?`reports`:`bundles`,s=Math.ceil(i.size/r),c=new Headers(t.headers);c.set(`content-type`,`application/octet-stream`);let l=0,u=!1;try{let d=null,f=!1,p=(await Promise.allSettled(Array.from({length:Math.min(N,s)},async()=>{for(;!f&&l<s;){let e=l++;try{let s=await n(`/api/admin/uploads/${o}/${a}/${e}`,{...t,headers:c,body:i.slice(e*r,(e+1)*r)});s.ok||(d??=s,f=!0)}catch(e){throw f=!0,e}}}))).find(e=>e.status===`rejected`);if(p)throw p.reason;if(d)return d;let m=new Headers(t.headers);m.set(`x-upload-id`,a),m.set(`x-upload-parts`,String(s)),m.set(`x-upload-size`,String(i.size));let h=await n(e,{...t,headers:m,body:``});return u=h.ok,h}finally{if(!u&&l>0){let e=new Headers(t.headers);e.set(`x-upload-parts`,String(l)),await n(`/api/admin/uploads/${o}/${a}`,{...t,method:`DELETE`,headers:e,body:void 0,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}}}async function F(e){await e.json().then(e=>e?.error,()=>null)===`view-only`&&globalThis.document?.dispatchEvent(new CustomEvent(`managed-view-only`))}async function I(e,n){if(n?.signal?.throwIfAborted(),E)return te(e,n);let r=D;async function i(e,n){if(r!==D)throw new DOMException(`Managed session changed`,`AbortError`);let i=t();if(i){if(new URL(e,globalThis.location.origin).origin!==globalThis.location.origin)throw Error(`Public workspace requests must be same-origin`);let t=new Headers(n?.headers);t.set(`x-deepview-share`,i.token),n={...n,headers:t,credentials:`omit`,redirect:`error`}}let a=await fetch(e,{...n,cache:`no-store`});if(r!==D)throw new DOMException(`Managed session changed`,`AbortError`);return a.status===403&&![`GET`,`HEAD`].includes((n?.method??`GET`).toUpperCase())&&F(a.clone()),a}return n?.method===`POST`&&A.has(e)&&n.body instanceof Blob?await M(e,n,i):await i(e,n)}var L=new class{constructor(e=()=>{}){this.resources=new Map,this.session=null,this.teamCatalog=null,this.reportCatalog=null,this.bundleCatalog=null,this.generation=0,this.sessionController=new AbortController,this.notify=e}setSession(e){(this.session?.id!==e?.id||this.session?.role!==e?.role)&&this.reset(),this.session=e}reset(){this.generation++,this.sessionController.abort(),this.sessionController=new AbortController,this.invalidate(),this.session=null,this.teamCatalog=null,this.reportCatalog=null,this.bundleCatalog=null}setReportCatalog(e){let t=new Set,n=new Map(e.map(e=>[e.id,JSON.stringify([e.cacheKey??null,e.reports.map(e=>[e.id,e.cacheKey??null,e.visible!==!1]).toSorted(),(e.bundles??[]).map(e=>[e.id,e.filename,e.repoFullName,e.repoDirectory??``]).toSorted()])]));for(let e of new Set([...this.teamCatalog?.keys()??[],...n.keys()]))this.teamCatalog?.get(e)!==n.get(e)&&t.add(`team:${e}`);for(let e of this.resources.keys())if(e.startsWith(`reports:content:team:`)){let[t]=e.slice(21).split(`:`);n.has(t)&&this.teamCatalog?.get(t)===n.get(t)||this.invalidate([e])}this.teamCatalog=n;let r=new Map;for(let t of e)for(let e of t.reports){let n=r.get(e.id)??[];n.push(JSON.stringify([t.id,e.cacheKey??null])),r.set(e.id,n)}let i=new Map([...r].map(([e,t])=>[e,JSON.stringify(t.toSorted())])),a=this.reportCatalog;this.reportCatalog=i;let o=new Set(t);for(let e of new Set([...a?.keys()??[],...i.keys()]))a?.get(e)!==i.get(e)&&o.add(e);for(let e of this.resources.keys()){if(!e.startsWith(`reports:content:`)||e.startsWith(`reports:content:team:`))continue;let t=e.slice(16);(!i.has(t)||o.has(t))&&(this.invalidate([e]),o.add(t))}let s=new Map;for(let t of e)for(let e of t.bundles??[]){let n=s.get(e.id)??[];n.push(JSON.stringify([t.id,t.cacheKey??null,e.filename,e.repoFullName,e.repoDirectory??``])),s.set(e.id,n)}let c=!1,l=new Map([...s].map(([e,t])=>[e,JSON.stringify(t.toSorted())]));for(let e of new Set([...this.bundleCatalog?.keys()??[],...l.keys()]))this.bundleCatalog?.get(e)!==l.get(e)&&(c=!0,o.add(`bundle:${e}`),this.invalidate([`bundle-metadata:${e}`]));this.bundleCatalog=l;for(let e of this.resources.keys()){if(!e.startsWith(`report-sources:`)&&!e.startsWith(`finding-history:`))continue;let[,n,r]=e.split(`:`);(n?t.has(`team:${n}`):c||o.has(r))&&this.invalidate([e])}return o}read(e){return this.resources.get(e)?.data}invalidate(e){for(let[t,n]of this.resources)e&&!e.some(e=>t===e||t.startsWith(`${e}:`))||(n.controller?.abort(),this.resources.delete(t))}async mutate(e,t){let n=this.generation,r;try{r=await e()}catch(e){throw n===this.generation&&e?.name!==`AbortError`&&this.notify(`Couldn't save changes: ${e?.message??e}`),e}if(n!==this.generation)throw new DOMException(`Managed session changed`,`AbortError`);return this.invalidate(t),r}async load(e,t,n,{signal:r,apply:i=()=>{},retryInvalidated:a=!1}={}){let o=this.generation;for(;;){r?.throwIfAborted();let s=this.resources.get(e);if(s||(s={},this.resources.set(e,s)),s.data!==void 0&&i(s.data),!s.pending){let e=s.controller=new AbortController;s.pending=(async()=>{try{let t=await n(e.signal);return e.signal.throwIfAborted(),s.data=t,t}catch(n){throw!e.signal.aborted&&n?.name!==`AbortError`&&this.notify(`Couldn't refresh ${t}: ${n?.message??n}`),n}})().finally(()=>{s.pending=null})}try{let t=await s.pending;if(r?.throwIfAborted(),this.resources.get(e)!==s)throw new DOMException(`Managed data changed`,`AbortError`);return i(t),t}catch(t){if(!a||t?.name!==`AbortError`||r?.aborted||o!==this.generation||this.resources.get(e)===s)throw t}}}}(e=>{document.dispatchEvent(new CustomEvent(`managed-notice`,{detail:{message:e}}))});function R(e){L.setSession(e)}function z(e){return L.setReportCatalog(e)}function B(){L.reset()}var V=[`package`,`repo`],H=e=>Array.isArray(e?.findings)?`findings`:Array.isArray(e?.groups)?`groups`:null;function U(e,t){let n=H(e);if(!n||!Array.isArray(t))return e;for(let r of e[n].flat())if(r&&typeof r==`object`)for(let e of V)Number.isInteger(r[e])&&(r[e]=t[r[e]]);return e}async function W(e,t=null,n={}){let r;try{r=await I(e,{credentials:`same-origin`,headers:{accept:`application/json`},...n})}catch{return t}if(r.status===401||r.status===403)return null;if(!r.ok)return t;try{return await r.json()}catch{return t}}async function G({fallback:e=null,sent:r}={}){let i=t()||O()!==null?void 0:await r;if(i===null)return null;let a=K(i);if(a!==void 0)return a;let o;try{let r=t(),i=await I(r?n(r):`/api/auth/session`,{credentials:`same-origin`,headers:{accept:`application/json`}});if(i.status===401||i.status===403)return null;if(!i.ok)return e;o=await i.json()}catch{return e}let s=K(o);return s===void 0?e:s}function K(e){let n=e?.user;if(n===null)return null;if(n!==void 0&&typeof n.login==`string`)return{id:n.id,login:n.login,name:typeof n.name==`string`?n.name:null,avatarUrl:typeof n.avatarUrl==`string`?n.avatarUrl:null,role:typeof n.role==`string`?n.role:`none`,csrfToken:typeof e.csrfToken==`string`?e.csrfToken:null,...t()?{publicShare:!0}:{},...typeof e.viewer?.login==`string`?{viewer:{id:e.viewer.id,login:e.viewer.login,name:typeof e.viewer.name==`string`?e.viewer.name:null}}:{},...!t()&&e.dependencyReview===!0?{dependencyReview:!0}:{}}}function q(e){let t=t=>Number.isSafeInteger(e?.[t])&&e[t]>=0;return e?.appMode===!1?{appMode:!1,...t(`appReports`)&&{appReports:e.appReports},...t(`findings`)&&{findings:e.findings}}:e?.appMode===!0&&t(`appFindings`)?{appMode:!0,appFindings:e.appFindings}:null}function J(e){if(typeof e?.sha!=`string`||typeof e.github!=`string`||!Array.isArray(e.tags))return null;let t=e.details,n=e=>typeof e==`string`?e:null,r=e=>Number.isSafeInteger(e)?e:null;return{sha:e.sha,github:e.github,tags:e.tags.filter(e=>typeof e==`string`),details:typeof t?.subject==`string`?{subject:t.subject,authorName:n(t.authorName),authorLogin:n(t.authorLogin),authoredAt:r(t.authoredAt),committedAt:r(t.committedAt)}:null}}async function ne({fallback:e=[],signal:r,onRevision:i}={}){let a=t(),o=a?await W(n(a),null,{signal:r}):null,s=a?{teams:o?.team?[o.team]:[]}:await W(`/api/teams`,{teams:e},{signal:r}),c=s?.teams;return Array.isArray(c)?(i?.(typeof s.revision==`string`?s.revision:null),c.filter(e=>e!=null&&typeof e.id==`string`&&typeof e.name==`string`).map(e=>({id:e.id,slug:e.slug,name:e.name,...!a&&e.dependencyReview===!0?{dependencyReview:!0}:{},...e.permissions?{permissions:{dependencies:e.permissions.dependencies===!0,security:e.permissions.security===!0}}:{},...typeof e.cacheKey==`string`?{cacheKey:e.cacheKey}:{},...q(e.app)?{app:q(e.app)}:{},repos:Array.isArray(e.repos)?e.repos.filter(e=>Number.isSafeInteger(e?.repoId)&&e.repoId>0&&typeof e.fullName==`string`).map(e=>({repoId:e.repoId,fullName:e.fullName,path:typeof e.path==`string`&&e.path?e.path:null})):[],reports:Array.isArray(e.reports)?e.reports.filter(e=>e!=null&&typeof e.id==`string`&&typeof e.filename==`string`).map(e=>({id:e.id,slug:e.slug,filename:e.filename,visible:e.visible!==!1,...e.analyzer===null||typeof e.analyzer==`string`?{analyzer:e.analyzer}:{},repoFullName:typeof e.repoFullName==`string`?e.repoFullName:``,repoDirectory:typeof e.repoDirectory==`string`?e.repoDirectory:``,...typeof e.cacheKey==`string`?{cacheKey:e.cacheKey}:{}})):[],bundles:Array.isArray(e.bundles)?e.bundles.filter(e=>e!=null&&typeof e.id==`string`&&typeof e.filename==`string`).map(e=>({id:e.id,slug:e.slug,integrity:e.integrity,byteSize:e.byteSize,repoId:e.repoId,filename:e.filename,kind:e.kind,visible:e.visible!==!1,summary:e.summary??null,summaryRetryAt:Number.isSafeInteger(e.summaryRetryAt)&&e.summaryRetryAt>0?e.summaryRetryAt:null,repoDirectory:typeof e.repoDirectory==`string`?e.repoDirectory:``,repoFullName:typeof e.repoFullName==`string`?e.repoFullName:``,commitInfo:J(e.commitInfo)})):[]}))):s==null?[]:e}function Y(e){return e?.links===void 0?[]:Array.isArray(e.links)&&e.links.every(e=>Array.isArray(e)&&e.length>=2&&e.every(e=>typeof e==`string`))?e.links:null}function X(e,t=null){return s(e?.data)===null||typeof e.repo?.directory!=`string`||e.repo.github!==null&&typeof e.repo.github!=`string`||Y(e)===null?null:{data:U(e.data,t),repo:e.repo,...e.links?{links:e.links}:{}}}async function Z(e,{signal:t}={}){return X(await W(`/api/reports/${encodeURIComponent(e)}`,null,{signal:t}))}async function re(e,{signal:t}={}){let n=[...new Set(e)];if(n.length===0)return[];let r=await W(`/api/reports/query`,null,{method:`POST`,signal:t,headers:{accept:`application/json`,"content-type":`application/json`},body:JSON.stringify({ids:n})});if(!Array.isArray(r?.reports)||r.reports.length!==n.length)return null;let i=new Map;for(let e of r.reports){let t=X(e);if(!t||!n.includes(e.id)||i.has(e.id))return null;i.set(e.id,t)}let a=Y(r);return a===null?null:e.map(e=>({...i.get(e),...a.length>0?{links:a}:{}}))}async function ie(e,{signal:t,reportId:n=null,lite:r=!1}={}){let i=new URLSearchParams(n===null?{}:{reportId:n});r&&i.set(`lite`,`1`);let a=await W(`/api/teams/${encodeURIComponent(e)}/reports${i.size>0?`?${i}`:``}`,null,{signal:t});if(!Array.isArray(a?.reports))return null;let o=[],s=new Set;for(let e of a.reports){let t=X(e,a.values);if(!t||typeof e.id!=`string`||typeof e.filename!=`string`||s.has(e.id))return null;s.add(e.id),o.push({id:e.id,filename:e.filename,...t})}let c=Y(a);return c===null?null:(Object.defineProperties(o,{links:{value:c},...[`rows`,`app`].includes(a.folded)?{folded:{value:a.folded},lens:{value:a.lens??null}}:{}}),o)}function Q(e){return e?`?team=${encodeURIComponent(e)}`:``}async function ae(e,{reportId:t,...n}={}){let r=t==null?``:`?reportId=${encodeURIComponent(t)}`,i=await W(`/api/teams/${encodeURIComponent(e)}/annotations${r}`,null,n),{reports:a,entries:o,comments:s,issues:c={}}=i??{};if(!a||typeof a!=`object`||Array.isArray(a)||!o||typeof o!=`object`||Array.isArray(o)||!Array.isArray(s)||!c||typeof c!=`object`||Array.isArray(c)||Object.values(a).some(e=>!Array.isArray(e)||e.some(e=>typeof e!=`string`))||s.some(e=>!e||typeof e.findingId!=`string`))return null;let l=new Map;for(let[e,t]of s.entries()){let n=t.findingId,r=l.get(n)??[];r.push(e),l.set(n,r)}let u=new Map,d=new Map,f=typeof i.revision==`string`?i.revision:null;return Object.assign(e=>{if(!Object.hasOwn(a,e))return null;if(d.has(e))return d.get(e);let t=JSON.stringify(a[e]),n=u.get(t);if(!n){let r=[...new Set(a[e])],i=r.flatMap(e=>l.get(e)??[]);n={entries:Object.fromEntries(r.filter(e=>Object.hasOwn(o,e)).map(e=>[e,o[e]])),comments:i.toSorted((e,t)=>e-t).map(e=>s[e]),issues:Object.fromEntries(r.filter(e=>Object.hasOwn(c,e)).map(e=>[e,c[e]]))},u.set(t,n)}return d.set(e,n),n},{revision:f})}async function oe(e,t,n){let r=(await W(`/api/reports/${encodeURIComponent(e)}/triage${Q(t)}`,null,n))?.entries;return typeof r==`object`&&r&&!Array.isArray(r)?r:null}async function se(e,n,r=null){if(t())return[];let i=r===null?``:`?reportId=${encodeURIComponent(r)}`,a=await W(`/api/teams/${encodeURIComponent(e)}/fixes${i}`,null,{signal:n});return Array.isArray(a?.fixes)?a.fixes:null}async function ce(e,t,n){let r=await W(`/api/reports/${encodeURIComponent(e)}/comments${Q(t)}`,null,n);return Array.isArray(r?.comments)?r.comments:null}async function le(e,{findingId:t,body:n,commentId:r=null,version:i},a,o){let s=r==null?``:`/${encodeURIComponent(r)}`;try{let c=await I(`/api/reports/${encodeURIComponent(e)}/comments${s}${Q(o)}`,{method:r==null?`POST`:`PATCH`,credentials:`same-origin`,headers:{"content-type":`application/json`,...a?{"x-csrf-token":a}:{}},body:JSON.stringify(r==null?{findingId:t,body:n}:{body:n,version:i})});return{status:c.status,comment:c.ok?(await c.json()).comment:null}}catch{return{status:0,comment:null}}}async function ue(e,t,n,r,i){try{return(await I(`/api/reports/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}${Q(i)}`,{method:`DELETE`,credentials:`same-origin`,headers:{"content-type":`application/json`,...r?{"x-csrf-token":r}:{}},body:JSON.stringify({version:n})})).status}catch{return 0}}async function de(e,t,n,r){try{return(await I(`/api/reports/${encodeURIComponent(e)}/triage${Q(r)}`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`,...n?{"x-csrf-token":n}:{}},body:JSON.stringify({entries:t})})).status}catch{return 0}}function fe(e){e&&(location.href=e)}async function pe(e){if(t())location.href=`/`;else{try{await I(`/api/auth/logout`,{method:`POST`,credentials:`same-origin`,headers:e?{"x-csrf-token":e}:{}})}catch{}location.reload()}}async function $(e,t){let n=await I(`/api/auth/view-as`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`,...t?{"x-csrf-token":t}:{}},body:JSON.stringify({userId:e})});if(!n.ok)throw Error(`HTTP ${n.status}`);location.assign(`/`)}async function me(e){try{await I(`/api/auth/view-as`,{method:`DELETE`,credentials:`same-origin`,headers:e?{"x-csrf-token":e}:{}})}catch{}location.assign(o[`admin-users`])}async function he(e){let t=await I(`/api/teams/${encodeURIComponent(e)}/share`,{credentials:`same-origin`});if(!t.ok)throw Error(`Could not load public links (${t.status})`);return(await t.json()).shares}async function ge(e,t,{id:n,revoke:r=!1,dependencies:i=!1,security:a=!1}={}){let o=n?`/${encodeURIComponent(n)}`:``,s=await I(`/api/teams/${encodeURIComponent(e)}/share${o}`,{method:r?`DELETE`:n?`PATCH`:`POST`,credentials:`same-origin`,headers:{"x-csrf-token":t,"content-type":`application/json`},...r?{}:{body:JSON.stringify({dependencies:i,security:a})}});if(!s.ok)throw Error(`Could not ${r?`revoke`:n?`update`:`create`} public link (${s.status})`);return s.json()}async function _e(e,t){let n=await I(`/api/bundles/${encodeURIComponent(e)}/download`,{credentials:`same-origin`});if(!n.ok)throw Error(`Could not download bundle (${n.status})`);let r=URL.createObjectURL(await n.blob()),i=document.createElement(`a`);i.href=r,i.download=t,i.click(),setTimeout(()=>URL.revokeObjectURL(r),6e4)}export{u as a,O as b,ee as c,I as d,L as e,R as f,z as g,B as h,G as i,ne as j,Z as k,re as l,ie as m,Q as n,ae as o,oe as p,se as q,ce as r,le as s,ue as t,de as u,fe as v,pe as w,$ as x,me as y,he as z,ge as A,_e as B};
@@ -1,52 +0,0 @@
1
- import{c as e,f as t,n}from"./chunk-WFDXHPT2.js";import{a as r}from"./chunk-IYPY47MC.js";import{a as i,b as a,c as o}from"./chunk-PWFUOLZK.js";import{D as s,E as c,F as l,J as u}from"./chunk-QRKFPLA4.js";import{d,e as f,f as p,x as m}from"./chunk-74AEKRES.js";import{a as h,b as ee,c as te}from"./chunk-C4Z6ZBXV.js";import{b as ne,c as g,d as _,f as v,g as y,j as re}from"./chunk-2XUEZHIP.js";function b(e){let t=null,n=0,r={module:null,load(){return t??=(n?import(`${e}?retry=${n}`):import(e)).then(e=>r.module=e,e=>{throw t=null,n++,e}),t}};return r}var ie=b(`./dialogs.js`),x=e=>async(...t)=>(await ie.load())[e](...t),ae=x(`openAdvisoryDetailsDialog`),oe=x(`openCommentDialog`),se=x(`openDeleteBundleDialog`),ce=x(`openDeleteReportDialog`),le=x(`openDetachBundleDialog`),ue=x(`openDetachReportDialog`),de=x(`openDiscardReviewDialog`),fe=x(`openDownloadBundleDialog`),pe=x(`openExportConfirmDialog`),me=x(`openExportViewDialog`),he=x(`openFindingHistoryDialog`),ge=x(`openFindingSourceDialog`),_e=x(`openFixLinkDialog`),ve=x(`openImportConflictDialog`),ye=x(`openLeaveWorkspaceDialog`),be=x(`openLocalContentImportDialog`),xe=x(`openLocalTriageImportDialog`),Se=x(`openManagedCommentsDialog`),Ce=x(`openManagedIssueDialog`),we=x(`openManagedShareDialog`),Te=x(`openNewWorkspaceDialog`),Ee=x(`openNpmCompareAdvisoriesDialog`),De=x(`openObjstoreRecoveryDialog`),Oe=x(`openPasskeySetupDialog`),ke=x(`openPersistenceDegradedDialog`),Ae=x(`openReportCompareDialog`),je=x(`openRepositoryItemDialog`),Me=x(`openRevalidationConflictsDialog`),Ne=x(`openStoragePersistDialog`),Pe=x(`openSyncDownloadDialog`),Fe=x(`openSyncSuggestDialog`),Ie=x(`openSyncUploadDialog`),Le=x(`openTriageComparisonDialog`),Re=x(`openTriageExportDialog`),ze=x(`openWhyDialog`),Be=x(`openWorkspaceExportDialog`),Ve=x(`openWorkspaceShareLinkDialog`),He=x(`openWorkspaceUnlockBundleDialog`),Ue=x(`openWorkspaceUnlockLinkDialog`);function We(e){if(!e?.startsWith(`#public=`))return null;let t=/^#public=([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]{43})$/u.exec(e);return t?{id:t[1],token:t[2]}:{id:``,token:``}}var Ge=globalThis.location?.hash,S=We(Ge);globalThis.addEventListener?.(`hashchange`,()=>{let e=globalThis.location?.hash;e?.startsWith(`#public=`)&&e!==Ge&&globalThis.location.reload()});function Ke(){return S}function qe(e=S){return`/api/shares/${encodeURIComponent(e.id)}/workspace`}function Je(e,t=S){return t?`${e.replace(/#.*$/su,``)}#public=${t.id}.${t.token}`:e}var C=[`admin`,`manage`,`triage`,`view`,`none`];function Ye(e){return typeof e==`string`&&C.includes(e)}function Xe(e,t){let n=C.indexOf(e);return n!==-1&&n<=C.indexOf(t)}function Ze(e){return e!=null&&!e.publicShare&&Xe(e.role,`view`)}var Qe={default:{className:`brand-deepview`,mark:`<path class="fg" d="M7.843 6.719c-1.605 0-2.926 1.292-3.477 1.947.466.58 1.872 2.024 3.496 2.024s2.907-1.292 3.486-2.005c-.627-.703-1.88-1.966-3.505-1.966m.019 3.857c-1.51 0-2.802-1.263-3.353-1.9.55-.617 1.814-1.852 3.334-1.852 1.51 0 2.698 1.12 3.335 1.852-.533.618-1.787 1.9-3.316 1.9m-.019-3.42c-.826 0-1.577.694-1.577 1.596 0 .789.599 1.577 1.577 1.577.893 0 1.587-.684 1.587-1.577-.01-.779-.627-1.596-1.587-1.596m0 3.069a1.476 1.476 0 0 1-1.482-1.473c0-.722.599-1.491 1.482-1.491.846 0 1.482.693 1.492 1.491 0 .808-.618 1.473-1.492 1.473m.01-2.727c-.637 0-1.264.532-1.264 1.244 0 .627.475 1.235 1.245 1.245.684 0 1.254-.522 1.254-1.244 0-.58-.475-1.236-1.235-1.245m-.02 2.403a1.167 1.167 0 0 1-1.149-1.159c0-.532.456-1.14 1.169-1.149.56 0 1.149.427 1.159 1.15 0 .636-.485 1.158-1.179 1.158m-.769-1.833c-.19.238-.275.494-.237.864l.74.057zm1.026-.294c-.295-.057-.665 0-.912.228l.323.607zm.133.047-.38.56.988.114c-.057-.275-.323-.579-.608-.674m-.124.741.456.912c.21-.209.352-.484.314-.836zm-1.225.504a.97.97 0 0 0 .57.617l.399-.551zm.713.664c.313.076.636.01.845-.161l-.295-.618zm-.637 1.55c0 .028-.028.066-.066.066h-.59c-.028 0-.066-.028-.066-.066s.029-.066.067-.066h.579c.048 0 .076.028.076.066m.712 0c0 .028-.028.066-.066.066h-.437c-.028 0-.066-.028-.066-.066s.028-.066.066-.066h.437c.038 0 .066.028.066.066m.666 0c0 .028-.029.066-.067.066h-.37c-.029 0-.067-.028-.067-.066s.029-.066.067-.066h.37c.038 0 .067.028.067.066m-1.672.351c0 .029-.029.067-.067.067h-.295c-.028 0-.066-.028-.066-.066 0-.029.029-.067.067-.067h.294c.038 0 .066.028.066.066m.694 0c0 .029-.028.067-.066.067h-.409c-.028 0-.066-.028-.066-.066 0-.029.028-.067.066-.067h.399c.038 0 .076.028.076.066m.732 0c0 .029-.029.067-.067.067h-.465c-.029 0-.067-.028-.067-.066 0-.029.029-.067.067-.067h.465c.038 0 .067.028.067.066m-1.093.371a.065.065 0 0 1-.067.066h-.627c-.028 0-.075-.028-.066-.066 0-.028.029-.066.067-.066h.627c.038 0 .066.028.066.066m.684 0a.065.065 0 0 1-.066.066h-.39c-.028 0-.076-.028-.066-.066 0-.028.028-.066.066-.066h.39c.038 0 .066.028.066.066M5.088 6.263c-.019-.105-.114-.19-.237-.19s-.257.104-.257.237.105.238.247.238c.105 0 .218-.076.238-.18h.864v.826l.095-.048V6.31c0-.028-.019-.057-.048-.057h-.902zm-.237.19c-.076 0-.143-.066-.143-.143s.066-.142.143-.142.142.066.142.143c.01.076-.066.142-.143.142m2.89-.323H6.38l.418-.475v-.332a.255.255 0 0 0 .218-.248c0-.123-.114-.256-.256-.256s-.266.114-.266.257c0 .123.095.228.209.247v.284l-.456.523v.893l.095-.047v-.742h1.396c.029 0 .067-.009.067-.057 0-.028-.019-.047-.067-.047m-1.13-1.054c0-.076.066-.152.152-.152s.152.066.152.151c0 .076-.066.152-.152.152s-.152-.066-.152-.152m-.836 5.264h-.874c-.019-.105-.114-.219-.247-.219s-.256.105-.256.257c0 .132.114.275.266.275.104 0 .218-.076.237-.19h.827v.608l-.257.285a.3.3 0 0 0-.095-.019c-.133 0-.256.105-.256.228 0 .133.104.238.237.238.124 0 .247-.105.247-.238a.23.23 0 0 0-.057-.152l.285-.304v-.712c0-.029-.019-.058-.057-.058m-1.121.219a.16.16 0 0 1-.152-.161c0-.077.066-.162.152-.162s.152.066.152.152-.066.171-.152.171m.713 1.14c-.076 0-.143-.066-.143-.143s.066-.133.143-.133.142.067.142.143c0 .066-.066.133-.143.133m5.472-1.377a.24.24 0 0 0-.237.208h-1.13c-.029 0-.038.02-.038.048v.712l-.323.39h-.029a.245.245 0 0 0-.247.247c0 .133.114.256.247.256s.247-.113.247-.256a.26.26 0 0 0-.123-.219l.313-.38v-.674h1.083c.019.105.114.2.238.2.133 0 .266-.105.266-.257 0-.133-.105-.276-.266-.276m-1.758 1.767a.15.15 0 0 1-.143-.152c0-.075.067-.142.143-.142s.152.066.152.143a.15.15 0 0 1-.152.151m1.758-1.33a.15.15 0 0 1-.143-.152.147.147 0 0 1 .294.001.15.15 0 0 1-.152.151M8.917 5.55h-.399a.075.075 0 0 1-.076-.076c0-.028.029-.066.067-.066h.418c.028 0 .066.028.066.066s-.038.076-.076.076m.742 0H9.22c-.038 0-.067-.028-.067-.076 0-.028.029-.066.067-.066h.437c.038 0 .066.028.066.066s-.028.076-.066.076m.883 0h-.598c-.029 0-.067-.028-.067-.076 0-.028.029-.066.067-.066h.598c.028 0 .066.028.066.066s-.028.076-.066.076m-1.282.4h-.741c-.038 0-.076-.029-.076-.067s.028-.076.066-.076h.75c.039 0 .067.038.067.076 0 .029-.028.067-.066.067m.797 0h-.503c-.038 0-.076-.029-.076-.067s.028-.066.066-.066h.513c.038 0 .067.028.067.066 0 .029-.029.067-.067.067m.476 0h-.19c-.039 0-.067-.029-.067-.067s.028-.066.066-.066h.2c.028 0 .066.028.066.066 0 .029-.028.067-.075.067m-1.682.398h-.332c-.039 0-.077-.028-.077-.066s.029-.066.067-.066h.342c.038 0 .076.028.076.066s-.028.066-.076.066m.789 0h-.494c-.038 0-.067-.028-.067-.066s.029-.066.067-.066h.494c.038 0 .066.028.066.066s-.028.066-.066.066m.893 0h-.599c-.038 0-.076-.028-.076-.066s.028-.066.066-.066h.618c.028 0 .066.028.066.066s-.028.066-.076.066m.418.305a.69.69 0 0 0-.674.712c0 .086.019.18.048.257l.085.066c-.028-.085-.057-.171-.057-.304 0-.285.228-.646.598-.646.295 0 .599.228.599.636a.58.58 0 0 1-.599.59.8.8 0 0 1-.237-.048l.123.114a.4.4 0 0 0 .114.01c.39 0 .684-.276.684-.666 0-.313-.266-.712-.684-.722m.353.552-.019-.01-.161.19-.143-.01-.057-.047-.019-.133.19-.2a.28.28 0 0 0-.361.077c-.076.095-.076.209-.038.351l-.247.304.171.152.266-.266c.142.038.285.019.38-.095a.31.31 0 0 0 .038-.313"/>`},"claude-security":{className:`brand-claude`,mark:`<path class="fg" d="${f}"/>`},"codex-security":{className:`brand-codex`,mark:`<path class="fg" d="${p}"/>`},deepsec:{className:`brand-vercel`,mark:`<path class="fg" d="m8 5.97 3.5 6.062h-7Z"/>`},"markdown-generic":{className:`brand-markdown`,mark:`<path class="fg" d="M4 7h1.2l1.2 1.5L7.6 7h1.2v4H7.6V8.8L6.4 10 5.2 8.8V11H4zm5.6 0h1.2v2.3H12l-1.8 1.8-1.8-1.8h1.2Z"/>`},piolium:{className:`brand-piolium`,mark:`<path class="fg" d="M8 6.4 5.6 7.2v2.3c0 1.6 1 2.7 2.4 3.3 1.4-.6 2.4-1.7 2.4-3.3V7.2Z"/>`}},$e={default:[`#2563eb`,`#fff`],"claude-security":[`#d97757`,`#fff`],"codex-security":[`#fff`,`#000`],deepsec:[`#000`,`#fff`],piolium:[`#fbb829`,`#1c1b19`],"markdown-generic":[`#374151`,`#fff`]},et=Object.fromEntries(Object.entries(Qe).map(([e,{className:t,mark:n}])=>{let[r,i]=$e[e];return[e,`<svg class="file-icon ${t}" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path class="bg" fill="${r}"${e===`codex-security`||e===`deepsec`?` stroke="${i}" stroke-width=".5"`:``} d="M3 2h6l4 4v8H3z"/><path fill="rgba(0,0,0,.18)" d="M9 2v4h4Z"/><g fill="${i}">${n}</g></svg>`]})),tt=Object.fromEntries(Object.entries(Qe).map(([e,{className:t,mark:n}])=>[e,`<span class="report-logo ${t}" aria-hidden="true"><svg viewBox="${e==="default"?`3.5 4 9 9`:`4 5 8 8`}" width="14" height="14">${n}</svg></span>`]));function nt(e){let t=e.toLowerCase();if(t.endsWith(`.generic-md`)){let t=e.slice(0,-11);try{return decodeURIComponent(t)}catch{return t}}return t.endsWith(`.codex`)?e.slice(0,-6).replaceAll(`__`,`/`):e}var w=ee(class extends te{constructor(e){if(super(e),e.type!==h.PROPERTY&&e.type!==h.ATTRIBUTE&&e.type!==h.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!a(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===v||t===y)return t;let n=e.element,r=e.name;if(e.type===h.PROPERTY){if(t===n[r])return v}else if(e.type===h.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return v}else if(e.type===h.ATTRIBUTE&&n.getAttribute(r)===t+``)return v;return o(e),t}}),rt=_`<path d="M8 1C4.5 1 4 1.5 4 3v1h4v1H3C1.5 5 1 6 1 8s.5 3 2 3h1V9c0-1.5 1-2 2.5-2H10c1.5 0 2-.5 2-2V3c0-1.5-.5-2-4-2Z" fill="#3776ab"/><path d="M8 1C4.5 1 4 1.5 4 3v1h4v1H3C1.5 5 1 6 1 8s.5 3 2 3h1V9c0-1.5 1-2 2.5-2H10c1.5 0 2-.5 2-2V3c0-1.5-.5-2-4-2Z" fill="#ffd43b" transform="rotate(180 8 8)"/><circle cx="6" cy="2.8" r=".65" fill="#fff"/><circle cx="10" cy="13.2" r=".65" fill="#fff"/>`,it=_`<path d="M6.42 2.11 6.81 .49 9.19 .49 9.58 2.11 11.05 2.72 12.47 1.85 14.15 3.53 13.28 4.95 13.89 6.42 15.51 6.81 15.51 9.19 13.89 9.58 13.28 11.05 14.15 12.47 12.47 14.15 11.05 13.28 9.58 13.89 9.19 15.51 6.81 15.51 6.42 13.89 4.95 13.28 3.53 14.15 1.85 12.47 2.72 11.05 2.11 9.58 .49 9.19 .49 6.81 2.11 6.42 2.72 4.95 1.85 3.53 3.53 1.85 4.95 2.72ZM8 3.7a4.3 4.3 0 1 0 0 8.6 4.3 4.3 0 1 0 0 -8.6Z" fill="#c97d5d" fill-rule="evenodd"/><text x="8" y="10.8" text-anchor="middle" fill="currentColor" font-family="serif" font-size="8" font-weight="700">R</text>`,at=_`<g fill="#8892bf" transform="translate(0 .5) scale(.5)"><path d="M28 10a4 4 0 0 0-4-4h-6v6a6 6 0 0 1-6 6h-2v2h2v6h4v-6h8v6h4V16h2v-4a2 2 0 0 0-2-2"/><path d="M12 4H8v2a6 6 0 0 0-6 6v6a2 2 0 0 0 2 2v2H2.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5H6a2 2 0 0 0 2-2v-8h4a4 4 0 0 0 4-4V8a4 4 0 0 0-4-4M6 14H4v-2h2Z"/></g>`,ot=/^(?:(?:un)?licen[cs]e|copying)(?:-[^/.]*)?(?:\.(?:mit|bsd|isc|apache|[al]?gpl|mpl|epl|eupl|cddl|cc0|zlib|psf|boost|bsl|artistic|unicode|ofl|wtfpl|lesser|lib)(?:v?\d[^/.]*|-[^/.]*)?)?(?:\.\d[^/.]*)*(?:\.(?:md|markdown|txt|text|rst|adoc|asciidoc|org))?$/iu,st=new Set([`resource:base64`,`directory`,`binary`]),ct=e=>st.has(e);function lt(e,t,n){return n!==null&&n!==`markdown`||ct(t)?!1:ot.test(e.slice(e.lastIndexOf(`/`)+1))}function ut(e,t){return(e?.kind===`stasis`?e.bundle?.formats?.get(t):void 0)??(e?.npmBinaries?.has(t)?`binary`:void 0)}var T=e=>e.slice(e.lastIndexOf(`/`)+1),dt=e=>{let t=T(e),n=t.lastIndexOf(`.`);return n>0?t.slice(n+1).toLowerCase():``},ft=new Set([`gemfile`,`gemfile.lock`,`.ruby-version`]),pt=new Set([`node`,`so`,`dylib`,`dll`]);function mt(t,n){let r=e(t,n);if(r===null&&/\.map$/iu.test(t))return`map`;if(lt(t,n,r))return`license`;if([`javascript`,`jsx`].includes(r))return`js`;if([`typescript`,`tsx`].includes(r))return`ts`;let i=dt(t);return[`c`,`cpp`,`objectivec`].includes(r)&&i===`h`?`header`:[`solidity`,`rust`,`php`,`python`,`json`,`markdown`,`css`,`yaml`,`markup`,`java`,`ruby`,`c`,`cpp`].includes(r)?r:r===`bash`?`shell`:r===`objectivec`?`objc`:r===null&&ft.has(T(t).toLowerCase())?`ruby`:r===null&&T(t).toLowerCase()===`codeowners`?`owners`:i===`wasm`?`wasm`:pt.has(i)?`native`:`generic`}var ht=_`<path d="M1.5 3.4 5.3 2l5.4 1.6 3.8-1.4v10.4l-3.8 1.4-5.4-1.6-3.8 1.4Z" fill="#3fa59a" fill-opacity=".22" stroke="#3fa59a" stroke-width="1.1" stroke-linejoin="round"/><path d="M5.3 2v10.4m5.4-8.8V14" stroke="#3fa59a" stroke-width="1.1"/>`,gt=_`<circle cx="8" cy="2.6" r="1" fill="currentColor"/><path d="M8 3.6v9.9m-3.5 0h7M3 4.6h10M3 4.6 1.2 9.2M3 4.6l1.8 4.6M13 4.6l-1.8 4.6M13 4.6l1.8 4.6" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" stroke-linejoin="round"/><path d="M1 9.2h4a2 2 0 0 1-4 0Zm10 0h4a2 2 0 0 1-4 0Z" fill="currentColor"/>`,_t=_`<rect x="1" y="1" width="14" height="14" rx="2" fill="#663399"/><text x="14" y="13.2" text-anchor="end" fill="#fff" font-family="sans-serif" font-size="6.4" font-weight="700" letter-spacing="-.2">CSS</text>`,vt=_`<path d="M1 11.5v-7h2l1.7 2.3 1.7-2.3h2v7h-2V7.8L4.7 10 3 7.8v3.7Zm10.2-7h2V8H15l-2.8 3.5L9.4 8h1.8Z" fill="var(--green, #3fb950)"/>`,E=(e,t,n=`#fff`)=>t.length>2?_`<rect x="1" y="1" width="14" height="14" rx="2" fill=${e}/><text x="8" y="10.6" text-anchor="middle" fill=${n} font-family="sans-serif" font-size="6.2" font-weight="700" letter-spacing="-.2">${t}</text>`:_`<rect x="1" y="1" width="14" height="14" rx="2" fill=${e}/><text x="8" y="11.5" text-anchor="middle" fill=${n} font-family="sans-serif" font-size="8" font-weight="700">${t}</text>`,yt={__proto__:null,js:E(`#e6c84f`,`JS`,`#202020`),ts:E(`#3178c6`,`TS`),solidity:_`<path d="m8 1 4 6-4 2-4-2Z" fill="currentColor"/><path d="m4 8 4 2 4-2-4 7Z" fill="currentColor" opacity=".65"/>`,rust:it,php:at,python:rt,map:ht,markdown:vt,license:gt,css:_t,json:_`<path d="M6 2.5C4.6 2.5 4.4 3.3 4.4 4.6v1.6C4.4 7.4 3.8 8 2.6 8c1.2 0 1.8.6 1.8 1.8v1.6c0 1.3.2 2.1 1.6 2.1M10 2.5c1.4 0 1.6.8 1.6 2.1v1.6c0 1.2.6 1.8 1.8 1.8-1.2 0-1.8.6-1.8 1.8v1.6c0 1.3-.2 2.1-1.6 2.1" fill="none" stroke="light-dark(#a26e12, #f2b440)" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>`,yaml:E(`#cb171e`,`YML`),shell:_`<rect x="1.5" y="2.5" width="13" height="11" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.1"/><path d="m4.2 6 2 2-2 2m3.3 0h4.2" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>`,markup:_`<path d="M4.8 4.5 1.5 8l3.3 3.5m6.4-7L14.5 8l-3.3 3.5M9.3 3 6.7 13" fill="none" stroke="#e34c26" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>`,wasm:E(`#654ff0`,`WA`),native:_`<rect x="4" y="4" width="8" height="8" rx="1" fill="none" stroke="currentColor" stroke-width="1.1"/><rect x="6.4" y="6.4" width="3.2" height="3.2" fill="currentColor"/><path d="M6 1.5V4m4-2.5V4M6 12v2.5m4-2.5v2.5M1.5 6H4m-2.5 4H4M12 6h2.5M12 10h2.5" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/>`,java:_`<path d="M5.4 5.8c-.9-1 .9-1.7 0-3M8.4 5.8c-.9-1 .9-1.7 0-3" fill="none" stroke="#e76f00" stroke-width="1.1" stroke-linecap="round"/><path d="M2.5 7h9v3.3A3.7 3.7 0 0 1 7.8 14H6.2a3.7 3.7 0 0 1-3.7-3.7Z" fill="#5382a1"/><path d="M11.5 8.2h.9a1.6 1.6 0 0 1 0 3.2h-1.1" fill="none" stroke="#5382a1" stroke-width="1.1"/>`,objc:E(`#438eff`,`OC`),c:E(`#3949ab`,`C`),cpp:E(`#00599c`,`C++`),header:E(`#607d8b`,`H`),owners:_`<circle cx="11" cy="4.7" r="2" fill="currentColor" opacity=".55"/><path d="M11.3 8.3c2.1.2 3.5 1.9 3.5 4.2h-3.4c-.2-1.7-1-3-2.2-3.8.6-.3 1.3-.4 2.1-.4Z" fill="currentColor" opacity=".55"/><circle cx="6" cy="5.3" r="2.4" fill="currentColor"/><path d="M1.6 13.5c0-2.6 2-4.5 4.4-4.5s4.4 1.9 4.4 4.5Z" fill="currentColor"/>`,ruby:_`<path d="M4.5 2.5h7L14.5 6 8 14 1.5 6Z" fill="#cc342d"/><path d="M1.5 6h13M4.5 2.5 6 6l2 8 2-8 1.5-3.5M6 6l2-3.5L10 6" fill="none" stroke="#fff" stroke-opacity=".55" stroke-width=".7" stroke-linejoin="round"/>`},bt=_`<path d="M4 1.5h5l3 3v10H4Zm5 0v3h3M6 8h4M6 10.5h4" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>`;function xt(e,t){let n=mt(e,t);return g`<svg class="source-file-icon" data-file-type="${n}" width="16" height="16" viewBox="0 0 16 16" style="${i({flex:`none`})}" aria-hidden="true">${yt[n]??bt}</svg>`}var St=g`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.2" style="${i({flex:`none`})}" aria-hidden="true"><path d="M1.5 4V2.5h5L8 4h6.5v9h-13Z" stroke-linejoin="round"/></svg>`,Ct=g`<svg class="bundle-code-tree-npm" width="12" height="12" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M1 1h14v14H1Zm3 3v8h4V6h2v6h2V4Z"/></svg>`,wt=g`<svg class="bundle-code-tree-soldeer" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m8 1 6 3.5v7L8 15l-6-3.5v-7Z" fill="none" stroke="currentColor" stroke-width="1"/><path d="m8 3 2.5 4L8 8.5 5.5 7Zm-2.5 5L8 9.5 10.5 8 8 13Z" fill="currentColor"/></svg>`,Tt=g`<svg class="bundle-code-tree-composer" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1 15 4.5v7L8 15l-7-3.5v-7Z" fill="#8892bf"/><path d="m1 4.5 7 3.5 7-3.5M8 8v7M4.5 2.75l7 3.5" fill="none" stroke="var(--surface, #fff)" stroke-width=".9"/></svg>`,Et=g`<svg class="bundle-code-tree-cargo" width="12" height="12" viewBox="9.25 6.14 14 14" aria-hidden="true"><path d="m16.264 11.547 6.2-2.446v8.16l-6.2 2.485Zm0-.019-6.2-2.481v8.123l6.2 2.522Z" fill="#e5ac3d" stroke="#73561f" stroke-miterlimit="10" stroke-width=".05430921534373718px"/><path d="m16.277 11.508 6.169-2.435-6.2-2.531-6.2 2.467Z" fill="#e3b04e" stroke="#73561f" stroke-miterlimit="10" stroke-width=".05430921534373718px"/><path d="m12.82 10.149 6.196-2.467" fill="none" stroke="#73561f" stroke-miterlimit="10" stroke-width=".05430921534373718px"/><path d="m18.301 7.395-6.24 2.484 1.482.593 6.196-2.466z" fill="#fff" stroke="#73561f" stroke-miterlimit="10" stroke-width=".04741218643894885px" opacity=".3"/><path d="m13.562 10.47-1.453-.565v1.645l.201-.136.18.285.104.04.138-.121.137.228.129.05.189-.166.238.332.137.053zm-1.423 7.576 1.461.545-.023-1.645-.2.139-.184-.282-.104-.039-.136.123-.14-.226-.131-.049-.186.169-.243-.329-.137-.051z" fill="#fff" stroke="#73561f" stroke-miterlimit="10" stroke-width=".06661495224335688px" opacity=".3"/><path d="m21.426 13.49-.172-.039V13.4l.148-.208a.1.1 0 0 0 .018-.065.035.035 0 0 0-.037-.03l-.189.006-.015-.045.118-.222a.07.07 0 0 0 .007-.063.04.04 0 0 0-.045-.018l-.2.051-.024-.037.084-.229a.06.06 0 0 0 0-.058.04.04 0 0 0-.051-.006l-.2.094-.032-.027.047-.227a.05.05 0 0 0-.016-.052.05.05 0 0 0-.056.007l-.2.133-.039-.017.007-.215a.04.04 0 0 0-.026-.043.07.07 0 0 0-.058.02l-.184.166-.045-.006-.033-.2a.036.036 0 0 0-.036-.032.08.08 0 0 0-.057.031l-.164.194-.049.005-.071-.168a.036.036 0 0 0-.044-.021.1.1 0 0 0-.055.042l-.138.214-.05.016-.107-.135a.04.04 0 0 0-.05-.008.1.1 0 0 0-.05.051l-.107.226-.05.026-.138-.1a.05.05 0 0 0-.055 0 .1.1 0 0 0-.044.058l-.071.228-.049.036-.164-.054a.06.06 0 0 0-.057.017.1.1 0 0 0-.036.063l-.033.223-.045.044-.184-.01a.08.08 0 0 0-.058.029.1.1 0 0 0-.026.065l.007.209-.039.05-.2.035a.1.1 0 0 0-.056.04.1.1 0 0 0-.016.065l.046.187-.032.054-.2.079a.1.1 0 0 0-.051.049.07.07 0 0 0 0 .062l.084.157-.024.057-.2.119a.1.1 0 0 0-.045.057.06.06 0 0 0 .007.057l.118.122-.015.058-.189.155a.1.1 0 0 0-.037.062.045.045 0 0 0 .018.05l.148.082v.055l-.172.185a.1.1 0 0 0-.028.065.04.04 0 0 0 .028.041l.172.039v.051l-.148.208a.1.1 0 0 0-.018.065.035.035 0 0 0 .037.03l.189-.006.015.045-.118.222a.07.07 0 0 0-.007.063.04.04 0 0 0 .045.018l.2-.051.024.037-.084.229a.06.06 0 0 0 0 .058.04.04 0 0 0 .051.006l.2-.094.032.027-.046.227a.05.05 0 0 0 .016.051.05.05 0 0 0 .056-.007l.2-.133.039.017-.007.215a.04.04 0 0 0 .026.043.07.07 0 0 0 .058-.02l.184-.166.045.006.033.2a.035.035 0 0 0 .036.032.08.08 0 0 0 .057-.031l.164-.194.049-.005.071.168a.036.036 0 0 0 .044.02.1.1 0 0 0 .055-.042l.138-.214.05-.016.107.135a.04.04 0 0 0 .05.008.1.1 0 0 0 .05-.051l.107-.226.05-.027.138.1a.05.05 0 0 0 .055 0 .1.1 0 0 0 .044-.058l.071-.228.049-.036.164.054a.06.06 0 0 0 .057-.017.1.1 0 0 0 .036-.063l.033-.223.045-.044.184.01a.08.08 0 0 0 .058-.029.1.1 0 0 0 .026-.065l-.007-.209.039-.05.2-.035a.1.1 0 0 0 .056-.04.1.1 0 0 0 .016-.065l-.046-.187.017-.053.2-.079a.1.1 0 0 0 .051-.049.07.07 0 0 0 0-.062l-.084-.157.024-.057.2-.119a.1.1 0 0 0 .045-.057.06.06 0 0 0-.007-.057l-.118-.122.015-.058.189-.155a.1.1 0 0 0 .037-.062.045.045 0 0 0-.018-.05l-.148-.082v-.055l.172-.185a.1.1 0 0 0 .028-.065.04.04 0 0 0-.014-.039m-1.153 1.988c-.066.013-.108-.037-.094-.112a.21.21 0 0 1 .145-.16c.066-.013.108.037.094.112a.21.21 0 0 1-.145.16m-.059-.39a.19.19 0 0 0-.132.146l-.061.325a2.3 2.3 0 0 1-.619.4 1.4 1.4 0 0 1-.632.123l-.061-.273c-.013-.057-.072-.072-.132-.033l-.252.164a1 1 0 0 1-.13-.106l1.226-.521q.022-.007.023-.026v-.455c0-.013-.009-.012-.023-.006l-.359.152v-.288l.388-.165a.16.16 0 0 1 .239.115c.015.057.049.249.072.3s.117.172.217.13l.611-.26.022-.012a3 3 0 0 1-.139.23Zm-1.7 1.13c-.066.043-.131.026-.145-.037a.2.2 0 0 1 .094-.192c.066-.043.131-.026.145.037a.2.2 0 0 1-.09.192Zm-.465-1.779a.18.18 0 0 1-.062.2c-.062.055-.134.056-.161 0a.18.18 0 0 1 .062-.2c.066-.051.138-.053.165 0Zm-.143.416.263-.234a.16.16 0 0 0 .057-.178l-.054-.105.213-.09v1l-.429.182a1.4 1.4 0 0 1-.057-.407c.001-.052.001-.11.011-.168Zm1.152-.587v-.3l.506-.215c.026-.011.185-.047.185.077 0 .1-.122.192-.222.234l-.47.2Zm1.84-.516v.118l-.154.065a.04.04 0 0 0-.022.036v.074a.31.31 0 0 1-.176.3c-.078.043-.165.036-.176-.01-.046-.253-.123-.278-.245-.327a1 1 0 0 0 .308-.578.3.3 0 0 0-.235-.315.57.57 0 0 0-.322.026l-1.592.677a2.7 2.7 0 0 1 .84-.853l.188.127c.042.029.113 0 .157-.063l.21-.3a.94.94 0 0 1 1.027.33l-.144.4c-.025.069 0 .128.057.13l.277.011q.004.073.004.152Zm-1.591-1.044c.049-.069.126-.1.172-.069s.045.113 0 .183-.126.1-.172.069-.044-.114.005-.184Zm1.427.6a.19.19 0 0 1 .161-.133c.062 0 .089.066.062.142a.19.19 0 0 1-.161.133c-.057-.006-.085-.07-.058-.15Z" opacity=".55"/><path d="M0 16.309h22.926v9.971L45.72 13.139 22.926 0v9.97H0z" fill="#231f20" transform="matrix(0 -.029 .022 .013 10.451 11.138)"/><path d="M0 16.309h22.926v9.971L45.72 13.139 22.926 0v9.97H0z" fill="#231f20" transform="matrix(0 -.029 .022 .013 15.013 12.984)"/></svg>`;function Dt(e){return e===`composer`?Tt:e===`cargo`?Et:e===`soldeer`?wt:Ct}var Ot=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/iu,kt=200;function At(e){let t=[...e];return t.length>kt?`${t.slice(0,kt-1).join(``).trimEnd()}\u2026`:e}var D=e=>e.split(`/`).map(encodeURIComponent).join(`/`),jt=(e,t)=>`https://github.com/${D(e)}/releases/tag/${D(t)}`;function Mt(e,t){return t&&e?.sha===t&&Array.isArray(e.tags)?e.tags.filter(e=>typeof e==`string`&&e):[]}function Nt(e,t,n=null){let r=typeof e?.github==`string`&&typeof n==`string`&&n.toLowerCase()===e.github.toLowerCase()?Mt(e,t):[],i=t&&e?.sha===t&&typeof e.details?.subject==`string`?e.details:null;if(i||r.length!==0)return JSON.stringify({tags:r,...i?{title:At(i.subject),authorName:i.authorName,authorLogin:i.authorLogin,date:i.committedAt??i.authoredAt}:{}})}function Pt(e,t=``,n=null){let i=[],a=s(e);if(a){let o=[c(e.repo),c({directory:t})].filter(Boolean).join(`/`),l=r(e.repo?.commit),u=o.split(`/`).map(encodeURIComponent).join(`/`),d=`https://github.com/${a}`,f=s({repo:{github:n?.github}}),p=f?Mt(n,l):[];i.push({label:`GitHub`,text:a+(o?`/${o}`:``),href:l||o?`${d}/tree/${l??`HEAD`}${u?`/${u}`:``}`:d,...l?{commit:{hash:l,text:l.slice(0,7),href:`${d}/commit/${l}`,...p.length>0?{tags:p.map(e=>({name:e,href:jt(f,e)}))}:{}}}:{}})}let o=e?.package?.npm;if(typeof o?.name==`string`&&Ot.test(o.name)){let e=typeof o.version==`string`?o.version.trim():``;i.push({label:`npm`,text:o.name+(e?`@${e}`:``),href:`https://www.npmjs.com/package/${o.name}${e?`/v/${encodeURIComponent(e)}`:``}`})}return i}function Ft(e){if(e?.kind===`sourcemap`)return t(e);let n=new Map;if(e?.kind!==`stasis`||!e.bundle)return n;for(let t of e.bundle.imports.values())for(let[e,r]of t){n.has(e)||n.set(e,new Set);for(let t of r.values()){let r=typeof t==`string`?[t]:t instanceof Map?t.values():[];for(let t of r)typeof t==`string`&&n.get(e).add(t)}}return n}var It=e=>[...n(e)].filter(([,e])=>e!=null).map(([e])=>e);function Lt(e,t){let n=new Map,r=e?.kind===`stasis`?e.bundle?.reason:null;if(!r||typeof r!=`object`||Array.isArray(r))return n;let i=new Set(t??It(e));for(let[e,t]of Object.entries(r).toSorted(([e],[t])=>e.localeCompare(t))){if(!e||!Array.isArray(t))continue;let r=new Set(t.filter(e=>typeof e==`string`&&i.has(e)));r.size>0&&n.set(e,r)}return[...n.values()].some(e=>e.size<i.size)||n.clear(),n}function Rt(e,t){let n=t&&[...t],r=Lt(e,n),i=e?.kind===`stasis`?[...e.bundle?.entries??[]]:[],a=new Set(i.length>1?n??It(e):[]),o=new Set(i.filter(e=>a.has(e))),s=Object.values(e?.bundle?.reason??{}).filter(Array.isArray);(o.size<2||s.length>0&&!s.some(e=>new Set(e.filter(e=>o.has(e))).size>1))&&o.clear();let c=[...[...r.keys()].map(e=>`reason:${e}`),...[...o].toSorted().map(e=>`entry:${e}`)];return{ids:c,has:e=>c.includes(e),files(t){if(!c.includes(t))return null;if(t.startsWith(`reason:`))return r.get(O(t));let n=Ft(e),i=new Set([O(t)]);for(let e of i)for(let t of n.get(e)??[])i.add(t);return new Set([...i].filter(e=>a.has(e)))}}}var O=e=>e.slice(e.indexOf(`:`)+1),zt=e=>e.ids.map(e=>({id:e,label:O(e)}));function Bt(e,t){let n=l(e);if(n===null)return null;let r=t.replace(/\.(?:md|markdown)$/iu,``),i=new Set;return n.map(({displayName:e,data:t})=>{let n=`${r}: ${e}`.replaceAll(`%`,`%25`).replaceAll(/[\\/\p{Cc}]/gu,`_`)+`.generic-md`;if(i.has(n))throw Error(`Markdown (generic): products produce the same report name: ${n}`);return i.add(n),{name:n,content:JSON.stringify(t)}})}var Vt=`...`,Ht=120;function Ut(e){for(let t of(u(e)??[]).flat()){let e=t?.description;typeof e==`string`&&e.length===Ht&&e.endsWith(Vt)&&(t.description=`${e.slice(0,-Vt.length)}\u2026`)}return e}var Wt=b(`./scan.js`),Gt=()=>Wt.load();function Kt(e){if(/^https?:\/\//iu.test(e)){try{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean);if(n.length>=2)return{owner:`${t.host}/${n[0]}`,name:n.slice(1).join(`/`)}}catch{}return{owner:null,name:e}}let t=/^([^\s/:]+)\/(.+)$/u.exec(e);return t?{owner:t[1],name:t[2]}:{owner:null,name:e}}var qt=e=>e.normalize(`NFKC`).toLocaleLowerCase(),k=(e,t)=>e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`}),A=Symbol(`other repositories`);function Jt(e,t=``,n=null,{includeSingletonOrganizations:r=!1}={}){let i=e.map(e=>({...e,...e.special?{owner:null,name:e.label}:Kt(e.label)})),a=new Map;for(let e of i)e.owner!=null&&a.set(e.owner,(a.get(e.owner)??0)+1);let o=r?1:2,s=[...a].filter(([,e])=>e>=o).toSorted(([e],[t])=>k(e,t)).map(([e,t])=>({value:e,name:e,count:t})),c=e=>(a.get(e.owner)??0)<o,l=i.filter(e=>!e.special&&!e.reset&&c(e)).length;l>0&&s.push({value:A,name:`Other`,count:l});let u=s.some(e=>e.value===n)?n:null,d=qt(t.trim()).split(/\s+/u).filter(Boolean),f=e=>d.every(t=>qt(e.label).includes(t)),p=i.filter(e=>e.reset||e.special&&f(e)),m=i.filter(e=>!e.reset&&!e.special&&f(e)&&(u==null||(u===A?c(e):e.owner===u))),h=new Map;for(let e of m){let t=(a.get(e.owner)??0)>=o?e.owner:null;h.has(t)||h.set(t,[]),h.get(t).push(e)}return{facets:s,activeFacet:u,pinned:p,sections:[...h].toSorted(([e],[t])=>e==null?1:t==null?-1:k(e,t)).map(([e,t])=>({label:e??(s.some(e=>e.value!==A)?`Other`:null),organization:e!=null,options:t.toSorted((e,t)=>k(e.label,t.label))})),count:m.length+p.filter(e=>!e.reset).length,total:i.filter(e=>!e.reset).length,showFacets:s.length>1}}function Yt(e,t,n){let r=e[0].getBoundingClientRect().top,i=1;for(;i<e.length&&Math.abs(e[i].getBoundingClientRect().top-r)<1;)i++;if(i===1&&(n===`ArrowLeft`||n===`ArrowRight`))return t;let a=t+{ArrowLeft:-1,ArrowRight:1,ArrowUp:-i,ArrowDown:i}[n];if(a<0)return n===`ArrowUp`?-1:t;let o=Math.floor((e.length-1)/i);return a<e.length?a:Math.floor(t/i)<o?e.length-1:t}var Xt=class extends re{static properties={options:{attribute:!1},value:{attribute:!1},label:{type:String},placeholder:{type:String},disabled:{type:Boolean},_query:{state:!0},_facet:{state:!0},_open:{state:!0}};static styles=ne`:host{display:block;min-width:0}:host,.menu{-webkit-app-region:no-drag;app-region:no-drag}*{box-sizing:border-box}button,input{font:inherit;color:var(--text)}button{cursor:default;user-select:none}.trigger{display:flex;align-items:center;gap:.6rem;width:100%;height:2rem;padding:.28rem .5rem;border:1px solid var(--border);border-radius:var(--ui-radius, 5px);background:var(--bg);text-align:left;font-size:.76rem}.trigger:hover:not(:disabled){border-color:var(--muted)}.trigger:disabled{opacity:.5}:host([variant=filter]){display:inline-block;max-width:min(20rem,100%)}:host([variant=filter]) .trigger{height:30px;min-width:8.5rem;background:transparent;font-size:.8rem;font-weight:500;border-radius:var(--ui-radius, 4px)}.name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.option-copy{flex:1;min-width:0;display:grid;gap:.08rem}.secondary{color:var(--muted);font-size:.64rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.secondary.is-warning{color:var(--warning);font-weight:600}.detail.is-noted{padding:0 .35rem;border-radius:3px;color:var(--accent);background:rgb(from var(--accent) r g b / .13);font-weight:600}.avatar{display:grid;place-items:center;flex:0 0 1.5rem;width:1.5rem;height:1.5rem;border-radius:50%;color:var(--accent);background:rgb(from var(--accent) r g b / .13);font-family:sans-serif;font-size:.62rem;font-weight:600}.detail,.count{flex:0 0 auto;color:var(--muted);font-size:.66rem;font-variant-numeric:tabular-nums;white-space:nowrap}svg{flex:0 0 auto;width:.9rem;height:.9rem;color:var(--muted)}.menu{visibility:hidden;position:fixed;inset:auto;margin:0;padding:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--ui-radius, 8px);background:var(--bg);color:var(--text);box-shadow:0 .6rem 1.6rem #0006;user-select:none}.menu:popover-open{display:flex;flex-direction:column}.menu[data-positioned]{visibility:visible}.search{display:flex;align-items:center;gap:.5rem;flex:0 0 auto;padding:.55rem .65rem;border-bottom:1px solid var(--border)}input{flex:1;min-width:0;width:0;padding:.15rem 0;border:0;background:transparent;font-size:.78rem;outline:none}input::placeholder{color:var(--muted)}.search:focus-within{box-shadow:inset 0 -2px var(--accent)}.body{display:flex;min-height:0;flex:1}.facets{width:10.5rem;flex:0 0 auto;padding:.35rem;overflow:auto;overscroll-behavior:none;border-right:1px solid var(--border);background:rgb(from var(--bg) r g b / .25)}.org{display:flex;align-items:center;gap:.4rem;width:100%;padding:.4rem .45rem;border:0;border-radius:var(--ui-radius, 4px);background:transparent;text-align:left;font-size:.7rem}.org[aria-pressed=true]{color:var(--accent);background:rgb(from var(--accent) r g b / .1)}.results{flex:1;min-width:0;overflow:auto;overscroll-behavior:none;padding:.3rem}.group+.group{margin-top:.35rem;padding-top:.35rem;border-top:1px solid var(--border)}.heading{position:sticky;top:-.3rem;z-index:1;display:flex;align-items:center;gap:.4rem;margin:0;padding:.4rem .5rem;color:var(--muted);background:var(--bg);font-size:.68rem;font-weight:600}.heading svg{width:.8rem;height:.8rem}.option{display:flex;align-items:center;gap:.65rem;width:100%;padding:.35rem .5rem;border:0;border-radius:var(--ui-radius, 4px);background:transparent;text-align:left;font-size:.76rem}.option svg{width:.8rem;height:.8rem;opacity:0;color:var(--accent)}.option[aria-selected=true]{color:var(--accent);background:rgb(from var(--accent) r g b / .1)}.option[aria-selected=true] svg{opacity:1}.option:disabled{opacity:.45}.option:hover:not(:disabled),.org:hover{background:rgb(from var(--text) r g b / .05)}.pinned{padding-bottom:.25rem;margin-bottom:.25rem;border-bottom:1px solid var(--border)}.empty{margin:0;padding:1.3rem .7rem;color:var(--muted);font-size:.76rem}button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}@media(max-width:40rem){.facets{width:8.5rem}}@media(max-width:28rem){.facets{width:7rem}.option{gap:.35rem}}:host-context(body.theme-w95){.trigger,.trigger:hover:not(:disabled){height:23px;padding:0 1px 0 4px;gap:4px;border:0;border-radius:0;background:#fff;box-shadow:var(--w95-sunken);font-size:11px;font-weight:400}.trigger>svg:last-child{width:16px;height:19px;padding:3px 2px;background:var(--w95-face);box-shadow:var(--w95-raised);color:#000}.menu{border:1px solid #000;border-radius:0;box-shadow:none;font-size:11px}.search{border-bottom:0;box-shadow:inset 0 -1px var(--w95-shadow)}.search:focus-within{box-shadow:inset 0 -1px var(--w95-shadow)}:is(.option,.org){border-radius:0;font-size:11px}:is(.option,.org):is(:hover:not(:disabled),[aria-selected=true],[aria-pressed=true]){background:var(--w95-title);color:#fff;.secondary,svg,.detail,.count{color:#fff}}.avatar{border-radius:0}& button:focus-visible{outline:1px dotted #000;outline-offset:-2px}}:host-context(body.theme-w95) *{overscroll-behavior:none}`;constructor(){super(),this.options=[],this.value=null,this.label=`Choose`,this.placeholder=`Choose`,this.disabled=!1,this._query=``,this._facet=null,this._open=!1,this._menuHeight=null,this._onViewport=()=>this._position()}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent(`tooltip-root-connected`,{bubbles:!0,composed:!0})),window.addEventListener(`resize`,this._onViewport),window.addEventListener(`scroll`,this._onViewport,!0),this._scrollRoots=[];for(let e=this.getRootNode();e.host;e=e.host.getRootNode())e.addEventListener(`scroll`,this._onViewport,!0),this._scrollRoots.push(e)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this._onViewport),window.removeEventListener(`scroll`,this._onViewport,!0);for(let e of this._scrollRoots??[])e.removeEventListener(`scroll`,this._onViewport,!0);this._scrollRoots=[]}render(){let e=this.options.find(e=>e.value===this.value),t=this.choices(),n=[...t.pinned,...t.sections.flatMap(e=>e.options)].filter(e=>!e.disabled),r=n.find(e=>e.value===this.value)?.value??n[0]?.value;return g`<button type="button" class="trigger" popovertarget="selector-menu" aria-label="${this.label}" aria-haspopup="dialog" aria-expanded="${this._open}" ?disabled="${this.disabled}">${e?this.optionIcon(e):y}<span class="name" data-tooltip-truncated data-tooltip="${e?.label??y}">${e?.label??this.placeholder}</span>${e?.detail?g`<span class="${e.detailNote?`detail is-noted`:`detail`}" ?data-tooltip-truncated="${!e.detailNote}" data-tooltip="${e.detailNote??e.detail}">${e.detail}</span>`:y} <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="m4 6 4 4 4-4"/></svg></button><div class="menu" id="selector-menu" popover="auto" role="dialog" aria-label="${this.label}" @beforetoggle="${this._beforeToggle}" @toggle="${this._toggle}" @keydown="${this._keyDown}"><div class="search"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="m10.5 10.5 3.5 3.5"/></svg> <input type="search" placeholder="${`${this.searchLabel}\u2026`}" aria-label="${this.searchLabel}" aria-controls="selector-options" .value="${w(this._query)}" @input="${e=>{this._query=e.target.value}}"> <span class="count" role="status">${t.count}${t.count===t.total?``:` / ${t.total}`}</span></div><div class="body">${t.showFacets?g`<div class="facets" role="group" aria-label="${this.facetLabel}"><button type="button" class="org" aria-pressed="${t.activeFacet==null}" @click="${()=>this._filterFacet(null)}"><span class="name">${this.allFacetsLabel}</span><span class="count">${t.total}</span></button> ${t.facets.map(e=>g`<button type="button" class="org" aria-pressed="${t.activeFacet===e.value}" @click="${()=>this._filterFacet(e.value)}"><span class="name" data-tooltip-truncated data-tooltip="${e.name}">${e.name}</span><span class="count">${e.count}</span></button>`)}</div>`:y}<div class="results" id="selector-options" role="listbox" aria-label="${this.optionsLabel}">${t.pinned.length>0?g`<div class="pinned">${t.pinned.map(e=>this._option(e,!1,r))}</div>`:y} ${t.sections.map((e,t)=>g`<div class="group" role="group" aria-labelledby="${e.label?`selector-group-${t}`:y}">${e.label?g`<h3 class="heading" id="${`selector-group-${t}`}">${e.organization?g`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.2" aria-hidden="true"><path d="M3 14V3h6v11M9 7h4v7M1 14h14M5 6h2M5 9h2M5 12h2"/></svg>`:y}${e.label}</h3>`:y} ${e.options.map(t=>this._option(t,e.organization,r))}</div>`)} ${t.count?y:g`<p class="empty">${this.options.length>0?this.noMatchesLabel:this.emptyLabel}</p>`}</div></div></div>`}get menuWidth(){return 360}optionIcon(e){return e.initials?g`<span class="avatar" aria-hidden="true">${e.initials}</span>`:y}optionTooltip(e){return e.label}_option(e,t,n){let r=e.displayLabel??(t?e.name:e.label),i=this.optionTooltip(e);return g`<button type="button" class="option" role="option" ?data-reset="${e.reset}" ?disabled="${e.disabled}" aria-label="${e.label}" aria-selected="${e.value===this.value}" tabindex="${e.value===n?0:-1}" @click="${()=>this._pick(e.value)}"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="m3 8 3 3 7-7"/></svg>${this.optionIcon(e)}<span class="option-copy"><span class="name" ?data-tooltip-truncated="${r===i}" data-tooltip="${i}">${r}</span>${e.secondary?g`<span class="${e.secondaryWarning?`secondary is-warning`:`secondary`}" ?data-tooltip-truncated="${!e.secondaryWarning}" data-tooltip="${e.secondaryWarning??e.secondary}">${e.secondary}</span>`:y}</span>${e.detail?g`<span class="${e.detailNote?`detail is-noted`:`detail`}" data-tooltip="${e.detailNote??y}">${e.detail}</span>`:y}</button>`}updated(e){this.disabled&&this._open&&this._close(!1),e.has(`options`)&&(this._menuHeight=null),this._position(),(e.has(`_query`)||e.has(`_facet`))&&(this.renderRoot.querySelector(`.results`).scrollTop=0)}_beforeToggle(e){this._open=e.newState===`open`,delete e.target.dataset.positioned,this._open&&(this._query=``,this._facet=null,this._menuHeight=null)}async _toggle(e){e.newState===`open`&&(await this.updateComplete,this._open&&this.isConnected&&(this._position(),this.renderRoot.querySelector(`input`).focus({preventScroll:!0})))}_position(){let e=this.renderRoot.querySelector(`.menu`);if(!e?.matches(`:popover-open`))return;let t=this.renderRoot.querySelector(`.trigger`).getBoundingClientRect(),n=e.querySelector(`.facets`)!=null,r=Math.min(Math.max(t.width,n?560:this.menuWidth),window.innerWidth-16),i=window.innerHeight-t.bottom-8-4,a=t.top-8-4;e.style.width=`${r}px`,this._menuHeight??=Math.min(480,e.querySelector(`.search`).offsetHeight+Math.max(e.querySelector(`.results`).scrollHeight,e.querySelector(`.facets`)?.scrollHeight??0)+2);let o=this._menuHeight,s=i<o&&a>i;e.style.maxHeight=`${Math.max(0,Math.min(o,s?a:i))}px`,e.style.left=`${Math.max(8,Math.min(t.left,window.innerWidth-r-8))}px`,e.style.top=`${Math.max(8,s?t.top-e.offsetHeight-4:t.bottom+4)}px`,e.dataset.positioned=``}_filterFacet(e){this._facet=e,this.renderRoot.querySelector(`input`).focus({preventScroll:!0})}_keyDown(e){if(e.stopPropagation(),e.key===`Escape`){e.preventDefault(),this._close();return}let t=this.renderRoot.querySelector(`input`),n=this.renderRoot.activeElement,r=[...this.renderRoot.querySelectorAll(`.option:not(:disabled)`)],i=r.indexOf(n);if(n!==t&&i<0)return;if(e.key===`Enter`&&n===t){e.preventDefault(),(this.renderRoot.querySelector(`.option:not([data-reset]):not(:disabled)`)??r[0])?.click();return}let a;if(n===t){if(e.key===`ArrowDown`)a=0;else if(e.key===`ArrowUp`)a=-1;else return}else if(e.key.startsWith(`Arrow`))a=Yt(r,i,e.key);else if(e.key===`Home`)a=0;else if(e.key===`End`)a=r.length-1;else if(e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault(),this._query+=e.key,t.focus();return}else return;e.preventDefault();for(let[e,t]of r.entries())t.tabIndex=e===a?0:-1;a<0?t.focus():r[a]?.focus()}_pick(e){this.disabled||!this.options.some(t=>t.value===e&&!t.disabled)||(this._close(),this.dispatchEvent(new CustomEvent(this.changeEvent,{detail:{value:e},bubbles:!0,composed:!0})))}_close(e=!0){this.renderRoot.querySelector(`.menu`).hidePopover(),this._open=!1,e&&this.renderRoot.querySelector(`.trigger`).focus({preventScroll:!0})}},Zt=class extends Xt{constructor(){super(),this.label=`Choose repository`,this.placeholder=`Choose repository`}get searchLabel(){return`Search repositories`}get optionsLabel(){return`Repositories`}get facetLabel(){return`Filter by organization`}get allFacetsLabel(){return`All organizations`}get noMatchesLabel(){return`No matching repositories`}get emptyLabel(){return`No repositories available`}get changeEvent(){return`repository-change`}choices(){return Jt(this.options,this._query,this._facet)}};customElements.get(`repository-selector`)||customElements.define(`repository-selector`,Zt);var Qt=/(?![\t\n\r])\p{Cc}|[\u202A-\u202E\u2066-\u2069]/gu,$t=/\P{ASCII}/u,en=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u2800\u3000\p{Cf}\p{Cs}\p{Co}\p{Cn}\p{Default_Ignorable_Code_Point}]/u;function tn(e){if(typeof e!=`string`)return{kind:`binary`,controls:null};let t=new Map;for(let[n]of e.matchAll(Qt))t.set(n.codePointAt(0),(t.get(n.codePointAt(0))??0)+1);let n=e.search($t);if(n!==-1)for(let[r,i]of vn(e,n)??[])t.set(r,i);return{kind:n===-1?`ascii`:`utf8`,controls:t.size>0?t:null}}var nn=/(?=\p{Emoji})\p{Extended_Pictographic}(?:\u{FE0F}|[\u{1F3FB}-\u{1F3FF}])?$/u,rn=/^(?=\p{Emoji})\p{Extended_Pictographic}/u,an=/(?=\p{Emoji})\p{Extended_Pictographic}$/u,on=/^[\d#*]$/u,j=e=>e>=917536&&e<=917631,sn=new Set([`gbeng`,`gbsct`,`gbwls`]),cn=(e,t,n)=>n-t===10?String.fromCodePoint(...Array.from({length:5},(n,r)=>e.codePointAt(t+2*r)-917504)):``;function ln(e,t,n,r){if(n===13&&(e[t+1]===`
2
- `||r&&t+1===e.length)||n===8205&&nn.test(e.slice(Math.max(0,t-4),t))&&rn.test(e.slice(t+1,t+3))||(n===65038||n===65039)&&an.test(e.slice(Math.max(0,t-2),t))||n===65039&&on.test(e[t-1]??``)&&e[t+1]===`⃣`)return t+1;if(j(n)&&!j(e.codePointAt(t-2))){let n=t;for(;j(e.codePointAt(n));)n+=2;if(e.codePointAt(t-2)===127988&&e.codePointAt(n-2)===917631&&sn.has(cn(e,t,n-2)))return n}return-1}var un=/[\u115F\u1160\u3164\uFFA0\u{E0001}\u{E0020}-\u{E007F}]|[\uFE00-\uFE0F]|[\u{E0100}-\u{E01EF}]/u,M=/[\uFE00-\uFE0F\u115F\u1160\u3164\uFFA0\uDB40]/g,dn=e=>new Set(e.split(` `).flatMap(e=>{let[t,n=t]=e.split(`-`).map(e=>Number.parseInt(e,16));return Array.from({length:n-t+1},(e,n)=>t+n)})),fn=new Map([[65024,`30 1000 1002 1004 1010-1011 1015 1019-101a 101c-101d 1022 1031 1075 1078 107a 1080 2018-2019 201c-201d 210b 2110 2112 211b 212c 2130-2131 2133 2205 2229-222a 223d 2242-2243 2248 2268-2269 2272-2273 228a-228b 2293-2295 2297 229c 22cd 22da-22dd 29b7 2a3c-2a3d 2a6c 2a9d-2a9e 2aac-2aad 2acb-2acc 3001-3002 31c0 31c6 31c9 31cf-31d2 31d4-31d5 31d7 31db-31dd 31e5 a856 a85c a85e-a860 a868 aa60-aa66 aa6b-aa6c aa6f aa7a ff01 ff0c ff0e ff10 ff1a-ff1b ff1f 10ac5-10ac6 10ad6-10ad7 10ae1 13091 1310f 1311c 13121 13127 13139 131a0 131b1 131b8-131b9 131cb 131e0 131f9-131fa 1327b 1327f 13285 1328c 132aa 132cb 132dc 132e7 13307 1331b 13322 1333c 13377-13378 13399-1339a 133d3 133e4-133e5 133e7 133ee 133f2 133f5-133f6 13416 13419-1341a 13423 13443-13446 13be8-13bea 13f72 1d49c 1d49e-1d49f 1d4a2 1d4a5-1d4a6 1d4a9-1d4ac 1d4ae-1d4b5 1db10`],[65025,`2018-2019 201c-201d 210b 2110 2112 211b 212c 2130-2131 2133 3001-3002 31c6 31cf 31dd ff01 ff0c ff0e ff1a-ff1b ff1f 13093 13132 13139 13187 131b1 131ee 131f8-131fa 13257 1327f 1328b 132a4 13308 13312-13314 1331b 13321-13322 13331 133e8 13419 13f1f 14274 1d49c 1d49e-1d49f 1d4a2 1d4a5-1d4a6 1d4a9-1d4ac 1d4ae-1d4b5`],[65026,`2018-2019 201c-201d 13117 13139 13183 131a0 131ba 131ee 13216 1327b 132a4 132e7 132e9 132f8 132fd 13302-13303 13310-13314 1331c 13321 13331 1334a 13361 13373 1337d 13385 133af-133b0 133bf 133db 133dd 13419 1342c 1342e 14274 1d4cf`],[65027,`13012 130b8 130ba 1310f 1312f 13139 13184 1319c-1319d 1319f 131b1 131db 13205 13296 13338 13419`],[65028,`13139 1340d`],[65029,`13139 14274`],[65030,`1312f 13139 13184 131db 131ee 13205 132a4 132e9 1332b 13338 13370-13371 13419 14274`]].map(([e,t])=>[e,dn(t)])),pn=dn(`23 2a 30-39 a9 ae 203c 2049 2122 2139 2194-2199 21a9-21aa 231a-231b 2328 23cf 23e9-23f3 23f8-23fa 24c2 25aa-25ab 25b6 25c0 25fb-25fe 2600-2604 260e 2611 2614-2615 2618 261d 2620 2622-2623 2626 262a 262e-262f 2638-263a 2640 2642 2648-2653 265f-2660 2663 2665-2666 2668 267b 267e-267f 2692-2697 2699 269b-269c 26a0-26a1 26a7 26aa-26ab 26b0-26b1 26bd-26be 26c4-26c5 26c8 26ce-26cf 26d1 26d3-26d4 26e9-26ea 26f0-26f5 26f7-26fa 26fd 2702 2705 2708-270d 270f 2712 2714 2716 271d 2721 2728 2733-2734 2744 2747 274c 274e 2753-2755 2757 2763-2764 2795-2797 27a1 27b0 27bf 2934-2935 2b05-2b07 2b1b-2b1c 2b50 2b55 3030 303d 3297 3299 1f004 1f170-1f171 1f17e-1f17f 1f202 1f21a 1f22f 1f237 1f30d-1f30f 1f315 1f31c 1f321 1f324-1f32c 1f336 1f378 1f37d 1f393 1f396-1f397 1f399-1f39b 1f39e-1f39f 1f3a7 1f3ac-1f3ae 1f3c2 1f3c4 1f3c6 1f3ca-1f3ce 1f3d4-1f3e0 1f3ed 1f3f3 1f3f5 1f3f7 1f408 1f415 1f41f 1f426 1f43f 1f441-1f442 1f446-1f449 1f44d-1f44e 1f453 1f46a 1f47d 1f4a3 1f4b0 1f4b3 1f4bb 1f4bf 1f4cb 1f4da 1f4df 1f4e4-1f4e6 1f4ea-1f4ed 1f4f7 1f4f9-1f4fb 1f4fd 1f508 1f50d 1f512-1f513 1f549-1f54a 1f550-1f567 1f56f-1f570 1f573-1f579 1f587 1f58a-1f58d 1f590 1f5a5 1f5a8 1f5b1-1f5b2 1f5bc 1f5c2-1f5c4 1f5d1-1f5d3 1f5dc-1f5de 1f5e1 1f5e3 1f5e8 1f5ef 1f5f3 1f5fa 1f610 1f687 1f68d 1f691 1f694 1f698 1f6ad 1f6b2 1f6b9-1f6ba 1f6bc 1f6cb 1f6cd-1f6cf 1f6e0-1f6e5 1f6e9 1f6f0 1f6f3`),mn=[[65024,65039],[917760,917999]],hn=[[12593,12643],[12645,12686]];function gn(e,t){if(t===0)return;let n=t>=2?e.codePointAt(t-2):0;return n>65535?n:e.codePointAt(t-1)}var N=(e,...t)=>e!==void 0&&t.some(([t,n])=>e>=t&&e<=n);function _n(e,t,n){let r=t+(n>65535?2:1),i=e.codePointAt(r),a=gn(e,t);switch(n){case 4447:return N(i,[4449,4519],[55216,55238]);case 4448:return N(a,[4352,4446],[43360,43388]);case 12644:return N(a,...hn)||N(i,...hn);case 65440:return N(a,[65441,65500])||N(i,[65441,65500]);default:return(n===65038||n===65039?pn.has(a):fn.get(n)?.has(a))||mn.some(([i,a])=>n===i&&e[r]===`-`&&e.codePointAt(r+1)===a||n===a&&e[t-1]===`-`&&gn(e,t-1)===i)||(n===65038||n===65039)&&a===n&&an.test(e.slice(Math.max(0,t-3),t-1))}}function vn(e,t=0){let n=null;M.lastIndex=t;for(let t=M.exec(e);t;t=M.exec(e)){let r=t.index,i=e.codePointAt(r);if(!un.test(String.fromCodePoint(i)))continue;let a=ln(e,r,i,!1);a===-1?_n(e,r,i)||(n??=new Map,n.set(i,(n.get(i)??0)+1)):M.lastIndex=a}return n}var yn={stringOrComment:/((?=\/)(?<=(?:^|\.\.\.|[(,=:[!&|?{};>+\-*/%^<~]|(?<![\p{ID_Continue}$.#])(?:await|case|default|delete|do|else|extends|in|instanceof|new|of|return|throw|typeof|void|yield))[ \t]*)\/(?![/*])(?:[^/\\[\n]|\\.|\[(?:[^\]\\\n]|\\.)*(?:\]|(?=\\?$)))+(?:\/[a-z]*|(?=\\?$))|"(?:[^"\\\n]|\\(?:\r\n|[\s\S]))*(?:"|$)|'(?:[^'\\\n]|\\(?:\r\n|[\s\S]))*(?:'|$)|`(?:[^`\\]|\\(?:\r\n|[\s\S]))*(?:`|(?![\s\S])))|(?<![ \t])[ \t]*(?:\/\*[\s\S]*?(?:\*\/|(?![\s\S]))|\/\/.*|(?<![\s\S])\uFEFF?#!.*)[ \t]*/gmu,droppable:/(?<![\p{ID_Continue}$\\\u200C\u200D])[ \t]+|[ \t]+(?![\p{ID_Continue}$\\\u200C\u200D])/gu,needed:(e,t,n)=>`+-/`.includes(e[t-1])&&e[t+n.length]===e[t-1]||e[t-2]===``&&/[\p{ID_Continue}$\\\u200C\u200D]/u.test(e[t+n.length])},bn={stringOrComment:/("(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*')|[ \t]*\/\*[\s\S]*?\*\/[ \t]*/gu,droppable:/(?<=[{};,:>(])[ \t]+|[ \t]+(?=[{};,>)!])|(?<=[+~])[ \t]+|[ \t]+(?=[+~])/gu,needed:(e,t,n,r)=>/[+~]/u.test(e[t-1]+e[t+n.length])&&(r>0||/^\s*--[^:]*:/u.test(e.slice(Math.max(...[`{`,`;`,`}`].map(n=>e.lastIndexOf(n,t)))+1,t)))},xn=yn.stringOrComment,Sn=(e,t=!1)=>/\.css$/iu.test(e)?bn:t||/\.[cm]?js$/iu.test(e)?yn:null,Cn=4194304;function wn(e,{stringOrComment:t,droppable:n,needed:r}){let i=(e.length>Cn?e.slice(0,e.lastIndexOf(`
3
- `,Cn)+1||Cn):e).replaceAll(t,(e,t)=>(t===void 0?``:t[0]===`/`?`//`:`""`)+e.replaceAll(/[^\n]/gu,``)).replaceAll(/^[ \t]+/gmu,``).split(`
4
- `).filter(e=>e.trim()!==``),a=i.join(`
5
- `),o=a.length-(i.length-1),s=0,c=0,l=0;for(let{0:e,index:t}of a.matchAll(n)){for(;l<t;l++)s=Math.max(0,s+(a[l]===`(`?1:a[l]===`)`?-1:0));r(a,t,e,s)||(c+=e.length)}return i.length>0&&o>110*i.length&&c<.01*o?Math.round(o/i.length):0}var Tn=/\.[cm]?[jt]sx?$/iu,En=/^\uFEFF?#!.*\bnode\b/u,P=(e,t,n=!1)=>typeof t==`string`&&(n||Tn.test(e)||En.test(t)),Dn=100,On=1024;function kn(e){let t=null;return n=>{if(!t){t=[];for(let n=e.indexOf(`
6
- `),r=0;n!==-1;n=e.indexOf(`
7
- `,n+1),r++)r%On===0&&t.push(n)}let r=t.length,i=0;for(;i<r;){let e=i+r>>1;t[e]<n?i=e+1:r=e}if(i===0)return 1;let a=(i-1)*On+1;for(let r=e.indexOf(`
8
- `,t[i-1]+1);r!==-1&&r<n;r=e.indexOf(`
9
- `,r+1))a++;return a+1}}var An=1e3,jn=/(?:\.(?:md|markdown|mdown|mkdn|mdx|txt|rst|adoc|asciidoc|asc|textile|rdoc|org|creole|mediawiki|wiki|pod)|(?:^|\/)(?:licen[cs]e|copying|notice|authors|contributors|readme|changelog|changes|history)(?:-[^/.]*)?(?:\.\d[^/.]*)*)$/iu,Mn=/^\s*(?:\/\/|\/\*)[#@] sourceMappingURL=/u,Nn=/^\s*(?:\/\/|\/\*)[#@] sourceMappingURL=data:[^\s,]*,[\w+/=%.~-]*\s*(?:\*\/)?\s*$/u,Pn=/\.map$/iu,Fn=/\.min\.[^/.]+$/iu,In=/(?<![\p{ID_Continue}$])_0x[0-9a-f]{4,6}(?![\p{ID_Continue}$])/gu,Ln=20,Rn=/while\s*\(\s*!!\[\]\s*\)/u,zn=1e3;function Bn(e){let t=new Set;for(let[n]of e.matchAll(In))if(t.add(n),t.size===zn)break;let n=Rn.test(e);return t.size>=Ln||n?{names:t.size,loop:n}:null}var Vn=262144,Hn=/\.(?:[cm]?[jt]s|[jt]sx)$/iu,Un=/\.d\.[cm]?ts$/iu,Wn=(e,t,n=!1)=>typeof t==`number`&&t>=Vn&&(n||Hn.test(e)&&!Un.test(e));function Gn(e,t,n=!1){let r=tn(t);if(r.kind===`binary`)return{...r,category:`binary`,longest:0,longLines:0,average:0,inlineMap:0,obfuscation:null};let i=0,a=0,o=0,s=0;for(let e=0;e<=t.length;){let n=t.indexOf(`
10
- `,e),r=n===-1?t.length:n,c=r-e-+(t[r-1]===`\r`);Mn.test(t.slice(e,e+64))&&Nn.test(t.slice(e,r))?i+=c:(c>An&&(o++,a+=c),s=Math.max(s,c)),e=r+1}let c=!n&&Pn.test(e),l=!n&&jn.test(e),u=l||c?null:Bn(t),d={...r,longest:s,longLines:o,average:0,inlineMap:i,obfuscation:u};if(c)return{...d,category:`map`};if(l)return{...d,category:i>0?`inline-map`:r.kind};if(o===0){let a=Sn(e,n),o=a!==null&&s>110?wn(t,a):0;return{...d,average:o,category:i>0?`inline-map`:o>0?`minified`:r.kind}}return a/(t.length-i)<.5&&!Fn.test(e)?{...d,category:`long`}:{...d,category:i>0?`inline-map`:`minified`}}var Kn=e=>e.category===`long`?e.kind:e.category;function qn(e){let t=[...Zn(e.controls),...e.longLines>0&&[`long`,`minified`,`inline-map`].includes(e.category)?[`long`]:[]],n=Kn(e);return F.get(n).mark||t.length===0?[...t,n]:t}var Jn=(e,t)=>t===`long`&&e.category!==`long`?`notice`:F.get(t).mark,F=new Map([[`binary`,{name:`Binary`,tag:`Binary`,mark:`warn`}],[`controls`,{name:`Control chars`,tag:`Controls`,mark:`warn`}],[`invisible`,{name:`Invisible chars`,tag:`Invisible`,mark:`warn`}],[`long`,{name:`Long lines`,tag:`Long lines`,mark:`warn`}],[`minified`,{name:`Minified`,tag:`Minified`,short:`Min`,mark:`notice`}],[`map`,{name:`Source maps`,tag:`Map`,mark:`notice`}],[`inline-map`,{name:`Inline source maps`,tag:`Inline map`,mark:`notice`}],[`utf8`,{name:`UTF-8`,tag:`UTF-8`,mark:null}],[`ascii`,{name:`ASCII`,tag:`ASCII`,mark:null}]]),Yn=new RegExp(Qt.source,`u`),Xn=(e,t)=>[...e??[]].filter(([e])=>Yn.test(String.fromCodePoint(e))===(t===`controls`)).toSorted((e,t)=>t[1]-e[1]||e[0]-t[0]),Zn=e=>e?[`controls`,`invisible`].filter(t=>Xn(e,t).length>0):[],Qn=1e3,$n=String.raw`[\p{L}\p{N}](?:[\p{L}\p{N}-]*[\p{L}\p{N}])?`,er=new RegExp(String.raw`\b(?:https?|wss?|ftp)\??:\/\/(?:[^\s/@'"\x60]*@)?(${$n}(?:\.${$n})+)(?![\p{L}\p{N}-]|\.[\p{L}\p{N}_$-])`,`giu`),tr=/\.(?:\p{L}{2,}|xn--[a-z0-9-]+)$/u,nr=/^(?:(?:25[0-5]|2[0-4]\d|1?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d?\d)$/u,rr=/^(?:localhost|.+\.(?:localhost|local|test|invalid|example|internal)|(?:.+\.)?example\.(?:com|net|org)|127(?:\.\d+){3}|0\.0\.0\.0|(?:.+\.)?w3\.org)$/u,ir=/\\([/.])/gu,ar=new Set([`issues`,`pull`,`pulls`,`blob`,`tree`,`wiki`,`discussions`,`commit`,`commits`,`compare`,`blame`,`security`,`projects`,`labels`,`milestone`,`milestones`,`releases`,`tags`,`graphs`,`network`,`stargazers`]),or=new Set([`sponsors`,`orgs`,`apps`,`marketplace`,`features`,`topics`,`collections`,`settings`,`login`,`search`,`explore`,`about`]),sr=new Set([`blob`,`tree`,`blame`,`wiki`]),cr=/\.(?:patch|diff|atom)$/iu,lr=/\.git$/iu,ur=e=>{try{return decodeURIComponent(e)}catch{return e}};function dr(e){let t=null;try{t=new URL(e.replace(/^(\w+)\?:/u,`$1:`).replace(/[)\]}>.,;:!]+$/u,``))}catch{}if(!t)return`github.com/`;let n=t.pathname.split(`/`).slice(1).map(ur);n.length>1&&n.at(-1)===``&&n.pop();let[r,i=``,a,...o]=n,s=r!==``&&i!==``&&!lr.test(i)&&ar.has(a)&&!(a===`releases`&&o.includes(`download`))&&!(a===`blob`&&t.searchParams.has(`raw`))&&!(!sr.has(a)&&cr.test(n.at(-1)));return t.hostname.replace(/\.$/u,``)===`github.com`&&(n.length===1||or.has(r)||s)?`github.com`:`github.com/${r}/${i.replace(lr,``)}`.toLowerCase()}function fr(e,t,n=!1){if(!P(e,t,n)||!(t.includes(`://`)||t.includes(`:\\/\\/`)))return null;let r=new Map,i=kn(t);for(let{1:e,index:n}of t.matchAll(xn)){if(r.size>=Qn)break;let t=e?.startsWith(`/`)?e.replace(/\/[a-z]*$/u,``):e,a=t?.includes(`\\`)?t.replaceAll(ir,`$1`):t;if(a?.includes(`://`))for(let{1:e,index:t}of a.matchAll(er)){let o=e.toLowerCase(),s=o===`github.com`?dr(/^[^\s'"\u0060]*/u.exec(a.slice(t))[0]):o;if(!r.has(s)&&(tr.test(o)||nr.test(o))&&!rr.test(o)&&r.set(s,i(n+t)),r.size>=Qn)break}}return r.size>0?r:null}var I=String.raw`[\p{L}\p{N}_-]`,L=(e,t=``)=>new RegExp(String.raw`(?<!${I})${e}${t}(?!\.?${I})`,`giu`),pr=e=>new RegExp(String.raw`(?<=(?:(?:^|[\s'"\x60(=,<>])(?:https?|wss?|ftp)\??:|['"\x60(=,])\\?\/\\?\/(?:[^\s/@'"\x60]*@)?(?:${I}+\.)*)${e}(?!\.?${I}|(?::[^\s/@'"\x60]*)?@)`,`giu`),R=new Map([[`Exfiltration`,`critical`],[`Remote`,`high`],[`IP lookup`,`moderate`]]),[z,B,V]=[...R.keys()].map(e=>({tag:e})),H=new Map([[`webhook-site`,{...z,name:`webhook.site`,pattern:L(String.raw`webhook\.site`)}],[`pipedream`,{...z,name:`Pipedream`,pattern:L(String.raw`pipedream\.net`)}],[`requestbin`,{...z,name:`RequestBin`,pattern:L(String.raw`(?:requestbin\.(?:net|com)|requestb\.in)`)}],[`requestcatcher`,{...z,name:`Request Catcher`,pattern:L(String.raw`requestcatcher\.com`)}],[`requestrepo`,{...z,name:`requestrepo`,pattern:L(String.raw`requestrepo\.com`)}],[`beeceptor`,{...z,name:`Beeceptor`,pattern:L(String.raw`beeceptor\.com`)}],[`oast`,{...z,name:`OAST`,pattern:L(String.raw`(?:interact\.sh|interactsh\.com|oast\.(?:pro|live|site|online|fun|me)|oastify\.com|burpcollaborator\.net)`)}],[`canarytokens`,{...z,name:`Canarytokens`,pattern:L(String.raw`canarytokens\.(?:com|org)`)}],[`dnslog`,{...z,name:`DNSLog`,pattern:L(String.raw`dnslog\.cn`)}],[`ceye`,{...z,name:`CEYE`,pattern:L(String.raw`ceye\.io`)}],[`telegram`,{...B,name:`Telegram`,pattern:L(String.raw`api\.telegram\.org`)}],[`discord`,{...B,name:`Discord webhook`,pattern:L(String.raw`discord(?:app)?\.com`,String.raw`/api(?:/v\d+)?/webhooks`)}],[`slack`,{...B,name:`Slack webhook`,pattern:L(String.raw`hooks\.slack\.com`,`/(?:services|workflows|triggers)`)}],[`pastebin`,{...B,name:`Pastebin`,pattern:L(String.raw`pastebin\.com`)}],[`paste-ee`,{...B,name:`paste.ee`,pattern:L(String.raw`paste\.ee`)}],[`transfer-sh`,{...B,name:`transfer.sh`,pattern:pr(String.raw`transfer\.sh`)}],[`file-io`,{...B,name:`file.io`,pattern:pr(String.raw`file\.io`)}],[`0x0`,{...B,name:`0x0.st`,pattern:L(String.raw`0x0\.st`)}],[`ngrok`,{...B,name:`ngrok`,pattern:L(String.raw`ngrok(?:-free)?\.(?:io|app|dev)`)}],[`localtunnel`,{...B,name:`localtunnel`,pattern:L(String.raw`loca\.lt`)}],[`cloudflare-tunnel`,{...B,name:`Cloudflare Tunnel`,pattern:L(String.raw`trycloudflare\.com`)}],[`serveo`,{...B,name:`Serveo`,pattern:L(String.raw`serveo\.net`)}],[`pipedream-api`,{...B,name:`Pipedream API`,pattern:L(String.raw`pipedream\.com`)}],[`bun`,{...B,name:`Bun install`,pattern:L(String.raw`bun\.(?:sh|com)`,`/install`)}],[`ipinfo`,{...V,name:`ipinfo`,pattern:L(String.raw`ipinfo\.io`)}],[`ipify`,{...V,name:`ipify`,pattern:L(String.raw`ipify\.org`)}],[`ifconfig-me`,{...V,name:`ifconfig.me`,pattern:L(String.raw`ifconfig\.me`)}],[`icanhazip`,{...V,name:`icanhazip`,pattern:L(String.raw`icanhazip\.com`)}],[`ip-api`,{...V,name:`ip-api`,pattern:L(String.raw`ip-api\.com`)}],[`ipapi`,{...V,name:`ipapi`,pattern:L(String.raw`ipapi\.com?`)}],[`checkip`,{...V,name:`checkip`,pattern:L(String.raw`checkip\.amazonaws\.com`)}]]),mr=new RegExp([...H.values()].map(({pattern:e})=>e.source).join(`|`),`iu`);function hr(e,t,n=!1){if(typeof t!=`string`||!n&&(jn.test(e)||Pn.test(e))||!mr.test(t))return null;let r=new Map,i=kn(t);for(let[e,{pattern:n}]of H){let a=new Set;for(let{index:e}of t.matchAll(n))if(a.add(i(e)).size>=Dn)break;a.size>0&&r.set(e,[...a])}return r.size>0?r:null}function gr(e,t){let n=e&&new Map([...e].filter(([e])=>H.get(e).tag===t));return n?.size>0?n:null}var _r=e=>[...R.keys()].map(t=>[t,gr(e,t)]).filter(([,e])=>e);function vr(e,t,n){let r=[...R.values()],i=r.indexOf(R.get(e));return r[n!==void 0&&[...t.keys()].some(e=>!n?.has(e))?Math.max(0,i-1):i]}var yr=String.raw`/\*(?:[^*]|\*(?!/)){0,100}\*/|//[^\n]{0,100}\n`,U=String.raw`(?:\s|${yr})*`,br=String.raw`(?:${U}\??\.${U}(?:call|apply))?${U}(?:\?\.${U})?\(`,xr=String.raw`(?!${U}(?<quote>["'\u0060])\s*return\s+this\s*;?\s*\k<quote>${U}\))`,Sr=String.raw`process${U}\.${U}env(?![\p{ID_Continue}$])(?!${U}(?:\??\.|\[))`,Cr=String.raw`${U}\)${U}\??\.${U}(?:filter|find|findLast|some|every|reduce)(?![\p{ID_Continue}$])`,wr=String.raw`(?:\{${U}\.\.\.${U})?`,Tr=String.raw`(?=JSON|Object|URLSearchParams)(?<![\p{ID_Continue}$.])(?:JSON${U}\.${U}stringify|URLSearchParams)${U}\(${U}${wr}${Sr}`+String.raw`|(?=Object)(?<![\p{ID_Continue}$.])Object${U}\.${U}(?:values|entries)${U}\(${U}${wr}${Sr}(?!${Cr})`,W=String.raw`(?:(?:ba|z|da|k|mk|c|tc|fi|a)?sh|pwsh|powershell)`,Er=String.raw`(?:(?:\/[\w.-]{1,40}){0,8}\/)?(?:env(?:[^\S\n]+(?:-[\w-]{1,20}(?:=\S{0,100}|[^\S\n]+(?!-)[^\s=]{1,100})?|\w{1,40}=\S{0,100})){0,6}[^\S\n]+)?`,Dr=String.raw`curl|wget|\|\s*(?:sudo|${Er}${W})|powershell|pwsh|rundll32|osascript|mshta|certutil|bitsadmin|\/dev\/(?:tcp|udp)|iex|invoke-expression`+String.raw`|\$profile|profile\.ps1|config\.fish|conf\.d|bashrc|zshrc|zshenv|zlogin|bash_profile|bash_login|zprofile|\.profile|Launch(?:Agents|Daemons)|systemd|systemctl|\.claude|\.vscode|trufflehog|metadata\.google\.internal|["'\x60\/\\]gh(?:\.exe)?["'\x60]`,Or=String.raw`auth(?:[^\S\n]|[\\^\x60]\r?\n)+token|169\.254\.169\.254|Runner\.Worker|\/proc\/`,kr=new RegExp(Dr,`iu`),Ar=new RegExp(String.raw`eval|Function${br}|vm["'\x60]|_compile|child_process|\.(?:npmrc|ssh|aws)|_TOKEN|${Or}|(?:stringify|values|entries|URLSearchParams)${U}\(${U}(?:\{${U}\.\.\.${U})?process${U}\.${U}env|publish|whoami|registry\.(?:npmjs\.org|yarnpkg\.com)`,`u`),jr={test:e=>Ar.test(e)||kr.test(e)},Mr=`globalThis|window|global|self`,Nr=e=>String.raw`(?=${Mr}|${e})(?<![\p{ID_Continue}$#])(?<!(?<!\.)\.${U})(?<!\bfunction${U})(?:(?:${Mr})${U}\??\.${U})?${e}`,G=`(?:NPM|GITHUB)_TOKEN`,Pr=String.raw`\s{0,4}=(?![=>])`,Fr=String.raw`\s{0,4}(?:\?:|:\s{0,4}(?:string|number|boolean|unknown|any)(?![\p{ID_Continue}$]))`,Ir=String.raw`\s{0,4}(?:(?:\)\s{0,4}){1,4}(?![\s)]{0,8}(?:[.[(]|\?\.))|&&|\|\||\?\?|\?(?!\.)|[;,:}\]]|$)`,Lr=String.raw`(?=NPM|GITHUB)(?<![\p{ID_Continue}$])(?<!\b(?:const|let|var)\s{1,4})`+String.raw`(?:(?<!(?:!|\bdelete\s)[\s(]{0,4}(?:[\p{ID_Continue}$]{1,64}\s{0,4}\??\.\s{0,4}){0,4})|(?!${G}${Ir}))`+String.raw`${G}(?![\p{ID_Continue}$])(?!${Fr})(?:(?!${Pr})|(?<=[{,]\s{0,64}${G}))`,Rr=String.raw`(?<=[{,;]${U}eval)\s*:(?!${U}(?:true|!0)(?![\p{ID_Continue}$]))`+String.raw`(?![^{};]{0,200}\}${U}=${U}(?:${Mr})(?![\p{ID_Continue}$]))`,zr=new RegExp(String.raw`${xn.source}|(?<eval>${Nr(`eval`)}(?![\p{ID_Continue}$])(?!\s*\?:)(?!${Rr}))|(?<function>${Nr(`Function`)}${br}${xr})`+String.raw`|(?<compile>\.${U}_compile(?:${br}|${U}=(?![=>])))|(?<tokens>${Lr})|(?<env>${Tr})|(?<put>\.${U}put${U}\()`,`gmu`),Br=new RegExp(String.raw`\.(?:npmrc|ssh|aws)|_TOKEN|${Or}|publish|whoami|registry\.`,`u`),Vr={test:e=>Br.test(e)||kr.test(e)},Hr=new RegExp(String.raw`^\s{0,4}\]${Pr}`,`u`),Ur=new RegExp(String.raw`^\s{0,4}\]${Ir}`,`mu`),Wr=/(?:!|\bdelete\s)[\s(]{0,4}(?:[\p{ID_Continue}$]{1,64}\s{0,4}\??\.\s{0,4}){0,4}[\p{ID_Continue}$]{1,64}\s{0,4}(?:\?\.\s{0,4})?\[\s{0,4}$/u,Gr=/\\(?:x([\da-f]{2})|u([\da-f]{4})|u\{([\da-f]{1,6})\}|([0-3][0-7]{0,2}|[4-7][0-7]?)|(\r\n|[^]))/giu,Kr=new Map([[`n`,`
11
- `],[`r`,`\r`],[`t`,` `],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`]]),qr=new Set([`
12
- `,`\r`,`\r
13
- `,`\u2028`,`\u2029`]),Jr=e=>e.replaceAll(Gr,(e,t,n,r,i,a)=>{if(a!==void 0)return qr.has(a)?``:Kr.get(a)??a;let o=i===void 0?Number.parseInt(t??n??r,16):Number.parseInt(i,8);return o<=1114111?String.fromCodePoint(o):e}),Yr=String.raw`registry\.(?:npmjs\.org|yarnpkg\.com)`,Xr=new RegExp(String.raw`(?:[/\\]{2}|\bhttps?:[/\\]?)(?:[^/\\?#]{0,256}@)?${Yr}|^(["'\u0060])${Yr}(?=\1$|[/:?#])`,`iu`),Zr=/[\t\n\r]/gu,Qr=String.raw`[\\^\u0060]\r?\n`,$r=String.raw`(?:[^\n;|&]|${Qr})`,ei=String.raw`\u0060\r?\n`,ti=String.raw`(?:[^\n;|&"']|${Qr}|"[^"\n]*"|'[^'\n]*'|"(?![^"\n]*")|'(?![^'\n]*'))`,K=String.raw`(?:[^\S\n]|${Qr})`,q=String.raw`(?:${K}+--?\w[\w-]*(?:=\S*|${K}+(?!-)\S+)?){0,6}?`,ni=String.raw`(?<![\w.-])(?:curl|wget)(?:\.exe)?${K}(?:(?!(?:curl|wget)(?![\w-]))${ti}){0,2000}?["']?(?:https?|s?ftps?|scp):\\?\/\\?\/|(?<![|\\]|(?<![\w.\/-])${W}\s*)\|\s*(?:sudo${q}(?:${K}+--)?${K}+)?${Er}${W}(?![\w)|$-])`+String.raw`|(?<![\w.-])(?:powershell|pwsh)(?:\.exe)?[^\S\n]+-\w|(?<![\w.-])(?:rundll32|osascript|mshta)(?:\.exe)?(?![\w-])`+String.raw`|(?<![\w.-])certutil(?:\.exe)?${K}${$r}{0,100}?-urlcache|(?<![\w.-])bitsadmin(?:\.exe)?${K}${$r}{0,100}?\/transfer|\/dev\/(?:tcp|udp)\/`+String.raw`|(?<![\w$.-])(?:iex|invoke-expression)(?![\w-])(?:[^\n;|&]|${ei}){0,200}?(?:(?<![\w$.-])(?:iwr|irm|invoke-webrequest|invoke-restmethod)(?![\w-])|\.downloadstring\s*\()`+String.raw`|(?<![\w$.-])(?:iwr|irm|invoke-webrequest|invoke-restmethod)(?![\w-])(?:(?!(?:iwr|irm|invoke-webrequest|invoke-restmethod)(?![\w-]))(?:[^\n;|&]|${ei})){0,2000}\|\s*(?:iex|invoke-expression)(?![\w-])`,J=String.raw`(?:\\?\/|\\{1,2})`,ri=String.raw`(?<![\w.-])\.(?:bashrc|zshrc|zshenv|zlogin|bash_profile|bash_login|zprofile)(?![\w-])|(?<=[\/\\])(?<!\.[\w-]*[\/\\])\.profile(?![\w-])|(?<![\w-])Launch(?:Agents|Daemons)(?![\w-])|systemd${J}user(?![\w-])|fish${J}(?:config\.fish|conf\.d)(?![\w-])`+String.raw`|(?<![\w$])\$profile(?![\w-])|(?<![\w.-])Microsoft\.\w+_profile\.ps1(?![\w-])|(?:PowerShell|\$pshome)${J}profile\.ps1(?![\w-])|systemctl${q}${K}+--user${q}${K}+enable(?![\w-])|systemctl${q}${K}+enable(?:${K}+[^\s;|&]+){0,6}?${K}+--user(?![\w-])|(?<![\w.-])\.claude${J}settings(?:\.local)?\.json|(?<![\w.-])\.vscode${J}tasks\.json`,ii=String.raw`(?<![\w.-])[gG][hH](?:\.[eE][xX][eE])?${K}+auth${K}+token(?![\w-])`,ai=String.raw`[\d*?[\]-]{1,20}|\$\{[^}\n]{0,100}\}|\$\([^)\n]{0,200}\)|\u0060[^\u0060\n]{0,200}\u0060|\$\w{1,64}|\{\w{0,64}\}|%d`,oi=String.raw`(?<![\w.-]|(?<![\/\\])\/|[\w.~%-](?:\\?\/){2})`,si=String.raw`(?![\w-]|\.[\w-]|(?::[^\s\/@'"\x60]{0,64})?@)`,ci=String.raw`(?<![\p{ID_Continue}$-])trufflehog(?![\p{ID_Continue}$-])`,li=[[`credential-files`,/(?<![\w$.-])\.(?:npmrc|ssh|aws)(?![\w-])/gu],[`tokens`,new RegExp(String.raw`^["'\u0060]${G}["'\u0060]$|(?:\$\{?|%)${G}(?![\p{ID_Continue}$])`,`gu`)],[`gh-token`,new RegExp(ii,`gu`)],[`cloud-metadata`,new RegExp(String.raw`${oi}169\.254\.169\.254${si}(?!(?::\d{1,5})?\\?\/metadata\\?\/instance(?![\w-]))|${oi}metadata\.google\.internal${si}`,`giu`)],[`runner-worker`,/(?<![\w$-])Runner\.Worker(?![\w$-])/gu],[`process-memory`,new RegExp(String.raw`\/proc\/(?:${ai})\/mem(?![\w-])`,`gu`)],[`trufflehog`,new RegExp(ci,`giu`)],[`publish`,/(?<![\w-])(?:npm|pnpm|yarn)(?:\s+-{1,2}\w[\w-]*(?:=\S*|\s+(?!-)\S+)?){0,8}?\s+publish(?![\w-])|\/-\/whoami(?![\w-])/gu],[`shell`,new RegExp(ni,`giu`)],[`persistence`,new RegExp(ri,`giu`)]],ui=new Set([`gh-token`,`runner-worker`,`process-memory`,`trufflehog`,`shell`,`persistence`]),di=li.filter(([e])=>ui.has(e)),fi=/(?:\.(?:sh|bash|zsh|ksh|mksh|dash|ash|csh|tcsh|fish|command|bat|cmd|ps1|psm1)|(?:^|[\\/])\.(?:bashrc|zshrc|zshenv|zlogin|bash_profile|bash_login|zprofile|profile))$/iu,pi=/^[ \t]*#.*$|^((?:[^'"\n#\\]|\\.|'[^'\n]*'|"(?:[^"\n\\]|\\.)*")*?[ \t;&|])#.*$/gmu,mi=/\.psm?1$/iu,hi=/^\uFEFF?#!\s*\S*\/(?:env\s+(?:(?:-\S+|\w+=\S*)\s+)*)?pwsh(?![\w-])/u,gi=/^((?:[^'"\n#\u0060]|\u0060.|'[^'\n]*'|"(?:[^"\n\u0060]|\u0060.)*")*?)(?:(?<=^|[\s;({=,])<#[\s\S]*?(?:#>|(?![\s\S]))|(?<=^|[ \t;&|])#.*$)/gmu,_i=/\.(?:bat|cmd)$/iu,vi=/^[ \t]*@?(?:::|rem(?![\w-])).*$|(?<=&|\|\|)[ \t]*@?rem(?![\w-]).*$/gimu,yi=new RegExp(String.raw`^\uFEFF?#!\s*\S*\/(?:env\s+(?:(?:-\S+|\w+=\S*)\s+)*)?${W}(?![\w-])`,`u`),bi=[[`claude`,/^(["'\u0060])\.claude\1$/iu,/^(["'\u0060])settings(?:\.local)?\.json\1$/iu],[`vscode`,/^(["'\u0060])\.vscode\1$/iu,/^(["'\u0060])tasks\.json\1$/iu]],xi=/^(["'\u0060])\.profile\1$/iu,Si=/(?:homedir\s*\(\s*\)|\b(?:HOME|USERPROFILE)|(["'\u0060])~\1)\s*,\s*$/u,Ci=[[`vm`,/^(["'\u0060])(?:node:)?vm\1$/u],[`child-process`,/^(["'\u0060])(?:node:)?child_process\1$/u],[`publish`,/^(["'\u0060])libnpmpublish\1$/u]],wi=/^(["'\u0060])(?:npm|pnpm|yarn)\1$/u,Ti=/^(["'\u0060])publish\1$/u,Ei=/^(["'\u0060])-/u,Di=new RegExp(String.raw`^(?:[\s,[]|${yr})*$`,`u`),Oi=/^(["'\u0060])put\1$/iu,ki=new RegExp(String.raw`\bmethod["']?${U}[:=]${U}$`,`u`),Ai=/^(["'\u0060])(?:\S*[\\/]|[a-z]:[\\/][^\n]*[\\/])?(?:curl|wget|certutil|bitsadmin|powershell|pwsh|systemctl|gh)(?:\.exe)?\1$/iu,ji=/[;|&]/u,Mi=new RegExp(String.raw`^(?:[\s,[\]\w$.?]|${yr})*$`,`u`),Ni=new RegExp(ri,`iu`),Pi=new RegExp(String.raw`(?:(?:require[\w$]*${U}(?:\?\.${U})?|\bimport${U})\(|\b(?:from|import))${U}$`,`u`),Fi=new RegExp(String.raw`\b(?:import|export)${U}type\b(?!${U}(?:from\b|=))[^;'"\x60]*(?:\bfrom|=${U}require${U}\()${U}$`,`u`),Y={tag:`eval`,note:`Runs a string as code`},X={tag:`credentials`,note:`Reaches for credentials`},Z=new Map([[`eval`,{...Y,name:`eval`}],[`function`,{...Y,name:`Function`}],[`vm`,{...Y,name:`vm`}],[`compile`,{...Y,name:`Module._compile`}],[`child-process`,{tag:`child_process`,note:`Runs other programs`,name:`child_process`}],[`credential-files`,{...X,name:`.npmrc, .ssh or .aws`}],[`tokens`,{...X,name:`NPM_TOKEN or GITHUB_TOKEN`}],[`gh-token`,{...X,name:`gh auth token`}],[`cloud-metadata`,{...X,name:`169.254.169.254 or metadata.google.internal`}],[`runner-worker`,{...X,name:`Runner.Worker`}],[`process-memory`,{...X,name:`/proc/<pid>/mem`}],[`trufflehog`,{...X,name:`trufflehog`}],[`env`,{tag:`whole env`,note:`Reads out the whole environment`,name:`process.env, by JSON.stringify, Object.entries or values, URLSearchParams`,mark:`critical`}],[`publish`,{tag:`publish`,note:`Publishes to npm`,name:`npm publish, /-/whoami or a registry PUT`,mark:`critical`}],[`shell`,{tag:`shell`,note:`Runs shell commands fetching or handing off code`,name:`curl or wget a URL, | sh, powershell -…, iex, rundll32, osascript, /dev/tcp`}],[`persistence`,{tag:`persistence`,note:`Names a place code runs from again later`,name:`.bashrc, .zshrc, $PROFILE, LaunchAgents, systemd user units, .claude/settings.json, .vscode/tasks.json`,mark:`critical`}]]);function Ii(e,t,n=!1){let r=P(e,t,n),i=typeof t==`string`&&(fi.test(e)||yi.test(t));if(!r&&!i)return null;let a=new Map,o=(e,t)=>{let n=a.get(e);n?n.length<Dn&&n.push(t):a.set(e,[t])};if(r&&Li(t,0,o),i&&jr.test(t)){let n=_i.test(e)?vi:mi.test(e)||hi.test(t)?gi:pi,r=t.replace(n,(e,t=``)=>t+e.slice(t.length).replaceAll(/[^\n]/gu,` `));for(let[e,t]of di)for(let{index:n}of r.matchAll(t))o(e,n)}if(a.has(`registry`))for(let e of a.get(`put`)??[])o(`publish`,e);for(let[e]of bi)if(a.has(`${e}-file`))for(let t of a.get(`${e}-dir`)??[])o(`persistence`,t);if(![...Z.keys()].some(e=>a.has(e)))return null;let s=kn(t);return new Map([...Z.keys()].filter(e=>a.has(e)).map(e=>[e,[...new Set(a.get(e).map(s))].toSorted((e,t)=>e-t)]))}function Li(e,t,n){if(!jr.test(e))return;let r=null,i=null,a=0,o=!1,s=!1;for(let{0:c,1:l,groups:u,index:d}of e.matchAll(zr)){if(l===void 0){for(let e of Ri)u[e]&&n(e,t+d);continue}if(l[0]===`/`)continue;let f=l[0]==="`"&&jr.test(l)?Vi(l):[];for(let[e,r]of f)Li(l.slice(e,r),t+d+e,n);let p=f.length===0?l:Bi(l,f),m=()=>{let t=e.slice(d+c.length,d+c.length+20);return!Hr.test(t)&&(!Ur.test(t)||!Wr.test(e.slice(Math.max(0,d-300),d)))},h=Vr.test(p)?li.flatMap(([e,t])=>p.search(t)===-1?[]:[...p.matchAll(t)].map(({index:t})=>[e,t])):[];for(let[e,r]of h)(e!==`tokens`||r>0||m())&&n(e,t+d+r);p.includes(`registry.`)&&Xr.test(Jr(p).replaceAll(Zr,``))&&n(`registry`,t+d);for(let[r,i]of Ci)i.test(l)&&zi(e,d)&&n(r,t+d);xi.test(l)&&Si.test(e.slice(Math.max(0,d-100),d))&&n(`persistence`,t+d);for(let[e,r,i]of bi)r.test(l)&&n(`${e}-dir`,t+d),i.test(l)&&n(`${e}-file`,t+d);if(s&&Di.test(e.slice(a,d))?(Ti.test(l)&&n(`publish`,t+d),s=Ei.test(l)||o,o=Ei.test(l)):s=!1,wi.test(l)&&([s,o]=[!0,!1]),i&&i.arguments<20&&Mi.test(e.slice(a,d))){let e=p.slice(1,-1);i.line+=` ${ji.test(e)?`"${e.replaceAll(`"`,`'`)}"`:e}`,i.arguments++;let{line:t}=i,r=di.find(([,e])=>t.search(e)!==-1);r&&(n(r[0],i.at),i=null)}else i=null;if(Ai.test(l)&&(i={arguments:0,at:t+d,line:l.slice(1,-1)}),r&&r.text.length+p.length<200&&Di.test(e.slice(a,d))){let[e,t]=[r.text.slice(1,-1),p.slice(1,-1)];!Ni.test(e)&&!Ni.test(t)&&Ni.test(`${e}/${t}`)&&n(`persistence`,r.at)}r={text:p,at:t+d},Oi.test(l)&&ki.test(e.slice(Math.max(0,d-300),d))&&n(`put`,t+d),a=d+c.length}}var Ri=[`eval`,`function`,`compile`,`tokens`,`env`,`put`];function zi(e,t){let n=e.slice(Math.max(0,t-300),t);return Pi.test(n)&&!Fi.test(n)}function Bi(e,t){let n=[],r=0;for(let[i,a]of t)n.push(e.slice(r,i),` `.repeat(a-i)),r=a;return n.push(e.slice(r)),n.join(``)}function Vi(e){let t=[];for(let n=e.indexOf("${");n!==-1;n=e.indexOf("${",n)){let r=0;for(;e[n-1-r]===`\\`;)r++;if(r%2==1){n+=2;continue}let i=Ui(e,n+2);t.push([n+2,i]),n=i}return t}var Hi=new RegExp(xn.source,`muy`);function Ui(e,t){let n=0;for(let r=t;r<e.length;r++){let t=e[r];if(`"'\`/ `.includes(t)){Hi.lastIndex=r;let t=Hi.exec(e);if(t){r+=t[0].length-1;continue}}if(t===`{`)n++;else if(t===`}`&&n--===0)return r}return e.length}var Wi=e=>[...new Set([...Z].filter(([t])=>e.some(e=>e.has(t))).map(([,{tag:e}])=>e))].join(`, `);X.tag;var Gi=e=>[...new Map([...e?.keys()??[]].map(e=>Z.get(e)).map(({tag:e,mark:t})=>[e,{name:e,severity:t??`high`}])).values()],Ki=[`critical`,`high`,`moderate`,`low`,`notice`],qi=e=>e===`warn`?`high`:`notice`;function Ji({path:e,bytes:t,readability:n,runsCode:r,exfiltration:i,script:a}){let o=Kn(n),s=o!==`ascii`&&o!==`map`&&F.get(o).mark;return[...Gi(r),..._r(i).map(([e,t])=>({name:e,severity:vr(e,t)})),...Wn(e,t,a)?[{name:`Large`,severity:`notice`}]:[],...n.obfuscation?[{name:`Obfuscated`,severity:`high`}]:[],...qn(n).filter(e=>e===`controls`||e===`long`).map(e=>({name:F.get(e).tag,severity:qi(Jn(n,e))})),...s?[{name:F.get(o).tag,severity:qi(s)}]:[]]}function Yi(e,t,n,r=!1){let i=Gn(e,t,r),a=hr(e,t,r),o=Ii(e,t,r);return{readability:i,runsCode:o,exfiltration:a,hosts:fr(e,t,r),stamps:Ji({path:e,bytes:n,readability:i,runsCode:o,exfiltration:a,script:r})}}var Q=(e,t)=>new Date(Date.parse(e)+t*864e5);function Xi(e){let t=[];if(!e?.days)return t;for(let n=e.days.length-1;n>=6;n-=7){let r=0;for(let t=n-6;t<=n;t++)r+=e.days[t];t.push({from:Q(e.start,n-6),to:Q(e.start,n),total:r})}return t.toReversed()}function Zi(e){let t=[];if(!e?.days)return t;let n=Date.parse(e.start),r=null;e.days.forEach((e,i)=>{let a=new Date(n+i*864e5);a.getUTCDate()===1&&(r={from:a,to:a,total:0},t.push(r)),r&&(r.total+=e,r.to=a)});let i=t.at(-1);return i&&new Date(i.to.getTime()+864e5).getUTCDate()!==1&&t.pop(),t}var Qi=[[10,55e7],[20,405e6],[50,285e6],[100,225e6],[200,165e6],[500,95e6],[1e3,5e7],[2e3,2e7],[5e3,4e6],[1e4,85e4],[2e4,155e3],[5e4,18e3],[1e5,2e3],[1/0,0]];function $i(e){let t=Xi(e).slice(-6);if(t.length===0)return null;let n=Math.max(...t.map(e=>e.total));return Qi.find(([,e])=>n>=e)[0]}var ea=e=>e<=200?`is-solid`:e<=5e3?`is-top`:e<=2e4?`is-mid`:e<=1e5?`is-low`:`is-unpopular`,ta=e=>e>2e4,na=g`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" aria-hidden="true" viewBox="0 75 405 400"><path fill="currentColor" d="m62 447.6 65.8-68.2c2.2-.9 22.7 12 28.2 14.1C295.4 446.8 399.2 263.6 285.1 172 184.3 91.1 41.1 191.5 82 315.6c3.9 12 10.8 21.7 15.4 33.2l-47.1 47C-32 294.9 7.4 142.3 126.3 91.3 241.3 42 374.4 112 398 234.5c29.4 152.7-116.5 274.9-262.7 223.6-15.9-5.6-17-10.6-34.9-10.6H62Z"/><path fill="#e02129" d="M190.1 181.8c128.8-15 141.2 170.8 26 182.6-126.4 12.9-137.9-169.5-26-182.6M209 236c-7.4 5.6-10.8-5.4-13-7.7-9.6-10.3-19.4-.8-14 1.7s9.5-.3 10.1 5.6-9 9.9-7.9 16.4c13.2-5.9 25.9-6.4 39.1 0 3.2-7.1-7.9-12.1-7.8-14.8.1-9.4 11.6-6.2 12.6-7.2 4.3-4.3-8.9-11.7-17.1-.6-1.3 1.8-1.4 6.3-1.9 6.6zm-7.6 14.3c-10.1-1.5-19.3 10-25 11.8s-23.2 1.5-14.9 16.3c3.9.8 5.1-13.1 13.3-9.4 1.9 13.1-2.8 8.7-9 12.2-10 5.7-8.1 20.2-1.3 12.8 2.7-3 1.5-9.6 10.3-7.7 1.3 15.9-.8 8.4-7.9 11.7-11.5 5.3-9 20.2-1.7 14.8s0-10.8 8.6-9.3c1 .2 5.8 10.8 12.4 14.5 13.7 7.9 35 5.5 44.8-7.6s1.6-6.5 1.8-6.7c4-3.1 11.3 4.6 11 9.2l5.5-1.5c2.2-3.1-1.6-8.2-3.9-10.3-7.6-6.8-13.5.9-11-14.8 9-2.6 8.4 8.7 9.4 9.4 6 4.2 8.4-7.8 1.5-13.2-7.4-5.8-13.2 3.6-10.9-13.4 7.4-1.3 8.3 3.2 9.4 9.4 8.3 1.4 6.9-7.2 3.1-11.8-4.5-5.5-10.5-2.6-15.7-4.7-1.3-.5-25.1-18.8-25.1-9.4v52.5c-1.5.6-4.7-1.4-4.7-2.3z"/><ellipse cx="206.6" cy="270" fill="#e02129" rx="74.6" ry="66.5"/><path fill="#fff" d="M200.6 250v55.5s.4 1 .5 1.1c1.1 1.8 3.7 1.8 4.9 0 .1-.2.5-1.1.5-1.3v-55.4a34 34 0 0 1 17.2 5.8c3.1 2.2 5.6 5.1 7.7 8.3 3.8.1 7.6-.5 11.3.8 5.2 1.8 9.6 7.5 9.6 13.1 0 4.2-5.8 5.3-7.3 1.5-.7-1.8-.3-3.2-1.7-5-.8-1-3-2.7-4.3-2.7h-4.5c1.1 4.1.8 8.4.8 12.6.1.1 1.7-.1 2-.1 7.3 0 13.9 6 14.4 13.5.3 5.3-6.3 6-7.5 1.8-.6-2.1-.3-3.5-2-5.3-.8-.9-2.9-2.2-4.2-2.2h-3c.2 1 .2 2.2.1 3.2 0 2.1-.4 4.3-.9 6.4-.2.9-.5 1.8-.7 2.6 5.5-.7 10.5.7 14.1 5 1.7 2 3.4 5.6 3.6 8.3.5 5.4-6.6 6.7-7.8 1.2-.5-2.3-.7-3.8-2.7-5.4-3.1-2.5-7-1.2-10.7-1.4-1.9 3.2-4.5 6.1-7.5 8.4-14.4 10.8-36.9 7.2-46.2-8.4-.4-.2-2.4 0-2.9 0-3.2 0-6-.6-8.4 2.1-1.6 1.8-1.5 3.2-2.1 5.3-1.2 4.5-7.9 3.6-7.7-1.4.3-5.5 4.9-11.3 10.1-13 1.7-.5 5.7-1 7.4-.6.1 0 .1.1.1-.1 0-1.1-.7-2.8-.9-4.1-.4-2.7-.6-5.4-.4-8.1-2.8-.1-5.3.2-7.2 2.5-1.4 1.7-1.3 2.9-1.8 4.9-1.1 4.4-7.9 3.8-7.6-1.5.2-4.1 2.9-8.7 6.3-11 3-2.1 6.5-2.7 10.1-2.6v-5.8c.2-2.2.3-4.5.9-6.6h-4.5c-1.8 0-4.2 2.2-4.9 3.7-1.1 2.3-.4 6-4.1 6.3-3.4.3-4.5-2.3-4.1-5.2.9-6.1 5.1-11 11.3-12.2 3.1-.6 6.2 0 9.3-.4 2.2-3.1 4.8-6 7.9-8.3 4.9-3.5 10.9-5.1 16.8-5.8Z"/><path fill="#fff" d="M197.3 235.1c4.1-.7 8.3-.9 12.4 0 1.1-7.6 7-14.6 15.2-14 3.3.2 5.7 3.1 3.6 6.1-1.5 2-4.1 1-6.2 1.7s-3.7 2.5-4.5 4.4c-.3.7-1.2 3.8-.9 4.3 0 .1 1.3 1 1.6 1.2 3.4 3.1 6.2 7.4 6.6 12 0 .6-.1 1.2.1 1.8-.1.1-2.6-1.5-2.9-1.8-10.5-6-27.5-5.7-37.9.4-.2.1-2.3 1.6-2.4 1.5-.2-5.5 2.8-10.5 6.8-14 .3-.3 1.3-.9 1.5-1.1.1-.1.1-.2.1-.3 0-.5-.3-1.8-.5-2.3-.9-3.3-3-6-6.6-6.3h-2.2c-4.2-.4-4.5-6.5-.2-7.4 2.3-.5 5.2 0 7.3 1 5.2 2.2 8.5 7.4 9.1 12.9Z"/></svg>`,ra=new Map([[`registry`,{label:`Source: npm registry`,icon:Ct}],[`repository`,{label:`Source: GitHub repository`,icon:d(m)}],[`osv`,{label:`Source: OSV`,icon:na}]]);function ia(e){return e===`unknown`?`Unrated`:e.charAt(0).toUpperCase()+e.slice(1)}function aa(e){if(typeof e!=`string`)return null;let t=/\/(GHSA-[a-z0-9-]+)(?:[/?#]|$)/iu.exec(e);return t?t[1]:null}var oa=g`<svg class="external-link-icon" viewBox="0 0 16 16" width="11" height="11" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 13L13 3"/><path d="M5 3h8v8"/></svg>`;function sa(e){let t=/^CWE-(\d+)$/u.exec(e);if(!t)return g`<span>${e}</span>`;let n=`https://cwe.mitre.org/data/definitions/${t[1]}.html`;return g`<a class="bundle-advisory-cwe" href="${n}" target="_blank" rel="noopener noreferrer">${e}</a>`}function ca(e,t){return g`<div class="bundle-advisory-rail"><span class="${`bundle-advisory-severity sev-${e}`}">${ia(e)}</span> ${typeof t==`number`?g`<span class="bundle-advisory-cvss-score">CVSS <span class="mono">${t.toFixed(1)}</span></span>`:y}</div>`}function la(e){let t=typeof e.url==`string`&&/^https?:\/\//iu.test(e.url)?e.url:null,n=e.ghsa??aa(t)??(typeof e.id==`string`?e.id:null),r=ra.get(e.source);return!r&&!(n&&t)?y:g`<span class="bundle-advisory-reference">${r?g`<span class="bundle-advisory-source" role="img" aria-label="${r.label}">${r.icon}</span>`:y} ${n&&t?g`<a class="bundle-advisory-ghsa" href="${t}" target="_blank" rel="noopener noreferrer">${n}${oa}</a>`:y}</span>`}function ua(e){let t=Array.isArray(e)?e.filter(e=>typeof e==`string`):[];return t.length>0?g`<span class="bundle-advisory-cwes">${t.map((e,t)=>g`${t===0?``:`, `}${sa(e)}`)}</span>`:y}function da(e,t=null){let n=typeof e.cvss?.vectorString==`string`?e.cvss.vectorString:``,r=typeof e.vulnerable_versions==`string`?e.vulnerable_versions:null,i=Array.isArray(e.versions)?e.versions.filter(e=>typeof e==`string`):[];return g`<li class="bundle-advisory-row">${ca(e.severity,e.cvss?.score)}<div class="bundle-advisory-body"><div class="bundle-advisory-header">${t&&typeof e.details==`string`&&e.details.trim()?g`<button type="button" class="bundle-advisory-title" aria-haspopup="dialog" @click="${()=>t(e)}">${e.title}</button>`:g`<span class="bundle-advisory-title">${e.title}</span>`} ${la(e)}</div><div class="bundle-advisory-subrow"><div class="bundle-advisory-meta">${e.informational?g`<span>${e.informational}</span>`:y} ${r?g`<span>Affected <span class="mono">${r}</span></span>`:y} ${i.length>0?g`<span>Matches <span class="mono">${i.join(`, `)}</span></span>`:y} ${ua(e.cwe)}</div>${n?g`<div class="bundle-advisory-cvss-vector mono">${n}</div>`:y}</div></div></li>`}var $=e=>e??y,fa=g`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" aria-hidden="true"><circle cx="8" cy="8" r="3"/><path d="M1 8h4m6 0h4"/></svg>`,pa=g`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="m4 6 4 4 4-4"/></svg>`,ma=[{kind:`branch`,label:`Branch`,icon:g`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" aria-hidden="true"><circle cx="4" cy="3" r="1.5"/><circle cx="4" cy="13" r="1.5"/><circle cx="12" cy="3" r="1.5"/><path d="M4 4.5v7m0-3h3a5 5 0 0 0 5-4"/></svg>`},{kind:`tag`,label:`Tag`,icon:g`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" aria-hidden="true"><path d="M2 2h5.5l6.5 6.5-5.5 5.5L2 7.5Z"/><circle cx="5" cy="5" r="1"/></svg>`},{kind:`commit`,label:`Commit SHA`,icon:fa}],ha=/^v?(\d+(?:\.(?:\d+|x))*)(?:[-+](.+))?$/iu;function ga(e){let t=ha.exec(e);return t?t[2]===void 0?`line`:`version`:`other`}function _a(e){let t=e.map(e=>{let t=ha.exec(e);return{name:e,parts:t?.[1].split(`.`).map(e=>e.toLowerCase()===`x`?1/0:Number(e)),suffix:t?.[2]??``}});return[...t.filter(e=>e.parts).toSorted((e,t)=>{if(!!e.suffix!=!!t.suffix)return e.suffix?1:-1;for(let n=0;n<Math.max(e.parts.length,t.parts.length);n++){let r=(t.parts[n]??1/0)-(e.parts[n]??1/0);if(r)return r}return e.suffix.localeCompare(t.suffix)}),...t.filter(e=>!e.parts)].map(e=>e.name)}function va(e,t,n){let r=e=>e===n||!e.includes(`/`)?null:e.slice(0,e.indexOf(`/`)),i=Map.groupBy(e.filter(r),r),a=e.filter(e=>!(i.get(r(e))?.length>2)).map(e=>({name:e}));for(let[e,n]of i)n.length<=2||(a.push({prefix:e,count:n.length,expanded:t.has(e)}),t.has(e)&&a.push(..._a(n.map(t=>t.slice(e.length+1))).map(t=>({name:`${e}/${t}`,label:t,group:e}))));return a}var ya=class extends re{static properties={refs:{attribute:!1},kind:{type:String},name:{type:String},disabled:{type:Boolean},installTooltips:{attribute:!1},_open:{state:!0},_query:{state:!0},_active:{state:!0},_expanded:{state:!0},_keyboard:{state:!0}};static styles=ne`:host{display:block;min-width:0}:host,.revision-menu{-webkit-app-region:no-drag;app-region:no-drag}*{box-sizing:border-box}button,input{font:inherit;color:var(--text)}button{cursor:default;user-select:none}.revision{display:flex;align-items:center;min-width:0;height:2rem;margin:0;border:1px solid var(--border);border-radius:var(--ui-radius, 5px);background:var(--bg)}.revision.keyboard:focus-within{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.revision-size{display:grid;grid-template-columns:minmax(0,1fr);flex:1 1 auto;align-self:stretch;min-width:0}.revision-size>input,.revision-size:after{grid-area:1 / 1}.revision-size>input{width:100%}.revision-size:after{content:attr(data-value);visibility:hidden;height:0;overflow:hidden;white-space:pre;min-width:8rem;padding:0 calc(.6rem + 2px) 0 .6rem;font-size:.76rem}.revision input{height:100%;min-height:0;padding:.3rem .6rem;min-width:0;border:0;border-radius:0;background:transparent;color:var(--text);font-size:.76rem}.revision input:focus-visible{outline:none}.revision-switch{display:flex;flex:none;align-self:stretch;padding:2px;gap:2px}.revision-switch button{position:relative;display:grid;place-items:center;width:1.8rem;padding:0;border:0;border-radius:var(--ui-radius, 3px);background:transparent;color:var(--muted)}.revision-switch button:hover:not(:disabled){color:var(--text);background:var(--surface-active)}.revision-switch button:focus-visible{outline-offset:-2px}.revision-switch button[aria-pressed=true]{color:var(--accent);background:var(--selected-icon-background, color-mix(in srgb, var(--accent) 15%, var(--bg)))}.revision-switch button[aria-pressed=true]:before{content:var(--selected-icon-ring-content, none);position:absolute;left:50%;top:50%;width:22px;height:22px;box-sizing:border-box;border:1px solid currentcolor;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}.revision-switch svg{width:1rem;height:1rem}.revision-expand{display:grid;place-items:center;align-self:stretch;flex:none;width:2rem;padding:0;border:0;border-radius:var(--ui-radius, 4px);color:var(--muted);background:transparent}.revision-expand svg{width:.9rem;height:.9rem}.revision-expand:hover:not(:disabled){color:var(--text)}.revision-expand:focus-visible{outline-offset:-2px}.revision-menu{visibility:hidden;position:fixed;inset:auto;margin:0;padding:.45rem;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;border:1px solid var(--border);border-radius:var(--ui-radius, 8px);background:var(--surface-active);color:var(--text);box-shadow:0 .65rem 1.8rem #00000073}.revision-menu[data-positioned]{visibility:visible}.revision-options{display:flex;flex-direction:column;gap:.15rem}.revision-section{display:grid;grid-template-columns:repeat(var(--revision-columns, 1),minmax(0,1fr));gap:.15rem .5rem}.revision-section+.revision-section{padding-top:.15rem;border-top:1px solid var(--border)}.revision-options button{min-width:0;padding:.375rem .6rem;border:0;border-radius:var(--ui-radius, 4px);background:transparent;color:var(--text);text-align:left;font-size:.76rem}.revision-options button span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.revision-options button[aria-selected=true]{color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent)}.revision-options button:hover,.revision-options button[data-active]{background:color-mix(in srgb,var(--text) 8%,transparent)}.revision-options button[data-active]{outline:1px solid var(--accent);outline-offset:-1px}.revision-options .revision-group{display:flex;align-items:center;gap:.4rem}.revision-group svg{flex:none;width:.75rem;height:.75rem;color:var(--muted)}.revision-group[aria-expanded=false] svg{rotate:-90deg}.revision-options .revision-group .count{display:inline-flex;flex:none;min-width:1.1rem;padding:0 .35rem;background:transparent;font-size:.7rem}.revision-empty{margin:0;padding:.65rem;color:var(--muted);font-size:.75rem;cursor:default;user-select:none}button:disabled,input:disabled{opacity:.5}:host-context(body.theme-w95) *{overscroll-behavior:none}`;constructor(){super(),this.refs=null,this.kind=`branch`,this.name=``,this.disabled=!1,this._open=!1,this._query=``,this._active=-1,this._expanded=new Set,this._keyboard=!1,this._pointer=!1,this._onViewport=()=>this.position(),this._onKey=()=>{this._pointer=!1}}connectedCallback(){super.connectedCallback(),globalThis.addEventListener(`resize`,this._onViewport),globalThis.addEventListener(`scroll`,this._onViewport,!0),globalThis.addEventListener(`keydown`,this._onKey,!0)}disconnectedCallback(){globalThis.removeEventListener(`resize`,this._onViewport),globalThis.removeEventListener(`scroll`,this._onViewport,!0),globalThis.removeEventListener(`keydown`,this._onKey,!0),super.disconnectedCallback()}updated(e){e.has(`installTooltips`)&&this.installTooltips?.(this.renderRoot),e.has(`kind`)&&this.kind===`commit`&&this._open&&this.close(),this.position()}change(e,t,n){this.dispatchEvent(new CustomEvent(`revision-change`,{detail:{how:e,kind:t,name:n},bubbles:!0,composed:!0}))}suggestions(e=this.kind){let t=this.refs??{branches:[],tags:[]},n=e===`branch`?t.branches:e===`tag`?t.tags:[],r=e===`branch`?[...t.defaultBranch?[t.defaultBranch]:[],..._a(n.filter(e=>e!==t.defaultBranch))]:n,i=this._query.trim().toLowerCase();return r.filter(e=>e.toLowerCase().includes(i))}entries(e=this._expanded){let t=this.suggestions();return this.kind===`branch`&&!this._query.trim()?va(t,e,this.refs?.defaultBranch):t.map(e=>({name:e}))}toggleGroup(e){let t=new Set(this._expanded);t.delete(e)||t.add(e),this._expanded=t}sections(e){let t=e=>e.group??(this.kind===`branch`?ga(e.name):`all`),n=e[1]?.prefix==null?e[1]:void 0,r=[];for(let[i,a]of e.entries()){if(a.prefix!=null){r.push({header:a,index:i});continue}let e=t(i===0&&a.name===this.refs?.defaultBranch&&n?n:a);r.at(-1)?.key===e?r.at(-1).items.push({entry:a,index:i}):r.push({key:e,items:[{entry:a,index:i}]})}return r}show({query:e=``,kind:t=this.kind}={}){t===`commit`||this.disabled||(this._open||(this._expanded=new Set(this.name.includes(`/`)?[this.name.slice(0,this.name.indexOf(`/`))]:[])),this._query=e,this._active=-1,this.renderRoot?.querySelector(`.revision-menu`)?.showPopover())}close(){this.renderRoot?.querySelector(`.revision-menu`)?.hidePopover(),this._open=!1,this._active=-1}focusName(){this.renderRoot?.querySelector(`.revision-name`)?.focus({preventScroll:!0})}pick(e){this.change(`pick`,this.kind,e),this.focusName(),this.close()}pickKind(e){e!==this.kind&&(this.close(),this.change(`kind`,e,e===`branch`&&this.refs?.defaultBranch||``)),this.focusName(),this.show({kind:e})}position(){if(!this._open)return;let e=this.renderRoot.querySelector(`.revision-menu`),t=e.querySelector(`.revision-options`),n=this.renderRoot.querySelector(`.revision-name`).getBoundingClientRect(),r=parseFloat(getComputedStyle(this).fontSize),i=document.createRange(),a=t.querySelector(`.revision-section > button`),o=a?parseFloat(getComputedStyle(a).paddingLeft)+parseFloat(getComputedStyle(a).paddingRight):0,s=[...t.querySelectorAll(`.revision-section`)].map(e=>{let t=0;for(let n of e.querySelectorAll(`button > span`))i.selectNodeContents(n),t=Math.max(t,i.getBoundingClientRect().width);return{section:e,count:e.children.length,columnWidth:Math.max(5*r,Math.min(15*r,Math.ceil(t+o)+1))}}),c=s.length>0&&parseFloat(getComputedStyle(s[0].section).columnGap)||0,l=e.offsetWidth-t.clientWidth,u=Math.min(window.innerWidth-16,Math.max(n.width,...s.map(({count:e,columnWidth:t})=>Math.min(3,Math.ceil(e/8))*(t+c)-c+l))),d=this.entries({has:()=>!0}).length<=8;for(let{section:e,count:t,columnWidth:n}of s){let r=Math.max(1,Math.floor((u-l+c)/(n+c)));e.style.setProperty(`--revision-columns`,d?1:Math.ceil(t/Math.ceil(t/r)))}e.style.width=`${u}px`,e.style.left=`${Math.max(8,Math.min(n.left,window.innerWidth-u-8))}px`;let f=window.innerHeight-n.bottom-6-8,p=n.top-6-8,m=f<Math.min(e.scrollHeight,320)&&p>f;e.style.maxHeight=`${Math.max(0,Math.min(420,m?p:f))}px`,e.style.top=`${Math.max(8,m?n.top-e.offsetHeight-6:n.bottom+6)}px`,e.dataset.positioned=``}async keyDown(e){if(e.key===`Escape`||e.key===`Tab`){e.key===`Escape`&&this._open&&(e.preventDefault(),e.stopPropagation()),this.close();return}if(e.key===`Enter`){let t=this.entries()[this._active];this._open&&t?.prefix!=null?(e.preventDefault(),this.toggleGroup(t.prefix)):this._open&&t!=null?(e.preventDefault(),this.pick(t.name)):this.close();return}if(this.kind===`commit`||![`ArrowDown`,`ArrowUp`].includes(e.key))return;e.preventDefault(),this._open||this.show();let t=this.entries().length;this._active=t===0?-1:e.key===`ArrowDown`?Math.min(this._active+1,t-1):this._active<=0?t-1:this._active-1,await this.updateComplete,this.renderRoot.querySelector(`[data-active]`)?.scrollIntoView({block:`nearest`})}render(){let e=this.entries(),t=this.kind===`commit`?`Commit SHA`:this.kind===`tag`?`Tag`:`Branch`,n=this.kind!==`commit`;return g`<form class="${this._keyboard?`revision keyboard`:`revision`}" @pointerdown="${()=>{this._pointer=!0,this._keyboard=!1}}" @focusin="${()=>{this._keyboard=!this._pointer}}" @focusout="${e=>{e.currentTarget.contains(e.relatedTarget)||(this._keyboard=!1,this.close())}}" @submit="${e=>{e.preventDefault(),this.change(`submit`,this.kind,this.name)}}"><div class="revision-switch" role="group" aria-label="Revision type">${ma.map(({kind:e,label:t,icon:n})=>g`<button type="button" aria-label="${t}" data-tooltip="${t}" aria-pressed="${this.kind===e}" ?disabled="${this.disabled}" @click="${()=>this.pickKind(e)}">${n}</button>`)}</div><span class="revision-size" data-value="${this.name}"><input class="revision-name" type="text" size="1" aria-label="${t}" role="${$(n?`combobox`:void 0)}" aria-autocomplete="${$(n?`list`:void 0)}" aria-expanded="${$(n?String(this._open):void 0)}" aria-controls="${$(n?`revisions`:void 0)}" aria-activedescendant="${$(this._open&&this._active>=0?`revision-${this._active}`:void 0)}" autocomplete="off" spellcheck="false" placeholder="${n?`Choose or enter a ${this.kind}\u2026`:`Commit SHA…`}" .value="${w(this.name)}" ?disabled="${this.disabled}" @focus="${()=>this.show()}" @click="${()=>this.show()}" @keydown="${this.keyDown}" @input="${e=>{this.change(`input`,this.kind,e.target.value),this.show({query:e.target.value})}}"></span>${n?g`<button type="button" class="revision-expand" aria-label="${`Show ${this.kind} suggestions`}" aria-expanded="${this._open}" ?disabled="${this.disabled}" @mousedown="${e=>e.preventDefault()}" @click="${()=>{this._open?this.close():(this.focusName(),this.show())}}">${pa}</button>`:y}<div class="revision-menu" id="revisions" popover="auto" role="listbox" aria-label="${`${t} suggestions`}" @beforetoggle="${e=>{this._open=e.newState===`open`,delete e.target.dataset.positioned,this._open||(this._active=-1)}}"><div class="revision-options">${this.sections(e).map(({header:e,index:t,items:n})=>e?g`<button type="button" role="option" class="revision-group" id="${`revision-${t}`}" aria-selected="false" aria-expanded="${e.expanded}" ?data-active="${t===this._active}" tabindex="-1" @mousedown="${e=>e.preventDefault()}" @click="${()=>{this._active=-1,this.toggleGroup(e.prefix)}}">${pa}<span>${e.prefix}/</span><span class="count" aria-label="${`${e.count} branches`}">${e.count}</span></button>`:g`<div class="revision-section" role="none">${n.map(({entry:e,index:t})=>g`<button type="button" role="option" id="${`revision-${t}`}" aria-label="${$(e.label===void 0?void 0:e.name)}" aria-selected="${e.name===this.name}" ?data-active="${t===this._active}" tabindex="-1" @mousedown="${e=>e.preventDefault()}" @click="${()=>this.pick(e.name)}"><span data-tooltip-truncated data-tooltip="${e.name}">${e.label??e.name}</span></button>`)}</div>`)}</div>${e.length>0?y:g`<p class="revision-empty">${this._query?`No matching suggestions. Enter a revision name to browse.`:`No ${this.kind} suggestions available.`}</p>`}</div></form>`}};customElements.get(`revision-select`)||customElements.define(`revision-select`,ya);export{We as a,Ke as b,qe as c,Je as d,C as e,Ye as f,Xe as g,Ze as h,et as i,tt as j,nt as k,b as l,ae as m,oe as n,se as o,ce as p,le as q,ue as r,de as s,fe as t,pe as u,me as v,he as w,ge as x,_e as y,ve as z,ye as A,be as B,xe as C,Se as D,Ce as E,we as F,Te as G,Ee as H,De as I,Oe as J,ke as K,Ae as L,je as M,Me as N,Ne as O,Pe as P,Fe as Q,Ie as R,Le as S,Re as T,ze as U,Be as V,Ve as W,He as X,Ue as Y,en as Z,ln as _,w as $,ct as aa,ut as ba,xt as ca,St as da,Dt as ea,D as fa,jt as ga,Nt as ha,Pt as ia,P as ja,Dn as ka,An as la,jn as ma,Pn as na,Ln as oa,zn as pa,Gn as qa,Kn as ra,qn as sa,Jn as ta,F as ua,Xn as va,R as wa,H as xa,_r as ya,vr as za,Z as Aa,Wi as Ba,Ki as Ca,Yi as Da,Q as Ea,Xi as Fa,Zi as Ga,$i as Ha,ea as Ia,ta as Ja,Xt as Ka,Ft as La,Rt as Ma,O as Na,zt as Oa,oa as Pa,da as Qa,$ as Ra,fa as Sa,Bt as Ta,Ut as Ua,Gt as Va,Jt as Wa};
14
- /*!
15
- * PHP elephant adapted from Material Icon Theme:
16
- * https://github.com/material-extensions/vscode-material-icon-theme/blob/main/icons/php_elephant.svg
17
- * Copyright (c) 2025 Material Extensions
18
- *
19
- * Permission is hereby granted, free of charge, to any person obtaining a copy
20
- * of this software and associated documentation files (the "Software"), to deal
21
- * in the Software without restriction, including without limitation the rights
22
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
23
- * of the Software, and to permit persons to whom the Software is furnished to do
24
- * so, subject to the following conditions:
25
- *
26
- * The above copyright notice and this permission notice shall be included in all
27
- * copies or substantial portions of the Software.
28
- *
29
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
- * SOFTWARE.
36
- */
37
- /*! Bundled license information:
38
-
39
- lit-html/directives/live.js:
40
- (**
41
- * @license
42
- * Copyright 2020 Google LLC
43
- * SPDX-License-Identifier: BSD-3-Clause
44
- *)
45
-
46
- lit-html/directives/if-defined.js:
47
- (**
48
- * @license
49
- * Copyright 2018 Google LLC
50
- * SPDX-License-Identifier: BSD-3-Clause
51
- *)
52
- */
@@ -1,2 +0,0 @@
1
- import{d as e,i as t,s as n,t as r,v as i}from"./chunk-74AEKRES.js";import{c as a,g as o}from"./chunk-2XUEZHIP.js";var s=[[`manage`,`Overview`],[`manage-bundles`,`Bundles`],[`manage-scans`,`Scans`],[`manage-reports`,`Reports`],[`manage-deduplication`,`Deduplication`,`admin`],[`manage-repos`,`Repositories`,`admin`],[`admin-users`,`Users`,`admin`],[`manage-teams`,`Teams`,`admin`],[`manage-import`,`Import`,`admin`],[`manage-links`,`Links`],[`manage-history`,`History`]];function c(e,t,n=!1){return a`<header class="manage-header"><nav class="manage-nav" aria-label="Management pages">${s.filter(([e,,r])=>(r==null||r===t)&&(e!==`manage-links`||n)).map(([t,n])=>a`<button type="button" aria-current="${e===t?`page`:o}" @click="${()=>{document.dispatchEvent(new CustomEvent(`managed-admin-navigate`,{detail:{view:t},bubbles:!0,composed:!0}))}}">${n}</button>`)}</nav></header>`}function l(s){if(s===`bundle`)return e(t);if(s===`report`||s===`preview`)return e(r);if(s===`scan`)return e(n);if(s===`code`)return e(i);let c={users:`M10.75 4.75a2.75 2.75 0 1 1-5.5 0 2.75 2.75 0 0 1 5.5 0ZM3 14v-1.5A3.5 3.5 0 0 1 6.5 9h3a3.5 3.5 0 0 1 3.5 3.5V14`,team:`M8.5 5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM1.5 14v-1.5A3.5 3.5 0 0 1 5 9h2a3.5 3.5 0 0 1 3.5 3.5V14M11 2.75a2.5 2.5 0 0 1 0 4.5m1 2a3 3 0 0 1 2.5 3V14`,repo:`M3 12.5V3a1.5 1.5 0 0 1 1.5-1.5H13v13H4.5a1.5 1.5 0 0 1 0-3H13M7 1.5v6l2-1.5 2 1.5v-6`,history:`M2 5a6.25 6.25 0 1 1-.25 5M1.5 1.5V5H5M8 4.5V8l3 1.5`,arrow:`M3 8h10M9 4l4 4-4 4`,show:`M1 8s2.5-4.5 7-4.5S15 8 15 8s-2.5 4.5-7 4.5S1 8 1 8Zm9 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0`,hide:`m2 2 12 12M6 3.75A8 8 0 0 1 8 3.5c4.5 0 7 4.5 7 4.5a12 12 0 0 1-2 2.5M3.5 5A13 13 0 0 0 1 8s2.5 4.5 7 4.5a8 8 0 0 0 3-.6`,download:`M8 2v8M5 7l3 3 3-3M2 11v3h12v-3`,upload:`M8 11V2m-3 3 3-3 3 3M2 10v4h12v-4`};return a`<svg class="${s===`repo`?`repo-icon`:o}" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${c[s]??c.repo}"></path></svg>`}var u=`:host{display:flex;flex-direction:column;position:relative;padding:0 clamp(1rem,3vw,3rem) 3rem;color:var(--text);container-type:inline-size;font-family:var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);font-size:.875rem;line-height:1.5;--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:76rem;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,select,input[type=checkbox]{cursor:default}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)}.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{width:2rem;height:2rem}.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))}.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)}.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{gap:1.2rem;margin-bottom:1.75rem}.manage-nav button{min-height:3.25rem}h1,.head h1{font-size:1.65rem}.intro{margin-bottom:1.5rem}}@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}.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{c as a,l as b,u as c};
@@ -1,12 +0,0 @@
1
- import{a as e}from"./chunk-IYPY47MC.js";import{a as t}from"./chunk-QRKFPLA4.js";import{b as n}from"./chunk-TUII34K2.js";var r=new Set([`module`,`commonjs`,`json`,`module-typescript`,`commonjs-typescript`]),i=new Set([`solidity`,`php`,`shell`,`rust`,`teal`]),a=new Set([`java`,`kotlin`,`gradle`,`objc`,`objcpp`,`swift`,`c`,`cpp`,`c-header`,`cpp-header`,`ruby`,`python`,`cmake`,`podspec`,`podfile`,`podfile-lock`,`gemfile`,`gemfile-lock`,`template`,`xml`,`env`,`fastlane`,`pbxproj`]),o=new Set([`generic-javascript`,`generic-typescript`]),s=new Set([`resource`,`resource:base64`]),c=new Set([`stat:file`,`stat:directory`]),l=new Set([...r,...i,...a,...o,...s,`patch`,`directory`,...c]),u=e=>c.has(e),d=e=>e===`directory`||e===`stat:directory`?`directory`:`file`,f=new Set([`module`,`commonjs`,`module-typescript`,`commonjs-typescript`]),p=(e,t)=>o.has(e)&&f.has(t);function m(e,t,n){if(e===t)return e;if(p(e,t))return t;if(p(t,e))return e;let r=u(e);if(r!==u(t)&&d(e)===d(t))return r?t:e;throw Error(`format conflict for '${n}' ('${t}' vs '${e}')`)}var h=(e,t)=>t===``?e:e===`.`?t:`${e}/${t}`,ee=/^(?=[A-Za-z0-9-]{1,39}\/)[A-Za-z0-9](?:-?[A-Za-z0-9])*\/(?!\.\.?$)[\w.-]{1,100}$/u,te=/^(?!\.\.?(?:\/|$))[\w.~@+-]+(?:\/(?!\.\.?(?:\/|$))[\w.~@+-]+)*$/u,ne=/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u,g={github:e=>typeof e==`string`&&ee.test(e),directory:e=>typeof e==`string`&&e.length<=1024&&(e===``||te.test(e)),commit:e=>typeof e==`string`&&ne.test(e)},re=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),_=(e,t,n)=>{if(e===void 0)return;T(e)||S(!1,`${n} must be an object`);for(let r of Object.keys(e))Object.hasOwn(t,r)||S(!1,`unknown ${n} key '${r}'`);let r=Object.entries(t).map(([t,r])=>typeof r==`object`?[t,_(e[t],r,`${n}.${t}`)]:(e[t]!==void 0&&!r(e[t])&&S(!1,`invalid ${n}.${t}: ${JSON.stringify(e[t])}`),[t,e[t]])).filter(([,e])=>e!==void 0);return r.length===0?void 0:Object.freeze(E(r))},ie=(e,t=`bundle repo`)=>_(e,g,t),v=(e,t)=>t??(j(e)?`npm`:void 0),ae=(e,t,n,r,i)=>(a,{ecosystem:o,[e]:s},c)=>{if(s===void 0)return;r(a,o)||S(!1,`${c}: '${a}' is no ${i} bucket, and carries no ${e}`);let l=_(s,t,`${c} module '${a}' ${e}`);return l?.[n]===void 0&&S(!1,`${c} module '${a}' ${e} has no ${n}`),l},oe=ae(`repo`,g,`github`,(e,t)=>v(e,t)!==void 0,`dependency's`),se={sha1:/^sha1-[A-Za-z\d+/]{27}=$/u,sha256:/^sha256-[A-Za-z\d+/]{43}=$/u,sha512:/^sha512-[A-Za-z\d+/]{86}==$/u},ce=/^(?:\.\.\/)*(?!\.\.?(?:\/|$))[^/\\\p{Cc}]+(?:\/(?!\.\.?(?:\/|$))[^/\\\p{Cc}]+)*$/u,le={integrity:e=>typeof e==`string`&&se.sha256.test(e),file:e=>typeof e==`string`&&e.length<=4096&&ce.test(e)},ue=(e,t)=>j(e)&&v(e,t)===`npm`,de={npm:`sha512`,cargo:`sha256`,composer:`sha1`,soldeer:`sha256`},fe=(e,{ecosystem:t,integrity:n},r)=>{if(n===void 0)return;let i=v(e,t);return(!Object.hasOwn(de,i)||i===`npm`&&!j(e))&&S(!1,`${r}: '${e}' is no npm, cargo, composer or soldeer dependency's bucket, and carries no integrity`),typeof n==`string`&&se[de[i]].test(n)||S(!1,`invalid ${r} module '${e}' integrity: ${JSON.stringify(n)}`),n},pe=ae(`patch`,le,`integrity`,ue,`npm dependency's`),me=e=>typeof e==`string`&&/^[\w.+@/~'!()*-]+$/u.test(e),y={name:me,version:me},he=e=>typeof e==`string`&&e!==``&&!e.includes(`\\`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`),ge=(e,t,n)=>typeof e==`string`&&he(n)&&e===`${t}/${n}`,_e={vendored:()=>!0,subpackages:(e,t,n)=>ge(e.name,t,n)},ve=(e,t)=>{for(let n=t.lastIndexOf(`/`);n>0;n=t.lastIndexOf(`/`,n-1))if(Object.hasOwn(e,t.slice(0,n)))return t.slice(0,n)};function ye(e,t){if(e===void 0)return;let n=new Set(Object.keys(t).map(t=>ve(e,t)).filter(e=>e!==void 0));return n.size===0?void 0:Object.freeze(E(C(n).map(t=>[t,e[t]])))}var be=(e,t,{name:n,ecosystem:r,files:i,[e]:a},o)=>{if(a===void 0)return;v(t,r)===void 0&&S(!1,`${o}: '${t}' is no dependency's bucket, and carries no ${e}`),T(a)||S(!1,`${o} module '${t}' ${e} must be an object`);let s=E(Object.entries(a).map(([r,i])=>{he(r)||S(!1,`${o} module '${t}' ${e}: invalid directory ${JSON.stringify(r)}`);let a=_(i,y,`${o} module '${t}' ${e} '${r}'`);return a?.name===void 0&&S(!1,`${o} module '${t}' ${e} '${r}' has no name`),_e[e](a,n,r)||S(!1,`${o} module '${t}' ${e} '${r}' is named '${a.name}', not '${n}/${r}'`),[r,a]})),c=ye(s,i),l=Object.keys(s).find(e=>!Object.hasOwn(c??{},e));return l!==void 0&&S(!1,`${o} module '${t}' ${e} '${l}' holds none of its files`),c},xe={integrity:fe,patch:pe,repo:oe},Se=Object.keys(_e),b=[...Object.keys(xe),...Se],Ce=[`ecosystem`,...b],x=e=>{let t={name:e.name,version:e.version};for(let n of Ce)e[n]!==void 0&&(t[n]=e[n]);return t.files=e.files,t},we={integrity:(e,t)=>e===t,patch:(e,t)=>e?.integrity===t?.integrity&&(e?.file===void 0||t?.file===void 0||e.file===t.file)},Te=Object.keys(we),Ee=(e,t,n)=>we[e](t,n),De=(e,t)=>e[t]??(t===`patch`&&e.integrity!==void 0?null:void 0),Oe=(e,t,n,r)=>{if(Ee(e,t[e],n[e]))return;let[i,a]=[t[e],n[e]].map(e=>JSON.stringify(e)??`none`);S(!1,`${r} ${e} mismatch (${i} vs ${a})`)},ke=(e,t,n)=>{let[r,i]=[t[e],n[e]];if([r,i].every(e=>typeof e==`object`&&!!e))return Object.keys(i).some(e=>r[e]===void 0)?Object.freeze({...i,...r}):void 0};function Ae(e,t,n=`module`){let r;for(let i of Object.keys(xe))if(Te.includes(i)&&De(e,i)!==void 0&&De(t,i)!==void 0){Oe(i,e,t,n);let a=ke(i,e,t);a&&((r??={})[i]=a)}else e[i]===void 0&&t[i]!==void 0&&((r??={})[i]=t[i]);for(let n of Se)t[n]===void 0||Object.keys(t[n]).every(t=>Object.hasOwn(e[n]??{},t))||((r??={})[n]=Object.freeze(E([...Object.entries(t[n]),...Object.entries(e[n]??{})])));return r===void 0?e:x({...e,...r})}function je(e,t,n,r,i){let a={};for(let[i,o]of Object.entries(xe))a[i]=r.includes(i)?o(e,t,n):void 0;for(let o of Se)a[o]=r.includes(o)?be(o,e,{...t,[o]:i(o)},n):void 0;return a}function Me(e,t,n,r=b){let{name:i,version:a,ecosystem:o}=e;S(o===void 0||typeof o==`string`),T(e.files)||S(!1,`${n}: module '${t}' files must be an object`);let s=E(Object.entries(e.files));return x({name:i,version:a??void 0,ecosystem:o,...je(t,{...e,files:s},n,r,t=>e[t]),files:s})}function Ne(e,{scope:t=`full`}={}){let n=new Set;for(let[r,{files:i}]of e)if(t===`full`||j(r))for(let e of Object.keys(i))n.add(h(r,e));return n}function Pe(e,{what:t,files:n,formats:r,scope:i}){if(e.includes(`\\`))return`holds a '\\'`;if(O(e))return`escapes the root`;if(i!==`full`&&!j(e))return`is outside node_modules, which a '${i}'-scope ${t} does not record`;if(!n.has(e))return`names no file the ${t} records`;let a=r.get(e);return a===`directory`?`is a directory capture, not a file`:u(a)?`is a payload-free '${a}' record, not a file`:null}function Fe(e,{what:t,files:n,formats:r,scope:i}){for(let a of e){let e=Pe(a,{what:t,files:n,formats:r,scope:i});S(e===null,`${t}: executable entry '${a}' ${e}`)}}function Ie(e,t,n,r){S(Array.isArray(e),`${t} must be an array of file paths`);let i=new Set;for(let t of e)r(t),S(!i.has(t),`${n} '${t}' is listed twice`),i.add(t);return i}function Le(e,{what:t,files:n,formats:r,scope:i=`full`}){if(e===void 0)return new Set;let a=`${t}: executable entry`,o=Ie(e,`${t}: executable`,a,e=>S(typeof e==`string`&&e!==``,`${a} must be a non-empty string`));return Fe(o,{what:t,files:n,formats:r,scope:i}),o}function Re(e,{what:t,modules:n,formats:r,scope:i}){if(e.size!==0)return Fe(e,{what:t,files:Ne(n,{scope:i}),formats:r,scope:i}),qe(e)}function S(e,t){if(!e)throw Error(t)}var ze=`stasis.lock.json`,Be=new Set([`node_modules`,`full`]),Ve=(e,t)=>S(Be.has(e),`${t} scope must be node_modules or full, got ${JSON.stringify(e)}`),He=e=>{let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===ze||t.endsWith(`.${ze}`)},Ue=/(?:^|\/)(?:\.git(?:\/|$)|(?:\.npm-extension\.[cm]?[jt]s|\.?pnpmfile\.[cm]?[jt]s|\.npmrc|\.yarnrc(?:\.yml)?|\.?bunfig\.toml|\.pnp\.(?:c?js|loader\.mjs|data\.json))$)/iu,We=/(?:^|\/)node_modules\/(?:[^/]*\/)*(?:pnpm-workspace\.yaml|\.env\.[^/]*|[^/]*\.env)$/iu,Ge=e=>He(e)||Ue.test(e)||We.test(e);function Ke(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n++;let r=e.length-n,i=t.length-n;if(r===0&&i===0)return 0;if(r<2)return i<2&&(e[n]??``)>(t[n]??``)?1:-1;if(i<2)return 1;if(e[n]===`*`)return-1;if(t[n]===`*`||e[n]===`node_modules`)return 1;if(t[n]===`node_modules`)return-1;let a=e.slice(n).join(`\0`),o=t.slice(n).join(`\0`);if(a<o)return-1;if(a>o)return 1;throw Error(`Unreachable`)}var C=(e,t=e=>e)=>Array.from(e,e=>({item:e,segments:t(e).split(`/`)})).toSorted((e,t)=>Ke(e.segments,t.segments)).map(({item:e})=>e),w=([e])=>e;function T(e){if(!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var E=e=>Object.setPrototypeOf(Object.fromEntries(e),null),qe=e=>C(e),D=(e,{sorted:t=!0}={})=>E((t?C(e,w):[...e]).map(([e,n])=>[e,n instanceof Map?D(n,{sorted:t}):n]));function Je(e,t,n){let r=e.get(t);return r===void 0&&e.set(t,r=n()),r}var Ye=(e,t)=>Je(e,t,()=>new Map),Xe=e=>new Map(Object.entries(e).map(([e,t])=>[e,T(t)?Xe(t):t]));function O(e){if(e.startsWith(`/`))return!0;if(!e.includes(`..`))return!1;let t=0;for(let n of e.split(`/`))if(n!==`.`&&n!==``){if(n!==`..`)t++;else if(--t<0)return!0}return!1}var Ze=e=>e.includes(`\\`)||O(e),k=(e,t)=>S(!Ze(e),`${t}: path '${e}' escapes the root or holds a '\\'`),Qe=e=>typeof e==`string`&&e!==``&&!Ze(e),$e=(e,t)=>S(Qe(e),`${t}: invalid entry ${JSON.stringify(e)}`),et=(e,t)=>Ie(e,`${t}: entries`,`${t}: entry`,e=>$e(e,t));function tt(e,t){for(let n of e)$e(n,t);return qe(e)}function nt(e,t){k(e,`formats`),S(l.has(t),`unknown format '${t}' for ${e}`)}function rt(e){S(T(e));let t=new Map;for(let[n,r]of Object.entries(e)){nt(n,r);let e=n===``?`.`:n;S(!t.has(e),`duplicate format key '${e}'`),t.set(e,r)}return t}function it(e,t,n){for(let[r,i]of e)u(i)&&t.has(r)&&S(!1,`${n}: '${r}' is a payload-free '${i}' record, yet carries content`)}function at(e){for(let[t,n]of e)nt(t,n);return D(e)}function ot(e){for(let[,t]of e){S(t instanceof Map);for(let[e,n]of t){k(e,`imports`),S(n instanceof Map);for(let[,e]of n)if(typeof e==`string`)k(e,`imports`);else{S(e instanceof Map&&e.size>0,`import target must be a file or a non-empty {platform: file} map`);for(let[t,n]of e)S(typeof t==`string`&&t.length>0&&!t.includes(`/`),`invalid platform key '${t}'`),S(typeof n==`string`),k(n,`imports`)}}}}function st(e){S(T(e));let t=Xe(e);return ot(t),t}function ct(e){return ot(e),D(e)}function lt(e,{skipEmpty:t=!1,metadata:n=!0,what:r}={}){let i=n===!0?b:n===!1?[]:n,a={modules:[],sources:[]};for(let[n,o]of e){if(t&&Object.keys(o.files).length===0)continue;let e=j(n);e&&S(o.name&&o.version&&o.files);let s=E(C(Object.entries(o.files),w));a[e?`modules`:`sources`].push([n,x({...o,...je(n,{...o,files:s},r,i,e=>ye(o[e],s)),files:s})])}return{modules:E(C(a.modules,w)),sources:E(C(a.sources,w))}}function ut(e,t,n){let r=new Map;for(let i of e.config.scope===`full`?[`modules`,`sources`]:[`modules`]){if(i===`modules`&&e.modules===void 0)continue;S(T(e[i]),`${t}: ${i} must be an object`);let a=i===`modules`;for(let[o,s]of Object.entries(e[i]))S(j(o)===a),k(o,t),S(s?.name&&(s.version||!a)&&s.files),r.set(o,Me(s,o,t,n))}return r}function dt({config:{scope:e},entries:t,modules:n,formats:r,imports:i,executable:a},o,s){let c=e===`full`,l=lt(n,{...s,what:o});return{entries:c?tt(t,o):void 0,sources:c?l.sources:void 0,modules:l.modules,formats:r===null?void 0:at(r),imports:i===null?void 0:ct(i),executable:Re(a,{what:o,modules:n,formats:r??new Map,scope:e})}}function ft(e,t){return!(e instanceof Map)||!(t instanceof Map)?e===t:e.size===t.size&&e.entries().every(([e,n])=>t.get(e)===n)}var pt=e=>e instanceof Map?`{${[...e].map(([e,t])=>`${e}: ${t}`).join(`, `)}}`:e;function mt(e,t,n){let r=new Map;for(let i of[e,t])for(let[e,t]of i){let i=Ye(r,e);for(let[e,r]of t){let t=Ye(i,e);for(let[i,a]of r)t.has(i)?S(ft(t.get(i),a),`${n}: import '${i}' from '${e}' resolves differently ('${pt(t.get(i))}' vs '${pt(a)}')`):t.set(i,a instanceof Map?new Map(a):a)}}return r}function ht(e,t,n){let r=e.get(t);e.set(t,r===void 0?n:m(n,r,t))}function gt(e,t,n){let r=new Map;try{for(let n of[e,t])for(let[e,t]of n)ht(r,e,t)}catch(e){throw Error(`${n}: ${e.message}`,{cause:e})}return r}var _t=(e,t,n,r)=>e.size===0?new Set(t):new Set(t).union(e.difference(Ne(n,{scope:r}))),vt=/(?:^|\/)\.{0,2}(?:\/|$)/u;function A(e,t,n){let r=h(e,t);return(r!==`.`||t!==``)&&vt.test(r)&&S(!1,`${n}: non-canonical file key ${JSON.stringify(r)}`),r.includes(`\\`)&&S(!1,`${n}: file key '${r}' holds a '\\', which no path may`),r}function yt(e,t,n){let r=new Map;for(let[i,{files:a}]of e){typeof i!=`string`&&S(!1,`${t}: bucket dir ${String(i)} is not a string`),k(i,t);for(let e of Object.keys(a)){let a=A(i,e,t),o=r.get(a);o!==void 0&&n(a,o,i),r.set(a,i)}}return r}var bt=(e,t)=>n=>S(!1,`duplicate file key '${n}' across ${e} buckets -- module bucketing changed between writes (a workspace package without a version now owns its own bucket); regenerate the ${t}`);function xt(e,t,n,{held:r=!1}={}){let i=new Map;for(let a of[e,t])for(let[e,t]of a){let a=i.get(e);if(a===void 0)i.set(e,x({...t,files:Object.assign(Object.create(null),t.files)}));else{S(a.name===t.name,`${n}: module '${e}' name mismatch ('${a.name}' vs '${t.name}')`),S(a.version===t.version,`${n}: module '${e}' version mismatch ('${a.version}' vs '${t.version}')`+(a.version==null==(t.version==null)?``:` -- an artifact from an older stasis may record a placeholder version for a workspace package without one; regenerate it (bundle=replace / lock=replace)`)),S(a.ecosystem===t.ecosystem,`${n}: module '${e}' ecosystem mismatch ('${a.ecosystem??`(none)`}' vs '${t.ecosystem??`(none)`}')`),i.set(e,Ae(a,t,`${n}: module '${e}'`));for(let i of Te){if(a[i]===void 0==(t[i]===void 0)||r&&a[i]===void 0)continue;let[o,s]=a[i]===void 0?[t,a]:[a,t],c=Object.keys(s.files).find(e=>!Object.hasOwn(o.files,e));c!==void 0&&S(!1,`${n}: module '${e}' ${i} is recorded of one side's files, not of '${h(e,c)}' the other adds`)}for(let[r,i]of Object.entries(t.files))Object.hasOwn(a.files,r)?S(a.files[r]===i,`${n}: content mismatch for '${h(e,r)}'`):a.files[r]=i}}return yt(i,n,(e,t,r)=>S(!1,`${n}: file '${e}' is bucketed under both '${t}' and '${r}' -- module bucketing changed between the artifacts (a workspace package without a version now owns its own bucket); regenerate the artifact (bundle=replace / lock=replace)`)),i}var j=e=>e===`node_modules`||e.startsWith(`node_modules/`)||e.endsWith(`/node_modules`)||e.includes(`/node_modules/`),St=`node_modules/`;function Ct(e){let t=e.length;for(;(t=e.lastIndexOf(St,t-1))!==-1;)if(t===0||e[t-1]===`/`)return t;return-1}function wt(e){let t=Ct(e);if(t===-1)return null;let n=t+St.length,r=e.slice(n).split(`/`),i=r[0].startsWith(`@`)?2:1,a=r.slice(0,i);if(r.length<=i||a.includes(``))return null;let o=a.join(`/`);return{dir:e.slice(0,n)+o,rel:r.slice(i).join(`/`),name:o}}var M=1,Tt=0,Et=bt(`bundle`,`artifact (bundle=replace)`),Dt=(e,t)=>{let n=yt(e,`bundle`,Et);for(let e of n.keys())S(!Ge(e),`bundle: ${e} is a file no bundle may carry`);return it(t,n,`bundle`),n},Ot=e=>wt(e)??{dir:`.`,rel:e===`.`?``:e,name:null};function kt(e){S(T(e),`bundle: sources must be an object`);let t=new Map;for(let[n,r]of Object.entries(e)){k(n,`bundle`);let{dir:e,rel:i,name:a}=Ot(n);S(!O(e)&&!O(i));let{files:o}=Je(t,e,()=>({name:a,version:null,files:Object.create(null)}));S(!Object.hasOwn(o,i),`bundle: duplicate file key '.' (v0 '' and '.')`),o[i]=r}return t}function At(){throw Error(`bundle: file contents are not retained by this contents-free Bundle`)}var jt=(e,{files:t,...n})=>{let r=Object.create(null);for(let[n,i]of Object.entries(t))typeof i!=`symbol`&&S(!1,`bundle: file '${h(e,n)}' is not a placeholder`),Object.defineProperty(r,n,{get:At,enumerable:!0});return{...n,files:Object.freeze(r)}},N=(e,t)=>{if(e===void 0&&t===void 0)return;let n=new Map;for(let r of[e,t])for(let[e,t]of Object.entries(r??{}))Array.isArray(t)&&n.set(e,new Set([...n.get(e)??[],...t]));return E([...n.keys()].toSorted().map(e=>[e,qe(n.get(e))]))},Mt=(e,t)=>Object.hasOwn(g,e)&&g[e](t),Nt=(e,t)=>e?.github===void 0||!re(e.github,t?.github)?void 0:E(Object.keys(g).filter(n=>e[n]!==void 0&&(n===`github`||e[n]===t[n])).map(t=>[t,e[t]])),Pt=e=>{if(!T(e)||e.root!==!0||Object.hasOwn(e,`directory`))return e;let{root:t,...n}=e;return n},Ft={npm:y,composer:y,cargo:y},It=(e,t)=>E(Object.keys(Ft).map(n=>{let[r,i]=[e?.[n],t?.[n]];return[n,r?.name!==void 0&&r.name===i?.name?E(Object.entries(r).filter(([e,t])=>t===i[e])):void 0]})),P=class e{static VERSION=M;#e;get repo(){return this.#e}set repo(e){this.#e=ie(e)}#t;get package(){return this.#t}set package(e){this.#t=_(e,Ft,`bundle package`)}constructor({config:e={scope:`full`},entries:t,modules:n,formats:r,imports:i,executable:a,reason:o,repo:s,package:c,version:l=M}={}){S([Tt,M].includes(l)),Ve(e.scope,`bundle`),this.version=l,this.config=e,this.entries=t??new Set,this.modules=n??new Map,this.formats=r??new Map,this.imports=i??new Map,this.executable=a??new Set,this.reason=o,this.repo=s,this.package=c}get sources(){let e=new Map;for(let[t,{files:n}]of this.modules)for(let[r,i]of Object.entries(n))e.set(h(t,r),i);return e}static isResourceFormat(e){return s.has(e)||e===`directory`}get hasCode(){return this.modules.entries().some(([t,{files:n}])=>Object.keys(n).some(n=>!e.isResourceFormat(this.formats.get(h(t,n)))))}static parse(t){return e.fromJSON(JSON.parse(t))}static fileKeyAt(e){let[t,n,r,i]=e;if(typeof n==`string`){if(e.length===2&&t===`sources`){let e=Ot(n);return A(e.dir,e.rel,`bundle`)}if(e.length===4&&(t===`sources`||t===`modules`)&&r===`files`&&typeof i==`string`)return A(n,i,`bundle`)}}static fromJSON(t,{contents:n=!0}={}){S(t.version===M||t.version===Tt),Ve(t.config?.scope,`bundle`);let r=rt(t.formats),i=t.version===M;i&&t.config.scope!==`full`&&S(t.entries===void 0&&t.sources===void 0);let a=i?ut(t,`bundle`):kt(t.sources),o=Dt(a,r),s=st(t.imports);if(!n)for(let[e,t]of a)a.set(e,jt(e,t));return new e({version:t.version,config:t.config,entries:i&&t.entries!==void 0?et(t.entries,`bundle`):new Set,modules:a,formats:r,imports:s,executable:i?Le(t.executable,{what:`bundle`,files:o,formats:r,scope:t.config.scope}):new Set,reason:T(t.reason)?t.reason:void 0,repo:Pt(t.repo),package:t.package})}serialize(){return JSON.stringify(this.#n(),void 0,2)}serializedBytes(){let e=this.#n(),t=Object.keys(e.modules);if(t.length===0)return Buffer.from(JSON.stringify(e,void 0,2));let{modules:n,...r}=e,i=JSON.stringify(r,void 0,2);S(i.endsWith(`
2
- }`));let a=[],o=e=>a.push(Buffer.from(e));o(i.slice(0,-2)),o(`,
3
- "modules": {
4
- `);for(let[e,r]of t.entries())e>0&&o(`,
5
- `),o(JSON.stringify({indent:{[r]:n[r]}},void 0,2).slice(16,-6));return o(`
6
- }
7
- }`),Buffer.concat(a)}#n(){Dt(this.modules,this.formats);let{entries:e,sources:t,modules:n,formats:r,imports:i,executable:a}=dt(this,`bundle`,{skipEmpty:!0});return{version:M,config:this.config,repo:this.repo,package:this.package,entries:e,formats:r,imports:i,executable:a,reason:N(this.reason,void 0),sources:t,modules:n}}withReason(t,n=[...this.sources.keys()]){let{version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,repo:u,package:d}=this,f=N(this.reason,{[t]:n});return new e({version:r,config:i,entries:a,modules:o,formats:s,imports:c,executable:l,reason:f,repo:u,package:d})}merge(t){return S(this.config.scope===t.config.scope,`bundle merge: scope mismatch ('${this.config.scope}' vs '${t.config.scope}')`),new e({config:{scope:this.config.scope},entries:new Set([...this.entries,...t.entries]),modules:xt(this.modules,t.modules,`bundle merge`),formats:gt(this.formats,t.formats,`bundle merge`),imports:mt(this.imports,t.imports,`bundle merge`),executable:_t(this.executable,t.executable,t.modules,this.config.scope),reason:N(this.reason,t.reason),repo:Nt(this.repo,t.repo),package:It(this.package,t.package)})}},Lt={__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`},Rt={__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 zt(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 Bt(e,t,n){if(typeof t==`string`&&Rt[t])return Rt[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`?zt(n)?`json`:null:Lt[a]??null}var Vt=/^webpack(?:-internal)?:\/\/[^/]*\//u,Ht=/^[a-z][\d+.a-z-]*:/iu,Ut=/^file:/iu,Wt=/^(?:file|ftp|https?|wss?):/iu,Gt=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,F=e=>Gt.exec(e)[0],I=e=>F(e).includes(`://`),L=e=>e.replace(I(e)?/[#?].*$/su:/\?.*$/su,``),Kt=e=>e.slice(e.lastIndexOf(`/`)+1),R=(e,t)=>URL.parse(e,t)?.href??null;function z(e){let t=F(e),n=t.includes(`://`)&&R(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 qt(e,t){let n=F(t);return I(e)&&!n.includes(`:`)?R(t,e)??z(`${e}/../${t}`):z(n===`/`?F(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function Jt(e){try{return decodeURIComponent(e)}catch{return e}}function B(e,t){let n=e.replaceAll(`\\`,`/`);if(Vt.test(n))return z(n.replace(Vt,``));let r=Wt.test(n)?R(n)??n:n,i=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(i){let[,e,t]=i;return z(Jt(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(Ht.test(r)&&!F(r).includes(`:`))return r;if(t===void 0)return z(r);if(Ut.test(t)&&!F(r))return B(R(r,t)??r);let a=B(t);return F(r)&&!I(a)?z(r):qt(a,r)}var Yt=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function V(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return Yt.test(t)?t:null}var Xt=new Set([`.pnpm`,`.bun`,`.deno`]),Zt=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function Qt(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return Zt.test(r)?r:null}function $t(e){let t=L(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:V(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:Xt.has(t[n-2])?Qt(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var en=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 tn(e){let t=Kt(L(e));return/^[\w-]+$/u.test(t)?`jsx`:en.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var nn=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],rn=[`.ios`,`.android`,`.web`];function an(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(Kt(L(e.path??``)))?.[0]),[[n,r],[,i]]=rn.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var on=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),sn=[`index`,`main`,`browser`,`node`],cn=[``,`src/`,`lib/`,`dist/`,`build/`],ln=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*un(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of on.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of nn)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*dn(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!ln.has(t.slice(0,n)))return;t=t.slice(n+1)}}function fn(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:an(e),found:new Map}}function H(e,t){if(!e.found.has(t)){let n=L(t),r=un(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 pn(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 mn=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 hn(e){if(e.startsWith(`node:`)||mn.has(e))return{builtin:!0};let t=V(L(e));return t===null?{}:{package:t}}function gn(){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 _n(e,t){for(let n of sn)for(let r of cn){let i=H(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function vn(e,t,n,r){return/^\/[^?]/u.test(n)?H(e,t+n)??dn(n.slice(1)).map(n=>H(e,`${t}/${n}`)).find(Boolean):H(e,t+n)??r(e,t)}function yn(e,t,n,r=_n){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,a=Wt.test(i);if(a||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||I(i)){let n=a?B(i):qt(t.path,i),r=H(e,n);return r?{to:r}:{to:null,path:n}}if(Ht.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let o=V(L(n)),s=o===null?null:pn(e,t,o);if(s===null)return{to:null,...hn(n)};let c=vn(e,s,n.slice(o.length),r);return c?{to:c}:{to:null,package:o}}var U=class extends Error{name=`SourceMapError`},bn=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())bn[t.codePointAt(0)]=e;function W(e){let t=new Int32Array(e.length*2);return t.set(e),t}function xn(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 Sn(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 U(`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?bn[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new U(`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 U(`mappings: a value at ${c} runs past 32 bits`)}else{if(l===255)throw new U(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new U(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new U(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new U(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new U(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[W(n),W(r),W(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),xn({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var Cn=new WeakMap,wn=e=>Cn.get(e),G=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function K(e,t){if(!e)throw new U(t)}function Tn(e,t){if(e===void 0)return[];K(Array.isArray(e),`${t} is not an array`);for(let n of e)K(typeof n==`string`||n===null,`${t} holds ${JSON.stringify(n)}`);return e}function En(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:B(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:$t(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function Dn(e,t,n,r){K(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),K(e.sourceRoot===void 0||typeof e.sourceRoot==`string`,`sourceRoot is not a string`);let i=Tn(e.sources,`sources`),a=Tn(e.sourcesContent,`sourcesContent`),o=e.ignoreList??e.x_google_ignoreList??[];K(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)=>En(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 On(e,t){K(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),K(Array.isArray(e.sections),`sections is not an array`);for(let[n,r]of e.sections.entries()){let{offset:i,map:a}=G(r)?r:{};K(G(i)&&[i.line,i.column].every(e=>Number.isInteger(e)&&e>=0),`sections[${n}].offset is not a line and a column`),K(G(a)&&a.sections===void 0,`sections[${n}].map is not a plain source map`);let o=e.sections[n-1]?.offset;K(!o||o.line<i.line||o.line===i.line&&o.column<=i.column,`sections[${n}] starts before sections[${n-1}]`),Dn(a,t,i.line,i.column)}}function kn(e,t={}){if(!G(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 U(`not JSON: ${e.message}`,{cause:e})}K(G(n),`not a JSON object`);let r={files:[],bySource:new Map,mapPath:t.path,parts:[],names:[]};n.sections===void 0?Dn(n,r,0,0):On(n,r);let i={files:r.files};return Cn.set(i,{...Sn(r.parts),nameList:r.names}),i}var An=/\r\n?|[\n\u2028\u2029]/gu;function jn(e){let t=[0];for(let n of e.matchAll(An))t.push(n.index+n[0].length);return t}function Mn(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 q(e,t){let n=Mn(e,0,e.length,t);return[n,t-e[n]]}function Nn(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=Mn(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Pn(e,t,n,r){let i=wn(e),a=q(t,n),[o,s]=q(t,r),c=new Map,l=Nn(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 J=/\s+/uy,Fn=`
8
- \r\u2028\u2029`,In=/[\n\r\u2028\u2029]/gu,Ln=/[\n\r\u2028\u2029]/u,Y=/[\w$\u0080-￿]+/uy,Rn=new Set([`return`,`typeof`,`instanceof`,`in`,`of`,`new`,`delete`,`void`,`throw`,`case`,`default`,`extends`,`do`,`else`,`yield`,`await`]),zn=new Set([`if`,`while`,`for`,`with`]),Bn=new Set([`break`,`continue`,`debugger`]),Vn=new Set([`(`,`[`,"${",`,`,`=`,`:`,`?`,`!`,`~`,`+`,`-`,`*`,`/`,`%`,`&`,`|`,`^`,`<`,`>`]);function Hn(e,t){return e?.type===`word`?t&&[`return`,`yield`].includes(e.value)?!1:Rn.has(e.value)&&![`do`,`else`].includes(e.value):Vn.has(e?.value)}function Un(e){let t=e.at(-1);return t?.type===`word`&&(zn.has(t.value)||t.value===`await`&&e.at(-2)?.value===`for`)}function Wn(e){return e?e.type===`word`?Rn.has(e.value)||Bn.has(e.value)||e.label===!0:e.value===`)`?e.control:e.value===`}`?!e.object:e.type===`punctuator`&&![`++`,`--`,`]`].includes(e.value):!0}var Gn=(e,t)=>e.startsWith(`\r
9
- `,t+1)?3:2,Kn=/\\(?: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,qn={b:`\b`,f:`\f`,n:`
10
- `,r:`\r`,t:` `,v:`\v`};function Jn(e){return e.includes(`\\`)?e.replace(Kn,(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)?qn[o]??o:String.fromCodePoint(Math.min(s,1114111))}):e}function Yn(e,t){let n=e[t],r=t+1;for(;r<e.length&&e[r]!==n&&!Fn.includes(e[r]);)r+=e[r]===`\\`?Gn(e,r):1;return[e[r]===n?Jn(e.slice(t+1,r)):null,r+1]}function Xn(e,t){let n=t+1,r=!1;for(;n<e.length&&!Fn.includes(e[n])&&(r||e[n]!==`/`);)e[n]===`\\`?n++:e[n]===`[`?r=!0:e[n]===`]`&&(r=!1),n++;return Y.lastIndex=n+1,Y.test(e)?Y.lastIndex:n+1}function Zn(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 Qn(e){let t=[],n=[],r=[],i=0,a=0;for(;i<e.length;){let o=t.length;if(J.lastIndex=i,J.test(e)&&(i=J.lastIndex),i>=e.length)break;let s=e[i],c=e[i+1];if(Y.lastIndex=i,s===`/`&&c===`/`)In.lastIndex=i+2,i=In.test(e)?In.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]=Yn(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=Zn(e,i+1,n),o=s==="`"&&n.length===r&&e[a-1]==="`";t.push({type:`string`,value:o?Jn(e.slice(i+1,a-1)):null}),n.length>r&&t.push({type:`punctuator`,value:"${"}),i=a}else if(s===`/`&&Wn(t.at(-1)))i=Xn(e,i),t.push({type:`regex`});else if(Y.test(e)){let n=Bn.has(t.at(-1)?.value)&&!Ln.test(e.slice(a,i));t.push({type:`word`,value:e.slice(i,Y.lastIndex),...n&&{label:n}}),i=Y.lastIndex}else{s===`{`&&n.push(Hn(t.at(-1),Ln.test(e.slice(a,i)))?`object`:`block`);let o=s===`}`?n.pop():void 0;s===`(`&&r.push(Un(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,er=new Set([`type`,`typeof`]),tr=(e,t)=>e[t+1]?.type===`word`&&(e[t+1].value!==`as`||e[t+2]?.type!==`word`||e[t+2].value===`as`);function nr(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(!er.has(e[r].value)||!tr(e,r))return!1;n=!0}return n}function rr(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 ir(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(er.has(r?.value)&&![`,`,`from`].includes(i?.value)||r?.value===`{`&&nr(e,t+1)||n===`export`&&![`{`,`*`].includes(r?.value)||n===`import`&&r?.type!==`word`&&![`{`,`*`].includes(r?.value))return null;let o=rr(e,t+1);return o===null?null:{kind:a,specifier:o}}function ar(e,t){let[n,r]=[e[t+2],e[t+3]];if(n?.value!==`)`)return $n(n)&&[`)`,`,`].includes(r?.value)?n.value:null}function or(e,t=new Set){let n=Qn(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?ar(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=ir(n,e);t&&r.push(t)}}return r}var sr=/^[\w$]*__d\(/gmu,cr=([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 lr(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(!cr(i))break;n=i,r=r>0?e.lastIndexOf(`},`,r-1):-1}return n}function ur(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 dr(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:ur(t)}function fr(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 pr(e,t){let n=[...e.matchAll(sr)].map(e=>e.index);if(n.length===0)return null;let r=jn(e),i=t=>e.slice(r[t],r[t+1]),a=[];for(let[o,s]of n.entries()){let[c]=q(r,s),[l]=q(r,(n[o+1]??e.length)-1),u=lr(i(l));for(;!u&&l>c;)u=lr(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:Pn(t,r,s,d),dependencies:dr(u[1],e.slice(s,d))})}fr(a,t);let o=new Map(a.map(e=>[e.id,e])),{edges:s,link:c}=gn();for(let{file:e,dependencies:t}of a)for(let n of t)c(e,o.get(n)?.file,`dependency`);return s}var mr=e=>e.path!==null&&![`json`,null].includes(tn(e.path)),hr=e=>e.path!==null&&tn(e.path)===null;function gr(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 _r={jsxRuntime:`react/jsx-runtime`,jsxDevRuntime:`react/jsx-dev-runtime`};function vr(e){let{sources:t,names:n,nameList:r}=wn(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],gr(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(gr);o.length>0&&i.set(r,o.map(e=>_r[e]??`@babel/runtime/helpers/${e}`))}return i}function yr(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,yn(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:yn(t,e,r,i)}}var br=e=>/(?:^|\/)__prelude__$/u.test(e.source??``),xr=e=>e?.package?.name===`metro-runtime`&&e.package.path===`src/polyfills/require.js`;function Sr(e){if(!e.files.some(br)&&!xr(e.files[0]))return null;if(!e.files.some(e=>e.content!==null&&!br(e)&&!xr(e)))throw Error("bundleEdges: the Metro map carries no sourcesContent, which its edges are read from; pass the bundle as `code`");let t=fn(e.files),n=e.files[e.files.findIndex(hr)+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&&mr(e)).map(e=>[e,or(e.content)])),a=vr(e),o=yr([...[...i].map(([e,t])=>[e,t.flatMap(({specifier:e})=>e===null?[]:[e])]),...a],t),{edges:s,add:c,link:l}=gn();for(let t of e.files){hr(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 Cr=(e,t)=>t==null?Sr(e):pr(t,e);function wr(e,t){let n=Cr(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 Tr(e){let t=JSON.parse(e.replace(/^\)\]\}'[^\n]*\n/u,``)),n=kn(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 Er(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 Dr(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 Or(e){try{return wr(e)}catch{return{edges:[]}}}var kr=Object.freeze([]);function X(e){return e?.edges?e.edges:e?.map?(e.edges=Dr(e.map,Or),e.edges):kr}var Ar=new WeakMap,jr=new WeakMap;function Mr(e){let t=X(e);if(!Ar.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);Ar.set(t,e)}return Ar.get(t)}function Nr(e){let t=X(e);if(!jr.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));jr.set(t,e)}return jr.get(t)}var Pr=new WeakMap,Fr=new WeakMap,Ir=new WeakMap,Lr=new WeakMap,Rr=new WeakMap,zr=new WeakMap;function Z(e){if(e?.metadataOnly)return new Map;let t=e?.bundle??e?.json;if(t&&Pr.has(t))return Pr.get(t);let n=new Map;if(!e)return n;if(e.kind===`stasis`){if(!e.bundle)return n;let t=e.bundle.formats;for(let[r,i]of e.bundle.sources)typeof i==`string`&&(P.isResourceFormat(t?.get(r))||n.set(r,i))}else if(e.kind===`sourcemap`)for(let[t,r]of Er(e))typeof r==`string`&&n.set(t,r);return t&&Pr.set(t,n),n}function Br(e){let t=1;for(let n=e.indexOf(`
11
- `);n!==-1;n=e.indexOf(`
12
- `,n+1))t++;return t}var Vr=new WeakMap;function Hr(e){let t=Vr.get(e);if(!t){let n=[...e.keys()].toSorted();t={paths:n,numbers:new Map(n.map((e,t)=>[e,t+1]))},Vr.set(e,t)}return t}function Ur(e,t){let n=Array.isArray(t)?t:[];return{integrity:e.integrity,kind:`sourcemap`,size:e.size,json:{version:3,sources:n.map(([e])=>e),sourcesContent:n.map(([,,e])=>typeof e==`string`?e:null)},fileSizes:new Map(n.map(([e,t])=>[e,t])),npmBinaries:new Map(n.filter(([,,e,t])=>typeof e!=`string`&&typeof t==`string`).map(([e,t,,n])=>[e,{size:t,digest:n}]))}}function Wr(e){let t=e?.bundle??e?.json;if(t&&Fr.has(t))return Fr.get(t);let n=new Map(Z(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&&Fr.set(t,n),n}var Gr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function Kr(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&&Gr.indexOf(n.at(-1))&(r===2?15:3)?null:Math.floor(n.length*3/4)}function qr(e){return typeof e==`string`?n(e):e?.format===`digest`?e.size:e?.format===`base64`?Kr(e.data):null}function Q(e){if(e?.fileSizes)return e.fileSizes;let t=e?.bundle??e?.json;if(t&&Ir.has(t))return Ir.get(t);let n=new Map,r=Wr(e),i=e?.kind===`stasis`?e.bundle?.sources.keys():e&&Er(e).map(([e])=>e);for(let e of i??[])n.set(e,qr(r.get(e)));return t&&Ir.set(t,n),n}function Jr(e){if(e?.metadataOnly)return e.unsizedFiles??new Set;let t=Q(e);if(zr.has(t))return zr.get(t);let n=new Set;for(let r of Wr(e).keys())t.get(r)===null&&n.add(r);return zr.set(t,n),n}function Yr(e){let t=Q(e);if(Rr.has(t))return Rr.get(t);let n=Jr(e),r=e?.kind===`stasis`?e.bundle?.formats:null,i=new Map;for(let[a,o]of t)o===null&&!n.has(a)||i.set(a,P.isResourceFormat(r?.get(a))||e?.npmBinaries?.has(a)?`resource`:`source`);return Rr.set(t,i),i}function Xr(e){let t=Q(e),n=e?.kind===`stasis`?e.bundle?.formats:null;if(!n||n.size===0)return t;if(Lr.has(t))return Lr.get(t);let r=new Map;for(let[e,i]of t)P.isResourceFormat(n.get(e))||r.set(e,i);return Lr.set(t,r),r}var Zr=new WeakMap;function Qr(e){if(e?.kind!==`stasis`||!e.bundle?.modules)return null;if(Zr.has(e.bundle))return Zr.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 Zr.set(e.bundle,t),t}function $r(t,n=null){let r=new Map;if(t?.kind!==`stasis`||!t.bundle?.modules)return r;for(let[i,a]of t.bundle.modules){if(i===`.`||n&&!n.has(i))continue;let t=a?.repo?.github,o=e(a?.repo?.commit);if(typeof t!=`string`||t===``||!o)continue;let s=typeof a.repo.directory==`string`?a.repo.directory:``;r.set(i,{github:t,...s?{directory:s}:{},commit:o})}return r}function ei(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:Qr(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 ti=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`}),ni=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 ri(e){let t=typeof e==`string`?e.slice(e.lastIndexOf(`/`)+1):``,n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1).trim().toLowerCase():``,i=Bt(e)??ni[r];return i?{key:i,label:ti[i]??i}:r?{key:`extension:${r}`,label:`.${r}`}:{key:`other`,label:`Other`}}function ii(e,t){let n=new Map,r=0,i=0;for(let[a,o]of e){let e=ri(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 ai=6,$=new WeakMap,oi=new Set([`terminal`,`code`,`search`,`compare`]);function si(e,t=null){return!!t||oi.has(e)}var ci=/^sha512-[A-Za-z0-9+/]{86}==$/u;function li(e){if(e.fileHashes)return Promise.resolve(e.fileHashes);if($.has(e))return $.get(e);let n=(async()=>{let n=[...Z(e)],r=new Map;for(let e=0;e<n.length;e+=32){let i=await Promise.all(n.slice(e,e+32).map(async([e,n])=>[e,await t(n)]));for(let[e,t]of i)r.set(e,t)}return e.fileHashes=r,r})();return $.set(e,n),n.catch(()=>$.delete(e)),n}function ui(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 di(e){return e.lineCounts??=new Map([...Z(e)].map(([e,t])=>[e,ui(t)]))}function fi(e){return e instanceof Map?Object.fromEntries([...e].map(([e,t])=>[e,fi(t)])):e}async function pi(e){let t=await li(e),r=Q(e),i=di(e),a={version:ai,integrity:e.integrity,kind:e.kind,size:e.size,codeStats:ii(i,r),files:[...r].map(([e,n])=>[e,n,t.get(e)??null,i.get(e)??null])},o=Jr(e);if(o.size>0&&(a.unsized=[...o]),e.kind===`sourcemap`){let{version:t,file:r,sourceRoot:i,names:o}=e.json,s=Er(e);a.json={version:t,file:r,sourceRoot:i,sources:s.map(([e])=>e)},a.sourceSizes=s.map(([,e])=>typeof e==`string`?n(e):null),a.namesCount=e.namesCount??o?.length??null;let c=new Map(a.files.map(([e],t)=>[e,t]));a.edges=X(e).map(([e,t,...n])=>[c.get(e),c.get(t),...n])}else{let t=e.bundle,n={version:t.version,config:t.config,repo:t.repo,package:t.package,formats:fi(t.formats),imports:fi(t.imports),reason:t.reason,executable:[...t.executable]};if(t.version===0)n.sources=Object.fromEntries([...r.keys()].map(e=>[e,null]));else{let e={},r={};for(let[n,i]of t.modules){let t=n.split(`/`).includes(`node_modules`)?e:r;Object.defineProperty(t,n,{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]))}})}n.modules=e,t.config.scope===`full`&&(n.sources=r,n.entries=[...t.entries])}a.bundle=n}return a}function mi(e,t){if(![1,2,3,4,5,ai].includes(e?.version)||e.integrity!==t||![`stasis`,`sourcemap`].includes(e.kind)||!Number.isSafeInteger(e.size)||e.size<0||!Array.isArray(e.files))throw Error(`Invalid bundle metadata`);let n=e.version!==ai,r=e.version===1,i=new Map,a=new Map,o=new Map;for(let t of e.files){if(!Array.isArray(t)||t.length!==4&&!(r&&t.length===3))throw Error(`Invalid bundle metadata file`);let[e,n,s,c]=t;if(typeof e!=`string`||a.has(e)||n!==null&&(!Number.isSafeInteger(n)||n<0)||s!==null&&(typeof s!=`string`||!ci.test(s))||n===null&&s!==null||r&&n!==null&&s===null||c!=null&&(!Number.isSafeInteger(c)||c<0))throw Error(`Invalid bundle metadata file`);a.set(e,n),s!==null&&i.set(e,s),c!=null&&o.set(e,c)}let s=new Set(e.unsized??[]);if(e.unsized!==void 0&&(r||!Array.isArray(e.unsized)||s.size!==e.unsized.length)||[...s].some(e=>typeof e!=`string`||!a.has(e)||a.get(e)!==null))throw Error(`Invalid bundle metadata`);let c={integrity:t,kind:e.kind,size:e.size,metadataOnly:!0,fileSizes:a,fileHashes:i,lineCounts:o,unsizedFiles:s,stale:n};if(e.kind===`stasis`){c.bundle=P.fromJSON(e.bundle);let t=c.bundle.sources;if(t.size!==a.size||[...t.keys()].some(e=>!a.has(e)))throw Error(`Invalid bundle metadata inventory`);let n=c.bundle.formats;if(!r&&[...a].some(([e,t])=>i.has(e)!==(t!==null&&!P.isResourceFormat(n.get(e))))||[...s].some(e=>n.get(e)!==`resource:base64`))throw Error(`Invalid bundle metadata inventory`)}else{if(!e.json||typeof e.json!=`object`||![null,void 0].includes(e.namesCount)&&(!Number.isSafeInteger(e.namesCount)||e.namesCount<0))throw Error(`Invalid sourcemap metadata`);if(!Array.isArray(e.json.sources)||e.json.sources.some(e=>!a.has(e))||!Array.isArray(e.sourceSizes)||e.sourceSizes.length!==e.json.sources.length||e.sourceSizes.some(e=>e!==null&&(!Number.isSafeInteger(e)||e<0))||[...a].some(([e,t])=>i.has(e)!==(t!==null))||s.size>0)throw Error(`Invalid sourcemap inventory`);c.json=e.json,c.sourceSizes=e.sourceSizes,c.namesCount=e.namesCount,e.edges!==void 0&&(c.edges=hi(e.edges,e.files))}if(e.codeStats===void 0)c.codeStats=ii(o,a);else{let t=e.codeStats,n=e=>Number.isSafeInteger(e)&&e>=0;if(!t||![t.files,t.lines,t.bytes].every(n)||!Array.isArray(t.languages)||t.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`);c.codeStats=t}return c}function hi(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 gi(e,{integrity:t,kind:n,size:r}){if(n===`stasis`)return{integrity:t,kind:n,size:r,bundle:P.parse(e)};if(n!==`sourcemap`)throw Error(`Unsupported bundle format`);return{integrity:t,kind:n,size:r,...Tr(e)}}export{Mt as a,P as b,Bt as c,ii as d,X as e,Mr as f,Nr as g,Z as h,Br as i,Hr as j,Ur as k,Wr as l,qr as m,Q as n,Yr as o,Xr as p,Qr as q,$r as r,ei as s,si as t,li as u,ui as v,di as w,pi as x,mi as y,gi as z};