"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const XEUtils = require("xe-utils");
function assembleCollapseItem($xeCollapse, elem, collapseConfig) {
  const staticPanes = $xeCollapse.reactData.staticPanes;
  const parentElem = elem.parentNode;
  if (parentElem) {
    staticPanes.splice(XEUtils.arrayIndexOf(parentElem.children, elem), 0, collapseConfig);
    $xeCollapse.reactData.staticPanes = staticPanes.slice(0);
  }
}
function destroyCollapseItem($xeCollapse, collapseConfig) {
  const staticPanes = $xeCollapse.reactData.staticPanes;
  const matchObj = XEUtils.findTree(staticPanes, (item) => item.id === collapseConfig.id, { children: "children" });
  if (matchObj) {
    matchObj.items.splice(matchObj.index, 1);
  }
  $xeCollapse.reactData.staticPanes = staticPanes.slice(0);
}
exports.assembleCollapseItem = assembleCollapseItem;
exports.destroyCollapseItem = destroyCollapseItem;
