import{Ef as a,If as r,Vd as o}from"./chunk-QXV2GR6R.js";import{a as n,b as s,i as e}from"./chunk-JJ4RDTEF.js";var u=class d extends r{constructor(t){super(t);e(this,"displayName");e(this,"description");e(this,"support");e(this,"nameWithHost");e(this,"nameWithHostForced");e(this,"banners");e(this,"bannerUrl");e(this,"updatedAt");e(this,"ownerAccount");e(this,"ownerBy");e(this,"videosCount");e(this,"viewsPerDay");e(this,"totalViews");this.displayName=t.displayName,this.description=t.description,this.support=t.support,this.banners=t.banners||[],this.isLocal=t.isLocal,this.nameWithHost=r.CREATE_BY_STRING(this.name,this.host),this.nameWithHostForced=r.CREATE_BY_STRING(this.name,this.host,!0),this.videosCount=t.videosCount,t.updatedAt&&(this.updatedAt=new Date(t.updatedAt.toString())),t.viewsPerDay&&(this.viewsPerDay=t.viewsPerDay.map(i=>s(n({},i),{date:new Date(i.date)}))),t.totalViews!==null&&t.totalViews!==void 0&&(this.totalViews=t.totalViews),t.ownerAccount&&(this.ownerAccount=t.ownerAccount,this.ownerBy=r.CREATE_BY_STRING(t.ownerAccount.name,t.ownerAccount.host)),this.updateComputedAttributes()}static GET_ACTOR_AVATAR_URL(t,i){return r.GET_ACTOR_AVATAR_URL(t,i)}static GET_ACTOR_BANNER_URL(t){if(!t||t.banners.length===0)return"";let i=o(t.banners,"width");return i?i.url?i.url:a()+i.path:""}static GET_DEFAULT_AVATAR_URL(t){return t<=48?`${window.location.origin}/client/assets/images/default-avatar-video-channel-48x48.png`:`${window.location.origin}/client/assets/images/default-avatar-video-channel.png`}updateAvatar(t){this.avatars=t,this.updateComputedAttributes()}resetAvatar(){this.updateAvatar([])}updateBanner(t){this.banners=t,this.updateComputedAttributes()}resetBanner(){this.updateBanner([])}updateComputedAttributes(){this.bannerUrl=d.GET_ACTOR_BANNER_URL(this)}};export{u as a};
/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*/
//# sourceMappingURL=chunk-5QNRJ25A.js.map
