/* Socket Lib - Built with esbuild */
var c=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var P=(e,n)=>{for(var t in n)c(e,t,{get:n[t],enumerable:!0})},O=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of _(n))!x.call(e,r)&&r!==t&&c(e,r,{get:()=>n[r],enumerable:!(i=S(n,r))||i.enumerable});return e};var I=e=>O(c({},"__esModule",{value:!0}),e);var Y={};P(Y,{normalizePackageJson:()=>D,resolveEscapedScope:()=>l,resolveOriginalPackageName:()=>G,unescapeScope:()=>R});module.exports=I(Y);var p=require("../objects");const T=Array.isArray,o=Object.hasOwn;let d;function m(){return d===void 0&&(d=require("../constants/socket").REGISTRY_SCOPE_DELIMITER),d}let g;function y(){return g===void 0&&(g=require("../constants/socket").SOCKET_REGISTRY_SCOPE),g}let f;function v(){return f===void 0&&(f=require("../regexps").escapeRegExp),f}function C(){const e=m(),n=v(),t=e[0];return new RegExp(`^[^${n(t)}]+${n(e)}(?!${n(t)})`)}let u;function h(){return u===void 0&&(u=require("../external/normalize-package-data")),u}let E;function z(){return E===void 0&&(E=require("#packages/operations").findPackageExtensions),E}function D(e,n){const{preserve:t}={__proto__:null,...n};o(e,"version")||(e.version="0.0.0");const i=[["_id",void 0],["readme",void 0],...o(e,"bugs")?[]:[["bugs",void 0]],...o(e,"homepage")?[]:[["homepage",void 0]],...o(e,"name")?[]:[["name",void 0]],...T(t)?t.map(a=>[a,o(e,a)?e[a]:void 0]):[]];if(h()(e),e.name&&e.version){const s=z()(e.name,e.version);s&&typeof s=="object"&&(0,p.merge)(e,s)}for(const{0:a,1:s}of i)e[a]=s;return e}function l(e){return C().exec(e)?.[0]||void 0}function G(e){const n=y(),t=e.startsWith(`${n}/`)?e.slice(n.length+1):e,i=l(t);return i?`${R(i)}/${t.slice(i.length)}`:t}function R(e){const n=m();return`@${e.slice(0,-n.length)}`}0&&(module.exports={normalizePackageJson,resolveEscapedScope,resolveOriginalPackageName,unescapeScope});
//# sourceMappingURL=normalize.js.map
