@preventive/triage 1.0.0-alpha.44 → 1.0.0-alpha.46

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 (207) hide show
  1. package/client/linked-findings.js +3 -0
  2. package/common/bundle-metadata.d.ts +1 -0
  3. package/common/bundle-metadata.js +1 -1
  4. package/common/bundle-sources.js +25 -2
  5. package/common/default-scan-models.ts +1 -1
  6. package/common/dependency-reviews.d.ts +0 -5
  7. package/common/dependency-reviews.js +0 -17
  8. package/common/line-diff.js +5 -4
  9. package/common/managed/agent-tasks.ts +292 -0
  10. package/common/managed/github-agents.ts +92 -0
  11. package/common/managed/github-logins.ts +49 -0
  12. package/common/managed/roles.ts +7 -0
  13. package/common/managed/routes.js +88 -7
  14. package/common/managed/team-app.d.ts +5 -2
  15. package/common/managed/team-app.js +2 -2
  16. package/common/server-info.ts +3 -0
  17. package/common/workspace-app.js +6 -3
  18. package/out/brotli-fallback.js +3 -3
  19. package/out/chunk-2XUEZHIP.js +18 -18
  20. package/out/chunk-2ZDZWLFY.js +1 -0
  21. package/out/chunk-3PS4KWD2.js +10 -0
  22. package/out/chunk-4HI2MSAV.js +17 -0
  23. package/out/chunk-4UFAMJAX.js +1 -0
  24. package/out/chunk-7C7DWL7I.js +1 -0
  25. package/out/chunk-7XRR4OFU.js +1 -0
  26. package/out/chunk-BC2UCLFJ.js +1 -0
  27. package/out/chunk-BOIXMUU5.js +3 -0
  28. package/out/chunk-C4Z6ZBXV.js +6 -6
  29. package/out/chunk-CC4OM6TZ.js +3 -0
  30. package/out/chunk-G24A42V6.js +2 -0
  31. package/out/chunk-GDPCLSOS.js +2 -0
  32. package/out/chunk-GO7FT4OD.js +1 -0
  33. package/out/chunk-I2MDGSQX.js +3 -0
  34. package/out/chunk-IYPY47MC.js +1 -0
  35. package/out/chunk-IZ7POWI3.js +18 -0
  36. package/out/chunk-JCIIBLKR.js +1 -1
  37. package/out/chunk-JKGQ3O7O.js +6 -0
  38. package/out/chunk-LE5ZWLG4.js +235 -0
  39. package/out/chunk-MSION3G4.js +36 -0
  40. package/out/chunk-NRPC74AM.js +1 -1
  41. package/out/chunk-OKRLLE5I.js +17 -0
  42. package/out/chunk-OOJM4CTU.js +1 -1
  43. package/out/chunk-PNHBZGDD.js +1 -1
  44. package/out/chunk-PXK7EU4V.js +1 -0
  45. package/out/chunk-QB4CBOX2.js +1 -0
  46. package/out/chunk-R3NZFXVR.js +1 -0
  47. package/out/chunk-R5O6FAW4.js +1 -1
  48. package/out/chunk-S6GIXWQW.js +52 -0
  49. package/out/chunk-SXV2T5C4.js +80 -0
  50. package/out/chunk-TUII34K2.js +1 -1
  51. package/out/chunk-V3KWNNMY.js +1 -0
  52. package/out/chunk-VFWMQ3LG.js +2 -0
  53. package/out/chunk-VH4XMZIW.js +2 -0
  54. package/out/chunk-WFYLMF6Z.js +10 -0
  55. package/out/chunk-WQ74ZBZF.js +7 -0
  56. package/out/client-managed-import.js +3 -3
  57. package/out/client-managed.js +31 -35
  58. package/out/client-sync.js +11 -11
  59. package/out/compare.js +35 -0
  60. package/out/dialogs.js +51 -0
  61. package/out/github-issue-authorized.html +1 -1
  62. package/out/github-issue-authorized.js +1 -1
  63. package/out/graph.js +17 -17
  64. package/out/index.html +30 -34
  65. package/out/prism.js +14 -14
  66. package/out/scan.js +2 -0
  67. package/out/terminal.js +294 -293
  68. package/out/view.css +1 -1
  69. package/out/view.js +16 -107
  70. package/package.json +53 -6
  71. package/risk/actions/findings.js +161 -0
  72. package/risk/actions/resolve.js +219 -0
  73. package/risk/actions/scripts/commands.js +182 -0
  74. package/risk/actions/scripts/grade.js +113 -0
  75. package/risk/actions/scripts/packages.js +123 -0
  76. package/risk/actions/scripts/shell.js +169 -0
  77. package/risk/actions/uses.js +76 -0
  78. package/risk/actions/workflow.js +110 -0
  79. package/risk/files/hosts.js +6 -6
  80. package/risk/files/readability.js +23 -17
  81. package/risk/files/runs-code.js +18 -6
  82. package/risk/files/script.js +7 -3
  83. package/risk/files/stamps.js +8 -7
  84. package/risk/index.d.ts +71 -1
  85. package/risk/index.js +6 -2
  86. package/risk/npm/assess.js +1 -1
  87. package/risk/npm/compare.js +34 -10
  88. package/risk/npm/files.js +413 -2
  89. package/risk/npm/tarball.js +56 -73
  90. package/server-e2e/app.ts +5 -4
  91. package/server-e2e/http.ts +5 -2
  92. package/server-managed/agent-merges.ts +198 -0
  93. package/server-managed/app-agents.ts +30 -0
  94. package/server-managed/avatar-store.ts +1 -0
  95. package/server-managed/bundle-cache.ts +7 -1
  96. package/server-managed/combined.ts +3 -2
  97. package/server-managed/commit-coauthors.ts +83 -0
  98. package/server-managed/commit-lockfiles.ts +72 -0
  99. package/server-managed/config.ts +6 -0
  100. package/server-managed/db-methods.ts +66 -19
  101. package/server-managed/db-neon.ts +89 -21
  102. package/server-managed/db-schema.ts +13 -2
  103. package/server-managed/db.ts +9 -1
  104. package/server-managed/dependabot-access.ts +60 -0
  105. package/server-managed/dependabot-alerts.ts +185 -0
  106. package/server-managed/dependency-review-comments.ts +97 -0
  107. package/server-managed/dependency-reviews.ts +78 -18
  108. package/server-managed/github-accounts.ts +33 -0
  109. package/server-managed/github-actions.ts +71 -0
  110. package/server-managed/github-app.ts +33 -13
  111. package/server-managed/github-errors.ts +2 -0
  112. package/server-managed/github-issue-links.ts +11 -5
  113. package/server-managed/github-link-oauth.ts +69 -0
  114. package/server-managed/github-links.ts +204 -0
  115. package/server-managed/github-oauth.ts +5 -2
  116. package/server-managed/github-pulls.ts +2 -2
  117. package/server-managed/github-requests.ts +39 -0
  118. package/server-managed/github-users.ts +30 -0
  119. package/server-managed/http-response.ts +10 -2
  120. package/server-managed/http.ts +1251 -97
  121. package/server-managed/index.ts +13 -8
  122. package/server-managed/kept-briefly.ts +37 -0
  123. package/server-managed/locked-packages.ts +37 -16
  124. package/server-managed/lockfile-scope.ts +49 -0
  125. package/server-managed/npm-delta-worker.js +23 -0
  126. package/server-managed/npm-delta.ts +178 -0
  127. package/server-managed/npm-insights.ts +20 -11
  128. package/server-managed/npm-kept.ts +83 -6
  129. package/server-managed/npm-loads.ts +114 -37
  130. package/server-managed/npm-packages.ts +110 -64
  131. package/server-managed/npm-risk.ts +4 -1
  132. package/server-managed/pretty-print.ts +67 -23
  133. package/server-managed/pull-comment-reviews.ts +161 -0
  134. package/server-managed/pull-dependencies.ts +300 -0
  135. package/server-managed/pull-dependency-reviews.ts +318 -0
  136. package/server-managed/pull-reviews.ts +205 -0
  137. package/server-managed/queue.ts +16 -0
  138. package/server-managed/release-commits.ts +84 -0
  139. package/server-managed/rename-diff.ts +22 -13
  140. package/server-managed/report-sources.ts +1 -1
  141. package/server-managed/report-store.ts +42 -9
  142. package/server-managed/repository-actions.ts +218 -0
  143. package/server-managed/repository-agents.ts +220 -0
  144. package/server-managed/repository-browser.ts +166 -37
  145. package/server-managed/repository-changes.ts +284 -0
  146. package/server-managed/repository-code.ts +52 -0
  147. package/server-managed/repository-dependency-reviews.ts +157 -0
  148. package/server-managed/repository-history.ts +461 -0
  149. package/server-managed/repository-issues.ts +181 -0
  150. package/server-managed/repository-pulse.ts +439 -0
  151. package/server-managed/repository-risk-audit.ts +13 -0
  152. package/server-managed/repository-risk-read.ts +170 -0
  153. package/server-managed/repository-risk.ts +133 -118
  154. package/server-managed/reviewed-dependencies.ts +149 -0
  155. package/server-managed/session.ts +27 -9
  156. package/server-managed/sql.ts +6 -3
  157. package/server-managed/storage-stores.ts +5 -0
  158. package/server-managed/storage.ts +4 -2
  159. package/server-managed/team-app.ts +19 -3
  160. package/server-managed/team-reports.ts +24 -12
  161. package/server-managed/upstream-cache.ts +12 -0
  162. package/server-managed/workspace-shares.ts +4 -1
  163. package/server.ts +25 -5
  164. package/out/chunk-2ABLKCOY.js +0 -46
  165. package/out/chunk-2KBF5TZ7.js +0 -2
  166. package/out/chunk-35VE6CDH.js +0 -2
  167. package/out/chunk-3BZ7JERB.js +0 -1
  168. package/out/chunk-4XCDFGDP.js +0 -10
  169. package/out/chunk-5LSXOLUS.js +0 -1
  170. package/out/chunk-5RCM2J63.js +0 -1
  171. package/out/chunk-7B6HB4D7.js +0 -1
  172. package/out/chunk-AJ4GTATZ.js +0 -3
  173. package/out/chunk-CH4UN6WK.js +0 -225
  174. package/out/chunk-CMQA4DM6.js +0 -1
  175. package/out/chunk-CVVJAXVY.js +0 -2
  176. package/out/chunk-DIJJNTRH.js +0 -10
  177. package/out/chunk-EDKLBQQN.js +0 -17
  178. package/out/chunk-F47DXCEV.js +0 -33
  179. package/out/chunk-FK3DZEKL.js +0 -1
  180. package/out/chunk-G6AJWENO.js +0 -1
  181. package/out/chunk-GJ4IUCNS.js +0 -1
  182. package/out/chunk-GNXOKIGP.js +0 -80
  183. package/out/chunk-GZ4MS3TE.js +0 -13
  184. package/out/chunk-GZWM7UQM.js +0 -2
  185. package/out/chunk-IU3CCINR.js +0 -3
  186. package/out/chunk-K3X5EJBQ.js +0 -2
  187. package/out/chunk-KEX2ATEW.js +0 -2
  188. package/out/chunk-KYCNJVB7.js +0 -1
  189. package/out/chunk-LPCTJYNA.js +0 -7
  190. package/out/chunk-O4RJY5TP.js +0 -2
  191. package/out/chunk-OD4LPN3H.js +0 -1
  192. package/out/chunk-QWDWTBM7.js +0 -1
  193. package/out/chunk-QYWKC557.js +0 -1
  194. package/out/chunk-R75XOKUP.js +0 -1
  195. package/out/chunk-SWTLADW5.js +0 -1
  196. package/out/chunk-T7OKH4VW.js +0 -1
  197. package/out/chunk-TZ5KB2Y5.js +0 -10
  198. package/out/chunk-UNTRGE26.js +0 -2
  199. package/out/chunk-UTR2LVME.js +0 -2
  200. package/out/chunk-UYAXVRVL.js +0 -1
  201. package/out/chunk-V3ME6FI5.js +0 -2
  202. package/out/chunk-V5O7M2YT.js +0 -1
  203. package/out/chunk-VIHGO77Y.js +0 -1
  204. package/out/chunk-W4J3MGLB.js +0 -1
  205. package/out/chunk-WGG7KQUH.js +0 -1
  206. package/out/chunk-XYFXXB2G.js +0 -10
  207. package/out/chunk-ZESLQCTF.js +0 -6
