"use strict";var U=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Oe=Object.prototype.hasOwnProperty;var a=(e,t)=>U(e,"name",{value:t,configurable:!0});var ke=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},Te=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ee(t))!Oe.call(e,o)&&o!==r&&U(e,o,{get:()=>t[o],enumerable:!(n=Re(t,o))||n.enumerable});return e};var Ae=e=>Te(U({},"__esModule",{value:!0}),e);var He={};ke(He,{URLPattern:()=>M});module.exports=Ae(He);var P=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(t,r,n,o,l,f){this.type=t,this.name=r,this.prefix=n,this.value=o,this.suffix=l,this.modifier=f}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};a(P,"Part");var ye=/[$_\p{ID_Start}]/u,we=/[$_\u200C\u200D\p{ID_Continue}]/u,F=".*";function Ce(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}a(Ce,"isASCII");function W(e,t=!1){let r=[],n=0;for(;n{if(fc("OTHER_MODIFIER")??c("ASTERISK"),"tryConsumeModifier"),p=a(u=>{let d=c(u);if(d!==void 0)return d;let{type:g,index:y}=r[f];throw new TypeError(`Unexpected ${g} at ${y}, expected ${u}`)},"mustConsume"),A=a(()=>{let u="",d;for(;d=c("CHAR")??c("ESCAPED_CHAR");)u+=d;return u},"consumeText"),be=a(u=>u,"DefaultEncodePart"),N=t.encodePart||be,H="",v=a(u=>{H+=u},"appendToPendingFixedValue"),D=a(()=>{H.length&&(o.push(new P(3,"","",N(H),"",3)),H="")},"maybeAddPartFromPendingFixedValue"),Z=a((u,d,g,y,B)=>{let m=3;switch(B){case"?":m=1;break;case"*":m=0;break;case"+":m=2;break}if(!d&&!g&&m===3){v(u);return}if(D(),!d&&!g){if(!u)return;o.push(new P(3,"","",N(u),"",m));return}let S;g?g==="*"?S=F:S=g:S=n;let k=2;S===n?(k=1,S=""):S===F&&(k=0,S="");let E;if(d?E=d:g&&(E=l++),i.has(E))throw new TypeError(`Duplicate name '${E}'.`);i.add(E),o.push(new P(k,E,N(u),S,N(y),m))},"addPart");for(;f-1)}return f||(n+=`(?=${l}|${o})`),new RegExp(n,q(r))}a(z,"partsToRegexp");var b={delimiter:"",prefixes:"",sensitive:!0,strict:!0},Q={delimiter:".",prefixes:"",sensitive:!0,strict:!0},ee={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function te(e,t){return e.length?e[0]==="/"?!0:!t||e.length<2?!1:(e[0]=="\\"||e[0]=="{")&&e[1]=="/":!1}a(te,"isAbsolutePathname");function re(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}a(re,"maybeStripPrefix");function Le(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}a(Le,"maybeStripSuffix");function j(e){return!e||e.length<2?!1:e[0]==="["||(e[0]==="\\"||e[0]==="{")&&e[1]==="["}a(j,"treatAsIPv6Hostname");var ne=["ftp","file","http","https","ws","wss"];function $(e){if(!e)return!0;for(let t of ne)if(e.test(t))return!0;return!1}a($,"isSpecialScheme");function se(e,t){if(e=re(e,"#"),t||e==="")return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}a(se,"canonicalizeHash");function ie(e,t){if(e=re(e,"?"),t||e==="")return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}a(ie,"canonicalizeSearch");function ae(e,t){return t||e===""?e:j(e)?V(e):G(e)}a(ae,"canonicalizeHostname");function oe(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.password=e,r.password}a(oe,"canonicalizePassword");function ce(e,t){if(t||e==="")return e;let r=new URL("https://example.com");return r.username=e,r.username}a(ce,"canonicalizeUsername");function le(e,t,r){if(r||e==="")return e;if(t&&!ne.includes(t))return new URL(`${t}:${e}`).pathname;let n=e[0]=="/";return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}a(le,"canonicalizePathname");function fe(e,t,r){return K(t)===e&&(e=""),r||e===""?e:Y(e)}a(fe,"canonicalizePort");function he(e,t){return e=Le(e,":"),t||e===""?e:w(e)}a(he,"canonicalizeProtocol");function K(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}a(K,"defaultPortForProtocol");function w(e){if(e==="")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}a(w,"protocolEncodeCallback");function ue(e){if(e==="")return e;let t=new URL("https://example.com");return t.username=e,t.username}a(ue,"usernameEncodeCallback");function de(e){if(e==="")return e;let t=new URL("https://example.com");return t.password=e,t.password}a(de,"passwordEncodeCallback");function G(e){if(e==="")return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}a(G,"hostnameEncodeCallback");function V(e){if(e==="")return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}a(V,"ipv6HostnameEncodeCallback");function Y(e){if(e===""||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}a(Y,"portEncodeCallback");function pe(e){if(e==="")return e;let t=new URL("https://example.com");return t.pathname=e[0]!=="/"?"/-"+e:e,e[0]!=="/"?t.pathname.substring(2,t.pathname.length):t.pathname}a(pe,"standardURLPathnameEncodeCallback");function ge(e){return e===""?e:new URL(`data:${e}`).pathname}a(ge,"pathURLPathnameEncodeCallback");function me(e){if(e==="")return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}a(me,"searchEncodeCallback");function Se(e){if(e==="")return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}a(Se,"hashEncodeCallback");var C=class{#i;#n=[];#t={};#e=0;#s=1;#l=0;#o=0;#d=0;#p=0;#g=!1;constructor(t){this.#i=t}get result(){return this.#t}parse(){for(this.#n=W(this.#i,!0);this.#e0)if(this.#A())this.#d-=1;else continue;if(this.#T()){this.#d+=1;continue}switch(this.#o){case 0:this.#P()&&this.#u(1);break;case 1:if(this.#P()){this.#C();let t=7,r=1;this.#E()?(t=2,r=3):this.#g&&(t=2),this.#r(t,r)}break;case 2:this.#S()?this.#u(3):(this.#x()||this.#h()||this.#f())&&this.#u(5);break;case 3:this.#O()?this.#r(4,1):this.#S()&&this.#r(5,1);break;case 4:this.#S()&&this.#r(5,1);break;case 5:this.#y()?this.#p+=1:this.#w()&&(this.#p-=1),this.#k()&&!this.#p?this.#r(6,1):this.#x()?this.#r(7,0):this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 6:this.#x()?this.#r(7,0):this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 7:this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 8:this.#f()&&this.#r(9,1);break;case 9:break;case 10:break}}this.#t.hostname!==void 0&&this.#t.port===void 0&&(this.#t.port="")}#r(t,r){switch(this.#o){case 0:break;case 1:this.#t.protocol=this.#c();break;case 2:break;case 3:this.#t.username=this.#c();break;case 4:this.#t.password=this.#c();break;case 5:this.#t.hostname=this.#c();break;case 6:this.#t.port=this.#c();break;case 7:this.#t.pathname=this.#c();break;case 8:this.#t.search=this.#c();break;case 9:this.#t.hash=this.#c();break;case 10:break}this.#o!==0&&t!==10&&([1,2,3,4].includes(this.#o)&&[6,7,8,9].includes(t)&&(this.#t.hostname??=""),[1,2,3,4,5,6].includes(this.#o)&&[8,9].includes(t)&&(this.#t.pathname??=this.#g?"/":""),[1,2,3,4,5,6,7].includes(this.#o)&&t===9&&(this.#t.search??="")),this.#R(t,r)}#R(t,r){this.#o=t,this.#l=this.#e+r,this.#e+=r,this.#s=0}#b(){this.#e=this.#l,this.#s=0}#u(t){this.#b(),this.#o=t}#m(t){return t<0&&(t=this.#n.length-t),t=0&&(e.pathname=R(n.pathname.substring(0,o+1),r)+e.pathname)}e.pathname=le(e.pathname,e.protocol,r)}return typeof t.search=="string"&&(e.search=ie(t.search,r)),typeof t.hash=="string"&&(e.hash=se(t.hash,r)),e}a(L,"applyInit");function I(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}a(I,"escapePatternString");function Ie(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}a(Ie,"escapeRegexpString");function Ne(e,t){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=".*",n=`[^${Ie(t.delimiter)}]+?`,o=/[$_\u200C\u200D\p{ID_Continue}]/u,l="";for(let f=0;f0?e[f-1]:null,p=f0?p.value[0]:"";c=o.test(A)}else c=!p.hasCustomName();if(!c&&!s.prefix.length&&h&&h.type===3){let A=h.value[h.value.length-1];c=t.prefixes.includes(A)}c&&(l+="{"),l+=I(s.prefix),i&&(l+=`:${s.name}`),s.type===2?l+=`(${s.value})`:s.type===1?i||(l+=`(${n})`):s.type===0&&(!i&&(!h||h.type===3||h.modifier!==3||c||s.prefix!=="")?l+="*":l+=`(${r})`),s.type===1&&i&&s.suffix.length&&o.test(s.suffix[0])&&(l+="\\"),l+=I(s.suffix),c&&(l+="}"),s.modifier!==3&&(l+=T(s.modifier))}return l}a(Ne,"partsToPattern");var M=class{#i;#n={};#t={};#e={};#s={};#l=!1;constructor(t={},r,n){try{let o;if(typeof r=="string"?o=r:n=r,typeof t=="string"){let i=new C(t);if(i.parse(),t=i.result,o===void 0&&typeof t.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");t.baseURL=o}else{if(!t||typeof t!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(o)throw new TypeError("parameter 1 is not of type 'string'.")}typeof n>"u"&&(n={ignoreCase:!1});let l={ignoreCase:n.ignoreCase===!0},f={pathname:O,protocol:O,username:O,password:O,hostname:O,port:O,search:O,hash:O};this.#i=L(f,t,!0),K(this.#i.protocol)===this.#i.port&&(this.#i.port="");let s;for(s of X){if(!(s in this.#i))continue;let i={},c=this.#i[s];switch(this.#t[s]=[],s){case"protocol":Object.assign(i,b),i.encodePart=w;break;case"username":Object.assign(i,b),i.encodePart=ue;break;case"password":Object.assign(i,b),i.encodePart=de;break;case"hostname":Object.assign(i,Q),j(c)?i.encodePart=V:i.encodePart=G;break;case"port":Object.assign(i,b),i.encodePart=Y;break;case"pathname":$(this.#n.protocol)?(Object.assign(i,ee,l),i.encodePart=pe):(Object.assign(i,b,l),i.encodePart=ge);break;case"search":Object.assign(i,b,l),i.encodePart=me;break;case"hash":Object.assign(i,b,l),i.encodePart=Se;break}try{this.#s[s]=_(c,i),this.#n[s]=z(this.#s[s],this.#t[s],i),this.#e[s]=Ne(this.#s[s],i),this.#l=this.#l||this.#s[s].some(h=>h.type===2)}catch{throw new TypeError(`invalid ${s} pattern '${this.#i[s]}'.`)}}}catch(o){throw new TypeError(`Failed to construct 'URLPattern': ${o.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(t={},r){let n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&r)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return!1;try{typeof t=="object"?n=L(n,t,!1):n=L(n,xe(t,r),!1)}catch{return!1}let o;for(o of X)if(!this.#n[o].exec(n[o]))return!1;return!0}exec(t={},r){let n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof t!="string"&&r)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof t>"u")return;try{typeof t=="object"?n=L(n,t,!1):n=L(n,xe(t,r),!1)}catch{return null}let o={};r?o.inputs=[t,r]:o.inputs=[t];let l;for(l of X){let f=this.#n[l].exec(n[l]);if(!f)return null;let s={};for(let[i,c]of this.#t[l].entries())if(typeof c=="string"||typeof c=="number"){let h=f[i+1];s[c]=h}o[l]={input:n[l]??"",groups:s}}return o}static compareComponent(t,r,n){let o=a((i,c)=>{for(let h of["type","modifier","prefix","value","suffix"]){if(i[h]{let h=0;for(;h