text: define(["exports", "meta", "../../../lit/index.js", "../a11y-collapse.js"], function (_exports, meta, _index, _a11yCollapse) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.A11yCollapseGroup = void 0;
    meta = _interopRequireWildcard(meta);
  
    var _templateObject_b29942f0941711ec8d52c707f928eca0, _templateObject2_b29942f0941711ec8d52c707f928eca0;
  
    function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
  
    function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || babelHelpers.typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  
    function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  
    function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { babelHelpers.defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  
    function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = babelHelpers.getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = babelHelpers.getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return babelHelpers.possibleConstructorReturn(this, result); }; }
  
    function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  
    /**
     * `a11y-collapse-group`
     * a group of `a11y-collapse` elements
     * 
    ### Styling
    
    `<a11y-collapse-group>` provides the following custom properties
    for styling:
    
    Custom property | Description | Default
    ----------------|-------------|----------
    `--a11y-collapse-group-margin` | margin around the a11y-collapse-group | 15px 0
     *
     * @customElement
     * @extends LitElement
     * @see ../a11y-collapse.js
     * @demo ./demo/group.html collapse groups
     */
    var A11yCollapseGroup = /*#__PURE__*/function (_LitElement) {
      babelHelpers.inherits(A11yCollapseGroup, _LitElement);
  
      var _super = _createSuper(A11yCollapseGroup);
  
      function A11yCollapseGroup() {
        var _this;
  
        babelHelpers.classCallCheck(this, A11yCollapseGroup);
        _this = _super.call(this);
        _this.globalOptions = {};
        _this.radio = false;
        _this.__items = [];
  
        _this.addEventListener("a11y-collapse-attached", function (e) {
          e.stopPropagation();
          e.stopImmediatePropagation();
  
          _this._attachItem(e.detail);
        });
  
        _this.addEventListener("a11y-collapse-detached", function (e) {
          e.stopPropagation();
          e.stopImmediatePropagation();
  
          _this._detachItem(e.detail);
        });
  
        _this.addEventListener("a11y-collapse-click", function (e) {
          e.stopPropagation();
          e.stopImmediatePropagation();
  
          _this.radioToggle(e.detail);
        });
  
        _this.addEventListener("toggle", function (e) {
          e.stopPropagation();
          e.stopImmediatePropagation();
  
          _this.radioToggle(e.detail);
        });
  
        return _this;
      }
  
      babelHelpers.createClass(A11yCollapseGroup, [{
        key: "render",
        value: function render() {
          return (0, _index.html)(_templateObject_b29942f0941711ec8d52c707f928eca0 || (_templateObject_b29942f0941711ec8d52c707f928eca0 = babelHelpers.taggedTemplateLiteral([" <div class=\"wrapper\"><slot></slot></div> "])));
        }
      }, {
        key: "items",
        get: function get() {
          return this.__items;
        }
        /**
         * Adds a11y-collapse item to __items array.
         * @param {object} item an a11y-collapse item
         */
  
      }, {
        key: "_attachItem",
        value: function _attachItem(item) {
          var _this2 = this;
  
          this.__items.push(item);
  
          Object.keys(A11yCollapseGroup.properties || {}).forEach(function (propName) {
            return _this2._updateItem(item, propName);
          });
        }
        /**
         * Updates a11y-collapse item when properties change
         */
  
      }, {
        key: "updated",
        value: function updated(changedProperties) {
          var _this3 = this;
  
          changedProperties.forEach(function (oldValue, propName) {
            _this3.__items.forEach(function (item) {
              return _this3._updateItem(item, propName, oldValue);
            });
          });
        }
      }, {
        key: "_updateItem",
        value: function _updateItem(item, propName) {
          var oldValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
  
          if (propName === "globalOptions" || propName === "__items") {
            if (this.globalOptions !== {}) for (var key in this.globalOptions) {
              if (this.globalOptions.hasOwnProperty(key)) {
                item[key] = this.globalOptions[key];
              }
            }
          } else if (propName === "radio" && this.radio) {
            item.expanded = false;
          } else {
            if (this[propName] !== null || babelHelpers.typeof(this[propName]) !== (typeof undefined === "undefined" ? "undefined" : babelHelpers.typeof(undefined))) item[propName] = this[propName];
          }
        }
        /**
         * Removes a detached item from __items array.
         * @param {object} item an a11y-collapse item
         */
  
      }, {
        key: "_detachItem",
        value: function _detachItem(item) {
          if (this.__items && item) {
            for (var i = 0; i < this.__items.length; i++) {
              if (this.__items[i] === item) this.__items.splice(i, 1);
            }
          }
        }
        /**
         * Toggles off all previous choices.
         * @param {object} item an a11y-collapse item
         */
  
      }, {
        key: "radioToggle",
        value: function radioToggle(item) {
          if (this.radio && item.expanded) {
            for (var i = 0; i < this.__items.length; i++) {
              if (this.__items[i] !== item) this.__items[i].toggle(false);
            }
          }
        }
      }], [{
        key: "styles",
        get: function get() {
          return [(0, _index.css)(_templateObject2_b29942f0941711ec8d52c707f928eca0 || (_templateObject2_b29942f0941711ec8d52c707f928eca0 = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: block;\n          margin: var(--a11y-collapse-group-margin, 15px 0);\n          --a11y-collapse-margin: 15px;\n        }\n        :host([hidden]) {\n          display: none;\n        }\n        #heading {\n          font-weight: bold;\n        }\n        .wrapper {\n          border-radius: 0;\n          display: block;\n          --a11y-collapse-margin: 0 0;\n          --a11y-collapse-border-between: none;\n        }\n      "])))];
        }
      }, {
        key: "tag",
        get: function get() {
          return "a11y-collapse-group";
        }
      }, {
        key: "properties",
        get: function get() {
          return _objectSpread(_objectSpread(_objectSpread({}, babelHelpers.get(babelHelpers.getPrototypeOf(A11yCollapseGroup), "properties", this)), _a11yCollapse.A11yCollapse.properties), {}, {
            /**
             * an array of globalProperties to override every a11y-collapse item
             * For example, {"icon": "arrow-drop-down"} would set every item's icon to "arrow-drop-down"
             */
            globalOptions: {
              type: Object,
              attribute: "global-options",
              reflect: true
            },
  
            /**
             * Acts like a radio button. (Items can only be expanded one at a time.)
             */
            radio: {
              type: Boolean,
              attribute: "radio"
            },
  
            /**
             * is radio button
             */
            __items: {
              type: Array
            }
          });
        }
        /**
         * haxProperties integration via file reference
         */
  
      }, {
        key: "haxProperties",
        get: function get() {
          return new URL("./".concat(this.tag, ".haxProperties.json"), meta.url).href;
        }
      }]);
      return A11yCollapseGroup;
    }(_index.LitElement);
  
    _exports.A11yCollapseGroup = A11yCollapseGroup;
    window.customElements.define(A11yCollapseGroup.tag, A11yCollapseGroup);
  });