{"ast":null,"code":"import _Reflect$construct from \"@babel/runtime-corejs2/core-js/reflect/construct\";\nimport _classCallCheck from \"@babel/runtime-corejs2/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime-corejs2/helpers/createClass\";\nimport _assertThisInitialized from \"@babel/runtime-corejs2/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime-corejs2/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime-corejs2/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime-corejs2/helpers/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime-corejs2/helpers/defineProperty\";\nimport _JSXStyle from \"styled-jsx/style\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(_Reflect$construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nimport * as React from \"react\";\nimport Router from \"next/router\";\nimport NextLink from \"next/link\";\nimport { trim } from \"lodash\";\nimport { theme } from \"../theme\"; // Convert simple links to next style href + as\n\nvar Link = function Link(_ref) {\n  var to = _ref.to,\n      children = _ref.children,\n      basepath = _ref.basepath;\n  return /*#__PURE__*/React.createElement(NextLink, {\n    href: {\n      pathname: \"/view\",\n      query: {\n        viewPath: to\n      }\n    },\n    as: basepath + \"/\" + to\n  }, children);\n};\n\nvar BrowseHeader = /*#__PURE__*/function (_React$Component) {\n  _inherits(BrowseHeader, _React$Component);\n\n  var _super = _createSuper(BrowseHeader);\n\n  function BrowseHeader() {\n    var _this;\n\n    _classCallCheck(this, BrowseHeader);\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    _this = _super.call.apply(_super, [this].concat(args));\n\n    _defineProperty(_assertThisInitialized(_this), \"props\", void 0);\n\n    _defineProperty(_assertThisInitialized(_this), \"handleItemClick\", function (e, _ref2) {\n      var name = _ref2.name;\n      Router.push(name);\n    });\n\n    return _this;\n  }\n\n  _createClass(BrowseHeader, [{\n    key: \"render\",\n    value: function render() {\n      var _this$props = this.props,\n          path = _this$props.path,\n          basepath = _this$props.basepath;\n      var paths = trim(path, \"/\").split(\"/\"); // Empty path to start off\n\n      if (paths.length === 1 && paths[0] === \"\") {\n        paths = [];\n      } // TODO: Ensure this works under an app subpath (which is not implemented yet)\n\n\n      var filePath = basepath.replace(/view\\/?/, \"files/\") + path; // const serverSide = typeof document === \"undefined\";\n\n      var viewingNotebook = filePath.endsWith(\".ipynb\");\n      return /*#__PURE__*/React.createElement(\"nav\", {\n        className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]])\n      }, /*#__PURE__*/React.createElement(\"ul\", {\n        className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]]) + \" \" + \"breadcrumbs\"\n      }, /*#__PURE__*/React.createElement(\"li\", {\n        className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]])\n      }, /*#__PURE__*/React.createElement(Link, {\n        to: \"\",\n        basepath: basepath\n      }, /*#__PURE__*/React.createElement(\"a\", {\n        className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]])\n      }, /*#__PURE__*/React.createElement(\"span\", {\n        className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]])\n      }, \"home\")))), paths.map(function (name, index) {\n        var filePath = paths.slice(0, index + 1).join(\"/\");\n        return /*#__PURE__*/React.createElement(\"li\", {\n          key: \"\".concat(filePath),\n          className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]])\n        }, /*#__PURE__*/React.createElement(Link, {\n          to: \"\".concat(filePath),\n          basepath: basepath\n        }, /*#__PURE__*/React.createElement(\"a\", {\n          className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]])\n        }, /*#__PURE__*/React.createElement(\"span\", {\n          className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]])\n        }, name))));\n      })), this.props.type === \"directory\" ? null : /*#__PURE__*/React.createElement(React.Fragment, null, this.props.commuterExecuteLink && viewingNotebook ? /*#__PURE__*/React.createElement(\"a\", {\n        href: \"\".concat(this.props.commuterExecuteLink, \"/\").concat(path),\n        className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]]) + \" \" + \"ops\"\n      }, \"Run\") : null, /*#__PURE__*/React.createElement(\"a\", {\n        href: filePath,\n        download: true,\n        className: _JSXStyle.dynamic([[\"3767621066\", [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]]]) + \" \" + \"ops\"\n      }, \"Download\")), /*#__PURE__*/React.createElement(_JSXStyle, {\n        id: \"3767621066\",\n        dynamic: [theme.outline, theme.primary, theme.primary, theme.active, theme.active, theme.background, theme.outline, theme.outline, theme.primary, theme.active]\n      }, [\"nav.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;border:1px solid \".concat(theme.outline, \";padding:0 1rem;}\"), \"ul.breadcrumbs.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;margin:0 0 0 0;padding:0;list-style:none;background:#ffffff;font-family:\\\"Source Sans Pro\\\";font-size:16px;color:\".concat(theme.primary, \";}\"), \"ul.breadcrumbs.__jsx-style-dynamic-selector li.__jsx-style-dynamic-selector{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;list-style-type:none;display:inline;text-align:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}\", \"ul.breadcrumbs.__jsx-style-dynamic-selector li.__jsx-style-dynamic-selector a.__jsx-style-dynamic-selector{vertical-align:middle;display:table;padding:1em;color:\".concat(theme.primary, \";-webkit-text-decoration:none;text-decoration:none;}\"), \"ul.breadcrumbs.__jsx-style-dynamic-selector li.__jsx-style-dynamic-selector a.__jsx-style-dynamic-selector:hover{-webkit-text-decoration:underline;text-decoration:underline;}\", \"ul.breadcrumbs.__jsx-style-dynamic-selector li.__jsx-style-dynamic-selector:last-child a.__jsx-style-dynamic-selector{color:\".concat(theme.active, \";-webkit-text-decoration:none;text-decoration:none;cursor:pointer;}\"), \"ul.breadcrumbs.__jsx-style-dynamic-selector li.__jsx-style-dynamic-selector+li.__jsx-style-dynamic-selector:before{content:\\\"\\u203A\\\";color:\".concat(theme.active, \";}\"), \".ops.__jsx-style-dynamic-selector{display:inline-block;line-height:2em;padding:0 8px;border-radius:2px;background-color:\".concat(theme.background, \";border:1px solid \").concat(theme.outline, \";color:#000;-webkit-text-decoration:none;text-decoration:none;}\"), \".ops.__jsx-style-dynamic-selector:hover{background-color:\".concat(theme.outline, \";-webkit-transition:background-color 0.25s ease-out;transition:background-color 0.25s ease-out;}\"), \".ops.__jsx-style-dynamic-selector:active{background-color:\".concat(theme.primary, \";color:\").concat(theme.active, \";-webkit-transition:background-color 0.5s ease-out,color 6s ease-out;transition:background-color 0.5s ease-out,color 6s ease-out;}\"), \".ops.__jsx-style-dynamic-selector:not(:last-child){margin-right:10px;}\"]));\n    }\n  }]);\n\n  return BrowseHeader;\n}(React.Component);\n\n_defineProperty(BrowseHeader, \"defaultProps\", {\n  active: \"view\"\n});\n\nexport default BrowseHeader;","map":null,"metadata":{},"sourceType":"module"}