@package-broker/dist 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.
Files changed (40) hide show
  1. package/node/assets/{access.62e9484517a0.js → access.def9a17dc4a8.js} +1 -1
  2. package/node/assets/app.ec678c27ec0a.css +2 -0
  3. package/node/assets/{app.c064670cdc0d.js → app.fba0d059b40b.js} +2 -2
  4. package/node/assets/{audit.b7c40b9dc998.js → audit.453367b59daf.js} +1 -1
  5. package/node/assets/{chunk.56d473a1587d.js → chunk.2c3648a5bad1.js} +1 -1
  6. package/node/assets/{chunk.a6d755a9789f.js → chunk.304a2b5d1663.js} +1 -1
  7. package/node/assets/{chunk.741aec8d1ff9.js → chunk.3f077ff17cea.js} +1 -1
  8. package/node/assets/{chunk.d18497920e4d.js → chunk.4721d4544d48.js} +1 -1
  9. package/node/assets/{chunk.6ea6bdcaa465.js → chunk.4acf8fa7653f.js} +1 -1
  10. package/node/assets/{chunk.28a4d8aab337.js → chunk.53134c7df4e5.js} +1 -1
  11. package/node/assets/{chunk.965b76812604.js → chunk.56e058d97e0f.js} +1 -1
  12. package/node/assets/{chunk.3fcd6998795a.js → chunk.75e1357175af.js} +1 -1
  13. package/node/assets/chunk.837eb41f53ef.js +1 -0
  14. package/node/assets/{chunk.f54ea1378c8c.js → chunk.ab1a14143dc6.js} +1 -1
  15. package/node/assets/{chunk.d813fefb410d.js → chunk.dc41ee9219cf.js} +1 -1
  16. package/node/assets/{chunk.8442124f6802.js → chunk.f0fd799728ef.js} +1 -1
  17. package/node/assets/chunk.fac952720b72.js +4 -0
  18. package/node/assets/{import.e7a1e5834631.js → import.4275bbce08ac.js} +1 -1
  19. package/node/assets/index.html +7 -7
  20. package/node/assets/manifest.json +30 -30
  21. package/node/assets/{notifications.19225fe12044.js → notifications.bd7d4c3f9882.js} +1 -1
  22. package/node/assets/{npm-login.e059678af13d.js → npm-login.d8b60e11fe87.js} +1 -1
  23. package/node/assets/packages.bdd474bcfc11.js +2 -0
  24. package/node/assets/{projects.927fe18c785c.js → projects.44006a838c67.js} +1 -1
  25. package/node/assets/{setup.8e977608d413.js → setup.7bc86366227c.js} +1 -1
  26. package/node/assets/setup.html +2 -2
  27. package/node/assets/sources.d95aabfbec73.js +1 -0
  28. package/node/assets/{tokens.6b86d8d97e07.js → tokens.4ee13a722abb.js} +1 -1
  29. package/node/assets.json +2 -2
  30. package/node/build-info.json +4 -4
  31. package/node/generated/manifest.json +8 -2
  32. package/node/migrations/core/0010_source_discovery_rules.sql +48 -0
  33. package/node/server.js +5214 -3989
  34. package/package.json +1 -1
  35. package/prebuilt.json +37 -36
  36. package/node/assets/app.45b156168495.css +0 -2
  37. package/node/assets/chunk.51497edc7697.js +0 -4
  38. package/node/assets/chunk.fd375c54b526.js +0 -1
  39. package/node/assets/packages.ab5ab25b1c75.js +0 -2
  40. package/node/assets/sources.ae50f239f80f.js +0 -1
