mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-28 03:15:16 +00:00
1 line
19 KiB
JSON
1 line
19 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n\nvar _transitionStatusToCl;\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { Transition } from 'react-transition-group';\nimport { mapToCssModules, omit, pick, TransitionTimeouts, TransitionPropTypeKeys, TransitionStatuses, tagPropType } from './utils';\n\nvar propTypes = _objectSpread(_objectSpread({}, Transition.propTypes), {}, {\n isOpen: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n tag: tagPropType,\n className: PropTypes.node,\n navbar: PropTypes.bool,\n cssModule: PropTypes.object,\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])\n});\n\nvar defaultProps = _objectSpread(_objectSpread({}, Transition.defaultProps), {}, {\n isOpen: false,\n appear: false,\n enter: true,\n exit: true,\n tag: 'div',\n timeout: TransitionTimeouts.Collapse\n});\n\nvar transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);\n\nfunction getTransitionClass(status) {\n return transitionStatusToClassHash[status] || 'collapse';\n}\n\nfunction getHeight(node) {\n return node.scrollHeight;\n}\n\nvar Collapse = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Collapse, _Component);\n\n function Collapse(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.state = {\n height: null\n };\n ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {\n _this[name] = _this[name].bind(_assertThisInitialized(_this));\n });\n return _this;\n }\n\n var _proto = Collapse.prototype;\n\n _proto.onEntering = function onEntering(node, isAppearing) {\n this.setState({\n height: getHeight(node)\n });\n this.props.onEntering(node, isAppearing);\n };\n\n _proto.onEntered = function onEntered(node, isAppearing) {\n this.setState({\n height: null\n });\n this.props.onEntered(node, isAppearing);\n };\n\n _proto.onExit = function onExit(node) {\n this.setState({\n height: getHeight(node)\n });\n this.props.onExit(node);\n };\n\n _proto.onExiting = function onExiting(node) {\n // getting this variable triggers a reflow\n var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars\n\n this.setState({\n height: 0\n });\n this.props.onExiting(node);\n };\n\n _proto.onExited = function onExited(node) {\n this.setState({\n height: null\n });\n this.props.onExited(node);\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n Tag = _this$props.tag,\n isOpen = _this$props.isOpen,\n className = _this$props.className,\n navbar = _this$props.navbar,\n cssModule = _this$props.cssModule,\n children = _this$props.children,\n innerRef = _this$props.innerRef,\n otherProps = _objectWithoutPropertiesLoose(_this$props, [\"tag\", \"isOpen\", \"className\", \"navbar\", \"cssModule\", \"children\", \"innerRef\"]);\n\n var height = this.state.height;\n var transitionProps = pick(otherProps, TransitionPropTypeKeys);\n var childProps = omit(otherProps, TransitionPropTypeKeys);\n return /*#__PURE__*/React.createElement(Transition, _extends({}, transitionProps, {\n in: isOpen,\n onEntering: this.onEntering,\n onEntered: this.onEntered,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }), function (status) {\n var collapseClass = getTransitionClass(status);\n var classes = mapToCssModules(classNames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);\n var style = height === null ? null : {\n height: height\n };\n return /*#__PURE__*/React.createElement(Tag, _extends({}, childProps, {\n style: _objectSpread(_objectSpread({}, childProps.style), style),\n className: classes,\n ref: _this2.props.innerRef\n }), children);\n });\n };\n\n return Collapse;\n}(Component);\n\nCollapse.propTypes = propTypes;\nCollapse.defaultProps = defaultProps;\nexport default Collapse;","map":{"version":3,"sources":["/app/node_modules/reactstrap/es/Collapse.js"],"names":["_extends","_objectWithoutPropertiesLoose","_assertThisInitialized","_inheritsLoose","_defineProperty","_transitionStatusToCl","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","getOwnPropertyDescriptors","defineProperties","defineProperty","React","Component","PropTypes","classNames","Transition","mapToCssModules","omit","pick","TransitionTimeouts","TransitionPropTypeKeys","TransitionStatuses","tagPropType","propTypes","isOpen","bool","children","oneOfType","arrayOf","node","tag","className","navbar","cssModule","innerRef","func","string","defaultProps","appear","enter","exit","timeout","Collapse","transitionStatusToClassHash","ENTERING","ENTERED","EXITING","EXITED","getTransitionClass","status","getHeight","scrollHeight","_Component","props","_this","call","state","height","name","bind","_proto","prototype","onEntering","isAppearing","setState","onEntered","onExit","onExiting","_unused","offsetHeight","onExited","render","_this2","_this$props","Tag","otherProps","transitionProps","childProps","createElement","in","collapseClass","classes","style","ref"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,6BAAP,MAA0C,yDAA1C;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;;AAEA,IAAIC,qBAAJ;;AAEA,SAASC,OAAT,CAAiBC,MAAjB,EAAyBC,cAAzB,EAAyC;AAAE,MAAIC,IAAI,GAAGC,MAAM,CAACD,IAAP,CAAYF,MAAZ,CAAX;;AAAgC,MAAIG,MAAM,CAACC,qBAAX,EAAkC;AAAE,QAAIC,OAAO,GAAGF,MAAM,CAACC,qBAAP,CAA6BJ,MAA7B,CAAd;AAAoD,QAAIC,cAAJ,EAAoBI,OAAO,GAAGA,OAAO,CAACC,MAAR,CAAe,UAAUC,GAAV,EAAe;AAAE,aAAOJ,MAAM,CAACK,wBAAP,CAAgCR,MAAhC,EAAwCO,GAAxC,EAA6CE,UAApD;AAAiE,KAAjG,CAAV;AAA8GP,IAAAA,IAAI,CAACQ,IAAL,CAAUC,KAAV,CAAgBT,IAAhB,EAAsBG,OAAtB;AAAiC;;AAAC,SAAOH,IAAP;AAAc;;AAErV,SAASU,aAAT,CAAuBC,MAAvB,EAA+B;AAAE,OAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGC,SAAS,CAACC,MAA9B,EAAsCF,CAAC,EAAvC,EAA2C;AAAE,QAAIG,MAAM,GAAGF,SAAS,CAACD,CAAD,CAAT,IAAgB,IAAhB,GAAuBC,SAAS,CAACD,CAAD,CAAhC,GAAsC,EAAnD;;AAAuD,QAAIA,CAAC,GAAG,CAAR,EAAW;AAAEf,MAAAA,OAAO,CAACI,MAAM,CAACc,MAAD,CAAP,EAAiB,IAAjB,CAAP,CAA8BC,OA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AlBmB,CAApB;AAmBD,GAnCD;;AAqCA,SAAOgB,QAAP;AACD,CA9F2B,CA8F1B9B,SA9F0B,CAA5B;;AAgGA8B,QAAQ,CAACnB,SAAT,GAAqBA,SAArB;AACAmB,QAAQ,CAACL,YAAT,GAAwBA,YAAxB;AACA,eAAeK,QAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n\nvar _transitionStatusToCl;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { Transition } from 'react-transition-group';\nimport { mapToCssModules, omit, pick, TransitionTimeouts, TransitionPropTypeKeys, TransitionStatuses, tagPropType } from './utils';\n\nvar propTypes = _objectSpread(_objectSpread({}, Transition.propTypes), {}, {\n isOpen: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n tag: tagPropType,\n className: PropTypes.node,\n navbar: PropTypes.bool,\n cssModule: PropTypes.object,\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object])\n});\n\nvar defaultProps = _objectSpread(_objectSpread({}, Transition.defaultProps), {}, {\n isOpen: false,\n appear: false,\n enter: true,\n exit: true,\n tag: 'div',\n timeout: TransitionTimeouts.Collapse\n});\n\nvar transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);\n\nfunction getTransitionClass(status) {\n return transitionStatusToClassHash[status] || 'collapse';\n}\n\nfunction getHeight(node) {\n return node.scrollHeight;\n}\n\nvar Collapse = /*#__PURE__*/function (_Component) {\n _inheritsLoose(Collapse, _Component);\n\n function Collapse(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.state = {\n height: null\n };\n ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {\n _this[name] = _this[name].bind(_assertThisInitialized(_this));\n });\n return _this;\n }\n\n var _proto = Collapse.prototype;\n\n _proto.onEntering = function onEntering(node, isAppearing) {\n this.setState({\n height: getHeight(node)\n });\n this.props.onEntering(node, isAppearing);\n };\n\n _proto.onEntered = function onEntered(node, isAppearing) {\n this.setState({\n height: null\n });\n this.props.onEntered(node, isAppearing);\n };\n\n _proto.onExit = function onExit(node) {\n this.setState({\n height: getHeight(node)\n });\n this.props.onExit(node);\n };\n\n _proto.onExiting = function onExiting(node) {\n // getting this variable triggers a reflow\n var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars\n\n this.setState({\n height: 0\n });\n this.props.onExiting(node);\n };\n\n _proto.onExited = function onExited(node) {\n this.setState({\n height: null\n });\n this.props.onExited(node);\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n Tag = _this$props.tag,\n isOpen = _this$props.isOpen,\n className = _this$props.className,\n navbar = _this$props.navbar,\n cssModule = _this$props.cssModule,\n children = _this$props.children,\n innerRef = _this$props.innerRef,\n otherProps = _objectWithoutPropertiesLoose(_this$props, [\"tag\", \"isOpen\", \"className\", \"navbar\", \"cssModule\", \"children\", \"innerRef\"]);\n\n var height = this.state.height;\n var transitionProps = pick(otherProps, TransitionPropTypeKeys);\n var childProps = omit(otherProps, TransitionPropTypeKeys);\n return /*#__PURE__*/React.createElement(Transition, _extends({}, transitionProps, {\n in: isOpen,\n onEntering: this.onEntering,\n onEntered: this.onEntered,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }), function (status) {\n var collapseClass = getTransitionClass(status);\n var classes = mapToCssModules(classNames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);\n var style = height === null ? null : {\n height: height\n };\n return /*#__PURE__*/React.createElement(Tag, _extends({}, childProps, {\n style: _objectSpread(_objectSpread({}, childProps.style), style),\n className: classes,\n ref: _this2.props.innerRef\n }), children);\n });\n };\n\n return Collapse;\n}(Component);\n\nCollapse.propTypes = propTypes;\nCollapse.defaultProps = defaultProps;\nexport default Collapse;"]},"metadata":{},"sourceType":"module"} |