1import{a as ct}from"./chunk-JMY3WXT4.js";import{a as ne,b as mt}from"./chunk-ESE3UVT6.js";import"./chunk-DT6G25LC.js";import{a as Ke,b as Ze,c as Je,d as Ye,e as et,f as tt,g as it,h as nt,i as ot,j as at,l as rt,m as st}from"./chunk-BHV3MFIA.js";import{a as ie,b as lt,c as dt}from"./chunk-GM5K23OR.js";import{a as Qe,e as Xe}from"./chunk-SK4A2BYQ.js";import{u as Ge}from"./chunk-QGGQXCYQ.js";import"./chunk-GOAQA2OC.js";import"./chunk-CJXRRW2W.js";import"./chunk-2SJ2Q3YS.js";import{c as Be}from"./chunk-3TXQBTAU.js";import"./chunk-LPUMUIRZ.js";import"./chunk-QBGIBDAD.js";import"./chunk-V73EY762.js";import"./chunk-GZSUOX7W.js";import"./chunk-XVTULBT7.js";import"./chunk-57DKLUQT.js";import"./chunk-67G43VWR.js";import"./chunk-CJ523672.js";import{a as ze}from"./chunk-RBYCUP2Q.js";import"./chunk-22RZG74C.js";import"./chunk-RJTET5HV.js";import"./chunk-GZNVEQDL.js";import{a as te,b as Ue}from"./chunk-GEGGJYUG.js";import"./chunk-OFLGSQVY.js";import"./chunk-G34X3OQU.js";import"./chunk-CYCM3RMZ.js";import"./chunk-VRKKW3YG.js";import"./chunk-EL7BHOII.js";import"./chunk-OHXAIMNI.js";import"./chunk-XXYUR4VB.js";import"./chunk-QOBTJA7H.js";import"./chunk-WZCGUZ4C.js";import"./chunk-RMI4RNG7.js";import{b as qe}from"./chunk-BOY5XLW6.js";import"./chunk-C7MSEEIY.js";import"./chunk-FHSKWREM.js";import{a as He,b as Y,c as je}from"./chunk-7H6PHJQU.js";import{c as Z,j as J}from"./chunk-L2J5ABFW.js";import"./chunk-DWAZZ7VO.js";import{I as Me,K as be,L as ye,c as $,e as U,h as z,i as Ve,o as B,p as Se,t as Ee,w as xe,x as G,y as Q,z as X}from"./chunk-MTWVMMTV.js";import{p as ee}from"./chunk-6FMUVZTV.js";import{a as We,b as $e}from"./chunk-4GF7H5DQ.js";import"./chunk-2UU7EWIA.js";import"./chunk-E52PDVPR.js";import"./chunk-UKTE5MGH.js";import"./chunk-DASFUKKT.js";import"./chunk-YHWQER4F.js";import{a as K}from"./chunk-BT75IBSD.js";import{c as Fe,d as Ie,e as Te,g as Oe,h as ke,i as Le,j as Re}from"./chunk-EAATH5OS.js";import"./chunk-EJFYM7KG.js";import"./chunk-4IY5Y64V.js";import{g as Ae,i as Ne}from"./chunk-OAUPCMQT.js";import{a as Pe}from"./chunk-MNVAI74P.js";import{h as De,i as re}from"./chunk-N7TVKSTK.js";import"./chunk-XHS2HQOR.js";import{a as O,c as we}from"./chunk-SNKY6I5R.js";import{E as Ce,h as he,o as q,p as W}from"./chunk-QKVROGXD.js";import{Aa as v,Ab as C,Ba as A,Ca as N,Ec as h,Fc as w,Mb as H,Mc as y,Nb as j,Nc as D,Oc as P,Sb as f,Sc as ge,Uc as d,Vc as k,Wc as M,ad as F,bd as I,cd as T,hc as g,hd as ue,id as ve,ja as me,jc as pe,ka as R,md as fe,oa as ce,od as _e,pb as b,sc as a,tc as r,ub as c,uc as _,vc as V,wc as S,yc as x,za as u}from"./chunk-4BCQERYJ.js";import{a as le,r as de}from"./chunk-DYO6X7YC.js";var ae=(()=>{let o=class o{constructor(e){this.http=e,this.api_base_url=Pe.api_base_url+"/api/cms/videos"}getVideos(e=null){return this.http.get(this.api_base_url,{headers:new O({"X-Requested-With":"XMLHttpRequest"})})}getVideoByID(e){return this.http.get(this.api_base_url+`/${e}`,{headers:new O({"X-Requested-With":"XMLHttpRequest"})})}updateVideo(e,n){return this.http.post(this.api_base_url+`/${e}`,n,{headers:new O({"X-Requested-With":"XMLHttpRequest"})})}updateVideoSetting(e,n){return this.http.post(this.api_base_url+`/${e}/update-setting`,n,{headers:new O({"X-Requested-With":"XMLHttpRequest"})})}deleteVideo(e){return this.http.delete(this.api_base_url+`/${e}`,{headers:new O({"X-Requested-With":"XMLHttpRequest"})})}};o.\u0275fac=function(n){return new(n||o)(ce(we))},o.\u0275prov=me({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var xt=["video"],Mt=["existing_video"],bt=["canvas"];function yt(i,o){i&1&&(a(0,"div",33)(1,"div",34),A(),a(2,"svg",35)(3,"mask",36),_(4,"rect",37),r(),a(5,"g",38),_(6,"path",39),r()()(),N(),a(7,"p",40),d(8),fe(9,"translate"),r()()),i&2&&(c(8),k(_e(9,1,"edit_event_video.Dragavideofilehere","Drag a video file here")))}function Dt(i,o){if(i&1&&_(0,"video",43,2),i&2){let m=w(2);g("src",m.videoPreviewUrl,b)}}function Pt(i,o){if(i&1&&_(0,"video",43,3),i&2){let m=w(2);g("src",m.existingVideo.file_url,b)}}function Ft(i,o){if(i&1&&(a(0,"div",41),f(1,Dt,2,1,"video",42)(2,Pt,2,1,"video",42),r()),i&2){let m=w();
1c(),g("ngIf",m.videoPreviewUrl),c(),g("ngIf",!m.videoPreviewUrl&&(m.existingVideo==null?null:m.existingVideo.file_url))}}function It(i,o){if(i&1){let m=x();a(0,"button",14),h("click",function(n){return u(m),w().capturePoster(),v(n.stopPropagation())}),a(1,"span"),d(2,"Capture Poster"),r()()}}function Tt(i,o){if(i&1){let m=x();a(0,"div",44)(1,"div",45),_(2,"img",46),r(),a(3,"button",14),h("click",function(n){return u(m),w().capturePoster(),v(n.stopPropagation())}),a(4,"span"),d(5,"Change poster"),r()()()}if(i&2){let m=w();c(2),g("src",m.posterPreview,b)}}function Ot(i,o){if(i&1&&(a(0,"option",47),d(1),r()),i&2){let m=o.$implicit;g("value",m.lang),c(),M(" ",m.langName.toUpperCase()," ")}}function kt(i,o){i&1&&(a(0,"div",48),d(1,"Field is required"),r())}function Lt(i,o){i&1&&(a(0,"div",48),d(1,"Field is required"),r())}function Rt(i,o){i&1&&(a(0,"div",48),d(1,"Field is required"),r())}var gt=(()=>{let o=class o{constructor(e,n,t,s,p,l){this.dialogRef=e,this.data=n,this.globals=t,this.toastService=s,this.cmsEventVideosService=p,this.fb=l,this.languages=[],this.existingVideo=null,this.uploadedVideo=null,this.videoPreviewUrl=null,this.isDragOver=!1,this.selectedLanguage="en",this.languageFields={},this.isActive=!1,this.isApprove=!1,this.poster=null,this.posterPreview="",this.Icons=ct,this.languages=this.globals.getCountryData(),this.videoForm=this.fb.group({title:["",U.required],description:["",U.required],tags:["",U.required]})}ngOnInit(){this.existingVideo=this.data,this.posterPreview=this.data.poster_file_url,this.initializeLanguageFields(),this.loadVideoData(),this.isActive=!!this.data.is_active,this.isApprove=!!this.data.is_approve}initializeLanguageFields(){this.existingVideo&&this.existingVideo.fields&&(this.existingVideo.fields.forEach(e=>{this.languageFields[e.lang]=le({},e)}),this.existingVideo.fields.length>0&&(this.selectedLanguage=this.existingVideo.fields[0].lang))}onDragOver(e){e.preventDefault(),this.isDragOver=!0}onDragLeave(e){e.preventDefault(),this.isDragOver=!1}onDrop(e){e.preventDefault(),this.isDragOver=!1;let n=e.dataTransfer?.files;n&&n.length>0&&this.handleFileSelect(n[0])}onFileSelected(e){let n=e.target.files[0];n&&this.handleFileSelect(n)}handleFileSelect(e){if(e.size>1e7){this.toastService.show({type:"warning",text:"Video is too large. It has to be less than 10MB."});return}e.type.startsWith("video/")&&(this.uploadedVideo=e,this.videoPreviewUrl=URL.createObjectURL(e),this.posterPreview="",this.poster=null)}onLanguageChange(e){this.saveLanguageData(this.selectedLanguage),this.selectedLanguage=e,this.loadVideoData()}saveLanguageData(e){let n=this.videoForm.value,t=this.languageFields[e],s=t?t.id:0;this.languageFields[e]={id:s,lang:e,title:n.title||"",description:n.description||"",tags:n.tags||""}}loadVideoData(){let e=this.languageFields[this.selectedLanguage];e?this.videoForm.patchValue({title:e.title||"",description:e.description||"",tags:e.tags||""}):(this.videoForm.patchValue({title:"",description:"",tags:""}),this.videoForm.markAsPristine(),console.log("Form cleared for new language"))}close(){this.dialogRef.close()}submit(){this.saveLanguageData(this.selectedLanguage);let e=new FormData;this.uploadedVideo&&e.append("video",this.uploadedVideo),Object.keys(this.languageFields).filter(s=>{let p=this.languageFields[s];return p.title.trim()||p.description.trim()||p.tags.trim()}).forEach((s,p)=>{let l=this.languageFields[s];e.append(`fields[${p}][id]`,l.id?l.id.toString():""),e.append(`fields[${p}][title]`,l.title),e.append(`fields[${p}][lang]`,l.lang),e.append(`fields[${p}][description]`,l.description),e.append(`fields[${p}][tags]`,l.tags)}),e.append("is_active",this.isActive?"1":"0"),e.append("is_approve",this.isApprove?"1":"0"),this.poster&&e.append("poster",this.poster),this.updateVideo(this.data.id,e)}updateVideo(e,n){this.globals.startLoader(),this.cmsEventVideosService.updateVideo(e,n).subscribe(t=>{t?.data&&(this.dialogRef.close(t.data),this.toastService.show({type:"success",text:"Updated!"})),this.globals.stopLoader()},t=>{this.toastService.show({type:"error",msgFile:"errors",msgGroup:"errors",msgCode:t?.code}),this.dialogRef.close("data"),this.globals.stopLoader()})}capturePoster(){if(!this.videoRef&&!this.videoRef2||!this.canvas){this.toastService.show({type:"error",msgFile:"errors",msgGroup:"editEventVideo",msgCode:4.1});return}let e=this.videoRef?.nativeElement?this.videoRef?.nativeElement:this.videoRef2?.nativeElement,n=this.canvas.nativeElement,t=n.getContext("2d"),s=e.videoWidth,p=e.videoHeight;if(n.width=s,n.height=p,t){t.drawImage(e,0,0,s,p);let l=n.toDataURL("image/png");this.getPosterFile(l).then(E=>{this.posterPreview=l,this.poster=E,this.toastService.show({type:"success",text:"Poster captured!"})}).catch(E=>{this.toastService.show({type:"error",msgFile:"errors",msgGroup:"editEventVideo",msgCode:5})})}}getPosterFile(e){return de(this,null,function*(){let t=yield(yield fetch(e)).blob(),E=`video_poster_${Date.now()}.png`,L="image/png";return new File([t],E,{type:L})})}};o.\u0275fac=function(n){return new(n||o)(C(Fe),C(Ie),C(K),C(ee),C(ae),C(Me))}
vendor: 4,857 bytes, line 1
1,o.\u0275cmp=H({type:o,selectors:[["app-cms-event-videos-dialog"]],viewQuery:function(n,t){if(n&1&&(y(xt,5),y(Mt,5),y(bt,5)),n&2){let s;D(s=P())&&(t.videoRef=s.first),D(s=P())&&(t.videoRef2=s.first),D(s=P())&&(t.canvas=s.first)}},standalone:!1,decls:59,vars:18,consts:[["fileInput",""],["canvas",""],["video",""],["existing_video",""],["mat-dialog-title","",2,"margin","10px"],["mat-dialog-content","",1,"content","cms-event-videos-dialog"],[1,"upload-video-container"],[1,"video-upload-box",3,"dragover","dragleave","drop"],["type","file","accept","video/*",2,"display","none",3,"change"],["class","upload-state",4,"ngIf"],[1,"preview-section"],[1,"video-section"],["class","video-preview-state",4,"ngIf"],[1,"actions"],[1,"btn","btn-default",2,"margin","4px auto","display","block",3,"click"],["class","btn btn-default","style","margin: 4px auto; display: block;",3,"click",4,"ngIf"],["class","poster-section",4,"ngIf"],[2,"display","none"],[1,"language-switcher"],[1,"language-label"],["title","Language selector",1,"language-select",3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"video-form",3,"formGroup"],[1,"form-group"],[1,"example-full-width"],["matInput","","formControlName","title","type","text","placeholder","Title"],["class","item-error",4,"ngIf"],["matInput","","formControlName","description","placeholder","Description...","rows","3"],["matInput","","formControlName","tags","type","text","placeholder","Tags"],[3,"ngModelChange","ngModel"],["mat-dialog-actions","",1,"mat-dialog-actions"],["mat-button","","cdkFocusInitial","",1,"btn",3,"click"],["mat-button","","type","submit",1,"btn","btn-success",3,"click","disabled"],[1,"upload-state"],[1,"upload-icon"],["xmlns","http://www.w3.org/2000/svg","width","30","height","31","viewBox","0 0 30 31","fill","none"],["id","mask0_36934_99009","maskUnits","userSpaceOnUse","x","0","y","0","width","30","height","31",2,"mask-type","alpha"],["y","0.625","width","30","height","30","fill","#D9D9D9"],["mask","url(#mask0_36934_99009)"],["d","M8.125 25.625C6.22917 25.625 4.60938 24.9688 3.26562 23.6562C1.92188 22.3438 1.25 20.7396 1.25 18.8438C1.25 17.2188 1.73958 15.7708 2.71875 14.5C3.69792 13.2292 4.97917 12.4167 6.5625 12.0625C7.08333 10.1458 8.125 8.59375 9.6875 7.40625C11.25 6.21875 13.0208 5.625 15 5.625C17.4375 5.625 19.5052 6.47396 21.2031 8.17188C22.901 9.86979 23.75 11.9375 23.75 14.375C25.1875 14.5417 26.3802 15.1615 27.3281 16.2344C28.276 17.3073 28.75 18.5625 28.75 20C28.75 21.5625 28.2031 22.8906 27.1094 23.9844C26.0156 25.0781 24.6875 25.625 23.125 25.625H16.25C15.5625 25.625 14.974 25.3802 14.4844 24.8906C13.9948 24.401 13.75 23.8125 13.75 23.125V16.6875L11.75 18.625L10 16.875L15 11.875L20 16.875L18.25 18.625L16.25 16.6875V23.125H23.125C24 23.125 24.7396 22.8229 25.3438 22.2188C25.9479 21.6146 26.25 20.875 26.25 20C26.25 19.125 25.9479 18.3854 25.3438 17.7812C24.7396 17.1771 24 16.875 23.125 16.875H21.25V14.375C21.25 12.6458 20.6406 11.1719 19.4219 9.95312C18.2031 8.73438 16.7292 8.125 15 8.125C13.2708 8.125 11.7969 8.73438 10.5781 9.95312C9.35938 11.1719 8.75 12.6458 8.75 14.375H8.125C6.91667 14.375 5.88542 14.8021 5.03125 15.6563C4.17708 16.5104 3.75 17.5417 3.75 18.75C3.75 19.9583 4.17708 20.9896 5.03125 21.8438C5.88542 22.6979 6.91667 23.125 8.125 23.125H11.25V25.625H8.125Z","fill","#6B6D75"],[1,"upload-text"],[1,"video-preview-state"],["crossorigin","anonymous","controls","","class","video-preview",3,"src",4,"ngIf"],["crossorigin","anonymous","controls","",1,"video-preview",3,"src"],[1,"poster-section"],[1,"poster-preview"],["alt","Captured Frame","width","250",3,"src"],[3,"value"],[1,"item-error"]],template:function(n,t){if(n&1){let s=x();a(0,"h3",4)(1,"span"),d(2),r()(),a(3,"div",5)(4,"div",6)(5,"div",7),h("dragover",function(l){return u(s),v(t.onDragOver(l))})("dragleave",function(l){return u(s),v(t.onDragLeave(l))})("drop",function(l){return u(s),v(t.onDrop(l))}),a(6,"input",8,0),h("change",function(l){return u(s),v(t.onFileSelected(l))}),r(),f(8,yt,10,4,"div",9),a(9,"div",10)(10,"div",11),f(11,Ft,3,2,"div",12),a(12,"div",13)(13,"button",14),h("click",function(l){return u(s),ge(7).click(),v(l.stopPropagation())}),a(14,"span"),d(15,"Change Video"),r()(),f(16,It,3,0,"button",15),r()(),f(17,Tt,6,1,"div",16),r(),_(18,"canvas",17,1),r(),_(20,"br"),a(21,"div",18)(22,"label",19),d(23,"Language:"),r(),a(24,"select",20),h("ngModelChange",function(l){return u(s),v(t.onLanguageChange(l))}),f(25,Ot,2,2,"option",21),r()(),_(26,"br"),a(27,"form",22)(28,"div",23)(29,"mat-form-field",24)(30,"mat-label"),d(31,"Title"),r(),_(32,"input",25),r(),f(33,kt,2,0,"div",26),r(),a(34,"div",23)(35,"mat-form-field",24)(36,"mat-label"),d(37,"Description"),r(),_(38,"textarea",27),r(),f(39,Lt,2,0,"div",26),r(),a(40,"div",23)(41,"mat-form-field",24)(42,"mat-label"),d(43,"Tags"),r(),_(44,"input",28),r(),f(45,Rt,2,0,"div",26),r()(),a(4
16,"mat-checkbox",29),T("ngModelChange",function(l){return u(s),I(t.isActive,l)||(t.isActive=l),v(l)}),a(47,"span"),d(48,"is_active"),r()(),_(49,"br"),a(50,"mat-checkbox",29),T("ngModelChange",function(l){return u(s),I(t.isApprove,l)||(t.isApprove=l),v(l)}),a(51,"span"),d(52,"is_approve"),r()()()(),a(53,"div",30)(54,"button",31),h("click",function(){return u(s),v(t.close())}),d(55,"Close"),r(),a(56,"button",32),h("click",function(){return u(s),v(t.submit())}),a(57,"span"),d(58,"Edit"),r()()()}if(n&2){let s,p,l;c(2),M("Edit Video #",t.data.id,""),c(3),pe("drag-over",t.isDragOver)("has-video",t.uploadedVideo||t.existingVideo&&t.existingVideo.file_url),c(3),g("ngIf",!t.uploadedVideo&&!(t.existingVideo&&t.existingVideo.file_url)),c(3),g("ngIf",t.uploadedVideo||t.existingVideo&&t.existingVideo.file_url),c(5),g("ngIf",!t.posterPreview),c(),g("ngIf",t.posterPreview),c(7),g("ngModel",t.selectedLanguage),c(),g("ngForOf",t.languages),c(2),g("formGroup",t.videoForm),c(6),g("ngIf",((s=t.videoForm.get("title"))==null?null:s.touched)&&((s=t.videoForm.get("title"))==null?null:s.hasError("required"))),c(6),g("ngIf",((p=t.videoForm.get("description"))==null?null:p.touched)&&((p=t.videoForm.get("description"))==null?null:p.hasError("required"))),c(6),g("ngIf",((l=t.videoForm.get("tags"))==null?null:l.touched)&&((l=t.videoForm.get("tags"))==null?null:l.hasError("required"))),c(),F("ngModel",t.isActive),c(4),F("ngModel",t.isApprove),c(6),g("disabled",t.videoForm.invalid)}},dependencies:[q,W,Se,Q,X,$,G,z,Ve,B,Ee,xe,J,Z,Y,Oe,Le,ke,qe,te,Ae],styles:[".cms-event-videos-dialog[_ngcontent-%COMP%]{font-size:14px;min-width:300px}.cms-event-videos-dialog[_ngcontent-%COMP%] .preview-section[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:24px}.cms-event-videos-dialog[_ngcontent-%COMP%] .preview-section[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}.cms-event-videos-dialog[_ngcontent-%COMP%] .video-preview[_ngcontent-%COMP%]{width:250px;display:block;margin:0 auto}.cms-event-videos-dialog[_ngcontent-%COMP%] .poster-preview[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:16px}.cms-event-videos-dialog[_ngcontent-%COMP%] .language-select[_ngcontent-%COMP%], .cms-event-videos-dialog[_ngcontent-%COMP%] .form-input[_ngcontent-%COMP%]{background:#fff;color:#000}.cms-event-videos-dialog[_ngcontent-%COMP%] .language-select[_ngcontent-%COMP%]{border:1px solid gray}.cms-event-videos-dialog[_ngcontent-%COMP%] .example-full-width[_ngcontent-%COMP%]{width:100%;line-height:1}.mat-dialog-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-around}"]});let i=o;return i})();var At=()=>[10,25,100],Nt=i=>[i];function Ht(i,o){i&1&&(a(0,"th",34),d(1,"ID"),r())}function jt(i,o){if(i&1&&(a(0,"td",35),d(1),r()),i&2){let m=o.$implicit;c(),k(m.id)}}function qt(i,o){i&1&&(a(0,"th",36),d(1,"Video"),r())}function Wt(i,o){if(i&1&&(a(0,"td",35),_(1,"video",37),r()),i&2){let m=o.$implicit;c(),g("src",m.file_url,b)}}function $t(i,o){i&1&&(a(0,"th",36),d(1,"Poster"),r())}function Ut(i,o){if(i&1&&(V(0),_(1,"img",39),S()),i&2){let m=w().$implicit;c(),g("src",m.poster_file_url,b)}}function zt(i,o){if(i&1&&(a(0,"td",35),f(1,Ut,2,1,"ng-container",38),r()),i&2){let m=o.$implicit;c(),g("ngIf",m.poster_file_url)}}function Bt(i,o){i&1&&(a(0,"th",36),d(1,"Event"),r())}function Gt(i,o){if(i&1&&(a(0,"td",35)(1,"a",40),d(2),r(),a(3,"div"),d(4),r()()),i&2){let m=o.$implicit;c(),g("routerLink",ve(3,Nt,"/"+m.event_info.event_id)),c(),k(m.event_info.title),c(2),M("id: ",m.event_info.event_id,"")}}function Qt(i,o){i&1&&(a(0,"th",41),d(1," Fields "),r())}function Xt(i,o){if(i&1&&(a(0,"div",43)(1,"strong"),d(2),r(),a(3,"div",44)(4,"div")(5,"strong"),d(6,"Title:"),r(),d(7),r(),a(8,"div")(9,"strong"),d(10,"Description:"),r(),d(11),r(),a(12,"div")(13,"strong"),d(14,"Tags:"),r(),d(15),r()()()),i&2){let m=o.$implicit;c(2),M("",m.lang.toUpperCase(),":"),c(5),M(" ",m.title||"N/A",""),c(4),M(" ",m.description||"N/A",""),c(4),M(" ",m.tags||"N/A","")}}function Kt(i,o){if(i&1&&(a(0,"td",35),f(1,Xt,16,4,"div",42),r()),i&2){let m=o.$implicit;c(),g("ngForOf",m.fields)}}function Zt(i,o){i&1&&(a(0,"th",36),d(1,"Approve"),r())}function Jt(i,o){if(i&1){let m=x();a(0,"td",35)(1,"mat-checkbox",45),h("change",function(n){let t=u(m).$implicit,s=w();return v(s.updateCheckbox("is_approve",n.checked,t.id))}),r()()}if(i&2){let m=o.$implicit;c(),g("checked",!!m.is_approve)}}function Yt(i,o){i&1&&(a(0,"th",36),d(1,"Active"),r())}function ei(i,o){if(i&1){let m=x();a(0,"td",35)(1,"mat-checkbox",45),h("change",function(n){let t=u(m).$implicit,s=w();return v(s.updateCheckbox("is_active",n.checked,t.id))}),r()()}if(i&2){let m=o.$implicit;c(),g("checked",!!m.is_active)}}function ti(i,o){i&1&&(a(0,"th",36),d(1," Options "),r())}function ii(i,o){if(i&1){let m=x();a(0,"td",35)(1,"button",46),h("click",function(){let n=u(m).$implicit,t=w();return v(t.openDialog("edit",n.id))}),a(2,"mat-icon"),d(3,"edit"),r(),a(4,"span"),d(5,"Edit"),r()(),a(6,"button",46),h("click",function(){let n=u(m).$implicit,t=w();return v(t.delete(n.id))}),a(7,"mat-icon",47),d(8,"delete_forever"),r(),a(9,"span"),d(10,"Delete"),r()()()}}function ni(i,o){i&1&&_(0,"tr",48)}function oi(i,o){i&1&&_(0,"tr",49)}var ut=(()=>{let o=class o{constructor(e,n,t,s,p){this.cmsEventVideosService=e,this.globals=n,this.location=t,this.dialog=s,this.toastService=p,this.displayedColumns=["id","file_url","poster_file_url","event_info","fields","is_approve","is_active","options"],this.data=[],this.filterInput="",this.filterSelect=""}ngAfterViewInit(){this.sort.sortChange.subscribe(()=>this.paginator.pageIndex=0),this.fetchData()}fetchData(){this.globals.startLoader(),this.cmsEventVideosService.getVideos().subscribe(e=>{this.dataSource=new st(e.data),this.dataSource.paginator=this.paginator,this.globals.stopLoader()})}applyFilter(e){let n=e.target,t=n.value;n.tagName==="SELECT"?(this.filterSelect=t,this.filterInput=""):(this.filterInput=t,this.filterSelect=""),this.updateFilter()}updateFilter(){this.filterSelect?(this.dataSource.filterPredicate=(e,n
1)=>n==="is_approve"?e.is_approve===1:n==="is_active"?e.is_active===1:n==="approve_and_active"?e.is_approve===1&&e.is_active===1:n==="not_approve_and_not_active"?e.is_approve===0&&e.is_active===0:!0,this.dataSource.filter=this.filterSelect):this.filterInput?(this.dataSource.filterPredicate=(e,n)=>{let t=n.toLowerCase();return e.id.toString().includes(t)||e.event_info?.event_id?.toString().includes(t)||e.event_info?.title?.toLowerCase().includes(t)||e.fields?.some(s=>s.title?.toLowerCase().includes(t)||s.description?.toLowerCase().includes(t)||s.tags?.toLowerCase().includes(t))},this.dataSource.filter=this.filterInput.trim().toLowerCase()):(this.dataSource.filterPredicate=()=>!0,this.dataSource.filter=""),this.dataSource.paginator&&this.dataSource.paginator.firstPage()}back(){this.location.back()}openDialog(e="add",n){let t=e==="add"?{action:e}:{action:e,video_id:n};this.globals.startLoader(),this.cmsEventVideosService.getVideoByID(n).subscribe(s=>{this.globals.stopLoader(),this.dialog.open(gt,{data:s.data,minWidth:"50vw"}).afterClosed().subscribe(l=>{if(l&&l.hasOwnProperty("id")&&e=="edit"){let E=this.dataSource.data,L=E.findIndex(se=>se.id==l.id);L>=0&&(E[L]=l,this.dataSource.data=E)}})})}updateCheckbox(e,n,t){let s=new FormData;s.append("name",e),s.append("value",n?"1":"0"),this.globals.startLoader(),this.cmsEventVideosService.updateVideoSetting(t,s).subscribe(p=>{this.globals.stopLoader()})}delete(e){confirm(`Want to delete Video ${e} and all related fields?`)&&(this.globals.startLoader(),this.cmsEventVideosService.deleteVideo(e).subscribe(t=>{let s=this.dataSource.data,p=s.findIndex(l=>l.id==e);s.splice(p,1),this.dataSource.data=s,this.toastService.show({type:"success",text:"Deleted!"}),this.globals.stopLoader()},t=>{this.globals.stopLoader()}))}};o.\u0275fac=function(n){return new(n||o)(C(ae),C(K),C(he),C(Te),C(ee))},o.\u0275cmp=H({type:o,selectors:[["app-cms-event-videos"]],viewQuery:function(n,t){if(n&1&&(y(ne,5),y(ie,5)),n&2){let s;D(s=P())&&(t.paginator=s.first),D(s=P())&&(t.sort=s.first)}},standalone:!1,decls:54,vars:7,consts:[["input",""],[1,"cms_event_videos"],[1,"list-header"],[1,"close-btn",2,"width","50px","height","50px",3,"click"],["width","10","height","14","viewBox","0 0 10 14","fill","none","xmlns","http://www.w3.org/2000/svg",1,"arrow-close-modal"],["d","M9.49219 1.64063L4.13281 7L9.49219 12.3594L7.85156 14L0.851562 7L7.85156 0L9.49219 1.64063Z","fill","black"],[1,"list-title"],[2,"display","flex"],["subscriptSizing","dynamic",1,"filter-input",2,"width","100%"],["matInput","","placeholder","Ex. Event_ID, Name, Description, Tag",3,"keyup","ngModelChange","ngModel"],[3,"change","ngModelChange","ngModel"],["value","","selected",""],["value","is_approve"],["value","is_active"],["value","approve_and_active"],["value","not_approve_and_not_active"],[1,"header-actions"],[1,"table-container"],["mat-table","","matSort","",1,"table",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","file_url"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","poster_file_url"],["matColumnDef","event_info"],["matColumnDef","fields"],["mat-header-cell","","disableClear","",4,"matHeaderCellDef"],["matColumnDef","is_approve"],["matColumnDef","is_active"],["matColumnDef","options","stickyEnd",""],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["aria-label","Select page",3,"pageSizeOptions"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["controls","",2,"width","250px",3,"src"],[4,"ngIf"],["alt","Captured Frame","width","250",3,"src"],["href","#",3,"routerLink"],["mat-header-cell","","disableClear",""],["class","field-item",4,"ngFor","ngForOf"],[1,"field-item"],[1,"field-details"],[3,"change","checked"],["mat-menu-item","",3,"click"],[2,"color","#ce2e2e"],["mat-header-row",""],["mat-row",""]],template:function(n,t){if(n&1){let s=x();a(0,"div",1)(1,"div",2)(2,"button",3),h("click",function(){return u(s),v(t.back())}),A(),a(3,"svg",4),_(4,"path",5),r()(),N(),a(5,"div",6),d(6,"Event Featured Videos"),r()(),a(7,"div",7)(8,"mat-form-field",8)(9,"mat-label"),d(10,"Filter"),r(),a(11,"input",9,0),h("keyup",function(l){return u(s),v(t.applyFilter(l))}),T("ngModelChange",function(l){return u(s),I(t.filterInput,l)||(t.filterInput=l),v(l)}
1),r()(),a(13,"select",10),h("change",function(l){return u(s),v(t.applyFilter(l))}),T("ngModelChange",function(l){return u(s),I(t.filterSelect,l)||(t.filterSelect=l),v(l)}),a(14,"option",11),d(15,"All"),r(),a(16,"option",12),d(17,"Approve"),r(),a(18,"option",13),d(19,"Active"),r(),a(20,"option",14),d(21,"Approve + Active"),r(),a(22,"option",15),d(23,"Not Approve + Not Active"),r()()(),_(24,"div",16),a(25,"div",17)(26,"table",18),V(27,19),f(28,Ht,2,0,"th",20)(29,jt,2,1,"td",21),S(),V(30,22),f(31,qt,2,0,"th",23)(32,Wt,2,1,"td",21),S(),V(33,24),f(34,$t,2,0,"th",23)(35,zt,2,1,"td",21),S(),V(36,25),f(37,Bt,2,0,"th",23)(38,Gt,5,5,"td",21),S(),V(39,26),f(40,Qt,2,0,"th",27)(41,Kt,2,1,"td",21),S(),V(42,28),f(43,Zt,2,0,"th",23)(44,Jt,2,1,"td",21),S(),V(45,29),f(46,Yt,2,0,"th",23)(47,ei,2,1,"td",21),S(),V(48,30),f(49,ti,2,0,"th",23)(50,ii,11,0,"td",21),S(),f(51,ni,1,0,"tr",31)(52,oi,1,0,"tr",32),r()(),_(53,"mat-paginator",33),r()}n&2&&(c(11),F("ngModel",t.filterInput),c(2),F("ngModel",t.filterSelect),c(13),g("dataSource",t.dataSource),c(25),g("matHeaderRowDef",t.displayedColumns),c(),g("matRowDefColumns",t.displayedColumns),c(),g("pageSizeOptions",ue(6,At)))},dependencies:[q,W,De,ne,Ke,Je,it,Ye,Ze,nt,et,tt,ot,at,Qe,We,Q,X,$,G,z,B,J,Z,Y,ie,lt,te],styles:[".cms_event_videos[_ngcontent-%COMP%]{color:#000;background:#fff;padding:0 15px;max-width:1400px;margin:0 auto}.cms_event_videos[_ngcontent-%COMP%] .list-header[_ngcontent-%COMP%]{display:flex}.cms_event_videos[_ngcontent-%COMP%] .list-header[_ngcontent-%COMP%] .list-title[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;text-align:center;flex-grow:1;font-size:18px;line-height:1.5}.cms_event_videos[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]{top:-50px;left:-35px;display:block;z-index:999;cursor:pointer;-webkit-transition-property:all;-webkit-transition-duration:.3s;-webkit-transition-timing-function:ease;height:50px}.cms_event_videos[_ngcontent-%COMP%] .thumbnail[_ngcontent-%COMP%]:hover{position:relative;height:auto;max-height:300px;transform:scale(1);left:auto;top:auto;margin:auto}.cms_event_videos[_ngcontent-%COMP%] .table-container[_ngcontent-%COMP%]{overflow-x:scroll}.cms_event_videos[_ngcontent-%COMP%] .header-actions[_ngcontent-%COMP%]{display:flex;gap:20px}.cms_event_videos[_ngcontent-%COMP%] .btn-success[_ngcontent-%COMP%]{display:block;height:56px}.cms_event_videos[_ngcontent-%COMP%] .field-item[_ngcontent-%COMP%]{margin-bottom:10px;padding:8px;border-left:3px solid #007bff;background-color:#f8f9fa}.cms_event_videos[_ngcontent-%COMP%] .field-item[_ngcontent-%COMP%] .field-details[_ngcontent-%COMP%]{margin-left:10px;font-size:13px}.cms_event_videos[_ngcontent-%COMP%] .field-item[_ngcontent-%COMP%] .field-details[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{margin-bottom:3px}.cms_event_videos[_ngcontent-%COMP%] .field-item[_ngcontent-%COMP%] .field-details[_ngcontent-%COMP%] div[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#495057;font-weight:600}"]});let i=o;return i})();var ai=[{path:"",component:ut}],vt=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=j({type:o}),o.\u0275inj=R({imports:[re.forChild(ai),re]});let i=o;return i})();var pn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=j({type:o}),o.\u0275inj=R({imports:[Ce,vt,mt,rt,Xe,$e,be,ye,He,je,dt,Ge,Ue,Re,Ne,Be,ze]});let i=o;return i})();export{pn as CmsEventVideosModule}; 2/**i18n:781fa348e2b2338c8b8af109ef025fd7bb624da87d4802aee2d7ec6e37a8b725*/
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.