function e(e,n,t){throw new Error(t?`No known conditions for "${n}" specifier in "${e}" package`:`Missing "${n}" specifier in "${e}" package`)}function n(n,i,o,s){let f,u,l=t(n,o),c=function(e){let n=new Set(["default"]);e.unsafe||n.add(e.require?"require":"import"),e.unsafe||n.add(e.browser?"browser":"node");for(const t of e.conditions||[])t.startsWith("!")?n.delete(t.slice(1)):n.add(t);return n}(s||{}),a=i[l];if(void 0===a){let e,n,t,r;for(r in i)n&&r.length<n.length||("/"===r[r.length-1]&&l.startsWith(r)?(u=l.substring(r.length),n=r):r.length>1&&(t=r.indexOf("*",1),~t&&(e=RegExp("^"+r.substring(0,t)+"(.*)"+r.substring(1+t)+"$").exec(l),e&&e[1]&&(u=e[1],n=r))));a=i[n]}return a||e(n,l),f=r(a,c),f||e(n,l,1),u&&function(e,n){let t,r=0,i=e.length,o=/[*]/g,s=/[/]$/;for(;r<i;r++)e[r]=o.test(t=e[r])?t.replace(o,n):s.test(t)?t+n:t}(f,u),f}function t(e,n,t){if(e===n||"."===n)return".";let r=e+"/",i=r.length,o=n.slice(0,i)===r,s=o?n.slice(i):n;return"#"===s[0]?s:o||!t?"./"===s.slice(0,2)?s:"./"+s:s}function r(e,n,t){if(e){if("string"==typeof e)return t&&t.add(e),[e];let i,o;if(Array.isArray(e)){for(o=t||new Set,i=0;i<e.length;i++)r(e[i],n,o);if(!t&&o.size)return[...o]}else for(i in e)if(n.has(i))return r(e[i],n,t)}}function i(e,n={}){let r,i=0,o=n.browser,s=n.fields||["module","main"],f="string"==typeof o;for(o&&!s.includes("browser")&&(s.unshift("browser"),f&&(o=t(e.name,o,!0)));i<s.length;i++)if(r=e[s[i]]){if("string"==typeof r);else{if("object"!=typeof r||"browser"!=s[i])continue;if(f&&(r=r[o],null==r))return o}return"string"==typeof r?"./"+r.replace(/^\.?\//,""):r}}function o(e,t,r){let i,o=e.exports;if(o){if("string"==typeof o)o={".":o};else for(i in o){"."!==i[0]&&(o={".":o});break}return n(e.name,o,t||".",r)}}function s(e,t,r){if(e.imports)return n(e.name,e.imports,t,r)}function f(e,n,r){return"#"===(n=t(e.name,n||"."))[0]?s(e,n,r):o(e,n,r)}exports.exports=o;exports.imports=s;exports.legacy=i;exports.resolve=f;