import{__exports as t}from"../../../_virtual/UncontrolledCollapse.js";import e from"react";import{p as r}from"../../prop-types/index.js";import"./Collapse.js";import"./utils.js";import{__exports as n}from"../../../_virtual/Collapse.js";import{__exports as o}from"../../../_virtual/utils.js";!function(t){function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!==i(t)&&"function"!=typeof t)return{default:t};var r=c(e);if(r&&r.has(t))return r.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if("default"!==u&&Object.prototype.hasOwnProperty.call(t,u)){var l=o?Object.getOwnPropertyDescriptor(t,u):null;l&&(l.get||l.set)?Object.defineProperty(n,u,l):n[u]=t[u]}n.default=t,r&&r.set(t,n);return n}(e),l=a(r),s=a(n),f=o;function a(t){return t&&t.__esModule?t:{default:t}}function c(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(c=function(t){return t?r:e})(t)}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},p.apply(this,arguments)}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=b(t);if(e){var o=b(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,r)}}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}var O=["toggleEvents","defaultOpen"],h={defaultOpen:l.default.bool,toggler:l.default.string.isRequired,toggleEvents:l.default.arrayOf(l.default.string)},m={toggleEvents:f.defaultToggleEvents},j=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(i,t);var e,r,n,o=g(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).togglers=null,e.removeEventListeners=null,e.toggle=e.toggle.bind(v(e)),e.state={isOpen:t.defaultOpen||!1},e}return e=i,(r=[{key:"componentDidMount",value:function(){this.togglers=(0,f.findDOMElements)(this.props.toggler),this.togglers.length&&(this.removeEventListeners=(0,f.addMultipleEventListeners)(this.togglers,this.toggle,this.props.toggleEvents))}},{key:"componentWillUnmount",value:function(){this.togglers.length&&this.removeEventListeners&&this.removeEventListeners()}},{key:"toggle",value:function(t){this.setState((function(t){return{isOpen:!t.isOpen}})),t.preventDefault()}},{key:"render",value:function(){return u.default.createElement(s.default,p({isOpen:this.state.isOpen},(0,f.omit)(this.props,O)))}}])&&y(e.prototype,r),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}(u.Component);j.propTypes=h,j.defaultProps=m;var _=j;t.default=_}(t);
//# sourceMappingURL=UncontrolledCollapse.js.map
