"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.findExpand = void 0;
var _utils = require("@atlaskit/editor-prosemirror/utils");
var findExpand = exports.findExpand = function findExpand(state, selection) {
  var _state$schema$nodes = state.schema.nodes,
    expand = _state$schema$nodes.expand,
    nestedExpand = _state$schema$nodes.nestedExpand;
  return (0, _utils.findSelectedNodeOfType)([expand, nestedExpand])(selection || state.selection) || (0, _utils.findParentNodeOfType)([expand, nestedExpand])(selection || state.selection);
};