import{__exports as e}from"../../../../../../../_virtual/format-url.js_commonjs-exports";export{__exports as default}from"../../../../../../../_virtual/format-url.js_commonjs-exports";import"./querystring.js";import{__exports as t}from"../../../../../../../_virtual/querystring.js_commonjs-exports";e.__esModule=!0,e.formatUrl=function(e){let{auth:t,hostname:o}=e,s=e.protocol||"",a=e.pathname||"",p=e.hash||"",u=e.query||"",f=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?f=t+e.host:o&&(f=t+(~o.indexOf(":")?`[${o}]`:o),e.port&&(f+=":"+e.port));u&&"object"==typeof u&&(u=String(r.urlQueryToSearchParams(u)));let c=e.search||u&&`?${u}`||"";s&&":"!==s.substr(-1)&&(s+=":");e.slashes||(!s||n.test(s))&&!1!==f?(f="//"+(f||""),a&&"/"!==a[0]&&(a="/"+a)):f||(f="");p&&"#"!==p[0]&&(p="#"+p);c&&"?"!==c[0]&&(c="?"+c);return a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${s}${f}${a}${c}${p}`};var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=n?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=e[s]}r.default=e,t&&t.set(e,r);return r}(t);function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}const n=/https?|ftp|gopher|file/;
//# sourceMappingURL=format-url.js.map