@@ -1,28 +1,28 @@
1
- var M=globalThis,N=M.ShadowRoot&&(M.ShadyCSS===void 0||M.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,z=Symbol(),Q=new WeakMap,C=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(N&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Q.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Q.set(e,t))}return t}toString(){return this.cssText}},X=r=>new C(typeof r=="string"?r:r+"",void 0,z),_t=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1],r[0]);return new C(e,r,z)},Y=(r,t)=>{if(N)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=M.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},I=N?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return X(e)})(r):r;var{is:ft,defineProperty:At,getOwnPropertyDescriptor:mt,getOwnPropertyNames:gt,getOwnPropertySymbols:yt,getPrototypeOf:vt}=Object,T=globalThis,tt=T.trustedTypes,St=tt?tt.emptyScript:"",Et=T.reactiveElementPolyfillSupport,w=(r,t)=>r,V={toAttribute(r,t){switch(t){case Boolean:r=r?St:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},st=(r,t)=>!ft(r,t),et={attribute:!0,type:String,converter:V,reflect:!1,useDefault:!1,hasChanged:st};Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=et){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&At(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=mt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:i,set(n){let l=i?.call(this);o?.call(this,n),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??et}static _$Ei(){if(this.hasOwnProperty(w("elementProperties")))return;let t=vt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(w("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(w("properties"))){let e=this.properties,s=[...gt(e),...yt(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(I(i))}else t!==void 0&&e.push(I(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Y(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:V).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:V;this._$Em=i;let l=n.fromAttribute(e,o.type);this[i]=l??this._$Ej?.get(i)??l,this._$Em=null}}requestUpdate(t,e,s,i=!1,o){if(t!==void 0){let n=this.constructor;if(i===!1&&(o=this[t]),s??=n.getPropertyOptions(t),!((s.hasChanged??st)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:o},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s){let{wrapped:n}=o,l=this[i];n!==!0||this._$AL.has(i)||l===void 0||this.C(i,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[w("elementProperties")]=new Map,$[w("finalized")]=new Map,Et?.({ReactiveElement:$}),(T.reactiveElementVersions??=[]).push("2.1.2");var q=globalThis,it=r=>r,R=q.trustedTypes,rt=R?R.createPolicy("lit-html",{createHTML:r=>r}):void 0,K="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,F="?"+_,bt=`<${F}>`,g=document,P=()=>g.createComment(""),U=r=>r===null||typeof r!="object"&&typeof r!="function",J=Array.isArray,ct=r=>J(r)||typeof r?.[Symbol.iterator]=="function",W=`[
2
- \f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ot=/-->/g,nt=/>/g,A=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ht=/'/g,at=/"/g,pt=/^(?:script|style|textarea|title)$/i,Z=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Ht=Z(1),Mt=Z(2),Nt=Z(3),y=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),lt=new WeakMap,m=g.createTreeWalker(g,129);function dt(r,t){if(!J(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return rt!==void 0?rt.createHTML(t):t}var ut=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"<svg>":t===3?"<math>":"",n=x;for(let l=0;l<e;l++){let h=r[l],c,d,a=-1,u=0;for(;u<h.length&&(n.lastIndex=u,d=n.exec(h),d!==null);)u=n.lastIndex,n===x?d[1]==="!--"?n=ot:d[1]!==void 0?n=nt:d[2]!==void 0?(pt.test(d[2])&&(i=RegExp("</"+d[2],"g")),n=A):d[3]!==void 0&&(n=A):n===A?d[0]===">"?(n=i??x,a=-1):d[1]===void 0?a=-2:(a=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?A:d[3]==='"'?at:ht):n===at||n===ht?n=A:n===ot||n===nt?n=x:(n=A,i=void 0);let f=n===A&&r[l+1].startsWith("/>")?" ":"";o+=n===x?h+bt:a>=0?(s.push(c),h.slice(0,a)+K+h.slice(a)+_+f):h+_+(a===-2?l:f)}return[dt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},O=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,l=t.length-1,h=this.parts,[c,d]=ut(t,e);if(this.el=r.createElement(c,s),m.currentNode=this.el.content,e===2||e===3){let a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(i=m.nextNode())!==null&&h.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(let a of i.getAttributeNames())if(a.endsWith(K)){let u=d[n++],f=i.getAttribute(a).split(_),H=/([.?@])?(.*)/.exec(u);h.push({type:1,index:o,name:H[2],strings:f,ctor:H[1]==="."?k:H[1]==="?"?D:H[1]==="@"?j:S}),i.removeAttribute(a)}else a.startsWith(_)&&(h.push({type:6,index:o}),i.removeAttribute(a));if(pt.test(i.tagName)){let a=i.textContent.split(_),u=a.length-1;if(u>0){i.textContent=R?R.emptyScript:"";for(let f=0;f<u;f++)i.append(a[f],P()),m.nextNode(),h.push({type:2,index:++o});i.append(a[u],P())}}}else if(i.nodeType===8)if(i.data===F)h.push({type:2,index:o});else{let a=-1;for(;(a=i.data.indexOf(_,a+1))!==-1;)h.push({type:7,index:o}),a+=_.length-1}o++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}};function v(r,t,e=r,s){if(t===y)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl,o=U(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=v(r,i._$AS(r,t.values),i,s)),t}var L=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);m.currentNode=i;let o=m.nextNode(),n=0,l=0,h=s[0];for(;h!==void 0;){if(n===h.index){let c;h.type===2?c=new E(o,o.nextSibling,this,t):h.type===1?c=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(c=new B(o,this,t)),this._$AV.push(c),h=s[++l]}n!==h?.index&&(o=m.nextNode(),n++)}return m.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},E=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=v(this,t,e),U(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ct(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=O.createElement(dt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let o=new L(i,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=lt.get(t.strings);return e===void 0&&lt.set(t.strings,e=new O(t)),e}k(t){J(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let o of t)i===e.length?e.push(s=new r(this.O(P()),this.O(P()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=it(t).nextSibling;it(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},S=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=p}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=v(this,t,e,0),n=!U(t)||t!==this._$AH&&t!==y,n&&(this._$AH=t);else{let l=t,h,c;for(t=o[0],h=0;h<o.length-1;h++)c=v(this,l[s+h],e,h),c===y&&(c=this._$AH[h]),n||=!U(c)||c!==this._$AH[h],c===p?t=p:t!==p&&(t+=(c??"")+o[h+1]),this._$AH[h]=c}n&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},k=class extends S{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}},D=class extends S{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}},j=class extends S{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=v(this,t,e,0)??p)===y)return;let s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},B=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t)}},Tt={M:K,P:_,A:F,C:1,L:ut,R:L,D:ct,V:v,I:E,H:S,N:D,U:j,B:k,F:B},Ct=q.litHtmlPolyfillSupport;Ct?.(O,E),(q.litHtmlVersions??=[]).push("3.3.3");var $t=(r,t,e)=>{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new E(t.insertBefore(P(),o),o,void 0,e??{})}return i._$AI(r),i};var G=globalThis,b=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=$t(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return y}};b._$litElement$=!0,b.finalized=!0,G.litElementHydrateSupport?.({LitElement:b});var wt=G.litElementPolyfillSupport;wt?.({LitElement:b});(G.litElementVersions??=[]).push("4.2.2");export{X as a,_t as b,Ht as c,Mt as d,Nt as e,y as f,p as g,Tt as h,$t as i,b as j};
1
+ var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}},a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(e._$cssResult$===!0)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:ee,getOwnPropertySymbols:te,getPrototypeOf:ne}=Object,f=globalThis,p=f.trustedTypes,re=p?p.emptyScript:``,ie=f.reactiveElementPolyfillSupport,m=(e,t)=>e,h={toAttribute(e,t){switch(t){case Boolean:e=e?re:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},g=(e,t)=>!l(e,t),_={attribute:!0,type:String,converter:h,reflect:!1,useDefault:!1,hasChanged:g};Symbol.metadata??=Symbol(`metadata`),f.litPropertyMetadata??=new WeakMap;var v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty(m(`elementProperties`)))return;let e=ne(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(m(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m(`properties`))){let e=this.properties,t=[...ee(e),...te(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){let i=(n.converter?.toAttribute===void 0?h:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?h:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(r===!1&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??g)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),i!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];e!==!0||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};v.elementStyles=[],v.shadowRootOptions={mode:`open`},v[m(`elementProperties`)]=new Map,v[m(`finalized`)]=new Map,ie?.({ReactiveElement:v}),(f.reactiveElementVersions??=[]).push(`2.1.2`);var y=globalThis,ae=e=>e,b=y.trustedTypes,x=b?b.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,S=`$lit$`,C=`lit$${Math.random().toFixed(9).slice(2)}$`,w=`?`+C,oe=`<${w}>`,T=document,E=()=>T.createComment(``),D=e=>e===null||typeof e!=`object`&&typeof e!=`function`,O=Array.isArray,se=e=>O(e)||typeof e?.[Symbol.iterator]==`function`,k=`[
2
+ \f\r]`,A=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,M=/>/g,N=RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,`g`),P=/'/g,F=/"/g,I=/^(?:script|style|textarea|title)$/i,L=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),ce=L(1),le=L(2),ue=L(3),R=Symbol.for(`lit-noChange`),z=Symbol.for(`lit-nothing`),B=new WeakMap,V=T.createTreeWalker(T,129);function H(e,t){if(!O(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return x===void 0?t:x.createHTML(t)}var U=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=A;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===A?c[1]===`!--`?o=j:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=N):(I.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=N):o=M:o===N?c[0]===`>`?(o=i??A,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?N:c[3]===`"`?F:P):o===F||o===P?o=N:o===j||o===M?o=A:(o=N,i=void 0);let d=o===N&&e[t+1].startsWith(`/>`)?` `:``;a+=o===A?n+oe:l>=0?(r.push(s),n.slice(0,l)+S+n.slice(l)+C+d):n+C+(l===-2?t:d)}return[H(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},W=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=U(t,n);if(this.el=e.createElement(l,r),V.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=V.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(S)){let t=u[o++],n=i.getAttribute(e).split(C),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Y:r[1]===`?`?X:r[1]===`@`?de:J}),i.removeAttribute(e)}else e.startsWith(C)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(I.test(i.tagName)){let e=i.textContent.split(C),t=e.length-1;if(t>0){i.textContent=b?b.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],E()),V.nextNode(),c.push({type:2,index:++a});i.append(e[t],E())}}}else if(i.nodeType===8){if(i.data===w)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(C,e+1))!==-1;)c.push({type:7,index:a}),e+=C.length-1}}a++}}static createElement(e,t){let n=T.createElement(`template`);return n.innerHTML=e,n}};function G(e,t,n=e,r){if(t===R)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=D(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=G(e,i._$AS(e,t.values),i,r)),t}var K=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??T).importNode(t,!0);V.currentNode=r;let i=V.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new q(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Z(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=V.nextNode(),a++)}return V.currentNode=T,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},q=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=z,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=G(this,e,t),D(e)?e===z||e==null||e===``?(this._$AH!==z&&this._$AR(),this._$AH=z):e!==this._$AH&&e!==R&&this._(e):e._$litType$===void 0?e.nodeType===void 0?se(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==z&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=W.createElement(H(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new K(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=B.get(e.strings);return t===void 0&&B.set(e.strings,t=new W(e)),t}k(t){O(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(E()),this.O(E()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=ae(e).nextSibling;ae(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},J=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=z,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=z}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=G(this,e,t,0),a=!D(e)||e!==this._$AH&&e!==R,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=G(this,r[n+o],t,o),s===R&&(s=this._$AH[o]),a||=!D(s)||s!==this._$AH[o],s===z?e=z:e!==z&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Y=class extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===z?void 0:e}},X=class extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==z)}},de=class extends J{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=G(this,e,t,0)??z)===R)return;let n=this._$AH,r=e===z&&n!==z||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==z&&(n===z||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Z=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){G(this,e)}},fe={M:S,P:C,A:w,C:1,L:U,R:K,D:se,V:G,I:q,H:J,N:X,U:de,B:Y,F:Z},pe=y.litHtmlPolyfillSupport;pe?.(W,q),(y.litHtmlVersions??=[]).push(`3.3.3`);var me=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new q(t.insertBefore(E(),e),e,void 0,n??{})}return i._$AI(e),i},Q=globalThis,$=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=me(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return R}};$._$litElement$=!0,$.finalized=!0,Q.litElementHydrateSupport?.({LitElement:$});var he=Q.litElementPolyfillSupport;he?.({LitElement:$}),(Q.litElementVersions??=[]).push(`4.2.2`);export{a,o as b,ce as c,le as d,ue as e,R as f,z as g,fe as h,me as i,$ as j};
4
4
  /*! Bundled license information:
5
5
 
6
6
  @lit/reactive-element/css-tag.js:
7
- (**
8
- * @license
9
- * Copyright 2019 Google LLC
10
- * SPDX-License-Identifier: BSD-3-Clause
11
- *)
7
+ (**
8
+ * @license
9
+ * Copyright 2019 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ *)
12
12
 
13
13
  @lit/reactive-element/reactive-element.js:
14
14
  lit-html/lit-html.js:
15
15
  lit-element/lit-element.js:
16
- (**
17
- * @license
18
- * Copyright 2017 Google LLC
19
- * SPDX-License-Identifier: BSD-3-Clause
20
- *)
16
+ (**
17
+ * @license
18
+ * Copyright 2017 Google LLC
19
+ * SPDX-License-Identifier: BSD-3-Clause
20
+ *)
21
21
 
22
22
  lit-html/is-server.js:
23
- (**
24
- * @license
25
- * Copyright 2022 Google LLC
26
- * SPDX-License-Identifier: BSD-3-Clause
27
- *)
23
+ (**
24
+ * @license
25
+ * Copyright 2022 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ *)
28
28
  */
@@ -0,0 +1 @@
1
+ import{b as e,c as t,d as n,e as r,f as i,g as a,h as o,i as s,j as c,k as l,m as u,n as d}from"./chunk-PXK7EU4V.js";import{b as f}from"./chunk-OOJM4CTU.js";var p=globalThis.atob,m=Uint8Array.prototype.toBase64,h=8192,g=m&&p;function _(e,t=0,n=e.length){t|=0,n|=0;let r=n-t;if(r===0)return``;if(g&&r>=256&&r<1e8&&e.toBase64===m&&e.BYTES_PER_ELEMENT===1)return p((t===0&&n===e.length?e:e.subarray(t,n)).toBase64());if(r>h){let r=``;for(let i=t;i<n;){let t=Math.min(n,i+h);r+=String.fromCharCode.apply(String,e.subarray(i,t)),i=t}return r}let i=t===0&&n===e.length?e:e.subarray(t,n);return String.fromCharCode.apply(String,i)}var v=t?e=>e.byteLength>=768&&!r?t.from(e.buffer,e.byteOffset,e.byteLength).latin1Slice(0,e.byteLength):a.decode(e):o?e=>o.decode(e):e=>_(e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),ee=t=>e(t,new Uint8Array(t.length)),y=n&&i?.encodeInto?(e,t)=>{let n=new Uint8Array(e.length+4),r=i.encodeInto(e,n);if(r.read!==e.length||r.written!==e.length)throw SyntaxError(t);return n.subarray(0,e.length)}:t?(e,n)=>{let r=t.from(e,`utf8`);if(r.length!==e.length)throw SyntaxError(n);return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}:(e,t)=>{let n=i.encode(e);if(n.length!==e.length)throw SyntaxError(t);return n},b,x,S,C=12336,te=26214,ne=`0123456789ABCDEFabcdef`,w=`Input is not a hex string`;function re(e){b||=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));let t=e.length;if(a){if(!x){x=new Uint16Array(256);let e=new Uint8Array(x.buffer,x.byteOffset,x.byteLength);for(let t=0;t<256;t++){let n=b[t];e[2*t]=n.charCodeAt(0),e[2*t+1]=n.charCodeAt(1)}}let n=new Uint16Array(t),r=0;for(let t=e.length-3;!(r>=t);r+=4){let t=e[r],i=e[r+1],a=e[r+2],o=e[r+3];n[r]=x[t],n[r+1]=x[i],n[r+2]=x[a],n[r+3]=x[o]}for(;r<t;r++)n[r]=x[e[r]];return v(n)}return s(e,0,t,b)}function ie(e){if(typeof e!=`string`)throw TypeError(l);if(e.length%2!=0)throw SyntaxError(w);let t=e.length/2,n=new Uint8Array(t);if(i){if(!S){S=new Uint8Array(te+1);let e=new Uint8Array(2),t=new Uint16Array(e.buffer,e.byteOffset,1),n=[...ne].map(e=>[e.charCodeAt(0),parseInt(e,16)]);for(let[r,i]of n){e[0]=r;for(let[r,a]of n)e[1]=r,S[t[0]]=i<<4|a}}let r=y(e,w),i=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),a=0;for(let e=t-3;a<e;a+=4){let e=i[a],t=i[a+1],r=i[a+2],o=i[a+3],s=S[e],c=S[t],l=S[r],u=S[o];if(!s&&e!==C||!c&&t!==C||!l&&r!==C||!u&&o!==C)throw SyntaxError(w);n[a]=s,n[a+1]=c,n[a+2]=l,n[a+3]=u}for(;a<t;){let e=i[a],t=S[e];if(!t&&e!==C)throw SyntaxError(w);n[a++]=t}}else{if(!S){S=new Int8Array(128).fill(-1);for(let e=0;e<16;e++){let t=e.toString(16);S[t.charCodeAt(0)]=S[t.toUpperCase().charCodeAt(0)]=e}}let r=0;for(let i=0;i<t;i++){let t=e.charCodeAt(r++),a=e.charCodeAt(r++),o=S[t]<<4|S[a];if(o<0||(127|t|a)!=127)throw SyntaxError(w);n[i]=o}}return n}var{toHex:T}=Uint8Array.prototype;function ae(e){return c(e),e.length===0?``:T&&e.toHex===T?e.toHex():re(e)}var oe=Uint8Array.fromHex?(e,t=`uint8`)=>u(Uint8Array.fromHex(e),t):(e,t=`uint8`)=>u(ie(e),t);function E(e){if(Object.keys(e).length>0)throw TypeError(`Unexpected extra options`)}Object.getPrototypeOf(Uint8Array);var D={};f(D,{E_CHAR:()=>M,E_LAST:()=>F,E_LENGTH:()=>P,E_PADDING:()=>N,fromBase64:()=>L,toBase64:()=>I});var O=[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`],k=[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`],A={},j={},M=`Invalid character in base64 input`,N=`Invalid base64 padding`,P=`Invalid base64 length`,F=`Invalid last chunk`;function I(e,t,n){let r=e.length/3|0,i=r*3,o=``,s=0,c=t?k:O,l=t?j:A;if(!l.pairs){if(l.pairs=[],a){l.codepairs=new Uint16Array(4096);let e=l.codepairs,t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(let e=0;e<64;e++){let n=c[e].charCodeAt(0);for(let r=0;r<64;r++)t[e<<7|r<<1]=t[r<<7|(e<<1)+1]=n}}else{let e=l.pairs;for(let t=0;t<64;t++)for(let n=0;n<64;n++)e.push(`${c[t]}${c[n]}`)}}let{pairs:u,codepairs:d}=l;if(a){let t=new Uint16Array(r*2),n=0;for(let r=e.length-11;s<r;s+=12,n+=8){let r=e[s],i=e[s+1],a=e[s+2],o=e[s+3],c=e[s+4],l=e[s+5],u=e[s+6],f=e[s+7],p=e[s+8],m=e[s+9],h=e[s+10],g=e[s+11];t[n]=d[r<<4|i>>4],t[n+1]=d[(i&15)<<8|a],t[n+2]=d[o<<4|c>>4],t[n+3]=d[(c&15)<<8|l],t[n+4]=d[u<<4|f>>4],t[n+5]=d[(f&15)<<8|p],t[n+6]=d[m<<4|h>>4],t[n+7]=d[(h&15)<<8|g]}for(let r=e.length-2;s<r;s+=3,n+=2){let r=e[s],i=e[s+1],a=e[s+2];t[n]=d[r<<4|i>>4],t[n+1]=d[(i&15)<<8|a]}o=v(t)}else for(;s<i;s+=3){let t=e[s],n=e[s+1],r=e[s+2];o+=u[t<<4|n>>4],o+=u[(n&15)<<8|r]}let f=0,p=2,m=e.length;for(;s<m;s++){let t=e[s];o+=c[f|t>>p],p===6&&(p=0,o+=c[t&63]),f=t<<6-p&63,p+=2}return p!==2&&(o+=c[f]),n&&(o+=[``,`==`,`=`][m-i]),o}var se=i?128:65536;function L(e,t){let n=e.length;for(;e[n-1]===`=`;)n--;let r=e.length-n,a=n%4,o=n-a;if(a===1)throw SyntaxError(P);if(r>3||r!==0&&e.length%4!=0)throw SyntaxError(N);let s=t?k:O,c=t?j:A;c.fromMap||(c.fromMap=new Int8Array(se).fill(-1),s.forEach((e,t)=>c.fromMap[e.charCodeAt(0)]=t));let l=c.fromMap,u=new Uint8Array(Math.floor(n*3/4)),d=0,f=0;if(i){let t=y(e,M);for(;f<o;f+=4){let e=t[f],n=t[f+1],r=t[f+2],i=t[f+3],a=l[e]<<18|l[n]<<12|l[r]<<6|l[i];if(a<0)throw SyntaxError(M);u[d]=a>>16,u[d+1]=a>>8&255,u[d+2]=a&255,d+=3}}else for(;f<o;f+=4){let t=e.charCodeAt(f),n=e.charCodeAt(f+1),r=e.charCodeAt(f+2),i=e.charCodeAt(f+3),a=l[t]<<18|l[n]<<12|l[r]<<6|l[i];if(a<0)throw SyntaxError(M);u[d]=a>>16,u[d+1]=a>>8&255,u[d+2]=a&255,d+=3}if(a<2)return u;let p=l[e.charCodeAt(f++)]<<6|l[e.charCodeAt(f++)];if(p<0)throw SyntaxError(M);if(u[d++]=p>>4,a<3){if(p&15)throw SyntaxError(F);return u}let m=l[e.charCodeAt(f++)];if(m<0)throw SyntaxError(M);if(u[d++]=p<<4&255|m>>2,m&3)throw SyntaxError(F);return u}var{Buffer:R,atob:z,btoa:B}=globalThis,V=R&&!R.TYPED_ARRAY_SUPPORT,{toBase64:H}=Uint8Array.prototype,{E_CHAR:U,E_PADDING:W,E_LENGTH:ce,E_LAST:le}=D,ue=B&&n,de=z&&n,fe=e=>e.constructor===R&&R.isBuffer(e),pe=e=>fe(e)?e:R.from(e.buffer,e.byteOffset,e.byteLength);function G(e,t){if(t)return e;let n=e.indexOf(`=`,e.length-3);return n===-1?e:e.slice(0,n)}function K(e,t){return t&&e.length%4!=0?e+`=`.repeat(4-e.length%4):e}var me=e=>H&&e.toBase64===H;function q(e,{padding:t=!0}={}){return c(e),me(e)?t?e.toBase64():e.toBase64({omitPadding:!t}):V?G(pe(e).base64Slice(0,e.byteLength),t):ue?G(B(_(e)),t):I(e,!1,t)}function he(e,t){if(typeof t==`string`&&(t={format:t}),!t)return J(e,!1,`both`,`uint8`,null);let{format:n=`uint8`,padding:r=`both`,...i}=t;return J(e,!1,r,n,i)}function J(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(l);i!==null&&E(i);let a=n===`both`?e.endsWith(`=`):void 0;if(n===!0||a===!0){if(e.length%4!=0||e[e.length-3]===`=`)throw SyntaxError(W)}else if(n===!1||a===!1){if(e.length%4==1)throw SyntaxError(ce);if(n===!1&&e.endsWith(`=`))throw SyntaxError(`Did not expect padding in base64 input`)}else throw TypeError(`Invalid padding option`);return _e(e,t,n,r)}var ge=/[\t\n\f\r ]/;function Y(e,t){let n=e.indexOf(`=`,e.length-3),r=n>=0?e.length-n:0,i=e.length-r,a=i%4,o=t.length-(i-a)/4*3;return a===0&&o===0||a===2&&o===1||a===3&&o===2}var _e=Uint8Array.fromBase64?(e,t,n,r)=>{let i=t?`base64url`:`base64`,a;if(n===!0)a=Uint8Array.fromBase64(e,{alphabet:i,lastChunkHandling:`strict`});else try{let t=e.length%4>0?`${e}${`=`.repeat(4-e.length%4)}`:e;a=Uint8Array.fromBase64(t,{alphabet:i,lastChunkHandling:`strict`})}catch(t){throw ge.test(e)?SyntaxError(U):t}if(!Y(e,a))throw SyntaxError(U);return u(a,r)}:V?(e,t,n,r)=>{let i=R.byteLength(e,`base64`),a=R.allocUnsafeSlow(i);if(a.base64Write(e)!==i)throw SyntaxError(W);let o=t?a.base64urlSlice(0,a.length):a.base64Slice(0,a.length);if(e!==o&&(n===!t||K(e,!0)!==K(o,t)))throw SyntaxError(W);return d(a,r)}:de?(e,t,n,r)=>{let i;if(t){if(/[\t\n\f\r +/]/.test(e))throw SyntaxError(U);e=e.replaceAll(`-`,`+`).replaceAll(`_`,`/`)}try{i=ee(z(e))}catch{throw SyntaxError(U)}if(!t&&!Y(e,i))throw SyntaxError(U);if(i.length%3!=0&&q(i.subarray(-(i.length%3)))!==(e.length%4==0?e.slice(-4):e.slice(-(e.length%4)).padEnd(4,`=`)))throw SyntaxError(le);return u(i,r)}:(e,t,n,r)=>u(L(e,t),r),X=[{},{},{}],Z=[[...`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`],[...`0123456789ABCDEFGHIJKLMNOPQRSTUV`],[...`0123456789ABCDEFGHJKMNPQRSTVWXYZ`]],Q=`Invalid character in base32 input`,ve=`Invalid base32 padding`,ye=`Invalid base32 length`,$=`Invalid last chunk`,be=n;function xe(e,t,n){c(e);let r=Math.floor(e.length/5),i=r*5,o=``,s=0,l=Z[t],u=X[t];if(!u.pairs){if(u.pairs=[],a){u.codepairs=new Uint16Array(1024);let e=u.codepairs,t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(let e=0;e<32;e++){let n=l[e].charCodeAt(0);for(let r=0;r<32;r++)t[e<<6|r<<1]=t[r<<6|(e<<1)+1]=n}}else{let e=u.pairs;for(let t=0;t<32;t++)for(let n=0;n<32;n++)e.push(`${l[t]}${l[n]}`)}}let{pairs:d,codepairs:f}=u;if(a){let t=new Uint16Array(r*4);for(let n=0;s<i;s+=5){let r=e[s],i=e[s+1],a=e[s+2],o=e[s+3],c=e[s+4],l=r<<2|i>>6,u=(i&63)<<4|a>>4,d=(a&15)<<6|o>>2,p=(o&3)<<8|c;t[n]=f[l],t[n+1]=f[u],t[n+2]=f[d],t[n+3]=f[p],n+=4}o=v(t)}else if(be)for(;s<i;s+=5){let t=e[s],n=e[s+1],r=e[s+2],i=e[s+3],a=e[s+4],c=t<<2|n>>6,l=(n&63)<<4|r>>4,u=(r&15)<<6|i>>2,f=(i&3)<<8|a;o+=`${d[c]}${d[l]}${d[u]}${d[f]}`}else for(;s<i;s+=5){let t=e[s],n=e[s+1],r=e[s+2],i=e[s+3],a=e[s+4],c=t<<2|n>>6,l=(n&63)<<4|r>>4,u=(r&15)<<6|i>>2,f=(i&3)<<8|a;o+=d[c],o+=d[l],o+=d[u],o+=d[f]}let p=0,m=3;for(;s<e.length;s++){let t=e[s];o+=l[p|t>>m],m>=5&&(m-=5,o+=l[t>>m&31]),p=t<<5-m&31,m+=3}return m!==3&&(o+=l[p]),n&&(o+=[``,`======`,`====`,`===`,`=`][e.length-i]),o}var Se=i?128:65536;function Ce(e,t){let n=e.length;for(;e[n-1]===`=`;)n--;let r=e.length-n,a=n%8,o=n-a;if(![0,2,4,5,7].includes(a))throw SyntaxError(ye);if(r>7||r!==0&&e.length%8!=0)throw SyntaxError(ve);let s=Z[t],c=X[t];if(!c.fromMap){c.fromMap=new Int8Array(Se).fill(-1);let e=c.fromMap;s.forEach((t,n)=>{e[t.charCodeAt(0)]=e[t.toLowerCase().charCodeAt(0)]=n}),t===2&&(e[73]=e[76]=e[105]=e[108]=e[49],e[79]=e[111]=e[48])}let l=c.fromMap,u=new Uint8Array(Math.floor(n*5/8)),d=0,f=0;if(i){let t=y(e,Q);for(;f<o;f+=8){let e=t[f],n=t[f+1],r=t[f+2],i=t[f+3],a=t[f+4],o=t[f+5],s=t[f+6],c=t[f+7],p=l[e]<<15|l[n]<<10|l[r]<<5|l[i],m=l[a]<<15|l[o]<<10|l[s]<<5|l[c];if(p<0||m<0)throw SyntaxError(Q);u[d]=p>>12,u[d+1]=p>>4&255,u[d+2]=p<<4&255|m>>16,u[d+3]=m>>8&255,u[d+4]=m&255,d+=5}}else for(;f<o;f+=8){let t=e.charCodeAt(f),n=e.charCodeAt(f+1),r=e.charCodeAt(f+2),i=e.charCodeAt(f+3),a=e.charCodeAt(f+4),o=e.charCodeAt(f+5),s=e.charCodeAt(f+6),c=e.charCodeAt(f+7),p=l[t]<<15|l[n]<<10|l[r]<<5|l[i],m=l[a]<<15|l[o]<<10|l[s]<<5|l[c];if(p<0||m<0)throw SyntaxError(Q);u[d]=p>>12,u[d+1]=p>>4&255,u[d+2]=p<<4&255|m>>16,u[d+3]=m>>8&255,u[d+4]=m&255,d+=5}if(a<2)return u;let p=l[e.charCodeAt(f++)]<<5|l[e.charCodeAt(f++)];if(p<0)throw SyntaxError(Q);if(u[d++]=p>>2,a<4){if(p&3)throw SyntaxError($);return u}let m=l[e.charCodeAt(f++)]<<5|l[e.charCodeAt(f++)];if(m<0)throw SyntaxError(Q);if(u[d++]=p<<6&255|m>>4,a<5){if(m&15)throw SyntaxError($);return u}let h=l[e.charCodeAt(f++)];if(h<0)throw SyntaxError(Q);if(u[d++]=m<<4&255|h>>1,a<7){if(h&1)throw SyntaxError($);return u}let g=l[e.charCodeAt(f++)]<<5|l[e.charCodeAt(f++)];if(g<0)throw SyntaxError(Q);if(u[d++]=h<<7&255|g>>3,g&7)throw SyntaxError($);return u}function we(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(l);if(i!==null&&E(i),n===!0){if(e.length%8!=0)throw SyntaxError(ve)}else if(n===!1){if(e.endsWith(`=`))throw SyntaxError(`Did not expect padding in base32 input`)}else if(n!==`both`)throw TypeError(`Invalid padding option`);return u(Ce(e,t),r)}var Te=(e=>(t,n)=>{if(!n)return we(t,e,`both`,`uint8`,null);let{format:r=`uint8`,padding:i=`both`,...a}=n;return we(t,e,i,r,a)})(0),Ee=(e,{padding:t=!1}={})=>xe(e,0,t);export{q as a,he as b,ae as c,oe as d,Te as e,Ee as f};
@@ -0,0 +1,10 @@
1
+ import{b as e}from"./chunk-OKRLLE5I.js";import{b as t,c as n}from"./chunk-C4Z6ZBXV.js";import{g as r}from"./chunk-2XUEZHIP.js";function i(e){return!Number.isFinite(e)||e<0?`—`:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KiB`:e<1073741824?`${(e/1048576).toFixed(1)} MiB`:`${(e/1073741824).toFixed(1)} GiB`}function a(e){return Array.isArray(e)?e.reduce((e,t)=>({bytes:e.bytes!=null&&Number.isFinite(t.bytes)?e.bytes+t.bytes:null,lines:e.lines!=null&&Number.isFinite(t.lines)?e.lines+t.lines:null}),{bytes:0,lines:0}):{bytes:null,lines:null}}function o(e,t,n){if(Array.isArray(e?.files))return{files:t.length,lines:a(t).lines,packages:new Set(t.map(e=>e.module)).size};let r=e=>Number.isSafeInteger(e)&&e>=0?e:null,i=e?.summary;return{files:r(i?.[n===`code`?`codeFiles`:`files`]),lines:r(i?.lines),packages:null}}function s(e){return(e??[]).filter(e=>![`resource:base64`,`directory`].includes(e.format))}var c=t(class extends n{constructor(){super(...arguments),this.key=r}render(e,t){return this.key=e,t}update(t,[n,r]){return n!==this.key&&(e(t),this.key=n),r}});export{i as a,a as b,o as c,s as d,c as e};
2
+ /*! Bundled license information:
3
+
4
+ lit-html/directives/keyed.js:
5
+ (**
6
+ * @license
7
+ * Copyright 2021 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ *)
10
+ */
@@ -0,0 +1,17 @@
1
+ import{f as e,g as t,j as n,k as r,l as i,m as a}from"./chunk-PXK7EU4V.js";var o=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: ?(.*?))?\n?$/u,s=/^\*{15,}(?: (.*?))?\n?$/u,c=/^\*{3} (\d+)(?:,(\d+))? \*{4}\n?$/u,l=/^--- (\d+)(?:,(\d+))? ----\n?$/u,u=/^(\d+)(?:,(\d+))?([acd])(\d+)(?:,(\d+))?[ \t]*\r?\n?$/u,d=t,f=t?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):null,{isWellFormed:p}=String.prototype;function m(e,t,n){if(t||e.length===n.length)return n;if(p){if(p.call(e))return n;throw TypeError(i)}let r=0,a=n.length-3;for(;r<=a;){let t=n.indexOf(239,r);if(t===-1||t>a)break;if(r=t+1,n[t+1]===191&&n[t+2]===189){if(e===g(n))return n;throw TypeError(i)}}return n}function h(t,n=!1){if(typeof t!=`string`)throw TypeError(r);return t.length===0?new Uint8Array:m(t,n,e.encode(t))}function g(e,t=!1){return n(e),e.byteLength===0?``:t?d.decode(e):f.decode(e)}var _=(e,t=`uint8`)=>a(h(e,!1),t),v=(e,t=`uint8`)=>a(h(e,!0),t),y=e=>g(e,!1),b=e=>g(e,!0),x=/[ \t\n\v\f\r]/gu,ee=/[ \t\n\v\f\r]+/gu,S=/[ \t\n\v\f\r]+$/u,C=e=>e.replace(/[A-Z]/gu,e=>e.toLowerCase());function w({ignoreCase:e=!1,whitespace:t=`none`}={}){let n=null;return t===`all`?n=e=>e.replace(x,``):t===`change`?n=e=>e.replace(S,``).replace(ee,` `):t===`trailing`&&(n=e=>e.replace(S,``)),e?n?e=>C(n(e)):C:n}function T(e){let t=[];for(let n=0;n<e.length;){let r=e.indexOf(`
2
+ `,n),i=r<0?e.length:r+1;t.push(e.slice(n,i)),n=i}return t}var E=class extends Error{constructor(e,t){super(t===void 0?e:`${e} at line ${t+1}`),this.name=`PatchError`,this.line=t}},D=(e,t)=>t===0?Number(e):Number(e)-1,O=e=>e!==void 0&&e.startsWith(`\\`),k=e=>e.replace(/\n$/u,``);function te(e){let t=T(e),n=[],r={old:null,new:null},i=!1;for(let e=0;e<t.length;){let a=t[e],c=A(a,i);if(i=!a.startsWith(`***************`)&&a.startsWith(`*** `),c){r=c.names??{...r,[c.slot]:c.name},e++;continue}let l=o.test(a)?`unified`:s.test(a)?`context`:u.test(a)?`normal`:null;if(l===null){e++;continue}let d=[],f=ae[l];for(let n=f(t,e);n!==null&&(d.push(n.hunk),e=n.next,!(e>=t.length||A(t[e],!1)));n=f(t,e));n.push({old:r.old,new:r.new,format:l,hunks:d,blocks:ne(d)}),r={old:null,new:null}}return n}function A(e,t){let n=/^diff --git (\S+) (\S+)\n?$/u.exec(e);if(n)return{names:{old:n[1],new:n[2]}};if(c.test(e)||l.test(e))return null;let r=/^(\*\*\* |--- |\+\+\+ )(.*?)(?:\t.*)?\n?$/u.exec(e);return r?r[1]===`--- `?{slot:t?`new`:`old`,name:r[2]}:{slot:r[1]===`*** `?`old`:`new`,name:r[2]}:null}function ne(e){let t=[];for(let n of e){let e=n.oldStart,r=n.newStart,i=null,a=()=>{i&&=(t.push(i),e=i.a1,r=i.b1,null)};for(let{tag:t,text:o}of n.lines){if(t===` `){a(),e++,r++;continue}t===`-`&&i?.insert.length&&a(),i??={a0:e,a1:e,b0:r,b1:r,remove:[],insert:[]},t===`-`?(i.a1++,i.remove.push(o)):(i.b1++,i.insert.push(o))}a()}return t}function re(e,t){let n=o.exec(e[t]??``);if(!n)return null;let r=n[2]===void 0?1:Number(n[2]),i=n[4]===void 0?1:Number(n[4]),a={oldStart:D(n[1],r),newStart:D(n[3],i),label:n[5]||null,lines:[]},s=0,c=t+1,l=0;for(;l<r||s<i;c++){let t=e[c];if(t===void 0)throw new E(`the patch ends inside a hunk`,c);let n=t===`
3
+ `?` `:t[0];if(n!==` `&&n!==`-`&&n!==`+`)throw new E(`a hunk line begins with ${JSON.stringify(n)}`,c);let o=t===`
4
+ `?t:t.slice(1);if(O(e[c+1])&&(o=k(o),c++),n!==`+`&&l++,n!==`-`&&s++,l>r||s>i)throw new E(`a hunk has more lines than its header says`,c);a.lines.push({tag:n,text:o})}return{hunk:a,next:c}}function j(e,t){let n=u.exec(e[t]??``);if(!n)return null;let[,r,i,a,o,s]=n,c=a===`a`?0:Number(i??r)-Number(r)+1,l=a===`d`?0:Number(s??o)-Number(o)+1;if(c<0||l<0)throw new E(`a change command counts backwards`,t);let d={oldStart:a===`a`?Number(r):Number(r)-1,newStart:a===`d`?Number(o):Number(o)-1,label:null,lines:[]},f=t+1,p=(t,n,r)=>{for(let i=0;i<t;i++,f++){let t=e[f];if(t===void 0)throw new E(`the patch ends inside a hunk`,f);if(t[0]!==n)throw new E(`${JSON.stringify(n)} expected`,f);let i=t.slice(2);O(e[f+1])&&(i=k(i),f++),d.lines.push({tag:r,text:i})}};if(p(c,`<`,`-`),a===`c`){if(e[f]!==`---
5
+ `)throw new E(`'---' expected`,f);f++}return p(l,`>`,`+`),{hunk:d,next:f}}function ie(e,t){let n=s.exec(e[t]??``);if(!n)return null;let r=c.exec(e[t+1]??``);if(!r)throw new E(`'*** ' range expected`,t+1);let i=t+2,a=M(e,i,l,`-`);i=a.next;let o=l.exec(e[i]??``);if(!o)throw new E(`'--- ' range expected`,i);let u=M(e,i+1,null,`+`),d=a.lines.length===0?u.lines.filter(e=>e.tag===` `):a.lines,f=u.lines.length===0?a.lines.filter(e=>e.tag===` `):u.lines;return{hunk:{oldStart:D(r[1],d.length),newStart:D(o[1],f.length),label:n[1]||null,lines:N(d,f)},next:u.next}}function M(e,t,n,r){let i=[],a=t;for(;a<e.length;a++){let t=e[a];if(n&&n.test(t)||s.test(t)||c.test(t)||!n&&l.test(t))break;if(O(t)){i[i.length-1].text=k(i.at(-1).text);continue}let o=t===`
6
+ `?` `:t[0];if(o!==` `&&o!==`!`&&o!==`-`&&o!==`+`)break;i.push({tag:o===` `?` `:r,text:t===`
7
+ `?t:t.slice(2)})}return{lines:i,next:a}}function N(e,t){let n=[],r=0,i=0;for(;r<e.length||i<t.length;){if(e[r]?.tag===` `&&t[i]?.tag===` `){n.push(e[r]),r++,i++;continue}for(;r<e.length&&e[r].tag!==` `;)n.push(e[r]),r++;for(;i<t.length&&t[i].tag!==` `;)n.push(t[i]),i++;e[r]?.tag===` `&&t[i]===void 0?(n.push(e[r]),r++):t[i]?.tag===` `&&e[r]===void 0&&(n.push(t[i]),i++)}return n}var ae={unified:re,context:ie,normal:j},P=class extends Error{constructor(e){super(`the rendered diff does not say what the change set says (${e})`),this.name=`FormatError`}};function F(e,t,n,r){if(n.length===0){if(r!==``)throw new P(`there was nothing to print, and something was printed`);return}let i;try{i=te(r)}catch(e){throw new P(`it does not read back (${e.message})`)}if(i.length!==1)throw new P(`${i.length} files read back, not one`);let a=i[0].blocks;if(a.length!==n.length)throw new P(`${a.length} blocks read back, not ${n.length}`);for(let[e,t]of a.entries()){let r=n[e];if(t.a0!==r.a0||t.a1!==r.a1||t.b0!==r.b0||t.b1!==r.b1)throw new P(`block ${e+1} reads back somewhere else`)}for(let n of i[0].hunks){let r=i[0].format===`context`&&!n.lines.some(({tag:e})=>e===`-`),a=n.oldStart,o=n.newStart;for(let{tag:i,text:s}of n.lines){if(s!==(i===`+`||i===` `&&r?t[o]:e[a]))throw new P(`a ${i===`+`?`added`:i===`-`?`removed`:`kept`} line is not the line it stands for`);i!==`+`&&a++,i!==`-`&&o++}}}function oe(e,t,n,r){let i=[],a=0;for(;a<e.length;){let o=a;for(;o+1<e.length&&e[o+1].a0-e[o].a1<=2*t;)o++;let s=e[a],c=e[o];i.push({blocks:e.slice(a,o+1),a0:Math.max(0,s.a0-t),a1:Math.min(n,c.a1+t),b0:Math.max(0,s.b0-t),b1:Math.min(r,c.b1+t)}),a=o+1}return i}var I=e=>(t,n,r,{context:i,label:a=null})=>{let o=``;for(let s of oe(r,i,t.length,n.length))o+=e(t,n,s,a?a(s.a0):null);return F(t,n,r,o),o},se=`
8
+ \
9
+ `,L=(e,t)=>e+t+(t.endsWith(`
10
+ `)?``:se);function R(e,t){return t>e+1?`${e+1},${t}`:`${t>e?e+1:e}`}function ce(e,t,n){let r=``;for(let{a0:i,a1:a,b0:o,b1:s}of n){let n=i===a?`a`:o===s?`d`:`c`;r+=R(i,a)+n+R(o,s)+`
11
+ `;for(let t=i;t<a;t++)r+=L(`< `,e[t]);n===`c`&&(r+=`---
12
+ `);for(let e=o;e<s;e++)r+=L(`> `,t[e])}return F(e,t,n,r),r}function z(e,t){return t<=e?`${e},0`:t===e+1?`${e+1}`:`${e+1},${t-e}`}var le=I((e,t,n,r)=>{let i=`@@ -${z(n.a0,n.a1)} +${z(n.b0,n.b1)} @@${r===null?``:` `+r}
13
+ `,a=n.a0,o=n.b0;for(let{a0:r,a1:s,b1:c}of n.blocks){for(;a<r;a++,o++)i+=L(` `,e[a]);for(;a<s;a++)i+=L(`-`,e[a]);for(;o<c;o++)i+=L(`+`,t[o])}for(;a<n.a1;a++,o++)i+=L(` `,e[a]);return i});function B(e,t){return t<=e?`${e}`:t===e+1?`${e+1}`:`${e+1},${t}`}var V=I((e,t,n,r)=>{let i=`***************${r===null?``:` `+r}
14
+ `;return i+=`*** ${B(n.a0,n.a1)} ****
15
+ `,n.blocks.some(e=>e.a0<e.a1)&&(i+=H(e,n.a0,n.a1,n.blocks,`a`)),i+=`--- ${B(n.b0,n.b1)} ----
16
+ `,n.blocks.some(e=>e.b0<e.b1)&&(i+=H(t,n.b0,n.b1,n.blocks,`b`)),i});function H(e,t,n,r,i){let a=i+`1`,o=i+`0`,s=i===`a`?`b`:`a`,c=``,l=t;for(let t of r){for(;l<t[o];l++)c+=L(` `,e[l]);let n=t[s+`0`]<t[s+`1`]?`! `:i===`a`?`- `:`+ `;for(;l<t[a];l++)c+=L(n,e[l])}for(;l<n;l++)c+=L(` `,e[l]);return c}function U(e){let t=[];for(let n=0;;){let r=n;for(;n<e.length&&e[n];)n++;if(t.push(n>r),n===e.length)return t;n++}}function W(e,t,n){let r=t.length,i=U(n),a=0,o=0,s=0,c=()=>{if(a===r||e[s]!==e[a])return!1;for(t[s++]=0,t[a++]=1,o++;a<r&&t[a];)a++;return!0},l=()=>{if(s===0||e[s-1]!==e[a-1])return!1;for(t[--s]=1,t[--a]=0,o--;s>0&&t[s-1];)s--;return!0};for(let e=0;e<r;e++){if(!t[e]){o++;continue}for(s=e,a=e;a<r&&t[a];a++);let n=-1;for(let e=-1;e!==a-s;){for(e=a-s;l(););for(n=i[o]?a:-1;c();)i[o]&&(n=a)}if(n!==-1)for(let e=a-n;e>0;e--)l();e=a-1}}function ue(e){let t=1;for(let n=e;n!==0;n>>=2)t<<=1;return Math.max(256,t)}function G(e,t,{ignoreCase:n=!1,whitespace:r=`none`,minimal:i=!1,discard:a=!0,slide:o=!0,horizon:s=1/0}={}){let c=w({ignoreCase:n,whitespace:r});if(c===null&&J(e,t,null))return[];let{A:l,B:u,classes:d}=pe(e,t,c),f=new Uint8Array(l.length),p=new Uint8Array(u.length),m=de(e,t,s),[h,g]=i||!a?[null,null]:fe(l,u,d,m),_=q(m.lo,m.hiA,h,f),v=q(m.lo,m.hiB,g,p),y=new Uint8Array(_.length),b=new Uint8Array(v.length);me(_.map(e=>l[e]),v.map(e=>u[e]),y,b,i);for(let e=0;e<_.length;e++)y[e]&&(f[_[e]]=1);for(let e=0;e<v.length;e++)b[e]&&(p[v[e]]=1);if(o){let{lo:e,hiA:t,hiB:n}=m;W(l.subarray(e,t),f.subarray(e,t),p.subarray(e,n)),W(u.subarray(e,n),p.subarray(e,n),f.subarray(e,t))}let x=_e(f,p);return Y(e,t,x,c),x}function de(e,t,n){let r=Math.min(e.length,t.length),i=0;for(;i<r&&e[i]===t[i];)i++;let a=Math.max(0,i-n),o=0;for(;o<r-a&&e[e.length-1-o]===t[t.length-1-o];)o++;let s=Math.max(0,o-n);return{lo:a,hiA:e.length-s,hiB:t.length-s}}function fe(e,t,n,{lo:r,hiA:i,hiB:a}){let o=new Int32Array(n),s=new Int32Array(n);for(let t=r;t<i;t++)o[e[t]]++;for(let e=r;e<a;e++)s[t[e]]++;return[K(e.subarray(r,i),s),K(t.subarray(r,a),o)]}function K(e,t){let n=e.length,r=new Uint8Array(n),i=5;for(let e=Math.floor(n/64)>>2;e>0;e>>=2)i*=2;for(let a=0;a<n;a++){let n=t[e[a]];n===0?r[a]=1:n>i&&(r[a]=2)}for(let e=0;e<n;e++){if(r[e]===2){r[e]=0;continue}if(r[e]===0)continue;let t=e,i=0;for(;t<n&&r[t]!==0;t++)r[t]===2&&i++;for(;t>e&&r[t-1]===2;)r[--t]=0,i--;let a=t-e;if(i*4>a){for(;t>e;)r[--t]===2&&(r[t]=0);continue}let o=1;for(let e=a>>4;e>0;e>>=2)o<<=1;o++;for(let t=0,n=0;n<a;n++)r[e+n]===2?o===++t?n-=t:o<t&&(r[e+n]=0):t=0;for(let t=0,n=0;n<a&&!(n>=8&&r[e+n]===1||(r[e+n]===2?(t=0,r[e+n]=0):r[e+n]===0?t=0:t++,t===3));n++);e+=a-1;for(let t=0,n=0;n<a&&!(n>=8&&r[e-n]===1||(r[e-n]===2?(t=0,r[e-n]=0):r[e-n]===0?t=0:t++,t===3));n++);}return r}function q(e,t,n,r){let i=[];for(let a=e;a<t;a++)n!==null&&n[a-e]!==0?r[a]=1:i.push(a);return Int32Array.from(i)}function J(e,t,n=null){if(e.length!==t.length)return!1;let r=n?(e,t)=>n(e)===n(t):(e,t)=>e===t;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1;return!0}function pe(e,t,n){let r=new Map,i=e=>{let t=n?n(e):e,i=r.get(t);return i===void 0&&(i=r.size,r.set(t,i)),i};return{A:Int32Array.from(e,i),B:Int32Array.from(t,i),classes:r.size}}function me(e,t,n,r,i){let a=e.length+t.length+3,o={A:e,B:t,fd:new Int32Array(a),bd:new Int32Array(a),base:t.length+1,limit:ue(e.length+t.length)},s=[{xoff:0,xlim:e.length,yoff:0,ylim:t.length,minimal:i}],c={xmid:0,ymid:0,loMinimal:!1,hiMinimal:!1};for(;s.length;){let{xoff:i,xlim:a,yoff:l,ylim:u,minimal:d}=s.pop();for(;i<a&&l<u&&e[i]===t[l];)i++,l++;for(;i<a&&l<u&&e[a-1]===t[u-1];)a--,u--;if(i===a){for(;l<u;l++)r[l]=1;continue}if(l===u){for(;i<a;i++)n[i]=1;continue}he(o,i,a,l,u,d,c),s.push({xoff:c.xmid,xlim:a,yoff:c.ymid,ylim:u,minimal:c.hiMinimal}),s.push({xoff:i,xlim:c.xmid,yoff:l,ylim:c.ymid,minimal:c.loMinimal})}}function he(e,t,n,r,i,a,o){let{A:s,B:c,fd:l,bd:u,base:d,limit:f}=e,p=n-r,m=t-i,h=n-i,g=t-r,_=h,v=h,y=g,b=g,x=!!(g-h&1);l[d+g]=t,u[d+h]=n;for(let h=1;;h++){b>m?l[d+--b-1]=-1:++b,y<p?l[d+ ++y+1]=-1:--y;for(let e=y;e>=b;e-=2){let t=l[d+e+1],r=l[d+e-1],a=r<t?t:r+1,f=a-e;for(;a<n&&f<i&&s[a]===c[f];)a++,f++;if(l[d+e]=a,x&&v<=e&&e<=_&&u[d+e]<=a){o.xmid=a,o.ymid=f,o.loMinimal=o.hiMinimal=!0;return}}v>m?u[d+--v-1]=2147483647:++v,_<p?u[d+ ++_+1]=2147483647:--_;for(let e=_;e>=v;e-=2){let n=u[d+e+1],i=u[d+e-1],a=i<n?i:n-1,f=a-e;for(;t<a&&r<f&&s[a-1]===c[f-1];)a--,f--;if(u[d+e]=a,!x&&b<=e&&e<=y&&a<=l[d+e]){o.xmid=a,o.ymid=f,o.loMinimal=o.hiMinimal=!0;return}}if(!(a||h<f)){ge(e,{xoff:t,xlim:n,yoff:r,ylim:i,fmin:b,fmax:y,bmin:v,bmax:_},o);return}}}function ge(e,t,n){let{fd:r,bd:i,base:a}=e,{xoff:o,xlim:s,yoff:c,ylim:l,fmin:u,fmax:d,bmin:f,bmax:p}=t,m=0,h=-1;for(let e=d;e>=u;e-=2){let t=Math.min(r[a+e],s),n=t-e;l<n&&(t=l+e,n=l),h<t+n&&(h=t+n,m=t)}let g=0,_=2147483647;for(let e=p;e>=f;e-=2){let t=Math.max(o,i[a+e]),n=t-e;n<c&&(t=c+e,n=c),t+n<_&&(_=t+n,g=t)}s+l-_<h-(o+c)?(n.xmid=m,n.ymid=h-m,n.loMinimal=!0,n.hiMinimal=!1):(n.xmid=g,n.ymid=_-g,n.loMinimal=!1,n.hiMinimal=!0)}function _e(e,t){let n=[],r=t.length,i=e.length,a=0,o=0;for(;a<i||o<r;){if(a<i&&o<r&&!e[a]&&!t[o]){a++,o++;continue}let s=a,c=o;for(;a<i&&e[a];)a++;for(;o<r&&t[o];)o++;if(s===a&&c===o)throw new X(`a kept line has no counterpart`);n.push({a0:s,a1:a,b0:c,b1:o})}return n}function Y(e,t,n,r=null){let i=r?(e,t)=>r(e)===r(t):(e,t)=>e===t,a=0,o=0;for(let{a0:r,a1:s,b0:c,b1:l}of n){if(r<a||c<o||s<r||l<c||s>e.length||l>t.length)throw new X(`a block is out of order or out of range`);if(r===s&&c===l)throw new X(`a block changes nothing`);if(r-a!==c-o)throw new X(`the kept lines before a block differ in count`);for(;a<r;a++,o++)if(!i(e[a],t[o]))throw new X(`kept line ${a+1} does not match`);a=s,o=l}if(e.length-a!==t.length-o)throw new X(`the kept lines after the last block differ in count`);for(;a<e.length;a++,o++)if(!i(e[a],t[o]))throw new X(`kept line ${a+1} does not match`)}var X=class extends Error{constructor(e){super(`the computed change set does not reconstruct the second file (${e})`),this.name=`DiffError`}},Z={unified:le,context:V,normal:ce},Q=`Files differ
17
+ `;function ve(e,t,n){if(e===t)return``;let r=w(n);return r===null?Q:J(T(e),T(t),r)?``:Q}function $(e,t){if(!(Number.isInteger(e)&&e>=0)&&e!==1/0)throw RangeError(`${t} is a number of lines, not ${e}`);return e}function ye(e,t,{slide:n=!0,horizon:r=3,...i}={}){let a=T(e),o=T(t);return G(a,o,{...i,slide:n,horizon:$(r,`horizon`)}).map(({a0:e,a1:t,b0:n,b1:r})=>({a0:e,a1:t,b0:n,b1:r,remove:a.slice(e,t),insert:o.slice(n,r)}))}function be(e,t,n,{format:r=`unified`,context:i=3,label:a=null,...o}={}){if(!Object.hasOwn(Z,r))throw RangeError(`a change set prints as unified, context or normal, not ${r}`);let s=T(e),c=T(t);return Y(s,c,n,w(o)),n.length===0?``:Z[r](s,c,n,{context:i,label:a})}function xe(e,t,{format:n=`unified`,context:r=3,label:i=null,...a}={}){if(n===`brief`)return ve(e,t,a);let o=T(e),s=T(t),{slide:c=!0,horizon:l=0,...u}=a,d=$(l,`horizon`),f=G(o,s,{...u,slide:c,horizon:n===`normal`?d:Math.max(d,$(r,`context`))});return f.length===0?``:Z[n](o,s,f,{context:r,label:i})}export{o as a,s as b,u as c,P as d,X as e,ye as f,be as g,xe as h,_ as i,v as j,y as k,b as l};
@@ -0,0 +1 @@
1
+ import{z as e}from"./chunk-S6GIXWQW.js";import{m as t,p as n,u as r}from"./chunk-JKGQ3O7O.js";import{a as i}from"./chunk-3PS4KWD2.js";import{b as a}from"./chunk-IYPY47MC.js";import{D as o,J as s,L as c,q as l}from"./chunk-SXV2T5C4.js";function u(e){let{data:t}=c(e);return t&&d(t)>0?t:null}function d(e){return(s(e)??[]).filter(t=>(Array.isArray(t)?t:[t]).some(t=>t&&typeof t==`object`&&l(t,t.source??e.source))).length}function f(e,t){let n=[],r=new Map;for(let{name:t,content:i,fallbackRepo:a}of e){if(typeof i!=`string`)continue;let e=u(i);if(!e)continue;let c=s(e),l=o(e)??o({repo:{github:a}}),f=new Set(l?[l]:[]);if(!l)for(let e of c.flat()){if(/(?:^|\/)(?:node_modules|dependencies)\//u.test(e?.file??``))continue;let t=o(e);t&&f.add(t)}for(let e of f)r.set(e,{id:e,label:e});n.push({id:t,filename:t,repoIds:[...f],analyzer:e.source,appFindings:d(e)})}let i=new Set(n.map(e=>e.id));return{merge:{bundles:[],results:[]},link:{reports:n,repositories:[...r.values()],workspaces:t.map(e=>({id:e.id,label:e.name,reports:e.reports.filter(e=>i.has(e))})).filter(e=>e.reports.length>0)}}}function p(e,t){let n=(e.reports??[]).filter(e=>e.visible&&e.repoId!=null).flatMap(e=>{let t=u(e.content??``);return t?[{id:e.id,filename:e.filename,repoIds:[e.repoId],repo:e.repoFullName,directory:e.repoDirectory,analyzer:e.analyzer,appFindings:d(t)}]:[]}),r=new Map((e.repos??[]).map(e=>[e.repoId,{id:e.repoId,label:e.fullName}]));for(let e of n)r.has(e.repoIds[0])||r.set(e.repoIds[0],{id:e.repoIds[0],label:e.repo??String(e.repoIds[0])});let a=t.results??[],o=new Set(a.map(e=>e.bundleId));return{merge:{bundles:(t.bundles??[]).filter(e=>o.has(e.id)).map(e=>({...e,size:i(e.byteSize)})),results:a},link:{repositories:[...r.values()].filter(e=>n.some(t=>t.repoIds.includes(e.id))),reports:n}}}var m=new Map([[`openai/gpt-6-astra`,`GPT-6 Astra`],[`openai/gpt-6-astra-pro`,`GPT-6 Astra Pro`],[`openai/gpt-5.6-sol`,`GPT-5.6 Sol`],[`openai/gpt-5.6-terra`,`GPT-5.6 Terra`],[`openai/gpt-5.6-luna`,`GPT-5.6 Luna`],[`anthropic/claude-fable-5.1`,`Claude Fable 5.1`],[`anthropic/claude-opus-5`,`Claude Opus 5`],[`anthropic/claude-sonnet-5`,`Claude Sonnet 5`],[`moonshotai/kimi-k3`,`Kimi K3`],[`z-ai/glm-5.3`,`GLM 5.3`],[`qwen/qwen3.8-max`,`Qwen3.8 Max`],[`deepseek/deepseek-v4.1-flash`,`DeepSeek V4.1 Flash`],[`deepseek/deepseek-v4-pro`,`DeepSeek V4 Pro`]]),h=new Map([[`openai`,`OpenAI`],[`anthropic`,`Anthropic`],[`moonshotai`,`Moonshot AI`],[`google`,`Google`],[`nvidia`,`NVIDIA`],[`qwen`,`Qwen`],[`deepseek`,`DeepSeek`],[`x-ai`,`xAI`],[`z-ai`,`Z.ai`],[`mistralai`,`Mistral AI`],[`meta`,`Meta`],[`unbiased`,`Unbiased`]]),g=new Map([[`meta-llama`,`meta`]]),_=new Map([[`gpt`,`GPT`],[`gptoss`,`GPT OSS`],[`oss`,`OSS`],[`o`,`O`],[`ai`,`AI`],[`api`,`API`],[`4o`,`4o`],[`k3`,`K3`],[`k4`,`K4`],[`qwen`,`Qwen`],[`kimi`,`Kimi`],[`mimo`,`MiMo`],[`gemini`,`Gemini`],[`claude`,`Claude`],[`fable`,`Fable`],[`opus`,`Opus`],[`sonnet`,`Sonnet`],[`astra`,`Astra`],[`terra`,`Terra`],[`luna`,`Luna`],[`codex`,`Codex`],[`deepseek`,`DeepSeek`],[`nemotron`,`Nemotron`],[`gemma`,`Gemma`]]);function v(e){let t=e.replace(/:free$/u,``).replaceAll(`_`,`-`).split(`-`).filter(Boolean),n=[];for(let e=0;e<t.length;e++){let r=t[e],i=t[e+1];if(/^\d+$/u.test(r)&&/^\d+$/u.test(i??``)){n.push(`${r}.${i}`),e++;continue}let a=_.get(r.toLowerCase());n.push(a??(/^(?:[a-z]+\d+|\d+[a-z]+)$/iu.test(r)?r.toUpperCase():r[0]?.toUpperCase()+r.slice(1)))}return n.join(` `).replace(/^GPT (\d)/u,`GPT-$1`)}function y(e){return m.get(e)??v(e.includes(`/`)?e.slice(e.indexOf(`/`)+1):e)}function b(e){let t=e.includes(`/`)?e.split(`/`)[0].replace(/^~/u,``):`other`,n=g.get(t)??t;return{key:n,name:h.get(n)??(n===`other`?`Other`:v(n))}}function x(e){return e===`xhigh`?`Extra high`:e?e[0].toUpperCase()+e.slice(1):`Unavailable`}function S(e){return e.efforts.includes(`max`)?`max`:e.efforts.at(-1)??null}async function C(e,t=fetch){let n=await t(`/api/admin/scan/models`,{credentials:`same-origin`,headers:{accept:`application/json`},signal:e});if(!n.ok)throw Error(`HTTP ${n.status}`);return w(await n.json())}function w(e){if(!Array.isArray(e?.models))throw Error(`No model catalogue returned`);let t=e.models.filter(e=>typeof e?.id==`string`&&e.id.length>0).map(e=>({id:e.id,efforts:Array.isArray(e.efforts)?[...new Set(e.efforts.filter(e=>typeof e==`string`&&e.length>0))]:[]}));if(t.length===0)throw Error(`No models available`);return{models:t,defaultModel:t.find(t=>t.id===e.defaultModel)?.id??t[0].id}}function T(e,t=[]){let n=new Map,r=e.flatMap(e=>{let r=t.filter(t=>t.bundles?.includes(e.integrity));return(r.length>0?r.map(e=>({id:e.id,label:e.name})):[{id:`unattached`,label:`Unattached`}]).map(t=>(n.set(t.id,t),{id:e.integrity,integrity:e.integrity,filename:e.name,repoId:t.id,repo:t.label,files:null,reasons:[],size:`—`}))});return{repositories:[...n.values()],bundles:r,reports:[],scans:[]}}function E(o,s){if(s.error)throw Error(s.error);let c=n(s),l=s.kind===`stasis`?s.bundle?.formats:null,u=r(s),d=[...t(s)].filter(([,e])=>e!=null).map(([e,t])=>({path:e,format:l?.get(e)??null,bytes:t,lines:u.get(e)??0,size:i(t),module:a(e,{packageDir:c?.get(e)})})),f=[{id:`all`,label:`All`,filePaths:null},...[...e(s,d.map(e=>e.path))].map(([e,t])=>({id:`reason:${e}`,label:e,filePaths:[...t]}))];return{...o,files:d,reasons:f,size:i(s.size)}}export{T as a,E as b,f as c,p as d,y as e,b as f,x as g,S as h,C as i,w as j};
@@ -0,0 +1 @@
1
+ function e(e){return e===`inprogress`||e===`fixed`||e===`invalid`||e===`deleted`||e===`ignored`?e:void 0}function t(t){if(t)return e(t.triage)??(t.deleted?`deleted`:void 0)}function n(e){let n=t(e);return n===void 0||n===`ignored`}function r(e){return!e||!e.color&&!t(e)&&!e.comment&&!e.fix&&!(e.ignoredReports&&e.ignoredReports.length>0)&&e.flagged===void 0}function i(e,t,n){let r=e.get(t)?.ignoredReports;return Array.isArray(r)&&r.includes(n)}function a(e,t){return Array.isArray(e?.scopedIgnoredReports)&&e.scopedIgnoredReports.includes(t)}function o(t){if(!t||typeof t!=`object`)return;let n=t,i={};typeof n.color==`string`&&n.color&&(i.color=n.color);let a=e(n.triage)??(n.deleted?`deleted`:void 0);if(a&&(i.triage=a),typeof n.comment==`string`&&n.comment&&(i.comment=n.comment),typeof n.fix==`string`&&n.fix&&(i.fix=n.fix),typeof n.flagged==`boolean`&&(i.flagged=n.flagged),Array.isArray(n.ignoredReports)){let e=n.ignoredReports.filter(e=>typeof e==`string`&&e.length>0);e.length>0&&(i.ignoredReports=e)}if(Array.isArray(n.scopedIgnoredReports)&&i.ignoredReports){let e=[...new Set(n.scopedIgnoredReports.filter(e=>typeof e==`string`&&i.ignoredReports.includes(e)))];e.length>0&&(i.scopedIgnoredReports=e)}return r(i)?void 0:i}function s(e,t){let n=e??[],r=t??[];if(n.length!==r.length)return!1;if(n.length===0)return!0;let i=new Set(n);for(let e of r)if(!i.has(e))return!1;return!0}function c(e,n){let r=e??{},i=n??{};return(r.color??``)===(i.color??``)&&(t(r)??``)===(t(i)??``)&&(r.comment??``)===(i.comment??``)&&(r.fix??``)===(i.fix??``)&&r.flagged===i.flagged&&s(r.ignoredReports,i.ignoredReports)&&s(r.scopedIgnoredReports,i.scopedIgnoredReports)}function l(e,t,n){let r=e.get(t),i=o({...r,...n});return i===void 0?e.delete(t):!c(r,i)&&(e.set(t,i),!0)}function u(e,t,n){let r=o(n),i=e.get(t);return r===void 0?e.delete(t):!c(i,r)&&(e.set(t,r),!0)}function d(e,t,n,r,i=!1){let a=new Set(e.get(t)?.ignoredReports??[]);r?a.add(n):a.delete(n);let o=new Set(e.get(t)?.scopedIgnoredReports??[]);return r&&i&&o.add(n),l(e,t,{ignoredReports:a.size>0?[...a]:void 0,scopedIgnoredReports:[...o]})}async function f(e){let t=await crypto.subtle.digest(`SHA-512`,e);return`sha512-${new Uint8Array(t).toBase64()}`}export{t as a,n as b,i as c,a as d,o as e,l as f,u as g,d as h,f as i};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-GO7FT4OD.js";import{c as t,d as n,e as r,h as i,i as a,j as o,m as s,n as c,o as l}from"./chunk-G24A42V6.js";import{i as u}from"./chunk-4HI2MSAV.js";import"./chunk-PXK7EU4V.js";import{a as d,c as f}from"./chunk-JCIIBLKR.js";import{l as p,p as m,q as h,u as g}from"./chunk-JKGQ3O7O.js";import{b as _}from"./chunk-IYPY47MC.js";import"./chunk-SXV2T5C4.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function v(e){if(typeof e!=`string`)throw TypeError(`a text must be a string, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a text must be a well-formed string`);return{proven:!1,reason:`unsupported`,at:null}}var y=e=>e.subarray(0,8e3).includes(0),b=(e,t)=>(e+Math.imul(t,97)>>>0)%107927,x=e=>Uint8Array.from({length:256},(t,n)=>Number(n===10||e.includes(String.fromCodePoint(n)))),S=x(``),C=x(`,;={}`);function w(e,t=S){let n=!y(e),r=new Map,i=(e,t)=>r.set(e,(r.get(e)??0)+t),a=0,o=0,s=0;for(let r=0;r<e.length;r++){let c=e[r];if(n&&c===13&&e[r+1]===10)continue;let l=a;a=(a<<7^o>>>25)+c>>>0,o=(o<<7^l>>>25)>>>0,!(++s<64&&t[c]===0)&&(i(b(a,o),s),s=0,a=0,o=0)}s>0&&i(b(a,o),s);let c=Uint32Array.from(r.keys()).sort();return{hashes:c,bytes:Float64Array.from(c,e=>r.get(e)),total:r.values().reduce((e,t)=>e+t,0)}}function T(e,t){let n=0;for(let r=0,i=0;r<e.hashes.length&&i<t.hashes.length;)e.hashes[r]<t.hashes[i]?r++:e.hashes[r]>t.hashes[i]?i++:n+=Math.min(e.bytes[r++],t.bytes[i++]);return n}function E(e,t,n){let r=0,i=e.total,a=t.total;for(let o=0,s=0;o<e.hashes.length&&s<t.hashes.length;)if(e.hashes[o]<t.hashes[s]?i-=e.bytes[o++]:(e.hashes[o]>t.hashes[s]||(r+=Math.min(e.bytes[o],t.bytes[s]),i-=e.bytes[o++]),a-=t.bytes[s++]),(r+Math.min(i,a))*6e4<n)return 0;return r}function ee(e,t,n,r,i=!1){if(e===null||t===null||t.length===0)return 0;let a=Math.abs(e.length-t.length),o=Math.max(e.length,t.length);if(o*(6e4-n)<a*6e4)return 0;let s=r(e),c=r(t),l=i?E(s,c,n*o):T(s,c);return Math.trunc(l*6e4/o)}var D=/^[\w-]{6,}$/u,O=/[\dA-Z]/u,te=/^(?:\.[\w-]+)+$/u,ne=/^[\w-]{8,32}$/u;function k(e){let t=[];for(let n=e.length-1;n>0;n--){if(e[n]!==`-`&&e[n]!==`.`)continue;let r=e.indexOf(`.`,n+1),i=e.slice(r),a=e.slice(n+1,r);r!==-1&&ne.test(a)&&te.test(i)&&/[A-Za-z]/u.test(a)&&O.test(a)&&t.push([e.slice(0,n),a,i])}return t}var re=e=>e.replaceAll(/\d/gu,`0`).replaceAll(/[a-z]/gu,`a`).replaceAll(/[A-Z]/gu,`A`);function ie(e,t){let n=k(t);for(let[t,r,i]of k(e)){let e=n.find(e=>e[2]===i);if(e&&e[1]!==r)return e[0]===t&&re(e[1])!==re(r)}return!1}function ae(e){let t=e.lastIndexOf(`/`),n=e.slice(t+1),r=n.lastIndexOf(`.`),i=r>0?n.slice(r):``;return{name:n,key:`${e.slice(0,t+1)}\0${i}\0${n.length}`}}function oe(e,t){let n=e.length,r=0;for(;r<e.length&&e[r]===t[r];)r++;for(;n>r&&e[n-1]===t[n-1];)n--;for(;r>0&&!`-._`.includes(e[r-1]);)r--;for(;n<e.length&&e[n]!==`.`;)n++;let i=e.slice(r,n),a=t.slice(r,n);return r>0&&D.test(i)&&D.test(a)&&(O.test(i)||O.test(a))}function se({sources:e,dests:t,pairs:n,used:r,record:i,punctuatedScoreOf:a},{remaining:o,open:s},c,l){let u=(e,t)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>[t,ae(e[t].path)])),d=u(t,s),f=u(e,o),p=Map.groupBy(f.keys(),e=>f.get(e).key),m=Map.groupBy(d.keys(),e=>d.get(e).key),h=[];for(let[e,t]of m){let n=p.get(e)??[];for(let e of t)for(let t of n)oe(f.get(t).name,d.get(e).name)&&h.push({s:t,d:e})}let g=Map.groupBy(h,({d:e})=>e),_=Map.groupBy(h,({s:e})=>e),v=[];for(let{s:e,d:t}of h){let n=_.get(e).length===1&&g.get(t).length===1&&ie(f.get(e).name,d.get(t).name),r=a(e,t,n?0:c);(n||r>=c)&&v.push({s:e,d:t,score:r})}let y=[],b=new Set,x=new Set;for(let e of v.sort((e,t)=>t.score-e.score))n.has(e.d)||r.has(e.s)||(x.has(e.s)||b.has(e.d)||l(e)?(y.push(e),x.add(e.s),b.add(e.d)):i(e.d,e.s,e.score));return y}function ce(e,t){let n=e.length;if(n!==t.length)return!1;let r=0;if(n>=32&&(e.byteOffset&3)==(t.byteOffset&3)){for(let n=4-(e.byteOffset&3)&3;r<n;r++)if(e[r]!==t[r])return!1;let i=n-r>>>2,a=new Int32Array(e.buffer,e.byteOffset+r,i),o=new Int32Array(t.buffer,t.byteOffset+r,i);for(let e=0;e<i;e++)if(a[e]!==o[e])return!1;r+=i*4}for(;r<n;r++)if(e[r]!==t[r])return!1;return!0}var A=class extends Error{constructor(e,t,n){let r=n===void 0?``:` in the ${n} tree`;super(t===void 0?e:`${e}: ${JSON.stringify(t)}${r}`),this.name=`CompareError`,this.path=t,this.tree=n}},le=new Set([`file`,`contiguous-file`]),ue=new Set([`fifo`,`character-device`,`block-device`]),de=/(?:^|\/)\.{0,2}(?:\/|$)/u;function fe(e){if(!Number.isInteger(e)||e<0||e>4095)throw RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function pe(e,t,n,r){if(typeof e!=`string`)throw TypeError(`an entry's name must be a string, not ${typeof e}`);if(e!==`.`||t!==`directory`){if(r?e===``:de.test(e))throw new A(r?`a name must not be empty`:"a name must be a relative path with no empty, `.` or `..` segment",e,n);if(!e.isWellFormed())throw new A(`a name must be well-formed Unicode`,e,n)}}function me(e,t,n){if(typeof e!=`string`||e===``)throw new A(`a link must name its target`,t,n);if(!e.isWellFormed())throw new A(`a link target must be well-formed Unicode`,t,n);return e}function he(e){if(e===void 0)return new Uint8Array;if(e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`a file's data must be a string or a Uint8Array, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a file's text must be well-formed Unicode`);return e}var j=e=>typeof e==`string`?u(e):e;function ge(e,t,n){if(typeof e!=`object`||!e)throw TypeError(`an entry must be an object, not ${e===null?`null`:typeof e}`);let{name:r,type:i=`file`,mode:a,linkname:o,data:s}=e;if(pe(r,i,t,n),a!==void 0&&fe(a),le.has(i))return{path:r,type:`file`,mode:a??420,data:he(s)};if(i===`symlink`||i===`hardlink`)return{path:r,type:i,target:me(o,r,t)};if(i===`directory`)return{path:r,type:i};throw ue.has(i)?new A(`a ${i} is neither a file nor a link`,r,t):TypeError(`${JSON.stringify(i)} is not an entry type`)}function M(e,t){return e.type===t.type?e.type===`symlink`?e.target===t.target:e.data===t.data?!0:typeof e.data==`string`&&typeof t.data==`string`?!1:ce(j(e.data),j(t.data)):!1}function _e(e,t,n){let r=new Set([e.path]),i=t.get(e.target);for(;i?.type===`hardlink`;){if(r.has(i.path))throw new A(`a hard link leads back to itself`,e.path,n);r.add(i.path),i=t.get(i.target)}if(i===void 0||i.type===`directory`)throw new A(`a hard link must name a file or a link in the tree`,e.path,n);return{...i,path:e.path}}function N(e,t,n){let r=new Map;for(let i of e){let e=ge(i,t,n);if(e.type!==`directory`||e.path!==`.`){if(r.has(e.path))throw new A(`a name is given twice`,e.path,t);r.set(e.path,e)}}let i=new Map;for(let[e,a]of r){for(let i=n?-1:e.lastIndexOf(`/`);i>0;i=e.lastIndexOf(`/`,i-1)){let n=r.get(e.slice(0,i));if(n!==void 0&&n.type!==`directory`)throw new A(`a path lies under a ${n.type===`symlink`?`link`:`file`}`,e,t)}a.type===`hardlink`?i.set(e,_e(a,r,t)):a.type!==`directory`&&i.set(e,a)}return i}var ve=100,ye=4,P=e=>e.slice(e.lastIndexOf(`/`)+1);function F(t,n){if(t.type===`symlink`)return`l${t.target}`;let r=n(t);return`f${r.length}:${e(r)}`}function be({sources:e,dests:t,sourceNames:n,destNames:r,used:i,record:a,bytes:o}){let s=Map.groupBy(e.keys(),t=>F(e[t],o));for(let c=0;c<t.length;c++){let l=-1,u=ve;for(let a of s.get(F(t[c],o))??[])if(!i.has(a)&&M(e[a],t[c])&&((l===-1||n[a]===r[c])&&(l=a),n[a]===r[c]||--u===0))break;l!==-1&&a(c,l,6e4)}}var xe=new Map([[`.ts`,`.js`],[`.mts`,`.mjs`],[`.cts`,`.cjs`],[`.tsx`,`.jsx`]]),Se=new Map([...[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.mts`,`.cts`,`.tsx`].map(e=>[e,`script`]),...[`.css`,`.scss`,`.sass`,`.less`].map(e=>[e,`style`])]);function I(e){let t=e.split(`/`),n=t.pop(),r=n.lastIndexOf(`.`);return r>0?{dirs:t,stem:n.slice(0,r),extension:n.slice(r)}:{dirs:t,stem:n,extension:``}}function L(e){let{dirs:t,stem:n,extension:r}=I(e);return JSON.stringify([t.map(e=>e===`lib`||e===`src`?null:e),n,xe.get(r)??r])}function Ce(e){let{dirs:t,stem:n,extension:r}=I(e),i=[n,Se.get(r)??r],a=t.lastIndexOf(`node_modules`),o=a===-1?0:a+(t[a+1]?.startsWith(`@`)?3:2),s=[JSON.stringify([...i,t])];for(let e=o;e<t.length;e++)s.push(JSON.stringify([...i,t.toSpliced(e,1,null)]));return s}var R=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function z({pairs:e,used:t,scoreOf:n},{remaining:r,open:i},{s:a,d:o,score:s},c){let l=R(s,c);return i.some(t=>t!==o&&!e.has(t)&&n(a,t,l)>=l)||r.some(e=>e!==a&&!t.has(e)&&n(e,o,l)>=l)}function we(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=Map.groupBy(t.remaining.filter(e=>i[e].type===`file`),e=>L(i[e].path)),d=t.open.filter(e=>a[e].type===`file`).flatMap(e=>(u.get(L(a[e].path))??[]).map(t=>({s:t,d:e,score:l(t,e,0)})));for(let i of d.sort((e,t)=>t.score-e.score))!o.has(i.d)&&!s.has(i.s)&&!(n&&z(e,t,i,r))&&c(i.d,i.s,i.score)}function Te(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=new Map,d=(e,t,n)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>{let r=Ce(e[t].path);for(let e of r)(u.get(e)??u.set(e,{sources:[],dests:[]}).get(e))[n].push(t);return[t,r]})),f=d(a,t.open.filter(e=>!o.has(e)),`dests`),p=d(i,t.remaining.filter(e=>!s.has(e)),`sources`),m=(e,t)=>{let n=new Set(e.flatMap(e=>u.get(e)[t]));return n.size===1?[...n][0]:-1};for(let[i,a]of p){let o=m(a,`dests`);if(o===-1||m(f.get(o),`sources`)!==i)continue;let s={s:i,d:o,score:l(i,o,0)};n&&z(e,t,s,r)||c(o,i,s.score)}}function Ee(e,t,n){let r=H(e),i=t<6e4&&r.remaining.length*r.open.length<=n*n;we(e,r,i,t),Te(e,r,i,t)}function B(e,t){let n=new Map;for(let r of t)n.set(e[r],n.has(e[r])?-1:r);return n}function De({sourceNames:e,destNames:t,record:n,scoreOf:r},{remaining:i,open:a},o){let s=B(t,a),c=B(e,i);for(let t of i){let i=s.get(e[t]);if(i===void 0||i===-1||c.get(e[t])===-1)continue;let a=r(t,i,o);a>=o&&n(i,t,a)}}var V=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function Oe(e,t){if(e.length<ye){e.push(t);return}let n=0;for(let t=1;t<e.length;t++)V(e[t],e[n])>0&&(n=t);V(e[n],t)>0&&(e[n]=t)}function ke({sourceNames:e,destNames:t,pairs:n,used:r,record:i,scoreOf:a},{remaining:o,open:s},c,l){let u=[];for(let n of s){let r=[];for(let i of o)Oe(r,{score:a(i,n,c),nameScore:+(e[i]===t[n]),dst:n,src:i});u.push(...r)}let d=0,f=e=>{for(;d<l.length&&R(l[d].score,c)>e;d++){let{s:e,d:t,score:a}=l[d];!n.has(t)&&!r.has(e)&&i(t,e,a)}};for(let{dst:e,src:t,score:a}of u.sort(V)){if(a<c)break;f(a),!n.has(e)&&!r.has(t)&&i(e,t,a)}f(-1/0)}var H=({sources:e,dests:t,pairs:n,used:r})=>({remaining:e.keys().filter(e=>!r.has(e)).toArray(),open:t.keys().filter(e=>!n.has(e)).toArray()}),U=e=>e+Math.trunc(.5*(6e4-e));function W(e,t,{minimum:n,limit:r,byPath:i}){let a=new Map,o=new Set;if(e.length===0||t.length===0)return a;let s=new Map,c=new Map,l=new Map,u=e=>e.type===`file`?c.get(e)??c.set(e,j(e.data)).get(e):null,d=e=>s.get(e)??s.set(e,w(e)).get(e),f=e=>l.get(e)??l.set(e,w(e,C)).get(e),p={sources:e,dests:t,pairs:a,used:o,sourceNames:e.map(e=>P(e.path)),destNames:t.map(e=>P(e.path)),record(e,t,n){a.set(e,{source:t,score:n}),o.add(t)},bytes:u,scoreOf:(n,r,i)=>ee(u(e[n]),u(t[r]),i,d),punctuatedScoreOf:(n,r,i)=>ee(u(e[n]),u(t[r]),i,f,!0)};if(be(p),i&&Ee(p,n,r),n>=6e4)return a;De(p,H(p),U(n));let m=H(p);if(m.remaining.length*m.open.length>r*r)return a;let h=i?se(p,m,U(n),e=>z(p,m,e,n)):[];return ke(p,H(p),n,h),a}var Ae=50,je=1e3;function G(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.codePointAt(r)-t.codePointAt(r);return e.length-t.length}function Me(e){if(e===!1)return null;let t=e===!0?Ae:e;if(typeof t!=`number`)throw TypeError(`renames must be a boolean or a percentage, not ${typeof e}`);if(!(t>0&&t<=100))throw RangeError(`renames must be a percentage above 0 and at most 100, not ${e}`);return Math.max(1,Math.trunc(6e4*t/100))}function Ne({renamesByPath:e,renameLimit:t,renameGroup:n,paths:r,lines:i}){if(typeof e!=`boolean`)throw TypeError(`renamesByPath must be a boolean, not ${typeof e}`);if(t!==1/0&&!(Number.isSafeInteger(t)&&t>=0))throw RangeError(`renameLimit must be a whole number or Infinity, not ${t}`);if(n!==null&&typeof n!=`function`)throw TypeError(`renameGroup must be a function, not ${typeof n}`);if(r!==`tree`&&r!==`keys`)throw RangeError(`paths must be 'tree' or 'keys', not ${r}`);if(typeof i!=`boolean`)throw TypeError(`lines must be a boolean, not ${typeof i}`)}var Pe=(e,t)=>M(e,t)&&(e.type!==`file`||e.mode===t.mode),K=(e,t,n,r=null)=>({status:e,old:t,new:n,similarity:r}),Fe=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,q=e=>e.endsWith(`.mts`)?`module`:e.endsWith(`.cts`)?`commonjs`:null,Ie=/^export\s*\{\s*\}\s*;?$/u;function J(e){if(e===null)return{proven:!0,runtime:``,loads:!1};let n=t(e);try{return n===void 0?{proven:!1}:v(n)}catch{return{proven:!1}}}function Le(e){if(![e.old,e.new].filter(e=>e!==null).every(e=>e.type===`file`&&Fe.test(e.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let t=J(e.new),n=J(e.old);return!n.proven||!t.proven||n.runtime!==t.runtime&&!(e.old===null&&Ie.test(t.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&q(e.old.path)!==q(e.new.path)?e:{...e,typeOnly:!0}}function Re(e,t){let n=[],r=[],i=[];for(let[n,a]of e){let e=t.get(n);e===void 0?i.push(a):e.type===a.type?Pe(a,e)||r.push(K(`modified`,a,e)):r.push(K(`type-changed`,a,e))}for(let[r,i]of t)e.has(r)||n.push(i);return i.sort((e,t)=>G(e.path,t.path)),n.sort((e,t)=>G(e.path,t.path)),{changes:r,deleted:i,added:n}}function ze(e,t,{group:n,...r}){if(n===null)return W(e,t,r);let i=new Map,a=e=>Map.groupBy(e.keys(),t=>n(e[t].path)),o=a(e);for(let[n,s]of a(t)){let a=o.get(n);if(a!==void 0)for(let[n,{source:o,score:c}]of W(a.map(t=>e[t]),s.map(e=>t[e]),r))i.set(s[n],{source:a[o],score:c})}return i}function Be(e,t,{renames:i=!0,renamesByPath:a=!0,renameLimit:o=je,renameGroup:s=null,paths:c=`tree`,lines:l=!0,horizon:u,whitespace:d,ignoreCase:f}={}){let p=Me(i);Ne({renamesByPath:a,renameLimit:o,renameGroup:s,paths:c,lines:l});let m=n({horizon:u,whitespace:d,ignoreCase:f}),h=c===`keys`,{changes:g,deleted:_,added:v}=Re(N(e,`old`,h),N(t,`new`,h)),y=p===null?new Map:ze(_,v,{minimum:p,limit:o,byPath:a,group:s});for(let[e,t]of v.entries()){let n=y.get(e);g.push(n===void 0?K(`added`,null,t):K(`renamed`,_[n.source],t,Math.trunc(n.score*100/6e4)))}let b=new Set(y.values().map(({source:e})=>e));for(let[e,t]of _.entries())b.has(e)||g.push(K(`deleted`,t,null));return g.sort((e,t)=>G((e.new??e.old).path,(t.new??t.old).path)),(l?g.map(e=>({...e,...r(e.old,e.new,m)})):g).map(Le)}function Y(e,t,n){let r=new Map,o=new Set,s=0;for(let a of e){let e=i(n,a);e===null||!t.has(e)||(r.set(a,e),o.add(e),e!==a&&s++)}for(let n of e)r.has(n)||!t.has(n)||o.has(n)||(r.set(n,n),o.add(n));let c=r.size;for(let s of e){if(r.has(s))continue;let e=i(n,s)??a(n,s);for(;t.has(e)||o.has(e);)e=`../${e}`;r.set(s,e),o.add(e)}return{paths:r,paired:c,moved:s}}function Ve(e,t){let n=new Set(e),r=new Set(t),i=(e,t)=>{let n=new Map;for(let r of e)for(let e=r.indexOf(`/`);e!==-1;e=r.indexOf(`/`,e+1))t.has(r.slice(e+1))&&n.set(r.slice(0,e+1),(n.get(r.slice(0,e+1))??0)+1);let r=null,i=!1;for(let[e,t]of n)t>(n.get(r)??0)?[r,i]=[e,!1]:t===n.get(r)&&(i=!0);return i?null:r},a=Y(n,r,null).paired,o=[[{base:``,other:i(r,n)},n],[{base:i(n,r),other:``},r]].filter(([e])=>e.base!==null&&e.other!==null).map(([e,t])=>({root:e,side:t,...Y(n,r,e)})).filter(({side:e,paired:t,moved:n})=>t>a&&n*2>=e.size);return o.length===2&&o[0].paired===o[1].paired?null:o.toSorted((e,t)=>t.paired-e.paired)[0]?.root??null}function X(e,t){let n=[...e],r=new Set(t),i=Ve(n,r);return{root:i,paths:Y(n,r,i).paths}}function He(e,t,n){if(!e&&!t)return null;let r=Map.groupBy([...e??[]],([,e])=>e),i=new Map([...r].map(([e,t])=>[e,o(n,e,t.map(([t])=>t.slice(e.length+1)))]));return new Map([...[...e??[]].map(([e,t])=>[n.paths.get(e)??e,i.get(t)]),...t??[]])}function Ue(e,t,n=new Map,r=new Map,i=null){let a=e=>{let t=n.get(e)??r.get(e);return t===void 0?[...new Set([e,Xe(i,e)??e])]:[t]},o=[];for(let n of e.values()){let e=a(n.parent).map(e=>t.get(c(e,n.specifier,n.conditions,n.platform))).find(Boolean);if(e&&!a(n.target).includes(e.target)){let{target:t,...i}=e;o.push({...i,baseTarget:r.get(n.target)??n.target,otherTarget:t})}}return o.sort((e,t)=>e.key.localeCompare(t.key)),{changed:o,totalChanges:o.length}}function Z(e){return p(e)??0}function Q(e,t){return e===t||e?.format===`base64`&&t?.format===`base64`&&e.data===t.data||e?.format===`digest`&&t?.format===`digest`&&e.digest===t.digest}function We(e){if(e?.kind!==`stasis`||!e.bundle)return null;let{formats:t,executable:n,entries:r}=e.bundle;return e=>({format:t?.get(e),executable:n?.has(e)??!1,entry:r?.has(e)??!1})}function Ge(e,t){return!e||!t?[]:[`format`,`executable`,`entry`].filter(n=>e[n]!==t[n]).map(n=>({field:n,from:e[n],to:t[n]}))}function Ke(e){return(t,n)=>Math.abs(n.delta)-Math.abs(t.delta)||t[e].localeCompare(n[e])}function $(e){return(t,n)=>n.bytes-t.bytes||t[e].localeCompare(n[e])}function qe(e,t){return typeof e==`string`?`\0text\0${e.toWellFormed()}`:e?.format===`base64`?`\0base64\0${e.data}`:e?.format===`digest`?`\0digest\0${e.digest}`:`\0none\0${t}`}var Je=250;function Ye(e,t,n,r,i){let a=(e,t,n)=>e.filter(({path:e})=>e!==``&&e.isWellFormed()).map(({path:e},r)=>({name:e,data:qe(t.get(e),`${n}${r}`)})),o={paths:`keys`,renameGroup:i,renameLimit:Je,lines:!1},s=Be(a(e,n,`a`),a(t,r,`b`),o);return new Map(s.filter(({status:e})=>e===`renamed`).map(e=>[e.old.path,e.new.path]))}function Xe(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}function Ze(){return{baseBytes:0,otherBytes:0,onlyBaseFiles:0,onlyOtherFiles:0,changedFiles:0}}function Qe(e,t,n,r=X(e.keys(),t.keys()),i=[]){let{root:a,paths:o}=r,s=new Map([...o].map(([e,t])=>[t,e]));e=new Map([...e].map(([e,t])=>[o.get(e),t]));let c=e=>s.get(e)===e?{}:{basePath:s.get(e)},l=(e,t)=>{let n=Ge(i[0]?.(e),i[1]?.(t));return n.length>0?{meta:n}:{}},u=[],d=[],f=[],p=0,m=0,h=0,g=0,_=0,v=0,y=new Map,b=e=>{let t=n(e),r=y.get(t);return r||(r=Ze(),y.set(t,r)),r},x=new Set([...e.keys(),...t.keys()]);for(let n of x){let r=e.has(n),i=t.has(n),a=b(n);if(r&&i){let r=e.get(n),i=t.get(n),o=Q(r,i),u=l(s.get(n),n),d=Z(r),h=o?d:Z(i);if(p+=d,m+=h,a.baseBytes+=d,a.otherBytes+=h,o&&!u.meta)v++;else{let e=h-d;f.push({path:n,...c(n),baseBytes:d,otherBytes:h,delta:e,...u,...o?{modified:!1}:{}}),_+=e,a.changedFiles++}}else if(r){let t=Z(e.get(n));p+=t,h+=t,a.baseBytes+=t,a.onlyBaseFiles++,u.push({path:n,...c(n),bytes:t})}else{let e=Z(t.get(n));m+=e,g+=e,a.otherBytes+=e,a.onlyOtherFiles++,d.push({path:n,bytes:e})}}let S=Ye(u,d,e,t,n);if(S.size>0){let n=new Set(S.values());for(let[n,r]of S){let i=e.get(n),a=t.get(r),o=Q(i,a),c=Z(i),u=o?c:Z(a);h-=c,g-=u,f.push({path:r,renamedFrom:n,basePath:s.get(n),baseBytes:c,otherBytes:u,delta:u-c,modified:!o,...l(s.get(n),r)}),_+=u-c;let d=b(n);d.onlyBaseFiles--,d.onlyOtherFiles--,d.changedFiles++}u.splice(0,u.length,...u.filter(e=>!S.has(e.path))),d.splice(0,d.length,...d.filter(e=>!n.has(e.path)))}let C=[],w=[],T=[],E=[];for(let[e,t]of y){let n=t.baseBytes>0||t.onlyBaseFiles>0||t.changedFiles>0,r=t.otherBytes>0||t.onlyOtherFiles>0||t.changedFiles>0,i=t.onlyBaseFiles+t.onlyOtherFiles+t.changedFiles;n&&!r?C.push({pkg:e,bytes:t.baseBytes}):r&&!n?w.push({pkg:e,bytes:t.otherBytes}):i>0||t.baseBytes!==t.otherBytes?T.push({pkg:e,baseBytes:t.baseBytes,otherBytes:t.otherBytes,delta:t.otherBytes-t.baseBytes}):E.push({pkg:e,bytes:t.baseBytes})}return u.sort($(`path`)),d.sort($(`path`)),f.sort(Ke(`path`)),C.sort($(`pkg`)),w.sort($(`pkg`)),T.sort(Ke(`pkg`)),{totals:{baseFiles:e.size,baseBytes:p,otherFiles:t.size,otherBytes:m,onlyBaseFiles:u.length,onlyBaseBytes:h,onlyOtherFiles:d.length,onlyOtherBytes:g,changedFiles:f.length,renamedFiles:S.size,changedDelta:_,unchangedFiles:v,fileDelta:t.size-e.size,byteDelta:m-p,identical:u.length===0&&d.length===0&&f.length===0},files:{onlyBase:u,onlyOther:d,changed:f,root:a,basePaths:o},packages:{onlyBase:C,onlyOther:w,changed:T,unchanged:E}}}function $e(e,t,n=null){let[r,i]=[e,t],a=s(r,n),o=s(i,n),c=X(a.keys(),o.keys()),u=He(m(r),m(i),c),p=Qe(a,o,e=>_(e,{packageDir:u?.get(e)}),c,[We(r),We(i)]),v=g(r),y=g(i),b=(e,t)=>{let n=0;for(let r of t)n+=e.get(r)??0;return n};Object.assign(p.totals,{baseLines:b(v,a.keys()),otherLines:b(y,o.keys())});for(let e of p.files.onlyBase)e.lines=v.get(e.basePath??e.path)??0;for(let e of p.files.onlyOther)e.lines=y.get(e.path)??0;for(let e of p.files.changed)Object.assign(e,{baseLines:v.get(e.basePath??e.path)??0,otherLines:y.get(e.path)??0});p.resolutions=Ue(l(r,n),l(i,n),new Map(p.files.changed.filter(e=>e.renamedFrom!=null).map(e=>[e.basePath,e.path])),p.files.basePaths,p.files.root);let x=e=>_(``,{packageDir:e}),S=h(r,n?a.keys():null,x),C=h(i,n?o.keys():null,x);return p.versionUpdates=f(S,C),p.packageRows=d(p.packages,S,C),p.scope=n??``,p}export{$e as prepareComparison};
@@ -0,0 +1 @@
1
+ var e=new Set([`overview`,`graph`,`treemap`,`compare`,`advisories`,`issues`,`code`,`search`,`terminal`]),t=/^\d+$/u;function n(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n<32||n===127)return!0}return!1}var r=512;function i(e){return typeof e==`string`&&e.length>0&&e.length<=r&&!n(e)}function a(e){return i(e)&&!t.test(e)}var o=/^(?=.{1,214}$)(?:@[\w.-]+\/[\w-]|[\dA-Za-z])[\w.-]*$/u,s=/^(?=.{1,256}$)[\dA-Za-z][\w.+-]*$/u,c=/^@[\da-z~-][\w.~-]*$/u;function l(e){return typeof e==`string`&&o.test(e)}function u(e){return typeof e==`string`&&s.test(e)}function d(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase(),n=t.startsWith(`@`)?t:`@${t}`;return n.length<=214&&c.test(n)?n:null}var f=new Set([`code`,`diff`]),p=e=>f.has(e)?`code`:`overview`,m=e=>f.has(e)?{compareMode:`code`}:{},h=e=>f.has(e)?`/code`:``,g=Object.freeze({manage:`/manage`,"manage-bundles":`/manage/bundle`,"manage-scans":`/manage/scans`,"manage-reports":`/manage/report`,"manage-repos":`/manage/repositories`,"manage-repo-risk":`/manage/repositories/risk`,"admin-users":`/manage/users`,"manage-teams":`/manage/team`,"manage-import":`/manage/import`,"manage-links":`/manage/links`,"manage-deduplication":`/manage/deduplication`,"manage-history":`/manage/history`}),_=new Set([`workspace-reports`,`workspace-bundles`,`workspace-repositories`,`workspace-dependencies`]),v=new Set([`pulls`,`versions`,`branch`,`reviews`]),y=e=>e.view===`workspace-dependencies`&&e.dependencyTab!=null?{dependencyTab:e.dependencyTab}:{};function b(e){if(!a(e)||e===`.`||e===`..`)return null;try{return`/finding/${encodeURIComponent(e)}`}catch{return null}}function x(t){if(!t)return null;if(t.view===`home`)return`/`;if(t.view===`reviews`)return`/my/reviews`;if(t.view===`profile`)return`/my/profile`;if(t.view===`npm`)return C(t);if(t.view===`repository-code`)return j(t);if(_.has(t.view)){let e=y(t).dependencyTab??`pulls`;return!/^[A-Za-z0-9_-]+$/u.test(t.teamSlug??``)||!v.has(e)?null:`/team/${t.teamSlug}/${t.view.slice(10)}${e===`pulls`?``:`/${e}`}`}if(t.view===`bundles`){if(!/^[A-Za-z0-9_-]+$/u.test(t.bundleSlug??``)||[t.teamSlug,t.compareSlug].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e)))return null;let n=t.bundleTab??`overview`;if(!e.has(n))return null;let r=t.teamSlug?`/team/${t.teamSlug}`:`/manage`,i=n===`code`&&N(t.file)?`/${t.file}`:``,a=i&&N(t.line)?`#L${t.line}${N(t.endLine)&&t.endLine>t.line?`-L${t.endLine}`:``}`:``,o=n===`compare`&&t.compareSlug!=null?`/${t.compareSlug}${h(t.compareMode)}`:``;return`${r}/bundle/${t.bundleSlug}${n===`overview`?``:`/${n}`}${i}${o}${a}`}if(Object.hasOwn(g,t.view)){let e=g[t.view];return t.view===`manage-deduplication`&&t.linkId?`${e}?report=${encodeURIComponent(t.linkId)}`:t.view===`manage-bundles`&&Number.isSafeInteger(t.createRepoId)&&t.createRepoId>0?`${e}?createRepo=${t.createRepoId}`:t.view===`manage-scans`&&t.scanMode===`link`?`${e}?mode=link`:t.view===`manage-scans`&&t.bundleId?`${e}?bundle=${encodeURIComponent(t.bundleId)}${t.scanMode===`dependencies`?`&mode=dependencies`:``}`:t.view===`manage-history`&&t.actor?`${e}?actor=${encodeURIComponent(t.actor)}`:e}if(![`findings`,`files`].includes(t.view)||!t.teamSlug||[t.teamSlug,t.reportSlug].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e)))return null;let n=`/team/${encodeURIComponent(t.teamSlug)}`,r=t.reportSlug?`/report/${encodeURIComponent(t.reportSlug)}`:``;if(t.finding){let e=b(t.finding.id);return t.view===`findings`&&e?`${n}${r}${e}`:null}return`${n}${r}${t.view===`files`?`/files`:``}`}var S=new Set([`overview`,`code`,`search`,`compare`,`review`,`treemap`]);function C(e){if(e.packageName==null)return`/npm`;let t=e.bundleTab??`overview`;if(!l(e.packageName)||e.packageSpec!=null&&!u(e.packageSpec)||!S.has(t)||e.compareSpec!=null&&!u(e.compareSpec))return null;if(t===`review`){if(e.reviewPackage!=null&&!l(e.reviewPackage)||e.reviewSpec!=null&&!u(e.reviewSpec))return null;let t=e.reviewPackage==null?``:`/${e.reviewPackage}${e.reviewSpec==null?``:`@${e.reviewSpec}`}`;return`/npm/${e.packageName}${e.packageSpec==null?``:`@${e.packageSpec}`}/review${t}`}let n=t===`code`&&N(e.file)?`/${e.file}`:``,r=n&&N(e.line)?`#L${e.line}${N(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``,i=t===`compare`&&e.compareSpec!=null?`/${e.compareSpec}${h(e.compareMode)}`:``;return`/npm/${e.packageName}${e.packageSpec==null?``:`@${e.packageSpec}`}${t===`overview`?``:`/${t}`}${n}${i}${r}`}function w(e,t){let n=/^\/npm\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?\/review(?:\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?)?$/u.exec(e);if(n){if(!l(n[1])||n[2]!=null&&!u(n[2])||n[3]!=null&&!l(n[3])||n[4]!=null&&!u(n[4]))return null;let e=n[3]&&/^\d+\.\d+\.\d+(?:[-+].*)?$/u.test(n[3])&&n[4]==null;return{view:`npm`,packageName:n[1],packageSpec:n[2]??null,bundleTab:`review`,...n[3]?{reviewPackage:e?n[1]:n[3],reviewSpec:e?n[3]:n[4]??null}:{}}}let r=/^\/npm(?:\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(code|search|compare|treemap)(?:\/([^/]+)(?:\/([a-z]+))?)?)?)?$/u.exec(e);if(!r)return;if(r[1]==null)return{view:`npm`};if(!l(r[1])||r[2]!=null&&!u(r[2]))return null;let i={view:`npm`,packageName:r[1],packageSpec:r[2]??null,bundleTab:r[3]??`overview`};if(r[4]==null)return i;if(i.bundleTab===`compare`)return u(r[4])&&(r[5]==null||f.has(r[5]))?{...i,compareSpec:r[4],...m(r[5])}:null;if(i.bundleTab!==`code`)return null;let a=Number(r[4]);return!r[5]&&/^[1-9]\d*$/u.test(r[4])&&Number.isSafeInteger(a)?{...i,file:a,...P(t)}:null}var T=new Set([`code`,`search`,`treemap`,`compare`,`commits`,`issues`,`pulls`,`agents`,`pulse`,`replay`]),E=new Set([`commits`,`issues`,`pulls`,`agents`,`pulse`,`replay`]),D=/^[a-f\d]{40}$/u,O=500,k=e=>Number.isSafeInteger(e)&&e>0;function A(e){return typeof e==`string`&&(e===``||e.length<=O&&!/[\p{Cc}\\]/u.test(e)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e===e.trim()))}function j(e){let t=e.bundleTab??`code`,n=e.path??``;if(!k(e.repoId)||e.commit!=null&&!D.test(e.commit)||!A(n)||!T.has(t)||e.compareCommit!=null&&!D.test(e.compareCommit))return null;let r=n?`?path=${n.split(`/`).map(encodeURIComponent).join(`/`)}`:``;if(e.commit==null)return`/repo/${e.repoId}${r}`;let i=t===`code`&&N(e.file)?`/code/${e.file}`:t===`code`?``:`/${t}`,a=t===`compare`&&e.compareCommit!=null?`/${e.compareCommit}${h(e.compareMode)}`:``,o=t===`code`&&N(e.file)&&N(e.line)?`#L${e.line}${N(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``;return`/repo/${e.repoId}/${e.commit}${i}${a}${r}${o}`}function M(e){let t=/^\/(?:repo|manage\/code)\/([1-9]\d*)(?:\/([a-f\d]{40})(?:\/(code|search|treemap|compare|commits|history|issues|pulls|agents|pulse|replay)(?:\/([^/]+)(?:\/([a-z]+))?)?)?)?$/u.exec(e.pathname.replace(/\/$/u,``));if(!t)return;let n=Number(t[1]),r=e.searchParams.get(`path`)??``,i=t[3]===`history`?`commits`:t[3]??`code`;if(!k(n)||!A(r))return null;let a={view:`repository-code`,repoId:n,commit:t[2]??null,path:r,bundleTab:i};if(t[4]==null)return a;if(i===`compare`)return D.test(t[4])&&(t[5]==null||f.has(t[5]))?{...a,compareCommit:t[4],...m(t[5])}:null;let o=Number(t[4]);return i===`code`&&t[5]==null&&/^[1-9]\d*$/u.test(t[4])&&Number.isSafeInteger(o)?{...a,file:o,...P(e.hash)}:null}function N(e){return Number.isSafeInteger(e)&&e>0}function P(e){let t=/^#L([1-9]\d*)(?:-L([1-9]\d*))?$/u.exec(e),[n,r]=t?[Number(t[1]),Number(t[2]??t[1])]:[];return!N(n)||!N(r)?{}:n===r?{line:n}:{line:Math.min(n,r),endLine:Math.max(n,r)}}function F(t){let n=t.pathname.replace(/\/$/u,``)||`/`;if(n===`/`||n===`/index.html`)return{view:`home`};if(n===`/my/reviews`)return{view:`reviews`};if(n===`/my/profile`){let e=t.searchParams.get(`link-error`);return{view:`profile`,...e&&/^[a-z-]{1,64}$/u.test(e)?{linkError:e}:{}}}let i=Object.keys(g).find(e=>g[e]===n);if(i){let e=Number(t.searchParams.get(`createRepo`));return{view:i,...i===`manage-deduplication`&&t.searchParams.get(`report`)?{linkId:t.searchParams.get(`report`)}:{},...i===`manage-bundles`&&Number.isSafeInteger(e)&&e>0?{createRepoId:e}:{},...i===`manage-history`&&t.searchParams.get(`actor`)?{actor:t.searchParams.get(`actor`)}:{},...i===`manage-scans`?t.searchParams.get(`mode`)===`link`?{scanMode:`link`}:t.searchParams.get(`bundle`)?{bundleId:t.searchParams.get(`bundle`),...t.searchParams.get(`mode`)===`dependencies`?{scanMode:`dependencies`}:{}}:{}:{}}}let a=/^(?:\/team\/([A-Za-z0-9_-]+)|\/manage)\/bundle\/([A-Za-z0-9_-]+)(?:\/([a-z]+)(?:\/([A-Za-z0-9_-]+)(?:\/([a-z]+))?)?)?$/u.exec(n);if(a){let n=a[3]??`overview`;if(!e.has(n))return null;let r={view:`bundles`,teamSlug:a[1]??null,bundleSlug:a[2],bundleTab:n};if(a[4]==null)return r;if(n===`compare`)return a[5]==null||f.has(a[5])?{...r,compareSlug:a[4],...m(a[5])}:null;let i=Number(a[4]);return n!==`code`||a[5]||!/^[1-9]\d*$/u.test(a[4])||!Number.isSafeInteger(i)?null:{...r,file:i,...P(t.hash)}}let o=w(n,t.hash);if(o!==void 0)return o;let s=M(t);if(s!==void 0)return s;let c=/^\/team\/([A-Za-z0-9_-]+)\/(reports|bundles|repositories|dependencies)$/u.exec(n);if(c)return{view:`workspace-${c[2]}`,teamSlug:c[1]};let l=/^\/team\/([A-Za-z0-9_-]+)\/dependencies\/([a-z]+)$/u.exec(n);if(l)return v.has(l[2])?{view:`workspace-dependencies`,teamSlug:l[1],dependencyTab:l[2]}:null;let u=/^\/team\/([^/]+)(?:\/report\/([^/]+))?(?:\/(files)|\/finding\/([^/]+))?$/u.exec(n);if(!u)return null;try{let e=decodeURIComponent(u[1]),t=u[2]?decodeURIComponent(u[2]):null;if([e,t].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e))||u[4]?.length>r*9)return null;let n=u[4]?decodeURIComponent(u[4]):null;return n!=null&&!b(n)?null:{view:u[3]?`files`:`findings`,teamSlug:e,reportSlug:t,...n==null?{}:{finding:{id:n}}}}catch{return null}}function I(e,t,n=[]){if(_.has(e.view)){let n=t.filter(t=>t.slug===e.teamSlug);return n.length===1?{view:e.view,teamId:n[0].id,...y(e)}:null}if(e.view===`bundles`){let{teamSlug:r,bundleSlug:i,compareSlug:a,compareMode:o,...s}=e,c=r==null?[]:t.filter(e=>e.slug===r);if(r!=null&&c.length!==1)return null;let l=c[0],u=r==null?n:t.flatMap(e=>e.bundles??[]),d=e=>new Set(u.filter(t=>t.slug===e).map(e=>e.id)),f=d(i),p=(l?.bundles??n).find(e=>e.slug===i);if(!i||!p||f.size!==1)return null;let h=a==null?null:d(a),g=h?.size===1?{compareId:[...h][0],...m(o)}:{};return{...s,teamId:l?.id??null,bundleId:p.id,...g}}if(![`findings`,`files`].includes(e.view))return e;let{teamSlug:r,reportSlug:i,...a}=e,o=t.filter(e=>e.slug===r);if(!r||o.length!==1)return null;let s=o[0];if(i==null)return{...a,teamId:s.id,reportId:null};let c=t.flatMap(e=>e.reports??[]).filter(e=>e.slug===i),l=new Set(c.map(e=>e.id)),u=(s.reports??[]).find(e=>e.slug===i);return u&&l.size===1?{...a,teamId:s.id,reportId:u.id}:null}function L(e,t,n=[]){if(_.has(e.view)){let n=t.find(t=>t.id===e.teamId),r={view:e.view,teamSlug:n?.slug,...y(e)};return n?.slug&&I(r,t)?r:null}if(e.view===`bundles`){let{teamId:r,bundleId:i,compareId:a,compareMode:o,...s}=e,c=t.find(e=>e.id===r);if(r!=null&&!c?.slug)return null;let l=(c?.bundles??n).find(e=>e.id===i);if(!l?.slug)return null;let u=a==null?null:(r==null?n:t.flatMap(e=>e.bundles??[])).find(e=>e.id===a),d={...s,teamSlug:c?.slug??null,bundleSlug:l.slug,...u?.slug?{compareSlug:u.slug,...m(o)}:{}},f=I(d,t,n);if(!f)return null;if(d.compareSlug!=null&&f.compareId!==a){let{compareSlug:e,compareMode:t,...n}=d;return n}return d}if(![`findings`,`files`].includes(e.view))return e;let{teamId:r,reportId:i,...a}=e,o=t.find(e=>e.id===r),s=i==null?null:o?.reports?.find(e=>e.id===i);if(!o?.slug||i!=null&&!s?.slug)return null;let c={...a,teamSlug:o.slug,reportSlug:s?.slug??null};return I(c,t)?c:null}export{e as a,r as b,a as c,l as d,u as e,d as f,p as g,m as h,g as i,v as j,x as k,S as l,T as m,E as n,F as o,I as p,L as q};
@@ -0,0 +1,3 @@
1
+ import{a as e}from"./chunk-QB4CBOX2.js";import{a as t,b as n,c as r,f as i,g as a}from"./chunk-S6GIXWQW.js";import{i as o}from"./chunk-BC2UCLFJ.js";import{J as s}from"./chunk-SXV2T5C4.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`},ee=34,v=1048576,y=65536,b=`deepview-managed-upload.v1.content-key`;function x(e,t){let n=new Uint8Array(12);return new DataView(n.buffer).setUint32(7,e),n[11]=+!!t,n}async function S(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(b)},r,{name:`AES-GCM`,length:256},!1,[n])}async function te(e){let t=new Uint8Array(await e.slice(0,y).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 C(e,t,n){let r=await te(e),[i,a]=await Promise.all([crypto.subtle.importKey(`raw`,t,_,!1,[]),crypto.subtle.generateKey(_,!1,[`deriveBits`])]),o=new Uint8Array(ee);o[0]=h,o[1]=r?g:0,o.set(new Uint8Array(await crypto.subtle.exportKey(`raw`,a.publicKey)),2);let s=await S(await crypto.subtle.deriveBits({name:`X25519`,public:i},a.privateKey,256),o,`encrypt`),c=[new Blob([o])],l=new Uint8Array(v),u=0,d=0,f=async e=>{c.push(new Blob([await crypto.subtle.encrypt({name:`AES-GCM`,iv:x(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===v&&await f(!1);let n=Math.min(v-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 w=null,T=0;function E(){return w?.user.role??null}function D(e){if(e!==null&&!n(e))throw TypeError(`Unknown managed preview role: ${e}. Expected ${t.join(`, `)}.`);T++,w=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 O(e,t){let n=new URL(e,`http://managed-preview.invalid`).pathname,i=(t?.method??`GET`).toUpperCase();if(i===`POST`&&n===`/api/auth/logout`)return Response.json({ok:!0});if(i!==`GET`)throw Error(`Changes are not saved in the managed UI preview`);if(n===`/api/auth/session`)return Response.json(w);if(n===`/api/teams`)return Response.json({teams:[]});if(n.startsWith(`/api/admin/`)&&!r(w.user.role,`manage`)||[`/api/admin/users`,`/api/admin/teams`,`/api/admin/repositories`,`/api/admin/repositories/aliases`,`/api/admin/repositories/risk`].includes(n)&&w.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 a={"/api/admin/users":{users:[w.user]},"/api/admin/teams":{teams:[],users:[w.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:w.user.login,name:w.user.name,githubName:w.user.name,nameAccount:null,avatarAccount:null,accounts:[]}}};return Object.hasOwn(a,n)?Response.json(a[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 Error(`The server sent an invalid upload key`);let i=new Headers(e.headers);return i.set(m,`1`),{...e,headers:i,body:await C(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 N(e,i,n,r)}async function N(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{for(let e=0;e<s;e++){l=e+1;let s=await n(`/api/admin/uploads/${o}/${a}/${e}`,{...t,headers:c,body:i.slice(e*r,(e+1)*r)});if(!s.ok)return s}let d=new Headers(t.headers);d.set(`x-upload-id`,a),d.set(`x-upload-parts`,String(s)),d.set(`x-upload-size`,String(i.size));let f=await n(e,{...t,headers:d,body:``});return u=f.ok,f}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 P(e){await e.json().then(e=>e?.error,()=>null)===`view-only`&&globalThis.document?.dispatchEvent(new CustomEvent(`managed-view-only`))}async function F(e,t){if(t?.signal?.throwIfAborted(),w)return O(e,t);let n=T;async function r(e,t){if(n!==T)throw new DOMException(`Managed session changed`,`AbortError`);let r=i();if(r){if(new URL(e,globalThis.location.origin).origin!==globalThis.location.origin)throw Error(`Public workspace requests must be same-origin`);let n=new Headers(t?.headers);n.set(`x-deepview-share`,r.token),t={...t,headers:n,credentials:`omit`,redirect:`error`}}let a=await fetch(e,{...t,cache:`no-store`});if(n!==T)throw new DOMException(`Managed session changed`,`AbortError`);return a.status===403&&![`GET`,`HEAD`].includes((t?.method??`GET`).toUpperCase())&&P(a.clone()),a}return t?.method===`POST`&&A.has(e)&&t.body instanceof Blob?await M(e,t,r):await r(e,t)}var I=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 L(e){I.setSession(e)}function R(e){return I.setReportCatalog(e)}function z(){I.reset()}async function B(e,t=null,n={}){let r;try{r=await F(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 V({fallback:e=null,sent:t}={}){let n=i()||E()!==null?void 0:await t;if(n===null)return null;let r=H(n);if(r!==void 0)return r;let o;try{let t=i(),n=await F(t?a(t):`/api/auth/session`,{credentials:`same-origin`,headers:{accept:`application/json`}});if(n.status===401||n.status===403)return null;if(!n.ok)return e;o=await n.json()}catch{return e}let s=H(o);return s===void 0?e:s}function H(e){let t=e?.user;if(t===null)return null;if(t!==void 0&&typeof t.login==`string`)return{id:t.id,login:t.login,name:typeof t.name==`string`?t.name:null,avatarUrl:typeof t.avatarUrl==`string`?t.avatarUrl:null,role:typeof t.role==`string`?t.role:`none`,csrfToken:typeof e.csrfToken==`string`?e.csrfToken:null,...i()?{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}}:{},...!i()&&e.dependencyReview===!0?{dependencyReview:!0}:{}}}function U(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 W(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 G({fallback:e=[],signal:t,onRevision:n}={}){let r=i(),o=r?await B(a(r),null,{signal:t}):null,s=r?{teams:o?.team?[o.team]:[]}:await B(`/api/teams`,{teams:e},{signal:t}),c=s?.teams;return Array.isArray(c)?(n?.(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,...!r&&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}:{},...U(e.app)?{app:U(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:W(e.commitInfo)})):[]}))):s==null?[]:e}function K(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 q(e){return s(e?.data)===null||typeof e.repo?.directory!=`string`||e.repo.github!==null&&typeof e.repo.github!=`string`||K(e)===null?null:{data:e.data,repo:e.repo,...e.links?{links:e.links}:{}}}async function J(e,{signal:t}={}){return q(await B(`/api/reports/${encodeURIComponent(e)}`,null,{signal:t}))}async function Y(e,{signal:t}={}){let n=[...new Set(e)];if(n.length===0)return[];let r=await B(`/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=q(e);if(!t||!n.includes(e.id)||i.has(e.id))return null;i.set(e.id,t)}let a=K(r);return a===null?null:e.map(e=>({...i.get(e),...a.length>0?{links:a}:{}}))}async function X(e,{signal:t,reportId:n=null}={}){let r=n===null?``:`?reportId=${encodeURIComponent(n)}`,i=await B(`/api/teams/${encodeURIComponent(e)}/reports${r}`,null,{signal:t});if(!Array.isArray(i?.reports))return null;let a=[],o=new Set;for(let e of i.reports){let t=q(e);if(!t||typeof e.id!=`string`||typeof e.filename!=`string`||o.has(e.id))return null;o.add(e.id),a.push({id:e.id,filename:e.filename,...t})}let s=K(i);return s===null?null:(Object.defineProperty(a,"links",{value:s}),a)}function Z(e){return e?`?team=${encodeURIComponent(e)}`:``}async function Q(e,{reportId:t,...n}={}){let r=t==null?``:`?reportId=${encodeURIComponent(t)}`,{reports:i,entries:a,comments:o,issues:s={}}=await B(`/api/teams/${encodeURIComponent(e)}/annotations${r}`,null,n)??{};if(!i||typeof i!=`object`||Array.isArray(i)||!a||typeof a!=`object`||Array.isArray(a)||!Array.isArray(o)||!s||typeof s!=`object`||Array.isArray(s)||Object.values(i).some(e=>!Array.isArray(e)||e.some(e=>typeof e!=`string`))||o.some(e=>!e||typeof e.findingId!=`string`))return null;let c=new Map;for(let[e,t]of o.entries()){let n=t.findingId,r=c.get(n)??[];r.push(e),c.set(n,r)}let l=new Map,u=new Map;return e=>{if(!Object.hasOwn(i,e))return null;if(u.has(e))return u.get(e);let t=JSON.stringify(i[e]),n=l.get(t);if(!n){let r=[...new Set(i[e])],u=r.flatMap(e=>c.get(e)??[]);n={entries:Object.fromEntries(r.filter(e=>Object.hasOwn(a,e)).map(e=>[e,a[e]])),comments:u.toSorted((e,t)=>e-t).map(e=>o[e]),issues:Object.fromEntries(r.filter(e=>Object.hasOwn(s,e)).map(e=>[e,s[e]]))},l.set(t,n)}return u.set(e,n),n}}async function ne(e,t,n){let r=(await B(`/api/reports/${encodeURIComponent(e)}/triage${Z(t)}`,null,n))?.entries;return typeof r==`object`&&r&&!Array.isArray(r)?r:null}async function re(e,t,n=null){if(i())return[];let r=n===null?``:`?reportId=${encodeURIComponent(n)}`,a=await B(`/api/teams/${encodeURIComponent(e)}/fixes${r}`,null,{signal:t});return Array.isArray(a?.fixes)?a.fixes:null}async function ie(e,t,n){let r=await B(`/api/reports/${encodeURIComponent(e)}/comments${Z(t)}`,null,n);return Array.isArray(r?.comments)?r.comments:null}async function ae(e,{findingId:t,body:n,commentId:r=null,version:i},a,o){let s=r==null?``:`/${encodeURIComponent(r)}`;try{let c=await F(`/api/reports/${encodeURIComponent(e)}/comments${s}${Z(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 oe(e,t,n,r,i){try{return(await F(`/api/reports/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}${Z(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 $(e,t,n,r){try{return(await F(`/api/reports/${encodeURIComponent(e)}/triage${Z(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 se(e){e&&(location.href=e)}async function ce(e){if(i()){location.href=`/`;return}try{await F(`/api/auth/logout`,{method:`POST`,credentials:`same-origin`,headers:e?{"x-csrf-token":e}:{}})}catch{}location.reload()}async function le(e,t){let n=await F(`/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 ue(e){try{await F(`/api/auth/view-as`,{method:`DELETE`,credentials:`same-origin`,headers:e?{"x-csrf-token":e}:{}})}catch{}location.assign(o[`admin-users`])}async function de(e){let t=await F(`/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 fe(e,t,{id:n,revoke:r=!1,dependencies:i=!1,security:a=!1}={}){let o=n?`/${encodeURIComponent(n)}`:``,s=await F(`/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 pe(e,t){let n=await F(`/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,E as b,D as c,F as d,I as e,L as f,R as g,z as h,V as i,G as j,J as k,Y as l,X as m,Z as n,Q as o,ne as p,re as q,ie as r,ae as s,oe as t,$ as u,se as v,ce as w,le as x,ue as y,de as z,fe as A,pe as B};
@@ -1,10 +1,10 @@
1
- var T={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},_=r=>(...t)=>({_$litDirective$:r,values:t}),s=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};export{T as a,_ as b,s as c};
1
+ var e={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},t=e=>(...t)=>({_$litDirective$:e,values:t}),n=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};export{e as a,t as b,n as c};
2
2
  /*! Bundled license information:
3
3
 
4
4
  lit-html/directive.js:
5
- (**
6
- * @license
7
- * Copyright 2017 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- *)
5
+ (**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ *)
10
10
  */
