var e,t={};var n=function(){if(e)return t;e=1,Object.defineProperty(t,"__esModule",{value:!0}),t.PathError=t.TokenData=void 0,t.parse=f,t.compile=function(e,t={}){const{encode:r=encodeURIComponent,delimiter:o=n}=t,i=l(("object"==typeof e?e:f(e,t)).tokens,o,r);return function(e={}){const t=[],n=i(e,t);if(t.length)throw new TypeError(`Missing parameters: ${t.join(", ")}`);return n}},t.match=function(e,t={}){const{decode:o=decodeURIComponent,delimiter:i=n}=t,{regexp:a,keys:u}=h(e,t),s=u.map(e=>!1===o?r:"param"===e.type?o:e=>e.split(i).map(o));return function(e){const t=a.exec(e);if(!t)return!1;const n=t[0],r=Object.create(null);for(let o=1;oe,o=/^[$_\p{ID_Start}]$/u,i=/^[$\u200c\u200d\p{ID_Continue}]$/u,a=/^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;function u(e){return e.replace(/[{}()\[\]+?!:*\\]/g,"\\$&")}function s(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class c{constructor(e,t){this.tokens=e,this.originalPath=t}}t.TokenData=c;class p extends TypeError{constructor(e,t){let n=e;t&&(n+=`: ${t}`),n+="; visit https://git.new/pathToRegexpError for info",super(n),this.originalPath=t}}function f(e,t={}){const{encodePath:n=r}=t,a=[...e];let u=0;return new c(function t(r){const s=[];let c="";function f(){c&&(s.push({type:"text",value:n(c)}),c="")}for(;ufunction(e,t,n){if("text"===e.type)return()=>e.value;if("group"===e.type){const r=l(e.tokens,t,n);return(e,t)=>{const n=t.length,o=r(e,t);return t.length===n?o:(t.length=n,"")}}const o=n||r;if("wildcard"===e.type&&!1!==n)return(n,r)=>{const i=n[e.name];if(null==i)return r.push(e.name),"";if(!Array.isArray(i)||0===i.length)throw new TypeError(`Expected "${e.name}" to be a non-empty array`);let a="";for(let u=0;u0&&(a+=t),a+=o(i[u])}return a};return(t,n)=>{const r=t[e.name];if(null==r)return n.push(e.name),"";if("string"!=typeof r)throw new TypeError(`Expected "${e.name}" to be a string`);return o(r)}}(e,t,n));return(e,t)=>{let n="";for(const r of o)n+=r(e,t);return n}}function h(e,t={}){const{delimiter:r=n,end:o=!0,sensitive:i=!1,trailing:a=!0}=t,u=[];let c="",l=0;!function e(n){if(Array.isArray(n)){for(const t of n)e(t);return}const o="object"==typeof n?n:f(n,t);y(o.tokens,0,[],e=>{if(l>=256)throw new p("Too many path combinations",o.originalPath);l>0&&(c+="|"),c+=function(e,t,n,r){let o="",i="",a="",u=0,c=0,f=0;function l(n,r){for(;ny(e,t,n,r)),n.length=i;continue}n.push(o)}r(n)}function d(e,t){return t.length>e.length?d(t,e):(e===t&&(t=""),t.length>1?`(?:(?!${s(e)}|${s(t)})[^])`:e.length>1?`(?:(?!${s(e)})[^${s(t)}])`:`[^${s(e+t)}]`)}function g(e,t){let n="";for(;t