"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var a=f(require("react")),b=f(require("./../contexts/ApiHandler/index.js")),c=f(require("./../contexts/config/index.js")),d=f(require("./../utils/api-factory.js")),e=require("react-router-dom");function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function i(a,b,c){return b&&h(a.prototype,b),c&&h(a,c),a}var j=function(){function f(){g(this,f),this.jsx=[]}return i(f,[{key:"withConfig",value:function withConfig(b){return this.jsx.push(function ConfigWrapper(d){var e=d.children;return a["default"].createElement(c["default"],{options:b.options,apps:b.apps,apis:b.apis,encodedApis:b.encodedApis,docs:b.docs},e)}),this}},{key:"withApiHandler",value:function withApiHandler(c){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:c,f=2<arguments.length?arguments[2]:void 0;return this.jsx.push(function ApiHandlerWrapper(g){var h=g.children;return a["default"].createElement(b["default"],{api:c,handler:(0,d["default"])(e),error:f},h)}),this}},{key:"withRouter",value:function withRouter(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.initialEntries,d=void 0===c?["/"]:c,f=b.initialIndex,g=void 0===f?1:f;return this.jsx.push(function RouterWrapper(b){var c=b.children;return a["default"].createElement(e.MemoryRouter,{initialEntries:d,initialIndex:g},c)}),this}},{key:"build",value:function build(b){if(0===this.jsx.length)return b;var c=this.jsx.shift();return this.build(a["default"].createElement(c,null,b))}}]),f}(),k=j;exports["default"]=k;