PageSourceSearch

https://fromsmash.com/6064.4bb9124f32e131e7.js

js fromsmash.com collected 2026-09-24 08:43:16 UTC 68,253 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkstaticsmashapp=self.webpackChunkstaticsmashapp||[]).push([[6064],{76064:(ne,y,m)=>{m.r(y),m.d(y,{PromotionModule:()=>Jt});var c=m(61142),O=m(75118),A=m(47975),_=m(94236),i=m(71100),C=m(20154),p=m(17796),u=m(80489),x=m(40450),P=m(19847),R=m(6663),F=m(60494),S=m(7738),N=m(84975),ie=m(21252);const w=(0,i.VP)("[Promotion] Load Promotion",(0,i.xk)()),re=(0,i.VP)("[Promotion] Load Promotion Success",(0,i.xk)()),ae=(0,i.VP)("[Promotion] Load Promotion Failure",(0,i.xk)()),L=(0,i.VP)("[Promotion] Load Promotions",(0,i.xk)()),se=(0,i.VP)("[Promotion] Load Promotions Success",(0,i.xk)()),le=(0,i.VP)("[Promotion] Load Promotions Failure",(0,i.xk)()),ce=(0,i.VP)("[Promotion] Update Temporary Data For Promotion To Create",(0,i.xk)()),de=(0,i.VP)("[Promotion] Add Image To Promotion To Create",(0,i.xk)()),H=(0,i.VP)("[Promotion] Add Video To Promotion To Create",(0,i.xk)()),X=(0,i.VP)("[Promotion] Add Video To Promotion To Create Success",(0,i.xk)()),me=((0,i.VP)("[Promotion] Add Video To Promotion To Create Failure",(0,i.xk)()),(0,i.VP)("[Promotion] Add Image To Promotion To Create Success",(0,i.xk)())),z=((0,i.VP)("[Promotion] Add Image To Promotion To Create Failure",(0,i.xk)()),(0,i.VP)("[Promotion] Remove Media From Promotion To Create",(0,i.xk)())),J=(0,i.VP)("[Promotion] Create Promotion"),Z=(0,i.VP)("[Promotion] Create Promotion Success",(0,i.xk)()),Re=(0,i.VP)("[Promotion] Create Promotion Failure",(0,i.xk)()),ke=(0,i.VP)("[Promotion] Clean Promotion To Create"),ve=(0,i.VP)("[Promotion] Clean Promotion To Update"),K=(0,i.VP)("[Promotion] Select Promotion To Udpate",(0,i.xk)()),pe=(0,i.VP)("[Promotion] Update Promotion To Update Temp",(0,i.xk)()),G=(0,i.VP)("[Promotion] Update Promotion"),W=(0,i.VP)("[Promotion] Update Promotion Success",(0,i.xk)()),Ue=(0,i.VP)("[Promotion] Update Promotion Failure",(0,i.xk)()),ge=(0,i.VP)("[Promotion] Add Image To Promotion To Update",(0,i.xk)()),_e=(0,i.VP)("[Promotion] Add Image To Promotion To Update Success",(0,i.xk)()),Q=((0,i.VP)("[Promotion] Add Image To Promotion To Update Failure",(0,i.xk)()),(0,i.VP)("[Promotion] Add Video To Promotion To Update",(0,i.xk)())),q=(0,i.VP)("[Promotion] Add Video To Promotion To Update Success",(0,i.xk)()),ee=((0,i.VP)("[Promotion] Add Video To Promotion To Update Failure",(0,i.xk)()),(0,i.VP)("[Promotion] Remove Media From Promotion To Update",(0,i.xk)())),ue=(0,i.VP)("[Promotion] Select Promotion To Delete",(0,i.xk)()),te=(0,i.VP)("[Promotion] Delete Promotion"),he=(0,i.VP)("[Promotion] Delete Promotion Success",(0,i.xk)()),xe=(0,i.VP)("[Promotion] Delete Promotion Failure",(0,i.xk)()),v={promotionsLoaded:[],promotionsLoading:!1,promotionToCreate:{title:"",text:"",teaser:"",button:"En savoir plus",link:"",role:"Receiver",created:null,medias:[],language:null,status:""},promotionCreating:!1,promotionCreationError:null,promotionToUpdate:{title:"",text:"",status:"",language:"",teaser:"",button:"",link:"",role:"",created:null,medias:[],mediaToCreate:[],mediasToDelete:[]},promotionUpdating:!1,promotionUpdateError:null,promotionToDelete:null,promotionToDeleteDeleting:null,processing:null,promotionUpdated:!1,promotionInactivated:!1,errorMessage:""},Ne=(0,i.vy)(v,(0,i.on)(w,t=>({...t,promotionToUpdate:null,promotionUpdating:!0})),(0,i.on)(re,(t,{promotion:r})=>({...t,promotionToUpdate:{...r,medias:[...r.medias],mediaToCreate:[],mediasToDelete:[]},promotionUpdating:!1,promotionsToUpdateLoading:!1})),(0,i.on)(ae,(t,{errorMessage:r})=>({...t,errorMessage:r,promotionUpdating:!1,promotionsToUpdateLoading:!1})),(0,i.on)(L,t=>({...t,...v,promotionsLoading:!0})),(0,i.on)(se,(t,{promotions:r})=>({...t,promotionsLoaded:r,promotionsLoading:!1})),(0,i.on)(le,(t,{errorMessage:r})=>({...t,errorMessage:r,promotionsLoading:!1})),(0,i.on)(J,t=>({...t,promotionCreating:!0})),(0,i.on)(Z,t=>({...t,promotionCreating:!1,promotionToCreate:v.promotionToCreate})),(0,i.on)(Re,(t,{error:r})=>({...t,promotionCreating:!1,promotionCreationError:r})),(0,i.on)(ce,(t,{data:r})=>({...t,promotionToCreate:{...t.promotionToCreate,...r,button:r.button.value}})),(0,i.on)(X,(t,{video:r})=>({...t,promotionToCreate:{...t.promotionToCreate,medias:[...t.promotionToCreate.medias,{...r,object_id:"local_"+Date.now()}]}})),(0,i.on)(me,(t,{image:r})=>({...t,promotionToCreate:{...t.promotionToCreate,medias:[...t.promotionToCreate.medias,{...r,sourceUrl:r.downloadUrl,thumbnail:r.downloadUrl,type:"Image",object_id:"local_"+Date.now()}]}})),(0,i.on)(z,(t,{media:r})=>({...t,promotionToCreate:{...t.promotionToCreate,medias:t.promotionToCreate.medias.filter(s=>s.object_id!==r.object_id)}})),(0,i.on)(ke,t=>({...t,promotionToCreate:v.promotionToCreate})),(0,i.on)(K,(t,{promotion:r})=>({...t,promotionToUpdate:r})),(0,i.on)(ve,t=>({...t,promotionToUpdate:v.promotionToUpdate})),(0,i.on)(G,t=>({...t,promotionUpdating:!0,processing:!0,promotionUpdated:v.promotionUpdated})),(0,i.on)(W,t=>({...t,promotionUpdating:!1,processing:!1,promotionUpdated:!0})),(0,i.on)(Ue,(t,{error:r})=>({...t,promotionUpdating:!1,processing:!1,promotionUpdateError:r,promotionUpdated:v.promotionUpdated})),(0,i.on)(pe,(t,{data:r})=>({...t,promotionToUpdate:{...t.promotionToUpdate,...r,button:r.button.value}})),(0,i.on)(ee,(t,{media:r})=>r.id?{...t,promotionToUpdate:{...t.promotionToUpdate,medias:t.promotionToUpdate.medias.filter(s=>s.id!==r.id),mediasToDelete:[...t.promotionToUpdate.mediasToDelete,r]}}:{...t,promotionToUpdate:{...t.promotionToUpdate,medias:t.promotionToUpdate.medias.filter(s=>s.object_id!==r.object_id),mediasToCreate:t.promotionToUpdate.mediasToCreate.filter(s=>s.object_id!==r.object_id)}}),(0,i.on)(q,(t,{video:r})=>({...t,promotionToUpdate:{...t.promotionToUpdate,medias:[...t.promotionToUpdate.medias,{...r,object_id:"local_"+Date.now()}],mediaToCreate:[...t.promotionToUpdate.mediaToCreate,{...r,object_id:"local_"+Date.now()}]}})),(0,i.on)(_e,(t,{image:r})=>({...t,promotionToUpdate:{...t.promotionToUpdate,medias:[...t.promotionToUpdate.medias,{...r,sourceUrl:r.downloadUrl,thumbnail:r.downloadUrl,type:"Image",object_id:"local_"+Date.now()}],mediaToCreate:[...t.promotionToUpdate.mediaToCreate,{...r,sourceUrl:r.downloadUrl,thumbnail:r.downloadUrl,type:"Image",object_id:"local_"+Date.now()}]}})),(0,i.on)(ue,(t,{promotion:r})=>({...t,promotionToDelete:r})),(0,i.on)(te,t=>({...t,processing:!0,promotionInactivated:v.promotionInactivated})),(0,i.on)(he,t=>({...t,processing:!1,promotionInactivated:!0})),(0,i.on)(xe,t=>({...t,processing:!1,promotionInactivated:v.promotionInactivated})));function Le(t,r){return Ne(t,r)}const k=(0,i.UX)("userPromotion"),fe=(0,i.Mz)(k,t=>t.promotionToCreate),ye=(0,i.Mz)(k,t=>t.promotionCreating),Me=(0,i.Mz)(k,t=>t.promotionToUpdate),je=(0,i.Mz)(k,t=>t.promotionToDelete),Ve=(0,i.Mz)(k,t=>t.promotionUpdating),Ae=(0,i.Mz)(k,t=>t.promotionsLoaded),Fe=(0,i.Mz)(k,t=>t.promotionsLoading),$e=((0,i.Mz)(k,t=>t.promotionToDeleteDeleting),(0,i.Mz)(k,t=>t.processing)),De=(0,i.Mz)(k,t=>t.promotionUpdated),Be=((0,i.Mz)(k,t=>t.promotionInactivated),(0,i.Mz)(k,t=>t.promotionCreationError));var Pe=m(89845),Ge=m(43315),e=m(58527),Ye=m(78154),we=m(94485);let He=(()=>{var t;
1class r{constructor(n){this.http=n}getThumbnailVimeo(n){return this.http.get("https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/"+n)}}return(t=r).\u0275fac=function(n){return new(n||t)(e.KVO(we.Qq))},t.\u0275prov=e.jDH({token:t,factory:t.\u0275fac,providedIn:"root"}),r})();var Xe=m(25889);let ze=(()=>{var t;class r{constructor(n,o,a,M,h,D){this.actions$=n,this.promotionService=o,this.vimeoService=a,this.imageService=M,this.store$=h,this.router=D,this.loadPromotion$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(w),(0,P.H)(({promotionId:d,teamId:l})=>{let f=this.promotionService.getPromotion(d);return l&&(f=this.promotionService.getTeamPromotion(l,d)),f.pipe((0,R.T)(({promotion:b})=>re({promotion:b})),(0,F.W)(b=>(0,p.of)(ae({errorMessage:b.message}))))}))),this.loadteamPromotions$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(L),(0,R.T)(d=>d.teamId),(0,P.H)(d=>this.promotionService.listTeamPromotions(d).pipe((0,P.H)(l=>[se({...l}),Ge.Zd.resetPrepare()]),(0,F.W)(l=>(0,p.of)(le({errorMessage:l.message}))))))),this.createPromotion$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(J),(0,S.E)(this.store$.pipe((0,i.Lt)(fe)),this.store$.pipe((0,i.Lt)(C.OO)),this.store$.pipe((0,i.Lt)(C.Ev))),(0,N.n)(([d,l,f,b])=>{const T={title:l.title,text:l.text,button:l.button,teaser:l.teaser,link:l.link,role:l.role,target:l.target,status:l.status,language:l.language};return(0,u.p)([(0,p.of)(d),(0,p.of)(l),(0,p.of)(f),this.promotionService.createPromotion(f.id,T)])}),(0,N.n)(([d,l,f,{promotion:b}])=>{const T=[];return l.medias&&l.medias.forEach(B=>{T.push(this.promotionService.addMediasToPromotion(f.id,b.id,B))}),(0,u.p)([(0,p.of)(d),(0,p.of)(l),(0,p.of)(f),...T])}),(0,N.n)(([d,l,f])=>[Z({promotion:l}),L({teamId:f.id})]))),this.createPromotionSuccess$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(Z),(0,S.E)(this.store$.pipe((0,i.Lt)(C.OO))),(0,ie.M)(([d,l])=>this.router.navigateByUrl("/account/team/"+l.id+"/promotions"))),{dispatch:!1}),this.updatePromotion$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(G),(0,S.E)(this.store$.pipe((0,i.Lt)(Me)),this.store$.pipe((0,i.Lt)(C.OO))),(0,N.n)(([d,l,f])=>{const b={title:l.title,text:l.text,teaser:l.teaser,button:l.button,link:l.link,language:l.language,role:l.role,target:l.target,status:l.status};let T=this.promotionService.updatePromotion(l.id,b);return f.id&&(T=this.promotionService.updateTeamPromotion(f.id,l.id,b)),(0,u.p)([(0,p.of)(l),(0,p.of)(f),T])}),(0,N.n)(([d,l,{promotion:f}])=>{const b=[];return d.mediaToCreate&&d.mediaToCreate.forEach(T=>{b.push(this.promotionService.addMediasToPromotion(l.id,f.id,T))}),(0,u.p)([(0,p.of)(d),(0,p.of)(l),(0,p.of)(f),...b])}),(0,N.n)(([d,l,f])=>{if(d.mediasToDelete&&d.mediasToDelete.length){const b=[];return d.mediasToDelete.forEach(T=>{b.push(this.promotionService.removeMediaToPromotion(l.id,f.id,T.id))}),(0,u.p)([(0,p.of)(f),(0,p.of)(l),...b])}return(0,u.p)([(0,p.of)(f),(0,p.of)(l),(0,p.of)(null)])}),(0,N.n)(([d,l,f])=>[W({promotion:d}),L({teamId:l.id})]))),this.updatePromotionSuccess$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(W),(0,S.E)(this.store$.pipe((0,i.Lt)(C.OO))),(0,ie.M)(([d,l])=>this.router.navigateByUrl("/account/team/"+l.id+"/promotions"))),{dispatch:!1}),this.addImageToPromotionToCreate$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(de),(0,R.T)(d=>d.image),(0,P.H)(([d])=>{const l=new Pe._;return(0,u.p)([(0,p.of)(d),(0,x.H)(l.createImage())])}),(0,P.H)(([d,l])=>(0,u.p)([(0,p.of)(l),this.imageService.uploadImage(l.image.uploadUrl,d)])),(0,P.H)(([d,l])=>(0,p.of)(me({...d}))))),this.addVideoToPromotionToCreate$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(H),(0,R.T)(d=>d.video),(0,P.H)(d=>{const{type:l,sourceId:f}=d;if("Youtube"===l){const b="https://i1.ytimg.com/vi/"+f+"/2.jpg",T={...d,thumbnail:b};return(0,p.of)(X({video:T}))}if("Vimeo"===l)return(0,u.p)([this.vimeoService.getThumbnailVimeo(d.sourceId)]).pipe((0,R.T)(([b])=>{const T=b.thumbnail_url.replace("https://",""),B={...d,thumbnail:T};return X({video:B})}))}))),this.addImageToPromotionToUpdate$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(ge),(0,R.T)(d=>d.image),(0,P.H)(([d])=>{const l=new Pe._;return(0,u.p)([(0,p.of)(d),(0,x.H)(l.createImage())])}),(0,P.H)(([d,l])=>(0,u.p)([(0,p.of)(l),this.imageService.uploadImage(l.image.uploadUrl,d)])),(0,P.H)(([d,l])=>(0,p.of)(_e({...d}))))),this.addVideoToPromotionToUpdate$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(Q),(0,R.T)(d=>d.video),(0,P.H)(d=>{const{type:l,sourceId:f}=d;if("Youtube"===l){const b="https://i1.ytimg.com/vi/"+f+"/2.jpg",T={...d,thumbnail:b};return(0,p.of)(q({video:T}))}if("Vimeo"===l)return(0,u.p)([this.vimeoService.getThumbnailVimeo(d.sourceId)]).pipe((0,R.T)(([b])=>{const T=b.thumbnail_url,B={...d,thumbnail:T};return q({video:B})}))}))),this.deletePromotion$=(0,_.EH)(()=>this.actions$.pipe((0,_.gp)(te),(0,S.E)(this.store$.pipe((0,i.Lt)(je)),this.store$.pipe((0,i.Lt)(C.OO))),(0,P.H)(([d,l,f])=>
1(0,u.p)([this.promotionService.deletePromotion(f.id,l.id),(0,p.of)(f)])),(0,P.H)(([d,l])=>[he({promotion:d}),L({teamId:l.id})])))}}return(t=r).\u0275fac=function(n){return new(n||t)(e.KVO(_.En),e.KVO(Ye.B),e.KVO(He),e.KVO(Xe.f),e.KVO(i.il),e.KVO(O.Ix))},t.\u0275prov=e.jDH({token:t,factory:t.\u0275fac}),r})();var be=m(46891),j=m(5007),U=m(96542);function Je(t,r){1&t&&(e.qex(0),e.j41(1,"div",8),e.nrm(2,"div",9),e.k0s(),e.bVm())}function Ze(t,r){if(1&t&&(e.qex(0),e.j41(1,"div",10)(2,"div",11)(3,"div",12),e.EFF(4),e.k0s()()(),e.bVm()),2&t){const s=e.XpG();e.R7$(4),e.SpI(" ",s.ref.data.confirmHint," ")}}let oe=(()=>{var t;class r{constructor(n,o){this.store$=n,this.ref=o,this.processing$=this.store$.select($e),this.promotionUpdated$=this.store$.select(De),this.promotionUpdated$.pipe((0,be.$)(a=>a)).subscribe(()=>this.closeModal())}ngOnInit(){}confirmAction(){this.store$.dispatch(G())}closeModal(){this.ref.close()}}return(t=r).\u0275fac=function(n){return new(n||t)(e.rXU(i.il),e.rXU(j.ce))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-modal-confirm"]],inputs:{confirmTitle:"confirmTitle",confirmHint:"confirmHint",confirmButton:"confirmButton",confirmProcessing:"confirmProcessing"},decls:16,vars:14,consts:[[1,"modal"],[1,"header"],["translate","",1,"title"],[1,"body"],[4,"ngIf"],[1,"footer"],["type","submit","translate","",1,"btn-new","white",3,"click","disabled"],["translate","",1,"btn-new","red",3,"click","disabled"],[1,"loading-container"],[1,"loading-spinner-grey"],[1,"section"],[1,"modal-info-add-image-video-body-container-main"],["translate","",1,"modal-info-add-image-video-main-content"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"h1",2),e.EFF(3),e.k0s()(),e.j41(4,"div",3),e.DNE(5,Je,3,0,"ng-container",4),e.nI1(6,"async"),e.DNE(7,Ze,5,1,"ng-container",4),e.nI1(8,"async"),e.k0s(),e.j41(9,"div",5)(10,"button",6),e.nI1(11,"async"),e.bIt("click",function(){return o.closeModal()}),e.EFF(12,"PREMIUM_ADMIN_MEMBER_MODAL_ADD_GROUP_BUTTON_LABEL_CANCEL"),e.k0s(),e.j41(13,"button",7),e.nI1(14,"async"),e.bIt("click",function(){return o.confirmAction()}),e.EFF(15),e.k0s()()()),2&n&&(e.R7$(3),e.JRh(o.ref.data.confirmTitle),e.R7$(2),e.Y8G("ngIf",e.bMT(6,6,o.processing$)),e.R7$(2),e.Y8G("ngIf",!e.bMT(8,8,o.processing$)),e.R7$(3),e.Y8G("disabled",e.bMT(11,10,o.processing$)),e.R7$(3),e.Y8G("disabled",e.bMT(14,12,o.processing$)),e.R7$(2),e.JRh(o.ref.data.confirmButton))},dependencies:[c.bT,U.Mm,c.Jj]}),r})();var g=m(56106),$=m(18471),Ke=m(26404);function We(t,r){1&t&&(e.qex(0),e.j41(1,"div",13),e.nrm(2,"div",14),e.k0s(),e.bVm())}function Qe(t,r){if(1&t){const s=e.RV6();e.j41(0,"li",17),e.bIt("click",function(){e.eBV(s);const o=e.XpG().$implicit,a=e.XpG(3);return e.Njj(a.openModalConfirm(o,"disable"))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"PREMIUM_PROMOTION_DISABLE")," "))}function qe(t,r){if(1&t){const s=e.RV6();e.j41(0,"li",17),e.bIt("click",function(){e.eBV(s);const o=e.XpG().$implicit,a=e.XpG(3);return e.Njj(a.openModalConfirm(o,"enable"))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"PREMIUM_PROMOTION_ENABLE")," "))}function et(t,r){if(1&t){const s=e.RV6();e.j41(0,"li",17),e.bIt("click",function(){const o=e.eBV(s).$implicit,a=e.XpG(3);return e.Njj(a.updatePromotion(o.id))}),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.DNE(3,Qe,3,3,"li",18)(4,qe,3,3,"li",18)}if(2&t){const s=r.$implicit;e.R7$(),e.SpI(" ",e.bMT(2,3,"PREMIUM_PROMOTION_EDIT")," "),e.R7$(2),e.Y8G("ngIf","Enabled"===s.status),e.R7$(),e.Y8G("ngIf","Disabled"===s.status)}}function tt(t,r){if(1&t){const s=e.RV6();e.qex(0),e.j41(1,"div",15)(2,"app-smash-data-table",16),e.bIt("rowClicked",function(o){e.eBV(s);const a=e.XpG(2);return e.Njj(a.updatePromotion(o.id))}),e.DNE(3,et,5,5,"ng-template",null,2,e.C5r),e.k0s()(),e.bVm()}if(2&t){const s=e.XpG(2);e.R7$(2),e.Y8G("data",s.promotions)("searchValue",s.searchPromotion)("columns",s.columnsEnabled)("enableColumnOptions",!1)("enableMoreOptions",!0)("paginationEnabled",!0)}}function ot(t,r){1&t&&(e.j41(0,"div",19)(1,"span",20),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"PREMIUM_PROMOTION_LIST_EMPTY")," "))}function nt(t,r){if(1&t&&e.DNE(0,tt,5,6,"ng-container",12)(1,ot,4,3,"ng-template",null,1,e.C5r),2&t){const s=e.sdS(2),n=e.XpG();e.Y8G("ngIf",n.promotions.length)("ngIfElse",s)}}let it=(()=>{var t;
1class r{constructor(n,o,a,M){this.router=n,this.store$=o,this.route=a,this.dialog=M,this.columnsEnabled=[{id:"title",colName:"PREMIUM_PROMOTION_TABLE_LABEL_TITLE",type:"string",removable:!1,searchable:!0},{id:"status",colName:"PREMIUM_PROMOTION_TABLE_LABEL_STATUS",type:"string",removable:!1,translations:{Enabled:"PREMIUM_PROMOTION_ENABLED",Disabled:"PREMIUM_PROMOTION_DISABLED"}},{id:"target",colName:"PREMIUM_PROMOTION_TABLE_LABEL_TARGET",type:"string",removable:!1,translations:{External:"PREMIUM_PROMOTION_OPTION_EXTERNAL",Internal:"PREMIUM_PROMOTION_OPTION_INTERNAL"}},{id:"language",colName:"PREMIUM_PROMOTION_TABLE_LABEL_LANGUAGE",type:"string",removable:!1,searchable:!0}],this.targets=[{value:"External",label:"PREMIUM_PROMOTION_OPTION_EXTERNAL"},{value:"Internal",label:"PREMIUM_PROMOTION_OPTION_INTERNAL"}],this.status={Enabled:"PREMIUM_PROMOTION_ENABLED",Disabled:"PREMIUM_PROMOTION_DISABLED"},this.subscriptions=[],this.selectedTeam$=this.store$.pipe((0,i.Lt)(C.OO)),this.promotionsLoading$=this.store$.pipe((0,i.Lt)(Fe)),this.subscriptions.push(this.store$.select(C.OO).subscribe(h=>{h&&(this.team=h,this.store$.dispatch(L({teamId:h.id})))}),this.store$.select(Ae).subscribe(h=>{this.promotions=h}))}refresh(){this.store$.dispatch(L({teamId:this.team.id}))}openModalConfirm(n,o){const a=o;switch(o){case"enable":this.store$.dispatch(K({promotion:{...n,status:"Enabled"}})),this.dialog.open(oe,{enableClose:!0,closeButton:!1,size:"sm",data:{confirmAction:a,confirmTitle:"PREMIUM_PROMOTION_MODAL_CONFIRM_ACTIVATION_TITLE",confirmHint:"PREMIUM_PROMOTION_MODAL_CONFIRM_ACTIVATION_DESCRIPTION",confirmButton:"PREMIUM_PROMOTION_MODAL_CONFIRM_ACTIVATION_BUTTON_LABEL_CONFIRM"}});break;case"disable":this.store$.dispatch(K({promotion:{...n,status:"Disabled"}})),this.dialog.open(oe,{enableClose:!0,closeButton:!1,size:"sm",data:{confirmAction:a,confirmTitle:"PREMIUM_PROMOTION_MODAL_CONFIRM_DESACTIVATION_TITLE",confirmHint:"PREMIUM_PROMOTION_MODAL_CONFIRM_DESACTIVATION_DESCRIPTION",confirmButton:"PREMIUM_PROMOTION_MODAL_CONFIRM_DESACTIVATION_BUTTON_LABEL_CONFIRM"}});break;case"delete":this.store$.dispatch(ue({promotion:n})),this.dialog.open(oe,{enableClose:!0,closeButton:!1,size:"sm",data:{confirmAction:a,confirmTitle:"PREMIUM_PROMOTION_MODAL_CONFIRM_DELETE_TITLE",confirmHint:"PREMIUM_PROMOTION_MODAL_CONFIRM_DELETE_DESCRIPTION",confirmButton:"PREMIUM_PROMOTION_MODAL_CONFIRM_DELETE_BUTTON_LABEL_CONFIRM"}})}}onConfirmDelete(){this.store$.dispatch(te())}updatePromotion(n){this.route.params.subscribe(o=>{this.router.navigateByUrl("/account/team/"+o.id+"/promotions/update/"+n)})}createPromotion(){this.route.params.subscribe(n=>{this.router.navigateByUrl("/account/team/"+n.id+"/promotions/create")})}ngOnDestroy(){this.subscriptions.map(n=>n.unsubscribe()),this.subscriptions.length=0}}return(t=r).\u0275fac=function(n){return new(n||t)(e.rXU(O.Ix),e.rXU(i.il),e.rXU(O.nX),e.rXU(j.o3))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-promotion"]],decls:22,vars:17,consts:[["promotionsLoaded",""],["nopromotions",""],["optionsList",""],[1,"premium-searchbar"],["type","text","name","searchValue2",3,"ngModelChange","placeholder","ngModel"],[1,"premium-card"],[1,"premium-card-header"],[1,"premium-card-header-title"],[1,"premium-card-header-actions"],[1,"icon","icon-refresh",3,"click"],[1,"icon-smash_remote"],[1,"btn-new","red",3,"click"],[4,"ngIf","ngIfElse"],[1,"premium-card-loading-container"],[1,"loading-spinner-grey"],[1,"premium-card-center"],["rowClickable","true",3,"rowClicked","data","searchValue","columns","enableColumnOptions","enableMoreOptions","paginationEnabled"],[3,"click"],[3,"click",4,"ngIf"],[1,"premium-card-center-no-content"],[1,"premium-card-center-no-content-message"]],template:function(n,o){if(1&n){const a=e.RV6();e.j41(0,"div",3)(1,"app-smash-input",4),e.nI1(2,"translate"),e.mxI("ngModelChange",function(h){return e.eBV(a),e.DH7(o.searchPromotion,h)||(o.searchPromotion=h),e.Njj(h)}),e.k0s()(),e.j41(3,"div",5)(4,"div",6)(5,"div",7)(6,"h1"),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.j41(9,"h2"),e.EFF(10),e.nI1(11,"translate"),e.k0s()(),e.j41(12,"div",8)(13,"div",9),e.bIt("click",function(){return e.eBV(a),e.Njj(o.refresh())}),e.nrm(14,"i",10),e.k0s(),e.j41(15,"button",11),e.bIt("click",function(){return e.eBV(a),e.Njj(o.createPromotion())}),e.EFF(16),e.nI1(17,"translate"),e.k0s()()(),e.DNE(18,We,3,0,"ng-container",12),e.nI1(19,"async"),e.DNE(20,nt,3,2,"ng-template",null,0,e.C5r),e.k0s()}
1if(2&n){const a=e.sdS(21);e.R7$(),e.FS9("placeholder",e.bMT(2,7,"PREMIUM_PROMOTION_PLACEHOLDER_SEARCH")),e.R50("ngModel",o.searchPromotion),e.R7$(6),e.SpI(" ",e.bMT(8,9,"PREMIUM_PROMOTION_LIST")," "),e.R7$(3),e.SpI(" ",e.bMT(11,11,"PREMIUM_PROMOTION_LIST_DESCRIPTION")," "),e.R7$(6),e.JRh(e.bMT(17,13,"PREMIUM_PROMOTION_CREATE")),e.R7$(2),e.Y8G("ngIf",e.bMT(19,15,o.promotionsLoading$))("ngIfElse",a)}},dependencies:[c.bT,g.BC,g.vS,$.S,Ke.y,c.Jj,U.D9]}),r})();var Te=m(25580),I=m(40262),Y=m(21141),Ie=m(78374),E=m(1936);function rt(t,r){if(1&t){const s=e.RV6();e.qex(0),e.j41(1,"div",3)(2,"h1"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"input",8),e.bIt("change",function(o){e.eBV(s);const a=e.XpG();return a.addBackgroundImage(o.target.files),e.Njj(a.value=null)}),e.k0s(),e.nrm(10,"div",9),e.j41(11,"span",10),e.EFF(12,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_IMAGE"),e.k0s()(),e.j41(13,"div",11),e.bIt("click",function(o){return e.eBV(s),e.XpG().displaySelectionVideo(),e.Njj(o.stopPropagation())}),e.nrm(14,"div",12),e.j41(15,"span",10),e.EFF(16,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_VIDEO"),e.k0s()()()()(),e.bVm()}2&t&&(e.R7$(3),e.JRh(e.bMT(4,1,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_ADD_IMAGE_VIDEO")))}function at(t,r){if(1&t){const s=e.RV6();e.j41(0,"div",3)(1,"h1"),e.EFF(2),e.nI1(3,"translate"),e.k0s()(),e.j41(4,"div",4)(5,"div",13)(6,"span",14),e.EFF(7,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_COPY_VIDEO_LINK"),e.k0s()(),e.j41(8,"div",15)(9,"div",16)(10,"div",17)(11,"app-smash-input",18),e.nI1(12,"translate"),e.mxI("ngModelChange",function(o){e.eBV(s);const a=e.XpG();return e.DH7(a.url,o)||(a.url=o),e.Njj(o)}),e.k0s()()()()(),e.j41(13,"div",19)(14,"button",20),e.bIt("click",function(o){e.eBV(s);const a=e.XpG();return e.Njj(a.hideSelectionVideo(o))}),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"button",21),e.bIt("click",function(){e.eBV(s);const o=e.XpG();return e.Njj(o.addBackgroundVideo(o.url))}),e.EFF(18),e.nI1(19,"translate"),e.k0s()()}if(2&t){const s=e.XpG();e.R7$(2),e.JRh(e.bMT(3,7,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_ADD_VIDEO")),e.R7$(9),e.FS9("placeholder",e.bMT(12,9,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_INPUT_VIDEO_URL_PLACEHOLDER")),e.R50("ngModel",s.url),e.Y8G("error",s.error),e.R7$(4),e.JRh(e.bMT(16,11,"PREMIUM_ADMIN_MEMBER_MODAL_ADD_GROUP_BUTTON_LABEL_CANCEL")),e.R7$(2),e.Y8G("disabled",!s.url),e.R7$(),e.JRh(e.bMT(19,13,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_BUTTON_LABEL_SAVE"))}}let st=(()=>{var t;class r{constructor(n,o){this.store$=n,this.ref=o,this.selectionVideo=!1,this.error=!1,this.url=null}displaySelectionVideo(){this.selectionVideo=!0}hideSelectionVideo(n){this.selectionVideo=!1,this.url=null,n&&n.stopPropagation()}addBackgroundImage(n){this.store$.dispatch(ge({image:[n[0]]})),this.closeModal()}closeModal(){this.ref.close()}addBackgroundVideo(n){let o,a;n?n.match(E.h.regexpYoutube)?(o=n.match(E.h.regexpYoutube),a={url:n,sourceId:o[1],type:"Youtube"},this.store$.dispatch(Q({video:a})),this.closeModal(),this.selectionVideo=!1):n.match(E.h.regexpVimeo)?(o=n.match(E.h.regexpVimeo),a={url:n,sourceId:o[1],type:"Vimeo"},this.store$.dispatch(Q({video:a})),this.closeModal(),this.selectionVideo=!1):this.error=!0:this.error=!0}}return(t=r).\u0275fac=function(n){return new(n||t)(e.rXU(i.il),e.rXU(j.ce))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-modal-promotion-update-add-background"]],decls:4,vars:2,consts:[["videoSelected",""],[1,"modal"],[4,"ngIf","ngIfElse"],[1,"header"],[1,"body"],[1,"section","media-selection-section"],[1,"section-row"],[1,"section-column"],["type","file",1,"image-input",3,"change"],[1,"icon-smash_image","icon"],["translate","",1,"subtitle"],[1,"section-column",3,"click"],[1,"icon-smash_videos","icon"],[1,"description"],["translate","",1,"text"],[1,"section"],[1,"form-section"],[1,"form-input"],["type","text","borderStyle","full",3,"ngModelChange","placeholder","ngModel","error"],[1,"footer"],[1,"btn-new","white",3,"click"],[1,"btn-new","red",3,"click","disabled"]],template:function(n,o){if(1&n&&(e.j41(0,"div",1),e.DNE(1,rt,17,3,"ng-container",2)(2,at,20,15,"ng-template",null,0,e.C5r),e.k0s()),2&n){const a=e.sdS(3);e.R7$(),e.Y8G("ngIf",!o.selectionVideo)("ngIfElse",a)}},dependencies:[c.bT,U.Mm,g.BC,g.vS,$.S,U.D9],styles:[".body-container-video[_ngcontent-%COMP%]{display:flex;flex-direction:column}.full-size-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.section.media-selection-section[_ngcontent-%COMP%]{padding:2rem 9rem}.image-input[_ngcontent-%COMP%]{position:absolute;top:-3rem;left:-1rem;opacity:0;width:4.5rem;height:10rem;cursor:pointer;z-index:1}.icon[_ngcontent-%COMP%]{font-size:4rem}.body-container-video[_ngcontent-%COMP%]{justify-content:space-between;align-items:center;width:100%;height:8.5rem}"]}),r})();
1var Ce=m(74181),V=m(12557),Oe=m(68365),Ee=m(2598);const lt=(t,r)=>({enabled:t,disabled:r}),ct=t=>({empty:t}),dt=t=>({"background-image":t});function mt(t,r){1&t&&(e.j41(0,"div",39),e.nrm(1,"div",40),e.k0s())}function pt(t,r){1&t&&(e.j41(0,"div",41),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"PREMIUM_PROMOTION_ERROR_MESSAGE")," "))}function gt(t,r){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"PREMIUM_PROMOTION_ENABLED"),""))}function _t(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI("",e.bMT(1,1,"PREMIUM_PROMOTION_DISABLED")," ")}function ut(t,r){1&t&&(e.j41(0,"div",47),e.nrm(1,"i",48),e.k0s())}function ht(t,r){if(1&t){const s=e.RV6();e.j41(0,"li",42),e.bIt("click",function(){const o=e.eBV(s).$implicit,a=e.XpG();return e.Njj(a.selectMedia(o))}),e.j41(1,"div",27),e.DNE(2,ut,2,0,"div",43),e.k0s(),e.j41(3,"div",44)(4,"div",45)(5,"i",46),e.bIt("click",function(o){const a=e.eBV(s).$implicit,M=e.XpG();return e.Njj(M.onDeleteMedia(a,o))}),e.k0s()()()()}if(2&t){const s=r.$implicit,n=e.XpG();e.Y8G("ngStyle",e.eq3(2,dt,n.resolveSrcUrlString(s.thumbnail))),e.R7$(2),e.Y8G("ngIf","Youtube"===s.type||"Vimeo"===s.type)}}function ft(t,r){1&t&&(e.j41(0,"li",49)(1,"div",50),e.nrm(2,"div",40),e.k0s()())}function Mt(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.translation)," ")}function Pt(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.translation)," ")}function bt(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.label)," ")}function Tt(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.label)," ")}function It(t,r){1&t&&(e.j41(0,"div",51)(1,"div",52),e.nrm(2,"div",40),e.k0s()())}let Ct=(()=>{var t;class r{constructor(n,o,a,M,h){this.router=n,this.route=o,this.store$=a,this.fb=M,this.dialog=h,this.subscriptions=[],this.creatingMedia=!1,this.modalDisplayed=!1,this.selectionVideo=!1,this.promotionEdited=!1,this.backgroundIsLoading=!1,this.error=!1,this.sourceUrl=null,this.submitted=!1,this.actions=E.h.callToActionsList,this.targets=[{value:"External",label:"PREMIUM_PROMOTION_OPTION_EXTERNAL"},{value:"Internal",label:"PREMIUM_PROMOTION_OPTION_INTERNAL"}],this.route.params.pipe((0,Ie.s)(1)).subscribe(({id:D,promotionId:d})=>{this.store$.dispatch(w({teamId:D,promotionId:d}))}),this.buildForm(),this.promotionToUpdate$=this.store$.pipe((0,i.Lt)(Me)),this.promotionUpdating$=this.store$.pipe((0,i.Lt)(Ve)),this.supportedLanguages$=this.store$.pipe((0,i.Lt)(C.qX)),this.selectedLanguage$=this.store$.pipe((0,i.Lt)(C.Ev))}buildForm(){this.promotionUpdateForm=this.fb.group({title:["",g.k0.required],teaser:["",g.k0.required],text:[""],language:["",g.k0.required],button:["",g.k0.required],link:["",[g.k0.required,g.k0.pattern(E.h.regexpPromotionLink)]],target:["",g.k0.required],status:["",g.k0.required]})}setupFormData(){var n=this;return(0,Te.A)(function*(){const o=yield n.promotionToUpdate$.pipe((0,be.$)(a=>!!a)).toPromise();n.action=n.actions.find(a=>o.button===a.value),n.promotionUpdateForm.patchValue({title:o.title,teaser:o.teaser?o.teaser:"",text:o.text?o.text:"",button:n.action,link:o.link,language:o.language,target:o.target,status:o.status}),n.checkboxStatus="Enabled"===(null==o?void 0:o.status),n.onReplay()})()}back(){this.route.params.pipe((0,Ie.s)(1)).subscribe(n=>{this.router.navigateByUrl("/account/team/"+n.id+"/promotions")})}listenChangesFromPromotionToUpdate(){this.promotionToUpdate$.subscribe(n=>{n&&(this.medias=n.medias,this.creatingMedia=!1)})}listenChangesForm(){this.promotionUpdateForm.valueChanges.subscribe(n=>{this.checkboxStatus=n.status,n.status=n.status?"Enabled":"Disabled",this.store$.dispatch(pe({data:n}))})}ngOnInit(){var n=this;return(0,Te.A)(function*(){yield n.setupFormData(),n.listenChangesFromPromotionToUpdate(),n.listenChangesForm()})()}get f(){return this.promotionUpdateForm.controls}onReplay(){this.promotionComponent.replay()}onAddMedia(){this.dialog.open(st,{closeButton:!0,enableClose:!0,size:"sm"})}onRemoveMedia(n){this.store$.dispatch(ee({media:n}))}
1onDeleteMedia(n,o){this.store$.dispatch(ee({media:n})),o.stopPropagation()}onSubmit(){if(this.submitted=!0,!this.promotionUpdateForm.valid)return!1;this.store$.dispatch(G()),this.submitted=!1}resolveSrcUrlString(n){return null!=n&&n.startsWith("http")?`url(${n})`:`url(//${n})`}selectMedia(n){if(!n)return null;{const o=this.medias.findIndex(n.id?a=>n.id===a.id:a=>n.object_id===a.object_id);this.selectedMedia={...n,index:o}}}isMediaSelected(n){if(this.selectedMedia)return n.id===this.selectedMedia.id}get indexSelected(){return this.selectedMedia?this.selectedMedia.index:null}get isUrlValid(){return!!this.sourceUrl&&(E.h.regexpYoutube.test(this.sourceUrl)||E.h.regexpVimeo.test(this.sourceUrl))}}return(t=r).\u0275fac=function(n){return new(n||t)(e.rXU(O.Ix),e.rXU(O.nX),e.rXU(i.il),e.rXU(g.ok),e.rXU(j.o3))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-promotion-update"]],viewQuery:function(n,o){if(1&n&&e.GBs(Y.H,7),2&n){let a;e.mGM(a=e.lsd())&&(o.promotionComponent=a.first)}},decls:83,vars:80,consts:[["disabled",""],[1,"modal-container","fullscreen"],[1,"modal-container-body"],["class","designer-loader",4,"ngIf"],[1,"design-container"],[1,"design-left-box"],[1,"design-left-box-header"],["appPreventDoubleClick","",1,"design-left-box-header-save-button",3,"throttledClick"],[1,"design-left-box-header-save-button",3,"click"],[1,"design-left-box-header-save-button-replay",3,"click"],["class","design-left-box-error",4,"ngIf"],[1,"design-left-box-text-content"],[1,"design-left-box-config-form"],[1,"form",3,"ngSubmit","formGroup"],[1,"design-left-box-edition-container"],[1,"checkbox",3,"ngClass"],["formControlName","status",3,"ngModelChange","value","ngModel"],[1,"label"],[4,"ngIf","ngIfElse"],[1,"design-left-box-config-form-input"],["type","text","borderStyle","full","formControlName","title",3,"placeholder","error"],["type","text","borderStyle","full","formControlName","teaser",3,"placeholder","error"],["type","text","borderStyle","full","formControlName","text",3,"placeholder","error"],["formControlName","language","bindLabel","name","autofocus","","bindValue","id",1,"basic",3,"items","searchable","clearable"],[1,"design-left-box-config-form-medias"],[1,"design-left-box-config-form-medias-thumbnails-list"],[1,"design-left-box-config-form-medias-thumbnails-list-item",3,"click","ngClass"],[1,"design-left-box-config-form-medias-thumbnails-list-item-content"],["class","design-left-box-config-form-medias-thumbnails-list-item",3,"ngStyle","click",4,"ngFor","ngForOf"],["class","design-left-box-config-form-medias-thumbnails-list-item item-loading",4,"ngIf"],["dropdownPosition","top","formControlName","button",1,"basic",3,"items","searchable","clearable"],["ng-label-tmp",""],["ng-option-tmp",""],["borderStyle","full","formControlName","link",3,"placeholder","error"],["dropdownPosition","top","bindValue","value","formControlName","target",1,"basic",3,"items","searchable","clearable"],[1,"design-right-box"],[1,"design-right-box-content"],[1,"design-right-box-preview-container",3,"promotion","inputIndexSelected"],["class","overlay",4,"ngIf"],[1,"designer-loader"],[1,"loading-spinner-grey"],[1,"design-left-box-error"],[1,"design-left-box-config-form-medias-thumbnails-list-item",3,"click","ngStyle"],["class","design-left-box-config-form-medias-thumbnails-list-item-content-media-icon",4,"ngIf"],[1,"design-left-box-config-form-medias-thumbnails-list-item-overlay"],[1,"design-left-box-config-form-medias-thumbnails-list-item-overlay-delete"],[1,"icon-smash_close",3,"click"],[1,"design-left-box-config-form-medias-thumbnails-list-item-content-media-icon"],[1,"icon-smash_videos"],[1,"design-left-box-config-form-medias-thumbnails-list-item","item-loading"],[1,"spinner-creation-promotion"],[1,"overlay"],[1,"spinner-update"]],template:function(n,o){if(1&n){const a=e.RV6();e.j41(0,"div",1)(1,"div",2),e.DNE(2,mt,2,0,"div",3),e.nI1(3,"async"),e.j41(4,"div",4)(5,"div",5)(6,"div",6)(7,"div")(8,"span",7),e.bIt("throttledClick",function(){return e.eBV(a),e.Njj(o.onSubmit())}),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.j41(11,"span",8),e.bIt("click",function(){return e.eBV(a),e.Njj(o.back())}),e.EFF(12),e.nI1(13,"translate"),e.k0s()(),e.j41(14,"span",9),e.bIt("click",function(){return e.eBV(a),e.Njj(o.onReplay())}),e.EFF(15),e.nI1(16,"translate"),e.k0s()(),e.DNE(17,pt,3,3,"div",10),e.j41(18,"div",11)(19,"h1"),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"p"),e.EFF(23),e.nI1(24,"translate"),e.k0s()(),e.j41(25,"ng-scrollbar")(26,"div",12)(27,"form",13),e.bIt("ngSubmit",function(){return e.eBV(a),e.Njj(o.onSubmit())}),e.j41(28,"div",14)(29,"label",15)(30,"div")(31,"app-smash-checkbox",16),e.mxI("ngModelChange",function(h){return e.eBV(a),e.DH7(o.checkboxStatus,h)||(o.checkboxStatus=h),e.Njj(h)}),e.k0s()(),e.j41(32,"div",17),e.DNE(33,gt,3,3,"ng-container",18)(34,_t,2,3,"ng-template",null,0,e.C5r),e.k0s()()(),e.j41(36,"div",19),e.nrm(37,"app-smash-input",20),e.nI1(38,"translate"),e.k0s(),e.j41(39,"div",19),e.nrm(40,"app-smash-input",21),e.nI1(41,"translate"),e.k0s(),e.j41(42,"div",19),e.nrm(43,"app-smash-input",22),e.nI1(44,"translate"),e.k0s(),e.j41(45,"div",19),e.nrm(46,"ng-select",23),e.nI1(47,"async"),e.k0s(),e.j41(48,"h2"),e.EFF(49),e.nI1(50,"translate"),e.k0s(),e.j41(51,"div",24)(52,"ul",25)(53,"li",26),e.bIt("click",function(){return e.eBV(a),e.Njj(o.onAddMedia())}),e.j41(54,"div",27)(55,"span"),e.EFF(56),e.nI1(57,"translate"),e.k0s()()(),e.DNE(58,ht,6,4,"li",28)(59,ft,3,0,"li",29),e.k0s()(),e.j41(60,"h2"),e.EFF(61),e.nI1(62,"translate"),e.k0s(),e.j41(63,"div",19)(64,"ng-select",30),e.DNE(65,Mt,2,3,"ng-template",31)(66,Pt,2,3,"ng-template",32),e.k0s()(),e.j41(67,"div",19),e.nrm(68,"app-smash-input",33),e.nI1(69,"translate"),e.k0s(),e.j41(70,"h2"),e.EFF(71),e.nI1(72,"translate"),e.k0s(),e.j41(73,"div",19)(74,"ng-select",34),e.DNE(75,bt,2,3,"ng-template",31)(76,Tt,2,3,"ng-template",32),e.k0s()()()()()(),e.j41(77,"div",35)(78,"div",36),e.nrm(79,"app-smash-promotion",37),e.nI1(80,"async"),e.k0s()(),e.DNE(81,It,3,0,"div",38),e.nI1(82,"async"),e.k0s()()()}if(2&n){const a=e.sdS(35);e.R7$(2),e.Y8G("ngIf",e.bMT(3,41,o.promotionUpdating$)),e.R7$(4),e.Y8G("@headerAnimation",o.promotionEdited?"out":"in"),e.R7$(3),e.JRh(e.bMT(10,43,"PREMIUM_PROMOTION_SAVE")),e.R7$(3),e.JRh(e.bMT(13,45,"PREMIUM_PROMOTION_CANCEL")),e.R7$(3),e.JRh(e.bMT(16,47,"PREMIUM_PROMOTION_REPLAY")),e.R7$(2),e.Y8G("ngIf",o.error),e.R7$(3),e.JRh(e.bMT(21,49,"PREMIUM_PROMOTION_EDIT_TITLE")),e.R7$(3),e.SpI(" ",e.bMT(24,51,"PREMIUM_PROMOTION_EDIT_HELP")," "),e.R7$(4),e.Y8G("formGroup",o.promotionUpdateForm),e.R7$(2),e.Y8G("ngClass",e.l_i(75,lt,o.checkboxStatus,!o.checkboxStatus)),e.R7$(2),e.Y8G("value",o.checkboxStatus),e.R50("ngModel",o.checkboxStatus),e.R7$(2),e.Y8G("ngIf",o.checkboxStatus)("ngIfElse",a),e.R7$(4),e.FS9("placeholder",e.bMT(38,53,"PREMIUM_PROMOTION_INPUT_PLACEHOLDER_TITLE")),e.Y8G("error",o.submitted&&o.f.title.errors),e.R7$(3),e.FS9("placeholder",e.bMT(41,55,"PREMIUM_PROMOTION_INPUT_PLACEHOLDER_TEASER")),e.Y8G("error",o.submitted&&o.f.teaser.errors),e.R7$(3),e.FS9("placeholder",e.bMT(44,57,"PREMIUM_PROMOTION_INPUT_PLACEHOLDER_DESCRIPTION")),e.Y8G("error",o.submitted&&o.f.text.errors),e.R7$(3),e.Y8G("items",e.bMT(47,59,o.supportedLanguages$))("searchable",!1)("clearable",!1),e.R7$(3),e.JRh(e.bMT(50,61,"PREMIUM_PROMOTION_LABEL_PICTURE_VIDEO")),e.R7$(4),e.Y8G("ngClass",e.eq3(78,ct,o.submitted&&o.medias&&!o.medias.length)),e.R7$(3),e.JRh(e.bMT(57,63,"PREMIUM_PROMOTION_PLACEHOLDER_PICTURE_VIDEO")),e.R7$(2),e.Y8G("ngForOf",o.medias),e.R7$(),e.Y8G("ngIf",o.creatingMedia),e.R7$(2),e.JRh(e.bMT(62,65,"PREMIUM_PROMOTION_LABEL_CALL_TO_ACTION")),e.R7$(3),e.Y8G("items",o.actions)("searchable",!1)("clearable",!1),e.R7$(4),e.FS9("placeholder",e.bMT(69,67,"PREMIUM_PROMOTION_PLACEHOLDER_LINK")),e.Y8G("error",o.submitted&&o.f.link.errors),e.R7$(3),e.JRh(e.bMT(72,69,"PREMIUM_PROMOTION_LABEL_TARGET")),e.R7$(3),e.Y8G("items",o.targets)("searchable",!1)("clearable",!1),e.R7$(5),e.Y8G("promotion",e.bMT(80,71,o.promotionToUpdate$))("inputIndexSelected",null!=o.selectedMedia&&o.selectedMedia.index?o.selectedMedia.index:0),e.R7$(2),e.Y8G("ngIf",e.bMT(82,73,o.promotionUpdating$))}},dependencies:[c.YU,c.Sq,c.bT,c.B3,Ce.l,Y.H,g.qT,g.BC,g.cb,g.j4,g.JD,V.vr,V.Uq,V.ZZ,$.S,Oe.r,Ee.Yh,c.Jj,U.D9],styles:[".input-error[_ngcontent-%COMP%]{color:#ea5159;font-size:1.3rem}label.checkbox[_ngcontent-%COMP%]{display:flex;flex-direction:row}.full-size-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.design-left-box-config-form[_ngcontent-%COMP%]{padding-right:15px}.spinner-creation-promotion[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%}.designer-loader[_ngcontent-%COMP%]{position:absolute;top:0;left:0;height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;z-index:200;background-color:#191922c9}.overlay[_ngcontent-%COMP%]{z-index:500;height:100%;width:100%;position:fixed;top:0;left:0;background-color:#191922c9;display:flex;justify-content:center;align-items:center}label.checkbox[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;cursor:pointer;padding:1rem}label.checkbox[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{margin-left:2rem}label.checkbox.enabled[_ngcontent-%COMP%]{border-radius:.3rem;border:.1rem solid #58EABB;color:#333;background:#c9f8e9}label.checkbox.disabled[_ngcontent-%COMP%]{border-radius:.3rem;border:.1rem solid red;color:#333;background:#ff8080}.activate-overlay-container[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:200}"],data:{animation:[(0,I.hZ)("headerAnimation",[(0,I.wk)("in",(0,I.iF)({transform:"translateX({{startPosition}})"}),{params:{startPosition:"0px"}}),(0,I.wk)("out",(0,I.iF)({transform:"translateX({{endPosition}})"}),{params:{endPosition:"-350px"}}),(0,I.kY)("in => out",(0,I.i0)("0.4s ease-in-out")),(0,I.kY)("out => in",(0,I.i0)("0.4s linear"))])]}}),r})();function Ot(t,r){if(1&t){const s=e.RV6();e.qex(0),e.j41(1,"div",3)(2,"h1"),e.EFF(3),e.nI1(4,"translate"),e.k0s()(),e.j41(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"input",8),e.bIt("change",function(o){e.eBV(s);const a=e.XpG();
1return a.addBackgroundImage(o.target.files),e.Njj(a.value=null)}),e.k0s(),e.nrm(10,"div",9),e.j41(11,"span",10),e.EFF(12,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_IMAGE"),e.k0s()(),e.j41(13,"div",11),e.bIt("click",function(o){return e.eBV(s),e.XpG().displaySelectionVideo(),e.Njj(o.stopPropagation())}),e.nrm(14,"div",12),e.j41(15,"span",10),e.EFF(16,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_VIDEO"),e.k0s()()()()(),e.bVm()}2&t&&(e.R7$(3),e.JRh(e.bMT(4,1,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_ADD_IMAGE_VIDEO")))}function Et(t,r){if(1&t){const s=e.RV6();e.j41(0,"div",3)(1,"h1"),e.EFF(2),e.nI1(3,"translate"),e.k0s()(),e.j41(4,"div",4)(5,"div",13)(6,"span",14),e.EFF(7,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_COPY_VIDEO_LINK"),e.k0s()(),e.j41(8,"div",15)(9,"div",16)(10,"div",17)(11,"app-smash-input",18),e.nI1(12,"translate"),e.mxI("ngModelChange",function(o){e.eBV(s);const a=e.XpG();return e.DH7(a.url,o)||(a.url=o),e.Njj(o)}),e.k0s()()()()(),e.j41(13,"div",19)(14,"button",20),e.bIt("click",function(o){e.eBV(s);const a=e.XpG();return e.Njj(a.hideSelectionVideo(o))}),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"button",21),e.bIt("click",function(){e.eBV(s);const o=e.XpG();return e.Njj(o.addBackgroundVideo(o.url))}),e.EFF(18),e.nI1(19,"translate"),e.k0s()()}if(2&t){const s=e.XpG();e.R7$(2),e.JRh(e.bMT(3,7,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_ADD_VIDEO")),e.R7$(9),e.FS9("placeholder",e.bMT(12,9,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_INPUT_VIDEO_URL_PLACEHOLDER")),e.R50("ngModel",s.url),e.Y8G("error",s.error),e.R7$(4),e.JRh(e.bMT(16,11,"PREMIUM_ADMIN_MEMBER_MODAL_ADD_GROUP_BUTTON_LABEL_CANCEL")),e.R7$(2),e.Y8G("disabled",!s.url),e.R7$(),e.JRh(e.bMT(19,13,"PREMIUM_CUSTOMIZATION_MODAL_RECEIVER_BUTTON_LABEL_SAVE"))}}let Rt=(()=>{var t;class r{constructor(n,o){this.store$=n,this.ref=o,this.selectionVideo=!1,this.error=!1,this.url=null}displaySelectionVideo(){this.selectionVideo=!0}hideSelectionVideo(n){this.selectionVideo=!1,this.url=null,n&&n.stopPropagation()}addBackgroundImage(n){this.store$.dispatch(de({image:[n[0]]})),this.closeModal()}closeModal(){this.ref.close()}addBackgroundVideo(n){let o,a;n?n.match(E.h.regexpYoutube)?(o=n.match(E.h.regexpYoutube),a={url:n,sourceId:o[1],type:"Youtube"},this.store$.dispatch(H({video:a})),this.closeModal(),this.selectionVideo=!1):n.match(E.h.regexpVimeo)?(o=n.match(E.h.regexpVimeo),a={url:n,sourceId:o[1],type:"Vimeo"},this.store$.dispatch(H({video:a})),this.closeModal(),this.selectionVideo=!1):this.error=!0:this.error=!0}}return(t=r).\u0275fac=function(n){return new(n||t)(e.rXU(i.il),e.rXU(j.ce))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-modal-promotion-create-add-background"]],decls:4,vars:2,consts:[["videoSelected",""],[1,"modal"],[4,"ngIf","ngIfElse"],[1,"header"],[1,"body"],[1,"section","media-selection-section"],[1,"section-row"],[1,"section-column","image-container"],["type","file",1,"image-input",3,"change"],[1,"icon-smash_image","icon"],["translate","",1,"subtitle"],[1,"section-column","video-container",3,"click"],[1,"icon-smash_videos","icon"],[1,"description"],["translate","",1,"text"],[1,"section"],[1,"form-section"],[1,"form-input"],["type","text","borderStyle","full",3,"ngModelChange","placeholder","ngModel","error"],[1,"footer"],[1,"btn-new","white",3,"click"],[1,"btn-new","red",3,"click","disabled"]],template:function(n,o){if(1&n&&(e.j41(0,"div",1),e.DNE(1,Ot,17,3,"ng-container",2)(2,Et,20,15,"ng-template",null,0,e.C5r),e.k0s()),2&n){const a=e.sdS(3);e.R7$(),e.Y8G("ngIf",!o.selectionVideo)("ngIfElse",a)}},dependencies:[c.bT,U.Mm,g.BC,g.vS,$.S,U.D9],styles:[".body-container-video[_ngcontent-%COMP%]{display:flex;flex-direction:column}.full-size-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.section.media-selection-section[_ngcontent-%COMP%]{padding:2rem 9rem}.image-input[_ngcontent-%COMP%]{position:absolute;top:-3rem;left:-1rem;opacity:0;width:4.5rem;height:10rem;cursor:pointer;z-index:1}.icon[_ngcontent-%COMP%]{font-size:4rem}.body-container-video[_ngcontent-%COMP%]{justify-content:space-between;align-items:center;width:100%;height:8.5rem}.image-container[_ngcontent-%COMP%], .video-container[_ngcontent-%COMP%]{cursor:pointer}"]}),r})();var kt=m(53177);const vt=(t,r)=>({enabled:t,disabled:r}),Ut=t=>({empty:t}),xt=t=>({"background-image":t});function St(t,r){1&t&&(e.j41(0,"div",39),e.nrm(1,"div",40),e.k0s())}function Nt(t,r){1&t&&(e.j41(0,"div",41),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"PREMIUM_PROMOTION_ERROR_MESSAGE")," "))}function Lt(t,r){1&t&&(e.qex(0),e.EFF(1),e.nI1(2,"translate"),e.bVm()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"PREMIUM_PROMOTION_ENABLED"),""))}function yt(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI("",e.bMT(1,1,"PREMIUM_PROMOTION_DISABLED")," ")}function jt(t,r){1&t&&(e.j41(0,"div",47),e.nrm(1,"i",48),e.k0s())}function Vt(t,r){if(1&t){const s=e.RV6();e.j41(0,"li",42),e.bIt("click",function(){const o=e.eBV(s).$implicit,a=e.XpG();return e.Njj(a.selectMedia(o))}),e.j41(1,"div",27),e.DNE(2,jt,2,0,"div",43),e.k0s(),e.j41(3,"div",44)(4,"div",45)(5,"i",46),e.bIt("click",function(o){const a=e.eBV(s).$implicit,M=e.XpG();return e.Njj(M.onDeleteMedia(a,o))}),e.k0s()()()()}if(2&t){const s=r.$implicit,n=e.XpG();e.Y8G("ngStyle",e.eq3(2,xt,n.resolveSrcUrlString(s.thumbnail))),e.R7$(2),e.Y8G("ngIf","Youtube"===s.type||"Vimeo"===s.type)}}function At(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.translation)," ")}function Ft(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.translation)," ")}function $t(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.label)," ")}function Dt(t,r){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,r.item.label)," ")}function Bt(t,r){1&t&&(e.j41(0,"div",49),e.nrm(1,"app-smash-loading-spinner"),e.k0s())}function Gt(t,r){1&t&&(e.j41(0,"div",50)(1,"div",51),e.nrm(2,"div",40),e.k0s()())}const Yt=[{path:"create",component:(()=>{var t;
1class r{constructor(n,o,a,M,h,D){this.router=n,this.route=o,this.store$=a,this.fb=M,this.translateService=h,this.dialog=D,this.subscriptions=[],this.promotionCreated=!1,this.backgroundIsLoading=!1,this.modalBackgroundOpened=!1,this.selectionVideo=!1,this.error=!1,this.downloadUrl=null,this.checkboxStatus=!1,this.submitted=!1,this.actions=E.h.callToActionsList,this.targets=[{value:"External",label:"PREMIUM_PROMOTION_OPTION_EXTERNAL"},{value:"Internal",label:"PREMIUM_PROMOTION_OPTION_INTERNAL"}],this.buildForm(),this.promotionToCreate$=this.store$.pipe((0,i.Lt)(fe)),this.promotionCreating$=this.store$.pipe((0,i.Lt)(ye)),this.promotionCreationError$=this.store$.pipe((0,i.Lt)(Be)),this.supportedLanguages$=this.store$.pipe((0,i.Lt)(C.qX)),this.selectedLanguage$=this.store$.pipe((0,i.Lt)(C.Ev))}buildForm(){this.promotionCreationForm=this.fb.group({title:["",g.k0.required],teaser:["",g.k0.required],text:[""],language:["",g.k0.required],button:[this.actions[18],g.k0.required],link:["",[g.k0.required,g.k0.pattern(E.h.regexpPromotionLink)]],target:[this.targets[0].value,g.k0.required],status:["Disabled",g.k0.required]})}back(){this.route.params.subscribe(n=>{this.router.navigateByUrl("/account/team/"+n.id+"/promotions")})}initSubscriptions(){this.subscriptions.push(this.selectedLanguage$.subscribe(n=>{this.selectedLanguageSync=n||this.translateService.getBrowserLang(),this.promotionCreationForm.patchValue({language:this.selectedLanguageSync})}),this.promotionToCreate$.subscribe(n=>{this.medias=n.medias,this.selectMedia(this.medias[this.medias.length-1])}),this.promotionCreationForm.valueChanges.subscribe(n=>{this.checkboxStatus=n.status,n.status=n.status?"Enabled":"Disabled",this.store$.dispatch(ce({data:n}))}))}ngOnInit(){this.initSubscriptions()}get f(){return this.promotionCreationForm.controls}onReplay(){this.promotionComponent.replay()}onAddMedia(){this.dialog.open(Rt,{closeButton:!0,enableClose:!0,size:"sm"})}onRemoveMedia(n){this.store$.dispatch(z({media:n}))}onDeleteMedia(n,o){this.store$.dispatch(z({media:n})),o.stopPropagation()}onSubmit(){if(this.submitted=!0,!this.promotionCreationForm.valid)return!1;this.store$.dispatch(J()),this.submitted=!1}selectMedia(n){if(!n)return null;{const o=this.medias.findIndex(n.id?a=>n.id===a.id:a=>n.object_id===a.object_id);this.selectedMedia={...n,index:o}}}isMediaSelected(n){if(this.selectedMedia)return n.object_id===this.selectedMedia.object_id}get indexSelected(){return this.selectedMedia?this.selectedMedia.index:null}get isUrlValid(){return!!this.downloadUrl&&(E.h.regexpYoutube.test(this.downloadUrl)||E.h.regexpVimeo.test(this.downloadUrl))}resolveSrcUrlString(n){return null!=n&&n.startsWith("http")?`url(${n})`:`url(//${n})`}}return(t=r).\u0275fac=function(n){return new(n||t)(e.rXU(O.Ix),e.rXU(O.nX),e.rXU(i.il),e.rXU(g.ok),e.rXU(U.c$),e.rXU(j.o3))},t.\u0275cmp=e.VBU({type:t,selectors:[["app-promotion-create"]],viewQuery:function(n,o){if(1&n&&e.GBs(Y.H,7),2&n){let a;e.mGM(a=e.lsd())&&(o.promotionComponent=a.first)}},decls:83,vars:80,consts:[["disabled",""],[1,"modal-container","fullscreen"],[1,"modal-container-body"],["class","designer-loader",4,"ngIf"],[1,"design-container"],[1,"design-left-box"],[1,"design-left-box-header"],["appPreventDoubleClick","",1,"design-left-box-header-save-button",3,"throttledClick"],[1,"design-left-box-header-save-button",3,"click"],[1,"design-left-box-header-save-button-replay",3,"click"],["class","design-left-box-error",4,"ngIf"],[1,"design-left-box-text-content"],[1,"design-left-box-config-form"],[1,"form",3,"ngSubmit","formGroup"],[1,"design-left-box-edition-container"],[1,"checkbox",3,"ngClass"],["formControlName","status",3,"ngModelChange","click","value","ngModel"],[1,"label"],[4,"ngIf","ngIfElse"],[1,"design-left-box-config-form-input"],["type","text","borderStyle","full","formControlName","title",3,"placeholder","error"],["type","text","borderStyle","full","formControlName","teaser",3,"placeholder","error"],["type","text","borderStyle","full","formControlName","text",3,"placeholder"],["formControlName","language","bindLabel","name","autofocus","","bindValue","id",1,"basic",3,"ngModelChange","items","searchable","clearable","ngModel"],[1,"design-left-box-config-form-medias"],[1,"design-left-box-config-form-medias-thumbnails-list"],[1,"design-left-box-config-form-medias-thumbnails-list-item",3,"click","ngClass"],[1,"design-left-box-config-form-medias-thumbnails-list-item-content"],["class","design-left-box-config-form-medias-thumbnails-list-item",3,"ngStyle","click",4,"ngFor","ngForOf"],["dropdownPosition","top","formControlName","button",1,"basic",3,"items","searchable","clearable"],["ng-label-tmp",""],["ng-option-tmp",""],["borderStyle","full","formControlName","link",3,"placeholder","error"],["dropdownPosition","top","bindValue","value","formControlName","target",1,"basic",3,"items","searchable","clearable"],[1,"design-right-box"],["class","design-right-box-loader",4,"ngIf"],[1,"design-right-box-content"],[1,"design-right-box-preview-container",3,"promotion","inputIndexSelected"],["class","overlay",4,"ngIf"],[1,"designer-loader"],[1,"loading-spinner-grey"],[1,"design-left-box-error"],[1,"design-left-box-config-form-medias-thumbnails-list-item",3,"click","ngStyle"],["class","design-left-box-config-form-medias-thumbnails-list-item-content-media-icon",4,"ngIf"],[1,"design-left-box-config-form-medias-thumbnails-list-item-overlay"],[1,"design-left-box-config-form-medias-thumbnails-list-item-overlay-delete"],[1,"icon-smash_close",3,"click"],[1,"design-left-box-config-form-medias-thumbnails-list-item-content-media-icon"],[1,"icon-smash_videos"],[1,"design-right-box-loader"],[1,"overlay"],[1,"spinner-update"]],template:function(n,o){if(1&n){const a=e.RV6();e.j41(0,"div",1)(1,"div",2),e.DNE(2,St,2,0,"div",3),e.nI1(3,"async"),e.j41(4,"div",4)(5,"div",5)(6,"div",6)(7,"div")(8,"span",7),e.bIt("throttledClick",function(){return e.eBV(a),e.Njj(o.onSubmit())}),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.j41(11,"span",8),e.bIt("click",function(){return e.eBV(a),e.Njj(o.back())}),e.EFF(12),e.nI1(13,"translate"),e.k0s()(),e.j41(14,"span",9),e.bIt("click",function(){return e.eBV(a),e.Njj(o.onReplay())}),e.EFF(15),e.nI1(16,"translate"),e.k0s()(),e.DNE(17,Nt,3,3,"div",10),e.j41(18,"div",11)(19,"h1"),e.EFF(20),e.nI1(21,"translate"),e.k0s(),e.j41(22,"p"),e.EFF(23),e.nI1(24,"translate"),e.k0s()(),e.j41(25,"ng-scrollbar")(26,"div",12)(27,"form",13),e.bIt("ngSubmit",function(){return e.eBV(a),e.Njj(o.onSubmit())}),e.j41(28,"div",14)(29,"label",15)(30,"div")(31,"app-smash-checkbox",16),e.mxI("ngModelChange",function(h){return e.eBV(a),e.DH7(o.checkboxStatus,h)||(o.checkboxStatus=h),e.Njj(h)}),e.bIt("click",function(h){return e.eBV(a),e.Njj(h.stopPropagation())}),e.k0s()(),e.j41(32,"div",17),e.DNE(33,Lt,3,3,"ng-container",18)(34,yt,2,3,"ng-template",null,0,e.C5r),e.k0s()()(),e.j41(36,"div",19),e.nrm(37,"app-smash-input",20),e.nI1(38,"translate"),e.k0s(),e.j41(39,"div",19),e.nrm(40,"app-smash-input",21),e.nI1(41,"translate"),e.k0s(),e.j41(42,"div",19),e.nrm(43,"app-smash-input",22),e.nI1(44,"translate"),e.k0s(),e.j41(45,"div",19)(46,"ng-select",23),e.nI1(47,"async"),e.mxI("ngModelChange",function(h){return e.eBV(a),e.DH7(o.selectedLanguageSync,h)||(o.selectedLanguageSync=h),e.Njj(h)}),e.k0s()(),e.j41(48,"h2"),e.EFF(49),e.nI1(50,"translate"),e.k0s(),e.j41(51,"div",24)(52,"ul",25)(53,"li",26),e.bIt("click",function(){return e.eBV(a),e.Njj(o.onAddMedia())}),e.j41(54,"div",27)(55,"span"),e.EFF(56),e.nI1(57,"translate"),e.k0s()()(),e.DNE(58,Vt,6,4,"li",28),e.k0s()(),e.j41(59,"h2"),e.EFF(60),e.nI1(61,"translate"),e.k0s(),e.j41(62,"div",19)(63,"ng-select",29),e.DNE(64,At,2,3,"ng-template",3
10)(65,Ft,2,3,"ng-template",31),e.k0s()(),e.j41(66,"div",19),e.nrm(67,"app-smash-input",32),e.nI1(68,"translate"),e.k0s(),e.j41(69,"h2"),e.EFF(70),e.nI1(71,"translate"),e.k0s(),e.j41(72,"div",19)(73,"ng-select",33),e.DNE(74,$t,2,3,"ng-template",30)(75,Dt,2,3,"ng-template",31),e.k0s()()()()()(),e.j41(76,"div",34),e.DNE(77,Bt,2,0,"div",35),e.j41(78,"div",36),e.nrm(79,"app-smash-promotion",37),e.nI1(80,"async"),e.k0s()(),e.DNE(81,Gt,3,0,"div",38),e.nI1(82,"async"),e.k0s()()()}if(2&n){const a=e.sdS(35);e.R7$(2),e.Y8G("ngIf",e.bMT(3,41,o.promotionCreating$)),e.R7$(4),e.Y8G("@headerAnimation",o.promotionCreated?"out":"in"),e.R7$(3),e.JRh(e.bMT(10,43,"PREMIUM_PROMOTION_SAVE")),e.R7$(3),e.JRh(e.bMT(13,45,"PREMIUM_PROMOTION_CANCEL")),e.R7$(3),e.JRh(e.bMT(16,47,"PREMIUM_PROMOTION_REPLAY")),e.R7$(2),e.Y8G("ngIf",o.error),e.R7$(3),e.JRh(e.bMT(21,49,"PREMIUM_PROMOTION_CREATE_TITLE")),e.R7$(3),e.SpI(" ",e.bMT(24,51,"PREMIUM_PROMOTION_CREATE_HELP")," "),e.R7$(4),e.Y8G("formGroup",o.promotionCreationForm),e.R7$(2),e.Y8G("ngClass",e.l_i(75,vt,o.checkboxStatus,!o.checkboxStatus)),e.R7$(2),e.Y8G("value",o.checkboxStatus),e.R50("ngModel",o.checkboxStatus),e.R7$(2),e.Y8G("ngIf",o.checkboxStatus)("ngIfElse",a),e.R7$(4),e.FS9("placeholder",e.bMT(38,53,"PREMIUM_PROMOTION_INPUT_PLACEHOLDER_TITLE")),e.Y8G("error",o.submitted&&o.f.title.errors),e.R7$(3),e.FS9("placeholder",e.bMT(41,55,"PREMIUM_PROMOTION_INPUT_PLACEHOLDER_TEASER")),e.Y8G("error",o.submitted&&o.f.teaser.errors),e.R7$(3),e.FS9("placeholder",e.bMT(44,57,"PREMIUM_PROMOTION_INPUT_PLACEHOLDER_DESCRIPTION")),e.R7$(3),e.Y8G("items",e.bMT(47,59,o.supportedLanguages$))("searchable",!1)("clearable",!1),e.R50("ngModel",o.selectedLanguageSync),e.R7$(3),e.JRh(e.bMT(50,61,"PREMIUM_PROMOTION_LABEL_PICTURE_VIDEO")),e.R7$(4),e.Y8G("ngClass",e.eq3(78,Ut,o.submitted&&!o.medias.length)),e.R7$(3),e.JRh(e.bMT(57,63,"PREMIUM_PROMOTION_PLACEHOLDER_PICTURE_VIDEO")),e.R7$(2),e.Y8G("ngForOf",o.medias),e.R7$(2),e.JRh(e.bMT(61,65,"PREMIUM_PROMOTION_LABEL_CALL_TO_ACTION")),e.R7$(3),e.Y8G("items",o.actions)("searchable",!1)("clearable",!1),e.R7$(4),e.FS9("placeholder",e.bMT(68,67,"PREMIUM_PROMOTION_PLACEHOLDER_LINK")),e.Y8G("error",o.submitted&&o.f.link.errors),e.R7$(3),e.JRh(e.bMT(71,69,"PREMIUM_PROMOTION_LABEL_TARGET")),e.R7$(3),e.Y8G("items",o.targets)("searchable",!1)("clearable",!1),e.R7$(4),e.Y8G("ngIf",o.backgroundIsLoading),e.R7$(2),e.Y8G("promotion",e.bMT(80,71,o.promotionToCreate$))("inputIndexSelected",o.selectedMedia?o.selectedMedia.index:null),e.R7$(2),e.Y8G("ngIf",e.bMT(82,73,o.promotionUpdating$))}},dependencies:[c.YU,c.Sq,c.bT,c.B3,Ce.l,kt.D,Y.H,g.qT,g.BC,g.cb,g.j4,g.JD,V.vr,V.Uq,V.ZZ,$.S,Oe.r,Ee.Yh,c.Jj,U.D9],styles:[".input-error[_ngcontent-%COMP%]{color:#ea5159;font-size:1.3rem}label.checkbox[_ngcontent-%COMP%]{display:flex;flex-direction:row}.full-size-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.design-left-box-config-form[_ngcontent-%COMP%]{padding-right:15px}.spinner-creation-promotion[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%}.designer-loader[_ngcontent-%COMP%]{position:absolute;top:0;left:0;height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;z-index:200;background-color:#191922c9}.overlay[_ngcontent-%COMP%]{z-index:500;height:100%;width:100%;position:fixed;top:0;left:0;background-color:#191922c9;display:flex;justify-content:center;align-items:center}label.checkbox[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;cursor:pointer;padding:1rem}label.checkbox[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{margin-left:2rem}label.checkbox.enabled[_ngcontent-%COMP%]{border-radius:.3rem;border:.1rem solid #58EABB;color:#333;background:#c9f8e9}label.checkbox.disabled[_ngcontent-%COMP%]{border-radius:.3rem;border:.1rem solid red;color:#333;background:#ff8080}.activate-overlay-container[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:200}"],data:{animation:[(0,I.hZ)("headerAnimation",[(0,I.wk)("in",(0,I.iF)({transform:"translateX({{startPosition}})"}),{params:{startPosition:"0px"}}),(0,I.wk)("out",(0,I.iF)({transform:"translateX({{endPosition}})"}),{params:{endPosition:"-350px"}}),(0,I.kY)("in => out",(0,I.i0)("0.4s ease-in-out")),(0,I.kY)("out => in",(0,I.i0)("0.4s linear"))])]}}),r})()},{path:"update/:promotionId",component:Ct},{path:"",component:it,data:{section:"TEAM_PROMOTIONS_SECTION"}}];var wt=m(60625),Ht=m(48429),Xt=m(37631),zt=m(70332);let Jt=(()=>{var t;class r{}
1return(t=r).\u0275fac=function(n){return new(n||t)},t.\u0275mod=e.$C({type:t}),t.\u0275inj=e.G2t({imports:[c.MD,A.G,O.iI.forChild(Yt),i.md.forFeature("userPromotion",Le),_.Vm.forFeature([ze]),wt.E,Ht.c,Xt.n,zt.V]}),r})()},53177:(ne,y,m)=>{m.d(y,{D:()=>p});var c=m(58527),O=m(61142);const A=u=>({preview:u}),_=u=>({animated:u});function i(u,x){1&u&&(c.qex(0),c.j41(1,"div",3)(2,"div",4),c.qSk(),c.j41(3,"svg",5)(4,"style",6),c.EFF(5," .st0 { clip-path: url(#SVGID_2_); fill: #fff; } "),c.k0s(),c.j41(6,"g")(7,"g")(8,"defs"),c.nrm(9,"rect",7),c.k0s(),c.j41(10,"clipPath",8),c.nrm(11,"use",9),c.k0s(),c.nrm(12,"path",10)(13,"path",11)(14,"path",12),c.k0s()()()()(),c.bVm())}function C(u,x){if(1&u&&c.nrm(0,"div",13),2&u){const P=c.XpG();c.ZvI("loader-img ",P.type,""),c.Y8G("ngClass",c.eq3(4,_,"state2"===P.loaderState))}}let p=(()=>{var u;class x{constructor(){this.defaultType="normal",this.type=this.defaultType,this.loaderState="state1"}ngOnInit(){}}return(u=x).\u0275fac=function(R){return new(R||u)},u.\u0275cmp=c.VBU({type:u,selectors:[["app-smash-loading-spinner"]],inputs:{type:"type"},decls:4,vars:5,consts:[["elseTemplate",""],[1,"loader-content",3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"loader-text-logo"],[1,"Logo_pastille_blanc","icon-fullscreen"],["version","1.1","id","Calque_1","xmlns","http://www.w3.org/2000/svg",0,"xmlns","xlink","http://www.w3.org/1999/xlink","x","0px","y","0px","viewBox","0 0 981.28 255.89",0,"xml","space","preserve",2,"enable-background","new 0 0 981.28 255.89"],["type","text/css"],["id","SVGID_1_","x","10.15","y","6.18","width","965.68","height","238.64"],["id","SVGID_2_"],[0,"xlink","href","#SVGID_1_",2,"overflow","visible"],["d","M959.54,189.81l14.41-67.31c1.42-6.38,1.89-11.1,1.89-15.35c0-21.26-12.28-37.79-36.84-37.79\n\t\t\tc-10.63,0-22.2,3.78-29.52,12.52l13.46-63.06H886.8l-36.13,170.98h35.9l14.64-68.01c2.6-11.81,9.68-20.55,20.78-20.55\n\t\t\tc10.63,0,16.53,6.61,16.53,16.3c0,2.12-0.24,4.72-1.42,9.92l-13.46,62.35H959.54z M750.3,154.38v1.42\n\t\t\tc0,11.1,7.32,37.55,46.52,37.55c30.23,0,46.52-20.07,46.52-39.2c0-14.41-6.85-27.16-26.69-35.19l-14.64-5.9\n\t\t\tc-3.78-1.42-6.38-4.49-6.38-8.5c0-5.9,5.2-10.15,12.04-10.15c12.28,0,14.17,8.74,14.17,14.88l30.7-3.54\n\t\t\tc-0.24-13.46-7.79-36.84-44.63-36.84c-27.16,0-45.82,18.18-45.82,39.44c0,13.93,6.85,25.98,26.69,34.24l11.34,4.72\n\t\t\tc6.85,2.83,8.03,6.61,8.03,10.16c0,5.2-4.02,9.68-12.52,9.68c-9.21,0-15.35-5.67-15.35-15.59c0-0.24,0-0.95,0.24-2.12\n\t\t\tL750.3,154.38z M719.36,72.44L717,84.95c-2.36-4.49-10.86-15.35-33.3-15.35c-33.06,0-59.28,28.58-59.28,69.43\n\t\t\tc0,29.76,17.71,52.66,46.05,52.66c16.06,0,25.03-8.74,29.52-15.82c-0.47,3.07-0.71,6.38-0.71,9.68c0,0.94,0,2.83,0.24,4.25h32.59\n\t\t\tc-0.24-2.12-0.24-3.78-0.24-4.49c0-5.9,0.71-12.99,2.13-19.13l20.07-93.76H719.36z M687.01,102.19c11.81,0,20.07,7.79,20.07,22.44\n\t\t\tc0,24.32-13.7,36.13-26.69,36.13c-11.81,0-20.55-8.26-20.55-23.38C659.85,120.38,669.3,102.19,687.01,102.19 M525.95,189.81\n\t\t\tl14.64-68.25c2.6-11.81,9.21-20.31,20.55-20.31c10.63,0,16.06,7.09,16.06,16.53c0,1.65-0.24,4.72-0.95,7.56l-13.7,64.47h35.66\n\t\t\tl14.88-69.9c0.71-4.01,1.18-7.79,1.18-11.57c0-22.2-14.64-38.97-38.02-38.97c-9.68,0-26.69,1.89-38.73,17\n\t\t\tc-5.67-10.15-16.29-17-31.88-17c-11.1,0-23.85,4.49-30.94,14.17c0.47-2.83,0.47-6.14,0.47-11.1h-34.95\n\t\t\tc0,3.78-0.24,10.15-2.12,19.6l-20.55,97.77h35.9l14.64-68.25c2.6-12.04,9.68-20.31,20.55-20.31c10.86,0,16.29,7.09,16.29,16.53\n\t\t\tc0,1.65-0.24,4.25-0.94,7.32l-13.93,64.71H525.95z M316,154.38v1.42c0,11.1,7.32,37.55,46.52,37.55\n\t\t\tc30.23,0,46.52-20.07,46.52-39.2c0-14.41-6.85-27.16-26.69-35.19l-14.64-5.9c-3.78-1.42-6.38-4.49-6.38-8.5\n\t\t\tc0-5.9,5.2-10.15,12.04-10.15c12.28,0,14.17,8.74,14.17,14.88l30.7-3.54c-0.24-13.46-7.79-36.84-44.64-36.84\n\t\t\tc-27.16,0-45.82,18.18-45.82,39.44c0,13.93,6.85,25.98,26.69,34.24l11.34,4.72c6.85,2.83,8.03,6.61,8.03,10.16\n\t\t\tc0,5.2-4.01,9.68-12.52,9.68c-9.21,0-15.35-5.67-15.35-15.59c0-0.24,0-0.95,0.24-2.12L316,154.38z",1,"st0"],["d","M206.45,206.72c-32.08,32.08-77.63,45-121.83,34.54c-6.68-1.58-10.81-8.27-9.23-14.95\n\t\t\tc1.58-6.68,8.27-10.81,14.95-9.23c35.76,8.46,72.59-1.98,98.54-27.93c24.87-24.87,35.6-60.34,28.71-94.89\n\t\t\tc-0.72-3.62-2.52-6.95-5.2-9.63L212,84.24c-5.18-5.18-12.99-6.93-19.88-4.45L86.15,118.18c-6.46,2.32-13.57-1.03-15.89-7.49\n\t\t\tc-2.32-6.46,1.04-13.58,7.5-15.89l105.97-38.39c15.91-5.71,33.9-1.68,45.85,10.26l0.39,0.39c6.16,6.16,10.31,13.89,12,22.34\n\t\t\tC250.48,132.11,237.2,175.97,206.45,206.72",1,"st0"],["d","M48.19,44.28c32.08-32.08,77.63-45,121.83-34.54c6.68,1.58,10.81,8.27,9.23,14.95\n\t\t\tc-1.58,6.68-8.27,10.81-14.95,9.23c-35.76-8.46-72.59,1.98-98.54,27.93c-24.87,24.86-35.6,60.34-28.71,94.89\n\t\t\tc0.72,3.62,2.52,6.95,5.2,9.63l0.39,0.39c5.18,5.18,12.99,6.93,19.88,4.45l105.96-38.39c6.46-2.32,13.57,1.03,15.89,7.49\n\t\t\tc2.32,6.46-1.04,13.58-7.5,15.89L70.92,194.59c-15.91,5.71-33.9,1.68-45.85-10.26l-0.39-0.39c-6.16-6.16-10.31-13.89-12-22.34\n\t\t\tC4.17,118.89,17.44,75.03,48.19,44.28",1,"st0"],[3,"ngClass"]],template:function(R,F){if(1&R&&(c.j41(0,"div",1),c.DNE(1,i,15,0,"ng-container",2)(2,C,1,6,"ng-template",null,0,c.C5r),c.k0s()),2&R){const S=c.sdS(3);c.Y8G("ngClass",c.eq3(3,A,"preview"===F.type)),c.R7$(),c.Y8G("ngIf","fullscreen"===F.type)("ngIfElse",S)}},dependencies:[O.YU,O.bT],styles:['.loader-content[_ngcontent-%COMP%]{display:flex;flex-direction:column}.full-size-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;width:100%}@keyframes _ngcontent-%COMP%_spinner{to{transform:rotate(360deg)}}.loading-spinner-grey[_ngcontent-%COMP%], .loader-img.loading-spinner[_ngcontent-%COMP%]{content:"";box-sizing:border-box;width:3rem;height:3rem;border-radius:50%;border:.2rem solid #333;border-top-color:#ccc;animation:_ngcontent-%COMP%_spinner .6s linear infinite}.button-loading-spinner[_ngcontent-%COMP%]{content:"";box-sizing:border-box;width:2rem;height:2rem;border-radius:50%;border:.2rem solid #fff;border-top-color:#ccc;animation:_ngcontent-%COMP%_spinner .6s linear infinite}.loading-spinner-white[_ngcontent-%COMP%]{content:"";box-sizing:border-box;width:3rem;height:3rem;border-radius:50%;border:.2rem solid #fff;border-top-color:#ccc;animation:_ngcontent-%COMP%_spinner .6s linear infinite}.loading-spinner-container[_ngcontent-%COMP%]{height:100%;display:flex;justify-content:center;align-items:center}.loader-content[_ngcontent-%COMP%]{justify-content:center;align-items:center;height:100%;background:#f7f9fa}.loader-content.preview[_ngcontent-%COMP%]{background:#f7f9fa}.loader-img[_ngcontent-%COMP%]{display:block;height:30px;width:300px;background:url(Logo_pastille_noir.98a327a76a99f9b9.png) no-repeat;background-size:contain;background-position:center;opacity:.2;animation:_ngcontent-%COMP%_opacity 3s linear 1s infinite}.loader-img.preview[_ngcontent-%COMP%]{width:20%;background-position:center}.loader-img.animated[_ngcontent-%COMP%]{opacity:.5}.loader-img.loading-spinner[_ngcontent-%COMP%]{background:unset}.loader-text-content[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin-top:-1rem;font-size:1.2rem}.loader-text-content[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin-top:.4rem}@media (max-width: 450px){.loader-text-content[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin-top:.2rem}}.loader-text-logo[_ngcontent-%COMP%]   .Logo_pastille_blanc[_ngcontent-%COMP%]{height:50px;width:10rem;display:flex;animation:_ngcontent-%COMP%_opacity 3s linear 1s infinite}.icon-fullscreen[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_color 1.5s linear infinite}@keyframes _ngcontent-%COMP%_color{0%{color:#f5f5f5}50%{color:#e5e5e5}to{color:#f5f5f5}}@keyframes _ngcontent-%COMP%_opacity{0%{opacity:100%}50%{opacity:25%}to{opacity:100%}}']}),x})()},68365:(ne,y,m)=>{m.d(y,{r:()=>A});var c=m(58527),O=m(56106);let A=(()=>{var _;class i{constructor(){this._checked=!1,this.onChange=()=>{},this.onTouched=()=>{},this.valueChange=new c.bkB}writeValue(p){this._checked=p}registerOnChange(p){this.onChange=p}registerOnTouched(p){this.onTouched=p}set checked(p){this._checked=!this._checked,this.onChange(p),this.onTouched(),this.valueChange.emit(p)}get checked(){return this._checked}}return(_=i).\u0275fac=function(p){return new(p||_)},_.\u0275cmp=c.VBU({type:_,selectors:[["app-smash-checkbox"]],outputs:{valueChange:"valueChange"},features:[c.Jv_([{provide:O.kq,multi:!0,useExisting:(0,c.Rfq)(()=>_)}])],decls:3,vars:2,consts:[[1,"container"],["type","checkbox",3,"ngModelChange","checked","ngModel"],[1,"checkmark"]
1],template:function(p,u){1&p&&(c.j41(0,"label",0)(1,"input",1),c.mxI("ngModelChange",function(P){return c.DH7(u.checked,P)||(u.checked=P),P}),c.k0s(),c.nrm(2,"span",2),c.k0s()),2&p&&(c.R7$(),c.Y8G("checked",u.checked),c.R50("ngModel",u.checked))},dependencies:[O.Zm,O.BC,O.vS],styles:['.container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.full-size-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.container[_ngcontent-%COMP%]{position:relative;margin-bottom:0;font-weight:400;cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:baseline}.container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{display:none;opacity:0;cursor:pointer;height:0;width:0;-moz-appearance:initial}.checkmark[_ngcontent-%COMP%]{position:relative;width:2rem;height:2rem;background-color:#fff;border-radius:.3rem;border:.1rem solid #ccc;transition:transform ease .25s}.container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]{border:1px solid #333}.checkmark[_ngcontent-%COMP%]:after{content:"";position:absolute}.container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]:after{opacity:1;transform:rotate(-45deg) scale(1)}.container[_ngcontent-%COMP%]   .checkmark[_ngcontent-%COMP%]:after{top:.6rem;left:.4rem;width:1rem;height:.5rem;border-bottom:.2rem solid #333;border-left:.2rem solid #333;opacity:0;transform:rotate(-45deg) scale(0);transition:transform ease .25s}']}),i})()}}]);
2//# sourceMappingURL=6064.4bb9124f32e131e7.js.map

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.