Liferay.Loader.define("frontend-js-spa-web@5.0.32/route/Route",["module","exports","require","../util/pathParser"],(function(t,e,a){window;{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a("../util/pathParser");class t{constructor(t,e){if(!t)throw new Error("Route path not specified.");if("function"!=typeof e)throw new Error("Route handler is not a function.");this.handler=e,this.path=t}buildParsedData_(){if(!this.parsedData_){const t=(0,r.parse)(this.path),e=(0,r.toRegex)(t);this.parsedData_={regex:e,tokens:t}}return this.parsedData_}extractParams(t){return"string"==typeof this.path?(0,r.extractData)(this.buildParsedData_().tokens,t):{}}getHandler(){return this.handler}getPath(){return this.path}matchesPath(t){let e=this.path;return"function"==typeof e?e(t):("string"==typeof e&&(e=this.buildParsedData_().regex),e instanceof RegExp&&t.search(e)>-1)}}var s=t;e.default=s}}));
//# sourceMappingURL=Route.js.map