text: "use strict";exports.__esModule=true;exports.pathToRegexp=exports.default=void 0;var pathToRegexp=_interopRequireWildcard(require("next/dist/compiled/path-to-regexp"));exports.pathToRegexp=pathToRegexp;function _getRequireWildcardCache(){if(typeof WeakMap!=="function")return null;var cache=new WeakMap();_getRequireWildcardCache=function(){return cache;};return cache;}function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache();if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var _default=(customRoute=false)=>{return path=>{const keys=[];const matcherOptions={sensitive:false,delimiter:'/',...(customRoute?{strict:true}:undefined),decode:decodeParam};const matcherRegex=pathToRegexp.pathToRegexp(path,keys,matcherOptions);const matcher=pathToRegexp.regexpToFunction(matcherRegex,keys,matcherOptions);return(pathname,params)=>{const res=pathname==null?false:matcher(pathname);if(!res){return false;}if(customRoute){for(const key of keys){// unnamed params should be removed as they
  // are not allowed to be used in the destination
  if(typeof key.name==='number'){delete res.params[key.name];}}}return{...params,...res.params};};};};exports.default=_default;function decodeParam(param){try{return decodeURIComponent(param);}catch(_){const err=new Error('failed to decode param');err.code='DECODE_FAILED';throw err;}}
  //# sourceMappingURL=path-match.js.map