import{__exports as e}from"../../../_virtual/AccordionHeader.js";import t from"react";import{p as r}from"../../prop-types/index.js";import{c as o}from"../../classnames/index.js";import"./utils.js";import"./AccordionContext.js";import{__exports as n}from"../../../_virtual/utils.js";import{__exports as a}from"../../../_virtual/AccordionContext.js";!function(e){function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var r=y(t);if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(o,a,l):o[a]=e[a]}o.default=e,r&&r.set(e,o);return o}(t),i=d(r),s=d(o),f=n,c=a,p=["className","cssModule","tag","innerRef","children","targetId"];function d(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(y=function(e){return e?r:t})(e)}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},m.apply(this,arguments)}function b(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var g={children:i.default.node,className:i.default.string,cssModule:i.default.object,innerRef:i.default.oneOfType([i.default.object,i.default.string,i.default.func]),tag:f.tagPropType,targetId:i.default.string.isRequired};function j(e){var t=e.className,r=e.cssModule,o=e.tag,n=e.innerRef,a=e.children,u=e.targetId,i=b(e,p),d=(0,l.useContext)(c.AccordionContext),y=d.open,g=d.toggle,j=(0,f.mapToCssModules)((0,s.default)(t,"accordion-header"),r),O=(0,f.mapToCssModules)((0,s.default)("accordion-button",{collapsed:!(Array.isArray(y)?y.includes(u):y===u)}),r);return l.default.createElement(o,m({},i,{className:j,ref:n}),l.default.createElement("button",{type:"button",className:O,onClick:function(){return g(u)}},a))}j.propTypes=g,j.defaultProps={tag:"h2"};var O=j;e.default=O}(e);
//# sourceMappingURL=AccordionHeader.js.map
