import{Pf as o,Uf as i,ee as s}from"./chunk-7W5IJG57.js";import{a as r,b as n}from"./chunk-RB5FWREQ.js";var a=class u extends i{displayName;description;support;nameWithHost;nameWithHostForced;banners;bannerUrl;updatedAt;ownerAccount;ownerBy;videosCount;viewsPerDay;totalViews;static GET_ACTOR_AVATAR_URL(t,e){return i.GET_ACTOR_AVATAR_URL(t,e)}static GET_ACTOR_BANNER_URL(t){if(!t||t.banners.length===0)return"";let e=s(t.banners,"width");return e?e.url?e.url:o()+e.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`}static buildPublicUrl(t){return`/c/${i.CREATE_BY_STRING(t.name,t.host)}`}constructor(t){super(t),this.displayName=t.displayName,this.description=t.description,this.support=t.support,this.banners=t.banners||[],this.isLocal=t.isLocal,this.nameWithHost=i.CREATE_BY_STRING(this.name,this.host),this.nameWithHostForced=i.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(e=>n(r({},e),{date:new Date(e.date)}))),t.totalViews!==null&&t.totalViews!==void 0&&(this.totalViews=t.totalViews),t.ownerAccount&&(this.ownerAccount=t.ownerAccount,this.ownerBy=i.CREATE_BY_STRING(t.ownerAccount.name,t.ownerAccount.host)),this.updateComputedAttributes()}updateAvatar(t){this.avatars=t,this.updateComputedAttributes()}resetAvatar(){this.updateAvatar([])}updateBanner(t){this.banners=t,this.updateComputedAttributes()}resetBanner(){this.updateBanner([])}updateComputedAttributes(){this.bannerUrl=u.GET_ACTOR_BANNER_URL(this)}};export{a};
/**i18n:3558f4fa3a6acf6a8a484a0589828971efacd00f9f89386e64ec00a5fc269cc5*/
//# sourceMappingURL=chunk-NHKGWW2Q.js.map