@@ -0,0 +1,3 @@
1
+ import{Cb as e,Tb as t,Zb as n,rb as r,sb as i,tb as a,v as o,vb as s,wb as c,xb as l}from"./chunk-LE5ZWLG4.js";import{c as u,d}from"./chunk-MSION3G4.js";import{e as f,f as p,g as m,j as h}from"./chunk-SXV2T5C4.js";import{c as g}from"./chunk-2XUEZHIP.js";var _=`.token.comment,.token.prolog,.token.cdata{color:var(--code-comment);font-style:italic}.token.punctuation{color:var(--muted)}.token.string,.token.attr-value,.token.char,.token.regex{color:var(--code-string)}.token.number,.token.boolean,.token.constant,.token.symbol{color:var(--code-number)}.token.keyword,.token.builtin,.token.important,.token.atrule{color:var(--code-keyword)}.token.function,.token.class-name,.token.tag{color:var(--code-function)}.token.operator,.token.entity,.token.url,.token.attr-name,.token.selector{color:var(--code-operator)}.token.variable,.token.property,.token.parameter{color:var(--code-variable)}.token.annotation{color:var(--code-function)}.token.deleted{color:var(--code-deleted)}.token.inserted{color:var(--code-inserted)}.token.italic{font-style:italic}.token.bold{font-weight:700}.code-control{padding:0 .3em;margin:0 .1em;border-radius:3px;font-size:.8em;line-height:0;font-style:normal;font-weight:400;color:var(--warning);background:rgb(from var(--warning) r g b / .14);box-shadow:inset 0 0 0 1px rgb(from var(--warning) r g b / .45);white-space:nowrap;user-select:none}
2
+ `,v=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,y=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="5" width="20.4" height="14" rx="2"/><path d="M5.6 15.6V8.4l3.1 3.6 3.1-3.6v7.2"/><path d="M16.9 8.4v7.2m-2.6-2.9 2.6 2.9 2.6-2.9"/></svg>`,b=g`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M6 9V2h12v7"/><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>`;function x(e,t){let n=u.find(t=>t.value===e)?.label??e;return d(e)?.includes(`partial`)?t===`exclude`?`${n} (full only)`:t===`only`?`${n} (partial only)`:n:n}function S(e){return h.filter(t=>e.has(t)).map(e=>f[e]??e).join(`, `)}function C(e=o){let t=[];if(e.filterSeverities.size>0&&t.push({key:`severity`,label:`Severity`,value:S(e.filterSeverities),clear:{filterSeverities:new Set}}),e.filterColors.size>0&&t.push({key:`marks`,label:`Marks`,value:[...e.filterColors].map(e=>m[e]??e).join(`, `),clear:{filterColors:new Set}}),e.filterSources.size===1&&t.push({key:`source`,label:`Source`,value:e.filterSources.has(`own`)?`Sources only`:`Dependencies only`,clear:{filterSources:new Set}}),e.filterAnalyzer&&t.push({key:`analyzer`,label:`Analyzer`,value:e.filterAnalyzer===r?`(none)`:e.filterAnalyzer,clear:{filterAnalyzer:``}}),e.filterModel&&t.push({key:`model`,label:`Model`,value:e.filterModel===a?`(none)`:e.filterModel,clear:{filterModel:``}}),e.filterRepo&&t.push({key:`repo`,label:`Repository`,value:e.filterRepo===i?`(no repo)`:e.filterRepo,clear:{filterRepo:``}}),d(e.filterRevalidate)&&t.push({key:`revalidate`,label:`Revalidation`,value:x(e.filterRevalidate,e.filterPartial),clear:{filterRevalidate:``,filterPartial:``}}),!e.filterRevalidate&&(e.filterConfMin>0||e.filterConfMax<10)){let n;n=e.filterConfMin>0&&e.filterConfMax<10?`${e.filterConfMin}\u2013${e.filterConfMax}`:e.filterConfMin>0?`\u2265 ${e.filterConfMin}`:`\u2264 ${e.filterConfMax}`,t.push({key:`confidence`,label:`Confidence`,value:n,clear:{filterConfMin:0,filterConfMax:10}})}e.filterInclude&&t.push({key:`search`,label:e.filterIncludeNegate?`Excluding`:`Search`,value:`"${e.filterInclude}"`,clear:{filterInclude:``,filterIncludeNegate:!1}});for(let[n,r]of[[`filterComment`,`comment`],[`filterFix`,`fix`],[`filterFlagged`,`flag`]]){let i=e[n];i&&t.push({key:`annotation:${r}`,label:`Annotation`,value:`${i===`with`?`With`:`Without`} ${r}`,clear:{[n]:``}})}return!o.currentWorkspace&&e.filterDuplicates&&t.push({key:`duplicates`,label:`Duplicates`,value:e.filterDuplicates===`with`?`Only rows linked to other reports`:`Exclude rows linked to other reports`,clear:{filterDuplicates:``}}),e.filterCrossContext&&t.push({key:`cross-context`,label:`Context`,value:e.filterCrossContext===`with`?`Only rows across multiple repos or packages`:`Exclude rows across multiple repos or packages`,clear:{filterCrossContext:``}}),e.filterAppStacked&&t.push({key:`app-stacked`,label:`App stack`,value:e.filterAppStacked===`with`?`Only rows with multiple App findings`:`Exclude rows with multiple App findings`,clear:{filterAppStacked:``}}),e.filterSecurity&&t.push({key:`security`,label:`Security`,value:e.filterSecurity===`with`?`Only security-related rows`:`Exclude security-related rows`,clear:{filterSecurity:``}}),t}function w(){return n().filter(e=>t(e).commonTriage===o.shownTriage)}function T(){return o.shownTriage?p[o.shownTriage]??o.shownTriage:null}function E(t,n=s()){let r=w(),i=r.length;c(n);let a;try{a=e(r).length}finally{l()}return{included:a,total:i,excluded:i-a,fields:n,filters:C(n),bucketLabel:T(),focusedOnly:t===`print`&&o.viewMode===`focus`}}var D=`.managed-comment{container:managed-comment / inline-size;white-space:normal}.managed-comment-row{display:grid;grid-template-columns:minmax(0,max-content) minmax(0,1fr) auto;align-items:start;gap:.35rem .65rem;line-height:1.5}.managed-comment-author{grid-column:1;grid-row:1;display:flex;align-items:center;gap:.45rem;min-width:0;max-width:14rem;& strong{overflow:hidden;text-overflow:ellipsis;font-weight:600}}.managed-comment-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:1.3rem;height:1.3rem;overflow:hidden;border-radius:50%;background:rgb(from var(--muted) r g b / .15);color:var(--muted);font-size:.65rem;font-weight:600;& img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}& img[hidden]{display:none}}.managed-comment-body{grid-column:2;grid-row:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;& a{color:var(--accent);text-decoration:none}& a:hover{text-decoration:underline}& a.comment-self-ref{text-decoration:underline dotted;text-underline-offset:2px}& a.comment-self-ref:hover{text-decoration:underline solid}}.managed-comment-time{color:var(--muted);font-size:.7rem;font-weight:400;white-space:nowrap;text-align:right}.managed-comment-meta{grid-column:3;grid-row:1;justify-self:end;display:flex;align-items:center;gap:.5rem;min-height:1.3rem}.managed-comment-actions{display:flex;align-items:center;gap:.15rem}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr) auto;.managed-comment-body{grid-column:1}.managed-comment-meta{grid-column:2}}@container managed-comment (max-width: 28rem){.managed-comment-row:has(.managed-comment-meta){grid-template-columns:minmax(0,max-content) minmax(0,1fr);.managed-comment-meta{grid-column:1 / -1;grid-row:1}.managed-comment-author,.managed-comment-body{grid-row:2}}.managed-comment-row:not(:has(.managed-comment-author)){grid-template-columns:minmax(0,1fr)}.managed-comment-author{max-width:9rem}}
3
+ `;export{_ as a,v as b,y as c,b as d,C as e,w as f,T as g,E as h,D as i};
@@ -0,0 +1,2 @@
1
+ import{e,f as t,g as n,k as r}from"./chunk-4HI2MSAV.js";import{k as i}from"./chunk-JKGQ3O7O.js";function a(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}var o=(e,t)=>`${`../`.repeat(e.base.split(`/`).length-1)}${t}`;function s({root:e,paths:t},n,r){if(!e||n===`.`)return n;for(let e of r){let r=t.get(`${n}/${e}`);if(r?.endsWith(`/${e}`))return r.slice(0,-e.length-1)}let i=a(e,`${n}/`);return i===null?o(e,n):i.slice(0,-1)||`.`}function c(e,t){if(!e)return{prefix:t,from:null,to:null};let n=t.startsWith(e.other)?t:``;return{prefix:n,from:`./${e.base}${n.slice(e.other.length)}`,to:`./${n||e.other}`}}function l(...e){let t=new Set;for(let n of e){let e=i(n);for(let[r,i]of Object.entries(n?.bundle?.reason??{}))Array.isArray(i)&&i.some(t=>e.has(t))&&t.add(r)}let n=t=>e.some(e=>{if(e?.kind!==`stasis`)return!1;let n=i(e),r=e?.bundle?.reason?.[t];return new Set(Array.isArray(r)?r.filter(e=>n.has(e)):[]).size<n.size});return[...t].some(n)?[...t].toSorted().map(e=>({id:`reason:${e}`,label:e})):[]}function u(e,t=``){let n=i(e);if(!t||e?.kind!==`stasis`)return n;let r=e?.bundle?.reason?.[t.replace(/^reason:/u,``)],a=new Set(Array.isArray(r)?r:[]);return new Map([...n].filter(([e])=>a.has(e)))}function d(e,t,n,r){return JSON.stringify([e,t,n,r])}function f(e,t=``){let n=new Map;if(e?.kind!==`stasis`||!e.bundle)return n;let r=t?i(e):null,a=t?u(e,t):null;for(let[t,i]of e.bundle.imports)for(let[e,o]of i)for(let[i,s]of o){let o=typeof s==`string`?[[null,s]]:s;for(let[s,c]of o){if(a&&!a.has(e)&&(r.has(e)||!a.has(c)))continue;let o=d(e,i,t,s);n.set(o,{key:o,parent:e,specifier:i,conditions:t,platform:s,target:c})}}return n}var p=(e,{lo:t,start:n},r)=>e[n+(r-t)/2];function m(e,t,{low:n,high:r},i,a){return e===-t||e-1<n||e!==t&&e+1<=r&&p(i,a,e-1)<p(i,a,e+1)?e+1:e-1}function h(e,t,n,{first:r,n:i,m:a,d:o,...s}){e.a.fill(1,0,r).fill(1,i),e.b.fill(1,0,r).fill(1,a);let c=i,l=a;for(let r=o;r>0;r--){let i=c-l,a=m(i,r,s,t,n[r]),o=p(t,n[r],a);for(let t=a>i?o:o+1;t<c;t++)e.a[t]=e.b[t-i]=1;c=o,l=c-a}for(let t=r;t<c;t++)e.a[t]=e.b[t]=1}function g(e,t,n){let r=0,i=t.length,a=e.length,o=2*(a+i);for(;r<a&&r<i&&e[r]===t[r];)r++;for(;a>r&&i>r&&e[a-1]===t[i-1];)a--,i--;let s={high:a-r,low:r-i},c=[r],l=[{lo:1,start:0}];for(let u=0;u<=s.high-s.low;u++){let d=l[u],f=Math.min(u,s.high),g=Math.max(-u,s.low+(s.low+u&1));l.push({lo:g,start:c.length});for(let _=g;_<=f;_+=2){let f=m(_,u,s,c,d),g=p(c,d,f),v=f>_?g:g+1,y=v;for(;v<a&&v-_<i&&e[v]===t[v-_];)v++;if(o+=2+v-y,c.push(v),v>=a&&v-_>=i)return h(n,c,l,{first:r,n:a,m:i,d:u,...s}),o}}throw Error(`no edit script between two lines`)}var _=/[\p{L}\p{N}_$]+|\s+|[^\p{L}\p{N}_$\s]/gu,v=2e3,y=800,b=.6;function x(e,t){if(e.length>v)return null;let n=e.match(_)??[];return n.length>y?null:{line:e,tokens:n,words:n.map(e=>(t.has(e)||t.set(e,t.size),t.get(e)))}}function S({tokens:e,line:t},n){let r=[];for(let i=0,a=0;a<e.length;i+=e[a++].length){if(n[a])continue;let o=r.at(-1);o&&/^\s*$/u.test(t.slice(o[1],i))?o[1]=i+e[a].length:r.push([i,i+e[a].length])}return r}var C=(e,t)=>e.reduce((e,[t,n])=>e+n-t,0)/Math.max(1,t.length);function w(e,t){let n={a:e.words.map(()=>0),b:t.words.map(()=>0)},r=g(e.words,t.words,n),i={a:S(e,n.a),b:S(t,n.b)};return{ranges:i,share:n.a.includes(1)?Math.min(C(i.a,e.line),C(i.b,t.line)):1,steps:r}}function T(e,t){if(e===t)return{a:[],b:[]};let n=new Map,r=x(e,n),i=x(t,n);if(r===null||i===null)return null;let{ranges:a,share:o}=w(r,i);return o<=b?a:null}var E=200,D=5e6,O=6,k=60,A=3;function j(e){let t=new Map;for(let n of e?.tokens??[])t.set(n,(t.get(n)??0)+1);return t}function M(e,t){let n=new Map,r=[e,t].map(e=>e.map(e=>x(e,n))),i=r.map(e=>e.map(j)),a=0,o=(e,t,n)=>{let r=0;for(let[i,o]of e)if(a+=A,(r+=i.length*Math.max(0,o-(t.get(i)??0)))>b*n.length)return 1/0;return r/Math.max(1,n.length)},s=(n,a)=>r[0][n]===null||r[1][a]===null?1/0:Math.min(o(i[0][n],i[1][a],e[n]),o(i[1][a],i[0][n],t[a])),c=(e,t)=>{if(a+=k,s(e,t)===1/0)return 1/0;let{share:n,steps:i}=w(r[0][e],r[1][t]);return a+=i,n<=b?n:1/0},l=new Float64Array(e.length*t.length).fill(NaN);return{share:(n,r)=>{let i=n*t.length+r;return Number.isNaN(l[i])&&(l[i]=e[n]===t[r]?0:c(n,r)),l[i]},floor:s,spent:()=>a}}function N(e,t,{share:n,spent:r}){let i=Array.from({length:e+1},()=>new Float64Array(t+1)),a=(e,t)=>n(e,t)===1/0?-1/0:1e3-n(e,t)+i[e][t];for(let n=0;n<e;n++)for(let e=0;e<t;e++)if(i[n+1][e+1]=Math.max(i[n][e+1],i[n+1][e],a(n,e)),r()>D)return null;let o=[];for(let n=e,r=t;n>0&&r>0;)i[n][r]===i[n][r-1]?r--:i[n][r]===i[n-1][r]?n--:o.push([--n,--r]);return o.toReversed()}function P(e,t,{share:n,floor:r}){let i=[];for(let a=0,o=0;a<e&&o<t;a++){let e=null,s=1/0,c=Array.from({length:Math.min(t,o+O)-o},(e,t)=>[o+t,r(a,o+t)]);for(let[t,r]of c.toSorted((e,t)=>e[1]-t[1]||e[0]-t[0])){if(r>s)break;(n(a,t)<s||n(a,t)===s&&t<e)&&([e,s]=[t,n(a,t)])}e!==null&&(i.push([a,e]),o=e+1)}return i}function F(e,t){if(e.length>E||t.length>E)return[];let n=M(e,t);return N(e.length,t.length,n)??P(e.length,t.length,n)}var I=(e,n,r)=>t(e,n,{...r,discard:!1});function L(e){if(e===null)return``;let t=e.type===`symlink`?e.target:e.data;if(typeof t==`string`)return t.includes(`\0`)?void 0:t;if(!t.includes(0))try{return r(t)}catch{return}}var R=new Set([`none`,`all`,`change`,`trailing`]);function z({horizon:e=1/0,whitespace:t=`none`,ignoreCase:n=!1}={}){if(e!==1/0&&!(Number.isSafeInteger(e)&&e>=0))throw RangeError(`horizon must be a whole number or Infinity, not ${e}`);if(!R.has(t))throw RangeError(`whitespace must be 'none', 'all', 'change' or 'trailing', not ${t}`);if(typeof n!=`boolean`)throw TypeError(`ignoreCase must be a boolean, not ${typeof n}`);return{horizon:e,whitespace:t,ignoreCase:n}}var B=e=>e.reduce((e,{a0:t,a1:n,b0:r,b1:i})=>e+n-t+i-r,0),V=e=>e===``?[]:e.split(/(?<=\n)/u),H=e=>({...e,ignoreCase:!1,whitespace:`none`}),U=e=>(e.whitespace??`none`)!==`none`||!!e.ignoreCase;function W(t,r,i,a,o){let s=V(t),c=V(r),l=(e,t,n,r)=>({a0:e,a1:t,b0:n,b1:r,remove:s.slice(e,t),insert:c.slice(n,r)}),u=o.flatMap(({a0:e,a1:t,b0:n,b1:r})=>e===t||n===r?[l(e,t,n,r)]:I(s.slice(e,t).join(``),c.slice(n,r).join(``),i).map(t=>l(e+t.a0,e+t.a1,n+t.b0,n+t.b1))),d=B(u)<B(a)&&(a=>{try{return n(t,r,a,{format:`normal`,ignoreCase:i.ignoreCase,whitespace:i.whitespace}),!0}catch(t){if(t instanceof e)return!1;throw t}})(u)?u:a;return B(d)<B(o)?d:o}function G(e,t,n){let r=I(e,t,n);return U(n)?W(e,t,n,r,I(e,t,H(n))):r}function K(e,t,n){let r=L(e),i=L(t);if(r===void 0||i===void 0)return{binary:!0,blocks:[],insertions:null,deletions:null};let a=r===i?[]:G(r,i,n),o=(e,t)=>a.reduce((n,r)=>n+r[t]-r[e],0);return{binary:!1,blocks:a,insertions:o(`b0`,`b1`),deletions:o(`a0`,`a1`)}}function q(t,r,i,a){let{whitespace:o,ignoreCase:s}=z(a);try{return n(t,r,i,{format:`normal`,whitespace:o,ignoreCase:s}),!0}catch(t){if(t instanceof e)return!1;throw t}}var J=/[ \t\n\v\f\r]/u,Y=e=>{let t=e.split(`
2
+ `);return t.at(-1)===``&&t.pop(),t};function X(e,t){for(let n=0,r=0;;n++,r++){let i=``,a=``;for(;n<e.length&&J.test(e[n]);)i+=e[n++];for(;r<t.length&&J.test(t[r]);)a+=t[r++];if(i!==a&&new Set(i+a).size>1)return!0;if(n>=e.length||r>=t.length)return!1}}function Z(e,t,n){try{if(!q(e,t,n,{whitespace:`all`}))return!0}catch{return!0}let r=Y(e),i=Y(t),a=0,o=0;for(let e=0;e<=n.length;e++){let t=e<n.length?n[e].a0:r.length;for(;a<t;a++,o++)if(r[a]!==i[o]&&X(r[a],i[o]))return!0;e<n.length&&({a1:a,b1:o}=n[e])}return!1}function Q(e,t,{extension:n=!0}={}){let r=e.split(`/`),i=t.split(`/`),a=0;for(;a<r.length-1&&a<i.length-1&&r[a]===i[a];)a++;let o=0;for(;o<r.length-a-1&&o<i.length-a-1&&r.at(-1-o)===i.at(-1-o);)o++;let s={head:a?`${r.slice(0,a).join(`/`)}/`:``,from:r.slice(a,r.length-o).join(`/`),to:i.slice(a,i.length-o).join(`/`),tail:o?`/${r.slice(-o).join(`/`)}`:``},c=s.from.lastIndexOf(`.`);return n&&!s.from.includes(`/`)&&!s.to.includes(`/`)&&c>0&&s.to.lastIndexOf(`.`)===c&&s.from.slice(0,c)===s.to.slice(0,c)?{...s,head:s.head+s.from.slice(0,c),from:s.from.slice(c),to:s.to.slice(c)}:s}export{T as a,F as b,L as c,z as d,K as e,Z as f,Q as g,a as h,o as i,s as j,c as k,l,u as m,d as n,f as o};
@@ -0,0 +1,2 @@
1
+ import{d as e,i as t,r as n,s as r,u as i}from"./chunk-WFYLMF6Z.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}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};
@@ -0,0 +1 @@
1
+ import{a as e,d as t,j as n}from"./chunk-PXK7EU4V.js";function r(){let e=new(t?Uint32Array:Int32Array)(4096);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}for(let t=0;t<256;t++){let n=e[t];for(let r=256+t;r<e.length;r+=256)n=e[r]=n>>>8^e[n&255]}return e}var i=r(),[a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]=Array.from({length:16},(e,t)=>i.subarray(t*256,t*256+256));function x(r){n(r);let x=-1,S=0,C=r.length;if(e&&C>1024){let e=4-(r.byteOffset&3)&3;for(;S<e;S++)x=a[(x^r[S])&255]^x>>>8;let n=C-S>>>2,o=new(t?Uint32Array:Int32Array)(r.buffer,r.byteOffset+S,n),s=0;for(let e=n-3;s<e;s+=4){let e=o[s]^x,t=o[s+1],n=o[s+2],r=o[s+3];x=i[3840+(e&255)]^i[3584+(e>>>8&255)]^i[3328+(e>>>16&255)]^i[3072+(e>>>24)]^i[2816+(t&255)]^i[2560+(t>>>8&255)]^i[2304+(t>>>16&255)]^i[2048+(t>>>24)]^i[1792+(n&255)]^i[1536+(n>>>8&255)]^i[1280+(n>>>16&255)]^i[1024+(n>>>24)]^i[768+(r&255)]^i[512+(r>>>8&255)]^i[256+(r>>>16&255)]^i[r>>>24]}S+=s*4}else for(let e=C-15;S<e;S+=16)x=b[(r[S]^x)&255]^y[(r[S+1]^x>>>8)&255]^v[(r[S+2]^x>>>16)&255]^_[r[S+3]^x>>>24]^g[r[S+4]]^h[r[S+5]]^m[r[S+6]]^p[r[S+7]]^f[r[S+8]]^d[r[S+9]]^u[r[S+10]]^l[r[S+11]]^c[r[S+12]]^s[r[S+13]]^o[r[S+14]]^a[r[S+15]];for(let e=S;e<C;e++)x=a[(x^r[e])&255]^x>>>8;return~x>>>0}export{x as a};
@@ -0,0 +1,3 @@
1
+ import{b as e,c as t,k as n,o as r}from"./chunk-BC2UCLFJ.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
2
+ `,workspace:`deepview/finding-link/workspace/v1
3
+ `},d=new Map;function f(e,t){return`${e}\0${t}`}function p(e){return typeof e==`string`&&s.test(e)}async function m(e,t){let n=u[e];if(!n||typeof t!=`string`||!t)return null;let r=f(e,t),o=d.get(r);if(o!==void 0)return o;let s;try{let e=await crypto.subtle.digest(`SHA-256`,i(n+t));s=new Uint8Array(e).slice(0,a).toBase64({alphabet:`base64url`,omitPadding:!0})}catch{return null}return d.set(r,s),s}function h(e,t){return typeof t!=`string`||!t?null:d.get(f(e,t))??null}function g(e,t){let n=[];for(let[r,i]of[[`report`,e],[`workspace`,t]]){if(i==null||i===``){n.push(l);continue}if(!p(i))throw TypeError(`encodeFindingRef: ${r} must be a link hint token, not a name`);n.push(i)}return n.every(e=>e===l)?null:n[0]===l?`w${n[1]}`:n.join(``)}function _(e){let t=[e.slice(0,o),e.slice(o)].map(e=>e===l?null:e);return{report:t[0],workspace:t[1]}}function v({id:e,report:n,workspace:r}={}){if(!t(e))throw TypeError(`encodeFindingRef: a persistent finding id is required`);let i=[`finding=${encodeURIComponent(e)}`],a=g(n,r);return a&&i.push(`v=${a}`),i.join(`&`)}function y(e,t){let n=v(e);return typeof location>`u`?`${t??``}#${n}`:`${location.origin}${t??location.pathname}#${n}`}function b(n){let r=typeof n==`string`?n:typeof location>`u`?``:location.hash;if(!r)return null;let i=r.replace(/^#/u,``);if(!i)return null;let a={id:null,report:null,workspace:null};for(let n of i.split(`&`)){let r=n.indexOf(`=`);if(r<0)continue;let i=n.slice(0,r),o=n.slice(r+1);if(!o)continue;if(i===`v`){if(o.length===5&&o[0]===`w`&&p(o.slice(1))){let e=o.slice(1);Object.assign(a,{report:null,workspace:e===l?null:e});continue}if(!c.test(o))continue;Object.assign(a,_(o));continue}if(i!==`finding`||o.length>e*3)continue;let s;try{s=decodeURIComponent(o)}catch{continue}t(s)&&(a.id=s)}return a.id?a:null}function x(e,{managed:t=!1}={}){if(typeof location>`u`)return null;let i;try{i=new URL(e)}catch{return null}if(i.href!==e||i.protocol!==location.protocol||i.host!==location.host||i.username||i.password)return null;let a=r(i);if(a?.finding)return{id:a.finding.id,fragment:v(a.finding),path:n(a)};if(t&&a?.view!==`home`&&!/\/(?:index|view)\.html$/u.test(i.pathname))return null;let o=b(i.hash);if(!o)return null;let s=v(o);return{id:o.id,fragment:s,path:`/#${s}`}}function S(e,t){if(typeof e!=`string`)return!1;let n=e.replaceAll(`\\`,`/`);return n.startsWith(`${t}/`)||n.includes(`/${t}/`)}function C(e){let t=!1;for(let n of e){for(let e of n.groups??[])for(let n of e){if(S(n.file,`node_modules`))return`node_modules`;S(n.file,`vendor`)&&(t=!0)}for(let e of Object.keys(n.tree??{})){if(S(e,`node_modules`))return`node_modules`;S(e,`vendor`)&&(t=!0)}}return t?`vendor`:`dependencies`}export{S as a,C as b,m as c,h as d,v as e,y as f,b as g,x as h};
@@ -0,0 +1 @@
1
+ function e(e,{packageDir:t=null}={}){if(t){if(t!==`.`){let e=t.match(/(?:^|\/)node_modules\/(@[^/]+\/[^/]+|[^/]+)$/u);return e&&e[1]!==`.pnpm`?e[1]:t}}else{let t=/\.sol$/iu.test(e)?/(?:^|\/)(?:node_modules\/(@[^/]+\/[^/]+|[^/]+)|dependencies\/(@[^/]+\/[^/]+|[^/]+)\/)/gu:/(?:^|\/)node_modules\/(@[^/]+\/[^/]+|[^/]+)/gu,n;for(;(n=t.exec(e))!==null;){let e=n[1]??n[2];if(e!==`.pnpm`)return e}}return`__own__`}function t(t,n=null){return e(t,{packageDir:n})===`__own__`||!!n&&!/(?:^|\/)(?:node_modules|dependencies|vendor)(?:\/|$)/u.test(n)}function n(e,n=null){let r=[],i=[];for(let a of e)(t(a,n?.get(a))?r:i).push(a);return[...r,...i]}function r(e){return e===`__own__`?`Own source`:typeof e==`string`?e.match(/^(?:.*\/)?vendor\/(.+)$/u)?.[1]??e:e}function i(e){return typeof e==`string`&&/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u.test(e)?e:null}export{i as a,e as b,t as c,n as d,r as e};