import{a as U}from"./chunk-I4PHAYOX.js";import{a as r}from"./chunk-HN24ADZS.js";import{Eb as g,Fc as E,Ha as n,L as y,Mg as h,Sa as D,Za as f,ba as m,eg as c,gb as d,hc as S,jc as v,pb as _,qb as u,rb as Q,zb as p}from"./chunk-ZXQQIUTT.js";import{i as l}from"./chunk-RE7RSUSQ.js";function V(a,i){if(a&1&&(_(0,"div",6)(1,"div",3),p(2,1),u(),Q(3,"my-progress-bar",4),S(4,"bytes"),u()),a&2){let s=g();n(3),d("label",s.labelQuotaDaily())("max",(s.user==null?null:s.user.videoQuotaDaily)||0)("value",s.userVideoQuotaUsedDaily)("valueFormatted",v(4,5,s.userVideoQuotaUsedDaily,1))("maxFormatted",s.userVideoQuotaDaily);}}var $=(()=>{let i=class i{userService=m(h);auth=m(c);userVideoQuota="0";userVideoQuotaUsed=0;userVideoQuotaPercentage=15;userVideoQuotaDaily="0";userVideoQuotaUsedDaily=0;userVideoQuotaDailyPercentage=15;get user(){return this.auth.getUser();}ngOnInit(){this.auth.userInformationLoaded.pipe(y()).subscribe(()=>{this.user.videoQuota!==-1?this.userVideoQuota=new r().transform(this.user.videoQuota,0).toString():this.userVideoQuota="\u0646\u0627\u0645\u062D\u062F\u0648\u062F",this.user.videoQuotaDaily!==-1?this.userVideoQuotaDaily=new r().transform(this.user.videoQuotaDaily,0).toString():this.userVideoQuotaDaily="\u0646\u0627\u0645\u062D\u062F\u0648\u062F";}),this.userService.getMyVideoQuotaUsed().subscribe(t=>{this.userVideoQuotaUsed=t.videoQuotaUsed,this.userVideoQuotaPercentage=this.userVideoQuotaUsed*100/this.user.videoQuota,this.userVideoQuotaUsedDaily=t.videoQuotaUsedDaily,this.userVideoQuotaDailyPercentage=this.userVideoQuotaUsedDaily*100/this.user.videoQuotaDaily;});}hasDailyQuota(){return this.user.videoQuotaDaily!==-1;}labelQuota(){return`Total video quota: ${new r().transform(this.userVideoQuotaUsed,0).toString()} / ${this.userVideoQuota}`;}labelQuotaDaily(){return`Total daily video quota: ${new r().transform(this.userVideoQuotaUsedDaily,0).toString()} / ${this.userVideoQuotaDaily}`;}};l(i,"\u0275fac",function(o){return new(o||i)();}),l(i,"\u0275cmp",D({type:i,selectors:[["my-user-quota"]],decls:7,vars:9,consts:()=>{let t;t="\u062C\u0645\u0639 \u0633\u0647\u0645\u06CC\u0647 \u0648\u06CC\u062F\u0626\u0648";let o;return o="\u0633\u0647\u0645\u06CC\u0647 \u0648\u06CC\u062F\u0626\u0648 \u0631\u0648\u0632\u0627\u0646\u0647",[t,o,[1,"user-quota","mb-3"],[1,"label"],["height","2rem",3,"label","max","value","valueFormatted","maxFormatted"],["class","mt-3",4,"ngIf"],[1,"mt-3"]];},template:function(o,e){o&1&&(_(0,"div",2)(1,"div")(2,"div",3),p(3,0),u(),Q(4,"my-progress-bar",4),S(5,"bytes"),u(),f(6,V,5,8,"div",5),u()),o&2&&(n(4),d("label",e.labelQuota())("max",(e.user==null?null:e.user.videoQuota)||0)("value",e.userVideoQuotaUsed)("valueFormatted",v(5,6,e.userVideoQuotaUsed,1))("maxFormatted",e.userVideoQuota),n(2),d("ngIf",e.hasDailyQuota()));},dependencies:[E,r,U],encapsulation:2}));let a=i;return a;})();export{$ as a};/**i18n:4ea3d52b0fe89d1d8e6fff59c182aeadbd7786f17ffe9a1efa1c7ed627997eaf*///# sourceMappingURL=chunk-PBZGDEKD.js.map