import { D as DataModel } from './data-model-f7ccf826.js';

var ViewPlacement;
(function (ViewPlacement) {
  ViewPlacement["Page"] = "page";
  ViewPlacement["SideModal"] = "side-modal";
  ViewPlacement["Dialog"] = "dialog";
})(ViewPlacement || (ViewPlacement = {}));
class AppConfig extends DataModel {
  static decode(json) {
    return Object.assign(Object.create(AppConfig.prototype), json);
  }
  getView(viewId) {
    return this.views.find(view => view._id === viewId);
  }
  getHomeView() {
    var _a;
    if (this.mainNavigation.items.length === 0) {
      return undefined;
    }
    return this.getView((_a = this.mainNavigation.items[0]) === null || _a === void 0 ? void 0 : _a.viewId);
  }
}

export { AppConfig as A, ViewPlacement as V };
