1"use strict";(self.webpackChunkdayfox_frontend=self.webpackChunkdayfox_frontend||[]).push([[578],{2578:(dn,$,r)=>{r.r($),r.d($,{UserAccountModule:()=>L});var N=r(7750),A=r(9968),le=r(6591),ue=r(4925),U=r(2419),c=r(4006),W=r(529),T=r(5698),m=(()=>{return(i=m||(m={})).NEWSLETTER="newsletter",i.PUBLISHED_TRACK_COLLECTIONS="published_track_collections",i.GOODIES_NEWSLETTER="goodies_newsletter",m;var i})(),h=(()=>((h||(h={})).MAIL="email",h))(),v=r(5812),pe=r(3925),e=r(4650),b=r(8015),k=r(3181),q=r(3392),F=r(5146);class S extends F.s{constructor(){super(...arguments),this.endpoint="/personal/notification-settings"}getAll(){return this.http.get(this.endpoint)}create(n){return this.http.post(this.endpoint,n)}get(n){return this.http.get(this.endpoint+"/"+n)}update(n,t){return this.http.put(this.endpoint+"/"+n,t)}delete(n){return this.http.delete(this.endpoint+"/"+n)}}S.\u0275fac=function(){let i;return function(t){return(i||(i=e.n5z(S)))(t||S)}}(),S.\u0275prov=e.Yz7({token:S,factory:S.\u0275fac,providedIn:"root"});var Z=r(3009),X=r(2974),z=r(7812),de=r(996),D=r(5631),x=r(9383);const _e=function(){return["login","password-change"]},Ae=function(i){return{m:i}},Te=function(i){return{outlets:i}},he=function(i){return["",i]};class R extends pe.y{get newsNotificationSettingEnabled(){const n=this.getNotificationSettingByEvent(m.NEWSLETTER);return!(!n||!n.channels.includes(h.MAIL))}get tracksNotificationSettingEnabled(){const n=this.getNotificationSettingByEvent(m.PUBLISHED_TRACK_COLLECTIONS);return!(!n||!n.channels.includes(h.MAIL))}get goodiesNotificationSettingEnabled(){const n=this.getNotificationSettingByEvent(m.GOODIES_NEWSLETTER);return!(!n||!n.channels.includes(h.MAIL))}get userImageUrl(){return this.user&&this.user.image_url?this.user.converted_image_url?this.user.converted_image_url:this.user.image_url:"/assets/images/user_image_upload_dropzone.webp"}ngOnInit(){this.analyticsService.trackPageView(v.Gy.ACCOUNT),super.ngOnInit(),this.user=this.userSessionService.user$.getValue(),this.loadProfileImage(),this.loadNotificationSettings(),this.user&&(this.form.patchValue(this.user),this.cdr.markForCheck())}submit(){this.form.markAllAsTouched(),this.form.updateValueAndValidity(),this.http.put("/auth/user",this.form.value).subscribe({next:t=>{this.updateSuccess=!0,this.user=t.data,this.userSessionService.handleUserUpdate(t.data),this.form.patchValue(this.user),this.cdr.markForCheck()},error:t=>{this.updateSuccess=!1,t instanceof W.UA&&(this.form.markAllAsTouched(),this.form.updateValueAndValidity({onlySelf:!1,emitEvent:!0}),this.formErrorService.mapErrorToForm(this.form,t),this.cdr.markForCheck())}})}fileInputChanged(n){n?.target?.files&&n.target.files.length>0?this.uploadUserImage(n.target.files[0]):this.log.error("No Input File found")}fileDropped(n){n&&n.length>0?this.uploadUserImage(n[0]):this.log.error("No Dropped File found")}uploadUserImage(n){const t=new FormData;t.set("image",n),this.http.post("/auth/user/image-upload",t).pipe((0,T.q)(1)).subscribe({next:o=>{this.user=o.data,this.userSessionService.handleUserUpdate(o.data),this.cdr.markForCheck()}})}createOrUpdateSetting(n,t){const o=this.getNotificationSettingByEvent(n);if(void 0!==o){const a=o.channels,s=a.indexOf(h.MAIL);-1!==s?a.splice(s,1):a.push(h.MAIL);const l={...o,channels:a};this.notificationSettingsService.update(o.id,l).pipe((0,T.q)(1)).subscribe({next:_=>{const g=this.notificationSettings.findIndex(w=>w.id===_.data.id);-1!==g&&(this.notificationSettings[g]=_.data)},error:_=>{t.target.checked=!t.target.checked},complete:()=>{this.cdr.markForCheck()}})}else this.notificationSettingsService.create({event:n,channels:[h.MAIL]}).pipe((0,T.q)(1)).subscribe({next:s=>{this.notificationSettings.push(s.data)},error:s=>{t.target.checked=!t.target.checked},complete:()=>{this.cdr.markForCheck()}})}loadProfileImage(){this.userSessionService.userImage().pipe((0,T.q)(1)).subscribe({next:n=>{this.user&&(this.user.image_url=n.image_url,this.user.converted_image_url=n.converted_image_url),this.cdr.markForCheck()}})}getNotificationSettingByEvent(n){return this.notificationSettings.find(t=>t.event===n)}loadNotificationSettings(){this.notificationSettingsLoading=!0,this.notificationSettingsService.getAll().pipe((0,T.q)(1)).subscribe({next:n=>{this.notificationSettings=n.data},complete:()=>{this.notificationSettingsLoading=!1,this.cdr.markForCheck()}})}constructor(n,t,o,a,s,l,_,g){super(n,a),this.cdr=n,this.log=t,this.fb=o,this.userSessionService=a,this.http=s,this.formErrorService=l,this.notificationSettingsService=_,this.analyticsService=g,this.updateSuccess=!1,this.form=this.fb.group({name:this.fb.control({value:"",disabled:!0}
1,[c.kI.required,c.kI.minLength(4)]),email:this.fb.control({value:"",disabled:!0},[c.kI.required,c.kI.email])},{updateOn:"change"}),this.notificationSettings=[],this.notificationSettingsLoading=!1,this.notificationSettingEvents=m,this.availableCredits=0,this.availableExtraCredits=0,this.USER_DASHBOARD_TABS=A.f1,this.USER_DASHBOARD_MY_ACCOUNT_TABS=A.L}}R.\u0275fac=function(n){return new(n||R)(e.Y36(e.sBO),e.Y36(b.Kf),e.Y36(c.qu),e.Y36(k.o),e.Y36(W.eN),e.Y36(q.J),e.Y36(S),e.Y36(Z.y))},R.\u0275cmp=e.Xpm({type:R,selectors:[["app-user-account-settings-page"]],features:[e.qOj],decls:68,vars:55,consts:[[3,"activeMainCategory","activeSubCategory"],[1,"container","py-5"],[1,"row","gx-3","gx-xl-5"],[1,"col-12","col-lg-7","col-xl-6"],[1,"user-info-container"],[1,"row","user-info-container-item"],[1,"col-12","mb-3"],[1,"h3","text-uppercase"],[1,"col-12","col-md-6","text-center"],["appDnd","",1,"user-image-upload-dropzone","mb-2",3,"fileDropped"],[3,"imageError","src","alt"],["type","file","id","fileDropRef",1,"pointer",3,"change"],["fileDropRef",""],[1,"text-center"],[1,"fw-medium","mb-2"],[1,"col-12","col-md-6"],[3,"formGroup"],[1,""],[1,"py-2"],["autocomplete","text","name","name","type","text",1,"py-2",3,"formControl","label","large","readonly","customInputGroup"],["autocomplete","email","name","email","type","email",1,"py-2",3,"formControl","label","large","readonly","customInputGroup"],[1,"link-primary","text-decoration-none","fw-bold","pointer",3,"routerLink"],[1,"col-12","mt-5"],[1,"row"],[1,"col-12","col-sm-7","pe-sm-4","pb-sm-0","pb-3"],[1,"text-muted","mb-0","fw-medium"],[1,"col-8","offset-2","offset-sm-0","col-sm-5"],[1,"d-flex","align-items-center","justify-content-between","mb-3"],[1,"h5","fw-medium","mb-0"],[1,"mail-setting-checkbox-container"],["id","newsletter-setting","type","checkbox",1,"d-none","opacity-0","visually-hidden","invisible",3,"checked","click"],["for","newsletter-setting",1,"mail-setting-sl
1ider"],[1,"mail-setting-slider-btn"],["id","new-tracks-setting","type","checkbox",1,"d-none","opacity-0","visually-hidden","invisible",3,"checked","click"],["for","new-tracks-setting",1,"mail-setting-slider"],[1,"d-flex","align-items-center","justify-content-between"],["id","goodies-setting","type","checkbox",1,"d-none","opacity-0","visually-hidden","invisible",3,"checked","click"],["for","goodies-setting",1,"mail-setting-slider"]],template:function(n,t){1&n&&(e._UZ(0,"app-logged-in-navbar",0),e.TgZ(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6)(7,"h6",7),e._uU(8),e.ALo(9,"translate"),e.qZA()(),e.TgZ(10,"div",8)(11,"div",9),e.NdJ("fileDropped",function(a){return t.fileDropped(a)}),e._UZ(12,"img",10),e.TgZ(13,"input",11,12),e.NdJ("change",function(a){return t.fileInputChanged(a)}),e.qZA()(),e.TgZ(15,"div",13)(16,"p",14),e._uU(17),e.ALo(18,"translate"),e.ALo(19,"translate"),e.qZA()()(),e.TgZ(20,"div",15)(21,"form",16)(22,"div",17)(23,"div",18),e._UZ(24,"app-form-group",19),e.ALo(25,"translate"),e.qZA(),e.TgZ(26,"div",18),e._UZ(27,"app-form-group",20),e.ALo(28,"translate"),e.qZA()()()()(),e._UZ(29,"hr"),e.TgZ(30,"div",5)(31,"div",8)(32,"a",21),e._uU(33," Change Password "),e.qZA()(),e.TgZ(34,"div",22)(35,"div",23)(36,"div",24)(37,"h6",7),e._uU(38),e.ALo(39,"translate"),e.qZA(),e.TgZ(40,"p",25),e._uU(41),e.ALo(42,"translate"),e.qZA()(),e.TgZ(43,"div",26)(44,"div",27)(45,"span",28),e._uU(46),e.ALo(47,"translate"),e.qZA(),e.TgZ(48,"div",29)(49,"input",30),e.NdJ("click",function(a){return t.createOrUpdateSetting(t.notificationSettingEvents.NEWSLETTER,a)}),e.qZA(),e.TgZ(50,"label",31),e._UZ(51,"div",32),e.qZA()()(),e.TgZ(52,"div",27)(53,"span",28),e._uU(54),e.ALo(55,"translate"),e.qZA(),e.TgZ(56,"div",29)(57,"input",33),e.NdJ("click",function(a){return t.createOrUpdateSetting(t.notificationSettingEvents.PUBLISHED_TRACK_COLLECTIONS,a)}),e.qZA(),e.TgZ(58,"label",34),e._UZ(59,"div",32),e.qZA()()(),e.TgZ(60,"div",35)(61,"span",28),e._uU(62),e.ALo(63,"translate"),e.qZA(),e.TgZ(64,"div",29)(65,"input",36),e.NdJ("click",function(a){return t.createOrUpdateSetting(t.notificationSettingEvents.GOODIES_NEWSLETTER,a)}),e.qZA(),e.TgZ(66,"label",37),e._UZ(67,"div",32),e.qZA()()()()()()()()()()()),2&n&&(e.Q6J("activeMainCategory",t.USER_DASHBOARD_TABS.MY_ACCOUNT)("activeSubCategory",t.USER_DASHBOARD_MY_ACCOUNT_TABS.SETTINGS),e.xp6(8),e.hij(" ",e.lcZ(9,28,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.TITLE")," "),e.xp6(4),e.s9C("src",t.userImageUrl,e.LSH),e.s9C("alt",null==t.user?null:t.user.name),e.Q6J("imageError","/assets/images/user_image_upload_dropzone.webp"),e.xp6(5),e.AsE(" ",e.lcZ(18,30,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.IMAGE_UPLOAD.MIN_DIMENSION")," (",e.lcZ(19,32,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.IMAGE_UPLOAD.MAX_SIZE"),") "),e.xp6(4),e.Q6J("formGroup",t.form),e.xp6(3),e.s9C("label",e.lcZ(25,34,"STATIC_PAGES.REGISTER.FORM.FIELDS.NAME")),e.Q6J("formControl",t.form.get("name"))("large",!1)("readonly",!0)("customInputGroup",!0),e.xp6(3),e.s9C("label",e.lcZ(28,36,"STATIC_PAGES.REGISTER.FORM.FIELDS.EMAIL")),e.Q6J("formControl",t.form.get("email"))("large",!1)("readonly",!0)("customInputGroup",!0),e.xp6(5),e.Q6J("routerLink",e.VKq(53,he,e.VKq(51,Te,e.VKq(49,Ae,e.DdM(48,_e))))),e.xp6(6),e.hij(" ",e.lcZ(39,38,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.EMAIL_SETTINGS.TITLE")," "),e.xp6(3),e.hij(" ",e.lcZ(42,40,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.EMAIL_SETTINGS.CONTENT")," "),e.xp6(5),e.hij("",e.lcZ(47,42,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.EMAIL_SETTINGS.NEWS"),":"),e.xp6(3),e.Q6J("checked",t.newsNotificationSettingEnabled),e.xp6(5),e.hij("",e.lcZ(55,44,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.EMAIL_SETTINGS.NEW_TRACKS"),":"),e.xp6(3),e.Q6J("checked",t.tracksNotificationSettingEnabled),e.xp6(5),e.hij("",e.lcZ(63,46,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.ACCOUNT_SETTINGS.CONTENT.USER_INFO.EMAIL_SETTINGS.GOODIES"),":"),e.xp6(3),e.Q6J("checked",t.goodiesNotificationSettingEnabled))},dependencies:[N.rH,c._Y,c.JJ,c.JL,c.oH,c.sg,X.H,z.h,de.V,D.w,x.X$],encapsulation:2,changeDetection:0});var Ce=r(4986),ge=r(7272),Ne=r(4482),me=r(5403),Se=r(5032),Oe=r(9718),fe=r(5577);function ee(i,n){return n?t=>(0,ge.z)(n.pipe((0,T.q)(1),function Ee(){return(0,Ne.e)((i,n)=>{i.subscribe(new me.Q(n,Se.Z))})}()),t.pipe(ee(i))):(0,fe.z)((t,o)=>i(t,o).pipe((0,T.q)(1),(0,Oe.h)(t)))}var Ue=r(5963),be=r(9646),Ze=r(8372),te=r(3900),ne=r(1998),J=r(953),I=r(833);function De(i,n){(0,I.Z)(2,arguments);var t=(0,J.Z)(i),o=(0,ne.Z)(n);if(isNaN(o))return new Date(NaN);if(!o)return t;var a=t.getDate(),s=new Date(t.getTime());s.setMonth(t.getMonth()+o+1,0);var l=s.getDate();return a>=l?s:(t.setFullYear(s.getFullYear(),s.getMonth(),a),t)}var C=(()=>{return(i=C||(C={})).NEW="new",i.IN_PROGRESS="in_progress",i.ADDED="added",i.ADDING_FAILED="adding_failed",i.REMOVED="removed",i.REMOVING_FAILED="removing_failed",C;var i})(),u=(()=>{return(i=u||(u={})).VIDEO="video",i.CHANNEL="channel",i.TWITCH_CHANNEL="twitch_channel",i.INSTAGRAM_CHANNEL="instagram_channel",i.FACEBOOK_CHANNEL="facebook_channel",i.TIK_TOK_CHANNEL="tik_tok_channel",i.EXTERNAL_PODCAST="external_podcast_url",u;var i})(),d=r(6714);class E extends F.s{constructor(){super(...arguments),this.endpoint="/allowlist/channels"}getAll(n=1,t=10){return this.http.get(this.endpoint+"?page="+n+"&perPage="+t)}createYoutubeChannel(n,t,o){return this.http.post(this.endpoint+"/youtube",{url:n,channel_name:t,media_url:o})}createOtherChannel(n,t){return this.http.post(this.endpoint+"/other",{type:n,url:t})}updateOtherChannel(n){return this.http.put(this.endpoint+"/other/"+n.id,n)}updateYoutubeChannel(n,t,o,a){return this.http.put(this.endpoint+"/youtube/"+n,{url:t,channel_name:o,media_url:a??null})}get(n){return this.http.get(this.endpoint+"/"+n)}search(n){return this.http.get(this.endpoint+"/search?s="+n).pipe((0,T.q)(1))}removeYoutubeChannel(n){return this.http.delete(this.endpoint+"/youtube/"+n+"/remove")}}
1E.\u0275fac=function(){let i;return function(t){return(i||(i=e.n5z(E)))(t||E)}}(),E.\u0275prov=e.Yz7({token:E,factory:E.\u0275fac,providedIn:"root"});var Le=r(388),ie=r(4693),oe=r(9900),p=r(6895),G=r(137),Q=r(9245),V=r(7784);const Re=["limitReachedModal"];function Ie(i,n){1&i&&e._UZ(0,"app-only-for-member-blocker")}function He(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",65),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4).index,s=e.oxw(2),l=e.MAs(84),_=e.MAs(88);return e.KtG(s.openDisconnectModal(l,_,a))}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.RETRY_DISCONNECT")," "))}function ye(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",66),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4).index,s=e.oxw(2);return e.KtG(s.retryConnectYTChannel(a))}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.RETRY_CONNECT")," "))}function Ye(i,n){if(1&i&&(e.TgZ(0,"ul",61)(1,"li",62),e.YNc(2,He,3,3,"button",63),e.YNc(3,ye,3,3,"button",64),e.qZA()()),2&i){const t=e.oxw(3).$implicit,o=e.oxw(2);e.xp6(2),e.Q6J("ngIf",t.model.status===o.channelStates.REMOVING_FAILED),e.xp6(1),e.Q6J("ngIf",t.model.status===o.channelStates.ADDING_FAILED)}}function Pe(i,n){1&i&&(e.TgZ(0,"div",57)(1,"button",58)(2,"span",8),e._uU(3),e.ALo(4,"translate"),e.qZA(),e._UZ(5,"i",59),e.qZA(),e.YNc(6,Ye,4,2,"ul",60),e.qZA()),2&i&&(e.xp6(3),e.Oqu(e.lcZ(4,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.ERROR")))}function Me(i,n){1&i&&(e.TgZ(0,"div",67)(1,"div",68),e._UZ(2,"div")(3,"div")(4,"div")(5,"div"),e.qZA()())}function Be(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"ul",75)(1,"li",62)(2,"button",76),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3).index,s=e.oxw(2),l=e.MAs(84),_=e.MAs(88);return e.KtG(s.openDisconnectModal(l,_,a))}
1),e._uU(3),e.ALo(4,"translate"),e._UZ(5,"i",77),e.qZA()()()}2&i&&(e.xp6(3),e.hij(" ",e.lcZ(4,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.DISCONNECT")," "))}function we(i,n){1&i&&(e.TgZ(0,"div",69)(1,"button",70)(2,"span",8),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"span",71),e._UZ(6,"i",72)(7,"i",73),e.qZA()(),e.YNc(8,Be,6,3,"ul",74),e.qZA()),2&i&&(e.xp6(3),e.Oqu(e.lcZ(4,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.SUCCESS")))}function ke(i,n){if(1&i&&(e.TgZ(0,"div",4)(1,"div",43)(2,"div",44)(3,"label",45),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"div",46)(7,"div",47),e._UZ(8,"img",48),e.qZA(),e.TgZ(9,"div",49)(10,"h5"),e._uU(11),e.qZA()(),e.TgZ(12,"div",50),e.YNc(13,Pe,7,3,"div",51),e.YNc(14,Me,6,0,"div",52),e.YNc(15,we,9,3,"div",53),e.qZA()()(),e.TgZ(16,"div",54)(17,"div",55),e._UZ(18,"i",56),e.qZA()()()()),2&i){const t=e.oxw().$implicit,o=e.oxw(2);let a;e.xp6(4),e.Oqu(e.lcZ(5,8,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.TITLE")),e.xp6(4),e.s9C("imageError",null!==(a=null==t.newChannel?null:t.newChannel.thumbnail)&&void 0!==a?a:null),e.s9C("src",t.model.channel_icon_url,e.LSH),e.s9C("alt",t.model.channel_name),e.xp6(3),e.Oqu(t.model.channel_name),e.xp6(2),e.Q6J("ngIf",t.model.status===o.channelStates.REMOVING_FAILED||t.model.status===o.channelStates.ADDING_FAILED),e.xp6(1),e.Q6J("ngIf",t.model.status===o.channelStates.IN_PROGRESS),e.xp6(1),e.Q6J("ngIf",t.model.status===o.channelStates.ADDED&&o.userCanChangeChannel)}}function qe(i,n){1&i&&(e.TgZ(0,"label",13),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.TITLE")))}function Fe(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",84),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3).index,s=e.oxw(2);return e.KtG(s.updateYoutubeChannel(a))}),e.TgZ(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA()()}2&i&&(e.xp6(2),e.Oqu(e.lcZ(3,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.CONNECT")))}function Je(i,n){if(1&i&&(e.TgZ(0,"div",7)(1,"div",80)(2,"div",47),e._UZ(3,"img",81),e.qZA(),e.TgZ(4,"div",49)(5,"h5"),e._uU(6),e.qZA()(),e.TgZ(7,"div",82),e.YNc(8,Fe,4,3,"button",83),e.qZA()()()),2&i){const t=e.oxw(2).$implicit,o=e.oxw(2);e.xp6(3),e.s9C("src",t.newChannel.thumbnail,e.LSH),e.s9C("alt",t.newChannel.title),e.xp6(3),e.Oqu(t.newChannel.title),e.xp6(2),e.Q6J("ngIf",!o.connecting)}}const Ge=function(i,n){return{ytChannel:i,index:n}};function Qe(i,n){if(1&i&&(e.TgZ(0,"div",4)(1,"div",7),e.YNc(2,qe,3,3,"label",78),e.TgZ(3,"div",14),e.GkF(4,79),e.qZA()(),e.YNc(5,Je,9,4,"div",11),e.qZA()),2&i){const t=e.oxw(),o=t.index,a=t.$implicit;e.oxw(2);const s=e.MAs(92);e.xp6(2),e.Q6J("ngIf",0===o),e.xp6(2),e.Q6J("ngTemplateOutlet",s)("ngTemplateOutletContext",e.WLB(4,Ge,a,o)),e.xp6(1),e.Q6J("ngIf",a.newChannel)}}function Ve(i,n){if(1&i&&(e.TgZ(0,"div",41),e.YNc(1,ke,19,10,"div",42),e.YNc(2,Qe,6,7,"div",42),e.qZA()),2&i){const t=n.$implicit,o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.model.status!==o.channelStates.REMOVED),e.xp6(1),e.Q6J("ngIf",t.model.status===o.channelStates.REMOVED)}}function Ke(i,n){if(1&i&&(e.TgZ(0,"div",7)(1,"div",4),e.YNc(2,Ve,3,2,"div",40),e.qZA()()),2&i){const t=e.oxw();e.xp6(2),e.Q6J("ngForOf",t.youtubeChannels)}}function je(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",89),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw(2);e.xp6(2),e.Oqu(t.channelUrlInput.getError("serverError"))}}function $e(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",84),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.addBaseYTChannel())}),e.TgZ(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA()()}2&i&&(e.xp6(2),e.Oqu(e.lcZ(3,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.CONNECT")))}function We(i,n){1&i&&(e.TgZ(0,"div",67)(1,"div",68),e._UZ(2,"div")(3,"div")(4,"div")(5,"div"),e.qZA()())}function Xe(i,n){if(1&i&&(e.TgZ(0,"div",7)(1,"div",80)(2,"div",47),e._UZ(3,"img",81),e.qZA(),e.TgZ(4,"div",49)(5,"h5"),e._uU(6),e.qZA()(),e.TgZ(7,"div",82),e.YNc(8,$e,4,3,"button",83),e.YNc(9,We,6,0,"div",52),e.qZA()()()),2&i){const t=e.oxw(2);e.xp6(3),e.s9C("src",t.selectedBaseYTChannel.thumbnail,e.LSH),e.s9C("alt",t.selectedBaseYTChannel.title),e.xp6(3),e.Oqu(t.selectedBaseYTChannel.title),e.xp6(2),e.Q6J("ngIf",!t.connecting),e.xp6(1),e.Q6J("ngIf",t.connecting)}}
1function ze(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"div",7)(1,"div",4)(2,"div",7)(3,"label",13),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"div",14)(7,"input",85,86),e.NdJ("input",function(){e.CHM(t);const a=e.MAs(8),s=e.oxw();return e.KtG(s.searchChannels(a.value))})("focusin",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.toggleTypeahead(!0))})("focusout",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.toggleTypeahead(!1))}),e.ALo(9,"translate"),e.qZA(),e.GkF(10,87),e.TgZ(11,"div",88),e._UZ(12,"i",56),e.qZA()(),e.YNc(13,je,3,1,"ng-container",2),e.qZA(),e.YNc(14,Xe,10,5,"div",11),e.qZA()()}if(2&i){const t=e.oxw(),o=e.MAs(90);e.xp6(4),e.Oqu(e.lcZ(5,5,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.TITLE")),e.xp6(3),e.s9C("placeholder",e.lcZ(9,7,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.PLACEHOLDER")),e.xp6(3),e.Q6J("ngTemplateOutlet",o),e.xp6(3),e.Q6J("ngIf",!!t.channelUrlInput.getError("serverError")),e.xp6(1),e.Q6J("ngIf",t.selectedBaseYTChannel)}}function et(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",90),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw();e.xp6(2),e.Oqu(t.otherChannels[t.channelTypes.INSTAGRAM_CHANNEL].form.getError("serverError"))}}function tt(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",90),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw();e.xp6(2),e.Oqu(t.otherChannels[t.channelTypes.FACEBOOK_CHANNEL].form.getError("serverError"))}}function nt(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",90),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw();e.xp6(2),e.Oqu(t.otherChannels[t.channelTypes.TIK_TOK_CHANNEL].form.getError("serverError"))}}function it(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",90),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw();e.xp6(2),e.Oqu(t.otherChannels[t.channelTypes.EXTERNAL_PODCAST].form.getError("serverError"))}}function ot(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",90),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw();e.xp6(2),e.Oqu(t.otherChannels[t.channelTypes.TWITCH_CHANNEL].form.getError("serverError"))}}function at(i,n){1&i&&e._UZ(0,"i",99)}function st(i,n){1&i&&e._UZ(0,"i",100)}function rt(i,n){if(1&i&&(e.TgZ(0,"accordion-group",91,92)(2,"button",93)(3,"div",94),e._uU(4),e.qZA(),e.TgZ(5,"span",95),e.YNc(6,at,1,0,"i",96),e.YNc(7,st,1,0,"i",97),e.qZA()(),e._UZ(8,"div",98),e.qZA()),2&i){const t=n.$implicit,o=e.MAs(1);e.xp6(4),e.Oqu(t.HEADER),e.xp6(2),e.Q6J("ngIf",!o.isOpen),e.xp6(1),e.Q6J("ngIf",o.isOpen),e.xp6(1),e.Q6J("innerHTML",t.CONTENT,e.oJD)}}function ct(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"div",101)(1,"div",102)(2,"div",7),e._UZ(3,"img",103),e.qZA(),e.TgZ(4,"div",7)(5,"h5",104),e._uU(6),e.ALo(7,"translate"),e.qZA()(),e.TgZ(8,"div",105)(9,"button",106),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(null==a.disconnectModalRef?null:a.disconnectModalRef.hide())}),e._uU(10),e.ALo(11,"translate"),e.qZA()(),e.TgZ(12,"div",105)(13,"button",107),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.disconnectChannel())}),e._uU(14),e.ALo(15,"translate"),e.qZA()(),e.TgZ(16,"div",108)(17,"p",109),e._uU(18),e.ALo(19,"translate"),e.qZA(),e.TgZ(20,"p",110),e._uU(21),e.ALo(22,"translate"),e.qZA(),e.TgZ(23,"a",111),e._uU(24),e.ALo(25,"translate"),e.qZA()()()()}2&i&&(e.xp6(6),e.hij(" ",e.lcZ(7,6,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.DISCONNECT.CONFIRM.TITLE")," "),e.xp6(4),e.hij(" ",e.lcZ(11,8,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.DISCONNECT.CONFIRM.BUTTONS.DISMISS")," "),e.xp6(4),e.hij(" ",e.lcZ(15,10,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.DISCONNECT.CONFIRM.BUTTONS.CONFIRM")," "),e.xp6(4),e.hij(" ",e.lcZ(19,12,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.DISCONNECT.CONFIRM.FOOTNOTE.TITLE"),": "),e.xp6(3),e.hij(" ",e.lcZ(22,14,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.DISCONNECT.CONFIRM.FOOTNOTE.CONTENT")," "),e.xp6(3),e.Oqu(e.lcZ(25,16,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.DISCONNECT.CONFIRM.FOOTNOTE.MORE")))}function lt(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"div",112)(1,"div",102)(2,"div",7),e._UZ(3,"img",103),e.qZA(),e.TgZ(4,"div",7)(5,"h5",104),e._UZ(6,"span",98),e.ALo(7,"translate"),e.TgZ(8,"span"),e._uU(9),e.ALo(10,"date"),e.qZA()()(),e.TgZ(11,"div",105)(12,"button",113),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(null==a.limitReachedModalRef?null:a.limitReachedModalRef.hide())}),e._uU(13),e.ALo(14,"translate"),e.qZA()(),e.TgZ(15,"div",105)(16,"button",113),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(null==a.limitReachedModalRef?null:a.limitReachedModalRef.hide())}),e._uU(17),e.ALo(18,"translate"),e.qZA()()()()}if(2&i){const t=e.oxw();e.xp6(6),e.Q6J("innerHTML",e.lcZ(7,4,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.NO_CHANGES.TITLE"),e.oJD),e.xp6(3),e.hij(" ",e.xi3(10,6,t.nextChangeDate,"dd.MM.yyyy"),"."),e.xp6(4),e.hij(" ",e.lcZ(14,9,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.NO_CHANGES.EXTRA_BUTTON")," "),e.xp6(4),e.hij(" ",e.lcZ(18,11,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.NO_CHANGES.SUPPORT_BUTTON")," ")}}function ut(i,n){}
1function pt(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",116),e.NdJ("click",function(a){const l=e.CHM(t).$implicit,_=e.oxw(3);return e.KtG(_.selectBaseYTChannel(l,a))}),e.TgZ(2,"div",47),e._UZ(3,"img",117),e.qZA(),e.TgZ(4,"div",49)(5,"h5"),e._uU(6),e.qZA()()(),e.BQk()}if(2&i){const t=n.$implicit;e.xp6(3),e.s9C("src",t.thumbnail,e.LSH),e.xp6(3),e.Oqu(t.title)}}function dt(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",114),e.YNc(2,pt,7,2,"ng-container",115),e.qZA(),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.ekj("d-block",t.showBaseYTChannelTypeahead),e.xp6(1),e.Q6J("ngForOf",t.channelSearchResults)}}function _t(i,n){if(1&i&&e.YNc(0,dt,3,3,"ng-container",2),2&i){const t=e.oxw();e.Q6J("ngIf",t.channelSearchResults&&t.channelSearchResults.length>0)}}function At(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",116),e.NdJ("click",function(){const s=e.CHM(t).$implicit,l=e.oxw(2).index,_=e.oxw();return e.KtG(_.selectNewChannel(s,l))}),e.TgZ(2,"div",47),e._UZ(3,"img",117),e.qZA(),e.TgZ(4,"div",49)(5,"h5"),e._uU(6),e.qZA()()(),e.BQk()}if(2&i){const t=n.$implicit;e.xp6(3),e.s9C("src",t.thumbnail,e.LSH),e.xp6(3),e.Oqu(t.title)}}function Tt(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",114),e.YNc(2,At,7,2,"ng-container",115),e.qZA(),e.BQk()),2&i){const t=e.oxw().index,o=e.oxw();e.xp6(1),e.ekj("d-block",o.youtubeChannels[t].showTypeahead),e.xp6(1),e.Q6J("ngForOf",o.channelSearchResults)}}function ht(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"input",118,119),e.NdJ("input",function(){e.CHM(t);const a=e.MAs(1),s=e.oxw();return e.KtG(s.searchChannels(a.value))})("focusin",function(){const s=e.CHM(t).index,l=e.oxw();return e.KtG(l.toggleTypeahead(!0,s))})("focusout",function(){const s=e.CHM(t).index,l=e.oxw();return e.KtG(l.toggleTypeahead(!1,s))}),e.ALo(2,"translate"),e.qZA(),e.YNc(3,Tt,3,3,"ng-container",2),e.TgZ(4,"div",88),e._UZ(5,"i",56),e.qZA()}if(2&i){const t=e.oxw();e.s9C("placeholder",e.lcZ(2,2,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.YOUTUBE.PLACEHOLDER")),e.xp6(3),e.Q6J("ngIf",t.channelSearchResults&&t.channelSearchResults.length>0)}}function Ct(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"div",120)(1,"div",121)(2,"h1",122),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",123)(6,"div",4)(7,"div",124)(8,"p",125),e._uU(9),e.ALo(10,"translate"),e.qZA(),e.TgZ(11,"p",126),e._uU(12),e.ALo(13,"number"),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"p",127),e._uU(16),e.ALo(17,"number"),e.ALo(18,"translate"),e.qZA()(),e.TgZ(19,"div",124)(20,"p",127),e._uU(21),e.ALo(22,"translate"),e.qZA()()()(),e.TgZ(23,"div",128)(24,"div",4)(25,"div",129)(26,"button",130),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.buyAddChannel())}),e._UZ(27,"i",131),e._uU(28),e.ALo(29,"translate"),e.qZA()()()()()}if(2&i){const t=e.oxw();e.xp6(3),e.hij(" ",e.lcZ(4,8,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.ADD_ADDITIONAL.TITLE")," "),e.xp6(6),e.hij(" ",e.lcZ(10,10,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.ADD_ADDITIONAL.SUBTITLE")," "),e.xp6(3),e.AsE(" $",e.xi3(13,12,t.addChannelProductPerMonthGross/100,"1.2-2"),"/",e.lcZ(14,15,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.ADD_ADDITIONAL.PER_MONTH")," "),e.xp6(4),e.AsE(" $",e.xi3(17,17,t.addChannelProdcutTotalGross/100,"1.2-2")," ",e.lcZ(18,20,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.ADD_ADDITIONAL.BILLED")," "),e.xp6(5),e.hij(" ",e.lcZ(22,22,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.ADD_ADDITIONAL.CONTENT")," "),e.xp6(7),e.hij(" ",e.lcZ(29,24,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.ADD_ADDITIONAL.BUY_BTN")," ")}}class H{get nextChangeDate(){const n=new Date;return n.getUTCMonth()>=6?function xe(i,n){(0,I.Z)(2,arguments);var t=(0,ne.Z)(n);return De(i,12*t)}(new Date(n.getUTCFullYear()+"-01-01T00:00:00.000Z"),1):new Date(n.getUTCFullYear()+"-07-01T00:00:00.000Z")}ngOnInit(){this.analyticsService.trackPageView(v.Gy.ACCOUNT),this.userSessionService.hasActivePlan$.value&&(this.loadChannels(),this.enableFormWatcherForOtherChannels()),this.hasActivePlanSub$=this.userSessionService.hasActivePlan$.subscribe({next:n=>{this.hasActivePlan=n,this.hasActivePlan&&this.userSessionService.getMainSubscription(),this.cdr.markForCheck()}}),this.userMainPlanSub$=this.userSessionService.mainPlan$.subscribe({next:n=>{this.userCanChangeChannel=void 0!==n&&n.frequency!==d.O.MONTHLY,this.cdr.markForCheck()}}),this.cdr.markForCheck()}ngOnDestroy(){this.channelUrlInputChanges$?.unsubscribe(),this.disableFormWatchersForOtherChannels(),this.hasActivePlanSub$?.unsubscribe(),this.userMainPlanSub$?.unsubscribe(),this.cdr.markForCheck()}loadChannels(){this.allowlistChannelService.getAll().subscribe({next:n=>{this.refreshChannelsViaIndexList(n.data),this.cdr.markForCheck()},error:n=>{this.log.error(JSON.stringify(n))}})}searchChannels(n){clearTimeout(this.queuedSearch),this.queuedSearch=setTimeout(()=>{this.allowlistChannelService.search(n??this.channelUrlInput.value).subscribe({next:t=>{this.channelSearchResults=t&&t.result?.length>0?t.result.slice(0,10):[],this.cdr.detectChanges()}})},700)}addBaseYTChannel(){this.connecting=!0,this.selectedBaseYTChannel&&this.allowlistChannelService.createYoutubeChannel(this.generateYoutubeChannelUrlFromId(this.selectedBaseYTChannel.channelId),this.selectedBaseYTChannel.title,this.selectedBaseYTChannel.thumbnail).pipe((0,T.q)(1)).subscribe({next:n=>{const t=this.youtubeChannels.push({model:n.data,form:new c.NI(""),sub:null,showTypeahead:!1,newChannel:this.selectedBaseYTChannel});this.connecting=!1,this.selectedBaseYTChannel=void 0,this.cdr.markForCheck(),this.refreshYoutubeChannel(n.data.id,t-1)}})}selectBaseYTChannel(n,t){t.preventDefault(),this.selectedBaseYTChannel=n,this.cdr.markForCheck()}
1openDisconnectModal(n,t,o){this.disconnectModalRef=this.modalService.show(n),this.selectedForDisconnectChannelIndex=o}disconnectChannel(){if(void 0===this.selectedForDisconnectChannelIndex)return;this.disconnectModalRef?.hide();const n=this.selectedForDisconnectChannelIndex;this.allowlistChannelService.removeYoutubeChannel(this.youtubeChannels[n].model.id).pipe((0,T.q)(1)).subscribe({next:t=>{this.youtubeChannels[n].newChannel=void 0,this.youtubeChannels[n].model=t.data,t.data.status===C.IN_PROGRESS&&this.refreshYoutubeChannel(t.data.id,n),this.cdr.markForCheck()}})}selectNewChannel(n,t){this.youtubeChannels[t].newChannel=n,this.cdr.markForCheck()}updateYoutubeChannel(n){this.youtubeChannels[n].model?.id&&this.youtubeChannels[n].newChannel&&this.allowlistChannelService.updateYoutubeChannel(this.youtubeChannels[n].model.id,this.generateYoutubeChannelUrlFromId(this.youtubeChannels[n].newChannel.channelId),this.youtubeChannels[n].newChannel.title,this.youtubeChannels[n].newChannel.thumbnail).pipe((0,T.q)(1)).subscribe({next:t=>{this.youtubeChannels[n].model=t.data,null===t.data.channel_icon_url&&(this.youtubeChannels[n].model.channel_icon_url=this.youtubeChannels[n].newChannel.thumbnail),t.data.status===C.IN_PROGRESS&&this.refreshYoutubeChannel(t.data.id,n),this.cdr.markForCheck()},error:t=>{423===t.status&&(this.limitReachedModalRef=this.modalService.show(this.limitReachedModal,{class:"channel-change-limit-reached-modal-container"}),this.cdr.markForCheck())}})}retryConnectYTChannel(n){this.youtubeChannels[n].model?.id&&this.allowlistChannelService.updateYoutubeChannel(this.youtubeChannels[n].model.id,this.youtubeChannels[n].model.url,this.youtubeChannels[n].model.channel_name).pipe((0,T.q)(1)).subscribe({next:t=>{this.youtubeChannels[n].model=t.data,null===t.data.channel_icon_url&&(this.youtubeChannels[n].model.channel_icon_url=this.youtubeChannels[n].newChannel.thumbnail),t.data.status===C.IN_PROGRESS&&this.refreshYoutubeChannel(t.data.id,n),this.cdr.markForCheck()}})}toggleTypeahead(n,t){clearTimeout(this.toggleTypeaheadTimer),setTimeout(()=>{void 0!==t?this.youtubeChannels[t].showTypeahead=n:this.showBaseYTChannelTypeahead=n,this.cdr.markForCheck()},150)}refreshYoutubeChannel(n,t){this.allowlistChannelService.get(n).pipe((0,T.q)(1),function ve(i,n=Ce.z){const t=(0,Ue.H)(i,n);return ee(()=>t)}(5e3)).subscribe({next:o=>{this.youtubeChannels[t].model=o.data,this.cdr.markForCheck(),o.data.status===C.IN_PROGRESS&&this.refreshYoutubeChannel(n,t)}})}createOrUpdateOtherChannel(n){(0,be.of)(n).pipe((0,te.w)(t=>t?.id?this.allowlistChannelService.updateOtherChannel(t):this.allowlistChannelService.createOtherChannel(n.type,n.url))).subscribe({next:t=>{this.otherChannels[t.data.type].model=t.data,this.otherChannels[t.data.type].form.patchValue(t.data.url,{emitEvent:!1}),this.otherChannels[t.data.type].success=!0,setTimeout(()=>{this.otherChannels[t.data.type].success&&(this.otherChannels[t.data.type].success=!1,this.cdr.markForCheck())},2e3),this.cdr.markForCheck()},error:t=>{this.otherChannels[n.type].form.setErrors(this.formErrorService.getValidationError("url",t),{emitEvent:!1}),this.otherChannels[n.type].success=!1,this.cdr.markForCheck()}})}showBuyAddChannelPopup(){this.productService.getChannels().pipe((0,T.q)(1)).subscribe({next:n=>{const t=n.data.filter(o=>o.frequency===d.O.MONTHLY);t[0]&&(this.addChannelProduct=t[0],this.addChannelProductPerMonthGross=this.addChannelProduct.price.gross,this.addChannelProdcutTotalGross=12*this.addChannelProduct.price.gross,this.cdr.markForCheck())}})}buyAddChannel(){this.addChannelProduct&&(this.cartService.clearSingleItemCart(),this.cartService.addChannel(this.addChannelProduct.id),this.router.navigateByUrl("/checkout"))}subscribeToOtherChannelForm(n){this.otherChannels[n].sub=this.otherChannels[n].form.valueChanges.pipe((0,Ze.b)(600)).subscribe({next:t=>{this.otherChannels[n].model.url=t,this.createOrUpdateOtherChannel(this.otherChannels[n].model),this.cdr.markForCheck()}})}enableFormWatcherForOtherChannels(){this.subscribeToOtherChannelForm(u.TWITCH_CHANNEL),this.subscribeToOtherChannelForm(u.INSTAGRAM_CHANNEL),this.subscribeToOtherChannelForm(u.FACEBOOK_CHANNEL),this.subscribeToOtherChannelForm(u.TIK_TOK_CHANNEL),this.subscribeToOtherChannelForm(u.EXTERNAL_PODCAST)}unsubscribeFromOtherChannelForm(n){this.otherChannels[n].sub&&this.otherChannels[n].sub.unsubscribe()}disableFormWatchersForOtherChannels(){this.unsubscribeFromOtherChannelForm(u.TWITCH_CHANNEL),this.unsubscribeFromOtherChannelForm(u.INSTAGRAM_CHANNEL),this.unsubscribeFromOtherChannelForm(u.FACEBOOK_CHANNEL),this.unsubscribeFromOtherChannelForm(u.TIK_TOK_CHANNEL),this.unsubscribeFromOtherChannelForm(u.EXTERNAL_PODCAST)}
1refreshChannelsViaIndexList(n){this.youtubeChannels=[],n.forEach(t=>{t.type===u.VIDEO||t.type===u.CHANNEL?t.type===u.CHANNEL&&this.youtubeChannels.push({model:t,form:new c.NI(""),sub:null,showTypeahead:!1}):(this.otherChannels[t.type].model=t,this.otherChannels[t.type].form.patchValue(t.url,{emitEvent:!1}))})}generateYoutubeChannelUrlFromId(n){return"https://youtube.com/channel/"+n}constructor(n,t,o,a,s,l,_,g,w,j){this.cdr=n,this.log=t,this.allowlistChannelService=o,this.formErrorService=a,this.modalService=s,this.userSessionService=l,this.productService=_,this.cartService=g,this.router=w,this.analyticsService=j,this.channelUrlInput=new c.NI("",[c.kI.required]),this.channels=[],this.total=0,this.perPage=0,this.totalPages=0,this.connecting=!1,this.channelStates=C,this.channelTypes=u,this.showBaseYTChannelTypeahead=!1,this.hasActivePlan=this.userSessionService.hasActivePlan$.getValue(),this.addChannelProdcutTotalGross=0,this.addChannelProductPerMonthGross=0,this.youtubeChannels=[],this.otherChannels={[u.TWITCH_CHANNEL]:{form:new c.NI,model:{type:u.TWITCH_CHANNEL,url:""},sub:null,success:!1},[u.INSTAGRAM_CHANNEL]:{form:new c.NI,model:{type:u.INSTAGRAM_CHANNEL,url:""},sub:null,success:!1},[u.FACEBOOK_CHANNEL]:{form:new c.NI,model:{type:u.FACEBOOK_CHANNEL,url:""},sub:null,success:!1},[u.TIK_TOK_CHANNEL]:{form:new c.NI,model:{type:u.TIK_TOK_CHANNEL,url:""},sub:null,success:!1},[u.EXTERNAL_PODCAST]:{form:new c.NI,model:{type:u.EXTERNAL_PODCAST,url:""},sub:null,success:!1}},this.userCanChangeChannel=!1,this.USER_DASHBOARD_TABS=A.f1,this.USER_DASHBOARD_MY_ACCOUNT_TABS=A.L}}H.\u0275fac=function(n){return new(n||H)(e.Y36(e.sBO),e.Y36(b.Kf),e.Y36(E),e.Y36(q.J),e.Y36(Le.tT),e.Y36(k.o),e.Y36(ie.M),e.Y36(oe.N),e.Y36(N.F0),e.Y36(Z.y))},H.\u0275cmp=e.Xpm({type:H,selectors:[["app-user-account-channels-page"]],viewQuery:function(n,t){if(1&n&&e.Gf(Re,5),2&n){let o;e.iGM(o=e.CRH())&&(t.limitReachedModal=o.first)}},decls:95,vars:69,consts:[[3,"activeMainCategory","activeSubCategory"],[1,"position-relative","mvh-70"],[4,"ngIf"],[1,"container","py-5"],[1,"row"],[1,"col-12","col-lg-6","pe-lg-4","mb-5"],[1,"channel-col-bg"],[1,"col-12"],[1,""],[1,"h3","text-uppercase","mb-1"],[1,"fw-bold"],["class","col-12",4,"ngIf"],[1,"col-12","pt-5"],["for","first-channel-url-input",1,"h5"],[1,"light-input-with-button","social-media-input","position-relative"],["id","instagram-channel-url","type","text",1,"light-input",3,"formControl","placeholder"],[1,"icon","instagram"],[1,"fab","fa-instagram"],["id","facebook-channel-url","type","text",1,"light-input",3,"formControl","placeholder"],[1,"icon","facebook"],[1,"fab","fa-facebook"],["id","tiktok-channel-url","type","text",1,"light-input",3,"formControl","placeholder"],[1,"icon","tiktok"],[1,"fab","fa-tiktok"],["id","podcast-channel-url","type","text",1,"light-input",3,"formControl","placeholder"],[1,"icon","podcast"],[1,"fa","fa-microphone"],["id","twitch-channel-url","type","text",1,"light-input",3,"formControl","placeholder"],[1,"icon","twitch"],[1,"fab","fa-twitch"],[1,"d-none","d-md-block","col-12","col-lg-6","ps-lg-4","mb-5"],[1,"h3","text-uppercase"],[1,"pt-4"],["panelClass","clear-accordion",4,"ngFor","ngForOf"],["disconnectConfirmModal",""],["limitReachedModal",""],["insufficientPlan",""],["searchTypeaheadFirstChannel",""],["removedYTChannelSearchBar",""],["buyAddChannelPopup",""],["class","col-12 pt-2 pb-3",4,"ngFor","ngForOf"],[1,"col-12","pt-2","pb-3"],["class","row",4,"ngIf"],[1,"col-12","social-media-input"],[1,"added-channel-preview-container"],[1,"h5"],[1,"added-channel-preview"],[1,"image"],[1,"img-fluid",3,"imageError","src","alt"],[1,"title"],[1,"conn\\ect"],["class","btn-group channel-error-dropdown","dropdown","",4,"ngIf"],["class","btn-channel-connecting",4,"ngIf"],["class","btn-group channel-connected-dropdown","dropdown","",4,"ngIf"],[1,"double-icon"],[1,"double-icon-item","youtube"],[1,"fab","fa-youtube"],["dropdown","",1,"btn-group","channel-error-dropdown"],["dropdownToggle","","type","button","aria-controls","dropdown-animated",1,"btn-clear","btn-channel-error","dropdown-toggle"],[1,"fas","fa-exclamation-triangle","ps-2"],["class","dropdown-menu btn-channel-error-dropdown","role","menu","aria-labelledby","button-animated",4,"dropdownMenu"],["role","menu","aria-labelledby","button-animated",1,"dropdown-menu","btn-channel-error-dropdown"],["role","menuitem"],["type","button","class","btn-clear btn-channel-retry-disconnect",3,"click",4,"ngIf"],["type","button","class","btn-clear btn-channel-retry-connect",3,"click",4,"ngIf"],["type","button",1,"btn-clear","btn-channel-retry-disconnect",3,"click"],["type","button",1,"btn-clear","btn-channel-retry-connect",3,"click"],[1,"btn-channel-connecting"],[1,"lds-ellipsis"],["dropdown","",1,"btn-group","channel-connected-dropdown"],["dropdownToggle","","type","button","aria-controls","dropdown-animated",1,"btn-clear","btn-channel-connected","dropdown-toggle"],[1,"fa-stack","fa-xs","align-bottom"],[1,"far","fa-circle","fa-stack-2x"],[1,"fas","fa-check","fa-stack-1x"],["class","dropdown-menu btn-channel-connected-dropdown","role","menu","aria-labelledby","button-animated",4,"dropdownMenu"],["role","menu","aria-labelledby","button-animated",1,"dropdown-menu","btn-channel-connected-dropdown"],["type","button",1,"btn-clear","btn-channel-disconnect",3,"click"],[1,"fas","fa-cut"],["class","h5","for","first-channel-url-input",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"add-channel-preview"],[1,"img-fluid",3,"src","alt"],[1,"connect"],["type","button","class","btn-clear btn-channel-connect",3,"click",4,"ngIf"],["type","button",1,"btn-clear","btn-channel-connect",3,"click"],["id","first-channel-url-input","type","text",1,"light-input","manual-typeahead",3,"placeholder","input","focusin","focusout"],["firstChannelInput",""],[3,"ngTemplateOutlet"],[1,"icon","youtube"],[1,"text-danger"],[1,"text-danger","pt-2"],["panelClass","clear-accordion"],["accordionPanelComponent",""],["accordion-heading","","type","button",1,"btn","text-body","fw-normal","px-0","justify-content-between","d-flex","w-100","shadow-none"],[1,"pull-left","float-left","text-start"],[1,"float-right","pull-right","text-end","ps-2"],["class","fa fa-chevron-down text-muted",4,"ngIf"],["class","fa fa-chevron-up text-muted",4,"ngIf"],[3,"innerHTML"],[1,"fa","fa-chevron-down","text-muted"],[1,"fa","fa-chevron-up","text-muted"],[1,"container-fluid","disconnect-channel-confirm-modal"],[1,"row","text-center","py-4"],["src","assets/images/fox_shocked.webp","alt","Fox shocked",1,"img-fluid","header-img"],[1,"h1","text-uppercase"],[1,"col-6","py-2"],["type","button",1,"btn-clear","dismiss-button",3,"click"],["type","button",1,"btn-clear","confirm-button",3,"click"],[1,"col-12","pt-2","fw-medium"],[1,"mb-0","text-underline"],[1,"mb-3"],["href","#",1,"link-dark","text-underline"],[1,"container-fluid","channel-change-limit-reached-modal"],["type","button",1,"btn-clear","next-step-button",3,"click"],[1,"manual-typeahead"],[4,"ngFor","ngForOf"],[1,"channel-search-item",3,"click"],[3,"src"],["type","text",1,"light-input","manual-typeahead",3,"placeholder","input","focusin","focusout"],["existingChannelSearchInput",""],[1,"buy-add-channel-popup-body"],[1,"header","pb-2"],[1,"h3","fw-medium","text-uppercase","mb-0"],[1,"content","py-2"],[1,"col-12","col-md-6","py-2"],[1,"text-primary","fw-light"],[1,"fw-medium","mb-1","text-uppercase"],[1,"fw-medium"],[1,"footer","pt-2"],[1,"col-12","col-md-6","offset-md-6"],[1,"btn","btn-primary","w-100","text-uppercase",3,"click"],[1,"fas","fa-shield-alt"]],template:function(n,t){1&n&&(e._UZ(0,"app-logged-in-navbar",0),e.TgZ(1,"div",1),e.YNc(2,Ie,1,0,"app-only-for-member-blocker",2),e.ALo(3,"async"),e.TgZ(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",4)(9,"div",7)(10,"div",8)(11,"h6",9),e._uU(12),e.ALo(13,"translate"),e.qZA(),e.TgZ(14,"p",10),e._uU(15),e.ALo(16,"translate"),e.qZA(),e.YNc(17,Ke,3,1,"div",11),e.YNc(18,ze,15,9,"div",11),e.TgZ(19,"div",12)(20,"div",4)(21,"label",13),e._uU(22),e.ALo(23,"translate"),e.qZA(),e.TgZ(24,"div",14),e._UZ(25,"input",15),e.ALo(26,"translate"),e.TgZ(27,"div",16),e._UZ(28,"i",17),e.qZA()(),e.YNc(29,et,3,1,"ng-container",2),e.qZA()(),e.TgZ(30,"div",12)(31,"div",4)(32,"label",13),e._uU(33),e.ALo(34,"translate"),e.qZA(),e.TgZ(35,"div",14),e._UZ(36,"input",18),e.ALo(37,"translate"),e.TgZ(38,"div",19),e._UZ(39,"i",20),e.qZA()(),e.YNc(40,tt,3,1,"ng-container",2),e.qZA()(),e.TgZ(41,"div",12)(42,"div",4)(43,"label",13),e._uU(44),e.ALo(45,"translate"),e.qZA(),e.TgZ(46,"div",14),e._UZ(47,"input",21),e.ALo(48,"translate"),e.TgZ(49,"div",22),e._UZ(50,"i",23),e.qZA()(),e.YNc(51,nt,3,1,"ng-container",2),e.qZA()(),e.TgZ(52,"div",12)(53,"div",4)(54,"label",13),e._uU(55),e.ALo(56,"translate"),e.qZA(),e.TgZ(57,"div",14),e._UZ(58,"input",24),e.ALo(59,"translate"),e.TgZ(60,"div",25),e._UZ(61,"i",26),e.qZA()(),e.YNc(62,it,3,1,"ng-container",2),e.qZA()(),e.TgZ(63,"div",12)(64,"div",4)(65,"label",13),e._uU(66),e.ALo(67,"translate"),e.qZA(),e.TgZ(68,"div",14),e._UZ(69,"input",27),e.ALo(70,"translate"),e.TgZ(71,"div",28),e._UZ(72,"i",29),e.qZA()(),e.YNc(73,ot,3,1,"ng-container",2),e.qZA()()()()()()(),e.TgZ(74,"div",30)(75,"div",6)(76,"h6",31),e._uU(77),e.ALo(78,"translate"),e.qZA(),e.TgZ(79,"div",32)(80,"accordion"),e.YNc(81,rt,9,4,"accordion-group",33),e.ALo(82,"translate"),e.qZA()()()()()()(),e.YNc(83,ct,26,18,"ng-template",null,34,e.W1O),e.YNc(85,lt,19,13,"ng-template",null,35,e.W1O),e.YNc(87,ut,0,0,"ng-template",null,36,e.W1O),e.YNc(89,_t,1,1,"ng-template",null,37,e.W1O),e.YNc(91,ht,6,4,"ng-template",null,38,e.W1O),e.YNc(93,Ct,30,26,"ng-template",null,39,e.W1O)),2&n&&(e.Q6J("activeMainCategory",t.USER_DASHBOARD_TABS.MY_ACCOUNT)("activeSubCategory",t.USER_DASHBOARD_MY_ACCOUNT_TABS.CHANNELS),e.xp6(2),e.Q6J("ngIf",!e.lcZ(3,39,t.userSessionService.hasActivePlan$)),e.xp6(10),e.Oqu(e.l
1cZ(13,41,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.TITLE")),e.xp6(3),e.Oqu(e.lcZ(16,43,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.SUBTITLE")),e.xp6(2),e.Q6J("ngIf",t.youtubeChannels.length>0),e.xp6(1),e.Q6J("ngIf",t.youtubeChannels.length<=0),e.xp6(4),e.Oqu(e.lcZ(23,45,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.INSTAGRAM.TITLE")),e.xp6(3),e.ekj("success",t.otherChannels[t.channelTypes.INSTAGRAM_CHANNEL].success),e.s9C("placeholder",e.lcZ(26,47,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.INSTAGRAM.PLACEHOLDER")),e.Q6J("formControl",t.otherChannels[t.channelTypes.INSTAGRAM_CHANNEL].form),e.xp6(4),e.Q6J("ngIf",!!t.otherChannels[t.channelTypes.INSTAGRAM_CHANNEL].form.getError("serverError")),e.xp6(4),e.Oqu(e.lcZ(34,49,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.FACEBOOK.TITLE")),e.xp6(3),e.ekj("success",t.otherChannels[t.channelTypes.FACEBOOK_CHANNEL].success),e.s9C("placeholder",e.lcZ(37,51,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.FACEBOOK.PLACEHOLDER")),e.Q6J("formControl",t.otherChannels[t.channelTypes.FACEBOOK_CHANNEL].form),e.xp6(4),e.Q6J("ngIf",!!t.otherChannels[t.channelTypes.FACEBOOK_CHANNEL].form.getError("serverError")),e.xp6(4),e.Oqu(e.lcZ(45,53,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.TIKTOK.TITLE")),e.xp6(3),e.ekj("success",t.otherChannels[t.channelTypes.TIK_TOK_CHANNEL].success),e.s9C("placeholder",e.lcZ(48,55,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.TIKTOK.PLACEHOLDER")),e.Q6J("formControl",t.otherChannels[t.channelTypes.TIK_TOK_CHANNEL].form),e.xp6(4),e.Q6J("ngIf",!!t.otherChannels[t.channelTypes.TIK_TOK_CHANNEL].form.getError("serverError")),e.xp6(4),e.Oqu(e.lcZ(56,57,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.PODCAST.TITLE")),e.xp6(3),e.ekj("success",t.otherChannels[t.channelTypes.EXTERNAL_PODCAST].success),e.s9C("placeholder",e.lcZ(59,59,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.PODCAST.PLACEHOLDER")),e.Q6J("formControl",t.otherChannels[t.channelTypes.EXTERNAL_PODCAST].form),e.xp6(4),e.Q6J("ngIf",!!t.otherChannels[t.channelTypes.EXTERNAL_PODCAST].form.getError("serverError")),e.xp6(4),e.Oqu(e.lcZ(67,61,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.TWITCH.TITLE")),e.xp6(3),e.ekj("success",t.otherChannels[t.channelTypes.TWITCH_CHANNEL].success),e.s9C("placeholder",e.lcZ(70,63,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.ADD.CHANNELS.TWITCH.PLACEHOLDER")),e.Q6J("formControl",t.otherChannels[t.channelTypes.TWITCH_CHANNEL].form),e.xp6(4),e.Q6J("ngIf",!!t.otherChannels[t.channelTypes.TWITCH_CHANNEL].form.getError("serverError")),e.xp6(4),e.Oqu(e.lcZ(78,65,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.FAQ.TITLE")),e.xp6(4),e.Q6J("ngForOf",e.lcZ(82,67,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CHANNELS.CONTENT.FAQ.LIST")))},dependencies:[p.sg,p.O5,p.tP,c.Fj,c.JJ,c.oH,G.Zf,G.U_,Q.Hz,Q.Mq,Q.TO,z.h,D.w,V.j,p.Ov,p.JJ,p.uU,x.X$],encapsulation:2,changeDetection:0});var gt=r(5650);function ae(i){var n=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return n.setUTCFullYear(i.getFullYear()),i.getTime()-n.getTime()}function se(i){(0,I.Z)(1,arguments);var n=(0,J.Z)(i);return n.setHours(0,0,0,0),n}function mt(i,n){(0,I.Z)(2,arguments);var t=se(i),o=se(n),a=t.getTime()-ae(t),s=o.getTime()-ae(o);return Math.round((a-s)/864e5)}function re(i,n){var t=i.getFullYear()-n.getFullYear()||i.getMonth()-n.getMonth()||i.getDate()-n.getDate()||i.getHours()-n.getHours()||i.getMinutes()-n.getMinutes()||i.getSeconds()-n.getSeconds()||i.getMilliseconds()-n.getMilliseconds();return t<0?-1:t>0?1:t}var Et=r(5759),ce=r(8124),Ot=r(3086),ft=r(9627),Ut=r(6354);function vt(i,n){1&i&&e._UZ(0,"app-only-for-member-blocker")}function bt(i,n){1&i&&(e.TgZ(0,"p",34),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.CANCELLED")," "))}
1function Zt(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",27)(2,"p",28),e._uU(3),e.qZA(),e.YNc(4,bt,3,3,"p",29),e.qZA(),e.TgZ(5,"div",30)(6,"div",31)(7,"div",32),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"div",33),e._uU(11),e.ALo(12,"translate"),e.qZA()()(),e.BQk()),2&i){const t=e.oxw();e.xp6(3),e.Oqu(t.mainSubscription.title),e.xp6(1),e.Q6J("ngIf",null!==t.mainSubscription.canceled_at&&null!==t.mainSubscription.cancel_at),e.xp6(4),e.hij("$",e.xi3(9,4,t.mainSubscriptionMonthlyGrossPrice/100,"1.2-2"),""),e.xp6(3),e.hij(" ",e.lcZ(12,7,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.PRICE_EXTRA")," ")}}function Dt(i,n){1&i&&(e.TgZ(0,"p",42),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.EXPIRES_AT")," "))}function xt(i,n){1&i&&(e.TgZ(0,"p",36),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.RENEWAL_DATE"),": "))}const Lt=function(i){return{days:i}};function Rt(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",35)(2,"p",36),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"p",37),e._uU(6),e.ALo(7,"date"),e.qZA()(),e.TgZ(8,"div",38),e.YNc(9,Dt,3,3,"p",39),e.YNc(10,xt,3,3,"p",40),e.TgZ(11,"p",41),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"p",36),e._uU(15),e.ALo(16,"translate"),e.qZA()(),e.BQk()),2&i){const t=e.oxw();e.xp6(3),e.hij(" ",e.lcZ(4,10,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.MEMBER_SINCE"),": "),e.xp6(3),e.Oqu(e.xi3(7,12,t.mainSubscription.created_at,"dd MMMM yyyy")),e.xp6(3),e.Q6J("ngIf",null!==t.mainSubscription.cancel_at&&null!==t.mainSubscription.canceled_at),e.xp6(1),e.Q6J("ngIf",null===t.mainSubscription.cancel_at&&null===t.mainSubscription.canceled_at),e.xp6(1),e.ekj("text-primary",null===t.mainSubscription.cancel_at&&null===t.mainSubscription.canceled_at)("text-danger",null!==t.mainSubscription.cancel_at&&null!==t.mainSubscription.canceled_at),e.xp6(1),e.Oqu(e.xi3(13,15,t.mainSubscription.active_until,"dd MMMM yyyy")),e.xp6(3),e.hij(" ",e.xi3(16,18,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.IN_DAYS",e.VKq(21,Lt,t.mainSubscriptionDaysUntilRenewal))," ")}}function It(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",43)(2,"h6",10),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",44)(6,"p",45),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"p",36),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"p",37),e._uU(13),e.ALo(14,"date"),e.qZA()(),e.BQk()),2&i){const t=e.oxw();e.xp6(3),e.hij(" ",e.lcZ(4,4,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.RENEWAL_AMOUNT"),": "),e.xp6(4),e.hij("$",e.xi3(8,6,t.mainSubscription.price.gross/100,"1.2-2"),""),e.xp6(3),e.hij(" ",e.lcZ(11,9,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.AMOUNT_TO_PAY_FOR_PLAN"),": "),e.xp6(3),e.Oqu(e.xi3(14,11,t.mainSubscription.active_until,"dd MMMM yyyy"))}}function Ht(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"div",46)(1,"div",9)(2,"button",47),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.changePlan())}),e._uU(3),e.ALo(4,"translate"),e.qZA()()()}2&i&&(e.xp6(3),e.hij(" ",e.lcZ(4,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.CHANGE_PLAN")," "))}
1function yt(i,n){if(1&i&&e.GkF(0,49),2&i){const t=e.oxw(2),o=e.MAs(53);e.Q6J("ngTemplateOutlet",t.user&&t.user.is_business?o:null)}}function Yt(i,n){if(1&i&&e.GkF(0,49),2&i){const t=e.oxw(2),o=e.MAs(55);e.Q6J("ngTemplateOutlet",t.subscriptionChangeActive?o:null)}}function Pt(i,n){if(1&i&&(e.TgZ(0,"div",7),e.YNc(1,yt,1,1,"ng-container",48),e.YNc(2,Yt,1,1,"ng-container",48),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.user&&t.user.is_business&&!t.subscriptionChangeActive),e.xp6(1),e.Q6J("ngIf",t.subscriptionChangeActive)}}function Mt(i,n){1&i&&e._UZ(0,"img",51)}function Bt(i,n){1&i&&(e.TgZ(0,"div"),e._UZ(1,"img",52)(2,"img",53),e.qZA())}function wt(i,n){if(1&i&&(e.ynx(0),e.YNc(1,Mt,1,0,"img",50),e.ALo(2,"lowercase"),e.YNc(3,Bt,3,0,"div",2),e.ALo(4,"lowercase"),e.BQk()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf","paypal"===e.lcZ(2,2,t.mainSubscription.payment_provider)),e.xp6(2),e.Q6J("ngIf","stripe"===e.lcZ(4,4,t.mainSubscription.payment_provider))}}function kt(i,n){if(1&i&&(e.TgZ(0,"form",54)(1,"div"),e._UZ(2,"app-form-group",55),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div")(5,"div",56),e._UZ(6,"app-form-group",57),e.ALo(7,"translate"),e._UZ(8,"app-form-group",58),e.ALo(9,"translate"),e.qZA()(),e.TgZ(10,"div",31)(11,"div",56),e._UZ(12,"app-form-group",59),e.ALo(13,"translate"),e._UZ(14,"app-form-group",60),e.ALo(15,"translate"),e.qZA()(),e.TgZ(16,"div",31)(17,"div",56),e._UZ(18,"app-form-group",61),e.ALo(19,"translate"),e._UZ(20,"app-form-group",62),e.ALo(21,"translate"),e.qZA()()()),2&i){const t=e.oxw();e.Q6J("formGroup",t.billingAddressForm),e.xp6(2),e.s9C("label",e.lcZ(3,39,"STATIC_PAGES.REGISTER.FORM.FIELDS.COMPANY_NAME")),e.Q6J("formControl",t.billingAddressForm.get("company_name"))("customInputGroup",!0)("large",!1)("readonly",!0),e.xp6(4),e.s9C("label",e.lcZ(7,41,"STATIC_PAGES.REGISTER.FORM.FIELDS.STREET")),e.Q6J("formControl",t.billingAddressForm.get("street"))("customInputGroup",!0)("large",!1)("readonly",!0),e.xp6(2),e.s9C("label",e.lcZ(9,43,"STATIC_PAGES.REGISTER.FORM.FIELDS.HOUSE_NUMBER")),e.Q6J("formControl",t.billingAddressForm.get("house_number"))("customInputGroup",!0)("large",!1)("readonly",!0),e.xp6(4),e.s9C("label",e.lcZ(13,45,"STATIC_PAGES.REGISTER.FORM.FIELDS.ZIP_CODE")),e.Q6J("formControl",t.billingAddressForm.get("zip_code"))("customInputGroup",!0)("large",!1)("readonly",!0),e.xp6(2),e.s9C("label",e.lcZ(15,47,"STATIC_PAGES.REGISTER.FORM.FIELDS.CITY")),e.Q6J("formControl",t.billingAddressForm.get("city"))("customInputGroup",!0)("large",!1)("readonly",!0),e.xp6(4),e.s9C("label",e.lcZ(19,49,"STATIC_PAGES.REGISTER.FORM.FIELDS.COMPANY_COUNTRY")),e.Q6J("formControl",t.billingAddressForm.get("company_country_code"))("selectOptions",t.countryCodeKeys)("selectNames",t.countryCodeValues)("selectDisplayOnlyValues",!0)("customInputGroup",!0)("large",!1)("readonly",!0),e.xp6(2),e.s9C("label",e.lcZ(21,51,"STATIC_PAGES.REGISTER.FORM.FIELDS.VAT_ID")),e.Q6J("formControl",t.billingAddressForm.get("vat_id"))("customInputGroup",!0)("large",!1)("readonly",!0)}}function qt(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"app-plan-card",72),e.NdJ("click",function(){const s=e.CHM(t).$implicit,l=e.oxw(2);return e.KtG(l.selectPlan(s))}),e.qZA(),e.BQk()}if(2&i){const t=n.$implicit,o=e.oxw(2);e.xp6(1),e.ekj("active",o.selectedPlan&&o.selectedPlan.id==t.id)("disabled",void 0!==t.disabled&&t.disabled),e.Q6J("plan",t)("planProduct",t.product)("selectMode",!0)}}function Ft(i,n){1&i&&(e.TgZ(0,"span",73),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.NEW_PLAN.CHECKBOX")," "))}function Jt(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"div",18)(1,"div",63)(2,"h6",64),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",9),e.YNc(6,qt,2,7,"ng-container",65),e.qZA(),e.TgZ(7,"div",66),e._UZ(8,"app-form-group",67),e.YNc(9,Ft,3,3,"ng-template",null,68,e.W1O),e.qZA(),e.TgZ(11,"div",69)(12,"button",70),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.checkoutPlanChange())}),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",71),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.cancelPlanChange())}),e._uU(16),e.ALo(17,"translate"),e.qZA()()()}if(2&i){const t=e.MAs(10),o=e.oxw();
1e.xp6(3),e.Oqu(e.lcZ(4,7,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.NEW_PLAN.TITLE")),e.xp6(3),e.Q6J("ngForOf",o.plans),e.xp6(2),e.Q6J("formControl",o.planChangeWaiverFormControl)("labelTemplate",t),e.xp6(4),e.Q6J("disabled",!o.selectedPlan||o.planChangeWaiverFormControl.invalid),e.xp6(1),e.hij(" ",e.lcZ(14,9,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.NEW_PLAN.CONFIRM_BTN")," "),e.xp6(3),e.hij(" ",e.lcZ(17,11,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.NEW_PLAN.CANCEL_BTN")," ")}}function Gt(i,n){}class y{ngOnInit(){this.analyticsService.trackPageView(v.Gy.ACCOUNT),this.userSessionService.getMainSubscription(),this.userMainPlanSub$=this.userSessionService.mainPlan$.subscribe({next:()=>{this.setMainSubscription(),this.cdr.markForCheck()}}),this.userSessionService.refreshUser().subscribe({next:n=>{this.user=n.data,this.billingAddressForm.patchValue(n.data),this.cdr.markForCheck()}})}ngOnDestroy(){this.userMainPlanSub$?.unsubscribe()}getMonthlyGrossPrice(n){if(n.frequency){const t=n.price.gross;switch(n.frequency){case d.O.TWO_YEARLY:return t/24;case d.O.YEARLY:return t/12;case d.O.HALF_YEARLY:return t/6;case d.O.QUARTERLY:return t/3;default:return t??0}}return 0}getRenewalDate(n){let t=0;if(n.frequency)switch(n.frequency){case d.O.TWO_YEARLY:t=730;break;case d.O.YEARLY:t=365;break;case d.O.HALF_YEARLY:t=180;break;case d.O.QUARTERLY:t=60;break;default:t=30}return(0,gt.Z)(new Date(n.created_at),t)}getLeftoverRenewalDays(n){return function St(i,n){(0,I.Z)(2,arguments);var t=(0,J.Z)(i),o=(0,J.Z)(n),a=re(t,o),s=Math.abs(mt(t,o));t.setDate(t.getDate()-a*s);var l=Number(re(t,o)===-a),_=a*(s-l);return 0===_?0:_}(new Date(n.active_until),new Date)}
1changePlan(){this.planChangeWaiverFormControl.reset(!1),this.subscriptionChangeActive=!0,this.planService.getAll(1,3).pipe((0,te.w)(n=>(this.plans=n.data,this.productService.getPlanProducts()))).subscribe({next:n=>{this.planProducts=n.data,this.mapProductsToPlans(),this.plans=this.plans.map(t=>({...t,disabled:!this.checkIfProductIsUpgradableTo(this.mainSubscription.frequency,t.product.frequency)}))},error:n=>{this.log.error(n)}})}selectPlan(n){void 0!==n.disabled&&!n.disabled&&(this.selectedPlan=n,this.cdr.markForCheck())}checkoutPlanChange(){this.mainSubscription?.id&&(this.cartService.addPlanChange(this.mainSubscription.id,this.selectedPlan,this.selectedPlan.product.id),this.router.navigate(["/checkout"]),this.cdr.markForCheck())}cancelPlanChange(){this.subscriptionChangeActive=!1,this.selectedPlan=void 0,this.cdr.markForCheck()}mapProductsToPlans(){this.plans=this.plans.map(n=>{const t=this.planProducts.findIndex(o=>o.orderable_id===n.id);return-1!==t&&(n.product=this.planProducts[t]),n}),this.cdr.markForCheck()}setMainSubscription(){this.mainSubscription=this.userSessionService.mainPlan$.value,this.mainSubscription&&(this.mainSubscriptionMonthlyGrossPrice=this.getMonthlyGrossPrice(this.mainSubscription),this.mainSubscriptionDaysUntilRenewal=this.getLeftoverRenewalDays(this.mainSubscription),this.cdr.markForCheck())}checkIfProductIsUpgradableTo(n,t){switch(n){case d.O.MONTHLY:return t!==d.O.MONTHLY;case d.O.QUARTERLY:return t!==d.O.MONTHLY&&t!==d.O.QUARTERLY;case d.O.HALF_YEARLY:return t===d.O.YEARLY||t===d.O.TWO_YEARLY;case d.O.YEARLY:return t===d.O.TWO_YEARLY;default:return!1}}constructor(n,t,o,a,s,l,_,g,w,j,pn){this.router=n,this.cdr=t,this.log=o,this.productService=a,this.cartService=s,this.userSessionService=l,this.authenticationService=_,this.fb=g,this.formErrorService=w,this.planService=j,this.analyticsService=pn,this.personalSubscriptions=[],this.personalPlanSubscriptions=[],this.mainSubscriptionMonthlyGrossPrice=0,this.mainSubscriptionDaysUntilRenewal=0,this.subscriptionChangeActive=!1,this.plans=[],this.planProducts=[],this.subscriptionStates=Et.q,this.billingAddressForm=this.fb.group({company_name:[{value:"",disabled:!0},c.kI.required],street:[{value:"",disabled:!0},c.kI.required],house_number:[{value:"",disabled:!0},c.kI.required],zip_code:[{value:"",disabled:!0},c.kI.required],city:[{value:"",disabled:!0},c.kI.required],company_country_code:[{value:"",disabled:!0},c.kI.required],vat_id:[{value:"",disabled:!0},[]]}),this.billingAddressFormSuccess=!1,this.countryCodeKeys=Object.keys(ce.Q),this.countryCodeValues=Object.values(ce.Q),this.planChangeWaiverForm
1Control=new c.NI(!1,[c.kI.requiredTrue]),this.USER_DASHBOARD_TABS=A.f1,this.USER_DASHBOARD_MY_ACCOUNT_TABS=A.L}}y.\u0275fac=function(n){return new(n||y)(e.Y36(N.F0),e.Y36(e.sBO),e.Y36(b.Kf),e.Y36(ie.M),e.Y36(oe.N),e.Y36(k.o),e.Y36(Ot.$),e.Y36(c.qu),e.Y36(q.J),e.Y36(ft.D),e.Y36(Z.y))},y.\u0275cmp=e.Xpm({type:y,selectors:[["app-user-account-subscription-page"]],decls:58,vars:29,consts:[[3,"activeMainCategory","activeSubCategory"],[1,"position-relative","mvh-70"],[4,"ngIf"],[1,"container"],[1,"container","py-5"],[1,"row","gx-3","gx-xl-5"],[1,"col-12","col-xl-6","pb-4"],[1,"subscription-border"],[1,"row","align-items-center","pb-4","subscription-spacer-border"],[1,"col-12"],[1,"h3","text-uppercase"],[1,"row","pt-3"],[1,"row","pt-5","pb-3"],["class","row pb-3",4,"ngIf"],["class","subscription-border",4,"ngIf"],[1,"row","align-items-center"],[1,"col-12","pb-4"],[1,"mb-0","h3"],[1,"row"],[1,"col-12","pb-3","subscription-spacer-border"],[1,"mb-0"],[1,"col-12","py-3"],["routerLink","/contact",1,"btn","btn-primary","text-uppercase","px-3"],["routerLink","/subscription-cancel",1,"link-danger","fw-medium","text-decoration-none"],["billingAddressChange",""],["planChange",""],["newPlanSelect",""],[1,"col-6","text-start","pb-3"],[1,"fw-bold","mb-1","text-uppercase","h5"],["class","fw-bold mb-0 text-danger h5 text-uppercase",4,"ngIf"],[1,"col-6","text-end","pb-3"],[1,""],[1,"h3-lh","fw-bolder","mb-0"],[1,"base-lh","fw-bold"],[1,"fw-bold","mb-0","text-danger","h5","text-uppercase"],[1,"col-6"],[1,"mb-0","base-lh"],[1,"text-primary","fw-bold","mb-0","base-lh"],[1,"col-6","text-end"],["class","mb-0 base-lh fw-medium text-danger",4,"ngIf"],["class","mb-0 base-lh",4,"ngIf"],[1,"fw-bold","mb-0","base-lh"],[1,"mb-0","base-lh","fw-medium","text-danger"],[1,"col-7"],[1,"col-5","text-end"],[1,"mb-0","h3-lh"],[1,"row","pb-3"],["type","button",1,"btn","btn-primary","text-uppercase",3,"click"],[3,"ngTemplateOutlet",4,"ngIf"],[3,"ngTemplateOutlet"],["class","d-block","src","assets/images/icons/paypal_brand.png","alt","PayPal",4,"ngIf"],["src","assets/images/icons/paypal_brand.png","alt","PayPal",1,"d-block"],["src","assets/images/icons/visa_card_brand.png","alt","Visa",1,"me-2"],["src","assets/images/icons/master_card_brand.png","alt","Master Card"],[1,"h-100",3,"formGroup"],["autocomplete","text","name","company_name","type","text",3,"formControl","label","customInputGroup","large","readonly"],[1,"row","gx-0"],["autocomplete","text","name","street","type","text",1,"col-12","pe-md-3","col-md-8",3,"formControl","label","customInputGroup","large","readonly"],["autocomplete","text","name","house_number","type","text",1,"col-12","col-md-4",3,"formControl","label","customInputGroup","large","readonly"],["autocomplete","text","name","zip_code","type","text",1,"col-12","pe-md-2","col-md-6",3,"formControl","label","customInputGroup","large","readonly"],["autocomplete","text","name","city","type","text",1,"col-12","ps-md-2","col-md-6",3,"formControl","label","customInputGroup","large","readonly"],["autocomplete","text","name","company_country_code","type","select",1,"col-12","pe-md-2","col-md-6",3,"formControl","label","selectOptions","selectNames","selectDisplayOnlyValues","customInputGroup","large","readonly"],["autocomplete","text","name","vat_id","type","text",1,"col-12","ps-md-2","col-md-6",3,"formControl","label","customInputGroup","large","readonly"],[1,"col-12","text-center","py-2"],[1,"h4","text-uppercase"],[4,"ngFor","ngForOf"],[1,"col-12","pt-2"],["name","plan_change_waiver","type","checkbox",1,"py-2",3,"formControl","labelTemplate"],["waiverLabel",""],[1,"col-12","pt-3"],["type","button",1,"btn","btn-primary","me-3",3,"disabled","click"],["type","button",1,"btn","btn-primary",3,"click"],[3,"plan","planProduct","selectMode","click"],[1,"fw-medium"]],template:function(n,t){1&n&&(e._UZ(0,"app-logged-in-navbar",0),e.TgZ(1,"div",1),e.YNc(2,vt,1,0,"app-only-for-member-blocker",2),e.ALo(3,"async"),e.TgZ(4,"div",3)(5,"div",4),e.ynx(6),e.TgZ(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"h6",10),e._uU(13),e.ALo(14,"translate"),e.qZA()(),e.YNc(15,Zt,13,9,"ng-container",2),e.qZA(),e.TgZ(16,"div",11),e.YNc(17,Rt,17,23,"ng-container",2),e.qZA(),e.TgZ(18,"div",12),e.YNc(19,It,15,14,"
1ng-container",2),e.qZA(),e.YNc(20,Ht,5,3,"div",13),e.qZA()(),e.TgZ(21,"div",6),e.YNc(22,Pt,3,2,"div",14),e.qZA()(),e.TgZ(23,"div",5)(24,"div",6)(25,"div",7)(26,"div",15)(27,"div",16)(28,"h6",17),e._uU(29),e.ALo(30,"translate"),e.qZA()(),e.TgZ(31,"div",9),e.YNc(32,wt,5,6,"ng-container",2),e.qZA()()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"div",18)(36,"div",16)(37,"h6",17),e._uU(38),e.ALo(39,"translate"),e.qZA()(),e.TgZ(40,"div",19)(41,"p",20),e._uU(42),e.ALo(43,"translate"),e.qZA()(),e.TgZ(44,"div",21)(45,"a",22),e._uU(46),e.ALo(47,"translate"),e.qZA()(),e.TgZ(48,"div",9)(49,"a",23),e._uU(50),e.ALo(51,"translate"),e.qZA()()()()()(),e.BQk(),e.qZA()()(),e.YNc(52,kt,22,53,"ng-template",null,24,e.W1O),e.YNc(54,Jt,18,13,"ng-template",null,25,e.W1O),e.YNc(56,Gt,0,0,"ng-template",null,26,e.W1O)),2&n&&(e.Q6J("activeMainCategory",t.USER_DASHBOARD_TABS.MY_ACCOUNT)("activeSubCategory",t.USER_DASHBOARD_MY_ACCOUNT_TABS.SUBSCRIPTIONS),e.xp6(2),e.Q6J("ngIf",!e.lcZ(3,15,t.userSessionService.hasActivePlan$)),e.xp6(11),e.hij(" ",e.lcZ(14,17,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.ACTIVE_PLANS.TITLE")," "),e.xp6(2),e.Q6J("ngIf",t.mainSubscription),e.xp6(2),e.Q6J("ngIf",t.mainSubscription&&t.mainSubscription.active_until),e.xp6(2),e.Q6J("ngIf",t.mainSubscription&&t.mainSubscription.active_until&&null===t.mainSubscription.canceled_at&&null===t.mainSubscription.cancel_at),e.xp6(1),e.Q6J("ngIf",t.mainSubscription&&null===t.mainSubscription.canceled_at&&null===t.mainSubscription.cancel_at&&(t.mainSubscription.state===t.subscriptionStates.STRIPE_ACTIVE||t.mainSubscription.state===t.subscriptionStates.PAYPAL_ACTIVE)&&!t.subscriptionChangeActive),e.xp6(2),e.Q6J("ngIf",t.user&&t.user.is_business||t.subscriptionChangeActive),e.xp6(7),e.hij(" ",e.lcZ(30,19,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.PAYMENT_METHOD.TITLE")," "),e.xp6(3),e.Q6J("ngIf",t.mainSubscription&&t.mainSubscription.payment_provider),e.xp6(6),e.Oqu(e.lcZ(39,21,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.HELP.TITLE")),e.xp6(4),e.Oqu(e.lcZ(43,23,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.HELP.SUBTITLE")),e.xp6(4),e.Oqu(e.lcZ(47,25,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.HELP.SUPPORT_BTN")),e.xp6(4),e.Oqu(e.lcZ(51,27,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.SUBSCRIPTION.CONTENT.HELP.CANCEL")))},dependencies:[p.sg,p.O5,p.tP,N.rH,c._Y,c.JJ,c.JL,c.oH,c.sg,X.H,Ut.r,D.w,V.j,p.Ov,p.i8,p.JJ,p.uU,x.X$],encapsulation:2,changeDetection:0});class O extends F.s{constructor(){super(...arguments),this.endpoint="/personal/invoices"}getAll(n=1){return this.http.get(this.endpoint,{params:{page:n}})}get(n){return this.http.get(this.endpoint+"/"+n)}}O.\u0275fac=function(){let i;return function(t){return(i||(i=e.n5z(O)))(t||O)}}(),O.\u0275prov=e.Yz7({token:O,factory:O.\u0275fac,providedIn:"root"});var K=r(655);class Y{transform(n,...t){return n.items&&n.items.length>0?n.items[0].title:n.transaction_id}}function Qt(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",14),e._uU(4),e.ALo(5,"invoicePurchaseTitlePipe"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.ALo(11,"date"),e.qZA(),e.TgZ(12,"td")(13,"a",17),e._UZ(14,"i",18),e.qZA()()()),2&i){const t=n.$implicit;e.xp6(2),e.Oqu(t.readable_invoice_id),e.xp6(2),e.Oqu(e.lcZ(5,7,t)),e.xp6(3),e.hij("$\xa0",e.xi3(8,9,t.order.price.gross/100,"1.2-2"),""),e.xp6(3),e.Oqu(e.xi3(11,12,t.created_at,"dd-MM-YYYY")),e.xp6(3),e.ekj("disabled",!t.invoice_download_link),e.s9C("href",t.invoice_download_link,e.LSH)}}function Vt(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"app-list-pagination",19),e.NdJ("pageChanged",function(a){e.CHM(t);const s=e.oxw();return e.KtG(s.loadInvoices(a.page))}),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("perPage",t.paginationMeta.per_page)("totalItems",t.paginationMeta.total)("totalPages",t.paginationMeta.last_page)}}Y.\u0275fac=function(n){return new(n||Y)},Y.\u0275pipe=e.Yjl({name:"invoicePurchaseTitlePipe",type:Y,pure:!0});class P{ngOnInit(){this.analyticsService.trackPageView(v.Gy.ACCOUNT),this.loadInvoices()}loadInvoices(n=1){this.personalInvoiceService.getAll(n).subscribe({next:t=>{this.invoices=t.data,this.paginationMeta=t.meta,this.cdr.markForCheck()}})}constructor(n,t,o,a,s){this.router=n,this.cdr=t,this.log=o,this.personalInvoiceService=a,this.analyticsService=s,this.total=0,this.perPage=0,this.totalPages=0,this.invoices=[],this.USER_DASHBOARD_TABS=A.f1,this.USER_DASHBOARD_MY_ACCOUNT_TABS=A.L}}P.\u0275fac=function(n){return new(n||P)(e.Y36(N.F0),e.Y36(e.sBO),e.Y36(b.Kf),e.Y36(O),e.Y36(Z.y))},P.\u0275cmp=e.Xpm({type:P,selectors:[["app-user-account-billing-history-page"]],decls:36,vars:25,consts:[[3,"activeMainCategory","activeSubCategory"],[1,"container","py-lg-5","py-3"],[1,"row"],[1,"d-none","d-lg-block","col-12","pb-4","pb-lg-0","col-lg-3"],[1,"billing-container","h-100","text-center"],[1,"col-5","col-lg-12","order-lg-2","text-center"],["src","assets/images/fox_smile.webp","alt","Smiling Fox",1,"fox-image"],[1,"col-7","col-lg-12","order-lg-1"],[1,"h3","text-uppercase"],[1,"col-12","col-lg-9"],[1,"billing-container","billing-history-list","h-100"],[1,"h3","text-center","d-lg-none","w-100","text-uppercase"],[1,"billing-history-table"],[1,"header"],[1,"d-none","d-md-table-cell"],[4,"ngFor","ngForOf"],["class","mt-auto",3,"perPage","totalItems","totalPages","pageChanged",4,"ngIf"],["target","_blank",1,"btn","btn-clear",3,"href"],[1,"fas","fa-file-invoice-dollar"],[1,"mt-auto",3,"perPage","totalItems","totalPages","pageChanged"]],template:function(n,t){1&n&&(e._UZ(0,"app-logged-in-navbar",0),e.TgZ(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",2)(6,"div",5),e._UZ(7,"img",6),e.qZA(),e.TgZ(8,"div",7)(9,"h1",8),e._uU(10),e.ALo(11,"translate"),e.qZA()()()()(),e.TgZ(12,"div",9)(13,"div",10)(14,"h1",11),e._uU(15),e.ALo(16,"translate"),e.qZA(),e.TgZ(17,"table",12)(18,"tr",13)(19,"th"),e._uU(20),e.ALo(21,"translate"),e.qZA(),e.TgZ(22,"th",14),e._uU(23),e.ALo(24,"translate"),e.qZA(),e.TgZ(25,"th"),e._uU(26),e.ALo(27,"translate"),e.qZA(),e.TgZ(28,"th"),e._uU(29),e.ALo(30,"translate"),e.qZA(),e.TgZ(31,"th"),e._uU(32),e.ALo(33,"translate"),e.qZA()(),e.YNc(34,Qt,15,15,"tr",15),e.qZA(),e.YNc(35,Vt,1,3,"app-list-pagination",16),e.qZA()()()()),2&n&&(e.Q6J("activeMainCategory",t.USER_DASHBOARD_TABS.MY_ACCOUNT)("activeSubCategory",t.USER_DASHBOARD_MY_ACCOUNT_TABS.BILLING_HISTORY),e.xp6(10),e.Oqu(e.l
1cZ(11,11,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.BILLING_HISTORY.CONTENT.HEADLINE")),e.xp6(5),e.Oqu(e.lcZ(16,13,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.BILLING_HISTORY.CONTENT.HEADLINE")),e.xp6(5),e.Oqu(e.lcZ(21,15,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.BILLING_HISTORY.CONTENT.TABLE.INVOICE_NUMBER")),e.xp6(3),e.Oqu(e.lcZ(24,17,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.BILLING_HISTORY.CONTENT.TABLE.PURCHASE")),e.xp6(3),e.Oqu(e.lcZ(27,19,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.BILLING_HISTORY.CONTENT.TABLE.TOTAL")),e.xp6(3),e.Oqu(e.lcZ(30,21,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.BILLING_HISTORY.CONTENT.TABLE.INVOICE_DATE")),e.xp6(3),e.Oqu(e.lcZ(33,23,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.BILLING_HISTORY.CONTENT.TABLE.INVOICE")),e.xp6(2),e.Q6J("ngForOf",t.invoices),e.xp6(1),e.Q6J("ngIf",t.paginationMeta))},dependencies:[p.sg,p.O5,K.I,D.w,p.JJ,p.uU,x.X$,Y],encapsulation:2,changeDetection:0});class f extends F.s{constructor(){super(...arguments),this.endpoint="/allowlist/videos"}getAll(n=1,t=10,o=""){return this.http.get(this.endpoint+"?page="+n+"&perPage="+t+"&search="+o)}create(n){return this.http.post(this.endpoint,{url:n})}status(){return this.http.get(this.endpoint+"/status")}}function Kt(i,n){1&i&&e._UZ(0,"app-only-for-member-blocker")}function jt(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"div",31),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw();e.xp6(2),e.Oqu(t.clearVideoInput.getError("serverError"))}}function $t(i,n){1&i&&(e.ynx(0),e.TgZ(1,"div",32),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.BQk()),2&i&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.SUCCESS_MESSAGE")," "))}function Wt(i,n){1&i&&(e.TgZ(0,"span",39),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.LIST.STATUS.STATES.IN_PROGRESS")," "))}function Xt(i,n){if(1&i&&(e.TgZ(0,"span",40),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.LIST.STATUS.STATES.SUCCESS."+(t.video_had_claims?"HAD_CLAIMS":"NO_CLAIMS"))," ")}}function zt(i,n){1&i&&(e.TgZ(0,"span",41),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.LIST.STATUS.STATES.ERROR")," "))}function en(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td")(2,"a",33),e._uU(3),e.qZA()(),e.TgZ(4,"td",34),e.YNc(5,Wt,3,3,"span",35),e.YNc(6,Xt,3,3,"span",36),e.YNc(7,zt,3,3,"span",37),e.qZA(),e.TgZ(8,"td",38),e._uU(9),e.ALo(10,"date"),e.qZA()()),2&i){const t=n.$implicit,o=e.oxw();e.xp6(2),e.s9C("href",t.url,e.LSH),e.xp6(1),e.Oqu(t.url),e.xp6(1),e.Q6J("ngSwitch",t.status),e.xp6(1),e.Q6J("ngSwitchCase",o.videoStates.IN_PROGRESS),e.xp6(1),e.Q6J("ngSwitchCase",o.videoStates.ADDED),e.xp6(3),e.Oqu(e.xi3(10,6,t.created_at,"dd-MM-YYYY"))}}function tn(i,n){1&i&&e._UZ(0,"i",50)}function nn(i,n){1&i&&e._UZ(0,"i",51)}function on(i,n){if(1&i&&(e.TgZ(0,"accordion-group",42,43)(2,"button",44)(3,"div",45),e._uU(4),e.qZA(),e.TgZ(5,"span",46),e.YNc(6,tn,1,0,"i",47),e.YNc(7,nn,1,0,"i",48),e.qZA()(),e._UZ(8,"div",49),e.qZA()),2&i){const t=n.$implicit,o=e.MAs(1);e.xp6(4),e.Oqu(t.HEADER),e.xp6(2),e.Q6J("ngIf",!o.isOpen),e.xp6(1),e.Q6J("ngIf",o.isOpen),e.xp6(1),e.Q6J("innerHTML",t.CONTENT,e.oJD)}}f.\u0275fac=function(){let i;return function(t){return(i||(i=e.n5z(f)))(t||f)}}(),f.\u0275prov=e.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"});class M{ngOnInit(){this.analyticsService.trackPageView(v.Gy.ACCOUNT),this.userSessionService.hasActivePlan$.value&&(this.loadAllowlistVideos(),this.allowlistVideoService.status().subscribe({next:n=>{this.clearedVideosCount=n.cleared,this.cdr.markForCheck()}}))}loadAllowlistVideos(n=1,t=""){clearTimeout(this.videoRefreshTimeout),this.allowlistVideoService.getAll(n,10,t).pipe((0,T.q)(1)).subscribe({next:o=>{this.videos=o.data,this.total=o.meta.total,this.perPage=o.meta.per_page,this.totalPages=o.meta.last_page,this.currentPage=o.meta.current_page,this.resetVideoRefresh(),this.cdr.markForCheck()},error:o=>{this.log.error(o)}})}clearVideo(){clearTimeout(this.videoRefreshTimeout),this.allowlistVideoService.create(this.clearVideoInput.value).pipe((0,T.q)(1)).subscribe({next:n=>{this.videoClearedSuccess=!0,this.clearedVideosCount++,this.loadAllowlistVideos(),this.cdr.markForCheck()},error:n=>{this.log.error(n),this.videoClearedSuccess=!1,this.clearVideoInput.setErrors(this.formErrorService.getValidationError("url",n)),this.cdr.markForCheck()}})}resetVideoRefresh(){clearTimeout(this.videoRefreshTimeout),this.videoRefreshTimeout=setTimeout(()=>{this.allowlistVideoService.getAll(this.currentPage,10,this.searchVideoInput.value).pipe((0,T.q)(1)).subscribe({next:n=>{this.videos=n.data,this.total=n.meta.total,this.perPage=n.meta.per_page,this.totalPages=n.meta.last_page,this.currentPage=n.meta.current_page,this.resetVideoRefresh(),this.cdr.markForCheck()},error:n=>{this.log.error(n)}})},4e3)}constructor(n,t,o,a,s,l){this.cdr=n,this.log=t,this.allowlistVideoService=o,this.formErrorService=a,this.analyticsService=s,this.userSessionService=l,this.clearVideoInput=new c.NI("",[c.kI.required]),this.searchVideoInput=new c.NI("",[c.kI.required]),this.videos=[],this.total=0,this.perPage=0,this.totalPages=0,this.currentPage=1,this.videoClearedSuccess=!1,this.clearedVideosCount=0,this.clearedVideosMaxCount=50,this.videoStates=C,this.USER_DASHBOARD_TABS=A.f1,this.USER_DASHBOARD_MY_ACCOUNT_TABS=A.L}}M.\u0275fac=function(n){return new(n||M)(e.Y36(e.sBO),e.Y36(b.Kf),e.Y36(f),e.Y36(q.J),e.Y36(Z.y),e.Y36(k.o))},M.\u0275cmp=e.Xpm({type:M,selectors:[["app-user-account-videos-page"]],decls:69,vars:58,consts:[[3,"activeMainCategory","activeSubCategory"],[1,"position-relative"],[4,"ngIf"],[1,"container","py-5"],[1,"row"],[1,"col-12","col-lg-6","pe-lg-4","mb-5"],[1,"videos-col-bg"],[1,"border-bottom","border-muted","pb-3"],[1,"h3","text-uppercase","mb-1"],[1,"fw-bold","mb-4"],["for","add-clear-video-input",1,"h5"],[1,"light-input-with-button"],["
1id","add-clear-video-input","type","text","placeholder","https://www.youtube.com/watch?v=xxxxxxxxxxx",1,"light-input",3,"formControl","keydown.enter"],["type","button",1,"light-input-button","ms-2",3,"click"],[1,"fa","fa-plus"],[1,"small","text-block-with-highlights","pt-2","fw-bold",3,"innerHTML"],[1,"pt-4","h5","text-primary"],[1,"pt-3"],[1,"h4","mb-1"],[1,"row","mb-2"],["type","text","placeholder","https://www.youtube.com/watch?v=xxxxxxxxxxx",1,"light-input",3,"formControl","keydown.enter"],[1,"fa","fa-search"],[1,"table"],["scope","col"],["scope","col",1,"d-none","d-md-table-cell"],[4,"ngFor","ngForOf"],[3,"totalPages","perPage","totalItems","pageChanged"],[1,"d-none","d-md-block","col-12","col-lg-6","ps-lg-4","mb-5"],[1,"col-12"],[1,"pt-4"],["panelClass","clear-accordion",4,"ngFor","ngForOf"],[1,"text-danger","pt-1"],[1,"text-success","pt-1"],["target","_blank",1,"link-dark","text-decoration-none",3,"href"],[3,"ngSwitch"],["class","text-info",4,"ngSwitchCase"],["class","text-success",4,"ngSwitchCase"],["class","text-danger",4,"ngSwitchDefault"],[1,"d-none","d-md-table-cell"],[1,"text-info"],[1,"text-success"],[1,"text-danger"],["panelClass","clear-accordion"],["accordionPanelComponent",""],["accordion-heading","","type","button",1,"btn","text-body","fw-normal","px-0","justify-content-between","d-flex","w-100","shadow-none"],[1,"pull-left","float-left","text-start"],[1,"float-right","pull-right","text-end","ps-2"],["class","fa fa-chevron-down text-muted",4,"ngIf"],["class","fa fa-chevron-up text-muted",4,"ngIf"],[3,"innerHTML"],[1,"fa","fa-chevron-down","text-muted"],[1,"fa","fa-chevron-up","text-muted"]],template:function(n,t){1&n&&(e._UZ(0,"app-logged-in-navbar",0),e.TgZ(1,"div",1),e.YNc(2,Kt,1,0,"app-only-for-member-blocker",2),e.ALo(3,"async"),e.TgZ(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h6",8),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"p",9),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"div")(16,"label",10),e._uU(17),e.ALo(18,"translate"),e.qZA(),e.TgZ(19,"div",4)(20,"div",11)(21,"input",12),e.NdJ("keydown.enter",function(){return t.clearVideo()}),e.qZA(),e.TgZ(22,"button",13),e.NdJ("click",function(){return t.clearVideo()}),e._UZ(23,"i",14),e.qZA()(),e.YNc(24,jt,3,1,"ng-container",2),e.YNc(25,$t,4,3,"ng-container",2),e.qZA()(),e._UZ(26,"p",15),e.ALo(27,"translate"),e.TgZ(28,"p",16),e._uU(29),e.ALo(30,"translate"),e.ALo(31,"translate"),e.ALo(32,"translate"),e.ALo(33,"translate"),e.qZA()(),e.TgZ(34,"div",17)(35,"h6",18),e._uU(36),e.ALo(37,"translate"),e.qZA(),e.TgZ(38,"div",19)(39,"div",11)(40,"input",20),e.NdJ("keydown.enter",function(){return t.loadAllowlistVideos(1,t.searchVideoInput.value)}),e.qZA(),e.TgZ(41,"button",13),e.NdJ("click",function(){return t.loadAllowlistVideos(1,t.searchVideoInput.value)}),e._UZ(42,"i",21),e.qZA()()(),e.TgZ(43,"table",22)(44,"thead")(45,"tr")(46,"th",23),e._uU(47),e.ALo(48,"translate"),e.qZA(),e.TgZ(49,"th",23),e._uU(50),e.ALo(51,"translate"),e.qZA(),e.TgZ(52,"th",24),e._uU(53),e.ALo(54,"translate"),e.qZA()()(),e.TgZ(55,"tbody"),e.YNc(56,en,11,9,"tr",25),e.qZA()(),e.TgZ(57,"app-list-pagination",26),e.NdJ("pageChanged",function(a){return t.loadAllowlistVideos(a.page)}),e.qZA()()()(),e.TgZ(58,"div",27)(59,"div",6)(60,"div",4)(61,"div",28)(62,"h6",8),e._uU(63),e.ALo(64,"translate"),e.qZA(),e.TgZ(65,"div",29)(66,"accordion"),e.YNc(67,on,9,4,"accordion-group",30),e.ALo(68,"translate"),e.qZA()()()()()()()()()),2&n&&(e.Q6J("activeMainCategory",t.USER_DASHBOARD_TABS.MY_ACCOUNT)("activeSubCategory",t.USER_DASHBOARD_MY_ACCOUNT_TABS.VIDEOS),e.xp6(2),e.Q6J("ngIf",!e.lcZ(3,28,t.userSessionService.hasActivePlan$)),e.xp6(8),e.Oqu(e.lcZ(11,30,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.TITLE")),e.xp6(3),e.Oqu(e.lcZ(14,32,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.SUBTITLE")),e.xp6(4),e.Oqu(e.lcZ(18,34,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.INPUT_LABEL")),e.xp6(4),e.Q6J("formControl",t.clearVideoInput),e.xp6(3),e.Q6J("ngIf",!!t.clearVideoInput.getError("serverError")),e.xp6(1),e.Q6J("ngIf",t.videoClearedSuccess),e.xp6(1),e.Q6J("innerHTML",e.lcZ(27,36,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.FOOTNOTE"),e.oJD),e.xp6(3),e.Q0o(" ",e.lcZ(30,38,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.CLEARED_PRE")," ",t.clearedVideosCount," ",e.lcZ(31,40,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.CLEARED_MID")," ",t.clearedVideosMaxCount," ",e.lcZ(32,42,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.CLEARED_POST")," (",t.clearedVideosMaxCount-t.clearedVideosCount," ",e.lcZ(33,44,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.REMAINING"),") "),e.xp6(7),e.Oqu(e.l
1cZ(37,46,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.SEARCH_LABEL")),e.xp6(4),e.Q6J("formControl",t.searchVideoInput),e.xp6(7),e.Oqu(e.lcZ(48,48,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.LIST.URL_LABEL")),e.xp6(3),e.Oqu(e.lcZ(51,50,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.LIST.STATUS.LABEL")),e.xp6(3),e.Oqu(e.lcZ(54,52,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.ADD.LIST.DATE_LABEL")),e.xp6(3),e.Q6J("ngForOf",t.videos),e.xp6(1),e.Q6J("totalPages",t.totalPages)("perPage",t.perPage)("totalItems",t.total),e.xp6(6),e.hij(" ",e.lcZ(64,54,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.FAQ.TITLE")," "),e.xp6(4),e.Q6J("ngForOf",e.lcZ(68,56,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.CLEAR_VIDEOS.CONTENT.FAQ.LIST")))},dependencies:[p.sg,p.O5,p.RF,p.n9,p.ED,c.Fj,c.JJ,c.oH,G.Zf,G.U_,K.I,D.w,V.j,p.Ov,p.uU,x.X$],encapsulation:2,changeDetection:0});var an=r(8320),sn=r(3550);function rn(i,n){if(1&i&&(e.ynx(0),e._uU(1),e.BQk()),2&i){const t=e.oxw(2).$implicit;e.xp6(1),e.hij(" , ",t.track_collection.secondary_artist?t.track_collection.secondary_artist:""," ")}}function cn(i,n){if(1&i&&(e.ynx(0),e._uU(1),e.YNc(2,rn,2,1,"ng-container",14),e.BQk()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.track_collection.artist.name," "),e.xp6(1),e.Q6J("ngIf",t.track_collection.secondary_artist_id)}}function ln(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,cn,3,2,"ng-container",14),e.qZA(),e.TgZ(7,"td",10),e._uU(8),e.qZA(),e.TgZ(9,"td",11)(10,"button",15),e.NdJ("click",function(){const s=e.CHM(t).index,l=e.oxw();return e.KtG(l.startTrackDownload(s))}),e.ALo(11,"translate"),e._UZ(12,"i",16),e.qZA(),e.TgZ(13,"button",17),e.NdJ("click",function(){const s=e.CHM(t).index,l=e.oxw();return e.KtG(l.startLicenseDownload(s))}),e.ALo(14,"translate"),e._UZ(15,"i",18),e.qZA()()()}if(2&i){const t=n.$implicit;e.xp6(2),e.Oqu(t.track_collection.external_id),e.xp6(2),e.Oqu(t.track_collection.title),e.xp6(2),e.Q6J("ngIf",t.track_collection.artist),e.xp6(2),e.Oqu(t.remaining_downloads),e.xp6(2),e.ekj("disabled",!t.track_collection.download_urls.complete),e.s9C("title",e.lcZ(11,10,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.TABLE.DOWNLOAD_HOVER")),e.xp6(3),e.ekj("disabled",!t.download_link),e.s9C("title",e.lcZ(14,12,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.TABLE.LICENSE_HOVER"))}}function un(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"app-list-pagination",19),e.NdJ("pageChanged",function(a){e.CHM(t);const s=e.oxw();return e.KtG(s.loadLicenses(a.page))}),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("perPage",t.paginationMeta.per_page)("totalItems",t.paginationMeta.total)("totalPages",t.paginationMeta.last_page)}}class B{ngOnInit(){this.analyticsService.trackPageView(v.Gy.ACCOUNT),this.load()}load(){this.loadLicenses(),this.cdr.markForCheck()}loadLicenses(n=1){this.personalLicenceService.getAll(n).pipe((0,T.q)(1)).subscribe({next:t=>{this.licenses=t.data,this.paginationMeta=t.meta,this.cdr.markForCheck()}})}startTrackDownload(n){if(!(this.licenses[n]?.remaining_downloads<=0)&&!this.downloadRequestActive&&this.licenses[n]&&this.licenses[n].track_collection&&this.licenses[n].track_collection.download_urls.complete){const t=this.licenses[n].track_collection.download_urls.complete;t&&(this.downloadRequestActive=!0,this.cdr.markForCheck(),this.trackFileUrlService.downloadUrl(t).subscribe({next:o=>{if(o.data.download_url){const a=document.createElement("a");a.setAttribute("href",o.data.download_url),a.setAttribute("download",""),a.onclick=function(s){setTimeout(function(){window.URL.revokeObjectURL(o.data.download_url)},1500)},document.body.appendChild(a),a.click(),a.remove()}this.downloadRequestActive=!1,this.cdr.markForCheck()},error:o=>{this.downloadRequestActive=!1,this.cdr.markForCheck()}}))}}startLicenseDownload(n){if(this.licenses[n]&&this.licenses[n].download_link){const t=this.licenses[n].download_link,o=document.createElement("a");o.setAttribute("href",t),o.setAttribute("download",""),o.onclick=function(a){setTimeout(function(){window.URL.revokeObjectURL(t)},1500)},document.body.appendChild(o),o.click(),o.remove()}}constructor(n,t,o,a,s,l){this.router=n,this.cdr=t,this.log=o,this.personalLicenceService=a,this.trackFileUrlService=s,this.analyticsService=l,this.total=0,this.perPage=0,this.totalPages=0,this.licenses=[],this.downloadRequestActive=!1,this.USER_DASHBOARD_TABS=A.f1,this.USER_DASHBOARD_MY_ACCOUNT_TABS=A.L}}B.\u0275fac=function(n){return new(n||B)(e.Y36(N.F0),e.Y36(e.sBO),e.Y36(b.Kf),e.Y36(an.f),e.Y36(sn.j),e.Y36(Z.y))},B.\u0275cmp=e.Xpm({type:B,selectors:[["app-user-account-licenses-page"]],decls:31,vars:25,consts:[[3,"activeMainCategory","activeSubCategory"],[1,"container","py-5"],[1,"row"],[1,"d-none","d-lg-block","col-12","pb-4"],[1,"h3","text-uppercase"],[1,"col-12"],[1,"licenses-container","licenses-history-list","h-100"],[1,"h3","text-uppercase","w-100","text-center","d-lg-none"],[1,"licenses-history-table"],[1,"header"],[1,"d-none","d-sm-table-cell"],[1,"d-none","d-md-table-cell"],[4,"ngFor","ngForOf"],["class","mt-auto",3,"perPage","totalItems","totalPages","pageChanged",4,"ngIf"],[4,"ngIf"],["type","button",1,"btn","btn-clear","me-2",3,"title","click"],[1,"fas","fa-download","fa-lg"],["type","button",1,"btn","btn-clear",3,"title","click"],[1,"fas","fa-file-pdf","fa-lg"],[1,"mt-auto",3,"perPage","totalItems","totalPages","pageChanged"]],template:function(n,t){1&n&&(e._UZ(0,"app-logged-in-navbar",0),e.TgZ(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),e._uU(5),e.ALo(6,"translate"),e.qZA()(),e.TgZ(7,"div",5)(8,"div",6)(9,"h1",7),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"table",8)(13,"tr",9)(14,"th"),e._uU(15),e.ALo(16,"translate"),e.qZA(),e.TgZ(17,"th"),e._uU(18),e.ALo(19,"translate"),e.qZA(),e.TgZ(20,"th"),e._uU(21),e.ALo(22,"translate"),e.qZA(),e.TgZ(23,"th",10),e._uU(24),e.ALo(25,"translate"),e.qZA(),e.TgZ(26,"th",11),e._uU(27),e.ALo(28,"translate"),e.qZA()(),e.YNc(29,ln,16,14,"tr",12),e.qZA(),e.YNc(30,un,1,3,"app-list-pagination",13),e.qZA()()()()),2&n&&(e.Q6J("activeMainCategory",t.USER_DASHBOARD_TABS.MY_ACCOUNT)("activeSubCategory",t.USER_DASHBOARD_MY_ACCOUNT_TABS.LICENSES),e.xp6(
15),e.Oqu(e.lcZ(6,11,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.HEADLINE")),e.xp6(5),e.Oqu(e.lcZ(11,13,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.HEADLINE")),e.xp6(5),e.Oqu(e.lcZ(16,15,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.TABLE.ID")),e.xp6(3),e.Oqu(e.lcZ(19,17,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.TABLE.TITLE")),e.xp6(3),e.Oqu(e.lcZ(22,19,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.TABLE.ARTISTS")),e.xp6(3),e.Oqu(e.lcZ(25,21,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.TABLE.DOWNLOAD_REMAINING")),e.xp6(3),e.Oqu(e.lcZ(28,23,"AUTH.USER_DASHBOARD.MY_ACCOUNT.CONTENT.LICENSES.CONTENT.TABLE.DOWNLOAD_AND_LICENSE")),e.xp6(2),e.Q6J("ngForOf",t.licenses),e.xp6(1),e.Q6J("ngIf",t.paginationMeta&&t.paginationMeta.last_page>1))},dependencies:[p.sg,p.O5,K.I,D.w,x.X$],encapsulation:2,changeDetection:0});class L{}L.\u0275fac=function(n){return new(n||L)},L.\u0275mod=e.oAB({type:L}),L.\u0275inj=e.cJS({imports:[le.m8,N.Bz.forChild([{path:"",pathMatch:"full",redirectTo:A.L.SETTINGS},{path:A.L.SETTINGS,canActivate:[U.u],component:R},{path:A.L.CHANNELS,canActivate:[U.u],component:H},{path:A.L.SUBSCRIPTIONS,canActivate:[U.u],component:y},{path:A.L.BILLING_HISTORY,canActivate:[U.u],component:P},{path:A.L.VIDEOS,canActivate:[U.u],component:M},{path:A.L.LICENSES,canActivate:[U.u],component:B}]),ue.LoggedInModule]})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.