@package-broker/dist 2.0.0-rc.2 → 2.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/node/assets/access.62e9484517a0.js +1 -0
- package/node/assets/app.45b156168495.css +2 -0
- package/node/assets/app.c064670cdc0d.js +9 -0
- package/node/assets/audit.b7c40b9dc998.js +1 -0
- package/node/assets/chunk.28a4d8aab337.js +1 -0
- package/node/assets/chunk.3fcd6998795a.js +1 -0
- package/node/assets/chunk.51497edc7697.js +4 -0
- package/node/assets/chunk.56d473a1587d.js +1 -0
- package/node/assets/chunk.675b635d9462.js +1 -0
- package/node/assets/chunk.6ea6bdcaa465.js +1 -0
- package/node/assets/chunk.741aec8d1ff9.js +1 -0
- package/node/assets/chunk.815f9a91c741.js +1 -0
- package/node/assets/chunk.8442124f6802.js +1 -0
- package/node/assets/chunk.965b76812604.js +2 -0
- package/node/assets/chunk.a6d755a9789f.js +1 -0
- package/node/assets/chunk.d18497920e4d.js +1 -0
- package/node/assets/chunk.d813fefb410d.js +1 -0
- package/node/assets/chunk.e3b0c44298fc.js +0 -0
- package/node/assets/chunk.f54ea1378c8c.js +1 -0
- package/node/assets/chunk.fd375c54b526.js +1 -0
- package/node/assets/import.e7a1e5834631.js +1 -0
- package/node/assets/index.html +9 -2
- package/node/assets/manifest.json +108 -8
- package/node/assets/notifications.19225fe12044.js +1 -0
- package/node/assets/npm-login.e059678af13d.js +1 -0
- package/node/assets/packages.ab5ab25b1c75.js +2 -0
- package/node/assets/projects.927fe18c785c.js +1 -0
- package/node/assets/setup.8e977608d413.js +1 -0
- package/node/assets/setup.html +3 -3
- package/node/assets/sources.ae50f239f80f.js +1 -0
- package/node/assets/tokens.6b86d8d97e07.js +4 -0
- package/node/assets.json +2 -2
- package/node/build-info.json +4 -4
- package/node/generated/manifest.json +53 -2
- package/node/migrations/core/0002_npm_publish.sql +88 -0
- package/node/migrations/core/0003_npm_identity.sql +96 -0
- package/node/migrations/core/0004_source_revision.sql +1 -0
- package/node/migrations/core/0005_package_settings_revision.sql +1 -0
- package/node/migrations/core/0006_npm_login_handoff.sql +39 -0
- package/node/migrations/core/0007_npm_vcs_build_outcomes.sql +10 -0
- package/node/migrations/core/0008_registry_policy.sql +49 -0
- package/node/migrations/core/0009_npm_notifications.sql +108 -0
- package/node/server.js +62542 -42939
- package/package.json +1 -1
- package/prebuilt.json +47 -14
- package/node/assets/app.b2abf3c46f6e.js +0 -15
- package/node/assets/app.e8cea8b32d3a.css +0 -2
- package/node/assets/setup.98343039898f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as h}from"./chunk.8442124f6802.js";import{a as L,c as b}from"./chunk.965b76812604.js";import"./chunk.3fcd6998795a.js";import{a as f}from"./chunk.d813fefb410d.js";import{A,B as w,C as N,D as m,E as C,F as D,K as R,c as g,d as B,g as y,p as d,x as I,y as k,z as x}from"./chunk.fd375c54b526.js";var u=g(B(),1);var e=g(y(),1);function S(a){return{id:a.id,state:a.state,planHash:a.planHash,approvedAt:a.approvedAt,approvedByUserId:a.approvedByUserId,acceptedAt:a.acceptedAt,beforeImageExpiresAt:a.beforeImageExpiresAt}}function v(a,t,s=Date.now()){if(t==="approve")return a.state==="planned"&&!!a.planHash&&a.approvedAt===null;if(t==="apply"){let i=a.approvedAt===null?NaN:Date.parse(a.approvedAt);return a.state==="planned"&&Number.isFinite(i)&&i<=s+6e4}return t==="cancel"?a.state==="planned":["failed","applied","verifying","verified"].includes(a.state)&&(a.beforeImageExpiresAt===null||Date.parse(a.beforeImageExpiresAt)>s)}function H(a){let t={runs:[],next:null,run:null,selectedId:null,loading:!1,detailLoading:!1,busy:!1,dialog:!1,confirmed:!1,error:null,notice:null},s=0,i=0,c=new Set,n=o=>{t={...t,...o};for(let l of c)l()},r={back(){++s,n({run:null,selectedId:null,detailLoading:!1,dialog:!1,confirmed:!1,error:null,notice:null})},snapshot:()=>t,subscribe(o){return c.add(o),()=>{c.delete(o)}},async load(o){let l=++i;n({loading:!0,error:null,cursor:o});let p=await a.client.request("get","/_pb/import-runs",{query:{cursor:o}});l===i&&n(p.ok?{runs:p.data.items.map(S),next:p.data.next,loading:!1}:{runs:[],next:null,loading:!1,error:"Unable to load import runs."})},async select(o){if(t.busy)return;let l=++s;n({run:null,selectedId:o,detailLoading:!0,dialog:!1,confirmed:!1,error:null,notice:null});let p=await a.client.request("get","/_pb/import-runs/{id}",{params:{id:o}});l===s&&n(p.ok?{run:S(p.data),detailLoading:!1}:{detailLoading:!1,error:"Unable to load the import run."})},openApproval(){!t.busy&&t.run?.state==="planned"&&t.run.planHash&&t.run.approvedAt===null&&n({dialog:!0,confirmed:!1})},closeApproval(){t.busy||n({dialog:!1,confirmed:!1})},confirmApproval(o){t.dialog&&!t.busy&&n({confirmed:o})},async action(o){let l=t.run;if(l===null||t.busy||!v(l,o)||o==="approve"&&(!t.dialog||!t.confirmed||!l.planHash||l.state!=="planned"||l.approvedAt!==null))return;n({busy:!0,error:null,notice:null});let p=o==="approve"?await a.client.request("post","/_pb/import-runs/{id}/approve",{params:{id:l.id},body:{planHash:l.planHash}}):await a.client.request("post",`/_pb/import-runs/{id}/${o}`,{params:{id:l.id}});if(n({busy:!1,dialog:!1,confirmed:!1}),!p.ok){p.code==="reauth_required"?a.requireReauth(p.request,{credential:!1,secretFields:[]}):n({error:p.code==="conflict"?"The run changed. Reload it and try again.":"Unable to update the import run."});return}await r.select(l.id),await r.load(t.cursor),n({notice:"Action accepted. Reload to check job progress."})}};return r}function E({state:a,controller:t,onSelect:s,onBack:i,onPage:c}){let n=a.run,[r,o]=(0,u.useState)(Date.now);return(0,u.useEffect)(()=>{let l=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(l)},[]),(0,e.jsxs)("section",{"aria-labelledby":"page-heading",className:"space-y-4",children:[(0,e.jsx)("h1",{tabIndex:-1,id:"page-heading",className:"text-2xl font-semibold",children:"Import"}),(0,e.jsx)("p",{children:"Upload credentials with the CLI. Import manifests are managed with the CLI."}),a.selectedId&&n===null?(0,e.jsx)(d,{type:"button",variant:"link",className:"px-0",disabled:a.busy,onClick:()=>i?i():t.back(),children:"\u2190 Back to import runs"}):null,a.error===null?null:(0,e.jsx)(b,{kind:"error",title:a.error,children:(0,e.jsx)(d,{type:"button",variant:"outline",disabled:a.busy||a.loading,onClick:()=>{a.selectedId?t.select(a.selectedId):t.load(a.cursor)},children:"Retry"})}),a.notice===null?null:(0,e.jsx)("p",{role:"status",children:a.notice}),(0,e.jsx)(d,{type:"button",variant:"outline",disabled:a.loading||a.busy,onClick:()=>{t.load(a.cursor)},children:"Reload runs"}),a.loading?(0,e.jsx)(b,{kind:"loading",title:"Loading import runs\u2026"}):null,a.detailLoading?(0,e.jsx)(b,{kind:"loading",title:"Loading import run\u2026"}):null,n===null&&!a.detailLoading&&!a.loading?a.runs.length?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(L,{label:"Import runs",items:a.runs,columns:[{key:"id",label:"Run",value:l=>l.id,render:l=>(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,e.jsxs)(d,{type:"button",variant:"link",className:"h-auto p-0 font-mono",disabled:a.busy,onClick:()=>s?s(l.id):void t.select(l.id),children:["Run ",l.id.slice(0,6),"\u2026",l.id.slice(-4)]}),(0,e.jsx)(m,{value:l.id,label:"run ID"})]})},{key:"state",label:"State",value:l=>l.state,render:l=>(0,e.jsx)(h,{status:l.state})},{key:"hash",label:"Plan hash",value:l=>l.planHash??"",render:l=>l.planHash?(0,e.jsx)(m,{value:l.planHash,label:"plan hash"}):"No plan hash"},{key:"approved",label:"Approved",priority:2,value:l=>l.approvedAt??"",render:l=>(0,e.jsx)(f,{value:l.approvedAt,fallback:"Not approved"})},{key:"accepted",label:"Accepted",priority:3,value:l=>l.acceptedAt??"",render:l=>(0,e.jsx)(f,{value:l.acceptedAt,fallback:"Not accepted"})},{key:"expires",label:"Before-image expires",priority:3,value:l=>l.beforeImageExpiresAt??"",render:l=>(0,e.jsx)(f,{value:l.beforeImageExpiresAt,fallback:"Not scheduled"})}]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(d,{type:"button",variant:"outline",disabled:!a.cursor||a.busy,onClick:()=>c?c():void t.load(),children:"First page"}),(0,e.jsx)(d,{type:"button",variant:"outline",disabled:!a.next||a.busy,onClick:()=>{a.next&&(c?c(a.next):t.load(a.next))},children:"Next page"})]})]}):a.error?null:(0,e.jsx)(b,{kind:a.cursor?"filtered-empty":"empty",title:a.cursor?"No import runs on this page":"No import runs.",children:"Create an import plan with the CLI to get started."}):null,n===null?null:(0,e.jsxs)("section",{"aria-labelledby":"run-heading",className:"space-y-3",children:[(0,e.jsx)(d,{type:"button",variant:"link",className:"px-0",disabled:a.busy,onClick:()=>i?i():t.back(),children:"\u2190 Back to import runs"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsxs)("h2",{id:"run-heading",className:"text-lg font-semibold",children:["Run ",(0,e.jsx)(m,{value:n.id,label:"run ID"})]}),(0,e.jsx)(h,{status:n.state})]}),(0,e.jsxs)("div",{className:"detail-grid",children:[(0,e.jsxs)("div",{className:"detail-group",children:[(0,e.jsx)("h3",{children:"Plan"}),(0,e.jsxs)("dl",{className:"detail-list",children:[(0,e.jsx)("dt",{children:"Plan hash"}),(0,e.jsx)("dd",{children:n.planHash?(0,e.jsx)(m,{value:n.planHash,label:"full plan hash",full:!0}):"No plan hash"}),(0,e.jsx)("dt",{children:"Run ID"}),(0,e.jsx)("dd",{children:(0,e.jsx)(m,{value:n.id,label:"run ID"})})]})]}),(0,e.jsxs)("div",{className:"detail-group",children:[(0,e.jsx)("h3",{children:"Approval"}),(0,e.jsxs)("dl",{className:"detail-list",children:[(0,e.jsx)("dt",{children:"Approved at"}),(0,e.jsx)("dd",{children:(0,e.jsx)(f,{value:n.approvedAt,fallback:"Not approved"})}),(0,e.jsx)("dt",{children:"Approved by"}),(0,e.jsx)("dd",{children:(0,e.jsx)(m,{value:n.approvedByUserId,label:"approving user ID"})})]})]}),(0,e.jsxs)("div",{className:"detail-group",children:[(0,e.jsx)("h3",{children:"Execution and retention"}),(0,e.jsxs)("dl",{className:"detail-list",children:[(0,e.jsx)("dt",{children:"Accepted at"}),(0,e.jsx)("dd",{children:(0,e.jsx)(f,{value:n.acceptedAt,fallback:"Not accepted"})}),(0,e.jsx)("dt",{children:"Before-image expires"}),(0,e.jsx)("dd",{children:(0,e.jsx)(f,{value:n.beforeImageExpiresAt,fallback:"Not scheduled"})})]})]})]}),(0,e.jsx)("h3",{className:"font-semibold",children:"Actions"}),(0,e.jsx)("p",{className:"text-sm text-neutral-600",children:"Apply requires an approved plan. Cancel is available for planned runs. Rollback is available after execution while before-images are retained."}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,e.jsx)(d,{type:"button",variant:"outline",disabled:a.busy,onClick:()=>{t.select(n.id)},children:"Reload run"}),(0,e.jsx)(d,{type:"button",disabled:a.busy||!v(n,"approve",r),onClick:()=>t.openApproval(),children:"Review approval"}),["apply","cancel","rollback"].map(l=>(0,e.jsx)(d,{type:"button",variant:l==="apply"?"outline":"ghost",className:l==="apply"?void 0:"text-red-700",disabled:a.busy||!v(n,l,r),title:v(n,l,r)?void 0:"Unavailable in the current state or retention window.",onClick:()=>{t.action(l)},children:l==="apply"?"Apply":l==="cancel"?"Cancel run":"Rollback"},l))]})]}),a.dialog&&n!==null?(0,e.jsx)(I,{open:!0,onOpenChange:l=>{l||t.closeApproval()},children:(0,e.jsx)(k,{onCancel:l=>{a.busy&&l.preventDefault()},children:(0,e.jsxs)("form",{className:"grid gap-4",onSubmit:l=>{l.preventDefault(),!(a.busy||!a.confirmed)&&t.action("approve")},children:[(0,e.jsxs)(x,{children:[(0,e.jsx)(w,{children:"Approve import run"}),(0,e.jsx)(N,{children:"Confirm the full plan hash for the plan you reviewed with the CLI."})]}),(0,e.jsx)("p",{className:"break-all",children:(0,e.jsx)("code",{children:n.planHash})}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(C,{id:"confirm-plan",type:"checkbox",className:"h-4 w-4",checked:a.confirmed,disabled:a.busy,onChange:l=>t.confirmApproval(l.currentTarget.checked)}),(0,e.jsx)(D,{htmlFor:"confirm-plan",children:"I confirm this plan hash."})]}),(0,e.jsxs)(A,{children:[(0,e.jsx)(d,{type:"button",variant:"outline",disabled:a.busy,onClick:()=>t.closeApproval(),children:"Back"}),(0,e.jsx)(d,{type:"submit",disabled:!a.confirmed||a.busy,children:"Approve run"})]})]})})}):null]})}function O(){let a=R(),t=(0,u.useMemo)(()=>H(a),[a]),s=(0,u.useSyncExternalStore)(t.subscribe,t.snapshot,t.snapshot),[i,c]=(0,u.useState)(()=>window.location.hash);(0,u.useEffect)(()=>{let r=()=>c(window.location.hash);return window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]),(0,u.useEffect)(()=>{let r=new URLSearchParams(i.split("?")[1]);t.load(r.get("cursor")??void 0);let o=r.get("run");o?t.select(o):t.back()},[t,i]);let n=(r,o)=>{let l=new URLSearchParams(i.split("?")[1]);o?l.set(r,o):l.delete(r),r==="cursor"&&l.delete("run"),window.location.hash=`#/import${l.size?`?${l}`:""}`};return(0,e.jsx)(E,{state:s,controller:t,onSelect:r=>n("run",r),onBack:()=>n("run"),onPage:r=>n("cursor",r)})}export{O as ImportPage,E as ImportView,H as createImportController,v as importActionAllowed};
|
package/node/assets/index.html
CHANGED
|
@@ -4,8 +4,15 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Package Broker</title>
|
|
7
|
-
<link rel="stylesheet" href="app.
|
|
8
|
-
<
|
|
7
|
+
<link rel="stylesheet" href="app.45b156168495.css" />
|
|
8
|
+
<link rel="modulepreload" href="chunk.675b635d9462.js" />
|
|
9
|
+
<link rel="modulepreload" href="chunk.f54ea1378c8c.js" />
|
|
10
|
+
<link rel="modulepreload" href="chunk.fd375c54b526.js" />
|
|
11
|
+
<link rel="modulepreload" href="chunk.815f9a91c741.js" />
|
|
12
|
+
<link rel="modulepreload" href="chunk.d18497920e4d.js" />
|
|
13
|
+
<link rel="modulepreload" href="chunk.3fcd6998795a.js" />
|
|
14
|
+
<link rel="modulepreload" href="chunk.741aec8d1ff9.js" />
|
|
15
|
+
<script type="module" src="app.c064670cdc0d.js"></script>
|
|
9
16
|
</head>
|
|
10
17
|
<body>
|
|
11
18
|
<div id="root"></div>
|
|
@@ -4,23 +4,123 @@
|
|
|
4
4
|
"files": {
|
|
5
5
|
"index.html": {
|
|
6
6
|
"contentType": "text/html",
|
|
7
|
-
"bytes":
|
|
7
|
+
"bytes": 797
|
|
8
8
|
},
|
|
9
9
|
"setup.html": {
|
|
10
10
|
"contentType": "text/html",
|
|
11
|
-
"bytes":
|
|
11
|
+
"bytes": 464
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"chunk.675b635d9462.js": {
|
|
14
14
|
"contentType": "text/javascript",
|
|
15
|
-
"bytes":
|
|
15
|
+
"bytes": 3251
|
|
16
16
|
},
|
|
17
|
-
"
|
|
17
|
+
"chunk.fd375c54b526.js": {
|
|
18
18
|
"contentType": "text/javascript",
|
|
19
|
-
"bytes":
|
|
19
|
+
"bytes": 87869
|
|
20
20
|
},
|
|
21
|
-
"
|
|
21
|
+
"chunk.f54ea1378c8c.js": {
|
|
22
|
+
"contentType": "text/javascript",
|
|
23
|
+
"bytes": 242
|
|
24
|
+
},
|
|
25
|
+
"chunk.815f9a91c741.js": {
|
|
26
|
+
"contentType": "text/javascript",
|
|
27
|
+
"bytes": 1315
|
|
28
|
+
},
|
|
29
|
+
"chunk.3fcd6998795a.js": {
|
|
30
|
+
"contentType": "text/javascript",
|
|
31
|
+
"bytes": 1694
|
|
32
|
+
},
|
|
33
|
+
"chunk.d18497920e4d.js": {
|
|
34
|
+
"contentType": "text/javascript",
|
|
35
|
+
"bytes": 179256
|
|
36
|
+
},
|
|
37
|
+
"chunk.741aec8d1ff9.js": {
|
|
38
|
+
"contentType": "text/javascript",
|
|
39
|
+
"bytes": 379
|
|
40
|
+
},
|
|
41
|
+
"chunk.28a4d8aab337.js": {
|
|
42
|
+
"contentType": "text/javascript",
|
|
43
|
+
"bytes": 2221
|
|
44
|
+
},
|
|
45
|
+
"chunk.965b76812604.js": {
|
|
46
|
+
"contentType": "text/javascript",
|
|
47
|
+
"bytes": 41963
|
|
48
|
+
},
|
|
49
|
+
"chunk.6ea6bdcaa465.js": {
|
|
50
|
+
"contentType": "text/javascript",
|
|
51
|
+
"bytes": 4075
|
|
52
|
+
},
|
|
53
|
+
"chunk.8442124f6802.js": {
|
|
54
|
+
"contentType": "text/javascript",
|
|
55
|
+
"bytes": 2178
|
|
56
|
+
},
|
|
57
|
+
"chunk.a6d755a9789f.js": {
|
|
58
|
+
"contentType": "text/javascript",
|
|
59
|
+
"bytes": 1120
|
|
60
|
+
},
|
|
61
|
+
"projects.927fe18c785c.js": {
|
|
62
|
+
"contentType": "text/javascript",
|
|
63
|
+
"bytes": 19234
|
|
64
|
+
},
|
|
65
|
+
"chunk.d813fefb410d.js": {
|
|
66
|
+
"contentType": "text/javascript",
|
|
67
|
+
"bytes": 457
|
|
68
|
+
},
|
|
69
|
+
"access.62e9484517a0.js": {
|
|
70
|
+
"contentType": "text/javascript",
|
|
71
|
+
"bytes": 26648
|
|
72
|
+
},
|
|
73
|
+
"chunk.56d473a1587d.js": {
|
|
74
|
+
"contentType": "text/javascript",
|
|
75
|
+
"bytes": 1645
|
|
76
|
+
},
|
|
77
|
+
"chunk.51497edc7697.js": {
|
|
78
|
+
"contentType": "text/javascript",
|
|
79
|
+
"bytes": 58133
|
|
80
|
+
},
|
|
81
|
+
"chunk.e3b0c44298fc.js": {
|
|
82
|
+
"contentType": "text/javascript",
|
|
83
|
+
"bytes": 0
|
|
84
|
+
},
|
|
85
|
+
"sources.ae50f239f80f.js": {
|
|
86
|
+
"contentType": "text/javascript",
|
|
87
|
+
"bytes": 774
|
|
88
|
+
},
|
|
89
|
+
"packages.ab5ab25b1c75.js": {
|
|
90
|
+
"contentType": "text/javascript",
|
|
91
|
+
"bytes": 57395
|
|
92
|
+
},
|
|
93
|
+
"npm-login.e059678af13d.js": {
|
|
94
|
+
"contentType": "text/javascript",
|
|
95
|
+
"bytes": 3728
|
|
96
|
+
},
|
|
97
|
+
"tokens.6b86d8d97e07.js": {
|
|
98
|
+
"contentType": "text/javascript",
|
|
99
|
+
"bytes": 63356
|
|
100
|
+
},
|
|
101
|
+
"notifications.19225fe12044.js": {
|
|
102
|
+
"contentType": "text/javascript",
|
|
103
|
+
"bytes": 30808
|
|
104
|
+
},
|
|
105
|
+
"audit.b7c40b9dc998.js": {
|
|
106
|
+
"contentType": "text/javascript",
|
|
107
|
+
"bytes": 6127
|
|
108
|
+
},
|
|
109
|
+
"import.e7a1e5834631.js": {
|
|
110
|
+
"contentType": "text/javascript",
|
|
111
|
+
"bytes": 10472
|
|
112
|
+
},
|
|
113
|
+
"app.c064670cdc0d.js": {
|
|
114
|
+
"contentType": "text/javascript",
|
|
115
|
+
"bytes": 217905
|
|
116
|
+
},
|
|
117
|
+
"setup.8e977608d413.js": {
|
|
118
|
+
"contentType": "text/javascript",
|
|
119
|
+
"bytes": 17028
|
|
120
|
+
},
|
|
121
|
+
"app.45b156168495.css": {
|
|
22
122
|
"contentType": "text/css",
|
|
23
|
-
"bytes":
|
|
123
|
+
"bytes": 32112
|
|
24
124
|
}
|
|
25
125
|
}
|
|
26
126
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as J,c as ie}from"./chunk.815f9a91c741.js";import{a as z,b as le}from"./chunk.56d473a1587d.js";import"./chunk.d18497920e4d.js";import{b as X}from"./chunk.8442124f6802.js";import{a as ae}from"./chunk.a6d755a9789f.js";import{a as V,c as A}from"./chunk.965b76812604.js";import"./chunk.3fcd6998795a.js";import{a as $}from"./chunk.d813fefb410d.js";import{a as ne}from"./chunk.741aec8d1ff9.js";import{E as O,F as R,K as te,c as _,d as G,g as F,m as Q,n as ee,p as w}from"./chunk.fd375c54b526.js";var N=_(G(),1);var K=[{value:"npm.package.published",label:"Version published",help:"A new local version is available immediately after publishing."},{value:"npm.package.released",label:"Held version released",help:"A version held for approval or scanning becomes available."},{value:"npm.package.unpublished",label:"Version or package removed",help:"A version or the whole package is unpublished or tombstoned."},{value:"npm.package.deprecation_changed",label:"Deprecation changed",help:"A version is deprecated or its deprecation is cleared. The message is not sent."},{value:"npm.package.dist_tag_changed",label:"Dist-tag changed",help:"A dist-tag is added, moved or deleted, including moves caused by an unpublish."}],B=n=>K.find(a=>a.value===n)?.label??"Unknown event";function se(n){if(n.state==="enabled")return"Sending new events.";switch(n.disabledReason){case"configuration_changed":return"Disabled because its delivery settings were replaced. Enable it to resume sending.";case"failures":return"Disabled after 10 deliveries in a row failed. Check the receiver, then enable it.";case"credentials":return"Disabled because the receiver refused the request (401 or 403). Replace the delivery settings, then enable it.";case"policy":return"Disabled because the destination is not allowed. Replace the destination, then enable it.";case"gone":return"Disabled because the receiver reported that it no longer exists (410).";case"manual":return"Disabled. No events are sent until it is enabled.";default:return"Not enabled yet. No events are sent until it is enabled."}}var me={ok:"Delivered",network:"Could not connect",timeout:"Receiver did not answer in time",http_retry:"Receiver asked to retry",http_permanent:"Receiver refused the event",redirect:"Receiver answered with a redirect, which is not followed",policy:"Destination not allowed",credentials:"Delivery settings could not be used",template:"Body template could not be applied",unknown:"Result unknown; the receiver may have processed it",expired:"Expired after 24 hours",attempt_limit:"Stopped after 8 attempts",disabled:"Cancelled because the endpoint was disabled",superseded:"Cancelled because the endpoint changed",project_inactive:"Cancelled because the project is archived",admission_lost:"Cancelled because the source left the project",deleted:"Cancelled because the endpoint was deleted"};function U(n){return n.state==="pending"?"Waiting to send":n.state==="sending"?"Sending":n.outcomeCode===null?"Finished":me[n.outcomeCode]}function ve(n){if(n.status===412||n.status===428||n.code==="conflict")return"This endpoint changed while you were editing. Reload the latest settings before saving.";switch(n.code){case"invalid_configuration":return"The broker refused these settings. Use an HTTPS address on a public host, a 43-character signing key, permitted headers and a valid template.";case"invalid_request":return"Check the entered values and try again.";case"endpoint_limit":return"This project already has 20 notification endpoints. Remove one before adding another.";case"transport_unavailable":return"This broker cannot send notifications, so the endpoint cannot be enabled.";case"forbidden":return"You do not have permission to change notifications in this project.";case"not_found":return"This endpoint no longer exists. Reload the list.";default:return"The request could not be completed. Try again."}}var ge=n=>({params:{project:n}}),Z=(n,a)=>({params:{project:n,id:a.id},headers:{"If-Match":`"r${a.revision}"`}});function I(n,a,e){return a.code==="reauth_required"?(n.requireReauth(e?{method:a.request.method,path:a.request.path}:a.request,{credential:e,secretFields:[]}),{ok:!1,reauth:!0,stale:!1,message:e?"Reauthenticate, then enter the delivery settings again. Nothing was saved.":"Reauthentication is required. Confirm the action again after signing in."}):{ok:!1,reauth:!1,stale:a.status===412||a.status===428||a.code==="conflict",message:ve(a)}}var M={ok:!1,message:"",stale:!1,reauth:!1};async function oe(n,a,e,t,o=()=>!0){let r=await n.client.request("post","/_pb/projects/{project}/notifications",{...ge(a),body:{...e,secret:t}});return o()?r.ok?{ok:!0,endpoint:r.data,message:"Endpoint added. It stays disabled until you enable it."}:(r.code==="reauth_required"&&J(a,null,e),I(n,r,!0)):M}async function re(n,a,e,t,o=()=>!0){let r=await n.client.request("patch","/_pb/projects/{project}/notifications/{id}",{...Z(a,e),body:t});return o()?r.ok?{ok:!0,endpoint:r.data,message:t.secret===void 0?"Endpoint saved. Waiting deliveries for the previous settings were cancelled.":"Delivery settings replaced. The endpoint is disabled and waiting deliveries were cancelled; enable it to resume."}:(r.code==="reauth_required"&&t.secret!==void 0&&t.options!==void 0&&J(a,e,t.options),I(n,r,t.secret!==void 0)):M}async function W(n,a,e,t,o=()=>!0){let r=await n.client.request("post",t?"/_pb/projects/{project}/notifications/{id}/enable":"/_pb/projects/{project}/notifications/{id}/disable",Z(a,e));return o()?r.ok?{ok:!0,endpoint:r.data,message:t?"Endpoint enabled. Only events from now on are sent; earlier events are not replayed.":"Endpoint disabled. No new events are sent; waiting deliveries are cancelled."}:I(n,r,!1):M}async function de(n,a,e,t=()=>!0){let o=await n.client.request("delete","/_pb/projects/{project}/notifications/{id}",Z(a,e));return t()?o.ok?{ok:!0,endpoint:null,message:"Endpoint removed. Its waiting deliveries were cancelled."}:I(n,o,!1):M}var j=_(G(),1);var l=_(F(),1),fe={id:"01JEXAMPLEEVENT00000000000",operationId:"01JEXAMPLE0PERATI0N0000000",organizationId:"01JEXAMPLE0RGANIZATI0N0000",projectId:"01JEXAMPLEPR0JECT000000000"},he={"npm.package.published":{},"npm.package.released":{releaseCause:"approval_and_scan"},"npm.package.unpublished":{removalScope:"version",removalKind:"window"},"npm.package.deprecation_changed":{deprecated:!0},"npm.package.dist_tag_changed":{tag:"latest",previousVersion:"1.2.2",version:"1.2.3",cause:"explicit"}};function ye(n){return{schemaVersion:1,...fe,type:n,occurredAt:"2026-11-01T12:00:00.000Z",package:{ecosystem:"npm",name:"@example/library",version:"1.2.3"},data:he[n]}}function be(n,a){let e=n;for(let t of a.split(".")){if(e===null||typeof e!="object"||!Object.hasOwn(e,t))return;e=e[t]}return e}function ke(n,a){let e=ye(n);if(a.trim()==="")return JSON.stringify(e,null,2);let t;try{t=JSON.parse(a)}catch{return"The template is not valid JSON."}let o=!1,r=d=>{if(Array.isArray(d))return d.map(r);if(d!==null&&typeof d=="object")return Object.fromEntries(Object.entries(d).map(([P,u])=>[P,r(u)]));let m=typeof d=="string"?/^\{\{([A-Za-z.]+)\}\}$/.exec(d):null;if(m===null)return d;let y=be(e,m[1]);return(y===void 0||y!==null&&typeof y=="object")&&(o=!0),y},f=r(t);return o?"The template names a value this event does not have.":JSON.stringify(f,null,2)}var H={url:"",signingKey:"",template:"",headers:[]};function ce(n){let a=(0,j.useId)(),e=n.endpoint,[t,o]=(0,j.useState)(()=>n.restoredOptions??{name:e?.name??"",method:e?.method??"POST",events:[...e?.events??["npm.package.published"]],packagePattern:e?.packagePattern??"*"}),[r,f]=(0,j.useState)(e===null||n.requireSecret===!0),[d,m]=(0,j.useState)(H),[y,P]=(0,j.useState)(!1),[u,h]=(0,j.useState)(null),[v,b]=(0,j.useState)(null);(0,j.useEffect)(()=>()=>m(H),[]);let E=e!==null&&[...t.events].sort().join()!==[...e.events].sort().join(),x=e?.templateConfigured===!0&&E&&!r,p=c=>`${a}-${c}`,q=async c=>{if(c.preventDefault(),y||n.disabled)return;if(t.events.length===0){h("Choose at least one event."),document.getElementById(p("events"))?.focus();return}if(x){h("This endpoint has a body template. Replace the delivery settings with a template that fits the new events.");return}P(!0),h(null);let k=await n.onSubmit({options:t,...r?{secret:{url:d.url,signingKey:d.signingKey,headers:d.headers.filter(S=>S.name!==""),template:d.template.trim()===""?null:d.template}}:{}});P(!1),(k.ok||k.reauth)&&(m(H),b(null)),k.ok||h(k.message)};return(0,l.jsxs)("form",{onSubmit:c=>{q(c)},"aria-label":e===null?"New notification endpoint":`Edit ${e.name}`,className:"grid max-w-5xl items-start gap-x-6 gap-y-4 lg:grid-cols-2",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold lg:col-span-2",children:e===null?"New notification endpoint":`Edit ${e.name}`}),(0,l.jsx)("p",{className:"lg:col-span-2",children:`Project ${n.projectName} \xB7 The broker sends a signed HTTPS request to your receiver when a selected package event commits in this project.`}),(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(R,{htmlFor:p("name"),children:"Name"}),(0,l.jsx)(O,{id:p("name"),required:!0,maxLength:80,value:t.name,onChange:c=>o({...t,name:c.target.value})})]}),(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(R,{htmlFor:p("pattern"),children:"Package filter"}),(0,l.jsx)(O,{id:p("pattern"),required:!0,maxLength:50,value:t.packagePattern,"aria-describedby":p("pattern-help"),onChange:c=>o({...t,packagePattern:c.target.value})}),(0,l.jsx)("p",{id:p("pattern-help"),className:"text-sm text-neutral-600",children:"* matches any characters, including /. Examples: * for every package, @acme/* for one scope. Matching is exact and case-sensitive on the stored name; legacy package names with capital letters are stored with each capital written as ! followed by the lower-case letter, for example !my!package for MyPackage."})]}),(0,l.jsxs)("fieldset",{id:p("events"),tabIndex:-1,className:"grid gap-2 lg:col-span-2","aria-describedby":p("events-help"),children:[(0,l.jsx)("legend",{className:"font-medium",children:"Events"}),(0,l.jsx)("p",{id:p("events-help"),className:"text-sm text-neutral-600",children:"Only events committed after the endpoint is enabled are sent."}),K.map(c=>(0,l.jsxs)("label",{className:"flex min-h-11 items-start gap-2",children:[(0,l.jsx)("input",{type:"checkbox",className:"mt-1 size-4",checked:t.events.includes(c.value),onChange:k=>o({...t,events:k.target.checked?[...t.events,c.value]:t.events.filter(S=>S!==c.value)})}),(0,l.jsxs)("span",{children:[(0,l.jsx)("span",{className:"font-medium",children:c.label}),(0,l.jsx)("span",{className:"block text-sm text-neutral-600",children:c.help})]})]},c.value))]}),(0,l.jsxs)("fieldset",{className:"grid gap-2 lg:col-span-2",children:[(0,l.jsx)("legend",{className:"font-medium",children:"Request method"}),["POST","PUT"].map(c=>(0,l.jsxs)("label",{className:"flex min-h-11 items-center gap-2",children:[(0,l.jsx)("input",{type:"radio",name:p("method"),checked:t.method===c,onChange:()=>o({...t,method:c})}),c]},c))]}),e===null?null:(0,l.jsxs)("div",{className:"grid gap-2 lg:col-span-2",children:[(0,l.jsx)("p",{children:`Delivery settings: destination configured, signing key configured, custom headers ${e.headersConfigured?"configured":"none"}, body template ${e.templateConfigured?"configured":"none (standard envelope)"}. Saved settings are never shown again.`}),(0,l.jsxs)("label",{className:"flex min-h-11 items-center gap-2",children:[(0,l.jsx)("input",{type:"checkbox",checked:r,onChange:c=>{f(c.target.checked),c.target.checked||m(H)}}),"Replace delivery settings (needs recent sign-in; disables the endpoint)"]})]}),r?(0,l.jsxs)("fieldset",{className:"grid gap-4 lg:col-span-2 lg:grid-cols-2",children:[(0,l.jsx)("legend",{className:"font-medium",children:"Delivery settings"}),(0,l.jsxs)("div",{className:"grid gap-1 lg:col-span-2",children:[(0,l.jsx)(R,{htmlFor:p("url"),children:"Destination URL"}),(0,l.jsx)(O,{id:p("url"),type:"url",required:!0,autoComplete:"off",maxLength:2048,value:d.url,"aria-describedby":p("url-help"),onChange:c=>m({...d,url:c.target.value})}),(0,l.jsx)("p",{id:p("url-help"),className:"text-sm text-neutral-600",children:"HTTPS on port 443 to a public host. Redirects are not followed. The address is stored sealed and never shown again, so tokens in the path or query stay private."})]}),(0,l.jsxs)("div",{className:"grid gap-1 lg:col-span-2",children:[(0,l.jsx)(R,{htmlFor:p("key"),children:"Signing key"}),(0,l.jsx)(O,{id:p("key"),type:"password",required:!0,autoComplete:"off",pattern:"[A-Za-z0-9_\\-]{43}",value:d.signingKey,"aria-describedby":p("key-help"),onChange:c=>m({...d,signingKey:c.target.value})}),(0,l.jsx)("p",{id:p("key-help"),className:"text-sm text-neutral-600",children:"32 random bytes as 43 base64url characters, shared with your receiver to verify the X-Package-Broker-Signature header."})]}),(0,l.jsxs)("div",{className:"grid gap-2 lg:col-span-2",children:[(0,l.jsx)("p",{className:"font-medium",children:"Custom headers (optional)"}),(0,l.jsx)("p",{className:"text-sm text-neutral-600",children:"Authorization or X- headers only, up to 16. Values are stored sealed."}),d.headers.map((c,k)=>(0,l.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[1fr_2fr_auto]",children:[(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(R,{htmlFor:p(`header-name-${k}`),children:"Header name"}),(0,l.jsx)(O,{id:p(`header-name-${k}`),value:c.name,autoComplete:"off",onChange:S=>m({...d,headers:d.headers.map((C,L)=>L===k?{...C,name:S.target.value}:C)})})]}),(0,l.jsxs)("div",{className:"grid gap-1",children:[(0,l.jsx)(R,{htmlFor:p(`header-value-${k}`),children:"Header value"}),(0,l.jsx)(O,{id:p(`header-value-${k}`),type:"password",value:c.value,autoComplete:"off",onChange:S=>m({...d,headers:d.headers.map((C,L)=>L===k?{...C,value:S.target.value}:C)})})]}),(0,l.jsx)(w,{type:"button",variant:"outline",className:"min-h-11 self-end",onClick:()=>m({...d,headers:d.headers.filter((S,C)=>C!==k)}),children:"Remove header"})]},k)),d.headers.length<16?(0,l.jsx)(w,{type:"button",variant:"outline",className:"min-h-11 w-full sm:w-auto",onClick:()=>m({...d,headers:[...d.headers,{name:"",value:""}]}),children:"Add header"}):null]}),(0,l.jsxs)("div",{className:"grid gap-1 lg:col-span-2",children:[(0,l.jsx)(R,{htmlFor:p("template"),children:"Body template (optional)"}),(0,l.jsx)(le,{id:p("template"),rows:5,maxLength:8192,value:d.template,"aria-describedby":p("template-help"),onChange:c=>m({...d,template:c.target.value})}),(0,l.jsxs)("p",{id:p("template-help"),className:"text-sm text-neutral-600",children:["Leave empty to send the standard event envelope. A template is JSON in which a string value written as ",'"{{package.name}}"'," is replaced by that event value. It must fit every selected event."]})]}),(0,l.jsxs)("div",{className:"grid gap-2 lg:col-span-2",children:[(0,l.jsx)(w,{type:"button",variant:"outline",className:"min-h-11 w-full sm:w-auto",disabled:t.events.length===0,onClick:()=>b(ke(t.events[0],d.template)),children:"Preview with example data"}),v===null?null:(0,l.jsx)("pre",{"aria-label":"Example body",className:"max-h-64 overflow-auto rounded-md border bg-neutral-50 p-2 text-xs",children:v})]})]}):null,x?(0,l.jsx)(Q,{className:"lg:col-span-2",children:(0,l.jsx)(ee,{children:"This endpoint has a body template checked against its current events. To change the events, replace the delivery settings with a template that fits them."})}):null,(0,l.jsx)("p",{className:"lg:col-span-2",children:e===null?"The endpoint is added disabled. Adding it needs a recent sign-in. Nothing is sent until you enable it.":"Saving any change, including a rename, starts a new revision and cancels deliveries still waiting for the previous one."}),u===null?null:(0,l.jsx)("p",{role:"alert",className:"text-red-700 lg:col-span-2",children:u}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2 lg:col-span-2",children:[(0,l.jsx)(w,{type:"submit",className:"min-h-11 w-full sm:w-auto",disabled:y||n.disabled,"aria-busy":y,children:y?e===null?"Adding endpoint\u2026":"Saving endpoint\u2026":e===null?"Add endpoint":"Save endpoint"}),(0,l.jsx)(w,{type:"button",variant:"outline",className:"min-h-11 w-full sm:w-auto",disabled:y,onClick:()=>{m(H),n.onCancel()},children:"Cancel"})]})]})}var ue={project:null,items:[],next:null,hasPrevious:!1,loading:!1,blocked:null,selected:null,deliveries:[],deliveriesNext:null,deliveriesHasPrevious:!1,deliveriesLoading:!1,deliveriesError:!1,filter:"all",detail:null,detailError:!1};function pe(n){let a=ue,e=0,t=0,o=0,r=[void 0],f=[void 0],d=new Set,m=u=>{a={...a,...u};for(let h of d)h()};async function y(){let{project:u,selected:h,filter:v}=a;if(u===null||h===null)return;let b=++o;m({deliveriesLoading:!0,deliveriesError:!1});let E=f[f.length-1],x=await n.client.request("get","/_pb/projects/{project}/notifications/{id}/deliveries",{params:{project:u,id:h},query:{...E===void 0?{}:{cursor:E},...v==="all"?{}:{state:v}}});b===o&&m({deliveriesLoading:!1,deliveriesError:!x.ok,deliveries:x.ok?x.data.items:[],deliveriesNext:x.ok?x.data.next:null,deliveriesHasPrevious:f.length>1})}let P={mutationScope(){let u=e;return()=>u===e},snapshot:()=>a,subscribe(u){return d.add(u),()=>{d.delete(u)}},async load(u=a.project){if(u!==a.project&&(e++,r=[void 0],f=[void 0],o++,m({...ue,project:u})),u===null)return;let h=++t;m({loading:!0,blocked:null});let v=r[r.length-1],b=await n.client.request("get","/_pb/projects/{project}/notifications",{params:{project:u},query:v===void 0?{}:{cursor:v}});if(h!==t)return;if(!b.ok){m({loading:!1,items:[],next:null,blocked:b.status===403?"denied":b.status===404?"unavailable":"error"});return}let E=a.selected!==null&&b.data.items.some(x=>x.id===a.selected)?a.selected:null;m({loading:!1,items:b.data.items,next:b.data.next,hasPrevious:r.length>1,selected:E,...E===null?{deliveries:[],detail:null}:{}})},async nextPage(){a.loading||a.next===null||(r.push(a.next),await P.load())},async previousPage(){a.loading||r.length<2||(r.pop(),await P.load())},replace(u,h){m({items:h===null?a.items.filter(v=>v.id!==u):a.items.some(v=>v.id===u)?a.items.map(v=>v.id===u?h:v):[...a.items,h],...h===null&&a.selected===u?{selected:null,deliveries:[],detail:null}:{}})},async select(u){f=[void 0],o++,m({selected:u,deliveries:[],deliveriesNext:null,deliveriesHasPrevious:!1,deliveriesError:!1,detail:null,detailError:!1,filter:"all"}),await y()},async filterHistory(u){f=[void 0],m({filter:u,detail:null}),await y()},reloadHistory:y,async nextHistory(){a.deliveriesLoading||a.deliveriesNext===null||(f.push(a.deliveriesNext),await y())},async previousHistory(){a.deliveriesLoading||f.length<2||(f.pop(),await y())},async openDelivery(u){let{project:h,selected:v}=a;if(h===null||v===null)return;m({detailError:!1});let b=await n.client.request("get","/_pb/projects/{project}/notifications/{id}/deliveries/{delivery}",{params:{project:h,id:v,delivery:u}});a.selected===v&&m(b.ok?{detail:b.data}:{detail:null,detailError:!0})},dispose(){e++,t++,o++}};return P}var i=_(F(),1),Y=20,Ne=[{value:"all",label:"All deliveries"},{value:"pending",label:"Waiting"},{value:"sending",label:"Sending"},{value:"delivered",label:"Delivered"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"}];function we(){let n=(0,N.useSyncExternalStore)(t=>(window.addEventListener("hashchange",t),()=>window.removeEventListener("hashchange",t)),()=>window.location.hash,()=>""),e=new URLSearchParams(n.split("?")[1]??"").get("project");return e!==null&&/^[A-Za-z0-9._-]{1,64}$/.test(e)?e:null}function xe(n){let{services:a,controller:e,project:t}=n,o=(0,N.useSyncExternalStore)(e.subscribe,e.snapshot,e.snapshot),[r,f]=(0,N.useState)(null),d=(0,N.useRef)(null),[m,y]=(0,N.useState)(null),[P,u]=(0,N.useState)(null),[h,v]=(0,N.useState)(null),[b,E]=(0,N.useState)(!1),[x,p]=(0,N.useState)(null),[q,c]=(0,N.useState)(null);(0,N.useEffect)(()=>{f(null),y(null),p(null),c(null),u(null),v(null),E(!1),e.load(t);let s=e.mutationScope();d.current?.project!==t&&(d.current={project:t,value:t===null?null:ie(t)});let g=d.current.value;if(g!==null){let T=D=>{s()&&(f(D),y(g.options),u("Draft restored. Review it and enter the delivery settings again before saving."),D!=="new"&&D.revision!==g.endpoint?.revision&&(E(!0),v("This endpoint changed while you were editing. Reload the latest settings before saving.")))};g.endpoint===null?T("new"):a.client.request("get","/_pb/projects/{project}/notifications/{id}",{params:{project:g.project,id:g.endpoint.id}}).then(D=>{D.ok?T(D.data):s()&&v("The draft endpoint could not be loaded. Reload the list.")})}return()=>e.dispose()},[e,t,a]);let k=n.projectName??t??"",S=(s,g)=>(g.ok?(g.endpoint!==null?e.replace(g.endpoint.id,g.endpoint):s!==null&&e.replace(s,null),u(g.message),v(null),E(!1)):(u(null),v(g.message),E(g.stale)),g),C=async(s,g)=>{if(x!==null||t===null)return;let T=e.mutationScope();p(s.id);let D=await g(T);T()&&(S(s.id,D),p(null))},L=o.items.find(s=>s.id===o.selected)??null;return t===null?(0,i.jsxs)("section",{className:"space-y-4",children:[(0,i.jsx)("h1",{className:"text-2xl font-semibold",children:"Notifications"}),(0,i.jsx)(A,{kind:"placeholder",title:"Choose a project to manage its notifications.",children:(0,i.jsx)("p",{children:"Notification endpoints belong to one project. Pick it in the Scope menu."})})]}):(0,i.jsxs)("section",{className:"space-y-4",children:[(0,i.jsx)("h1",{className:"text-2xl font-semibold",children:"Notifications"}),(0,i.jsx)("p",{children:`Project ${k} \xB7 Send a signed request to your own HTTPS receiver when a package in this project is published, released, removed, deprecated or re-tagged. Delivery is retried for up to 24 hours and is not guaranteed.`}),(0,i.jsx)("div",{role:"status","aria-live":"polite",children:P}),h===null?null:(0,i.jsxs)("div",{role:"alert",className:"space-y-2 text-red-700",children:[(0,i.jsx)("p",{children:h}),b?(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11",onClick:()=>{E(!1),v(null),f(null),e.load()},children:"Reload latest settings"}):null]}),o.blocked==="denied"?(0,i.jsx)(A,{kind:"error",title:"You cannot manage notifications in this project.",children:(0,i.jsx)("p",{children:"Changing project settings in a signed-in session is required."})}):o.blocked==="unavailable"?(0,i.jsx)(A,{kind:"placeholder",title:"Notifications are not available.",children:(0,i.jsx)("p",{children:"This broker has notifications turned off, or the project is archived or not visible to you."})}):o.blocked==="error"?(0,i.jsx)(A,{kind:"error",title:"Notification endpoints could not be loaded. Try again.",children:(0,i.jsx)(w,{type:"button",className:"min-h-11",onClick:()=>{e.load()},children:"Try again"})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r===null?(0,i.jsx)(w,{type:"button",className:"min-h-11 w-full sm:w-auto",disabled:o.loading||o.items.length>=Y,"aria-describedby":o.items.length>=Y?"notification-limit":void 0,onClick:()=>{u(null),v(null),y(null),f("new")},children:"Add endpoint"}):null,(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11 w-full sm:w-auto",disabled:o.loading,onClick:()=>{e.load()},children:"Reload"})]}),o.items.length>=Y?(0,i.jsx)("p",{id:"notification-limit",children:"A project can have at most 20 endpoints."}):null,r===null?null:(0,i.jsx)(ce,{projectName:k,endpoint:r==="new"?null:r,disabled:b,...m===null?{}:{restoredOptions:m,requireSecret:!0},onCancel:()=>f(null),onSubmit:async s=>{let g=e.mutationScope(),T=r==="new"?await oe(a,t,s.options,s.secret,g):await re(a,t,r,s,g);return g()&&(S(null,T),T.ok&&f(null)),T}},`${t}/${r==="new"?"new":r.id}`),o.loading?(0,i.jsx)(A,{kind:"loading",title:"Loading notification endpoints\u2026"}):o.items.length===0?(0,i.jsx)(A,{kind:"empty",title:o.hasPrevious?"No endpoints on this page.":"No notification endpoints yet. Add one to tell another system about package changes."}):(0,i.jsx)(V,{label:`Notification endpoints in ${k}`,items:o.items,...o.selected===null?{}:{selectedId:o.selected},columns:[{key:"name",label:"Endpoint",value:s=>s.name,render:s=>(0,i.jsxs)("div",{className:"break-words",children:[(0,i.jsx)("strong",{children:s.name}),(0,i.jsxs)("p",{className:"text-sm text-neutral-600",children:[s.method," \xB7 signed",s.headersConfigured?" \xB7 custom headers":"",s.templateConfigured?" \xB7 body template":""]})]})},{key:"events",label:"Events and packages",value:s=>s.events.length,render:s=>(0,i.jsxs)("div",{className:"break-words",children:[(0,i.jsx)("p",{children:s.events.map(B).join(", ")}),(0,i.jsx)("p",{className:"font-mono text-sm",children:s.packagePattern})]})},{key:"state",label:"Status",value:s=>s.state,render:s=>(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)(X,{status:s.state}),(0,i.jsx)("p",{className:"text-sm",children:se(s)}),s.failureStreak>0?(0,i.jsx)("p",{className:"text-sm",children:`${s.failureStreak} failed ${s.failureStreak===1?"delivery":"deliveries"} in a row.`}):null]})},{key:"updated",label:"Changed",value:s=>s.updatedAt,priority:2,render:s=>(0,i.jsx)($,{value:s.updatedAt})},{key:"actions",label:"Actions",value:()=>"",sortable:!1,render:s=>(0,i.jsx)(z,{entityLabel:s.name,actions:[{id:"history",label:"Delivery history",onSelect:()=>{e.select(s.id)}}],overflow:[{id:"edit",label:"Edit",disabled:x!==null||b,onSelect:()=>{u(null),v(null),y(null),f(s)}},s.state==="enabled"?{id:"disable",label:"Disable",pending:x===s.id,disabled:b,onSelect:()=>{C(s,g=>W(a,t,s,!1,g))}}:{id:"enable",label:"Enable",pending:x===s.id,disabled:b,onSelect:()=>{C(s,g=>W(a,t,s,!0,g))}},{id:"delete",label:"Remove",variant:"destructive",disabled:x!==null||b,onSelect:()=>c(s)}]})}]}),(0,i.jsx)("p",{children:`${o.items.length} ${o.items.length===1?"endpoint":"endpoints"} on this page`}),o.hasPrevious||o.next!==null?(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11",disabled:o.loading||!o.hasPrevious,onClick:()=>{e.previousPage()},children:"Previous endpoints"}),(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11",disabled:o.loading||o.next===null,onClick:()=>{e.nextPage()},children:"Next endpoints"})]}):null,q===null?null:(0,i.jsx)(ae,{action:"Remove endpoint",target:q.name,scope:`Project ${k}`,description:"No further events are sent to this receiver and deliveries still waiting are cancelled. A request already on its way cannot be recalled. Removing it needs a recent sign-in and cannot be undone.",open:!0,hideTrigger:!0,onOpenChange:s=>{s||c(null)},onConfirm:()=>{let s=q;c(null),C(s,g=>de(a,t,s,g))}}),L===null?null:(0,i.jsx)(Se,{controller:e,name:L.name})]})]})}function Ee(n){return`${n.outcome==="started"?"started, result not recorded yet":U({state:n.outcome==="delivered"?"delivered":"failed",outcomeCode:n.outcomeCode})}${n.status===null?"":` (HTTP ${n.status})`}${n.durationMs===null?"":`, ${n.durationMs} ms`}`}function Se({controller:n,name:a}){let e=(0,N.useSyncExternalStore)(n.subscribe,n.snapshot,n.snapshot);return(0,i.jsxs)("section",{"aria-labelledby":"delivery-history",className:"space-y-4",children:[(0,i.jsx)("h2",{id:"delivery-history",className:"text-lg font-semibold",children:`Delivery history: ${a}`}),(0,i.jsx)("p",{children:"Finished deliveries are kept for seven days. Request and response bodies, addresses and headers are never stored."}),(0,i.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,i.jsxs)("label",{className:"grid gap-1",children:["Show",(0,i.jsx)(ne,{value:e.filter,onChange:t=>{n.filterHistory(t.target.value)},children:Ne.map(t=>(0,i.jsx)("option",{value:t.value,children:t.label},t.value))})]}),(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11",disabled:e.deliveriesLoading,onClick:()=>{n.reloadHistory()},children:"Reload history"}),(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11",onClick:()=>{n.select(null)},children:"Close history"})]}),e.deliveriesLoading?(0,i.jsx)(A,{kind:"loading",title:"Loading deliveries\u2026"}):e.deliveriesError?(0,i.jsx)(A,{kind:"error",title:"Deliveries could not be loaded. Try again.",children:(0,i.jsx)(w,{type:"button",className:"min-h-11",onClick:()=>{n.reloadHistory()},children:"Try again"})}):e.deliveries.length===0?(0,i.jsx)(A,{kind:e.filter==="all"?"empty":"filtered-empty",title:e.filter==="all"?"No deliveries yet. Events committed while the endpoint is enabled appear here.":"No deliveries match this filter on this page."}):(0,i.jsx)(V,{label:`Deliveries to ${a}`,items:e.deliveries,columns:[{key:"event",label:"Event",value:t=>t.eventType,render:t=>B(t.eventType)},{key:"created",label:"Created",value:t=>t.createdAt,render:t=>(0,i.jsx)($,{value:t.createdAt})},{key:"result",label:"Result",value:t=>t.state,render:t=>(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)(X,{status:t.state}),(0,i.jsx)("p",{className:"text-sm",children:`${U(t)}${t.lastStatus===null?"":` (HTTP ${t.lastStatus})`}`}),t.nextAttemptAt===null?null:(0,i.jsxs)("p",{className:"text-sm",children:["Next attempt ",(0,i.jsx)($,{value:t.nextAttemptAt})]})]})},{key:"attempts",label:"Attempts",value:t=>t.attempts,render:t=>`${t.attempts} of 8`},{key:"actions",label:"Actions",value:()=>"",sortable:!1,render:t=>(0,i.jsx)(z,{entityLabel:`${B(t.eventType)} delivery`,actions:[{id:"attempts",label:"Show attempts",onSelect:()=>{n.openDelivery(t.id)}}]})}]}),e.deliveriesHasPrevious||e.deliveriesNext!==null?(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11",disabled:e.deliveriesLoading||!e.deliveriesHasPrevious,onClick:()=>{n.previousHistory()},children:"Newer deliveries"}),(0,i.jsx)(w,{type:"button",variant:"outline",className:"min-h-11",disabled:e.deliveriesLoading||e.deliveriesNext===null,onClick:()=>{n.nextHistory()},children:"Older deliveries"})]}):null,e.detailError?(0,i.jsx)("p",{role:"alert",children:"The attempts of this delivery could not be loaded."}):e.detail===null?null:(0,i.jsxs)("section",{"aria-labelledby":"delivery-attempts",className:"space-y-2",children:[(0,i.jsx)("h3",{id:"delivery-attempts",className:"font-semibold",children:`Attempts for the ${B(e.detail.eventType)} delivery`}),e.detail.history.length===0?(0,i.jsx)("p",{children:"No attempt has started."}):(0,i.jsx)("ol",{className:"list-decimal space-y-1 pl-6",children:e.detail.history.map(t=>(0,i.jsxs)("li",{children:[(0,i.jsx)($,{value:t.startedAt}),`: ${Ee(t)}`]},t.attempt))})]})]})}function Ze(){let n=te(),a=(0,N.useMemo)(()=>pe(n),[n]),e=we(),[t,o]=(0,N.useState)(null);return(0,N.useEffect)(()=>{if(o(null),e===null)return;let r=!0;return n.client.request("get","/_pb/projects/{project}",{params:{project:e}}).then(f=>{r&&f.ok&&o(f.data.name)}),()=>{r=!1}},[n,e]),(0,i.jsx)(xe,{services:n,controller:a,project:e,projectName:t})}export{Ze as NotificationsPage,xe as NotificationsView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk.d813fefb410d.js";import{a as b}from"./chunk.741aec8d1ff9.js";import{F as h,K as v,c as p,d as C,g as f,m as g,n as y,p as d}from"./chunk.fd375c54b526.js";var i=p(C(),1);var e=p(f(),1);function T(){let a=/^#\/npm-login\/([A-Za-z0-9_-]{43})$/.exec(window.location.hash)?.[1]??"";return(0,e.jsx)(L,{selector:a},a)}function L({selector:a}){let{client:l}=v(),[n,w]=(0,i.useState)(null),[q,j]=(0,i.useState)(!1),[u,k]=(0,i.useState)("read"),[t,s]=(0,i.useState)("loading");(0,i.useEffect)(()=>{let o=!0;return l.request("get","/_pb/me/npm-login/{selector}",{params:{selector:a}}).then(async r=>{if(!o)return;if(!r.ok){s(r.code==="reauth_required"?"reauth":"error");return}w(r.data),s("ready");let m=await l.request("get","/_pb/projects/{project}/permissions",{params:{project:r.data.project.slug}});o&&j(m.ok&&m.data.project.includes("project:packages:write"))}),()=>{o=!1}},[l,a]);async function A(o){if(o.preventDefault(),t!=="ready"&&t!=="failed"||n===null)return;s("busy");let r=await l.request("post","/_pb/me/npm-login/{selector}",{params:{selector:a},body:{scope:u==="write"?"write":"read"}});s(r.ok?"done":r.code==="reauth_required"?"reauth":r.code==="conflict"?"conflict":"failed")}return(0,e.jsxs)("section",{className:"max-w-2xl space-y-4",children:[(0,e.jsx)("h1",{className:"text-2xl font-semibold",children:"Confirm npm login"}),(0,e.jsx)(g,{children:(0,e.jsx)(y,{children:"Only continue if you ran npm login yourself a moment ago. Someone else may have sent you this link to gain access through your account."})}),t==="loading"&&(0,e.jsx)("p",{role:"status",children:"Loading login request\u2026"}),t==="reauth"&&(0,e.jsxs)("p",{children:["Confirm your identity before reviewing this request."," ",(0,e.jsx)("a",{className:"underline",href:`#/reauth?return=${encodeURIComponent(`/npm-login/${a}`)}`,children:"Reauthenticate"})]}),["error","conflict"].includes(t)&&(0,e.jsx)("p",{role:"alert",children:"This login request is unavailable or has already been confirmed. Run npm login again."}),t==="done"?(0,e.jsx)("p",{role:"status",children:"Login approved. Return to your terminal to collect the token."}):n!==null&&t!=="reauth"&&(0,e.jsxs)("form",{onSubmit:o=>{A(o)},className:"space-y-4",children:[(0,e.jsxs)("dl",{className:"space-y-2 break-words",children:[(0,e.jsx)("dt",{children:"Project"}),(0,e.jsxs)("dd",{children:[n.project.name," (",n.project.slug,")"]}),(0,e.jsx)("dt",{children:"CLI hostname"}),(0,e.jsx)("dd",{children:n.cliHostname??"Unavailable"}),(0,e.jsx)("dt",{children:"Source IP"}),(0,e.jsx)("dd",{children:n.sourceIp??"Unavailable"}),(0,e.jsx)("dt",{children:"Requested"}),(0,e.jsx)("dd",{children:(0,e.jsx)(c,{value:n.createdAt})}),(0,e.jsx)("dt",{children:"Request expires"}),(0,e.jsx)("dd",{children:(0,e.jsx)(c,{value:n.expiresAt})})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(h,{htmlFor:"npm-login-scope",children:"Token access"}),(0,e.jsxs)(b,{id:"npm-login-scope",value:u,onChange:o=>k(o.target.value),disabled:t==="busy",children:[(0,e.jsx)("option",{value:"read",children:"Install and download"}),q&&(0,e.jsx)("option",{value:"write",children:"Install, download and publish"})]})]}),(0,e.jsx)("p",{children:"This creates a personal token for this project with the organization\u2019s default lifetime. It carries only permissions you currently hold."}),t==="failed"&&(0,e.jsx)("p",{role:"alert",children:"Login could not be approved. Review the request before trying again."}),(0,e.jsx)(d,{type:"submit",disabled:t!=="ready"&&t!=="failed",className:"min-h-11 w-full sm:w-auto",children:t==="busy"?"Approving login\u2026":"Approve login"}),t==="failed"&&(0,e.jsx)(d,{type:"button",onClick:()=>s("ready"),children:"Review again"})]})]})}export{T as NpmLoginPage};
|