@@ -1 +0,0 @@
1
- var Nn=Object.create;var Qe=Object.defineProperty;var Mn=Object.getOwnPropertyDescriptor;var In=Object.getOwnPropertyNames;var Ln=Object.getPrototypeOf,Dn=Object.prototype.hasOwnProperty;var ge=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Zi=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},Hn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of In(t))!Dn.call(e,o)&&o!==r&&Qe(e,o,{get:()=>t[o],enumerable:!(n=Mn(t,o))||n.enumerable});return e};var C=(e,t,r)=>(r=e!=null?Nn(Ln(e)):{},Hn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e));var qt=ge(x=>{"use strict";var Je=Symbol.for("react.transitional.element"),jn=Symbol.for("react.portal"),zn=Symbol.for("react.fragment"),$n=Symbol.for("react.strict_mode"),Fn=Symbol.for("react.profiler"),Gn=Symbol.for("react.consumer"),Vn=Symbol.for("react.context"),qn=Symbol.for("react.forward_ref"),Yn=Symbol.for("react.suspense"),Un=Symbol.for("react.memo"),Dt=Symbol.for("react.lazy"),Bn=Symbol.for("react.activity"),Wn=Symbol.for("react.view_transition"),Nt=Symbol.iterator;function Kn(e){return e===null||typeof e!="object"?null:(e=Nt&&e[Nt]||e["@@iterator"],typeof e=="function"?e:null)}var Ht={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jt=Object.assign,zt={};function he(e,t,r){this.props=e,this.context=t,this.refs=zt,this.updater=r||Ht}he.prototype.isReactComponent={};he.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};he.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $t(){}$t.prototype=he.prototype;function et(e,t,r){this.props=e,this.context=t,this.refs=zt,this.updater=r||Ht}var tt=et.prototype=new $t;tt.constructor=et;jt(tt,he.prototype);tt.isPureReactComponent=!0;var Mt=Array.isArray;function Ze(){}var E={H:null,A:null,T:null,S:null},Ft=Object.prototype.hasOwnProperty;function rt(e,t,r){var n=r.ref;return{$$typeof:Je,type:e,key:t,ref:n!==void 0?n:null,props:r}}function Qn(e,t){return rt(e.type,t,e.props)}function nt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Je}function Xn(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var It=/\/+/g;function Xe(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Xn(""+e.key):t.toString(36)}function Zn(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ze,Ze):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function be(e,t,r,n,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Je:case jn:s=!0;break;case Dt:return s=e._init,be(s(e._payload),t,r,n,o)}}if(s)return o=o(e),s=n===""?"."+Xe(e,0):n,Mt(o)?(r="",s!=null&&(r=s.replace(It,"$&/")+"/"),be(o,t,r,"",function(d){return d})):o!=null&&(nt(o)&&(o=Qn(o,r+(o.key==null||e&&e.key===o.key?"":(""+o.key).replace(It,"$&/")+"/")+s)),t.push(o)),1;s=0;var l=n===""?".":n+":";if(Mt(e))for(var c=0;c<e.length;c++)n=e[c],i=l+Xe(n,c),s+=be(n,t,r,i,o);else if(c=Kn(e),typeof c=="function")for(e=c.call(e),c=0;!(n=e.next()).done;)n=n.value,i=l+Xe(n,c++),s+=be(n,t,r,i,o);else if(i==="object"){if(typeof e.then=="function")return be(Zn(e),t,r,n,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function Ne(e,t,r){if(e==null)return e;var n=[],o=0;return be(e,n,"","",function(i){return t.call(r,i,o++)}),n}function Jn(e){if(e._status===-1){var t=e._result,r=t();r.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n,r.status===void 0&&(r.status="fulfilled",r.value=n))},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n,r.status===void 0&&(r.status="rejected",r.reason=n))}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var Lt=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Gt(e){var t=E.T,r={};r.types=t!==null?t.types:null,E.T=r;try{var n=e(),o=E.S;o!==null&&o(r,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(Ze,Lt)}catch(i){Lt(i)}finally{t!==null&&r.types!==null&&(t.types=r.types),E.T=t}}function Vt(e){var t=E.T;if(t!==null){var r=t.types;r===null?t.types=[e]:r.indexOf(e)===-1&&r.push(e)}else Gt(Vt.bind(null,e))}var eo={map:Ne,forEach:function(e,t,r){Ne(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Ne(e,function(){t++}),t},toArray:function(e){return Ne(e,function(t){return t})||[]},only:function(e){if(!nt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};x.Activity=Bn;x.Children=eo;x.Component=he;x.Fragment=zn;x.Profiler=Fn;x.PureComponent=et;x.StrictMode=$n;x.Suspense=Yn;x.ViewTransition=Wn;x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E;x.__COMPILER_RUNTIME={__proto__:null,c:function(e){return E.H.useMemoCache(e)}};x.addTransitionType=Vt;x.cache=function(e){return function(){return e.apply(null,arguments)}};x.cacheSignal=function(){return null};x.cloneElement=function(e,t,r){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=jt({},e.props),o=e.key;if(t!=null)for(i in t.key!==void 0&&(o=""+t.key),t)!Ft.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(n[i]=t[i]);var i=arguments.length-2;if(i===1)n.children=r;else if(1<i){for(var s=Array(i),l=0;l<i;l++)s[l]=arguments[l+2];n.children=s}return rt(e.type,o,n)};x.createContext=function(e){return e={$$typeof:Vn,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Gn,_context:e},e};x.createElement=function(e,t,r){var n,o={},i=null;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)Ft.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(o[n]=t[n]);var s=arguments.length-2;if(s===1)o.children=r;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(n in s=e.defaultProps,s)o[n]===void 0&&(o[n]=s[n]);return rt(e,i,o)};x.createRef=function(){return{current:null}};x.forwardRef=function(e){return{$$typeof:qn,render:e}};x.isValidElement=nt;x.lazy=function(e){return{$$typeof:Dt,_payload:{_status:-1,_result:e},_init:Jn}};x.memo=function(e,t){return{$$typeof:Un,type:e,compare:t===void 0?null:t}};x.startTransition=Gt;x.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()};x.use=function(e){return E.H.use(e)};x.useActionState=function(e,t,r){return E.H.useActionState(e,t,r)};x.useCallback=function(e,t){return E.H.useCallback(e,t)};x.useContext=function(e){return E.H.useContext(e)};x.useDebugValue=function(){};x.useDeferredValue=function(e,t){return E.H.useDeferredValue(e,t)};x.useEffect=function(e,t){return E.H.useEffect(e,t)};x.useEffectEvent=function(e){return E.H.useEffectEvent(e)};x.useId=function(){return E.H.useId()};x.useImperativeHandle=function(e,t,r){return E.H.useImperativeHandle(e,t,r)};x.useInsertionEffect=function(e,t){return E.H.useInsertionEffect(e,t)};x.useLayoutEffect=function(e,t){return E.H.useLayoutEffect(e,t)};x.useMemo=function(e,t){return E.H.useMemo(e,t)};x.useOptimistic=function(e,t){return E.H.useOptimistic(e,t)};x.useReducer=function(e,t,r){return E.H.useReducer(e,t,r)};x.useRef=function(e){return E.H.useRef(e)};x.useState=function(e){return E.H.useState(e)};x.useSyncExternalStore=function(e,t,r){return E.H.useSyncExternalStore(e,t,r)};x.useTransition=function(){return E.H.useTransition()};x.version="19.3.0"});var B=ge((ts,Yt)=>{"use strict";Yt.exports=qt()});var Bt=ge(Me=>{"use strict";var to=Symbol.for("react.transitional.element"),ro=Symbol.for("react.fragment");function Ut(e,t,r){var n=null;if(r!==void 0&&(n=""+r),t.key!==void 0&&(n=""+t.key),"key"in t){r={};for(var o in t)o!=="key"&&(r[o]=t[o])}else r=t;return t=r.ref,{$$typeof:to,type:e,key:n,ref:t!==void 0?t:null,props:r}}Me.Fragment=ro;Me.jsx=Ut;Me.jsxs=Ut});var P=ge((ns,Wt)=>{"use strict";Wt.exports=Bt()});var zr=ge(j=>{"use strict";var ui=B();function jr(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function se(){}var F={d:{f:se,r:function(){throw Error(jr(522))},D:se,C:se,L:se,m:se,X:se,S:se,M:se},p:0,findDOMNode:null},fi=Symbol.for("react.portal"),pi=Symbol.for("react.recoverable"),Hr=Symbol.for("react.optimistic_key");function mi(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:fi,key:n==null?null:n===Hr?Hr:""+n,children:e,containerInfo:t,implementation:r}}var _e=ui.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Fe(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}j.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F;j.browser=function(e){return{$$typeof:pi,_reason:e}};j.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(jr(299));return mi(e,t,null,r)};j.flushSync=function(e){var t=_e.T,r=F.p;try{if(_e.T=null,F.p=2,e)return e()}finally{_e.T=t,F.p=r,F.d.f()}};j.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,F.d.C(e,t))};j.prefetchDNS=function(e){typeof e=="string"&&F.d.D(e)};j.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var r=t.as,n=Fe(r,t.crossOrigin),o=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;r==="style"?F.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):r==="script"&&F.d.X(e,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};j.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var r=Fe(t.as,t.crossOrigin);F.d.M(e,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&F.d.M(e)};j.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var r=t.as,n=Fe(r,t.crossOrigin);F.d.L(e,r,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};j.preloadModule=function(e,t){if(typeof e=="string")if(t){var r=Fe(t.as,t.crossOrigin);F.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else F.d.m(e)};j.requestFormReset=function(e){F.d.r(e)};j.unstable_batchedUpdates=function(e,t){return e(t)};j.useFormState=function(e,t,r){return _e.H.useFormState(e,t,r)};j.useFormStatus=function(){return _e.H.useHostTransitionStatus()};j.version="19.3.0"});var gt=ge((Es,Fr)=>{"use strict";function $r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($r)}catch(e){console.error(e)}}$r(),Fr.exports=zr()});var ot="pb.pending-action.v2",no="pb.pending-action";var oo=new Set(["method","path","idempotencyKey","body","headers","requiresCredential","savedAt","display"]),Kt=["If-Match","If-None-Match"],io=4096;function Ie(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Qt(e){return typeof e=="string"&&e.length<=io&&![...e].some(t=>{let r=t.charCodeAt(0);return r<32||r>=127&&r<=159})}function so(e){let t={};if(e===void 0)return t;if(!Ie(e))return!1;for(let[r,n]of Object.entries(e)){let o=Kt.find(i=>i.toLowerCase()===r.toLowerCase());if(o!==void 0){if(Object.hasOwn(t,o)||!Qt(n))return!1;t[o]=n}}return t}function ao(e){return e===void 0||Ie(e)&&Object.entries(e).every(([t,r])=>Kt.some(n=>n===t)&&Qt(r))}function lo(e){return typeof e=="string"&&e.startsWith("/_pb/")&&!e.includes("//")&&!/[\\:?#{}\s]/.test(e)&&!e.split("/").some(t=>{let r=t.replace(/%2e/gi,".");return r==="."||r===".."})}function Xt(e){return typeof e.method=="string"&&/^(GET|HEAD|OPTIONS|POST|PUT|PATCH|DELETE)$/.test(e.method)&&lo(e.path)&&(e.idempotencyKey===void 0||typeof e.idempotencyKey=="string")}function Zt(e){return Ie(e)&&Object.keys(e).length===3&&["packageName","version","scope"].every(t=>typeof e[t]=="string"&&e[t].length>0&&e[t].length<=256)}function co(e){return Ie(e)&&Object.keys(e).every(t=>oo.has(t))&&Xt(e)&&(e.display===void 0||Zt(e.display))&&ao(e.headers)&&(e.requiresCredential===void 0||e.requiresCredential===!0&&e.body===void 0)&&typeof e.savedAt=="number"&&Number.isFinite(e.savedAt)}function uo(e,t){let r=JSON.parse(JSON.stringify(e));for(let n of t){let o=n.split("."),i=r;for(let l of o.slice(0,-1)){if(i===null||typeof i!="object"||!Object.hasOwn(i,l)){i=void 0;break}i=i[l]}let s=o[o.length-1];i!==null&&typeof i=="object"&&Object.hasOwn(i,s)&&delete i[s]}return r}function Jt(e,t){try{if(!Xt(t)||t.display!==void 0&&!Zt(t.display)||typeof t.credential!="boolean"||!Array.isArray(t.secretFields)||!t.secretFields.every(o=>typeof o=="string"))return{ok:!1};let r=so(t.headers);if(r===!1)return{ok:!1};let n={method:t.method,path:t.path,...t.idempotencyKey===void 0?{}:{idempotencyKey:t.idempotencyKey},...Object.keys(r).length===0?{}:{headers:r},...t.credential?{requiresCredential:!0}:{},...!t.credential&&t.body!==void 0?{body:uo(t.body,t.secretFields)}:{},...t.display===void 0?{}:{display:{...t.display}},savedAt:Date.now()};return e.setItem(ot,JSON.stringify(n)),{ok:!0}}catch{return{ok:!1}}}function it(e,t){try{e.removeItem(no);let r=e.getItem(ot);if(e.removeItem(ot),r===null)return{ok:!0,action:null};let n;try{n=JSON.parse(r)}catch{return{ok:!0,action:null}}return!co(n)||!Number.isFinite(t)||t<n.savedAt||t-n.savedAt>6e5?{ok:!0,action:null}:{ok:!0,action:n}}catch{return{ok:!1}}}var er={project:64,status:64,source:26,projectId:26,q:200,after:4096,package:26,versionAfter:4096,cursor:4096,run:26,actor:200,action:200,filterProject:200,limit:3};function tr(e,t={}){let r=[];for(let n of Object.keys(er)){let o=t[n];if(!(o==null||o.length===0||o.length>er[n])&&!(n==="project"&&/[^A-Za-z0-9._-]/.test(o))&&!((n==="source"||n==="projectId")&&(e!=="packages"||!/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/.test(o)))&&!((n==="package"||n==="versionAfter")&&e!=="packages")&&!((n==="run"||n==="cursor")&&e!=="import")&&!(["actor","action","filterProject","limit"].includes(n)&&e!=="audit")&&!((n==="package"||n==="run")&&!/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/.test(o)))try{r.push(`${n}=${encodeURIComponent(o)}`)}catch{}}return`#/${e}${r.length===0?"":`?${r.join("&")}`}`}function rr(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=rr(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Le(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=rr(e))&&(n&&(n+=" "),n+=t);return n}var nr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,or=Le,De=(e,t)=>r=>{var n;if(t?.variants==null)return or(e,r?.class,r?.className);let{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(d=>{let _=r?.[d],S=i?.[d];if(_===null)return null;let k=nr(_)||nr(S);return o[d][k]}),l=r&&Object.entries(r).reduce((d,_)=>{let[S,k]=_;return k===void 0||(d[S]=k),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,_)=>{let{class:S,className:k,...y}=_;return Object.entries(y).every(h=>{let[v,u]=h;return Array.isArray(u)?u.includes({...i,...l}[v]):{...i,...l}[v]===u})?[...d,S,k]:d},[]);return or(e,s,c,r?.class,r?.className)};var fo=(e,t)=>{let r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},po=(e,t)=>({classGroupId:e,validator:t}),dr=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r});var ir=[],mo="arbitrary..",go=e=>{let t=ho(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return bo(s);let l=s.split("-"),c=l[0]===""&&l.length>1?1:0;return ur(l,c,t)},getConflictingClassGroupIds:(s,l)=>{if(l){let c=n[s],d=r[s];return c?d?fo(d,c):c:d||ir}return r[s]||ir}}},ur=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;let o=e[t],i=r.nextPart.get(o);if(i){let d=ur(e,t+1,i);if(d)return d}let s=r.validators;if(s===null)return;let l=t===0?e.join("-"):e.slice(t).join("-"),c=s.length;for(let d=0;d<c;d++){let _=s[d];if(_.validator(l))return _.classGroupId}},bo=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{let t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?mo+n:void 0})(),ho=e=>{let{theme:t,classGroups:r}=e;return yo(r,t)},yo=(e,t)=>{let r=dr();for(let n in e){let o=e[n];at(o,r,n,t)}return r},at=(e,t,r,n)=>{let o=e.length;for(let i=0;i<o;i++){let s=e[i];vo(s,t,r,n)}},vo=(e,t,r,n)=>{if(typeof e=="string"){wo(e,t,r);return}if(typeof e=="function"){xo(e,t,r,n);return}ko(e,t,r,n)},wo=(e,t,r)=>{let n=e===""?t:fr(t,e);n.classGroupId=r},xo=(e,t,r,n)=>{if(So(e)){at(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(po(r,e))},ko=(e,t,r,n)=>{let o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){let[l,c]=o[s];at(c,fr(t,l),r,n)}},fr=(e,t)=>{let r=e,n=t.split("-"),o=n.length;for(let i=0;i<o;i++){let s=n[i],l=r.nextPart.get(s);l||(l=dr(),r.nextPart.set(s,l)),r=l}return r},So=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,_o=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}};var Ro=[],sr=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Co=e=>{let{prefix:t,experimentalParseClassName:r}=e,n=o=>{let i=[],s=0,l=0,c=0,d,_=o.length;for(let v=0;v<_;v++){let u=o[v];if(s===0&&l===0){if(u===":"){i.push(o.slice(c,v)),c=v+1;continue}if(u==="/"){d=v;continue}}u==="["?s++:u==="]"?s--:u==="("?l++:u===")"&&l--}let S=i.length===0?o:o.slice(c),k=S,y=!1;S.endsWith("!")?(k=S.slice(0,-1),y=!0):S.startsWith("!")&&(k=S.slice(1),y=!0);let h=d&&d>c?d-c:void 0;return sr(i,y,k,h)};if(t){let o=t+":",i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):sr(Ro,!1,s,void 0,!0)}if(r){let o=n;n=i=>r({className:i,parseClassName:o})}return n},Eo=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{let n=[],o=[];for(let i=0;i<r.length;i++){let s=r[i],l=s[0]==="[",c=t.has(s);l||c?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Ao=e=>({cache:_o(e.cacheSize),parseClassName:Co(e),sortModifiers:Eo(e),postfixLookupClassGroupIds:To(e),...go(e)}),To=e=>{let t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},Po=/\s+/,Oo=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=t,l=[],c=e.trim().split(Po),d="";for(let _=c.length-1;_>=0;_-=1){let S=c[_],{isExternal:k,modifiers:y,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:u}=r(S);if(k){d=S+(d.length>0?" "+d:d);continue}let w=!!u,m;if(w){let Y=v.substring(0,u);m=n(Y);let g=m&&s[m]?n(v):void 0;g&&g!==m&&(m=g,w=!1)}else m=n(v);if(!m){if(!w){d=S+(d.length>0?" "+d:d);continue}if(m=n(v),!m){d=S+(d.length>0?" "+d:d);continue}w=!1}let T=y.length===0?"":y.length===1?y[0]:i(y).join(":"),W=h?T+"!":T,K=W+m;if(l.indexOf(K)>-1)continue;l.push(K);let q=o(m,w);for(let Y=0;Y<q.length;++Y){let g=q[Y];l.push(W+g)}d=S+(d.length>0?" "+d:d)}return d},No=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=pr(r))&&(o&&(o+=" "),o+=n);return o},pr=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=pr(e[n]))&&(r&&(r+=" "),r+=t);return r},Mo=(e,...t)=>{let r,n,o,i,s=c=>{let d=t.reduce((_,S)=>S(_),e());return r=Ao(d),n=r.cache.get,o=r.cache.set,i=l,l(c)},l=c=>{let d=n(c);if(d)return d;let _=Oo(c,r);return o(c,_),_};return i=s,(...c)=>i(No(...c))},Io=[],O=e=>{let t=r=>r[e]||Io;return t.isThemeGetter=!0,t.themeKey=e,t},mr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Do=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ho=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,zo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$o=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=e=>Lo.test(e),R=e=>!!e&&!Number.isNaN(Number(e)),X=e=>!!e&&Number.isInteger(Number(e)),st=e=>e.endsWith("%")&&R(e.slice(0,-1)),J=e=>Do.test(e),br=()=>!0,Fo=e=>Ho.test(e)&&!jo.test(e),lt=()=>!1,Go=e=>zo.test(e),Vo=e=>$o.test(e),qo=e=>!f(e)&&!p(e),Yo=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Uo=e=>ie(e,vr,lt),f=e=>mr.test(e),ue=e=>ie(e,wr,Fo),ar=e=>ie(e,ei,R),Bo=e=>ie(e,kr,br),Wo=e=>ie(e,xr,lt),lr=e=>ie(e,hr,lt),Ko=e=>ie(e,yr,Vo),He=e=>ie(e,Sr,Go),p=e=>gr.test(e),we=e=>fe(e,wr),Qo=e=>fe(e,xr),cr=e=>fe(e,hr),Xo=e=>fe(e,vr),Zo=e=>fe(e,yr),je=e=>fe(e,Sr,!0),Jo=e=>fe(e,kr,!0),ie=(e,t,r)=>{let n=mr.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},fe=(e,t,r=!1)=>{let n=gr.exec(e);return n?n[1]?t(n[1]):r:!1},hr=e=>e==="position"||e==="percentage",yr=e=>e==="image"||e==="url",vr=e=>e==="length"||e==="size"||e==="bg-size",wr=e=>e==="length",ei=e=>e==="number",xr=e=>e==="family-name",kr=e=>e==="number"||e==="weight",Sr=e=>e==="shadow";var ti=()=>{let e=O("color"),t=O("font"),r=O("text"),n=O("font-weight"),o=O("tracking"),i=O("leading"),s=O("breakpoint"),l=O("container"),c=O("spacing"),d=O("radius"),_=O("shadow"),S=O("inset-shadow"),k=O("text-shadow"),y=O("drop-shadow"),h=O("blur"),v=O("perspective"),u=O("aspect"),w=O("ease"),m=O("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],K=()=>[...W(),p,f],q=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto","contain","none"],g=()=>[p,f,c],N=()=>[oe,"full","auto",...g()],Ee=()=>[X,"none","subgrid",p,f],Z=()=>["auto",{span:["full",X,p,f]},X,p,f],ae=()=>[X,"auto",p,f],le=()=>["auto","min","max","fr",p,f],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],re=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...g()],ne=()=>[oe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...g()],de=()=>[l,oe,"screen","full","dvw","lvw","svw","min","max","fit",...g()],ve=()=>[oe,"screen","full","lh","dvh","lvh","svh","min","max","fit",...g()],b=()=>[e,p,f],Et=()=>[...W(),cr,lr,{position:[p,f]}],At=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Tt=()=>["auto","cover","contain",Xo,Uo,{size:[p,f]}],We=()=>[st,we,ue],z=()=>["","none","full",d,p,f],$=()=>["",R,we,ue],Ae=()=>["solid","dashed","dotted","double"],Pt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>[R,st,cr,lr],Ot=()=>["","none",h,p,f],Te=()=>["none",R,p,f],Pe=()=>["none",R,p,f],Ke=()=>[R,p,f],Oe=()=>[oe,"full",...g()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[J],breakpoint:[J],color:[br],container:[J],"drop-shadow":[J],ease:["in","out","in-out"],font:[qo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[J],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[J],shadow:[J],spacing:["px",R],text:[J],"text-shadow":[J],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oe,f,p,u]}],container:["container"],"container-type":[{"@container":["","normal","size",p,f]}],"container-named":[Yo],columns:[{columns:[R,"auto",f,p,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:K()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[X,"auto",p,f]}],basis:[{basis:[oe,"full","auto",l,...g()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[R,oe,"auto","initial","none",f]}],grow:[{grow:["",R,p,f]}],shrink:[{shrink:["",R,p,f]}],order:[{order:[X,"first","last","none",p,f]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:g()}],"gap-x":[{"gap-x":g()}],"gap-y":[{"gap-y":g()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...re(),"normal"]}],"justify-self":[{"justify-self":["auto",...re()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...re(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...re(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...re(),"baseline"]}],"place-self":[{"place-self":["auto",...re()]}],p:[{p:g()}],px:[{px:g()}],py:[{py:g()}],ps:[{ps:g()}],pe:[{pe:g()}],pbs:[{pbs:g()}],pbe:[{pbe:g()}],pt:[{pt:g()}],pr:[{pr:g()}],pb:[{pb:g()}],pl:[{pl:g()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":g()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":g()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],"inline-size":[{inline:["auto",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"block-size":[{block:["auto",...ve()]}],"min-block-size":[{"min-block":["auto",...ve()]}],"max-block-size":[{"max-block":["none",...ve()]}],w:[{w:[l,"screen",...ne()]}],"min-w":[{"min-w":[l,"screen","none",...ne()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[s]},...ne()]}],h:[{h:["screen","lh",...ne()]}],"min-h":[{"min-h":["screen","lh","none",...ne()]}],"max-h":[{"max-h":["screen","lh","none",...ne()]}],"font-size":[{text:["base",r,we,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Jo,Bo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",st,f]}],"font-family":[{font:[Qo,Wo,t]}],"font-features":[{"font-features":[f]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,p,f]}],"line-clamp":[{"line-clamp":[R,"none",p,ar]}],leading:[{leading:["none",i,...g()]}],"list-image":[{"list-image":["none",p,f]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",p,f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:b()}],"text-color":[{text:b()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[R,"from-font","auto",p,ue]}],"text-decoration-color":[{decoration:b()}],"underline-offset":[{"underline-offset":[R,"auto",p,f]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:g()}],"tab-size":[{tab:[X,p,f]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",p,f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",p,f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Et()}],"bg-repeat":[{bg:At()}],"bg-size":[{bg:Tt()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},X,p,f],radial:["",p,f],conic:["",X,p,f]},Zo,Ko]}],"bg-color":[{bg:b()}],"gradient-from-pos":[{from:We()}],"gradient-via-pos":[{via:We()}],"gradient-to-pos":[{to:We()}],"gradient-from":[{from:b()}],"gradient-via":[{via:b()}],"gradient-to":[{to:b()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-bs":[{"border-bs":$()}],"border-w-be":[{"border-be":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:b()}],"border-color-x":[{"border-x":b()}],"border-color-y":[{"border-y":b()}],"border-color-s":[{"border-s":b()}],"border-color-e":[{"border-e":b()}],"border-color-bs":[{"border-bs":b()}],"border-color-be":[{"border-be":b()}],"border-color-t":[{"border-t":b()}],"border-color-r":[{"border-r":b()}],"border-color-b":[{"border-b":b()}],"border-color-l":[{"border-l":b()}],"divide-color":[{divide:b()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[R,p,f]}],"outline-w":[{outline:["",R,we,ue]}],"outline-color":[{outline:b()}],shadow:[{shadow:["","inner","none",_,je,He]}],"shadow-color":[{shadow:b()}],"inset-shadow":[{"inset-shadow":["none",S,je,He]}],"inset-shadow-color":[{"inset-shadow":b()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:b()}],"ring-offset-w":[{"ring-offset":[R,ue]}],"ring-offset-color":[{"ring-offset":b()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":b()}],"text-shadow":[{"text-shadow":["none",k,je,He]}],"text-shadow-color":[{"text-shadow":b()}],opacity:[{opacity:[R,p,f]}],"mix-blend":[{"mix-blend":[...Pt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Pt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[R]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":b()}],"mask-image-linear-to-color":[{"mask-linear-to":b()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":b()}],"mask-image-t-to-color":[{"mask-t-to":b()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":b()}],"mask-image-r-to-color":[{"mask-r-to":b()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":b()}],"mask-image-b-to-color":[{"mask-b-to":b()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":b()}],"mask-image-l-to-color":[{"mask-l-to":b()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":b()}],"mask-image-x-to-color":[{"mask-x-to":b()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":b()}],"mask-image-y-to-color":[{"mask-y-to":b()}],"mask-image-radial":[{"mask-radial":[p,f]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":b()}],"mask-image-radial-to-color":[{"mask-radial-to":b()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":W()}],"mask-image-conic-pos":[{"mask-conic":[R]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":b()}],"mask-image-conic-to-color":[{"mask-conic-to":b()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Et()}],"mask-repeat":[{mask:At()}],"mask-size":[{mask:Tt()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",p,f]}],filter:[{filter:["","none",p,f]}],blur:[{blur:Ot()}],brightness:[{brightness:[R,p,f]}],contrast:[{contrast:[R,p,f]}],"drop-shadow":[{"drop-shadow":["","none",y,je,He]}],"drop-shadow-color":[{"drop-shadow":b()}],grayscale:[{grayscale:["",R,p,f]}],"hue-rotate":[{"hue-rotate":[R,p,f]}],invert:[{invert:["",R,p,f]}],saturate:[{saturate:[R,p,f]}],sepia:[{sepia:["",R,p,f]}],"backdrop-filter":[{"backdrop-filter":["","none",p,f]}],"backdrop-blur":[{"backdrop-blur":Ot()}],"backdrop-brightness":[{"backdrop-brightness":[R,p,f]}],"backdrop-contrast":[{"backdrop-contrast":[R,p,f]}],"backdrop-grayscale":[{"backdrop-grayscale":["",R,p,f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R,p,f]}],"backdrop-invert":[{"backdrop-invert":["",R,p,f]}],"backdrop-opacity":[{"backdrop-opacity":[R,p,f]}],"backdrop-saturate":[{"backdrop-saturate":[R,p,f]}],"backdrop-sepia":[{"backdrop-sepia":["",R,p,f]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":g()}],"border-spacing-x":[{"border-spacing-x":g()}],"border-spacing-y":[{"border-spacing-y":g()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",p,f]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[R,"initial",p,f]}],ease:[{ease:["linear","initial",w,p,f]}],delay:[{delay:[R,p,f]}],animate:[{animate:["none",m,p,f]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,p,f]}],"perspective-origin":[{"perspective-origin":K()}],rotate:[{rotate:Te()}],"rotate-x":[{"rotate-x":Te()}],"rotate-y":[{"rotate-y":Te()}],"rotate-z":[{"rotate-z":Te()}],scale:[{scale:Pe()}],"scale-x":[{"scale-x":Pe()}],"scale-y":[{"scale-y":Pe()}],"scale-z":[{"scale-z":Pe()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[p,f,"","none","gpu","cpu"]}],"transform-origin":[{origin:K()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],zoom:[{zoom:[X,p,f]}],accent:[{accent:b()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:b()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",p,f]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":b()}],"scrollbar-track-color":[{"scrollbar-track":b()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":g()}],"scroll-mx":[{"scroll-mx":g()}],"scroll-my":[{"scroll-my":g()}],"scroll-ms":[{"scroll-ms":g()}],"scroll-me":[{"scroll-me":g()}],"scroll-mbs":[{"scroll-mbs":g()}],"scroll-mbe":[{"scroll-mbe":g()}],"scroll-mt":[{"scroll-mt":g()}],"scroll-mr":[{"scroll-mr":g()}],"scroll-mb":[{"scroll-mb":g()}],"scroll-ml":[{"scroll-ml":g()}],"scroll-p":[{"scroll-p":g()}],"scroll-px":[{"scroll-px":g()}],"scroll-py":[{"scroll-py":g()}],"scroll-ps":[{"scroll-ps":g()}],"scroll-pe":[{"scroll-pe":g()}],"scroll-pbs":[{"scroll-pbs":g()}],"scroll-pbe":[{"scroll-pbe":g()}],"scroll-pt":[{"scroll-pt":g()}],"scroll-pr":[{"scroll-pr":g()}],"scroll-pb":[{"scroll-pb":g()}],"scroll-pl":[{"scroll-pl":g()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",p,f]}],fill:[{fill:["none",...b()]}],"stroke-w":[{stroke:[R,we,ue,ar]}],stroke:[{stroke:["none",...b()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}};var _r=Mo(ti);function A(...e){return _r(Le(e))}function Rr(){if(!(typeof document>"u"))return document.getElementById("root")??void 0}var ct=C(P(),1),ri=De("relative w-full rounded-lg border px-4 py-3 text-sm",{variants:{variant:{default:"border-neutral-200 bg-white text-neutral-900",destructive:"border-red-300 bg-red-50 text-red-900"}},defaultVariants:{variant:"default"}});function pe({className:e,variant:t,...r}){return(0,ct.jsx)("div",{role:"alert",className:A(ri({variant:t}),e),...r})}function me({className:e,...t}){return(0,ct.jsx)("div",{className:A("text-sm",e),...t})}var I=C(B(),1);var Cr=C(B(),1),ni=Object.defineProperty,ut=(e,t)=>ni(e,"name",{value:t,configurable:!0});function dt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ut(dt,"setRef");function Er(...e){return t=>{let r=!1,n=e.map(o=>{let i=dt(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){let i=n[o];typeof i=="function"?i():dt(e[o],null)}}}}ut(Er,"composeRefs");function ft(...e){return Cr.useCallback(Er(...e),e)}ut(ft,"useComposedRefs");var oi=Object.defineProperty,U=(e,t)=>oi(e,"name",{value:t,configurable:!0});function $e(e){let t=I.forwardRef((r,n)=>{let{children:o,...i}=r,s=null,l=!1,c=[];o=Ir(o),I.Children.forEach(o,k=>{if(Nr(k)){l=!0;let y=k,h="child"in y.props?y.props.child:y.props.children;for(;pt(h)&&typeof ze=="function";)h=ze(h._payload);s=si(y,h),c.push(s?.props?.children)}else c.push(k)}),s?s=I.cloneElement(s,void 0,c):!l&&I.Children.count(o)===1&&I.isValidElement(o)&&(s=o);let d=s?Or(s):void 0,_=ft(n,d);if(!s){if(o||o===0)throw new Error(l?ci(e):li(e));return o}let S=Pr(i,s.props??{});return s.type!==I.Fragment&&(S.ref=n?_:d),I.cloneElement(s,S)});return t.displayName=`${e}.Slot`,t}U($e,"createSlot");var Ar=$e("Slot"),Tr=Symbol.for("radix.slottable");function ii(e){let t=U(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Tr,t}U(ii,"createSlottable");var si=U((e,t)=>"child"in e.props?I.isValidElement(t)?I.cloneElement(t,void 0,e.props.children(t.props.children)):null:I.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function Pr(e,t){let r={...t};for(let n in t){let o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{let c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"?r[n]=[o,i].filter(Boolean).join(" "):n==="aria-describedby"&&(r[n]=Lr(i,o))}return{...e,...r}}U(Pr,"mergeProps");function Or(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}U(Or,"getElementRef");function Nr(e){return I.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tr}U(Nr,"isSlottable");var ai=Symbol.for("react.lazy");function pt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ai&&"_payload"in e&&Mr(e._payload)}U(pt,"isLazyComponent");function Mr(e){return typeof e=="object"&&e!==null&&"then"in e}U(Mr,"isPromiseLike");function Ir(e){let t=e;for(;pt(t)&&typeof ze=="function";)t=ze(t._payload);return t}U(Ir,"useUnwrappedLazy");function Lr(...e){let t=new Set;for(let r of e)if(typeof r=="string")for(let n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}U(Lr,"concatAriaDescribedby");var li=U(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),ci=U(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ze=I[" use ".trim().toString()];var Dr=C(P(),1),di=De("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-blue-700 text-white hover:bg-blue-800",destructive:"bg-red-700 text-white hover:bg-red-800",outline:"border border-neutral-300 bg-white hover:bg-neutral-100",secondary:"bg-neutral-100 text-neutral-900 hover:bg-neutral-200",ghost:"hover:bg-neutral-100",link:"text-blue-700 underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8"}},defaultVariants:{variant:"default",size:"default"}});function Q({className:e,variant:t,size:r,asChild:n=!1,type:o,...i}){return(0,Dr.jsx)(n?Ar:"button",{type:o??(n?void 0:"button"),"data-variant":t??"default",className:A(di({variant:t,size:r}),e),...i})}var ye=C(P(),1);function xe({className:e,...t}){return(0,ye.jsx)("div",{className:A("rounded-xl border border-neutral-200 bg-white shadow-sm",e),...t})}function ke({className:e,...t}){return(0,ye.jsx)("div",{className:A("flex flex-col gap-1.5 p-6",e),...t})}function _s({className:e,...t}){return(0,ye.jsx)("h2",{className:A("font-semibold leading-none tracking-tight",e),...t})}function mt({className:e,...t}){return(0,ye.jsx)("p",{className:A("text-sm text-neutral-600",e),...t})}function Se({className:e,...t}){return(0,ye.jsx)("div",{className:A("p-6 pt-0",e),...t})}var L=C(B(),1),Ur=C(gt(),1);var ee=C(B(),1),Ge=C(P(),1),Gr=(0,ee.createContext)(void 0),bt=new WeakMap;function Vr({children:e}){let[t,r]=(0,ee.useState)(null);return(0,Ge.jsxs)(Gr.Provider,{value:t,children:[e,(0,Ge.jsx)("div",{"data-overlay-host":!0,ref:r})]})}function As(){let e=(0,ee.useContext)(Gr),[t,r]=(0,ee.useState)(null);return(0,ee.useEffect)(()=>{if(e!==void 0)return;let n=bt.get(document);if(!n){let s=document.createElement("div");s.setAttribute("data-overlay-host",""),document.body.append(s),n={element:s,users:0},bt.set(document,n)}let o=document,i=n;return i.users++,r(i.element),()=>{--i.users===0&&(i.element.remove(),bt.delete(o))}},[e]),e===void 0?t:e}var qr=C(B(),1);function Yr(e,t){return(0,qr.useCallback)(r=>{let n=[e,t].map(o=>{if(typeof o=="function"){let i=o(r);return typeof i=="function"?i:()=>o(null)}return o&&(o.current=r),()=>{o&&(o.current=null)}});return()=>{for(let o of n)o()}},[e,t])}var G=C(P(),1),Re=(0,L.createContext)(null);function Br(e){let[t,r]=(0,L.useState)(e.defaultOpen??!1),n=(0,L.useId)(),o=(0,L.useId)();return(0,G.jsx)(Re.Provider,{value:{open:e.open??t,setOpen:i=>{r(i),e.onOpenChange?.(i)},titleId:n,descriptionId:o},children:e.children})}function gi({onClick:e,...t}){let r=(0,L.useContext)(Re);return(0,G.jsx)("button",{type:"button",...t,onClick:n=>{e?.(n),n.defaultPrevented||r?.setOpen(!1)}})}function Wr({className:e,children:t,variant:r,ref:n,...o}){let i=(0,L.useContext)(Re),s=(0,L.useRef)(null),l=Yr(n,s),c=i?.open??!1,d=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!c||(d.current?.(),!s.current))return;let k=s.current,y=k.ownerDocument,h=y.activeElement,u=h?.closest('[role="menu"]')?.getAttribute("aria-labelledby"),w=u?y.getElementById(u):h===y.body?null:h;k.showModal();let m=q=>!q.matches(":disabled")&&q.getClientRects().length>0,T=q=>Array.from(k.querySelectorAll(q)).find(m);(T('input:not([type="hidden"]), select, textarea')??T("[data-initial-focus]")??T('[data-dialog-footer] button:not([data-variant="destructive"])')??k.querySelector('button[aria-label="Close"]'))?.focus();let K=!1;return()=>{k.close();let q=()=>{K=!0};d.current=q,queueMicrotask(()=>{if(K)return;let Y=!1,g=!1,N=new MutationObserver(()=>ce()),Ee=setTimeout(()=>{ce(!0),Z()},5e3);function Z(){K=!0,N.disconnect(),clearTimeout(Ee),y.removeEventListener("focusin",ae),y.removeEventListener("keydown",le,!0),y.removeEventListener("pointerdown",le,!0)}function ae(){!Y&&y.activeElement!==null&&y.activeElement!==y.body&&!k.contains(y.activeElement)&&Z()}function le(){y.activeElement!==null&&y.activeElement!==y.body&&!k.contains(y.activeElement)&&Z()}function ce(re=!1){if(K)return;let H=y.activeElement;if(H!==null&&H!==y.body&&H!==w&&!k.contains(H)){Z();return}if(g&&w?.isConnected)return;let de=w?.closest("details:not([open])")?.querySelector("summary")??w,ve=y.querySelector("#page-heading"),b=!de?.isConnected||re&&!m(de)?ve:de;!b||!m(b)||(Y=!0,b.focus(),Y=!1,b!==w?Z():(g=!0,N.disconnect(),N.observe(y.documentElement,{subtree:!0,childList:!0})))}d.current=Z,N.observe(y.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["disabled","hidden","style","class","open"]}),y.addEventListener("focusin",ae),y.addEventListener("keydown",le,!0),y.addEventListener("pointerdown",le,!0),ce()})}},[c]);let _=Rr(),S=(0,G.jsx)("dialog",{...o,ref:l,"aria-labelledby":i?.titleId,"aria-describedby":i?.descriptionId,onCancel:k=>{o.onCancel?.(k),k.defaultPrevented||(k.preventDefault(),i?.setOpen(!1))},onClose:k=>{o.onClose?.(k),c&&!k.currentTarget.open&&i?.setOpen(!1)},className:A("fixed inset-0 m-auto w-[calc(100%_-_2rem)] min-w-0 max-w-lg max-h-[90dvh] overflow-visible rounded-lg border-0 bg-transparent p-0 text-neutral-900 shadow-lg backdrop:bg-black/50",r==="source"&&"h-dvh max-h-none w-full max-w-none rounded-none sm:h-auto sm:max-h-[90dvh] sm:w-[calc(100%_-_2rem)] sm:max-w-lg sm:rounded-lg",e),children:(0,G.jsx)(Vr,{children:(0,G.jsxs)("div",{className:A("relative grid min-w-0 max-h-[90dvh] gap-4 overflow-y-auto rounded-lg border border-neutral-200 bg-white p-6",r==="source"&&"flex h-dvh max-h-none flex-col gap-0 overflow-hidden rounded-none p-0 sm:h-auto sm:max-h-[90dvh] sm:rounded-lg"),children:[t,(0,G.jsx)(gi,{className:A("absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600",r==="source"&&"flex h-11 w-11 items-center justify-center"),"aria-label":"Close",children:(0,G.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,G.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]})})});return _?(0,Ur.createPortal)(S,_):S}function Kr({className:e,...t}){return(0,G.jsx)("div",{className:A("flex min-w-0 flex-col gap-1.5 pr-7",e),...t})}function Qr({className:e,...t}){return(0,G.jsx)("div",{"data-dialog-footer":!0,className:A("flex flex-wrap justify-end gap-2",e),...t})}function Xr({className:e,...t}){let r=(0,L.useContext)(Re);return(0,G.jsx)("h2",{id:r?.titleId,className:A("break-words text-lg font-semibold leading-snug tracking-tight",e),...t})}function Zr({className:e,...t}){let r=(0,L.useContext)(Re);return(0,G.jsx)("p",{id:r?.descriptionId,className:A("text-sm text-neutral-600",e),...t})}var Jr=C(B(),1);var V=C(P(),1);function bi(e,t=18){if(e.length<=t)return e;let r=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${e.slice(-r)}`}function ht({value:e,label:t}){let[r,n]=(0,Jr.useState)("");return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Q,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 px-1.5","aria-label":t,title:t,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>n("Copied."),()=>n("Unable to copy.")),navigator.clipboard||n("Unable to copy.")},children:(0,V.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[(0,V.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,V.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),(0,V.jsx)("span",{className:"sr-only",role:"status",children:r})]})}function Ve({value:e,label:t="ID",full:r=!1}){return e?(0,V.jsxs)("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1",children:[(0,V.jsx)("code",{title:e,className:r?"min-w-0 break-all font-mono text-xs":"font-mono text-xs whitespace-nowrap",children:r?e:bi(e)}),(0,V.jsx)(ht,{value:e,label:`Copy ${t}`})]}):(0,V.jsx)("span",{className:"text-neutral-600",children:"\u2014"})}var tn=C(P(),1);function en({className:e,type:t,...r}){return(0,tn.jsx)("input",{type:t,className:A("flex h-9 w-full rounded-md border border-neutral-300 bg-white px-3 py-1 text-sm shadow-sm placeholder:text-neutral-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:cursor-not-allowed disabled:opacity-50",e),...r})}var an=C(B(),1);var rn=C(B(),1),nn=C(gt(),1);var on=C(P(),1),hi=Object.defineProperty,yi=(e,t)=>hi(e,"name",{value:t,configurable:!0}),vi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sn=vi.reduce((e,t)=>{let r=$e(`Primitive.${t}`),n=rn.forwardRef((o,i)=>{let{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,on.jsx)(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function wi(e,t){e&&nn.flushSync(()=>e.dispatchEvent(t))}yi(wi,"dispatchDiscreteCustomEvent");var ln=C(P(),1),xi=Object.defineProperty,ki=(e,t)=>xi(e,"name",{value:t,configurable:!0}),cn=an.forwardRef(ki(function(t,r){return(0,ln.jsx)(sn.label,{...t,ref:r,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})},"Label"));var un=C(P(),1);function dn({className:e,...t}){return(0,un.jsx)(cn,{className:A("text-sm font-medium leading-none peer-disabled:opacity-70",e),...t})}var pn=C(B(),1);var qe={brand:"PACKAGE.broker",description:"open-source package registry broker",version:"2.0.0-rc.4",links:[{label:"AGPL-3.0",href:"https://github.com/package-broker/broker/blob/main/LICENSE"},{label:"Source code",href:"https://github.com/package-broker/broker"},{label:"Documentation",href:"https://package.broker/docs/"}]};function fn(e){return e("footer",{className:"product-footer"},e("span",{},e("strong",{},qe.brand),` ${qe.description}`),e("span",{},`Version ${qe.version}`),...qe.links.map(({label:t,href:r})=>e("a",{href:r,target:"_blank",rel:"noopener noreferrer","aria-label":`${t} (opens externally in a new tab)`},t)))}function mn(){return fn((e,t,...r)=>(0,pn.createElement)(e,t,...r))}var D=C(B(),1);var yn=[10,16,26,18,24,16,18,22,22,26,30,22,22,24],vn=[1,1,1,2,2,4,4,4,5,5,5,8,9,9],_i=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66]],Ri=[236,17],Ci=21522,Ei=1335,Ai=7973,wn=8;function xn(e){let t=(16*e+128)*e+64;if(e>=2){let r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return t}function vt(e){let t=e-1;return Math.floor(xn(e)/8)-yn[t]*vn[t]}function kn(e){return e<=9?8:16}function Sn(e){if(!Number.isInteger(e)||e<1||e>14)throw new RangeError("unsupported QR version");return Math.floor((vt(e)*8-4-kn(e))/8)}var gn=Sn(14),Ce=new Uint8Array(512),wt=new Uint8Array(256);{let e=1;for(let t=0;t<255;t+=1)Ce[t]=e,wt[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t+=1)Ce[t]=Ce[t-255]}function yt(e,t){return e===0||t===0?0:Ce[wt[e]+wt[t]]}function Ti(e,t){let r=[1];for(let o=0;o<t;o+=1){let i=new Array(r.length+1).fill(0);for(let s=0;s<r.length;s+=1)i[s]=i[s]^yt(r[s],1),i[s+1]=i[s+1]^yt(r[s],Ce[o]);r=i}let n=new Array(t).fill(0);for(let o of e){let i=o^n.shift();n.push(0);for(let s=0;s<t;s+=1)n[s]=n[s]^yt(r[s+1],i)}return n}function Pi(e,t){let r=[],n=(u,w)=>{for(let m=w-1;m>=0;m-=1)r.push(u>>>m&1)};n(4,4),n(t.length,kn(e));for(let u of t)n(u,8);let o=vt(e)*8;n(0,Math.min(4,o-r.length)),n(0,(8-r.length%8)%8);let i=[];for(let u=0;u<r.length;u+=8)i.push(parseInt(r.slice(u,u+8).join(""),2));for(let u=0;i.length<vt(e);u+=1)i.push(Ri[u%2]);let s=e-1,l=vn[s],c=yn[s],d=Math.floor(xn(e)/8),_=l-d%l,S=Math.floor(d/l)-c,k=[],y=[],h=0;for(let u=0;u<l;u+=1){let w=S+(u<_?0:1),m=i.slice(h,h+w);h+=w,k.push(m),y.push(Ti(m,c))}let v=[];for(let u=0;u<S+1;u+=1)for(let w of k)u<w.length&&v.push(w[u]);for(let u=0;u<c;u+=1)for(let w of y)v.push(w[u]);return v}function bn(e,t,r){let n=e;for(let o=0;o<r;o+=1)n=n<<1^(n>>>r-1)*t;return n}function Oi(e,t,r){switch(e){case 0:return(t+r)%2===0;case 1:return r%2===0;case 2:return t%3===0;case 3:return(t+r)%3===0;case 4:return(Math.floor(t/3)+Math.floor(r/2))%2===0;case 5:return t*r%2+t*r%3===0;case 6:return(t*r%2+t*r%3)%2===0;default:return((t+r)%2+t*r%3)%2===0}}function hn(e){let t=0,r=1;for(let o=1;o<=e.length;o+=1){if(o<e.length&&e[o]===e[o-1]){r+=1;continue}r>=5&&(t+=3+(r-5)),r=1}let n=`0000${e.map(o=>o?"1":"0").join("")}0000`;for(let o=0;o+11<=n.length;o+=1){let i=n.slice(o,o+11);(i==="10111010000"||i==="00001011101")&&(t+=40)}return t}function Ni(e){let t=e.length,r=0,n=0;for(let i=0;i<t;i+=1){let s=e[i];r+=hn(s),r+=hn(e.map(l=>l[i]));for(let l=0;l<t;l+=1)s[l]&&(n+=1),l+1<t&&i+1<t&&s[l]===s[l+1]&&s[l]===e[i+1][l]&&s[l]===e[i+1][l+1]&&(r+=3)}let o=t*t;return r+=(Math.ceil(Math.abs(n*20-o*10)/o)-1)*10,r}function Mi(e,t,r){let n=e*4+17,o=Array.from({length:n},()=>new Array(n).fill(!1)),i=Array.from({length:n},()=>new Array(n).fill(!1)),s=(h,v,u)=>{o[v][h]=u,i[v][h]=!0};for(let h=0;h<n;h+=1)s(6,h,h%2===0),s(h,6,h%2===0);let l=(h,v)=>{for(let u=-4;u<=4;u+=1)for(let w=-4;w<=4;w+=1){let m=Math.max(Math.abs(w),Math.abs(u)),T=h+w,W=v+u;T>=0&&T<n&&W>=0&&W<n&&s(T,W,m!==2&&m!==4)}};l(3,3),l(n-4,3),l(3,n-4);let c=_i[e-1],d=c.length-1;c.forEach((h,v)=>{c.forEach((u,w)=>{if(!(v===0&&w===0||v===0&&w===d||v===d&&w===0))for(let m=-2;m<=2;m+=1)for(let T=-2;T<=2;T+=1)s(u+T,h+m,Math.max(Math.abs(T),Math.abs(m))!==1)})});let _=h=>{let v=h,u=(v<<10|bn(v,Ei,10))^Ci,w=m=>(u>>>m&1)!==0;for(let m=0;m<=5;m+=1)s(8,m,w(m));s(8,7,w(6)),s(8,8,w(7)),s(7,8,w(8));for(let m=9;m<15;m+=1)s(14-m,8,w(m));for(let m=0;m<8;m+=1)s(n-1-m,8,w(m));for(let m=8;m<15;m+=1)s(8,n-15+m,w(m));s(8,n-8,!0)};if(_(0),e>=7){let h=e<<12|bn(e,Ai,12);for(let v=0;v<18;v+=1){let u=(h>>>v&1)!==0,w=n-11+v%3,m=Math.floor(v/3);s(w,m,u),s(m,w,u)}}let S=0;for(let h=n-1;h>=1;h-=2){h===6&&(h=5);for(let v=0;v<n;v+=1)for(let u=0;u<2;u+=1){let w=h-u,T=(h+1&2)===0?n-1-v:v;!i[T][w]&&S<t.length*8&&(o[T][w]=(t[S>>>3]>>>7-(S&7)&1)!==0,S+=1)}}let k=h=>o.map((v,u)=>v.map((w,m)=>!i[u][m]&&Oi(h,m,u)?!w:w)),y=r??0;if(r===void 0){let h=1/0;for(let v=0;v<wn;v+=1){_(v);let u=Ni(k(v));u<h&&(h=u,y=v)}}return _(y),{version:e,size:n,mask:y,modules:k(y)}}function _n(e,t={}){let{mask:r}=t;if(r!==void 0&&(!Number.isInteger(r)||r<0||r>=wn))throw new RangeError("unsupported QR mask");if(typeof e!="string"||e.length===0)throw new TypeError("QR text is empty");if(e.length>gn)throw new RangeError("QR text is too long");let n=new TextEncoder().encode(e);if(n.length>gn)throw new RangeError("QR text is too long");let o=1;for(;Sn(o)<n.length;)o+=1;return Mi(o,Pi(o,n),r)}var Rn="/_pb/ui/";var a=C(P(),1);function St(e){let t=e,r=new Set;return{get:()=>t,set(n){t={...t,...n};for(let o of[...r])o()},subscribe(n){return r.add(n),()=>{r.delete(n)}}}}function _t(e){return(0,D.useSyncExternalStore)(e.subscribe,e.snapshot,e.snapshot)}function Ii(e){if(e.startsWith("/")){if(e.startsWith("//")||e.includes("\\")||[...e].some(r=>r.charCodeAt(0)<=32||r.charCodeAt(0)===127))return!1;let t="https://broker.invalid";return new URL(e,t).origin===t}try{let{protocol:t}=new URL(e);return t==="https:"||t==="http:"}catch{return!1}}function Be(e){let t=/^#\/packages\/([0-7][0-9A-HJKMNP-TV-Z]{25})(\?[\s\S]*)?$/.exec(e);if(t)return Be(`#/packages${t[2]??""}`).replace("#/packages",`#/packages/${t[1]}`);if(/^#\/npm-login\/[A-Za-z0-9_-]{43}$/.test(e))return e;let r=/^#\/(projects|access|sources|packages|tokens|notifications|audit|import|login)(?:\?([\s\S]*))?$/.exec(e);if(r===null||r[0]!==e)return"#/projects";let n=new URLSearchParams(r[2]);return tr(r[1]==="login"?"projects":r[1],{project:n.get("project"),status:n.get("status"),source:n.get("source"),projectId:n.get("projectId"),q:n.get("q"),after:n.get("after"),package:n.get("package"),versionAfter:n.get("versionAfter"),cursor:n.get("cursor"),run:n.get("run"),actor:n.get("actor"),action:n.get("action"),filterProject:n.get("filterProject"),limit:n.get("limit")})}function En(e){let t=new URLSearchParams(e.split("?")[1]??"");return Be(`#${t.get("return")??"/projects"}`)}async function An(e,t,r,n,o){let i=r==="login"?Be(o??""):`#/reauth?return=${encodeURIComponent(En(o??"").slice(1))}&sso=complete`,s={params:{provider:t},body:{purpose:r,...o===void 0?{}:{returnTo:`/_pb/ui${i}`}},headers:{Accept:"application/json"}},l=await e.request("post","/_pb/auth/sso/{provider}/start",s);if(!l.ok)return"failed";let d=l.data?.location;return typeof d!="string"||!Ii(d)?"refused":(n(d),"navigated")}function Ye(e){return!e.ok&&e.status===403&&e.code==="local_auth_disabled"}function Li(e){let t=St({status:"idle",error:null});return{snapshot:t.get,subscribe:t.subscribe,async submit(r){if(t.get().status==="busy")return;t.set({status:"busy",error:null});let n=await e.client.request("post","/_pb/auth/local/login",{body:{email:r.email,password:r.password,code:r.code}});if(n.ok){t.set({status:"signed-in",error:null}),e.onSignedIn();return}t.set({status:"error",error:Ye(n)?"disabled":n.status===0?"unavailable":"invalid"})}}}function aa(e){let t=new Set,r=St({dialog:"closed",action:null,busy:!1,outcome:null});return{snapshot:r.get,subscribe:r.subscribe,subscribeReplay(n){return t.add(n),()=>{t.delete(n)}},requireReauth(n,o,i){if(!Jt(e.storage,{method:n.method,path:n.path,...n.idempotencyKey===void 0?{}:{idempotencyKey:n.idempotencyKey},...n.body===void 0?{}:{body:n.body},...n.headers===void 0?{}:{headers:n.headers},...o.display===void 0?{}:{display:o.display},credential:o.credential,secretFields:o.secretFields}).ok){r.set({dialog:"closed",action:null,outcome:"save-failed"});return}r.set({dialog:"closed",action:null,outcome:null}),e.navigate(`#/reauth?return=${encodeURIComponent(Be(i).slice(1))}`)},restore(){let n=it(e.storage,e.now());n.ok&&n.action!==null&&r.set(n.action.requiresCredential?{dialog:"closed",action:null,outcome:"credential-required"}:{dialog:"confirm",action:n.action,outcome:null})},clear(){it(e.storage,e.now()),r.set({dialog:"closed",action:null,busy:!1,outcome:null})},decline(){r.set({dialog:"closed",action:null,outcome:null})},async confirm(){let{action:n,busy:o}=r.get();if(n===null||n.requiresCredential||o)return;r.set({busy:!0,action:null});let i={...n.idempotencyKey===void 0?{}:{idempotencyKey:n.idempotencyKey},...n.body===void 0?{}:{body:n.body},...n.headers===void 0?{}:{headers:n.headers}},s=e.client.request,l;try{let c=await s(n.method.toLowerCase(),n.path,i);l={path:n.path,ok:c.ok,status:c.status,...c.ok?{}:{code:c.code},...c.ok&&c.status===201&&n.method==="POST"&&/^\/_pb\/(?:projects\/[^/]+\/)?sources$/.test(n.path)&&c.data!==null&&typeof c.data=="object"&&"id"in c.data&&typeof c.data.id=="string"&&/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/.test(c.data.id)?{createdSourceId:c.data.id}:{}},r.set({dialog:"closed",busy:!1,outcome:c.ok?"replayed":"failed"})}catch{l={path:n.path,ok:!1,status:0},r.set({dialog:"closed",busy:!1,outcome:"failed"})}for(let c of t)c(l)},async submitLocal(n){let o=await e.client.request("post","/_pb/auth/local/reauth",{body:{password:n.password,code:n.code}});return o.ok?"done":Ye(o)?"disabled":"refused"}}}var Di={bad_token_shape:"That does not look like a setup token. Paste the whole token as it was issued.",token_refused:"This setup token was not accepted. It may be wrong, expired or already used.",origin_refused:"The broker refused this request because it came from a different address.",rate_limited:"Too many attempts. Wait a few minutes and try again.",unavailable:"The broker could not be reached or answered unexpectedly. Try again in a moment.",password_mismatch:"The password and its confirmation do not match.",missing_fields:"Enter a password and the six digit code from your authenticator.",finish_refused:"Setup was not completed. Check the password requirements and the six digit code, then try again."},Hi=43,Cn=1024;function ji(e){try{return _n(e)}catch{return null}}function zi(e){return e===400||e===401?"token_refused":e===403?"origin_refused":e===429?"rate_limited":"unavailable"}function $i(e){let t=St({stage:"token",busy:!1,notice:null,enrollment:null}),r=null;return{snapshot:t.get,subscribe:t.subscribe,async submitToken(n){let o=t.get();if(o.busy||o.stage!=="token")return;let i=n.trim();if(i.length!==Hi||!/^[A-Za-z0-9_-]+$/.test(i)){t.set({notice:"bad_token_shape"});return}t.set({busy:!0,notice:null});let s=await e.client.request("post","/_pb/auth/local/setup/start",{body:{token:i}});if(Ye(s)){r=null,t.set({busy:!1,stage:"disabled",notice:null,enrollment:null});return}if(!s.ok){t.set({busy:!1,notice:zi(s.status)});return}let l=s.data;if(typeof l?.provisioningUri!="string"||typeof l.secret!="string"||l.secret===""){t.set({busy:!1,notice:"unavailable"});return}r=i,t.set({busy:!1,stage:"enroll",notice:null,enrollment:{secret:l.secret,qr:ji(l.provisioningUri)}})},async finish(n){let o=t.get();if(o.busy||o.stage!=="enroll"||r===null)return;let i=n.code.replace(/\s+/g,"");if(n.password===""||i===""){t.set({notice:"missing_fields"});return}if(n.password.length>Cn||i.length>Cn||n.password!==n.confirmation){t.set({notice:"password_mismatch"});return}t.set({busy:!0,notice:null});let s=await e.client.request("post","/_pb/auth/local/setup/finish",{body:{token:r,password:n.password,code:i}});if(s.ok){r=null,t.set({busy:!1,stage:"done",enrollment:null}),e.onSignedIn?.();return}if(Ye(s)){r=null,t.set({busy:!1,stage:"disabled",notice:null,enrollment:null});return}if(s.status===0||s.status>=500){r=null,t.set({busy:!1,stage:"uncertain",enrollment:null});return}t.set({busy:!1,notice:s.status===403?"origin_refused":s.status===429?"rate_limited":"finish_refused"})}}}var Fi=(0,D.createContext)(null);function la(){let e=(0,D.useContext)(Fi);if(e===null)throw new Error("ServicesContext is missing");return e}function Ue(e){e.preventDefault();let t=e.currentTarget,r={};for(let[n,o]of new FormData(t))typeof o=="string"&&(r[n]=o);return t.reset(),r}function te(e){return(0,a.jsxs)("div",{className:"grid gap-1.5",children:[(0,a.jsx)(dn,{htmlFor:e.id,children:e.label}),(0,a.jsx)(en,{id:e.id,name:e.id,type:e.type??"text",required:!0,autoComplete:e.autoComplete??"off",...e.inputMode?{inputMode:e.inputMode}:{},...e.hint?{"aria-describedby":`${e.id}-hint`}:{}}),e.hint?(0,a.jsx)("p",{id:`${e.id}-hint`,className:"text-xs text-neutral-600",children:e.hint}):null]})}var Gi={refused:"The sign-in provider returned an address the broker will not open.",failed:"Single sign-on could not be started. Try again in a moment."};function Tn(e){return e.providers.length===0?null:(0,a.jsx)("div",{className:"grid gap-2",children:e.providers.map(t=>(0,a.jsxs)(Q,{type:"button",variant:"outline",disabled:e.busy,onClick:()=>e.onSso(t.id),children:[e.verb," ",t.displayName]},t.id))})}function Rt(e){return e.status==="loading"?(0,a.jsx)("p",{role:"status",children:"Loading sign-in options\u2026"}):e.status==="error"?(0,a.jsx)("p",{role:"alert",children:"Sign-in options could not be loaded. Reload the page to try again."}):!e.local&&e.providers.length===0?(0,a.jsx)("p",{children:"Contact your administrator for help signing in."}):null}var xt={state_invalid:"The sign-in request expired or could not be verified. Start sign-in again.",state_mismatch:"The sign-in response did not match your request. Start sign-in again.",no_session:"Your session ended. Sign in again, then retry the action within 10 minutes.",session_inactive:"Your session ended. Sign in again, then retry the action within 10 minutes.",no_auth_time:"Your provider did not confirm a fresh sign-in. Sign out and sign in again, then retry the action within 10 minutes.",stale_auth_time:"Your provider returned an older sign-in. Sign out and sign in again, then retry the action within 10 minutes.",not_supported:"Your provider cannot confirm a fresh sign-in. Sign out and sign in again, then retry the action within 10 minutes.",not_sso_session:"Use the sign-in method associated with your current session to confirm this action.",identity_mismatch:"Sign in with the same account used for your current session.",anchor_mismatch:"Your sign-in provider configuration changed. Contact your administrator.",provider_rebound:"Your sign-in provider configuration changed. Contact your administrator.",provider_error:"The sign-in provider could not complete the request. Try signing in again.",missing_credentials:"The provider did not return a sign-in response. Start sign-in again.",invalid_token:"The provider response could not be verified. Start sign-in again.",email_missing:"Your provider did not supply the account details needed to sign in. Contact your administrator.",email_unverified:"Your provider has not verified your account address. Contact your administrator.",domain_not_verified:"Your account domain is not approved for this organization. Contact your administrator.",not_invited:"Your account has not been granted access. Contact your administrator.",user_suspended:"Your account is suspended. Contact your administrator.",hook_denied:"Organization policy refused this sign-in. Contact your administrator.",policy:"Organization policy refused confirmation. Contact your administrator.",too_many_groups:"Your provider returned more groups than allowed. Contact your administrator.",already_linked:"This provider account is already linked. Contact your administrator.",link_requires_admin:"An administrator needs to link your provider account.",invalid_identity:"Your provider returned account details that could not be verified. Contact your administrator.",email_changed:"Your provider account details changed. Contact your administrator.",conflict:"Your account changed during sign-in. Start sign-in again.",not_updated:"Confirmation could not be saved. Try again.",direct_reauth:"Your provider cannot complete confirmation. Sign out and sign in again, then retry within 10 minutes.",reauth_refused:"Confirmation was refused. Try again or contact your administrator.",login_refused:"Sign-in could not be completed. Try again or contact your administrator."};function Vi(e){return(e!==null&&Object.hasOwn(xt,e)?xt[e]:void 0)??xt.login_refused}function ca(e){return(0,a.jsxs)(xe,{className:"mx-auto mt-12 max-w-md",children:[(0,a.jsx)(ke,{children:(0,a.jsx)("h1",{id:"page-heading",tabIndex:-1,className:"font-semibold leading-none tracking-tight",children:"Sign-in failed"})}),(0,a.jsxs)(Se,{className:"grid gap-4",children:[(0,a.jsx)(pe,{variant:"destructive",children:(0,a.jsx)(me,{children:Vi(e.reason)})}),(0,a.jsx)("a",{href:e.signedIn?`#/reauth?return=${encodeURIComponent(En(e.hash??"").slice(1))}`:"#/login",children:e.signedIn?"Return to confirmation":"Return to sign in"})]})]})}function qi(e){let t=e.state.status==="busy",r=e.local&&e.state.error!=="disabled";return(0,a.jsxs)(xe,{className:"mx-auto mt-12 max-w-md",children:[(0,a.jsxs)(ke,{children:[(0,a.jsx)("h1",{id:"page-heading",tabIndex:-1,className:"font-semibold leading-none tracking-tight",children:"Sign in"}),(0,a.jsx)(mt,{children:"Package Broker"})]}),(0,a.jsxs)(Se,{className:"grid gap-4",children:[(0,a.jsx)(Rt,{status:e.availability??"ready",local:r,providers:e.providers}),e.state.error===null||e.state.error==="disabled"?null:(0,a.jsx)(pe,{variant:"destructive",children:(0,a.jsx)(me,{children:e.state.error==="unavailable"?"The broker could not be reached. Try again in a moment.":"Sign-in failed. Check your details and try again."})}),e.ssoError?(0,a.jsx)(pe,{variant:"destructive",children:(0,a.jsx)(me,{children:Gi[e.ssoError]})}):null,r&&(e.availability??"ready")==="ready"?(0,a.jsxs)("form",{className:"grid gap-4",onSubmit:n=>{if(n.preventDefault(),t)return;let o=Ue(n);e.onSubmit({email:o.email??"",password:o.password??"",code:(o.code??"").replace(/\s+/g,"")})},children:[(0,a.jsx)(te,{id:"email",label:"E-mail",type:"email",autoComplete:"username"}),(0,a.jsx)(te,{id:"password",label:"Password",type:"password",autoComplete:"current-password"}),(0,a.jsx)(te,{id:"code",label:"Authenticator code",autoComplete:"one-time-code",inputMode:"numeric"}),(0,a.jsx)(Q,{type:"submit",disabled:t,children:t?"Signing in\u2026":"Sign in"})]}):null,(0,a.jsx)(Tn,{providers:e.providers,busy:t,onSso:e.onSso,verb:"Sign in with"})]})]})}function Yi(e){let t=e.providers.filter(r=>r.supportsReauth);return(0,a.jsxs)(xe,{className:"mx-auto mt-12 max-w-md",children:[(0,a.jsxs)(ke,{children:[(0,a.jsx)("h1",{id:"page-heading",tabIndex:-1,className:"font-semibold leading-none tracking-tight",children:"Confirm it is you"}),(0,a.jsx)(mt,{children:"This action needs a fresh sign-in."})]}),(0,a.jsxs)(Se,{className:"grid gap-4",children:[(0,a.jsx)(Rt,{status:e.availability??"ready",local:e.local,providers:t}),e.error?(0,a.jsx)(pe,{variant:"destructive",children:(0,a.jsx)(me,{children:"Confirmation failed. Check your details and try again."})}):null,e.local&&(e.availability??"ready")==="ready"?(0,a.jsxs)("form",{className:"grid gap-4",onSubmit:r=>{if(r.preventDefault(),e.busy)return;let n=Ue(r);e.onSubmit({password:n.password??"",code:(n.code??"").replace(/\s+/g,"")})},children:[(0,a.jsx)(te,{id:"password",label:"Password",type:"password",autoComplete:"current-password"}),(0,a.jsx)(te,{id:"code",label:"Authenticator code",autoComplete:"one-time-code",inputMode:"numeric"}),(0,a.jsx)(Q,{type:"submit",disabled:e.busy,children:"Confirm"})]}):null,e.providers.some(r=>!r.supportsReauth)?(0,a.jsxs)("p",{role:"status",children:["Your sign-in provider cannot confirm a fresh sign-in. Sign out and sign in again, then retry this action within 10 minutes.",e.local?" You can also use the local sign-in form to confirm.":""]}):null,(0,a.jsx)(Tn,{providers:t,busy:e.busy,onSso:e.onSso,verb:"Confirm with"}),!e.local&&(e.availability??"ready")==="ready"&&t.length>0?(0,a.jsxs)("p",{children:["Signed in with a password? Sign out and sign in with"," ",t.map(r=>r.displayName).join(" or ")," to continue."]}):null]})]})}function Ui(e){return(0,a.jsx)(Br,{open:e.open,onOpenChange:t=>{t||e.onDecline()},children:(0,a.jsx)(Wr,{children:(0,a.jsx)(Wi,{...e})})})}function Pn(e){return e?.path.match(/^\/_pb\/projects\/([^/]+)\/restore$/)?.[1]}function Bi(e){if(Pn(e))return{label:"Restore project",effect:"Restore this archived project.",destructive:!1};let r=e?.path.match(/\/(quarantine|tombstone|release|approve|apply|cancel|rollback)$/)?.[1],n={quarantine:"Quarantine version",tombstone:"Tombstone version",release:"Release version",approve:"Approve import run",apply:"Apply import run",cancel:"Cancel import run",rollback:"Roll back import run"},o={quarantine:"Clients cannot resolve this version until it is released. Only this version is affected.",tombstone:"Clients can no longer install this version. Only this version is affected. This cannot be undone.",release:"Clients can resolve this version again. Only this version is affected.",approve:"Approve the reviewed plan hash for this run.",apply:"Apply the approved import plan.",cancel:"Cancel this planned import run.",rollback:"Restore retained before-images where rollback is possible."};return{label:r?n[r]??"Send held action":"Send held action",effect:r?o[r]??"Send the request you started before confirming your identity.":"Send the request you started before confirming your identity.",destructive:["tombstone","cancel","rollback"].includes(r??"")}}function Wi(e){let t=Bi(e.action),r=e.action?.display,n=Pn(e.action),o=e.action?.path.match(/\/packages\/([^/]+)\/versions\/([^/]+)/),i=e.action?.path.match(/\/import-runs\/([^/]+)/)?.[1],s=e.action?`${e.action.method} ${e.action.path}`:"";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(Kr,{children:[(0,a.jsx)(Xr,{children:"Send the held action now?"}),(0,a.jsx)(Zr,{children:"You confirmed your identity. The action below was held while you signed in and has not been sent yet."})]}),(0,a.jsxs)("dl",{className:"detail-list",children:[(0,a.jsx)("dt",{children:"Action"}),(0,a.jsx)("dd",{className:"font-medium",children:t.label}),n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("dt",{children:"Project"}),(0,a.jsx)("dd",{children:n})]}):null,r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("dt",{children:"Package"}),(0,a.jsx)("dd",{children:r.packageName}),(0,a.jsx)("dt",{children:"Version"}),(0,a.jsx)("dd",{className:"font-mono",children:r.version})]}):o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("dt",{children:"Package ID"}),(0,a.jsx)("dd",{children:(0,a.jsx)(Ve,{value:o[1],label:"package ID"})}),(0,a.jsx)("dt",{children:"Version ID"}),(0,a.jsx)("dd",{children:(0,a.jsx)(Ve,{value:o[2],label:"version ID"})})]}):null,i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("dt",{children:"Run"}),(0,a.jsx)("dd",{children:(0,a.jsx)(Ve,{value:i,label:"run ID"})})]}):null,(0,a.jsx)("dt",{children:"Scope"}),(0,a.jsx)("dd",{children:r?.scope??(e.action?.path.startsWith("/_pb/projects/")?"Project":"Organization")}),(0,a.jsx)("dt",{children:"Effect"}),(0,a.jsx)("dd",{children:t.effect})]}),s?(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{className:"cursor-pointer text-sm text-blue-700",children:"Request details"}),(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-start gap-2 rounded-md border border-neutral-200 bg-neutral-50 p-3",children:[(0,a.jsx)("code",{className:"min-w-0 break-all text-xs",children:s}),(0,a.jsx)(ht,{value:s,label:"Copy request"})]})]}):null,(0,a.jsxs)(Qr,{children:[(0,a.jsx)(Q,{type:"button",variant:"outline",onClick:e.onDecline,children:"Discard"}),(0,a.jsx)(Q,{type:"button",variant:t.destructive?"destructive":"default",onClick:e.onConfirm,children:t.label})]})]})}var kt=4;function Ki({matrix:e}){let t=e.size+kt*2,r=[];return e.modules.forEach((n,o)=>{n.forEach((i,s)=>{i&&r.push(`M${s+kt} ${o+kt}h1v1h-1z`)})}),(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${t} ${t}`,width:"192",height:"192",role:"img","aria-label":"Authenticator QR code",shapeRendering:"crispEdges",children:[(0,a.jsx)("rect",{width:t,height:t,fill:"#ffffff"}),(0,a.jsx)("path",{d:r.join(""),fill:"#000000"})]})}function Qi(e){let{state:t}=e;return(0,a.jsxs)(xe,{className:"mx-auto mt-12 max-w-md",children:[(0,a.jsx)(ke,{children:(0,a.jsx)("h1",{id:"page-heading",tabIndex:-1,className:"font-semibold leading-none tracking-tight",children:"First-run setup"})}),(0,a.jsxs)(Se,{className:"grid gap-4",children:[t.notice===null?null:(0,a.jsx)(pe,{variant:"destructive",children:(0,a.jsx)(me,{children:Di[t.notice]})}),t.stage==="token"?(0,a.jsxs)("form",{className:"grid gap-4",onSubmit:r=>{r.preventDefault(),!t.busy&&e.onToken(Ue(r).token??"")},children:[(0,a.jsx)(te,{id:"token",label:"Setup token",hint:"Paste the token the broker printed at start."}),(0,a.jsx)(Q,{type:"submit",disabled:t.busy,children:"Continue"})]}):null,t.stage==="enroll"&&t.enrollment?(0,a.jsxs)("form",{className:"grid gap-4",onSubmit:r=>{if(r.preventDefault(),t.busy)return;let n=Ue(r);e.onFinish({password:n.password??"",confirmation:n.confirmation??"",code:n.code??""})},children:[t.enrollment.qr?(0,a.jsx)(Ki,{matrix:t.enrollment.qr}):null,(0,a.jsxs)("p",{className:"text-sm",children:["Setup key: ",(0,a.jsx)("code",{className:"break-all",children:t.enrollment.secret})]}),(0,a.jsx)(te,{id:"password",label:"Password",type:"password",autoComplete:"new-password"}),(0,a.jsx)(te,{id:"confirmation",label:"Confirm password",type:"password",autoComplete:"new-password"}),(0,a.jsx)(te,{id:"code",label:"Authenticator code",autoComplete:"one-time-code",inputMode:"numeric"}),(0,a.jsx)(Q,{type:"submit",disabled:t.busy,children:"Finish setup"})]}):null,t.stage==="done"?(0,a.jsx)("p",{children:"Setup is complete. You can now sign in."}):null,t.stage==="uncertain"?(0,a.jsx)("p",{children:"The broker did not confirm the result. Try signing in; if that fails, ask for a fresh setup token."}):null]})]})}function Ct(e){let[t,r]=(0,D.useState)({client:e,providers:[],local:!1,availability:"loading"});return(0,D.useEffect)(()=>{let n=!0;return e.request("get","/_pb/auth/providers").then(o=>{n&&(o.ok&&o.data&&typeof o.data.local=="boolean"&&Array.isArray(o.data.providers)?r({client:e,providers:o.data.providers,local:o.data.local,availability:"ready"}):r({client:e,providers:[],local:!1,availability:"error"}))}).catch(()=>{n&&r({client:e,providers:[],local:!1,availability:"error"})}),()=>{n=!1}},[e]),t.client===e?t:{providers:[],local:!1,availability:"loading"}}var On=e=>{window.location.assign(e)};function da(e){let{client:t,onSignedIn:r}=e,n=(0,D.useMemo)(()=>Li({client:t,onSignedIn:r}),[t,r]),o=_t(n),{providers:i,local:s,availability:l}=Ct(t),[c,d]=(0,D.useState)(null);return(0,a.jsx)(qi,{state:o,providers:i,local:s,availability:l,ssoError:c,onSubmit:_=>{n.submit(_)},onSso:_=>{d(null),An(t,_,"login",On,window.location.hash).then(S=>{S!=="navigated"&&d(S)})}})}function Xi(e){return(0,a.jsxs)("div",{className:"mx-auto mt-12 max-w-md grid gap-4",children:[(0,a.jsx)("h1",{id:"page-heading",tabIndex:-1,className:"font-semibold",children:"First-run setup"}),e.availability!=="loading"?(0,a.jsx)("h2",{className:"font-semibold",children:e.availability==="error"?"Setup is unavailable":"Sign in with your organization's account"}):null,(0,a.jsx)(Rt,{status:e.availability,local:e.local,providers:e.providers}),e.availability==="ready"?(0,a.jsx)("p",{children:"Password setup is unavailable. Sign in to continue."}):null,(0,a.jsx)("a",{href:`${Rn}#/login`,children:"Go to sign in"})]})}function ua(e){let{client:t,onSignedIn:r}=e,n=(0,D.useMemo)(()=>$i({client:t,onSignedIn:r}),[t,r]),o=_t(n),{providers:i,local:s,availability:l}=Ct(t);return l!=="ready"||!s||o.stage==="disabled"?(0,a.jsx)(Xi,{availability:l,local:!1,providers:i}):(0,a.jsx)(Qi,{state:o,onToken:c=>{n.submitToken(c)},onFinish:c=>{n.finish(c)}})}function fa(e){let{client:t,flow:r,onDone:n}=e,{providers:o,local:i,availability:s}=Ct(t),[l,c]=(0,D.useState)(!1),[d,_]=(0,D.useState)(!1),[S,k]=(0,D.useState)(!1);return(0,a.jsx)(Yi,{providers:o,local:i&&!d,availability:s,error:l,busy:S,onSubmit:y=>{k(!0),c(!1),r.submitLocal(y).then(h=>{k(!1),h==="done"?(r.restore(),n()):h==="disabled"?_(!0):c(!0)})},onSso:y=>{c(!1),An(t,y,"reauth",On,window.location.hash).then(h=>{h!=="navigated"&&c(!0)})}})}function pa(e){let t=_t(e.flow);return t.outcome==="save-failed"||t.outcome==="failed"||t.outcome==="credential-required"?(0,a.jsxs)(pe,{variant:"destructive",className:"mx-auto my-4 max-w-lg",children:[(0,a.jsx)(me,{children:t.outcome==="credential-required"?"Enter the credential again to complete your action.":t.outcome==="save-failed"?"Your action could not be saved. Try the action again after dismissing this message.":"Your action could not be completed. Review the current data and try the action again."}),(0,a.jsx)(Q,{type:"button",variant:"outline",onClick:()=>e.flow.decline(),children:"Dismiss"})]}):(0,a.jsx)(Ui,{open:t.dialog==="confirm",action:t.action,onConfirm:()=>{e.flow.confirm()},onDecline:()=>e.flow.decline()})}function ma({children:e}){return(0,a.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,a.jsx)("main",{className:"flex-1 px-4",children:e}),(0,a.jsx)(mn,{})]})}export{ge as a,Zi as b,C as c,B as d,gt as e,mn as f,P as g,Jt as h,it as i,tr as j,De as k,A as l,pe as m,me as n,di as o,Q as p,xe as q,ke as r,_s as s,Se as t,Vr as u,As as v,Yr as w,Br as x,Wr as y,Kr as z,Qr as A,Xr as B,Zr as C,Ve as D,en as E,dn as F,Be as G,En as H,aa as I,Fi as J,la as K,ca as L,da as M,ua as N,fa as O,pa as P,ma as Q};
@@ -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&&lt(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};