"use strict";
function getParent(name, keys) {
  var _a;
  let parent = this.$parent;
  while (parent) {
    if (((_a = parent.$options) == null ? void 0 : _a.name) !== name) {
      parent = parent.$parent;
    } else {
      const data = {};
      if (Array.isArray(keys)) {
        keys.forEach((val) => {
          data[val] = (parent == null ? void 0 : parent[val]) ? parent[val] : "";
        });
      } else {
        for (const i in keys) {
          if (Array.isArray(keys[i])) {
            if (keys[i].length) {
              data[i] = keys[i];
            } else {
              data[i] = parent[i];
            }
          } else if (keys[i] && keys[i].constructor === Object) {
            if (Object.keys(keys[i]).length) {
              data[i] = keys[i];
            } else {
              data[i] = parent[i];
            }
          } else {
            data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
          }
        }
      }
      return data;
    }
  }
  return {};
}
exports.getParent = getParent;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-pro/libs/function/getParent.js.map
