"use strict";var __rest=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(r[o[s]]=e[o[s]])}return r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.withRouter=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),theme_1=require("@redocly/theme"),hooks_1=require("../hooks"),utils_1=require("./utils");function withRouter(e){const t=t=>{var r,o,{disableRouter:s=!1}=t,i=__rest(t,["disableRouter"]);const u=null!==(r=i.basePath)&&void 0!==r?r:"/",n=null!==(o=i.router)&&void 0!==o?o:"history",{Router:a,routerProps:l}=(0,hooks_1.useRouter)(n,u);return theme_1.IS_BROWSER&&!s?(0,react_1.createElement)(a,Object.assign({},l,{key:u}),(0,jsx_runtime_1.jsx)(e,Object.assign({},i))):(0,jsx_runtime_1.jsx)(e,Object.assign({},i))};return t.displayName=`WithRouter(${(0,utils_1.getDisplayName)(e)})`,t}exports.withRouter=withRouter;
//# sourceMappingURL=withRouter.js.map