/*! phoscon-app 2025-08-29 */

export const getMainView=(c,subs)=>new Promise((resolve,reject)=>{resolve(new(Backbone.View.extend({el:"#overview",initialize:function(){this.service=null,this.views=[],this.c=c,subs.forEach(view=>{let v=new view;this.views.push(v)}),this.groupEl=this.el.querySelector(".group-name"),this.menuBtnIcon=document.querySelector("#menu-btn svg use"),this.menuBtnLabel=document.querySelector("#menu-btn span"),this.listenTo(app,"switchViewAdded",this.removeEmpty),this.listenTo(app,"switchViewRemoved",this.addEmpty)},setGroupName:function(gid){if(!gid)return;let group=app.groups.get(gid);this.groupEl.innerText=group.get("name")},removeEmpty:function(){this.el.classList.remove("empty")},addEmpty:function(){this.el.classList.add("empty")},setClass:function(cl){this.el.classList.remove("navigation"),this.el.classList.remove("resourcelinks"),this.el.classList.remove("rlFunction"),this.el.classList.add(cl),(screenMax(SCREEN_MAX_WIDTH_PHONE_PORTRAIT)||screen.height<420)&&("resourcelinks"==cl?(this.menuBtnIcon.setAttribute("xlink:href","#back-icon-sm"),this.menuBtnLabel.innerText=translate("text_back")):"rlFunction"==cl?(this.menuBtnIcon.setAttribute("xlink:href","#back-icon-sm"),this.menuBtnLabel.innerText=translate("text_back")):(this.menuBtnIcon.setAttribute("xlink:href","#icon-hamburger-sm"),this.menuBtnLabel.innerText=""))}})))});