const I={};function w(e){let s=I[e];if(s)return s;s=I[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);s.push(i)}for(let n=0;n=55296&&u<=57343?a+="\uFFFD\uFFFD\uFFFD":a+=String.fromCharCode(u),t+=6;continue}}if((r&248)===240&&t+91114111?a+="\uFFFD\uFFFD\uFFFD\uFFFD":(l-=65536,a+=String.fromCharCode(55296+(l>>10),56320+(l&1023))),t+=9;continue}}a+="\uFFFD"}return a})}F.defaultChars=";/?:@&=+$,#";F.componentChars="";const S={};function z(e){let s=S[e];if(s)return s;s=S[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?s.push(i):s.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n=55296&&r<=57343){if(r>=55296&&r<=56319&&t+1=56320&&f<=57343){a+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}a+="%EF%BF%BD";continue}a+=encodeURIComponent(e[t])}return a}g.defaultChars=";/?:@&=+$,-_.!~*'()#";g.componentChars="-_.!~*'()";function U(e){let s="";return s+=e.protocol||"",s+=e.slashes?"//":"",s+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?s+="["+e.hostname+"]":s+=e.hostname||"",s+=e.port?":"+e.port:"",s+=e.pathname||"",s+=e.search||"",s+=e.hash||"",s}function d(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const E=/^([a-z0-9.+-]+:)/i,H=/:[0-9]*$/,B=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,L=["<",">",'"',"`"," ","\r",` `," "],M=["{","}","|","\\","^","`"].concat(L),R=["'"].concat(M),O=["%","/","?",";","#"].concat(R),_=["/","?","#"],Z=255,$=/^[+a-z0-9A-Z_-]{0,63}$/,T=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,j={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function G(e,s){if(e&&e instanceof d)return e;const n=new d;return n.parse(e,s),n}d.prototype.parse=function(e,s){let n,i,a,t=e;if(t=t.trim(),!s&&e.split("#").length===1){const o=B.exec(t);if(o)return this.pathname=o[1],o[2]&&(this.search=o[2]),this}let h=E.exec(t);if(h&&(h=h[0],n=h.toLowerCase(),this.protocol=h,t=t.substr(h.length)),(s||h||t.match(/^\/\/[^@\/]+@[^@\/]+/))&&(a=t.substr(0,2)==="//",a&&!(h&&j[h])&&(t=t.substr(2),this.slashes=!0)),!j[h]&&(a||h&&!y[h])){let o=-1;for(let c=0;c<_.length;c++)i=t.indexOf(_[c]),i!==-1&&(o===-1||i127?b+="x":b+=m[p];if(!b.match($)){const p=c.slice(0,x),C=c.slice(x+1),P=m.match(T);P&&(p.push(P[1]),C.unshift(P[2])),C.length&&(t=C.join(".")+t),this.hostname=p.join(".");break}}}}this.hostname.length>Z&&(this.hostname=""),D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const r=t.indexOf("#");r!==-1&&(this.hash=t.substr(r),t=t.slice(0,r));const f=t.indexOf("?");return f!==-1&&(this.search=t.substr(f),t=t.slice(0,f)),t&&(this.pathname=t),y[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};d.prototype.parseHost=function(e){let s=H.exec(e);s&&(s=s[0],s!==":"&&(this.port=s.substr(1)),e=e.substr(0,e.length-s.length)),e&&(this.hostname=e)};var J=Object.freeze(Object.defineProperty({__proto__:null,decode:F,encode:g,format:U,parse:G},Symbol.toStringTag,{value:"Module"}));export{F as d,g as e,U as f,J as m,G as u};