"use strict";function a(b){"@babel/helpers - typeof";return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},a(b)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var b=l(require("react")),c=j(require("classnames")),d=j(require("./ExplorerHeader")),e=j(require("./Menu")),f=j(require("react-split-pane")),g=require("../utils/withActionHandler"),h=require("../contexts/config"),i=require("react-i18next");function j(a){return a&&a.__esModule?a:{default:a}}function k(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(k=function(a){return a?c:b})(a)}function l(b,c){if(!c&&b&&b.__esModule)return b;if(null===b||"object"!==a(b)&&"function"!=typeof b)return{default:b};var d=k(c);if(d&&d.has(b))return d.get(b);var e={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in b)if("default"!=g&&Object.prototype.hasOwnProperty.call(b,g)){var h=f?Object.getOwnPropertyDescriptor(b,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=b[g]}return e["default"]=b,d&&d.set(b,e),e}function m(a,b){return r(a)||q(a,b)||o(a,b)||n()}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(a,b){if(a){if("string"==typeof a)return p(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?p(a,b):void 0}}function p(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function q(a,b){var c=null==a?null:"undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=c){var d,e,f=[],g=!0,h=!1;try{for(c=c.call(a);!(g=(d=c.next()).done)&&(f.push(d.value),!(b&&f.length===b));g=!0);}catch(a){h=!0,e=a}finally{try{g||null==c["return"]||c["return"]()}finally{if(h)throw e}}return f}}function r(a){if(Array.isArray(a))return a}var s=function(){return b["default"].createElement("svg",{key:"svgs"},b["default"].createElement("symbol",{viewBox:"0 0 32 32",fillRule:"evenodd",id:"copy"},b["default"].createElement("path",{d:"M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z",transform:"translate(0)"}),b["default"].createElement("path",{d:"M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z",transform:"translate(0)"})),b["default"].createElement("symbol",{viewBox:"0 0 32 32",fillRule:"evenodd",id:"download"},b["default"].createElement("polygon",{points:"26 15 24.59 13.59 17 21.17 17 2 15 2 15 21.17 7.41 13.59 6 15 16 25 26 15"}),b["default"].createElement("path",{d:"M26,24v4H6V24H4v4H4a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2h0V24Z"})))},t=function(a){var j=a.splitView,k=a.children,l=(0,i.useTranslation)(),n=l.t,o=(0,h.useConfig)(),p=(0,b.useState)(!0),q=m(p,2),r=q[0],t=q[1],u=(0,g.withActionHandler)(function(){t(!r)}),v=null;o.options.headerActive&&(v=b["default"].createElement(d["default"],null));var w=window.innerWidth/4;return b["default"].createElement("div",{className:"apiconnect-explorer",role:"region","aria-label":"explorer-root"},s(),function renderMobileButton(){return b["default"].createElement("div",{key:"expandMenuButton",role:"button",tabIndex:"0",className:(0,c["default"])("expMenuCollapseWrapper",{expMenuShow:!r},{headerActive:o.options.headerActive}),onKeyDown:u,onClick:u,"aria-label":n("menu_button")},b["default"].createElement("button",{className:(0,c["default"])("expMenuCollapseButton",{expMenuShow:!r}),"aria-label":n("menu_button"),"data-testid":"mobile-menu-button"},b["default"].createElement("div",null,b["default"].createElement("span",{className:"line"}),b["default"].createElement("span",{className:"line"}),b["default"].createElement("span",{className:"line"}))))}(),j&&b["default"].createElement("div",{"data-testid":"split-view"},v,b["default"].createElement(f["default"],{key:"splitPane",split:"vertical",className:(0,c["default"])({showResponsiveMenu:!r},{"header-active":o.options.headerActive}),minSize:1,defaultSize:w,maxSize:450},b["default"].createElement(e["default"],null),b["default"].createElement("div",{"data-testid":"explorer-body",className:"stretch"},k))),!j&&b["default"].createElement("div",null,v,k))},u=t;exports["default"]=u;