"use strict";

exports.__esModule = true;
exports.default = exports.PanelDrawer = void 0;

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

var _styledTransitionGroup = _interopRequireDefault(require("styled-transition-group"));

var _templateObject;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var getProp = function getProp(propName) {
  return function (props) {
    return props[propName];
  };
};

var panelWidth = getProp("width");

var getModalRoot = function getModalRoot() {
  return document.getElementById("modal");
};

var PanelDrawer = _styledTransitionGroup.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tright: 0;\n\twidth: ", ";\n\n\ttransition: transform ", "ms ease-out;\n\n\t&:enter {\n\t\ttransform: translateX(", ");\n\t}\n\t&:enter-active {\n\t\ttransform: translateX(0);\n\t}\n\t&:exit {\n\t\ttransform: translateX(0);\n\t}\n\t&:exit-active {\n\t\ttransform: translateX(", ");\n\t}\n"])), panelWidth, getProp("timeout"), panelWidth, panelWidth);

exports.PanelDrawer = PanelDrawer;
PanelDrawer.defaultProps = {
  timeout: 1000,
  unmountOnExit: true,
  width: "200px"
};

var Sidepanel = function Sidepanel(props) {
  return _reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(PanelDrawer, props), getModalRoot());
};

var _default = Sidepanel;
var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(getProp, "getProp", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(panelWidth, "panelWidth", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(getModalRoot, "getModalRoot", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(PanelDrawer, "PanelDrawer", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(Sidepanel, "Sidepanel", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Sidepanel.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();

;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(getProp, "getProp", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(panelWidth, "panelWidth", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(getModalRoot, "getModalRoot", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(PanelDrawer, "PanelDrawer", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(Sidepanel, "Sidepanel", "/home/vsts/work/1/s/src/components/Sidepanel.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Sidepanel.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();