@package-broker/ui 2.0.0-rc.4 → 2.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/api-types.d.ts +848 -22
- package/dist/api-types.d.ts.map +1 -1
- package/dist/assets/{access.62e9484517a0.js → access.def9a17dc4a8.js} +1 -1
- package/dist/assets/app.ec678c27ec0a.css +2 -0
- package/dist/assets/{app.c064670cdc0d.js → app.fba0d059b40b.js} +2 -2
- package/dist/assets/{audit.b7c40b9dc998.js → audit.453367b59daf.js} +1 -1
- package/dist/assets/{chunk.56d473a1587d.js → chunk.2c3648a5bad1.js} +1 -1
- package/dist/assets/{chunk.a6d755a9789f.js → chunk.304a2b5d1663.js} +1 -1
- package/dist/assets/{chunk.741aec8d1ff9.js → chunk.3f077ff17cea.js} +1 -1
- package/dist/assets/{chunk.d18497920e4d.js → chunk.4721d4544d48.js} +1 -1
- package/dist/assets/{chunk.6ea6bdcaa465.js → chunk.4acf8fa7653f.js} +1 -1
- package/dist/assets/{chunk.28a4d8aab337.js → chunk.53134c7df4e5.js} +1 -1
- package/dist/assets/{chunk.965b76812604.js → chunk.56e058d97e0f.js} +1 -1
- package/dist/assets/{chunk.3fcd6998795a.js → chunk.75e1357175af.js} +1 -1
- package/dist/assets/chunk.837eb41f53ef.js +1 -0
- package/dist/assets/{chunk.f54ea1378c8c.js → chunk.ab1a14143dc6.js} +1 -1
- package/dist/assets/{chunk.d813fefb410d.js → chunk.dc41ee9219cf.js} +1 -1
- package/dist/assets/{chunk.8442124f6802.js → chunk.f0fd799728ef.js} +1 -1
- package/dist/assets/chunk.fac952720b72.js +4 -0
- package/dist/assets/{import.e7a1e5834631.js → import.4275bbce08ac.js} +1 -1
- package/dist/assets/index.html +7 -7
- package/dist/assets/manifest.json +30 -30
- package/dist/assets/{notifications.19225fe12044.js → notifications.bd7d4c3f9882.js} +1 -1
- package/dist/assets/{npm-login.e059678af13d.js → npm-login.d8b60e11fe87.js} +1 -1
- package/dist/assets/packages.bdd474bcfc11.js +2 -0
- package/dist/assets/{projects.927fe18c785c.js → projects.44006a838c67.js} +1 -1
- package/dist/assets/{setup.8e977608d413.js → setup.7bc86366227c.js} +1 -1
- package/dist/assets/setup.html +2 -2
- package/dist/assets/sources.d95aabfbec73.js +1 -0
- package/dist/assets/{tokens.6b86d8d97e07.js → tokens.4ee13a722abb.js} +1 -1
- package/dist/auth.d.ts +1 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +13 -2
- package/dist/auth.js.map +1 -1
- package/dist/pages/audit.d.ts.map +1 -1
- package/dist/pages/packages/discovery-labels.d.ts +8 -0
- package/dist/pages/packages/discovery-labels.d.ts.map +1 -0
- package/dist/pages/packages/discovery-labels.js +25 -0
- package/dist/pages/packages/discovery-labels.js.map +1 -0
- package/dist/pages/packages/discovery-picker-view.d.ts +8 -0
- package/dist/pages/packages/discovery-picker-view.d.ts.map +1 -0
- package/dist/pages/packages/discovery-picker-view.js +109 -0
- package/dist/pages/packages/discovery-picker-view.js.map +1 -0
- package/dist/pages/packages/discovery-picker.d.ts +67 -0
- package/dist/pages/packages/discovery-picker.d.ts.map +1 -0
- package/dist/pages/packages/discovery-picker.js +238 -0
- package/dist/pages/packages/discovery-picker.js.map +1 -0
- package/dist/pages/packages/source-actions.d.ts +3 -1
- package/dist/pages/packages/source-actions.d.ts.map +1 -1
- package/dist/pages/packages/source-actions.js +19 -9
- package/dist/pages/packages/source-actions.js.map +1 -1
- package/dist/pages/sources/discovery-rule-prefill.d.ts +13 -0
- package/dist/pages/sources/discovery-rule-prefill.d.ts.map +1 -0
- package/dist/pages/sources/discovery-rule-prefill.js +9 -0
- package/dist/pages/sources/discovery-rule-prefill.js.map +1 -0
- package/dist/pages/sources/discovery-rules-view.d.ts +9 -0
- package/dist/pages/sources/discovery-rules-view.d.ts.map +1 -0
- package/dist/pages/sources/discovery-rules-view.js +144 -0
- package/dist/pages/sources/discovery-rules-view.js.map +1 -0
- package/dist/pages/sources/discovery-rules.d.ts +57 -0
- package/dist/pages/sources/discovery-rules.d.ts.map +1 -0
- package/dist/pages/sources/discovery-rules.js +383 -0
- package/dist/pages/sources/discovery-rules.js.map +1 -0
- package/dist/pages/sources.d.ts.map +1 -1
- package/dist/pages/sources.js +4 -1
- package/dist/pages/sources.js.map +1 -1
- package/dist/pending.d.ts +6 -1
- package/dist/pending.d.ts.map +1 -1
- package/dist/pending.js +1 -1
- package/dist/pending.js.map +1 -1
- package/package.json +3 -3
- package/dist/assets/app.45b156168495.css +0 -2
- package/dist/assets/chunk.51497edc7697.js +0 -4
- package/dist/assets/chunk.fd375c54b526.js +0 -1
- package/dist/assets/packages.ab5ab25b1c75.js +0 -2
- package/dist/assets/sources.ae50f239f80f.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as $e,b as tt,c as at,d as st,e as ge}from"./chunk.51497edc7697.js";import"./chunk.675b635d9462.js";import"./chunk.e3b0c44298fc.js";import{a as et}from"./chunk.28a4d8aab337.js";import{a as ot,b as nt}from"./chunk.56d473a1587d.js";import"./chunk.d18497920e4d.js";import{a as Xe,b as _e}from"./chunk.8442124f6802.js";import"./chunk.a6d755a9789f.js";import{a as oe,b as Je,c as Q}from"./chunk.965b76812604.js";import"./chunk.3fcd6998795a.js";import{a as K}from"./chunk.d813fefb410d.js";import{a as H}from"./chunk.741aec8d1ff9.js";import{A as pe,B as de,C as me,D as Ye,E as ke,F as $,G as Ke,K as Ze,c as U,d as Ce,g as J,j as Re,m as Qe,n as Ge,p as x,u as We,x as ce,y as le,z as ue}from"./chunk.fd375c54b526.js";var T=U(Ce(),1);var p=U(J(),1);function ct(t){return{visibleToNewProjects:t==="available",newProjectAccessMode:t==="request"?"request":"none"}}function lt(t,e,r,i){return t===null?e.includes("org:sources:write"):t===i&&r.includes("project:sources:write")}function rt(t){return{"If-Match":`"r${t}"`}}function ze(t,e,r,i){return t&&!e&&!r&&i==="pending"}function Fe(t){if(!["pending","not_required","approved"].includes(t.approvalState)||t.scanState==="denied")return[];let e=[];return t.approvalState==="pending"&&e.push("approve"),t.holdScan&&t.scanState==="failed"&&e.push("rescan"),(t.approvalState==="pending"||t.holdScan&&(t.approvalState==="not_required"||t.scanState==="failed"))&&e.push("reject"),e}function qt(t,e){return(!e||t.trim().length>0)&&new TextEncoder().encode(t).length<=1e3&&Array.from(t).every(r=>{let i=r.charCodeAt(0);return i>=32&&i!==127||i===9||i===10||i===13})}var it={queued:"Security scan queued",running:"Security scan running",allowed:"Security scan passed",denied:"Security scan refused",failed:"Security scan failed",not_required:"Security scan not required"};function Ve(t){return(0,p.jsx)("div",{className:"[&_button]:min-h-11",children:(0,p.jsx)(We,{children:(0,p.jsx)(ot,{...t})})})}function ut({services:t,project:e}){let[r,i]=(0,T.useState)([]),[a,b]=(0,T.useState)([]),[m,k]=(0,T.useState)([]),[s,N]=(0,T.useState)([]),[h,S]=(0,T.useState)(e?"Project":"Organization"),[v,w]=(0,T.useState)(!0),[l,q]=(0,T.useState)(!1),[f,g]=(0,T.useState)(""),[A,D]=(0,T.useState)({publishes:null,requests:null}),[u,_]=(0,T.useState)(null),[R,B]=(0,T.useState)(""),[G,y]=(0,T.useState)(""),[W,z]=(0,T.useState)(!1),[Z,ne]=(0,T.useState)(!1),[Ee,he]=(0,T.useState)(0),[X,be]=(0,T.useState)({}),ee=(0,T.useRef)(!1),ye=(0,T.useRef)(null),Y=(0,T.useRef)(0);(0,T.useEffect)(()=>{let c=++Y.current;return w(!0),q(!1),N([]),_(null),ne(!1),ee.current=!1,z(!1),(async()=>{let E=e===null?await t.client.request("get","/_pb/me/permissions"):await t.client.request("get","/_pb/projects/{project}/permissions",{params:{project:e}});if(c!==Y.current)return;let O=E.ok?"organization"in E.data&&e===null?E.data.organization:"project"in E.data?E.data.project:[]:[];if(N(O),e!==null){let[M,F]=await Promise.all([t.client.request("get","/_pb/projects/{project}",{params:{project:e}}),O.includes("project:packages:manage")?t.client.request("get","/_pb/projects/{project}/requestable-packages",{params:{project:e},query:{cursor:X.requests}}):null]);if(c!==Y.current)return;S(M.ok?`Project ${M.data.name}`:"Project"),k(F?.ok?F.data.items:[]),D({publishes:null,requests:F?.ok?F.data.next:null}),q(!E.ok||F!==null&&!F.ok)}else if(O.includes("org:packages:read")){let[M,F]=await Promise.all([t.client.request("get","/_pb/publishes",{query:{actionable:"true",cursor:X.publishes}}),t.client.request("get","/_pb/package-access-requests",{query:{state:"pending",cursor:X.requests}})]);if(c!==Y.current)return;i(M.ok?M.data.items:[]),b(F.ok?F.data.items:[]),D({publishes:M.ok?M.data.next:null,requests:F.ok?F.data.next:null}),q(!M.ok||!F.ok)}else q(!E.ok);w(!1)})(),()=>{++Y.current}},[t,e,Ee,X]),(0,T.useEffect)(()=>t.subscribeReplay?.(c=>{(c.path.startsWith("/_pb/publishes/")||c.path.startsWith("/_pb/package-access-requests/")||e&&c.path===`/_pb/projects/${encodeURIComponent(e)}/package-access-requests`)&&(g(c.ok?"Decision saved.":"Decision could not be saved. Reload and review the latest request."),he(E=>E+1))}),[t,e]);let te=c=>{_(c),B(""),y(""),ne(!1)},je=u?.kind==="publish"?s.includes("org:packages:approve"):u?.kind==="access"?s.includes("org:packages:manage"):s.includes("project:packages:manage"),ae=u?.kind!=="request"&&u?.action==="reject";async function qe(){if(!u||ee.current||!ze(je,W,Z,u.kind==="publish"?Fe(u.item).includes(u.action)?"pending":"closed":u.kind==="access"?u.item.state:"pending"))return;if(!qt(R,ae)){y("Enter a reason of at most 1000 UTF-8 bytes."),ye.current?.focus();return}ee.current=!0,z(!0),y("");let c=Y.current,E=R?{reason:R}:{},O=u.kind==="request"?await t.client.request("post","/_pb/projects/{project}/package-access-requests",{params:{project:e},body:{packageId:u.item.id,...E}}):u.kind==="publish"?await t.client.request("post",`/_pb/publishes/{id}/${u.action}`,{params:{id:u.item.id},headers:rt(u.item.revision),body:u.action==="rescan"?{}:E}):await t.client.request("post",`/_pb/package-access-requests/{id}/${u.action}`,{params:{id:u.item.id},headers:rt(u.item.revision),body:E});if(c===Y.current){if(ee.current=!1,z(!1),!O.ok){O.code==="reauth_required"&&t.requireReauth(O.request,{credential:!1,secretFields:[],display:{version:u.kind==="publish"?u.item.version:"",packageName:u.kind==="request"?u.item.name:u.item.packageName,scope:h}}),O.status===409||O.status===412?(ne(!0),y("This request changed. Reload the latest requests before reviewing again.")):y(O.code==="reauth_required"?"Sign in again, then reload and review this decision before submitting.":"The decision could not be saved. Try again.");return}g(u.kind==="request"?"Package access requested. An organization administrator must approve it.":u.kind==="publish"&&u.action==="rescan"?"Security scan queued. The version remains held until all required reviews pass.":`${u.kind==="publish"?"Publish":"Package access"} ${u.action==="approve"?"approved":"rejected"}.${u.kind==="publish"&&u.action==="approve"&&u.item.holdScan?" The package remains held until the security scan passes.":""}`),_(null),he(M=>M+1)}}let re=()=>{_(null),he(c=>c+1)};return v?(0,p.jsx)(Q,{kind:"loading",title:"Loading package requests\u2026"}):l?(0,p.jsx)(Q,{kind:"error",title:"Package requests could not be loaded.",children:(0,p.jsx)(x,{type:"button",className:"min-h-11",onClick:re,children:"Try again"})}):s.includes(e?"project:packages:manage":"org:packages:read")?(0,p.jsxs)("div",{className:"my-6 space-y-6 break-words",children:[(0,p.jsx)("p",{role:"status",children:f}),e?(0,p.jsxs)("section",{"aria-label":"Request package access",children:[(0,p.jsx)("h2",{className:"text-lg font-semibold",children:"Request package access"}),(0,p.jsxs)("p",{children:[h,". Attach the hosted source to this project first. Only packages that allow requests and have an active attached source appear here."]}),(0,p.jsxs)("p",{children:[m.length," ",m.length===1?"requestable package":"requestable packages"," on this page"]}),(0,p.jsx)(oe,{label:"Requestable packages",items:m,columns:[{key:"name",label:"Package",value:c=>c.name},{key:"action",label:"Actions",value:()=>"",render:c=>(0,p.jsx)(Ve,{entityLabel:c.name,actions:[{id:"request",label:"Request access",onSelect:()=>te({kind:"request",item:c})}]})}]}),!m.length&&(0,p.jsx)("p",{children:"No packages available to request on this page."}),A.requests&&(0,p.jsx)(x,{type:"button",className:"min-h-11",onClick:()=>be(c=>({...c,requests:A.requests})),children:"Next requestable packages"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("section",{"aria-label":"Pending publishes",children:[(0,p.jsx)("h2",{className:"text-lg font-semibold",children:"Pending publishes"}),(0,p.jsxs)("p",{children:[h,". Approval releases a version only after all required security scans pass. Rejection is permanent for this version."]}),(0,p.jsxs)("p",{children:[r.length," ",r.length===1?"held publish":"held publishes"," on this page"]}),(0,p.jsx)(oe,{label:"Pending publishes",items:r,columns:[{key:"package",label:"Package",value:c=>c.packageName,render:c=>(0,p.jsxs)(p.Fragment,{children:[c.packageName,(0,p.jsx)("span",{className:"block font-mono",children:c.version})]})},{key:"context",label:"Source and requester",value:c=>c.sourceName,render:c=>(0,p.jsxs)(p.Fragment,{children:[c.sourceName,(0,p.jsxs)("span",{className:"block",children:[c.requestedBy.name," \xB7 ",c.project?.name??"Organization"]})]})},{key:"scan",label:"Review status",value:c=>it[c.scanState],render:c=>(0,p.jsxs)(p.Fragment,{children:[it[c.scanState],(0,p.jsx)("span",{className:"block",children:c.approvalState==="pending"?"Approval pending":c.approvalState==="approved"?"Publish approved":"Approval not required"})]})},{key:"expires",label:"Expires",value:c=>c.expiresAt,render:c=>(0,p.jsx)(K,{value:c.expiresAt})},{key:"actions",label:"Actions",value:()=>"",render:c=>s.includes("org:packages:approve")?(0,p.jsx)(Ve,{entityLabel:`${c.packageName} ${c.version}`,actions:Fe(c).filter(E=>E!=="reject").map(E=>({id:E,label:E==="rescan"?"Rescan":"Approve publish",onSelect:()=>te({kind:"publish",item:c,action:E})})),overflow:Fe(c).includes("reject")?[{id:"reject",label:c.approvalState==="approved"?"Dispose failed publish":"Reject publish",variant:"destructive",onSelect:()=>te({kind:"publish",item:c,action:"reject"})}]:[]}):null}]}),!r.length&&(0,p.jsx)("p",{children:"No actionable holds on this page."}),A.publishes&&(0,p.jsx)(x,{type:"button",className:"min-h-11",onClick:()=>be(c=>({...c,publishes:A.publishes})),children:"Next publishes"})]}),(0,p.jsxs)("section",{"aria-label":"Access requests",children:[(0,p.jsx)("h2",{className:"text-lg font-semibold",children:"Access requests"}),(0,p.jsxs)("p",{children:[h,". Approval gives the named project access to this package. Other project access remains unchanged."]}),(0,p.jsxs)("p",{children:[a.length," ",a.length===1?"access request":"access requests"," on this page"]}),(0,p.jsx)(oe,{label:"Access requests",items:a,columns:[{key:"package",label:"Package",value:c=>c.packageName},{key:"project",label:"Project",value:c=>c.project.name},{key:"reason",label:"Requester and reason",value:c=>c.requestedBy.name,render:c=>(0,p.jsxs)(p.Fragment,{children:[c.requestedBy.name,(0,p.jsx)("p",{className:"whitespace-pre-wrap",children:c.reason||"No reason provided"})]})},{key:"expires",label:"Expires",value:c=>c.expiresAt,render:c=>(0,p.jsx)(K,{value:c.expiresAt})},{key:"actions",label:"Actions",value:()=>"",render:c=>s.includes("org:packages:manage")?(0,p.jsx)(Ve,{entityLabel:`${c.packageName} for ${c.project.name}`,actions:[{id:"approve",label:"Approve access",onSelect:()=>te({kind:"access",item:c,action:"approve"})}],overflow:[{id:"reject",label:"Reject access",variant:"destructive",onSelect:()=>te({kind:"access",item:c,action:"reject"})}]}):null}]}),!a.length&&(0,p.jsx)("p",{children:"No pending access requests on this page."}),A.requests&&(0,p.jsx)(x,{type:"button",className:"min-h-11",onClick:()=>be(c=>({...c,requests:A.requests})),children:"Next access requests"})]})]}),(0,p.jsx)(x,{type:"button",className:"min-h-11",variant:"outline",onClick:re,children:"Refresh requests"}),(0,p.jsx)(ce,{open:u!==null,onOpenChange:c=>{!c&&!W&&_(null)},children:(0,p.jsxs)(le,{className:"[&_button]:min-h-11 [&_button]:min-w-11",children:[(0,p.jsxs)(ue,{children:[(0,p.jsx)(de,{children:u?.kind==="request"?"Request package access":u?.action==="rescan"?"Rescan publish":u?.action==="reject"?"Reject request":"Approve request"}),(0,p.jsx)(me,{children:u?`${u.kind==="request"?u.item.name:u.item.packageName} \xB7 ${u.kind==="access"?u.item.project.name:h}. ${u.kind==="publish"?"Rejection permanently removes this version. Rescan queues another security review and keeps the version held. Approval still requires all security scans to pass.":"An approved request gives this project access to the package."}`:""})]}),(0,p.jsxs)("form",{noValidate:!0,onSubmit:c=>{c.preventDefault(),qe()},className:"space-y-4","aria-busy":W,children:[!(u?.kind==="publish"&&u.action==="rescan")&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)($,{htmlFor:"package-decision-reason",children:["Reason (",ae?"required":"optional",")"]}),(0,p.jsx)(nt,{id:"package-decision-reason",ref:ye,className:"min-h-24 w-full rounded border p-2",required:ae,value:R,disabled:W,onChange:c=>B(c.target.value),"aria-describedby":"package-reason-help package-decision-error","aria-invalid":!!G}),(0,p.jsx)("p",{id:"package-reason-help",children:"At most 1000 UTF-8 bytes. The reason is recorded with the decision."})]}),(0,p.jsx)("p",{id:"package-decision-error",role:"alert",children:G}),Z&&(0,p.jsx)(x,{type:"button",className:"min-h-11",onClick:re,children:"Reload latest requests"}),(0,p.jsxs)(pe,{children:[(0,p.jsx)(x,{type:"button",className:"min-h-11",variant:"outline",disabled:W,onClick:()=>_(null),children:"Cancel"}),(0,p.jsx)(x,{type:"submit",className:"min-h-11",disabled:W||Z,variant:ae?"destructive":"default",children:W?"Saving decision\u2026":u?.kind==="request"?"Send request":u?.kind==="publish"&&u.action==="rescan"?"Queue rescan":ae?"Confirm rejection":"Confirm approval"})]})]})]})})]}):null}var P=U(Ce(),1);var d=U(J(),1);function St(t,e,r,i){let a=`${r}/${encodeURIComponent(i)}`;return t==="npm"?`registry=${a}/npm/`:`composer config repositories.${i} composer ${a}
|
|
2
|
-
composer require ${e}`}function pt({services:t,id:e,project:r,back:i="#/packages"}){let[a,b]=(0,P.useState)(null),[m,k]=(0,P.useState)(null),[s,N]=(0,P.useState)([]),[h,S]=(0,P.useState)(r??""),[v,w]=(0,P.useState)(""),[l,q]=(0,P.useState)([]),[f,g]=(0,P.useState)([]),[A,D]=(0,P.useState)(null),[u,_]=(0,P.useState)([]),[R,B]=(0,P.useState)(),[G,y]=(0,P.useState)(null),[W,z]=(0,P.useState)(!1),[Z,ne]=(0,P.useState)(null),[Ee,he]=(0,P.useState)(0),X=(0,P.useRef)(null),[be,ee]=(0,P.useState)(!1),[ye,Y]=(0,P.useState)(""),[te,je]=(0,P.useState)(!0),[ae,qe]=(0,P.useState)(!1),[re,c]=(0,P.useState)("unavailable"),[E,O]=(0,P.useState)(!1),[M,F]=(0,P.useState)(!1),[yt,ie]=(0,P.useState)(""),[Te,Se]=(0,P.useState)(0),Ne=(0,P.useRef)(0),we=(0,P.useRef)(!1);(0,P.useEffect)(()=>{let j=!0;return++Ne.current,je(!0),qe(!1),b(null),k(null),q([]),g([]),O(!1),we.current=!1,(async()=>{let[C,He,xe]=await Promise.all([t.client.request("get","/_pb/me/permissions"),r?t.client.request("get","/_pb/projects/{project}/permissions",{params:{project:r}}):null,r?t.client.request("get","/_pb/projects/{project}",{params:{project:r}}):null]),Le=r?await t.client.request("get","/_pb/projects/{project}/packages/{package}",{params:{project:r,package:e}}):await t.client.request("get","/_pb/packages/{package}",{params:{package:e}}),Pe=Le.ok?Le.data:null,Ie=Pe;if(j){if(Le.ok||qe(!0),b(Pe),k(Ie),c(Ie?.visibleToNewProjects?"available":Ie?.newProjectAccessMode==="request"?"request":"unavailable"),F(!1),q(C.ok?C.data.organization:[]),g(He?.ok?He.data.project:[]),D(xe?.ok?xe.data.id:null),w(xe?.ok?xe.data.name:""),!r&&C.ok&&C.data.organization.includes("org:projects:read")){let De=[],Be;do{let se=await t.client.request("get","/_pb/projects",{query:{after:Be}});if(!j)return;if(!se.ok)break;De.push(...se.data.items),Be=se.data.next??void 0}while(Be);if(N(De),Pe?.source.projectId){let se=De.find(Ae=>Ae.id===Pe.source.projectId);if(se){let Ae=await t.client.request("get","/_pb/projects/{project}/permissions",{params:{project:se.slug}});if(!j)return;g(Ae.ok?Ae.data.project:[]),D(se.id)}}}je(!1)}})(),()=>{j=!1,++Ne.current}},[t,e,r,Te]),(0,P.useEffect)(()=>{if(!a)return;let j=!0;return _([]),z(!1),(async()=>{let C=r?await t.client.request("get","/_pb/projects/{project}/packages/{package}/versions",{params:{project:r,package:e},query:{after:R}}):await t.client.request("get","/_pb/packages/{package}/versions",{params:{package:e},query:{after:R}});j&&(_(C.ok?C.data.items:[]),y(C.ok?C.data.next:null),z(!C.ok))})(),()=>{j=!1}},[t,a,e,r,R,Te]),(0,P.useEffect)(()=>{let j=!0;if(ne(null),ee(!1),!h){Y("Choose a project to read the README within its package access.");return}return Y("Loading README\u2026"),t.client.request("get","/_pb/projects/{project}/packages/{package}/readme",{params:{project:h,package:e}}).then(C=>{j&&(ne(C.ok?C.data:null),ee(!C.ok&&(C.status===0||C.status>=500)),Y(C.ok?"README loaded.":C.status===403?"This project cannot read this package.":C.status===404?"No README is available for the active latest version in this project.":C.status===0||C.status>=500?"README could not be loaded. Try again.":"README is unavailable."))}),()=>{j=!1}},[t,e,h,Te,Ee]),(0,P.useEffect)(()=>t.subscribeReplay?.(j=>{j.path===`/_pb/packages/${encodeURIComponent(e)}/access`&&(j.ok?(ie("Access policy saved. Existing project access is unchanged."),Se(C=>C+1)):(F(!0),ie("The policy could not be saved. Reload the latest settings before saving.")))}),[t,e]);let Ue=a&<(a.source.projectId,l,f,A);async function jt(){if(!m||we.current||!ze(!!Ue,E,M,"pending"))return;we.current=!0,O(!0),ie("");let j=Ne.current,C=await t.client.request("patch","/_pb/packages/{package}/access",{params:{package:e},body:{...ct(re),revision:m.revision}});if(j===Ne.current){if(we.current=!1,O(!1),!C.ok){C.code==="reauth_required"&&t.requireReauth(C.request,{credential:!1,secretFields:[],display:{version:"",packageName:m.name,scope:r?`Project ${v}`:"Organization"}}),C.status===409?(F(!0),ie("This package changed while you were editing. Reload the latest settings before saving. Your selection is retained for comparison.")):ie(C.code==="reauth_required"?"Sign in again, then reload and review the access policy before saving.":"Access policy could not be saved. Try again.");return}k({...m,...C.data}),ie("Access policy saved. Existing project access is unchanged.")}}return(0,d.jsxs)("section",{"aria-labelledby":"package-detail-heading",className:"min-w-0 space-y-6 break-words",children:[(0,d.jsx)("a",{href:i,className:"inline-flex min-h-11 items-center text-blue-700 underline",children:"Back to packages"}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,d.jsx)("h1",{id:"package-detail-heading",tabIndex:-1,className:"text-2xl font-semibold",children:a?.name??"Package details"}),(0,d.jsx)(x,{type:"button",className:"min-h-11",variant:"outline",onClick:()=>Se(j=>j+1),children:"Reload package"})]}),te?(0,d.jsx)(Q,{kind:"loading",title:"Loading package\u2026"}):ae?(0,d.jsx)(Q,{kind:"error",title:"Package could not be loaded.",children:(0,d.jsx)(x,{type:"button",className:"min-h-11",onClick:()=>Se(j=>j+1),children:"Try again"})}):a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{children:[r?`Project ${v}`:"Organization"," \xB7 Source: ",a.source.name," \xB7"," ",ge[a.source.type]]}),(0,d.jsx)("p",{role:"status",children:yt}),(0,d.jsx)("a",{className:"inline-flex min-h-11 items-center text-blue-700 underline",href:`${i}${i.includes("?")?"&":"?"}package=${e}`,children:"Manage version status"}),m&&Ue&&(0,d.jsxs)("form",{className:"max-w-5xl space-y-4",onSubmit:j=>{j.preventDefault(),jt()},children:[(0,d.jsx)($,{htmlFor:"package-new-access",children:"Access for new projects"}),(0,d.jsxs)(H,{className:"min-h-11",id:"package-new-access",value:re,onChange:j=>c(j.target.value),disabled:E,"aria-describedby":"package-access-help",children:[(0,d.jsx)("option",{value:"available",children:"Available"}),(0,d.jsx)("option",{value:"request",children:"Require approval"}),(0,d.jsx)("option",{value:"unavailable",children:"Not available"})]}),(0,d.jsxs)("p",{id:"package-access-help",children:[a.source.projectId?`Project ${v||s.find(j=>j.id===a.source.projectId)?.name||"Name unavailable"}`:"Organization"," ","\xB7 ",a.name,". Available allows new projects to use this package. Require approval lets project managers request access. Not available prevents new project access. Existing project access is unchanged."]}),(0,d.jsx)(x,{className:"min-h-11",type:"submit",disabled:E||M,children:E?"Saving access policy\u2026":"Save access policy"}),M&&(0,d.jsx)(x,{type:"button",className:"min-h-11",variant:"outline",onClick:()=>Se(j=>j+1),children:"Reload latest settings"})]}),(0,d.jsx)("div",{children:!r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)($,{htmlFor:"readme-project",children:"Project for README and install instructions"}),(0,d.jsxs)(H,{className:"min-h-11",id:"readme-project",value:h,onChange:j=>S(j.target.value),children:[(0,d.jsx)("option",{value:"",children:"Choose a project"}),s.map(j=>(0,d.jsx)("option",{value:j.slug,children:j.name},j.id))]})]})}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Install"}),a.ecosystem==="npm"&&h&&(0,d.jsxs)("p",{children:["Add this line to .npmrc, then run npm install ",a.name,"."]}),h?(0,d.jsx)("pre",{className:"whitespace-pre-wrap break-all rounded border p-4",children:St(a.ecosystem,a.name,window.location.origin,h)}):(0,d.jsx)("p",{children:"Choose a project to see its registry address. Configure project credentials in your package manager."})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"README"}),(0,d.jsx)("p",{ref:X,tabIndex:-1,role:"status",children:ye}),Z&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{children:[Z.filename," \xB7 ",Z.sizeBytes," bytes"]}),(0,d.jsx)("pre",{className:"max-w-full whitespace-pre-wrap break-all rounded border p-4 font-mono text-sm",children:Z.body})]}),be&&(0,d.jsx)(x,{type:"button",className:"min-h-11",variant:"outline",onClick:()=>{X.current?.focus(),he(j=>j+1)},children:"Try again"})]}),(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"Versions"}),W?(0,d.jsx)("p",{role:"alert",children:"Versions could not be loaded. Reload the package to try again."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Oe,{item:a,versions:u,access:{organization:[],project:[],projectId:null,projectSlug:r},busy:!1,onAction:()=>{}}),u.map(j=>(0,d.jsxs)("details",{className:"my-4 rounded border p-4",children:[(0,d.jsxs)("summary",{className:"min-h-11 cursor-pointer",children:["Publication details for ",j.version]}),(0,d.jsxs)("dl",{children:[(0,d.jsx)("dt",{children:"Integrity"}),(0,d.jsx)("dd",{className:"break-all font-mono",children:j.integrity??"Unavailable"}),(0,d.jsx)("dt",{children:"Distribution tags"}),(0,d.jsx)("dd",{children:j.distTags.join(", ")||"No tags"}),(0,d.jsx)("dt",{children:"Published through the broker"}),(0,d.jsx)("dd",{children:j.publishedBy?.displayName??"Attribution unavailable"}),(0,d.jsx)("dt",{children:"Approved by"}),(0,d.jsx)("dd",{children:j.approvedBy?(0,d.jsxs)(d.Fragment,{children:[j.approvedBy.displayName," \xB7"," ",(0,d.jsx)(K,{value:j.approvedBy.decidedAt})]}):"Not approved"})]})]},j.id)),G&&(0,d.jsx)(x,{type:"button",className:"min-h-11",onClick:()=>B(G),children:"Next versions"})]})]})]}):(0,d.jsx)("p",{children:"Package unavailable in this scope."})]})}var V=U(Ce(),1);var o=U(J(),1);function dt(t){return t.status==="paused"?"Paused \xB7 Enable this source to sync.":t.lastError?"Last check failed":t.lastSuccessAt?"Last check succeeded":"Not checked yet"}function Me(t){return["packagist_proxy","npmjs_proxy","npm_registry"].includes(t.type)&&"attached"in t&&t.attached}function mt(t,e,r,i){return t.projectId===null?e.includes("org:sources:write"):t.projectId===i&&r.includes("project:sources:write")}function Nt(t){return["packagist_proxy","npmjs_proxy","npm_registry"].includes(t.type)?"Checks packages already held from this source when their metadata is due for refresh. This does not download the whole registry.":t.type==="vcs"?"Syncs the Composer package from this configured Git repository.":"Syncs packages selected in this source's settings."}function wt(t,e){let{client:r}=t,i={loading:!0,busy:!1,organization:[],permissions:[],projects:[],project:null,sources:[],error:null,notice:null,requested:[],available:null},a=new Set,b=s=>{i={...i,...s},a.forEach(N=>N())},m=0;async function k(s){let N=++m;if(b({loading:!0,busy:!1,project:null,permissions:[],sources:[],error:null,notice:null,available:null}),s===null){let l=[],q;do{let f=await r.request("get","/_pb/sources",{query:{ownership:"organization",limit:"100",...q?{after:q}:{}}});if(N!==m)return;if(!f.ok){b({loading:!1,error:"Sources could not be loaded. Try again."});return}l.push(...f.data.items),q=f.data.next??void 0}while(q);b({loading:!1,sources:l});return}let[h,S]=await Promise.all([r.request("get","/_pb/projects/{project}",{params:{project:s}}),r.request("get","/_pb/projects/{project}/permissions",{params:{project:s}})]);if(N!==m)return;if(!h.ok||h.data.status!=="active"||!S.ok){b({loading:!1,error:"Project access could not be loaded. Choose an active project."});return}let v=[],w;do{let l=await r.request("get","/_pb/projects/{project}/sources",{params:{project:s},query:{limit:"100",...w?{after:w}:{}}});if(N!==m)return;if(!l.ok){b({loading:!1,error:"Sources could not be loaded. Try again."});return}v.push(...l.data.items.filter(q=>q.attached)),w=l.data.next??void 0}while(w);b({loading:!1,project:h.data,permissions:S.data.project,sources:v})}return{snapshot:()=>i,subscribe:s=>(a.add(s),()=>{a.delete(s)}),selectProject:k,clearFeedback(){b({notice:null,error:null,available:null})},async load(){let s=await r.request("get","/_pb/me/permissions");if(b({organization:s.ok?s.data.organization:[]}),e===null){let N=[],h;do{let S=await r.request("get","/_pb/projects",{query:{status:"active",limit:"100",...h?{after:h}:{}}});if(!S.ok)break;let v=await Promise.all(S.data.items.filter(w=>w.status==="active").map(async w=>{let l=await r.request("get","/_pb/projects/{project}/permissions",{params:{project:w.slug}});return l.ok&&l.data.project.includes("project:sources:write")?w:null}));N.push(...v.filter(w=>w!==null)),h=S.data.next??void 0}while(h);b({projects:N})}await k(e)},async submit(s,N,h){let S=i.sources.find(q=>q.id===N);if(!S||i.busy||i.loading||S.status==="paused"||s==="mirror"&&(!i.project||!i.permissions.includes("project:sources:write")||!Me(S))||s==="sync"&&(!mt(S,i.organization,i.permissions,i.project?.id??null)||i.requested.includes(S.id)))return;if(h=h.trim(),s==="mirror"&&(!h||h.length>428)){b({error:"Enter a package name of 1 to 428 characters."});return}let v=m;b({busy:!0,error:null,notice:null,available:null});let w=s==="mirror"?await r.request("post","/_pb/projects/{project}/sources/{source}/packages",{params:{project:i.project.slug,source:S.id},body:{name:h}}):S.projectId===null?await r.request("post","/_pb/sources/{source}/sync",{params:{source:S.id}}):await r.request("post","/_pb/projects/{project}/sources/{source}/sync",{params:{project:i.project.slug,source:S.id}});if(v!==m)return;let l=s==="sync"?at(w):w;l.ok?b({busy:!1,notice:s==="mirror"?tt(l.status,h,S.name):$e,available:s==="mirror"&&l.status===200?{name:h,source:S.id}:null,requested:s==="sync"?[...i.requested,S.id]:i.requested}):b({busy:!1,error:l.status===403?"You no longer have permission to sync this source. Your selection has been kept.":l.code==="source_paused"?"This source is paused. Enable it before syncing.":l.code==="package_not_found"?`No packages match \u2018${h}\u2019 in ${S.name}. Check the name or choose another source.`:l.status===400?"Enter a valid package name for this source.":"Sync couldn't be queued. Try again shortly."})}}}function xt({ecosystem:t,mirror:e,setup:r,imported:i,onMirror:a,sourceLink:b}){return(0,o.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[(0,o.jsxs)("div",{className:"rounded border p-4",children:[(0,o.jsx)("h3",{className:"font-semibold",children:"From a mirror"}),(0,o.jsx)("p",{children:t==="npm"?"Find packages in a connected npm registry.":"Find packages in Packagist or another connected Composer repository."}),e?(0,o.jsx)(x,{className:"mt-2 min-h-11",onClick:a,children:"From a mirror"}):(0,o.jsx)("p",{children:"A project source manager can add packages from a mirror."})]}),t==="composer"?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"rounded border p-4",children:[(0,o.jsx)("h3",{className:"font-semibold",children:"From a connected GitHub organization"}),(0,o.jsx)("p",{children:"Choose repositories your GitHub connection can access."}),(0,o.jsx)("p",{children:"Organization picker \xB7 Coming soon"}),r?(0,o.jsx)("a",{className:"inline-flex min-h-11 items-center underline",href:`${b}&provider=github`,children:"Set up a GitHub repository source"}):(0,o.jsx)("p",{children:"Ask an organization source manager to connect GitHub."})]}),(0,o.jsxs)("div",{className:"rounded border p-4",children:[(0,o.jsx)("h3",{className:"font-semibold",children:"By repository URL"}),(0,o.jsx)("p",{children:"Add a Composer package from a Git repository."}),r?(0,o.jsx)("a",{className:"inline-flex min-h-11 items-center underline",href:b,children:"By repository URL"}):(0,o.jsx)("p",{children:"A source manager can add a Git repository."})]})]}):null,(0,o.jsxs)("div",{className:"rounded border p-4",children:[(0,o.jsx)("h3",{className:"font-semibold",children:"Import configuration"}),(0,o.jsx)("p",{children:"Bring source and package selections from a Satis configuration using the CLI."}),(0,o.jsx)("code",{className:"break-all",children:"pb import satis plan"}),i?(0,o.jsx)("a",{href:"#/import",className:"flex min-h-11 items-center underline",children:"Import review"}):(0,o.jsx)("p",{children:"An organization import manager can review imports."})]}),(0,o.jsxs)("div",{className:"lg:col-span-2",children:[(0,o.jsx)("h3",{className:"font-semibold",children:"Upload a private package"}),(0,o.jsx)("p",{children:"Publish a package archive for this project."}),(0,o.jsx)("p",{children:"Coming soon \xB7 Upload and publishing belong to #947."})]})]})}function gt({services:t,project:e,onSourcesChanged:r}){let i=(0,V.useMemo)(()=>wt(t,e),[t,e]),a=(0,V.useSyncExternalStore)(i.subscribe,i.snapshot,i.snapshot),b=a.loading?null:JSON.stringify(a.sources.map(y=>[y.id,y.name]));(0,V.useEffect)(()=>{b!==null&&r?.(a.project?.slug??e,b)},[b,r,a.project?.slug,e]);let[m,k]=(0,V.useState)(null),[s,N]=(0,V.useState)("composer"),[h,S]=(0,V.useState)(""),[v,w]=(0,V.useState)(!1),[l,q]=(0,V.useState)(""),f=(0,V.useRef)(null);(0,V.useEffect)(()=>{i.load()},[i]),(0,V.useEffect)(()=>{(a.notice||a.error)&&f.current?.focus()},[a.notice,a.error]);let g=a.sources.find(y=>y.id===h),A=a.permissions.includes("project:sources:write"),D=a.organization.includes("org:sources:write"),u=e===null?D:A,_=a.sources.filter(y=>m!=="mirror"||y.ecosystem===s&&Me(y)),R=g&&(m==="mirror"?A&&!!a.project:mt(g,a.organization,a.permissions,a.project?.id??null)),B=`#/sources?create=vcs${e?`&project=${encodeURIComponent(e)}`:""}`;function G(y){S(""),w(!1),q(""),i.clearFeedback(),k(y)}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"my-3 text-neutral-600",children:e?`Packages available to ${a.project?.name??e}.`:"Packages available across your organization."}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,o.jsx)(x,{className:"min-h-11",onClick:()=>G("choices"),children:"Add package"}),(0,o.jsx)(x,{className:"min-h-11",variant:"outline",onClick:()=>G("sync"),children:"Sync from source"})]}),m?(0,o.jsx)(ce,{open:!0,onOpenChange:y=>{y||k(null)},children:(0,o.jsxs)(le,{variant:"source",className:"lg:max-w-5xl",children:[(0,o.jsxs)(ue,{className:"shrink-0 p-6 pr-16",children:[(0,o.jsx)(de,{children:m==="sync"?"Sync from source":"Add package"}),(0,o.jsx)(me,{children:m==="sync"?"Check a source for package updates.":a.project?`Add packages to ${a.project.name}.`:"Choose how to add packages to a project."})]}),(0,o.jsxs)("div",{className:"min-h-0 overflow-y-auto px-6 pb-6",children:[a.loading?(0,o.jsx)("p",{role:"status",children:"Loading sources\u2026"}):null,m==="choices"?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)($,{htmlFor:"choice-ecosystem",children:"Ecosystem"}),(0,o.jsxs)(H,{className:"mb-4 min-h-11",id:"choice-ecosystem",value:s,onChange:y=>N(y.target.value),children:[(0,o.jsx)("option",{value:"composer",children:"Composer"}),(0,o.jsx)("option",{value:"npm",children:"npm"})]}),(0,o.jsx)(xt,{ecosystem:s,mirror:e===null?a.projects.length>0:A,setup:u,imported:a.organization.includes("org:import:write"),sourceLink:B,onMirror:()=>k("mirror")})]}):(0,o.jsxs)("form",{id:"source-action-form",className:"grid gap-4 lg:grid-cols-2",onSubmit:y=>{y.preventDefault(),g&&i.submit(m,g.id,l)},children:[e===null?(0,o.jsxs)("div",{children:[(0,o.jsx)($,{htmlFor:"destination-project",children:"Project"}),(0,o.jsxs)(H,{id:"destination-project",className:"min-h-11",disabled:a.busy,value:a.project?.slug??"",onChange:y=>{S(""),w(!1),i.selectProject(y.target.value||null)},children:[(0,o.jsx)("option",{value:"",children:m==="sync"?"Organization sources":"Choose a project"}),a.projects.map(y=>(0,o.jsx)("option",{value:y.slug,children:y.name},y.id))]})]}):null,m==="mirror"?(0,o.jsxs)("div",{children:[(0,o.jsx)($,{htmlFor:"mirror-ecosystem",children:"Ecosystem"}),(0,o.jsxs)(H,{id:"mirror-ecosystem",className:"min-h-11",value:s,disabled:a.busy,onChange:y=>{N(y.target.value),S(""),w(!1)},children:[(0,o.jsx)("option",{value:"composer",children:"Composer"}),(0,o.jsx)("option",{value:"npm",children:"npm"})]})]}):null,(0,o.jsxs)("div",{children:[(0,o.jsx)($,{htmlFor:"package-source",children:"Source"}),(0,o.jsxs)(H,{id:"package-source",className:"min-h-11",required:!0,"aria-invalid":v||void 0,"aria-describedby":v?"package-source-error":void 0,onInvalid:()=>w(!0),disabled:a.loading||a.busy,value:h,onChange:y=>{S(y.target.value),w(!1),i.clearFeedback()},children:[(0,o.jsx)("option",{value:"",children:"Choose a source"}),_.map(y=>(0,o.jsxs)("option",{value:y.id,children:[y.name," \xB7 ",ge[y.type]," \xB7 ",dt(y)]},y.id))]}),v?(0,o.jsx)("p",{id:"package-source-error",role:"alert",children:"Choose a source."}):null]}),m==="mirror"?(0,o.jsxs)("div",{children:[(0,o.jsx)($,{htmlFor:"mirror-package",children:"Find a package"}),(0,o.jsx)(ke,{id:"mirror-package",className:"min-h-11",required:!0,maxLength:428,disabled:a.busy,value:l,onChange:y=>{q(y.target.value),i.clearFeedback()},"aria-describedby":"mirror-help"}),(0,o.jsx)("p",{id:"mirror-help",children:"This source does not support search. Enter the full package name."})]}):null,(0,o.jsxs)("div",{className:"space-y-3 lg:col-span-2",children:[!_.length&&!a.loading?(0,o.jsx)("p",{children:a.project?`No sources available for ${a.project.name}. Attach a source before adding packages.`:m==="mirror"?"Choose a destination project before adding packages.":"No sources available."}):null,!_.length&&u&&!a.loading?(0,o.jsx)("a",{className:"inline-flex min-h-11 items-center underline",href:`#/sources${a.project?`?project=${encodeURIComponent(a.project.slug)}`:""}`,children:"Manage sources"}):null,g?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:g.projectId===null?"Shared organization source":`Only ${a.project?.name??e}`}),(0,o.jsx)("p",{children:dt(g)}),g.status==="paused"?(0,o.jsx)("p",{children:"This source is paused. Enable it before syncing."}):null,m==="sync"&&a.requested.includes(g.id)&&!a.notice?(0,o.jsx)("p",{role:"status",children:$e}):null,m==="sync"?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h3",{className:"font-semibold",children:Me(g)||["packagist_proxy","npmjs_proxy"].includes(g.type)?"Check cached packages for updates":"All configured packages"}),(0,o.jsx)("p",{children:Nt(g)}),g.type==="composer_repository"&&g.config&&"selection"in g.config?(0,o.jsxs)("p",{className:"break-words",children:["Configured selection:"," ",[...g.config.selection?.packages??[],...g.config.selection?.patterns??[]].join(", ")||"No packages selected."]}):null,g.projectId===null?(0,o.jsx)("p",{children:"This source is shared. Updated metadata can be used by other attached projects."}):null,R?null:(0,o.jsx)("p",{children:g.projectId===null?"An organization source manager can sync this source.":"A project source manager can sync this source."})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:"Checks this source and queues the package if it is not already available."}),(0,o.jsx)("p",{children:"This syncs the selected packages. Dependencies are fetched through your project's sources when requested."})]})]}):null]})]}),a.notice||a.error?(0,o.jsxs)("div",{ref:f,tabIndex:-1,className:"mt-4 break-words",role:a.error?"alert":"status","aria-live":"polite",children:[(0,o.jsx)("h3",{className:"font-semibold",children:a.error?"Request could not be completed":"Request outcome"}),(0,o.jsx)("p",{children:a.error??a.notice}),a.available?(0,o.jsx)("a",{className:"inline-flex min-h-11 items-center underline",href:Re("packages",{project:a.project?.slug??null,q:a.available.name,source:a.available.source}),children:"View"}):null,a.notice?(0,o.jsx)("a",{className:"inline-flex min-h-11 items-center underline",href:`#/sources${a.project?`?project=${encodeURIComponent(a.project.slug)}`:""}`,children:"View sources"}):null]}):null]}),(0,o.jsx)(pe,{className:"shrink-0 border-t bg-white p-4 pb-[max(1rem,env(safe-area-inset-bottom))]",children:m!=="choices"&&R&&g?.status!=="paused"?(0,o.jsx)(x,{className:"min-h-11",form:"source-action-form",type:"submit",disabled:a.busy||a.loading||!!a.notice||m==="sync"&&a.requested.includes(g.id),children:a.busy?"Requesting\u2026":m==="mirror"?"Add package":"Request source sync"}):null})]})}):null]})}var I=U(Ce(),1);var L=U(J(),1),Pt={not_checked:"Not checked",disabled:"Vulnerability checks disabled",unsupported_version:"Not checked: unsupported version",pending:"Not checked yet",upstream_unavailable:"Check unavailable; no result yet",incomplete:"Check incomplete; no complete result yet",expired:"Outdated result"},At={affected:{icon:"!",color:"border-red-200 bg-red-50 text-red-800"},not_affected:{icon:"i",color:"border-blue-200 bg-blue-50 text-blue-800"},unknown:{icon:"?",color:"border-neutral-200 bg-neutral-100 text-neutral-700"},stale:{icon:"\u25F7",color:"border-amber-300 bg-amber-50 text-amber-900"}};function Ct(t){return t.length<=200&&/^[A-Za-z0-9]/.test(t)&&!/[^A-Za-z0-9._-]/.test(t)?`https://osv.dev/vulnerability/${encodeURIComponent(t)}`:void 0}function ft({assessment:t,sourceType:e}){let{status:r,reason:i}=t,a=r==="unknown"&&i==="not_checked",b=["vcs","composer_repository","npm_registry","hosted"].includes(e),m=r==="affected"?`Known advisories: ${t.advisoryCount}`:r==="not_affected"?"No known advisories":r==="stale"?"Outdated result":a&&b?"Not checked: private package":i===null?"Not checked":Pt[i],k=At[r];return(0,L.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,L.jsxs)(Je,{variant:"outline",className:k.color,children:[(0,L.jsx)("span",{"aria-hidden":"true",children:k.icon})," ",m]}),a?(0,L.jsx)("p",{children:"Only verified public proxy packages are checked."}):(0,L.jsxs)(L.Fragment,{children:[t.source==="osv"?(0,L.jsxs)("p",{children:["OSV \xB7 ",r==="stale"?"Last checked":"checked"," ",(0,L.jsx)(K,{value:t.fetchedAt,fallback:"No successful check yet"})]}):null,r==="stale"&&t.lastKnownStatus!==null?(0,L.jsx)("p",{children:t.lastKnownStatus==="affected"?`Last result: known advisories: ${t.advisoryCount}`:"Last result: no known advisories"}):null,(0,L.jsxs)("details",{children:[(0,L.jsx)("summary",{className:"cursor-pointer",children:"Advisory check details"}),r==="stale"&&i==="incomplete"?(0,L.jsx)("p",{children:"Check incomplete; last complete result shown."}):null,t.advisoryCount>0&&!t.detailsComplete?(0,L.jsx)("p",{children:"Advisory details pending"}):null,t.advisoriesTruncated?(0,L.jsxs)("p",{children:["Showing ",t.advisories.length," of ",t.advisoryCount," advisories"]}):null,t.advisories.length>0?(0,L.jsx)("ul",{className:"list-disc pl-5",children:t.advisories.map(s=>{let N=Ct(s.id);return(0,L.jsxs)("li",{children:[N?(0,L.jsx)("a",{href:N,target:"_blank",rel:"noopener noreferrer",referrerPolicy:"no-referrer",className:"underline",children:s.id}):s.id," \xB7 ",s.severity.level==="unknown"?"Severity unavailable":`Severity: ${s.severity.level}`,s.detailsFetchedAt===null?(0,L.jsx)("span",{children:" \xB7 Advisory details pending"}):(0,L.jsxs)("span",{children:[" ","\xB7 Details fetched ",(0,L.jsx)(K,{value:s.detailsFetchedAt})]})]},s.id)})}):null]})]})]})}var n=U(J(),1),bt=["active","quarantined","tombstoned","removed_upstream"],Rt={quarantine:"Quarantine",tombstone:"Tombstone",release:"Release"},ht=t=>Xe[t];function kt(t){return t.organization.includes("org:packages:manage")?"Organization":`Project ${t.projectSlug}`}function fe(t){let e=new URLSearchParams(Ke(t).split("?")[1]),r={project:e.get("project")},i=e.get("status");bt.includes(i)&&(r.status=i);let a=e.get("source");a!==null&&(r.source=a);let b=e.get("projectId");r.project===null&&b!==null&&(r.projectId=b);let m=e.get("q")?.trim().toLowerCase();m&&m.length<=100&&!m.includes("\0")&&(r.q=m);let k=e.get("after");return k!==null&&(r.after=k),r}function ve(t){return Re("packages",t)}function vt(t,e,r){let i=r.organization.includes("org:packages:manage"),a=r.projectSlug!==null&&r.projectId!==null&&r.project.includes("project:packages:manage")&&t.source.projectId===r.projectId;if(!i&&!a)return[];let b=[];return(e==="active"||e==="removed_upstream")&&b.push("quarantine"),(e==="active"||e==="removed_upstream"||e==="quarantined")&&b.push("tombstone"),e==="quarantined"&&b.push("release"),b}function _t(t){let e={query:{project:null},items:[],next:null,access:{organization:[],project:[],projectId:null,projectSlug:null},selected:null,versions:[],versionsNext:null,loading:!1,versionsLoading:!1,busy:!1,notice:null,confirmVersion:null},r=new Set,i=f=>{e={...e,...f};for(let g of r)g()},a=0,b=0,m=0,k=null,s,N=t.client;async function h(f,g=null){let A=++a;++b,k=null,i({query:f,items:[],next:null,selected:null,versions:[],versionsNext:null,confirmVersion:null,loading:!0,listError:!1,versionsError:!1,versionsLoading:!1,busy:!1,notice:g,access:{organization:[],project:[],projectId:null,projectSlug:f.project}});let D={status:f.status,source:f.source,q:f.q,after:f.after},[u,_,R,B]=await Promise.all([N.request("get","/_pb/me/permissions"),f.project===null?null:N.request("get","/_pb/projects/{project}/permissions",{params:{project:f.project}}),f.project===null?null:N.request("get","/_pb/projects/{project}",{params:{project:f.project}}),f.project===null?N.request("get","/_pb/packages",{query:{...D,project:f.projectId}}):N.request("get","/_pb/projects/{project}/packages",{params:{project:f.project},query:D})]);A===a&&(k=B.ok?ve(f):null,i({loading:!1,listError:!B.ok,access:{organization:u.ok?u.data.organization:[],project:_?.ok?_.data.project:[],projectId:R?.ok?R.data.id:null,projectSlug:f.project},items:B.ok?B.data.items:[],next:B.ok?B.data.next:null,notice:[g,B.ok?null:B.status===404?"Not found.":"Packages could not be loaded. Try again."].filter(Boolean).join(" ")||null}))}async function S(f,g){if(e.busy||e.loading)return;let A=e.items.find(B=>B.id===f);if(!A)return;let D=++b,u=a,_=e.query.project;s=g,i({selected:A,versions:[],versionsNext:null,versionsLoading:!0,versionsError:!1,confirmVersion:null});let R=_===null?await N.request("get","/_pb/packages/{package}/versions",{params:{package:f},query:{after:g}}):await N.request("get","/_pb/projects/{project}/packages/{package}/versions",{params:{project:_,package:f},query:{after:g}});D!==b||u!==a||i({versionsLoading:!1,versionsError:!R.ok,versions:R.ok?R.data.items:[],versionsNext:R.ok?R.data.next:null,notice:R.ok?e.notice:R.status===404?"Not found.":"Versions could not be loaded. Try again."})}function v(){++b,s=void 0,i({selected:null,versions:[],versionsNext:null,versionsLoading:!1,confirmVersion:null})}async function w(f,g,A){let D=++m;k!==ve(f)&&await h(f),D===m&&(g?await S(g,A):v())}async function l(f=null){let g=e.selected?.id,A=s,D=a,u=m;await h(e.query,f),a===D+1&&u===m&&g&&await S(g,A)}async function q(f,g,A=!1,D=""){let u=e.selected,_=e.versions.find(Z=>Z.id===f);if(e.busy||e.loading||e.versionsLoading||!u||!_||!vt(u,_.status,e.access).includes(g))return;if(g==="tombstone"&&!A){i({confirmVersion:f});return}let R=a,B=b,G=e.query,y={package:u.id,version:_.id},W=e.access.projectSlug;i({busy:!0,notice:null});let z=e.access.organization.includes("org:packages:manage")?await N.request("post",`/_pb/packages/{package}/versions/{version}/${g}`,{params:y,body:g==="tombstone"?{reason:D}:{}}):await N.request("post",`/_pb/projects/{project}/packages/{package}/versions/{version}/${g}`,{params:{...y,project:W},body:g==="tombstone"?{reason:D}:{}});if(!(R!==a||B!==b)){if(i({busy:!1}),!z.ok&&z.code==="reauth_required"){i({confirmVersion:null}),t.requireReauth(z.request,{credential:!1,secretFields:[],display:{packageName:u.name,version:_.version,scope:kt(e.access)}});return}if(!z.ok&&z.status===404){await h(G,"Not found.");return}if(!z.ok){i({notice:z.status===409?"The version changed, refresh.":"The action could not be completed. Try again."});return}await h(G,"Version updated."),a===R+1&&await S(u.id)}}return{snapshot:()=>e,subscribe(f){return r.add(f),()=>{r.delete(f)}},async replayed(f){let g=e.query.project===null?null:`/_pb/projects/${encodeURIComponent(e.query.project)}/packages/`,A=f.path.startsWith("/_pb/packages/")?f.path.slice(14):g!==null&&f.path.startsWith(g)?f.path.slice(g.length):null;A===null||!/^[^/]+\/versions\/[^/]+\/(quarantine|tombstone|release)$/.test(A)||await l(f.ok?"Version updated.":f.status===404?"Not found.":f.status===409?"The version changed, refresh.":"The action could not be completed. Try again.")},load:h,open:S,navigate:w,refresh:l,act:q,close:v,cancelTombstone:()=>i({confirmVersion:null}),async confirmTombstone(f){if(!f.trim()||new TextEncoder().encode(f).byteLength>1e3)return;let g=e.confirmVersion;g!==null&&await q(g,"tombstone",!0,f)},dispose(){++m,++a,++b}}}function Oe(t){return(0,n.jsx)(oe,{label:`Versions of ${t.item.name}`,items:t.versions,columns:[{key:"version",label:"Version",value:e=>e.version,render:e=>(0,n.jsx)("span",{className:"font-mono",children:e.version})},{key:"status",label:"Status",value:e=>e.status,render:e=>(0,n.jsx)(_e,{status:e.status})},{key:"vulnerability",label:"Known vulnerabilities",value:e=>e.vulnerability.status,render:e=>(0,n.jsx)(ft,{assessment:e.vulnerability,sourceType:t.item.source.type})},{key:"published",label:"Published",priority:2,value:e=>e.publishedAt??"",render:e=>(0,n.jsx)(K,{value:e.publishedAt})},{key:"actions",label:"Actions",value:()=>"",render:e=>(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:vt(t.item,e.status,t.access).map(r=>(0,n.jsx)(x,{type:"button",size:"sm",variant:r==="tombstone"?"ghost":"outline",className:r==="tombstone"?"text-red-700":void 0,disabled:t.busy,"data-package-action":r,onClick:()=>t.onAction(e.id,r),children:Rt[r]},r))})}]})}function Et(t){let{state:e}=t,[r,i]=(0,I.useState)("");(0,I.useEffect)(()=>{e.confirmVersion!==null&&i("")},[e.confirmVersion]);let a=new TextEncoder().encode(r).byteLength,b=r.trim().length>0&&a<=1e3,m=e.versions.find(s=>s.id===e.confirmVersion),k=!!(e.query.q||e.query.status||e.query.source||e.query.projectId||e.query.after);return(0,n.jsxs)(n.Fragment,{children:[e.notice?(0,n.jsx)(Qe,{className:"my-4",children:(0,n.jsx)(Ge,{children:e.notice})}):null,(0,n.jsxs)("div",{className:"my-4 flex flex-wrap items-center gap-3",children:[(0,n.jsx)("span",{className:"mr-auto text-neutral-600",children:e.selected?e.selected.name:`${e.items.length} packages on this page`}),(0,n.jsx)(x,{type:"button",variant:"outline",onClick:t.onRefresh,disabled:e.loading||e.busy,children:"Refresh"})]}),e.selected===null?e.loading?(0,n.jsx)(Q,{kind:"loading",title:"Loading packages\u2026"}):e.items.length?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(oe,{label:"Packages",items:e.items,columns:[{key:"name",label:"Name",value:s=>s.name,render:s=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x,{type:"button",variant:"link",className:"h-auto min-h-11 max-w-full justify-start whitespace-normal break-words p-0 text-left",disabled:e.busy,onClick:()=>t.onOpen(s.id),children:s.name}),(0,n.jsx)("span",{className:"block text-xs text-neutral-600",children:s.ecosystem})]})},{key:"status",label:"Status",value:s=>s.status,render:s=>(0,n.jsx)(_e,{status:s.status})},{key:"latest",label:"Latest version",value:s=>s.latestVersion??"",render:s=>(0,n.jsx)("span",{className:"font-mono",children:s.latestVersion??"\u2014"})},{key:"source",label:"Winning source",priority:2,value:s=>s.source.name,render:s=>(0,n.jsxs)(n.Fragment,{children:[s.source.name,(0,n.jsx)("span",{className:"block text-xs text-neutral-600",children:ge[s.source.type]})]})},{key:"count",label:"Version count",priority:2,value:s=>s.versionCount},{key:"synced",label:"Last synced",priority:3,value:s=>s.lastSyncedAt??"",render:s=>(0,n.jsx)(K,{value:s.lastSyncedAt,fallback:"Never"})}]}),e.next?(0,n.jsx)(x,{type:"button",className:"my-4",variant:"outline",disabled:e.busy,onClick:t.onNext,children:"Next packages"}):null]}):e.listError?(0,n.jsx)(Q,{kind:"error",title:"Packages could not be loaded",children:(0,n.jsx)(x,{type:"button",variant:"outline",onClick:t.onRefresh,children:"Retry"})}):(0,n.jsx)(Q,{kind:k?"filtered-empty":"empty",title:k?"No packages match these filters":"No packages yet",children:k?"Change or clear the filters to see more packages.":`No packages yet. Add a package from a connected source, or attach a source to get started. ${st}`}):(0,n.jsxs)("section",{"aria-labelledby":"versions-heading",className:"space-y-4",children:[(0,n.jsx)(x,{type:"button",variant:"link",className:"px-0",onClick:t.onBack,disabled:e.busy,children:"\u2190 Back to packages"}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,n.jsxs)("h2",{id:"versions-heading",className:"text-lg font-semibold break-all",children:["Versions of ",e.selected.name]}),(0,n.jsx)(_e,{status:e.selected.status})]}),(0,n.jsx)(Ye,{value:e.selected.id,label:"package ID"}),e.versionsLoading?(0,n.jsx)(Q,{kind:"loading",title:"Loading versions\u2026"}):e.versions.length?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Oe,{item:e.selected,versions:e.versions,access:e.access,busy:e.busy,onAction:t.onAction}),e.versionsNext?(0,n.jsx)(x,{type:"button",variant:"outline",disabled:e.busy,onClick:t.onVersionNext,children:"Next versions"}):null]}):(0,n.jsx)(Q,{kind:e.versionsError?"error":"empty",title:e.versionsError?"Versions could not be loaded":"No versions found."})]}),e.confirmVersion!==null?(0,n.jsx)(ce,{open:!0,onOpenChange:s=>{s||t.onCancel()},children:(0,n.jsxs)(le,{children:[(0,n.jsxs)(ue,{children:[(0,n.jsxs)(de,{children:["Tombstone ",m?.version??"version","?"]}),(0,n.jsx)(me,{children:"This removes the version from package resolution. Clients can no longer install it. Only this version is affected. This cannot be undone."})]}),(0,n.jsxs)("dl",{className:"detail-list",children:[(0,n.jsx)("dt",{children:"Package"}),(0,n.jsx)("dd",{children:e.selected?.name}),(0,n.jsx)("dt",{children:"Version"}),(0,n.jsx)("dd",{className:"font-mono",children:m?.version}),(0,n.jsx)("dt",{children:"Scope"}),(0,n.jsx)("dd",{children:kt(e.access)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)($,{htmlFor:"tombstone-reason",children:"Reason (required)"}),(0,n.jsx)(ke,{id:"tombstone-reason",disabled:e.busy,required:!0,value:r,"aria-describedby":"tombstone-reason-help","aria-invalid":a>1e3,onChange:s=>i(s.target.value)}),(0,n.jsxs)("p",{id:"tombstone-reason-help",children:["Enter a reason of 1\u20131000 UTF-8 bytes. ",a," bytes used."]})]}),(0,n.jsxs)(pe,{children:[(0,n.jsx)(x,{type:"button",variant:"outline",onClick:t.onCancel,children:"Cancel"}),(0,n.jsx)(x,{type:"button",variant:"destructive",disabled:!b||e.busy,onClick:()=>t.onConfirm(r),children:"Confirm tombstone"})]})]})}):null]})}function Tt(t){let e=new Map;return Object.assign(i=>{let a=e.get(i);if(a)return a;let b=(async()=>{let m=[],k,s=!0;do{let h=i===null?await t.client.request("get","/_pb/sources",{query:{after:k}}):await t.client.request("get","/_pb/projects/{project}/sources",{params:{project:i},query:{after:k}});if(!h.ok){s=!1;break}m.push(...h.data.items),k=h.data.next??void 0}while(k);let N=[];if(i===null){k=void 0;do{let h=await t.client.request("get","/_pb/projects",{query:{after:k}});if(!h.ok){s=!1;break}N.push(...h.data.items),k=h.data.next??void 0}while(k)}return s||e.delete(i),{sources:m,projects:N}})();return e.set(i,b),b},{invalidate:()=>e.clear()})}function Lt(t){let[e,r]=(0,I.useState)(t.query),{q:i,status:a,source:b,projectId:m,project:k}=t.query;(0,I.useEffect)(()=>{r({project:k,...i?{q:i}:{},...a?{status:a}:{},...b?{source:b}:{},...m?{projectId:m}:{}})},[i,a,b,m,k]);let[s,N]=(0,I.useState)(null);(0,I.useEffect)(()=>{let l=!0;return N(null),t.loadChoices(t.query.project).then(q=>{l&&N(q)}),()=>{l=!1}},[t.loadChoices,t.query.project,t.choicesRevision]);let h=s?.sources??[],S=s?.projects??[],v=s!==null;function w(l){l.preventDefault();let q=new FormData(l.currentTarget),f=new URLSearchParams;t.query.project!==null&&f.set("project",t.query.project);for(let g of["status","source","projectId","q"]){let A=q.get(g);typeof A=="string"&&A.trim()!==""&&f.set(g,A.trim())}t.onChange(fe(`#/packages?${f}`))}return(0,n.jsx)(et,{chips:["q","status","source","projectId"].flatMap(l=>t.query[l]&&(v||l!=="source"&&l!=="projectId")?[{label:{q:"Name prefix",status:"Status",source:"Source",projectId:"Project"}[l],value:l==="source"?h.find(q=>q.id===t.query.source)?.name??"Name unavailable":l==="projectId"?S.find(q=>q.id===t.query.projectId)?.name??"Name unavailable":l==="status"?ht(t.query.status):t.query[l],onRemove:()=>{let q={...t.query};delete q[l],delete q.after,t.onChange(q)}}]:[]),children:(0,n.jsxs)("form",{onSubmit:w,className:"my-4 flex flex-wrap items-end gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)($,{htmlFor:"package-q",children:"Name prefix"}),(0,n.jsx)(ke,{id:"package-q",name:"q",maxLength:100,value:e.q??"",onChange:l=>r(q=>({...q,q:l.target.value}))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)($,{htmlFor:"package-status",children:"Status"}),(0,n.jsxs)(H,{id:"package-status",name:"status",value:e.status??"",onChange:l=>r(q=>({...q,status:l.target.value})),children:[(0,n.jsx)("option",{value:"",children:"All statuses"}),bt.map(l=>(0,n.jsx)("option",{value:l,children:ht(l)},l))]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)($,{htmlFor:"package-source",children:"Source"}),(0,n.jsxs)(H,{className:"min-h-11",id:"package-source",name:"source",value:e.source??"",onChange:l=>r(q=>({...q,source:l.target.value})),disabled:!v,children:[(0,n.jsx)("option",{value:"",children:"All sources"}),t.query.source&&!h.some(l=>l.id===t.query.source)&&(0,n.jsx)("option",{value:t.query.source,children:"Name unavailable"}),h.map(l=>(0,n.jsx)("option",{value:l.id,children:l.name},l.id))]})]}),t.query.project===null?(0,n.jsxs)("div",{children:[(0,n.jsx)($,{htmlFor:"package-project",children:"Project"}),(0,n.jsxs)(H,{className:"min-h-11",id:"package-project",name:"projectId",value:e.projectId??"",onChange:l=>r(q=>({...q,projectId:l.target.value})),disabled:!v,children:[(0,n.jsx)("option",{value:"",children:"All projects"}),t.query.projectId&&!S.some(l=>l.id===t.query.projectId)&&(0,n.jsx)("option",{value:t.query.projectId,children:"Name unavailable"}),S.map(l=>(0,n.jsx)("option",{value:l.id,children:l.name},l.id))]})]}):null,(0,n.jsx)(x,{type:"submit",children:"Apply filters"}),(0,n.jsx)(x,{type:"reset",variant:"outline",onClick:()=>t.onChange({project:t.query.project}),children:"Clear filters"})]})})}function Ea(){let t=Ze(),e=(0,I.useMemo)(()=>_t(t),[t]),[r,i]=(0,I.useState)(0),a=(0,I.useMemo)(()=>Tt(t),[t]),b=(0,I.useRef)(new Map),m=(0,I.useCallback)((v,w)=>{if(v!==void 0&&w!==void 0){let l=b.current.get(v);if(b.current.set(v,w),l===void 0||l===w)return}a.invalidate(),i(l=>l+1)},[a]),k=(0,I.useSyncExternalStore)(e.subscribe,e.snapshot,e.snapshot),[s,N]=(0,I.useState)(()=>typeof window>"u"?"#/packages":window.location.hash);(0,I.useEffect)(()=>{let v=()=>N(window.location.hash);return window.addEventListener("hashchange",v),()=>window.removeEventListener("hashchange",v)},[]),(0,I.useEffect)(()=>{if(/^#\/packages\//.test(s))return;let v=new URLSearchParams(s.split("?")[1]);return e.navigate(fe(s),v.get("package")??void 0,v.get("versionAfter")??void 0),()=>e.dispose()},[e,s]),(0,I.useEffect)(()=>t.subscribeReplay?.(v=>{v.ok&&/\/sources(?:\/|$)/.test(v.path)&&m(),e.replayed(v)}),[t,e,m]);let h=v=>{window.location.hash=ve(v)},S=/^#\/packages\/([^?]+)(?:\?|$)/.exec(s);return S?(0,n.jsx)(pt,{services:t,id:S[1],project:fe(s).project,back:ve(fe(s))},s):(0,n.jsxs)("section",{"aria-labelledby":"page-heading",children:[(0,n.jsx)("h1",{tabIndex:-1,id:"page-heading",className:"text-2xl font-semibold",children:"Packages"}),k.selected===null?(0,n.jsx)(ut,{services:t,project:fe(s).project},k.query.project):null,k.selected===null?(0,n.jsx)(gt,{services:t,project:k.query.project,onSourcesChanged:m},k.query.project):null,k.selected===null?(0,n.jsx)(Lt,{loadChoices:a,choicesRevision:r,query:fe(s),onChange:h}):null,(0,n.jsx)(Et,{state:k,onOpen:v=>{let w=new URLSearchParams(ve(k.query).split("?")[1]);window.location.hash=`#/packages/${v}${w.size?`?${w}`:""}`},onBack:()=>h(k.query),onAction:(v,w)=>{e.act(v,w)},onNext:()=>{k.next!==null&&h({...k.query,after:k.next})},onVersionNext:()=>{if(k.selected&&k.versionsNext){let v=new URLSearchParams(s.split("?")[1]);v.set("versionAfter",k.versionsNext),window.location.hash=`#/packages?${v}`}},onRefresh:()=>{e.refresh()},onConfirm:v=>{e.confirmTombstone(v)},onCancel:e.cancelTombstone})]})}export{Oe as PackageVersions,Ea as PackagesPage,Et as PackagesView,ve as buildPackagesHash,Tt as createPackageFilterChoicesLoader,_t as createPackagesController,vt as packageActions,fe as parsePackagesHash};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l}from"./chunk.51497edc7697.js";import"./chunk.675b635d9462.js";import"./chunk.e3b0c44298fc.js";import"./chunk.28a4d8aab337.js";import"./chunk.56d473a1587d.js";import"./chunk.d18497920e4d.js";import"./chunk.8442124f6802.js";import"./chunk.a6d755a9789f.js";import"./chunk.965b76812604.js";import"./chunk.3fcd6998795a.js";import"./chunk.d813fefb410d.js";import"./chunk.741aec8d1ff9.js";import"./chunk.fd375c54b526.js";export{g as CredentialFields,h as SYNC_ERROR_LABELS,i as SourceActions,l as SourcesPage,k as SourcesView,e as createSourcesModel,d as displayUrl,j as filterSources,b as sourceCredentialKind,a as sourceCredentialKinds,f as submitCredential,c as suggestedScopePatterns};
|