/* Socket Lib - Built with esbuild */
var l=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var B=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},H=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of U(e))!F.call(t,r)&&r!==n&&l(t,r,{get:()=>e[r],enumerable:!(s=N(e,r))||s.enumerable});return t};var L=t=>H(l({},"__esModule",{value:!0}),t);var Z={};B(Z,{createPackageJson:()=>W,fetchPackageManifest:()=>K,fetchPackagePackument:()=>X});module.exports=L(Z);var a=require("#constants/packages"),S=require("#constants/process"),f=require("#constants/socket"),$=require("../arrays"),o=require("../objects"),C=require("./exports"),J=require("./validation");const b=(0,S.getAbortSignal)(),g=(0,a.getPackageDefaultNodeRange)(),Y=(0,a.getPackageDefaultSocketCategories)(),T=(0,a.getPackumentCache)(),z=/^@socketregistry\//;let k;function Q(){return k===void 0&&(k=require("../external/npm-package-arg")),k}let y;function j(){return y===void 0&&(y=require("../external/pacote")),y}let P;function V(){return P===void 0&&(P=require("../external/semver")),P}function W(t,e,n){const{dependencies:s,description:r,engines:i,exports:c,files:p,keywords:G,main:D,overrides:_,resolutions:E,sideEffects:O,socket:h,type:v,version:q}={__proto__:null,...n},I=`@socketregistry/${t.replace(z,"")}`,u=(0,C.resolvePackageJsonEntryExports)(c),w=`https://github.com/${f.SOCKET_GITHUB_ORG}/${f.SOCKET_REGISTRY_REPO_NAME}`;return{__proto__:null,name:I,version:q,license:"MIT",description:r,keywords:G,homepage:`${w}/tree/main/${e}`,repository:{type:"git",url:`git+${w}.git`,directory:e},...v?{type:v}:{},...(0,o.isObjectObject)(u)?{exports:{...u}}:{},...u?{}:{main:`${D??"./index.js"}`},sideEffects:O!==void 0&&!!O,...(0,o.isObjectObject)(s)?{dependencies:{...s}}:{},...(0,o.isObjectObject)(_)?{overrides:{..._}}:{},...(0,o.isObjectObject)(E)?{resolutions:{...E}}:{},...(0,o.isObjectObject)(i)?{engines:Object.fromEntries((0,o.objectEntries)(i).map(R=>{const x=String(R[0]),m=[x,R[1]];if(x==="node"){const A=V(),{1:d}=m;if(typeof d=="string"&&d&&g){const M=A.coerce(d);A.satisfies(M?.version??"0.0.0",g)||(m[1]=g)}}return m}))}:{engines:{node:g}},files:(0,$.isArray)(p)?p.slice():["*.d.ts","*.js"],...(0,o.isObjectObject)(h)?{socket:{...h}}:{socket:{categories:Y}}}}async function K(t,e){const n={__proto__:null,signal:b,...e,packumentCache:T,preferOffline:!0},{signal:s}=n;if(s?.aborted)return;const r=j();let i;try{i=await r.manifest(t,n)}catch{}if(!s?.aborted){if(i){const p=Q()(t,n.where);if((0,J.isRegistryFetcherType)(p.type))return i}if(i){const c=i;return await K(`${c.name}@${c.version}`,n)}return null}}async function X(t,e){const n=j();try{return await n.packument(t,{__proto__:null,signal:b,...e,packumentCache:T,preferOffline:!0})}catch{}}0&&(module.exports={createPackageJson,fetchPackageManifest,fetchPackagePackument});
//# sourceMappingURL=manifest.js.map
