PageSourceSearch

https://app.merren.io/639.e63be4c01b5ef526.js

js merren.io collected 2026-10-04 03:13:42 UTC 428,860 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmerren_customer_portal=self.webpackChunkmerren_customer_portal||[]).push([[639],{8639:(La,N,h)=>{h.r(N),h.d(N,{DeploySurveyModule:()=>Ga});var p=h(177),g=h(1188),_=h(9960),u=h(7421),e=h(4438),b=h(1722),x=h(5794),v=h(2796),r=h(9417);const z=["publishsurveyModel"],Y=["createLinkModel"],q=["questioncoutzeroModel"],U=["checkActiveCampaignModel"],J=o=>({"pointer-events":o}),W=(o,s,t)=>({totalItems:o,itemsPerPage:s,currentPage:t});function H(o,s){if(1&o){const t=e.RV6();e.j41(0,"a",65),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG(3);return e.Njj(a.copyLink(n))}),e.EFF(1,"Copy Link"),e.k0s()}if(2&o){const t=e.XpG().$implicit;e.xc7("pointer-events",0==t.isActive?"none":"unset")}}function K(o,s){1&o&&(e.j41(0,"span",66),e.EFF(1,"NA"),e.k0s())}function Q(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",67),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG(3);return e.Njj(a.confirmDeactivate(n))}),e.EFF(1),e.k0s()}if(2&o){const t=e.XpG().$implicit;e.AVh("sl-action-btn--deactivated",!1===t.isActive),e.Y8G("disabled",0==t.isActive),e.R7$(),e.SpI(" ","Deactivate Link"," ")}}function Z(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",68),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG(3);return e.Njj(a.navigate(n))}),e.EFF(1," View Report "),e.k0s()}}function ee(o,s){if(1&o&&(e.j41(0,"tr",58)(1,"td")(2,"div",59),e.EFF(3),e.k0s()(),e.j41(4,"td"),e.EFF(5),e.k0s(),e.j41(6,"td"),e.EFF(7),e.nI1(8,"date"),e.k0s(),e.j41(9,"td"),e.EFF(10),e.k0s(),e.j41(11,"td"),e.EFF(12),e.k0s(),e.j41(13,"td"),e.EFF(14),e.k0s(),e.j41(15,"td")(16,"span",60),e.EFF(17),e.k0s()(),e.j41(18,"td"),e.DNE(19,H,2,2,"a",61)(20,K,2,0,"span",62),e.k0s(),e.j41(21,"td"),e.DNE(22,Q,2,4,"button",63)(23,Z,2,0,"button",64),e.k0s()()),2&o){const t=s.$implicit;e.R7$(2),e.Y8G("title",t.campaignName||("Link"==t.collectorType?"WhatsApp":t.collectorType)),e.R7$(),e.JRh(t.campaignName?t.campaignName:"Link"==t.collectorType?"WhatsApp":t.collectorType),e.R7$(2),e.JRh("Link"==t.collectorType?"WhatsApp":t.collectorType),e.R7$(2),e.JRh(e.bMT(8,13,t.createdAt)),e.R7$(3),e.JRh(t.noOfClicks?t.noOfClicks:"NA"),e.R7$(2),e.JRh(t.surveyStartedCount?t.surveyStartedCount:"NA"),e.R7$(2),e.JRh(t.surveyCompletedCount?t.surveyCompletedCount:"NA"),e.R7$(2),e.Y8G("ngClass",!1===t.isActive?"sl-inactive":"sl-active"),e.R7$(),e.SpI(" ",0==t.isActive?"Inactive":"Active"," "),e.R7$(2),e.Y8G("ngIf","BuyResponses"!=t.collectorType&&!t.isPush),e.R7$(),e.Y8G("ngIf",t.isPush),e.R7$(2),e.Y8G("ngIf",!t.isPush),e.R7$(),e.Y8G("ngIf",t.isPush)}}function te(o,s){if(1&o&&(e.j41(0,"div",54)(1,"table",55)(2,"thead")(3,"tr")(4,"th",56),e.EFF(5,"Campaign"),e.k0s(),e.j41(6,"th",56),e.EFF(7,"Channel"),e.k0s(),e.j41(8,"th",56),e.EFF(9,"Created On"),e.k0s(),e.j41(10,"th",56),e.EFF(11,"Clicks"),e.k0s(),e.j41(12,"th",56),e.EFF(13,"Survey Started"),e.k0s(),e.j41(14,"th",56),e.EFF(15,"Survey Completed"),e.k0s(),e.j41(16,"th",56),e.EFF(17,"Status"),e.k0s(),e.j41(18,"th",56),e.EFF(19,"Get Link"),e.k0s(),e.j41(20,"th",56),e.EFF(21,"Action"),e.k0s()()(),e.j41(22,"tbody"),e.DNE(23,ee,24,15,"tr",57),e.nI1(24,"paginate"),e.k0s()()()),2&o){const t=e.XpG(2);e.R7$(23),e.Y8G("ngForOf",e.i5U(24,1,t.ongoingSurveysArr,e.sMw(4,W,t.length,t.pageSize,t.page)))}}function ne(o,s){1&o&&(e.j41(0,"div",69)(1,"h5"),e.EFF(2,"No data found..."),e.k0s()())}function ie(o,s){if(1&o&&(e.j41(0,"option",74),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG(3);e.Y8G("selected",i.pageSize==t)("value",t),e.R7$(),e.SpI(" ",t," ")}}function oe(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",70)(1,"pagination-controls",71),e.bIt("pageChange",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageChange(n))}),e.k0s(),e.j41(2,"select",72),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageSizeChange(n))}),e.DNE(3,ie,2,3,"option",73),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.Y8G("ngForOf",t.pageSizes)}}function ae(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",75),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.cancelDeactivate())}),e.k0s()}}function se(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",76)(1,"p",77),e.EFF(2,"Are you sure you want to deactivate this link?"),e.k0s(),e.j41(3,"div",78)(4,"button",79),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.cancelDeactivate())}
1),e.EFF(5,"Cancel"),e.k0s(),e.j41(6,"button",80),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.updatePreviewAndTest(n.pendingDeactivateItem))}),e.EFF(7,"Deactivate"),e.k0s()()()}}function re(o,s){if(1&o){const t=e.RV6();e.j41(0,"section",29)(1,"div",30)(2,"div",31)(3,"div",32)(4,"div",33),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.createLink(),e.Njj(n.linkType="Whatsapp")}),e.nrm(5,"img",34),e.j41(6,"a"),e.EFF(7,"Whatsapp Link"),e.k0s()(),e.j41(8,"div",35),e.nrm(9,"img",36),e.j41(10,"a"),e.EFF(11,"Whatsapp Push"),e.k0s()(),e.j41(12,"div",37),e.nrm(13,"img",38),e.j41(14,"a"),e.EFF(15,"Send Email"),e.k0s()(),e.j41(16,"div",39),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.createLink(),e.Njj(n.linkType="Webchat")}),e.nrm(17,"img",40),e.j41(18,"a"),e.EFF(19,"Webchatbot link"),e.k0s()(),e.j41(20,"div",41),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.createLink(),e.Njj(n.linkType="Facebook")}),e.nrm(21,"img",42),e.j41(22,"a"),e.EFF(23,"Facebook"),e.k0s()(),e.j41(24,"div",43),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.createLink(),e.Njj(n.linkType="Facebook")}),e.nrm(25,"img",44),e.j41(26,"a"),e.EFF(27,"Embed in a website"),e.k0s()(),e.j41(28,"div",45),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.createSalesforce())}),e.nrm(29,"img",46),e.j41(30,"a"),e.EFF(31,"Salesforce Integration"),e.k0s()()()(),e.j41(32,"div",47)(33,"h5",48),e.EFF(34,"Deployment List"),e.k0s()(),e.DNE(35,te,25,8,"div",49)(36,ne,3,0,"div",50)(37,oe,4,1,"div",51),e.k0s(),e.DNE(38,ae,1,0,"div",52)(39,se,8,0,"div",53),e.k0s()}if(2&o){const t=e.XpG();e.R7$(3),e.Y8G("ngStyle",e.eq3(6,J,t.surveyDetails.status&&"CLOSED"!=t.surveyDetails.status?"auto":"none")),e.R7$(32),e.Y8G("ngIf",0!=t.ongoingSurveysArr.length),e.R7$(),e.Y8G("ngIf",0==t.ongoingSurveysArr.length),e.R7$(),e.Y8G("ngIf",t.ongoingSurveysArr.length>0),e.R7$(),e.Y8G("ngIf",t.pendingDeactivateItem),e.R7$(),e.Y8G("ngIf",t.pendingDeactivateItem)}}function le(o,s){1&o&&(e.j41(0,"section",81)(1,"div",82)(2,"span",83),e.EFF(3,"Loading..."),e.k0s()()())}function ce(o,s){if(1&o&&(e.j41(0,"option",74),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG(3);e.FS9("value",t.phone),e.Y8G("selected",i.gupshupPhone==t.phone),e.R7$(),e.JRh(t.displayName)}}function de(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",85)(1,"label",86),e.EFF(2,"Send Survey From "),e.j41(3,"span",87),e.EFF(4,"*"),e.k0s()(),e.j41(5,"select",92),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.gupshupPhone=n.target.value)}),e.j41(6,"option",93),e.EFF(7,"Select phone"),e.k0s(),e.DNE(8,ce,2,3,"option",73),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(8),e.Y8G("ngForOf",t.phoneNumbersArr)}}function pe(o,s){if(1&o){const t=e.RV6();e.qex(0),e.j41(1,"div",14)(2,"h5",15),e.EFF(3,"Create Link"),e.k0s(),e.j41(4,"button",16),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.isLinkCreated=!1,e.Njj(n.resetform())}),e.nrm(5,"i",17),e.k0s()(),e.j41(6,"div",84)(7,"div",85)(8,"label",86),e.EFF(9,"Link Title "),e.j41(10,"span",87),e.EFF(11,"*"),e.k0s()(),e.j41(12,"input",88),e.bIt("input",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.linkName=n.target.value)}),e.k0s()(),e.DNE(13,de,9,1,"div",89),e.j41(14,"div",90)(15,"button",21),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.isLinkCreated=!1,e.Njj(n.resetform())}),e.EFF(16,"Close"),e.k0s(),e.j41(17,"button",91),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.saveData())}),e.EFF(18,"Create"),e.k0s()()(),e.bVm()}if(2&o){const t=e.XpG();e.R7$(12),e.FS9("value",t.linkName),e.R7$(),e.Y8G("ngIf","Facebook"!=t.linkType&&"Webchat"!=t.linkType),e.R7$(4),e.Y8G("disabled",!t.areAllFieldsFilled())}}function ue(o,s){if(1&o){const t=e.RV6();e.qex(0),e.j41(1,"div",14)(2,"h5",15),e.EFF(3,"Survey Link"),e.k0s(),e.j41(4,"button",27),e.nrm(5,"i",17),e.k0s()(),e.j41(6,"div",84)(7,"div",85)(8,"label",86),e.EFF(9,"Copy your link"),e.k0s(),e.nrm(10,"input",94),e.k0s(),e.j41(11,"div",90)(12,"button",28),e.EFF(13,"Close"),e.k0s(),e.j41(14,"button",95),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.copyNewLink(n.surveyLink))}),e.EFF(15,"Copy Link"),e.k0s()()(),e.bVm()}if(2&o){const t=e.XpG();e.R7$(10),e.FS9("value",t.surveyLink)}}let me=(()=>{class o{constructor(t,i,n){this.surveyService=t,this.toastrService=i,this.router=n,this.surveyDetails={},this.embedCode="",this.surveyLink="",this.ongoingSurveysArr=[],this.createSurveyLink=!1,this.currentTutorial=null,this.currentIndex=-1,this.title="",this.totalitems=[],this.surveyName="",this.isLoading=!1,this.linkType="Whatsapp",this.isLinkCreated=!1,this.linkName="",this.phoneNumbersArr=[],this.gupshupPhone="",this.pendingDeactivateItem=null,this.length=0,this.pageIndex=0,this.page=1,this.showPageSizeOptions=!0,this.pageSizeOptions=[5,10,25],this.pageSizes=[5,10,25],this.pageSize=5,this.isSalesforceIntegration=!1,this.showLoading=!1;for(var a=0;a<this.ongoingSurveysArr.count;a++)this.ongoingSurveysArr.data.push({id:a+1,value:"items number "+(a+1)}),console.log("Count",this.ongoingSurveysArr.count);let l=new Date;l=new Date(l.getTime()+864e5),this.minDate=l.toISOString().split("T")[0]}ngOnInit(){this.isLoading=!0,this.surveyCategory=localStorage.getItem("surveyCategory"),this.surveyName=localStorage.getItem("surveyName"),this.get
1SurveyDetails(),this.getOnGoingSurveys(),this.embedCode='<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSfTVOGCeSWQwtnU4Yc_fTeON07LrB_6f4eF8EvfrUyCRzggBA/viewform?embedded=true" width="640" height="2151" frameborder="0" marginheight="0" marginwidth="0">Loading\u2026</iframe>'}getPhoneNumbers(){this.surveyService.getPhoneNumbers().subscribe(t=>{t&&(this.phoneNumbersArr=t.whatsAppPhones,0!=this.phoneNumbersArr&&(this.gupshupPhone=this.phoneNumbersArr[0].phone))},t=>{console.error(t)})}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t,this.getPhoneNumbers()})}getOnGoingSurveys(){this.surveyID=localStorage.getItem("surveyId"),this.isLoading=!0,this.surveyService.getOnGoingSurveysPage(this.surveyID,this.pageIndex*this.pageSize,this.pageSize).subscribe(t=>{console.log(t),this.ongoingSurveysArr=t.data,console.log(t),this.length=t.count,this.isLoading=!1},t=>{this.isLoading=!1,console.error(t)})}createLink(){this.isLinkCreated=!1,this.isSalesforceIntegration=!1,"DRAFT"==this.surveyDetails.status?0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click():this.createLinkModel.nativeElement.click()}createSalesforce(){if(this.isLinkCreated=!1,this.isSalesforceIntegration=!0,"DRAFT"==this.surveyDetails.status)0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click();else{let t=localStorage.getItem("currentUser");t&&(t=JSON.parse(t)),this.showLoading=!0,this.surveyService.checkActiveCampaign({surveyId:localStorage.getItem("surveyId"),email:t?.email}).subscribe(i=>{this.showLoading=!1,1==i?.isActiveSurveyFound?this.checkActiveCampaign.nativeElement.click():this.router.navigateByUrl("/survey/deploy-survey/crm")})}}updateStatus(t){t&&this.surveyService.updateSurveyStatus({id:this.surveyID,is_published:!0}).subscribe(n=>{this.toastrService.success("Survey Published successfully."),this.isSalesforceIntegration?this.checkCampgin():this.createLinkModel.nativeElement.click(),this.get
1SurveyDetails()},n=>{console.error(n)})}checkCampgin(){let t=localStorage.getItem("currentUser");t&&(t=JSON.parse(t)),this.showLoading=!0,this.surveyService.checkActiveCampaign({surveyId:localStorage.getItem("surveyId"),email:t?.email}).subscribe(i=>{this.showLoading=!1,1==i?.isActiveSurveyFound?this.checkActiveCampaign.nativeElement.click():this.router.navigateByUrl("/survey/deploy-survey/crm")})}copyLink(t){var i=document.createElement("textarea");document.body.appendChild(i),i.value=t.collectorLink,i.select(),document.execCommand("copy"),document.body.removeChild(i),this.toastrService.success("Copied")}copyNewLink(t){navigator.clipboard.writeText(t),this.toastrService.success("Copied")}getRequestParams(t,i){let n={};return t&&(n.page=t-1),i&&(n.size=i),n}handlePageChange(t){this.page=t,this.pageIndex=t-1,this.getOnGoingSurveys()}handlePageSizeChange(t){this.pageSize=Number(t.target.value),this.page=1,this.pageIndex=0,this.getOnGoingSurveys()}setActiveTutorial(t,i){this.currentTutorial=t,this.currentIndex=i}goToSocial(t){console.log(t)}saveData(){this.checkCampName({collectorType:this.linkType,linkName:this.linkName,sender_phone:this.gupshupPhone,surveyId:this.surveyID,campaignName:this.linkName})}checkCampName(t){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.linkName).subscribe(i=>{this.createNewLink(t),console.log(i)},i=>{this.toastrService.error(i)})}createNewLink(t){this.surveyService.createSurveyLink(localStorage.getItem("surveyId"),t).subscribe(i=>{console.log("==========",i),this.isLinkCreated=!0,this.linkName="",this.toastrService.success("Link Created sucessfully."),this.surveyLink=i.collectorLink,localStorage.setItem("surveyLink",this.surveyLink),this.ngOnInit()},i=>{console.error(i),this.createSurveyLink=!1,this.toastrService.error(i.message)})}resetform(){this.linkName=""}confirmDeactivate(t){this.pendingDeactivateItem=t}cancelDeactivate(){this.pendingDeactivateItem=null}updatePreviewAndTest(t){this.pendingDeactivateItem=null,this.surveyService.updateSurveyLink({_id:t._id,isActive:!1}).subscribe(n=>{this.getOnGoingSurveys(),console.log(n),this.toastrService.success("Link deactivated sucessfully.")},n=>{console.error(n),this.toastrService.error("Oh! Not saved please try again.")})}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}areAllFieldsFilled(){return this.linkName&&""!==this.linkName.trim()&&this.gupshupPhone&&""!==this.gupshupPhone.trim()}restrictNegativeNumbers(t){const i=t.target.value;i.startsWith("-")&&(t.target.value=i.replace("-",""))}navigate(t){return 1==t?.isComingFromKnit?(this.router.navigateByUrl("/survey/deploy-survey/crm/"+(t?.crmName?t?.crmName:"salesforce")),!1):"ampEmail"==t?.collectorType||"email_amp"==t?.collectorType?(this.router.navigateByUrl("/survey/deploy-survey/email"),!1):void this.router.navigateByUrl("/survey/deploy-survey/push-msg")}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(b.I),e.rXU(x.tw),e.rXU(g.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-survey-link"]],viewQuery:function(i,n){if(1&i&&(e.GBs(z,7),e.GBs(Y,7),e.GBs(q,7),e.GBs(U,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.createLinkModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first),e.mGM(a=e.lsd())&&(n.checkActiveCampaign=a.first)}},decls:62,vars:4,consts:[["createLinkModel",""],["publishsurveyModel",""],["closeModal",""],["questioncoutzeroModel",""],["checkActiveCampaignModel",""],["class","sl-section p-2",4,"ngIf"],["class","sl-loading",4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#createLink",2,"display","none"],["id","createLink","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content","sl-modal"],[4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#publishSurvy",2,"display","none"],["id","publishSurvy","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"sl-modal-header"],[1,"sl-modal-title"],["type","button","data-bs-dismiss","modal",1,"sl-modal-close",3,"click"],[1,"fa","fa-times"],[1,"sl-modal-body","text-center"],[1,"sl-modal-msg"],[1,"sl-modal-footer","sl-modal-footer--center"],["type","button","data-bs-dismiss","modal",1,"sl-btn","sl-btn-outline",3,"click"],["type","button","data-bs-dismiss","modal",1,"sl-btn","sl-btn-primary",3,"click"],["data-bs-toggle","modal","data-bs-target","#questioncoutzero",2,"display","none"],["id","questioncoutzero","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],["data-bs-toggle","modal","data-bs-target","#checkActiveCampaign",2,"display","none"],["id","checkActiveCampaign","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],["type","button","data-bs-dismiss","modal",1,"sl-modal-close"],["type","button","data-bs-dismiss","modal",1,"sl-btn","sl-btn-outline"],[1,"sl-section","p-2"],[1,"col-sm-12","px-0","p-0"],[1,"col-sm-12","d-none"],[1,"col-sm-12","row","pt-2","px-0","d-flex","text-center",3,"ngStyle"],["tooltip","Create new link for Whatsapp",1,"card","text-center","shadow","p-3","m-auto","content",3,"click"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/whatapp.svg","height","60","width","60",1,"mx-auto"],["tooltip","Import Recepients","routerLink","/survey/deploy-survey/push-msg",1,"card","text-center","shadow","p-3","m-auto","content"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/whatsapp-push.png","height","60","width","60",1,"mx-auto"],["tooltip","Import Recepients","routerLink","/survey/deploy-survey/email",1,"card","text-center","shadow","p-3","m-auto","content"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/email-mail.png","height","60","width","60",1,"mx-auto"],["tooltip","Create new link for Webchat",1,"card","text-center","shadow","p-3","m-auto","content",3,"click"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/webchat.svg","height","60","width","60",1,"mx-auto"],["tooltip","Create new link for Facebook",1,"card","text-center","shadow","p-3","m-auto","content",3,"click"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/facebookm.svg","height","60","width","60",1,"mx-auto"],[1,"card","text-center","shadow","p-3","m-auto","content","d-none",3,"click"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/embed.svg","height","60","width","60",1,"mx-auto"],["tooltip","Import Recepients",1,"card","text-center","shadow","p-3","m-auto","content",3,"click"],["src","../assets/img/salesforce-logo 1.svg","height","60","width","70",1,"mx-auto"],[1,"sl-heading-row"],[1,"sl-heading"],["class","sl-table-card",4,"ngIf"],["class","sl-empty",4,"ngIf"],["class","sl-pagination-row",4,"ngIf"],["class","sl-confirm-overlay",3,"click",4,"ngIf"],["class","sl-confirm-box",4,"ngIf"],[1,"sl-table-card"],[1,"table","table-borderless","sl-table"],["scope","col"],["class","sl-row",4,"ngFor","ngForOf"],[1,"sl-row"],[1,"sl-campaign-name",3,"title"],[3,"ngClass"],["class","sl-copy-link",3,"pointerEvents","click",4,"ngIf"],["class","sl-na",4,"ngIf"],["class","sl-action-btn",3,"sl-action-btn--deactivated","disabled","click",4,"ngIf"],["class","sl-action-btn sl-action-btn--report","routerLinkActive","active",3,"click",4,"ngIf"],[1,"sl-copy-link",3,"click"],[1,"sl-na"],[1,"sl-action-btn",3,"click","disabled"],["routerLinkActive","active",1,"sl-action-btn","sl-action-btn--report",3,"click"],[1,"sl-empty"],[1,"sl-pagination-row"],["previousLabel","Prev","nextLabel","Next","responsive","true",3,"pageChange"],[1,"rsp-page-size",3,"change"],[3,"selected","value",4,"ngFor","ngForOf"],[3,"selected","value"],[1,"sl-confirm-overlay",3,"click"],[1,"sl-confirm-box"],[1,"sl-confirm-msg"],[1,"sl-confirm-actions"],[1,"sl-confirm-cancel",3,"click"],[1,"sl-confirm-ok",3,"click"],[1,"sl-loading"],["role","status",1,"spinner-grow",2,"width","2rem","height","2rem","color","#F79522"],[1,"sr-only"],[1,"sl
1-modal-body"],[1,"sl-form-group"],[1,"sl-label"],[1,"text-danger"],["type","text","id","Title","placeholder","Enter link title",1,"sl-input",3,"input","value"],["class","sl-form-group",4,"ngIf"],[1,"sl-modal-footer"],["type","button",1,"sl-btn","sl-btn-primary",3,"click","disabled"],[1,"sl-select",3,"change"],["selected","","disabled",""],["type","text","readonly","",1,"sl-input",3,"value"],["type","button",1,"sl-btn","sl-btn-primary",3,"click"]],template:function(i,n){if(1&i){const a=e.RV6();e.DNE(0,re,40,8,"section",5)(1,le,4,0,"section",6),e.nrm(2,"a",7,0),e.j41(4,"div",8)(5,"div",9)(6,"div",10),e.DNE(7,pe,19,3,"ng-container",11)(8,ue,16,1,"ng-container",11),e.k0s()()(),e.nrm(9,"a",12,1),e.j41(11,"div",13)(12,"div",9)(13,"div",10)(14,"div",14)(15,"h5",15),e.EFF(16,"Publish Survey"),e.k0s(),e.j41(17,"button",16),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.nrm(18,"i",17),e.k0s()(),e.j41(19,"div",18)(20,"p",19),e.EFF(21,"Are you sure you want to publish this survey?"),e.k0s(),e.j41(22,"div",20)(23,"button",21),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.EFF(24,"Close"),e.k0s(),e.j41(25,"button",22,2),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!0))}),e.EFF(27,"Publish"),e.k0s()()()()()(),e.nrm(28,"a",23,3),e.j41(30,"div",24)(31,"div",9)(32,"div",10)(33,"div",14)(34,"h5",15),e.EFF(35,"Survey Empty"),e.k0s()(),e.j41(36,"div",18)(37,"p",19),e.EFF(38,"Survey looks empty."),e.nrm(39,"br"),e.EFF(40,"Please add questions to publish the survey."),e.k0s(),e.j41(41,"div",20)(42,"button",21),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!0))}),e.EFF(43,"My Dashboard"),e.k0s(),e.j41(44,"button",22),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!1))}),e.EFF(45,"Add Questions"),e.k0s()()()()()(),e.nrm(46,"a",25,4),e.j41(48,"div",26)(49,"div",9)(50,"div",10)(51,"div",14)(52,"h5",15),e.EFF(53,"Integration Conflict"),e.k0s(),e.j41(54,"button",27),e.nrm(55,"i",17),e.k0s()(),e.j41(56,"div",18)(57,"p",19),e.EFF(58,"You can't enable Salesforce integration for this survey. There is already a Salesforce integration live for another survey."),e.k0s(),e.j41(59,"div",20)(60,"button",28),e.EFF(61,"Close"),e.k0s()()()()()()}2&i&&(e.Y8G("ngIf",!n.isLoading),e.R7$(),e.Y8G("ngIf",n.isLoading),e.R7$(6),e.Y8G("ngIf",!n.isLinkCreated),e.R7$(),e.Y8G("ngIf",n.isLinkCreated))},dependencies:[p.YU,p.Sq,p.bT,p.B3,g.Wk,g.wQ,v.ej,r.xH,r.y7,p.vh,v.kf],styles:['@charset "UTF-8";.sl-section[_ngcontent-%COMP%]{padding:0 20px 32px}.sl-loading[_ngcontent-%COMP%]{width:100%;min-height:70vh;display:flex;align-items:center;justify-content:center;background:#101116}.sl-heading-row[_ngcontent-%COMP%]{padding:20px 0 16px}.sl-heading[_ngcontent-%COMP%]{font-size:18px;color:#fff;margin:0}.sl-table-card[_ngcontent-%COMP%]{background:#191b21;border:1px solid #363A47;border-radius:12px;overflow:hidden}.sl-table[_ngcontent-%COMP%]{width:100%;margin-bottom:0!important;border-spacing:0!important;table-layout:auto}.sl-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{color:#9ca3af;background:transparent!important;border-bottom:1px solid #363A47!important;padding:14px!important;font-size:13px;font-weight:600;white-space:nowrap}.sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{color:#e0e0e0!important;background:transparent!important;border-top:1px solid #363A47;padding:14px!important;font-size:13px;vertical-align:middle!important;white-space:nowrap}.sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:first-child   td[_ngcontent-%COMP%]{border-top:none}.sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:has(button:disabled){opacity:.65}.sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:has(button:disabled)   td[_ngcontent-%COMP%]{color:#9ca3af!important}.sl-campaign-name[_ngcontent-%COMP%]{max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sl-active[_ngcontent-%COMP%]{color:#22c55e;font-weight:500}.sl-inactive[_ngcontent-%COMP%]{color:#f79522;font-weight:500}.sl-copy-link[_ngcontent-%COMP%]{color:#3a7bfd!important;cursor:pointer;text-decoration:none;font-size:13px}.sl-na[_ngcontent-%COMP%]{color:#9ca3af;font-size:13px}.sl-action-btn[_ngcontent-%COMP%]{background:transparent;border:1px solid #ef4444;color:#ef4444;border-radius:9999px;font-size:12px;font-weight:500;padding:5px 14px;cursor:pointer;white-space:nowrap;transition:background .15s}.sl-action-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#ef44441a}.sl-action-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.sl-action-btn--deactivated[_ngcontent-%COMP%]:hover{background:transparent}.sl-action-btn--report[_ngcontent-%COMP%]{border-color:#3a7bfd;color:#3a7bfd}.sl-action-btn--report[_ngcontent-%COMP%]:hover:not(:disabled){background:#3a7bfd1a}.sl-empty[_ngcontent-%COMP%]{padding:48px 0;text-align:center;color:#9ca3af}.sl-empty[_ngcontent-%COMP%]   h5[_ngcontent-%COMP%]{color:#9ca3af;font-weight:400}.sl-pagination-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:12px;margin-top:16px}.rsp-page-size[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:4px 8px;font-size:13px;height:34px;
1cursor:pointer;flex-shrink:0}.rsp-page-size[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}[_nghost-%COMP%]     .sl-pagination-row .ngx-pagination{display:flex;align-items:center;list-style:none;padding:0;margin:0;gap:2px;flex-shrink:0}[_nghost-%COMP%]     .sl-pagination-row .ngx-pagination a, [_nghost-%COMP%]     .sl-pagination-row .ngx-pagination button, [_nghost-%COMP%]     .sl-pagination-row .ngx-pagination span{color:#9ca3af!important;font-size:13px}[_nghost-%COMP%]     .sl-pagination-row .ngx-pagination a:hover, [_nghost-%COMP%]     .sl-pagination-row .ngx-pagination button:hover{color:#fff!important;background:transparent!important}[_nghost-%COMP%]     .sl-pagination-row .ngx-pagination .current{background:#3a7bfd!important;color:#fff!important;border-radius:6px;padding:3px 10px}[_nghost-%COMP%]     .sl-pagination-row .ngx-pagination .disabled{color:#727c8d!important}.sl-modal[_ngcontent-%COMP%]{background-color:#0f1116!important;border:1px solid #2A2D38!important;border-radius:14px!important;overflow:hidden;box-shadow:0 24px 48px #0009!important}.sl-modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 16px;background-color:#16181f;border-bottom:1px solid #2A2D38}.sl-modal-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#fff;margin:0}.sl-modal-close[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:1px solid #2A2D38;background:transparent;color:#9ca3af;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px}.sl-modal-close[_ngcontent-%COMP%]:hover{background:#0b0d12;color:#fff}.sl-modal-body[_ngcontent-%COMP%]{padding:20px 24px}.sl-modal-msg[_ngcontent-%COMP%]{color:#e0e0e0;font-size:14px;line-height:1.6;margin-bottom:0}.sl-form-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.sl-label[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#9ca3af}.sl-input[_ngcontent-%COMP%]{background-color:#0b0d12!important;border:1px solid #2A2D38!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;width:100%;outline:none;transition:border-color .15s}.sl-input[_ngcontent-%COMP%]::placeholder{color:#555868}.sl-input[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important;box-shadow:0 0 0 3px #3a7bfd26!important}.sl-input[readonly][_ngcontent-%COMP%]{opacity:.7;cursor:default}.sl-select[_ngcontent-%COMP%]{background-color:#0b0d12!important;border:1px solid #2A2D38!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;width:100%;height:44px;outline:none}.sl-select[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#0b0d12;color:#fff}.sl-select[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important;outline:none}.sl-modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding-top:8px}.sl-modal-footer--center[_ngcontent-%COMP%]{justify-content:center;margin-top:16px}.sl-btn[_ngcontent-%COMP%]{border-radius:9999px;font-size:14px;font-weight:500;padding:9px 22px;cursor:pointer;border:1px solid transparent;transition:background .15s,border-color .15s,opacity .15s}.sl-btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.sl-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border-color:#3a7bfd;color:#fff}.sl-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1260fd}.sl-btn-outline[_ngcontent-%COMP%]{background:transparent;border-color:#3a7bfd;color:#3a7bfd}.sl-btn-outline[_ngcontent-%COMP%]:hover:not(:disabled){background:#3a7bfd1a}@media (max-width: 768px){.sl-section[_ngcontent-%COMP%]{padding:0 12px 24px}.sl-table-card[_ngcontent-%COMP%]{background:transparent!important;border:none!important;border-radius:0!important;overflow:visible!important}[_nghost-%COMP%]     .sl-table thead, .sl-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{display:none!important}[_nghost-%COMP%]     .sl-table tbody, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;gap:12px!important}[_nghost-%COMP%]     .sl-table tbody tr, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]{display:grid!important;grid-template-columns:auto auto 1fr;column-gap:0;grid-template-areas:"name      name      status" "channel   channel   channel" "date      date      date" "clicks started completed" "copy      copy      action";background:#21222d!important;border:1px solid #35364e!important;border-radius:12px!important;padding:14px 16px!important;border-top:none!important}[_nghost-%COMP%]     .sl-table tbody td, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border-top:none!important;padding:4px 0!important;white-space:normal!important;font-size:14px;background:transparent!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(1), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(1){grid-area:name;font-size:15px!important;font-weight:600!important;color:#fff!important;padding-bottom:6px!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(1) .sl-campaign-name, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(1)   .sl-campaign-name[_ng
1content-%COMP%]{max-width:100%!important;font-size:15px;font-weight:600;color:#fff}[_nghost-%COMP%]     .sl-table tbody td:nth-child(2), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(2){grid-area:channel;color:#ababab!important;font-size:14px!important;font-weight:400!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(2):before, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(2):before{content:"Channel : ";color:#ababab}[_nghost-%COMP%]     .sl-table tbody td:nth-child(3), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(3){grid-area:date;color:#ababab!important;font-size:13px!important;font-weight:400!important;padding-bottom:6px!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(3):before, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(3):before{content:"Created On : ";color:#ababab}[_nghost-%COMP%]     .sl-table tbody td:nth-child(4), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(4){grid-area:clicks;color:#ababab!important;font-size:11px!important;font-weight:400!important;padding-bottom:10px!important;padding-right:10px!important;white-space:nowrap!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(4):before, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(4):before{content:"Clicks : ";color:#ababab}[_nghost-%COMP%]     .sl-table tbody td:nth-child(5), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(5){grid-area:started;color:#ababab!important;font-size:11px!important;font-weight:400!important;padding-bottom:10px!important;padding-right:10px!important;white-space:nowrap!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(5):before, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(5):before{content:"Survey Started : ";color:#ababab}[_nghost-%COMP%]     .sl-table tbody td:nth-child(6), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(6){grid-area:completed;color:#ababab!important;font-size:14px!important;font-weight:400!important;padding-bottom:10px!important;white-space:nowrap!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(6):before, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(6):before{content:"Survey Completed : ";color:#ababab}[_nghost-%COMP%]     .sl-table tbody td:nth-child(7), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(7){grid-area:status;display:flex!important;align-items:flex-start!important;justify-content:flex-end!important;padding-bottom:6px!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(7) .sl-active, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(7)   .sl-active[_ngcontent-%COMP%]{border:1px solid #22c55e;border-radius:6px;padding:1px 8px;font-size:11px}[_nghost-%COMP%]     .sl-table tbody td:nth-child(7) .sl-inactive, .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(7)   .sl-inactive[_ngcontent-%COMP%]{border:1px solid #F79522;border-radius:6px;padding:1px 8px;font-size:11px}[_nghost-%COMP%]     .sl-table tbody td:nth-child(8), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(8){grid-area:copy;border-top:1px solid #363A47!important;padding-top:10px!important;padding-left:16px!important;margin-left:-16px!important;display:flex!important;align-items:center!important}[_nghost-%COMP%]     .sl-table tbody td:nth-child(9), .sl-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:nth-child(9){grid-area:action;border-top:1px solid #363A47!important;padding-top:10px!important;padding-right:16px!important;margin-right:-16px!important;display:flex!important;align-items:center!important;justify-content:flex-end!important}}.sl-confirm-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1040;background:#0009;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.sl-confirm-box[_ngcontent-%COMP%]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1050;background:#191b21;border:1px solid #363A47;border-radius:12px;padding:24px 28px;min-width:340px;box-shadow:0 24px 60px #00000080}.sl-confirm-msg[_ngcontent-%COMP%]{font-size:16px;font-weight:400;color:#e0e0e0;margin:0 0 20px;line-height:1.5}.sl-confirm-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:8px}.sl-confirm-cancel[_ngcontent-%COMP%]{background:transparent;border:1px solid #363A47;color:#9ca3af;border-radius:9999px;padding:7px 18px;font-size:13px;width:120px;font-family:inherit;cursor:pointer;transition:border-color .2s,color .2s}.sl-confirm-cancel[_ngcontent-%COMP%]:hover{border-color:#6b7280;color:#fff}.sl-confirm-ok[_ngcontent-%COMP%]{background:transparent;border:1px solid #ef4444;color:#ef4444;border-radius:9999px;padding:7px 18px;font-size:13px;font-family:inherit;cursor:pointer;transition:background .2s;width:120px}.sl-confirm-ok[_ngcontent-%COMP%]:hover{background:#ef44441f}']})}return o}
1)();var j=h(9520),F=h(6222),M=h(2510);const ge=["publishsurveyModel"],he=["uploadModel"],fe=["questioncoutzeroModel"],D=(o,s,t)=>({totalItems:o,itemsPerPage:s,currentPage:t});function _e(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",59),e.qSk(),e.j41(1,"svg",60),e.nrm(2,"circle",61)(3,"line",62),e.k0s(),e.joV(),e.j41(4,"input",63),e.bIt("input",function(n){e.eBV(t);const a=e.XpG();return a.searchRecord=n.target.value,a.searchRecord=a.searchRecord.trim(),e.Njj(a.getAllParticipents())}),e.k0s()()}}function be(o,s){1&o&&(e.j41(0,"div",64),e.nrm(1,"div",65),e.k0s())}function ve(o,s){if(1&o&&(e.j41(0,"tr")(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s(),e.j41(7,"td"),e.EFF(8),e.k0s(),e.j41(9,"td"),e.EFF(10),e.nI1(11,"date"),e.k0s(),e.j41(12,"td"),e.EFF(13),e.nI1(14,"date"),e.k0s(),e.j41(15,"td")(16,"span",69),e.EFF(17),e.k0s()(),e.j41(18,"td"),e.EFF(19),e.k0s()()),2&o){const t=s.$implicit;e.R7$(2),e.JRh(t.phone_number?t.phone_number:"-"),e.R7$(2),e.JRh((null==t?null:t.uniqueId)||(null==t?null:t.uid)||"\u2014"),e.R7$(2),e.JRh((null==t?null:t.surveyProgress)||(null==t?null:t.survey_progress)||"\u2014"),e.R7$(2),e.JRh((null==t?null:t.campaignName)||"\u2014"),e.R7$(2),e.JRh(e.i5U(11,10,null==t?null:t.created_at,"dd-MMM-yyyy h:mm a")||"\u2014"),e.R7$(3),e.JRh(e.i5U(14,13,(null==t?null:t.lastEventOn)||(null==t?null:t.last_event_on)||(null==t?null:t.updatedAt)||(null==t?null:t.updated_at),"dd-MMM-yyyy h:mm a")||"\u2014"),e.R7$(3),e.AVh("pm-status--active","sent"===(null==t?null:t.status)||"delivered"===(null==t?null:t.status)),e.R7$(),e.SpI(" ",t.surveyStatus?t.surveyStatus:"\u2014"," "),e.R7$(2),e.JRh(t.failedReason?t.failedReason:"-")}}function xe(o,s){if(1&o&&(e.j41(0,"div",66)(1,"table",67)(2,"thead")(3,"tr")(4,"th"),e.EFF(5,"Number"),e.k0s(),e.j41(6,"th"),e.EFF(7,"UID"),e.k0s(),e.j41(8,"th"),e.EFF(9,"Survey Progress"),e.k0s(),e.j41(10,"th"),e.EFF(11,"Campaign"),e.k0s(),e.j41(12,"th"),e.EFF(13,"Created At"),e.k0s(),e.j41(14,"th"),e.EFF(15,"Last Event On"),e.k0s(),e.j41(16,"th"),e.EFF(17,"Status"),e.k0s(),e.j41(18,"th"),e.EFF(19,"Status Reason"),e.k0s()()(),e.j41(20,"tbody"),e.DNE(21,ve,20,16,"tr",68),e.nI1(22,"paginate"),e.k0s()()()),2&o){const t=e.XpG();e.R7$(21),e.Y8G("ngForOf",e.i5U(22,1,t.usersArr,e.sMw(4,D,t.count,t.pageSize,t.page)))}}function ke(o,s){if(1&o&&(e.j41(0,"div",72)(1,"div",73)(2,"span",74),e.EFF(3),e.k0s(),e.j41(4,"span",75),e.EFF(5),e.k0s()(),e.j41(6,"div",76)(7,"div",77),e.EFF(8),e.k0s(),e.j41(9,"div",77),e.EFF(10),e.k0s(),e.j41(11,"div",77),e.EFF(12),e.k0s(),e.j41(13,"div",77),e.EFF(14),e.nI1(15,"date"),e.k0s(),e.j41(16,"div",78),e.EFF(17),e.nI1(18,"date"),e.k0s()(),e.j41(19,"div",79),e.EFF(20),e.k0s()()),2&o){const t=s.$implicit;e.R7$(3),e.JRh(t.phone_number?t.phone_number:"-"),e.R7$(),e.AVh("pm-card-badge--complete","sent"===(null==t?null:t.status)||"delivered"===(null==t?null:t.status))("pm-card-badge--failed","failed"===(null==t?null:t.status)),e.R7$(),e.SpI(" ",t.surveyStatus?t.surveyStatus:"\u2014"," "),e.R7$(3),e.SpI("UID : ",(null==t?null:t.uniqueId)||(null==t?null:t.uid)||"\u2014",""),e.R7$(2),e.SpI("Campaign : ",(null==t?null:t.campaignName)||"\u2014",""),e.R7$(2),e.SpI("Survey Progress : ",(null==t?null:t.surveyProgress)||(null==t?null:t.survey_progress)||"\u2014",""),e.R7$(2),e.SpI("Created At : ",e.i5U(15,12,null==t?null:t.created_at,"M/d/yy, h:mm a")||"\u2014",""),e.R7$(3),e.SpI(" Last Event On : ",e.i5U(18,15,(null==t?null:t.lastEventOn)||(null==t?null:t.last_event_on)||(null==t?null:t.updatedAt)||(null==t?null:t.updated_at),"M/d/yy, h:mm a")||"NA"," "),e.R7$(3),e.SpI(" Status Reason : ",t.failedReason?t.failedReason:"NA"," ")}}function ye(o,s){if(1&o&&(e.j41(0,"div",70),e.DNE(1,ke,21,18,"div",71),e.nI1(2,"paginate"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",e.i5U(2,1,t.usersArr,e.sMw(4,D,t.count,t.pageSize,t.page)))}}function Ce(o,s){if(1&o&&(e.j41(0,"option",84),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG(2);e.Y8G("selected",i.pageSize==t)("value",t),e.R7$(),e.JRh(t)}}function Fe(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",80)(1,"pagination-controls",81),e.bIt("pageChange",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.handlePageChange(n))}),e.k0s(),e.j41(2,"select",82),e.bIt("change",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.handlePageSizeChange(n))}),e.DNE(3,Ce,2,3,"option",83),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(3),e.Y8G("ngForOf",t.pageSizes)}}function je(o,s){1&o&&(e.j41(0,"div",85)(1,"p"),e.EFF(2,"No recipients found."),e.k0s()())}function Me(o,s){if(1&o&&(e.j41(0,"span",86),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.campaignNameValidation)}}let we=(()=>
1{class o{constructor(t,i,n,a,l){this.tostr=t,this.surveyService=i,this.CommonService=n,this.authenticationService=a,this.router=l,this.usersArr=[],this.page=0,this.count=0,this.pageSize=5,this.pageSizes=[5,10,15],this.currentPage=0,this.test=[],this.disbaledFlag=!0,this.surveyList=[],this.isLoading=!1,this.isFileLoading=!1,this.surveyId="",this.pushMsgStatusObj={},this.searchRecord="",this.surveyDetails={},this.redirectDetails={},this.campaignName="",this.xoxodayCampaignId="",this.isFileSelected=!1,this.isNumberFetched=!1,this.phoneNumbersArr=[],this.gupshupPhone="",this.campaignNameValidation="";let c=new Date;c=new Date(c.getTime()+864e5),this.minDate=c.toISOString().split("T")[0]}ngOnInit(){this.getSurveyDetails(),this.getAllParticipents(),this.getPushMessageStatus(),this.getxoxodayCampginList()}handleFileSelect(t){var i=t.target.files;if(i&&i.length>0){this.isFileSelected=!0;var n=i[0];this.uploadedFiles=i[0],(new FileReader).readAsText(n)}}onFileChanged(t){this.fileEvent=t,this.selectedFile=t.target.files[0],this.isFileSelected=!0}createChunk(t,i){let n=[],a=0;const l=t.length+t.length%i+1;for(let c=i;c<l;c+=i)n.push(t.slice(a,c)),a=c;console.log(n),n.map(c=>{this.upload(n)})}getUserAccessibility(){this.isLoading=!0,this.surveyService.getRedirectDetails().subscribe(t=>{this.isLoading=!1,!t||400==t.status&&401==t.status?this.tostr.error("Access denied"):(this.redirectDetails=t,this.getSurveyDetails(),this.getAllParticipents(),this.getPushMessageStatus())},t=>{this.isLoading=!1,this.tostr.error("Access denied")})}getUniqueListBy(t,i){return[...new Map(t.map(n=>[n[i],n])).values()]}saveData1(){let t={surveyId:localStorage.getItem("surveyId"),userData:this.getUniqueListBy(this.test,"phoneNumber"),phone:this.gupshupPhone,campaignName:""!=this.campaignName&&null!=this.campaignName&&null!=this.campaignName?this.campaignName:this.surveyDetails.name,xoxodayCampaignId:this.xoxodayCampaignId,xoxodayLink_expiry:this.formatDate(this.expiryDate),xoxodayNoOfRewards:this.reward,isXoxodayEnabled:!0};this.checkCampName(t)}saveData(){const t=new FormData;t.append("surveyId",localStorage.getItem("surveyId")),t.append("file",this.selectedFile,this.selectedFile?.name),t.append("phone",this.gupshupPhone),t.append("campaignName",""!=this.campaignName&&null!=this.campaignName&&null!=this.campaignName?this.campaignName:this.surveyDetails.name),this.xoxodayCampaignId&&(t.append("xoxodayCampaignId",this.xoxodayCampaignId),t.append("xoxodayLink_expiry",this.formatDate(this.expiryDate)),t.append("xoxodayNoOfRewards",this.reward)),this.checkCampName(t)}checkCampName(t){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.campaignName).subscribe(i=>{this.upload(t),console.log(i),this.nameEvent.target.value="",this.fileEvent.target.value=""},i=>{this.tostr.error(i),this.nameEvent.target.value="",this.fileEvent.target.value=""})}upload(t){document.getElementById("close-modal").click(),this.surveyService.uploadParticipent(t,this.surveyDetails.surveyPhone).subscribe(n=>{this.xoxodayCampaignId="",this.reward="",this.expiryDate="",this.campaignName="",this.tostr.success(n.message)},n=>{this.tostr.error(n?.message)})}handlePageChange(t){1===t?(this.page=t,this.currentPage=t-1):t>1&&(this.page=t,this.currentPage=this.pageSize*(t-1)),this.getAllParticipents()}handlePageSizeChange(t){this.pageSize=Number(t.target.value),this.page=1,this.currentPage=0,this.getAllParticipents()}getAllParticipents(){this.isLoading=!0,this.surveyService.getAllParticipents(this.currentPage,this.pageSize,this.searchRecord).subscribe(t=>{this.usersArr=t.data,this.count=t.count,this.isLoading=!1,console.log(t)},t=>{this.isLoading=!1,console.error(t)})}getPushMessageStatus(){this.surveyService.getPushMessageStatus().subscribe(t=>{this.pushMsgStatusObj=t},t=>{console.error(t)})}exportRespondantDetails(){this.isFileLoading=!0,this.surveyService.exportRepondantDetailsBySurveyID(localStorage.getItem("surveyId")).subscribe(t=>{this.isFileLoading=!1;const i=new Blob([t],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(i),a=document.createElement("a");a.href=n,a.download=`${this.surveyId}+${new Date}.csv`,a.click()},t=>{this.isFileLoading=!1})}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t,0==this.isNumberFetched&&this.getPhoneNumbers(),this.isNumberFetched=!0,1==this.surveyDetails?.isPushMessageUpo
1ad&&(this.refreshPush(),this.getPushMessageStatus()),this.isXoxodayEnabled=t.isXoxodayEnabled})}createLink(){"DRAFT"==this.surveyDetails.status?0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click():this.uploadModel.nativeElement.click()}refreshPush(){setTimeout(()=>{this.getSurveyDetails()},5e3)}searchSurveyByName(t){this.searchRecord=t.target.value,this.searchRecord=this.searchRecord.trim(),this.getAllParticipents()}updateStatus(t){if(t){let i={id:localStorage.getItem("surveyId"),is_published:!0};this.surveyService.updateSurveyStatus(i).subscribe(n=>{this.tostr.success("Survey Published sucessfully."),this.uploadModel.nativeElement.click(),this.getSurveyDetails()},n=>{console.error(n)})}}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}getPhoneNumbers(){this.surveyService.getPhoneNumbers().subscribe(t=>{t&&(this.phoneNumbersArr=t.whatsAppPhones,0!=this.phoneNumbersArr&&(this.gupshupPhone=this.phoneNumbersArr[0].phone))},t=>{console.error(t)})}getxoxodayCampginList(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.getxoxodayCampginList(t.userId).subscribe(i=>{i.data&&i.data.campaignList&&i.data.campaignList.data?(this.compaignlist=i.data.campaignList.data,console.log(this.compaignlist)):this.compaignlist=[]},i=>{console.log(i)})}formatDate(t){const i=new Date(t),n=i.getDate(),a=i.getMonth()+1,l=i.getFullYear();return`${n.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}-${l}`}onCampaignSelected(t){this.selectedCampaign=t}validateCampName(t){this.nameEvent=t;const i=/^[a-zA-Z0-9\s]+$/;return i.test(t.target.value)?(this.campaignName=t.target.value,this.campaignNameValidation=""):this.campaignNameValidation="Campaign Name can only contain letters, numbers and spaces.",this.isCampNameValid=i.test(t.target.value),this.isCampNameValid}isFormComplete(){return!(!this.campaignName||!this.gupshupPhone||!this.isFileSelected||!this.isCampNameValid||this.selectedCampaign&&(!this.reward||!this.expiryDate))}resetform(){this.xoxodayCampaignId="",this.campaignName="",this.selectedCampaign="",this.reward="",this.expiryDate="",this.nameEvent.target.value="",this.fileEvent.target.value=""}refreshButton(){this.ngOnInit()}validateInput(t){let i=t.which?t.which:t.keyCode;return!!(8===i||9===i||13===i||i>=37&&i<=40||46===i||/^[A-Za-z0-9\s]+$/.test(t.key))||(t.preventDefault(),!1)}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(x.tw),e.rXU(b.I),e.rXU(j.h),e.rXU(F.k),e.rXU(g.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-push-msg"]],viewQuery:function(i,n){if(1&i&&(e.GBs(ge,7),e.GBs(he,7),e.GBs(fe,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.uploadModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first)}},decls:126,vars:21,consts:[["publishsurveyModel",""],["uploadModel",""],["questioncoutzeroModel",""],[1,"pm-page"],[1,"pm-topbar"],[1,"pm-breadcrumb"],["routerLink","/survey/deploy-survey/deployments",1,"pm-bc-link"],["src","assets/icons/shuffle-random.png","alt","",1,"pm-bc-icon"],[1,"pm-bc-sep"],[1,"pm-bc-current"],["src","assets/icons/task-square.svg","alt","",1,"pm-bc-icon","pm-bc-icon--active"],[1,"pm-actions-row"],["title","Refresh",1,"pm-refresh-btn",3,"click"],["width","18","height","18","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round"],["d","M23 4v6h-6"],["d","M1 20v-6h6"],["d","M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"],[1,"pm-import-btn",3,"click"],[1,"pm-stats-row"],[1,"pm-stat-card"],[1,"pm-stat-value"],[1,"pm-stat-label"],["class","pm-search-wrap",4,"ngIf"],["class","pm-loading",4,"ngIf"],["class","pm-table-card",4,"ngIf"],["class","pm-cards-mobile",4,"ngIf"],["class","pm-pagination-row",4,"ngIf"],["class","pm-empty",4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#publishSurvy",2,"display","none"],["data-bs-toggle","modal","data-bs-target","#uploadModal",2,"display","none"],["data-bs-toggle","modal","data-bs-target","#questioncoutzero",2,"display","none"],["id","publishSurvy","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content","pm-modal"],[1,"pm-modal-body","text-center"],[1,"pm-modal-msg"],[1,"pm-modal-footer","pm-modal-footer--center"],["data-bs-dismiss","modal",1,"pm-btn-outline",3,"click"],["data-bs-dismiss","modal",1,"pm-btn-primary",3,"click"],["id","close-modal","data-bs-dismiss","modal","data-bs-target","#uploadModal",2,"display","none"],["id","uploadModal","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered","modal-lg"],[1,"pm-modal-header"],[1,"pm-modal-title"],["type","button","data-bs-dismiss","modal",1,"pm-modal-close"],[1,"fa","fa-times"],[1,"pm-modal-body"],[1,"pm-field"],[1,"pm-label"],[1,"pm-required"],["type","text","placeholder","Enter campaign name","maxlength","30",1,"pm-input",3,"input","value"],["class","pm-error",4,"ngIf"],["bindLabel","displayName","bindValue","phone","placeholder","Select phone",1,"pm-select","rp-native-select",3,"ngModelChange","items","ngModel","clearable","searchable","appendTo"],["type","file","accept",".csv",1,"pm-input",3,"change"],[1,"pm-modal-footer"],["data-bs-dismiss","modal",1,"pm-btn-outline"],["data-bs-dismiss","modal",1,"pm-btn-primary",3,"click","disabled"],["id","questioncoutzero","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],["data-bs-dismiss","modal",1,"pm-btn-primary"],[1,"pm-search-wrap"],["width","16","height","16","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"pm-search-icon"],["cx","11","cy","11","r","8"],["x1","21","y1","21","x2","16.65","y2","16.65"],["type","text","placeholder","Search",1,"pm-search-input",3,"input"],[1,"pm-loading"],["role","status",1,"spinner-grow",2,"color","#F79522"],[1,"pm-table-card"],[1,"pm-table"],[4,"ngFor","ngForOf"],[1,"pm-status"],[1,"pm-cards-mobile"],["class","pm-card-item",4,"ngFor","ngForOf"],[1,"pm-card-item"],[1,"pm-card-header"],[1,"pm-card-phone"],[1,"pm-card-badge"],[1,"pm-card-fields"],[1,"pm-card-field"],[1,"pm-card-field","pm-card-field--full"],[1,"pm-card-footer"],[1,"pm-pagination-row"],["previousLabel","Prev","nextLabel","Next","responsive","true",3,"pageChange"],[1,"pm-page-size",3,"change"],[3,"selected","value",4,"ngFor","ngForOf"],[3,"selected","value"],[1,"pm-empty"],[1,"pm-error"]],template:function(i,n){if(1&i){const a=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"nav",5)(3,"a",6),e.nrm(4,"img",7),e.EFF(5," Deployments "),e.k0s(),e.j41(6,"span",8),e.EFF(7,"\u203a"),e.k0s(),e.j41(8,"span",9),e.nrm(9,"img",10),e.EFF(10," Whatsapp Push "),e.k0s()(),e.j41(11,"div",11)(12,"button",12),e.bIt("click",function(){return e.eBV(a),n.refreshPush(),e.Njj(n.getPushMessageStatus())}),e.qSk(),e.j41(13,"svg",13),e.nrm(14,"path",14)(15,"path",15)(16,"path",16),e.k0s()(),e.joV(),e.j41(17,"button",17),e.bIt("click",function(){return e.eBV(a),e.Njj(n.createLink())}),e.EFF(18," Import Recipients "),e.k0s()()(),e.j41(19,"div",18)(20,"div",19)(21,"span",20),e.EFF(22),e.k0s(),e.j41(23,"span",21),e.EFF(24,"Total"),e.k0s()(),e.j41(25,"div",19)(26,"span",20),e.EFF(27),e.k0s(),e.j41(28,"span",21),e.EFF(29,"Sent"),e.k0s()(),e.j41(30,"div",19)(31,"span",20),e.EFF(32),e.k0s(),e.j41(33,"span",21),e.EFF(34,"Delivered"),e.k0s()(),e.j41(35,"div",19)(36,"span",20),e.EFF(37),e.k0s(),e.j41(38,"span",21),e.EFF(39,"Failed"),e.k0s()(),e.j41(40,"div",19)(41,"span",20),e.EFF(42),e.k0s(),e.j41(43,"span",21),e.EFF(44,"Read"),e.k0s()(),e.j41(45,"div",19)(46,"span",20),e.EFF(47),e.k0s(),e.j41(48,"span",21),e.EFF(49,"Survey Started"),e.k0s()(),e.j41(50,"div",19)(51,"span",20),e.EFF(52),e.k0s(),e.j41(53,"span",21),e.EFF(54,"Survey Completed"),e.k0s()()(),e.DNE(55,_e,5,0,"div",22)(56,be,2,0,"div",23)(57,xe,23,8,"div",24)(58,ye,3,8,"div",25)(59,Fe,4,1,"div",26)(60,je,3,0,"div",27),e.k0s(),e.nrm(61,"a",28,0)(63,"a",29,1)(65,"a",30,2),e.j41(67,"div",31)(68,"div",32)(69,"div",33)(70,"div",34)(71,"p",35),e.EFF(72,"Are you sure you want to publish this survey?"),e.k0s(),e.j41(73,"div",36)(74,"button",37),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.EFF(75,"Close"),e.k0s(),e.j41(76,"button",38),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!0))}),e.EFF(77,"Publish"),e.k0s()()()()()(),e.nrm(78,"button",39),e.j41(79,"div",40)(80,"div",41)(81,"div",33)(82,"div",42)(83,"h5",43),e.EFF(84,"Import Recipients"),e.k0s(),e.j41(85,"button",44),e.nrm(86,"i",45),e.k0s()(),e.j41(87,"div",46)(88,"div",47)(89,"label",48),e.
1EFF(90,"Campaign Name "),e.j41(91,"span",49),e.EFF(92,"*"),e.k0s()(),e.j41(93,"input",50),e.bIt("input",function(c){return e.eBV(a),n.campaignNameValidation="",e.Njj(n.campaignName=c.target.value)}),e.k0s(),e.DNE(94,Me,2,1,"span",51),e.k0s(),e.j41(95,"div",47)(96,"label",48),e.EFF(97,"Send From "),e.j41(98,"span",49),e.EFF(99,"*"),e.k0s()(),e.j41(100,"ng-select",52),e.mxI("ngModelChange",function(c){return e.eBV(a),e.DH7(n.gupshupPhone,c)||(n.gupshupPhone=c),e.Njj(c)}),e.k0s()(),e.j41(101,"div",47)(102,"label",48),e.EFF(103,"Upload CSV "),e.j41(104,"span",49),e.EFF(105,"*"),e.k0s()(),e.j41(106,"input",53),e.bIt("change",function(c){return e.eBV(a),e.Njj(n.onFileChanged(c))}),e.k0s()(),e.j41(107,"div",54)(108,"button",55),e.EFF(109,"Cancel"),e.k0s(),e.j41(110,"button",56),e.bIt("click",function(){return e.eBV(a),e.Njj(n.saveData())}),e.EFF(111," Upload "),e.k0s()()()()()(),e.j41(112,"div",57)(113,"div",32)(114,"div",33)(115,"div",42)(116,"h5",43),e.EFF(117,"Survey Empty"),e.k0s()(),e.j41(118,"div",34)(119,"p",35),e.EFF(120,"Survey looks empty."),e.nrm(121,"br"),e.EFF(122,"Please add questions before importing recipients."),e.k0s(),e.j41(123,"div",36)(124,"button",58),e.EFF(125,"OK"),e.k0s()()()()()()}if(2&i){let a,l,c,m,d,f,C;e.R7$(22),e.JRh(null!==(a=null==n.pushMsgStatusObj?null:n.pushMsgStatusObj.total)&&void 0!==a?a:0),e.R7$(5),e.JRh(null!==(l=null==n.pushMsgStatusObj?null:n.pushMsgStatusObj.sent)&&void 0!==l?l:0),e.R7$(5),e.JRh(null!==(c=null==n.pushMsgStatusObj?null:n.pushMsgStatusObj.delivered)&&void 0!==c?c:0),e.R7$(5),e.JRh(null!==(m=null==n.pushMsgStatusObj?null:n.pushMsgStatusObj.failed)&&void 0!==m?m:0),e.R7$(5),e.JRh(null!==(d=null==n.pushMsgStatusObj?null:n.pushMsgStatusObj.read)&&void 0!==d?d:0),e.R7$(5),e.JRh(null!==(f=null==n.pushMsgStatusObj?null:n.pushMsgStatusObj.started)&&void 0!==f?f:0),e.R7$(5),e.JRh(null!==(C=null==n.pushMsgStatusObj?null:n.pushMsgStatusObj.completed)&&void 0!==C?C:0),e.R7$(3),e.Y8G("ngIf",!n.isLoading&&(null==n.usersArr?null:n.usersArr.length)>0),e.R7$(),e.Y8G("ngIf",n.isLoading),e.R7$(),e.Y8G("ngIf",!n.isLoading&&(null==n.usersArr?null:n.usersArr.length)>0),e.R7$(),e.Y8G("ngIf",!n.isLoading&&(null==n.usersArr?null:n.usersArr.length)>0),e.R7$(),e.Y8G("ngIf",!n.isLoading&&(null==n.usersArr?null:n.usersArr.length)>0),e.R7$(),e.Y8G("ngIf",!(n.isLoading||n.usersArr&&0!==n.usersArr.length)),e.R7$(33),e.Y8G("value",n.campaignName),e.R7$(),e.Y8G("ngIf",n.campaignNameValidation),e.R7$(6),e.Y8G("items",n.phoneNumbersArr),e.R50("ngModel",n.gupshupPhone),e.Y8G("clearable",!1)("searchable",!1)("appendTo","body"),e.R7$(10),e.Y8G("disabled",!n.isFileSelected||!n.gupshupPhone||!n.campaignName)}},dependencies:[p.Sq,p.bT,g.Wk,v.ej,r.xH,r.y7,r.BC,r.vS,M.vr,p.vh,v.kf],styles:['@charset "UTF-8";.pm-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:20px;padding:20px 0 24px}.pm-topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}.pm-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:14px}.pm-bc-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#9ca3af;text-decoration:none;cursor:pointer}.pm-bc-link[_ngcontent-%COMP%]:hover{color:#fff}.pm-bc-current[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#f79522;font-weight:500;border-bottom:2px solid #F79522;padding-bottom:4px}.pm-bc-sep[_ngcontent-%COMP%]{color:#9ca3af}.pm-bc-icon[_ngcontent-%COMP%]{width:16px;height:16px;object-fit:contain;flex-shrink:0;filter:brightness(0) saturate(100%) invert(69%) sepia(11%) saturate(405%) hue-rotate(176deg) brightness(91%) contrast(87%);transition:filter .15s}.pm-bc-icon--active[_ngcontent-%COMP%]{filter:brightness(0) saturate(100%) invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%)}.pm-bc-link[_ngcontent-%COMP%]:hover   .pm-bc-icon[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}.pm-actions-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.pm-refresh-btn[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:50%;border:1px solid #363A47;background:transparent;color:#9ca3af;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,color .15s}.pm-refresh-btn[_ngcontent-%COMP%]:hover{background:#191b21;color:#fff}.pm-import-btn[_ngcontent-%COMP%]{background:#3a7bfd;border:1px solid #3a7bfd;border-radius:9999px;color:#fff;font-size:14px;font-weight:500;padding:8px 20px;cursor:pointer;transition:background .15s}.pm-import-btn[_ngcontent-%COMP%]:hover{background:#1260fd}.pm-stats-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}@media (max-width: 1024px){.pm-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(4,1fr)}}@media (max-width: 600px){.pm-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}.pm-stat-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:10px;padding:18px 12px;display:flex;flex-direction:column;align-items:center;gap:6px}.pm-stat-value[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#fff;line-height:1}.pm-stat-label[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af;text-align:center;white-space:nowrap}.pm-search-wrap[_ngcontent-%COMP%]{position:relative;max-width:280px}.pm-search-icon[_ngcontent-%COMP%]{position:absolute;
1left:12px;top:50%;transform:translateY(-50%);color:#9ca3af;pointer-events:none}.pm-search-input[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:9999px!important;color:#fff!important;padding:9px 14px 9px 36px;font-size:14px;width:100%;outline:none;height:40px;transition:border-color .15s}.pm-search-input[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.pm-search-input[_ngcontent-%COMP%]:focus{border-color:#f79522!important}.pm-table-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:12px;overflow:hidden}.pm-table[_ngcontent-%COMP%]{width:100%;--bs-table-border-color: transparent;border-spacing:0}.pm-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{color:#9ca3af!important;background:transparent!important;border-bottom:1px solid #363A47!important;padding:14px 16px!important;font-size:13px;font-weight:600;white-space:nowrap;vertical-align:middle!important}.pm-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{color:#e0e0e0!important;background:transparent!important;padding:14px 16px!important;font-size:13px;vertical-align:middle!important;border-top:none!important;border-bottom:none!important}.pm-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] + tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border-top:1px solid rgba(255,255,255,.06)!important}.pm-status[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af}.pm-status--active[_ngcontent-%COMP%]{color:#22c55e}.pm-pagination-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:12px;padding:12px 16px}.pm-page-size[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:4px 8px;font-size:13px;height:34px;flex-shrink:0}.pm-page-size[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination{display:flex;align-items:center;list-style:none;padding:0;margin:0;gap:2px;flex-shrink:0}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination a, [_nghost-%COMP%]     .pm-pagination-row .ngx-pagination button, [_nghost-%COMP%]     .pm-pagination-row .ngx-pagination span{color:#9ca3af!important;font-size:13px}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination a:hover, [_nghost-%COMP%]     .pm-pagination-row .ngx-pagination button:hover{color:#fff!important;background:transparent!important}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination .current{background:#3a7bfd!important;color:#fff!important;border-radius:6px;padding:3px 10px}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination .disabled{color:#727c8d!important}.pm-empty[_ngcontent-%COMP%]{text-align:center;padding:48px 0;color:#9ca3af;font-size:14px}.pm-loading[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:48px 0}.pm-modal[_ngcontent-%COMP%]{background:#0f1116!important;border:1px solid #2A2D38!important;border-radius:14px!important;overflow:hidden;box-shadow:0 24px 48px #0009!important}.pm-modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:18px 24px;background:#16181f;border-bottom:1px solid #2A2D38}.pm-modal-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#fff;margin:0}.pm-modal-close[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:1px solid #2A2D38;background:transparent;color:#9ca3af;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px}.pm-modal-close[_ngcontent-%COMP%]:hover{background:#191b21;color:#fff}.pm-modal-body[_ngcontent-%COMP%]{padding:24px}.pm-modal-msg[_ngcontent-%COMP%]{color:#fff;font-size:18px;line-height:1.6;margin-bottom:0}.pm-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.pm-label[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#9ca3af}.pm-required[_ngcontent-%COMP%]{color:#ef4444;margin-left:2px}.pm-input[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #2A2D38!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;width:100%;height:44px;outline:none}.pm-input[_ngcontent-%COMP%]::placeholder{color:#555868}.pm-input[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important}.pm-select[_ngcontent-%COMP%]{width:100%}.pm-error[_ngcontent-%COMP%]{color:#ef4444;font-size:12px}.pm-modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding-top:8px}.pm-modal-footer--center[_ngcontent-%COMP%]{justify-content:center;margin-top:12px}.pm-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border:1px solid #3a7bfd;border-radius:9999px;color:#fff;font-size:14px;font-weight:500;padding:9px 24px;
1cursor:pointer;transition:background .15s}.pm-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1260fd}.pm-btn-primary[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.pm-btn-outline[_ngcontent-%COMP%]{background:transparent;border:1px solid #363A47;border-radius:9999px;color:#e0e0e0;font-size:14px;font-weight:500;padding:9px 24px;cursor:pointer;transition:background .15s}.pm-btn-outline[_ngcontent-%COMP%]:hover{background:#ffffff0f}.borderbottobm[_ngcontent-%COMP%]{border-top:1px solid #272B37}.pm-cards-mobile[_ngcontent-%COMP%]{display:none}@media (max-width: 640px){.pm-page[_ngcontent-%COMP%]{gap:12px;padding:12px 14px 80px}.pm-breadcrumb[_ngcontent-%COMP%], .pm-bc-link[_ngcontent-%COMP%], .pm-bc-current[_ngcontent-%COMP%]{font-size:16px;font-weight:400}.pm-topbar[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:10px}.pm-actions-row[_ngcontent-%COMP%]{width:100%;flex-direction:row-reverse;align-items:center;margin-top:10px}.pm-import-btn[_ngcontent-%COMP%]{flex:1;text-align:center;padding:10px 20px}.pm-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)!important;gap:8px}.pm-stat-card[_ngcontent-%COMP%]{padding:12px 6px}.pm-stat-card[_ngcontent-%COMP%]:last-child{grid-column:1/-1}.pm-stat-value[_ngcontent-%COMP%]{font-size:20px}.pm-stat-label[_ngcontent-%COMP%]{font-size:11px}.pm-search-wrap[_ngcontent-%COMP%]{max-width:100%}.pm-table-card[_ngcontent-%COMP%]{display:none!important}.pm-cards-mobile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.pm-card-item[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:12px;overflow:hidden}.pm-card-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px}.pm-card-phone[_ngcontent-%COMP%]{font-size:17px;font-weight:600;color:#fff}.pm-card-badge[_ngcontent-%COMP%]{font-size:13px;font-weight:400;padding:4px 12px;border-radius:10px;border:1px solid #9ca3af;color:#9ca3af}.pm-card-badge--complete[_ngcontent-%COMP%]{border-color:#22c55e;color:#22c55e}.pm-card-badge--failed[_ngcontent-%COMP%]{border-color:#ef4444;color:#ef4444}.pm-card-fields[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;padding:0 16px 14px}.pm-card-field[_ngcontent-%COMP%]{font-size:13px;color:#e0e0e0}.pm-card-field--full[_ngcontent-%COMP%]{grid-column:1/-1}.pm-card-footer[_ngcontent-%COMP%]{border-top:1px solid #363A47;padding:12px 16px;font-size:13px;color:#e0e0e0}.pm-pagination-row[_ngcontent-%COMP%]{flex-wrap:wrap;justify-content:center;padding:10px}}']})}return o})();const Pe=(o,s,t)=>({totalItems:o,itemsPerPage:s,currentPage:t});function Oe(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",19),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.gotoCampaign())}),e.EFF(1,"CREATE NEW CAMPAIGN"),e.k0s()}}function Se(o,s){if(1&o){const t=e.RV6();e.j41(0,"div")(1,"form",23),e.bIt("ngSubmit",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.submitForm())}),e.j41(2,"div",24)(3,"label",25)(4,"h5"),e.EFF(5,"Campaign Name"),e.k0s()(),e.nrm(6,"input",26),e.k0s(),e.j41(7,"div",20)(8,"div",27)(9,"div",28),e.nrm(10,"input",29),e.k0s(),e.j41(11,"div",30),e.nrm(12,"textarea",31),e.k0s()()(),e.j41(13,"div",32)(14,"button",33),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.isCreateCampaign=!n.isCreateCampaign)}),e.EFF(15,"CANCEL"),e.k0s(),e.j41(16,"button",34),e.EFF(17,"SAVE & UPLOAD RECIPIENTS"),e.k0s()()()()}if(2&o){const t=e.XpG(2);e.R7$(),e.Y8G("formGroup",t.form),e.R7$(15),e.Y8G("disabled",!t.form.valid)}}function Ee(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",35)(1,"div",36)(2,"div",37)(3,"h4"),e.EFF(4,"Upload Recipients"),e.k0s()(),e.j41(5,"div",38)(6,"a",39),e.EFF(7,"Download Sample File"),e.k0s()()(),e.j41(8,"div",40)(9,"div",41),e.nrm(10,"div",42),e.k0s()(),e.j41(11,"div",43)(12,"button",44),e.EFF(13,"BACK"),e.k0s(),e.j41(14,"button",45),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.uploadDoc())}),e.EFF(15,"UPLOAD"),e.k0s()()()}if(2&o){const t=e.XpG(2);e.R7$(14),e.Y8G("disabled",t.disbaledFlag)}}function Ie(o,s){if(1&o&&(e.j41(0,"div",20)(1,"div",20)(2,"h4"),e.EFF(3,"Create New Campaign"),e.k0s()(),e.DNE(4,Se,18,2,"div",21)(5,Ee,16,1,"div",22),e.k0s()),2&o){const t=e.XpG();e.R7$(4),e.Y8G("ngIf",!t.isUploadEmail),e.R7$(),e.Y8G("ngIf",t.isUploadEmail)}}function Re(o,s){1&o&&(e.j41(0,"div",48)(1,"p"),e.EFF(2,"No Data To Display"),e.k0s()())}function Te(o,s){if(1&o&&(e.j41(0,"tr",58)(1,"td",59),e.EFF(2),e.k0s(),e.j41(3,"td",59),e.EFF(4),e.nI1(5,"date"),e.k0s(),e.j41(6,"td",59),e.EFF(7),e.k0s()()),2&o){const t=s.$implicit;e.R7$(2),e.JRh(null==t?null:t.campaignName),e.R7$(2),e.JRh(e.i5U(5,3,null==t?null:t.createdAt,"dd/M/yyyy , h:mm a")),e.R7$(3),e.JRh(null==t?null:t.emails.length)}}function Ne(o,s){if(1&o&&(e.j41(0,"option",60),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG(3);e.Y8G("ngValue",i.pageSize),e.R7$(),e.SpI(" ",t," ")}}function De(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",35)(1,"div",4)(2,"table",49)(3,"thead",50)(4,"tr")(
15,"th",51),e.EFF(6,"Campaign Name"),e.k0s(),e.j41(7,"th",51),e.EFF(8,"Created At"),e.k0s(),e.j41(9,"th",51),e.EFF(10,"No.Of Emails"),e.k0s()()(),e.j41(11,"tbody"),e.DNE(12,Te,8,6,"tr",52),e.nI1(13,"paginate"),e.k0s()()(),e.j41(14,"div",53)(15,"pagination-controls",54),e.bIt("pageChange",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageChange(n))}),e.k0s()(),e.j41(16,"div",55)(17,"select",56),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageSizeChange(n))}),e.DNE(18,Ne,2,2,"option",57),e.k0s()()()}if(2&o){const t=e.XpG(2);e.R7$(12),e.Y8G("ngForOf",e.i5U(13,2,t.campaignList,e.sMw(5,Pe,t.count,t.pageSize,t.page))),e.R7$(6),e.Y8G("ngForOf",t.pageSizes)}}function Ge(o,s){if(1&o&&(e.j41(0,"div",46),e.DNE(1,Re,3,0,"div",47)(2,De,19,9,"div",22),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.campaignList&&0==t.campaignList.length),e.R7$(),e.Y8G("ngIf",t.campaignList.length>0)}}let Ae=(()=>{class o{constructor(t,i,n){this.formBuilder=t,this.surveyService=i,this.toastrService=n,this.submitted=!1,this.pageSizes=[5,10,15],this.currentPage=0,this.page=0,this.count=0,this.pageSize=5,this.userData=JSON.parse(localStorage.getItem("currentUser")),this.test=[],this.campaignList=[],this.isCreateCampaign=!1,this.isUploadEmail=!1,this.disbaledFlag=!0,this.form=new r.gE({campaignname:new r.MJ(""),subjectname:new r.MJ(""),mailbody:new r.MJ("")})}ngOnInit(){this.getAllCampaignList(),this.pageSize=this.pageSizes[0],this.form=this.formBuilder.group({campaignName:["",r.k0.required],mailSubject:["",r.k0.required],mailBody:["",r.k0.required]})}get f(){return this.form.controls}getAllCampaignList(){this.surveyService.getAllCampaignList(localStorage.getItem("surveyId"),this.currentPage,this.pageSize).subscribe(t=>{console.log(t),this.campaignList=t.data,this.count=t.count,console.log("Pagination",this.page)},t=>{console.log(t)})}gotoCampaign(){this.resetForm(),this.isUploadEmail=!1,this.isCreateCampaign=!this.isCreateCampaign}resetForm(){this.form.patchValue({campaignName:"",mailSubject:"",mailBody:""})}submitForm(){if(this.submitted=!0,this.form.invalid)return;console.log(this.form.value);const t={campaignName:this.form.controls.campaignName.value,mailSubject:this.form.controls.mailSubject.value,mailBody:this.form.controls.mailBody.value,surveyId:localStorage.getItem("surveyId")};this.surveyService.uploadRecipients(t).subscribe(i=>{this.CampId=i._id,this.isUploadEmail=!0,console.log(i),this.toastrService.success("Recipients uploaded sucessfully."),this.ngOnInit(),this.resetForm()},i=>{console.error(i),this.toastrService.error("Oh! Not Uploaded please try again.")})}createChunk(t,i){let n=[],a=0;const l=t.length+t.length%i+1;for(let c=i;c<l;c+=i)n.push(t.slice(a,c)),a=c;console.log(n),n.map(c=>{this.uploadDoc()})}uploadDoc(){let i={email:JSON.parse(localStorage.getItem("currentUser")).email,userData:this.test,cId:this.CampId};this.surveyService.uploadRecipentFiles(i).subscribe(n=>{console.log(n),this.getAllCampaignList(),this.toastrService.success("Recipient Files uploaded sucessfully."),this.isCreateCampaign=!this.isCreateCampaign},n=>{console.error(n),this.toastrService.error("Oh! Not Uploaded Recipient Files please try again.")})}handlePageChange(t){1===t?(this.page=t,this.currentPage=t-1):t>1&&(this.page=t,this.currentPage=this.pageSize*(t-1)),console.log("this is page"),this.getAllCampaignList()}handlePageSizeChange(t){this.pageSize=t.target.value,this.page=1,this.currentPage=0,this.getAllCampaignList()}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(r.ok),e.rXU(b.I),e.rXU(x.tw))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-webchat-push"]],decls:27,vars:3,consts:[["discardChangesModal",""],["closeModal",""],[2,"padding","0px"],[1,"fisrt","row","px-0","pt-3"],[1,"col-sm-12","d-flex"],[1,"col-sm-12","text-right","px-0"],["class","nav-link btn btn-primary newcampaign","placement","top",3,"click",4,"ngIf"],["class","col-sm-12 px-0",4,"ngIf"],["class","content",4,"ngIf"],["type","button","data-bs-toggle","modal","data-bs-target","#discardChangesModal",1,"btn","btn-primary","d-none"],["id","discardChangesMo
1dal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-labelledby","discardChangesModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered","modal-lg"],[1,"modal-content","bg-white"],[1,"modal-body"],[1,"py-4","text-danger","text-center"],[1,"pb-4","text-center"],[1,"col-sm-12","text-center","py-3"],["id","closeModal","data-bs-dismiss","modal",1,"btn","btn-outline-primary","text-uppercase","btn1","ml-1","mr-4"],["id","closeModal","data-bs-dismiss","modal",1,"btn","btn-danger","text-uppercase","ml-4","btn4"],["placement","top",1,"nav-link","btn","btn-primary","newcampaign",3,"click"],[1,"col-sm-12","px-0"],[4,"ngIf"],["class","fisrt row px-0 py-3",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"col-sm-12","py-4","px-0","form-group"],["for",""],["type","text","placeholder","Enter campaign name","formControlName","campaignName",1,"form-control","pl-4"],[1,"col-sm-12","bg-white","shadow-md","p-5"],[1,"col-sm-12","form-group"],["type","text","placeholder","Subject","formControlName","mailSubject",1,"form-control","pl-4"],[1,"col-sm-12","py-4","form-group"],["name","","id","","cols","30","rows","10","placeholder","Compose Email","formControlName","mailBody",1,"form-control","pl-4","pt-4"],[1,"col-sm-12","text-right","pt-5","px-0","form-group"],["type","button","placement","top",1,"btn1","btn","btn-outline-primary","mr-2","p-2",3,"click"],["placement","top","type","submit",1,"btn2","btn","btn-primary","ml-2","p-2",3,"disabled"],[1,"fisrt","row","px-0","py-3"],[1,"col-sm-12","d-flex","py-3"],[1,"col-sm-4","px-0"],[1,"col-sm-8","text-right","px-0","text-primary"],["href","",2,"text-align","right"],[1,"col-sm-12","px-3"],[1,"col-sm-12","cover"],[1,"col-sm-12"],[1,"col-sm-12","text-right","py-5","px-3"],["type","button","placement","top","data-bs-toggle","modal","data-bs-target","#discardChangesModal",1,"btn1","btn","btn-outline-primary","mr-2","p-2"],["placement","top",1,"btn3","btn","btn-primary","ml-2","p-2",3,"click","disabled"],[1,"content"],["class","d-flex align-items-center justify-content-center contents",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-center","contents"],[1,"table","table-borderless","px-0"],[1,"table"],["scope","col",2,"text-align","center"],["class","bg-white shadow-lg",4,"ngFor","ngForOf"],[1,"row","col-sm-11","d-flex","justify-content-end","align-items-center","mt-3","content"],["previousLabel","Prev","nextLabel","Next","responsive","true",3,"pageChange"],[1,"col-sm-1","d-flex","justify-content-end","align-items-center","px-0",2,"margin-left","12px"],[1,"custom-select","form-select","form-select-sm",3,"change"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"bg-white","shadow-lg"],[2,"text-align","center"],[3,"ngValue"]],template:function(i,n){1&i&&(e.j41(0,"section",2)(1,"div",3)(2,"div",4)(3,"div",5),e.DNE(4,Oe,2,0,"button",6),e.k0s()()(),e.DNE(5,Ie,6,2,"div",7)(6,Ge,3,2,"div",8),e.k0s(),e.nrm(7,"br")(8,"br"),e.j41(9,"button",9,0),e.EFF(11," Discard Changes\n"),e.k0s(),e.j41(12,"div",10)(13,"div",11)(14,"div",12)(15,"div",13)(16,"h3",14),e.EFF(17," Are you sure? "),e.k0s(),e.j41(18,"h4",15),e.EFF(19,"Do you want to discard some unsaved changes?"),e.k0s(),e.j41(20,"div",16)(21,"button",17,1),e.EFF(23," CANCEL "),e.k0s(),e.j41(24,"button",18,1),e.EFF(26," DISCARD "),e.k0s()()()()()()),2&i&&(e.R7$(4),e.Y8G("ngIf",!n.isCreateCampaign),e.R7$(),e.Y8G("ngIf",n.isCreateCampaign),e.R7$(),e.Y8G("ngIf",!n.isCreateCampaign))},dependencies:[p.Sq,p.bT,v.ej,r.qT,r.xH,r.y7,r.me,r.BC,r.cb,r.j4,r.JD,p.vh,v.kf],styles:[".campaign[_ngcontent-%COMP%]{font-family:Rubik;font-weight:400px}.newcampaign[_ngcontent-%COMP%]{font-size:15px;width:225px}.main[_ngcontent-%COMP%]{padding:0}.btn1[_ngcontent-%COMP%]{width:100px;height:45px}.btn2[_ngcontent-%COMP%]{width:240px;height:46px}.btn3[_ngcontent-%COMP%], .btn4[_ngcontent-%COMP%]{width:120px;height:46px}.cover[_ngcontent-%COMP%]{padding:50px;border:1px solid black;border-radius:10px}th[_ngcontent-%COMP%]{color:#6b6666;font-size:18px;font-weight:400;line-height:5px}td[_ngcontent-%COMP%]{font-weight:300px;font-size:17px;padding:15px}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0 15px;width:100%}.content[_ngcontent-%COMP%]{font-size:15px;color:#000}.contents[_ngcontent-%COMP%]{height:500px;font-size:40px;color:#a5a1a1}input[_ngcontent-%COMP%]::file-selector-button{width:130px;height:40px;background:#efefef;border:.5px solid #b3b1b1;border-radius:5px}input[type=file][_ngcontent-%COMP%]{font-size:17px;color:#b3b1b1}.cover[_ngcontent-%COMP%]{border:.5px solid #b3b1b1}"]})}return o}
1)();var Ve=h(5348);function Le(o,s){if(1&o&&(e.j41(0,"li",7)(1,"a",8),e.nrm(2,"img",9),e.EFF(3," Channels "),e.k0s()()),2&o){const t=e.XpG();e.FS9("tooltip",0==(null==t.surveyDetails?null:t.surveyDetails.totalNoOfQuestions)?"Please add question to publish the survey":""),e.R7$(),e.AVh("ds-tab-active",t.router.url.startsWith("/survey/deploy-survey/channels")||t.router.url.startsWith("/survey/deploy-survey/email"))}}function $e(o,s){if(1&o&&(e.j41(0,"li",7)(1,"a",10),e.nrm(2,"img",11),e.EFF(3," Deployments "),e.k0s()()),2&o){const t=e.XpG();e.FS9("tooltip",0==(null==t.surveyDetails?null:t.surveyDetails.totalNoOfQuestions)?"Please add question to publish the survey":""),e.R7$(),e.AVh("ds-tab-active",t.router.url.startsWith("/survey/deploy-survey/deployments")||t.router.url.startsWith("/survey/deploy-survey/push-msg"))}}function Be(o,s){1&o&&(e.j41(0,"li",12)(1,"a",13),e.nrm(2,"i",14),e.EFF(3," Email Campaign "),e.k0s()())}function Xe(o,s){1&o&&(e.j41(0,"li",12)(1,"a",15),e.nrm(2,"i",16),e.EFF(3," Options "),e.k0s()())}let ze=(()=>{class o{constructor(t,i,n){this.authenticationService=t,this.surveyService=i,this.router=n,this.surveyName=localStorage.getItem("surveyName"),this.surveyDetails={}}ngOnInit(){this.getSurveyDetails(),sessionStorage.removeItem("participent")}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t})}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(F.k),e.rXU(b.I),e.rXU(g.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-deploy-survey"]],decls:10,vars:5,consts:[[3,"pageTitle"],[1,"ds-section"],[1,"ds-tab-bar"],["role","tablist",1,"ds-tabs"],["class","ds-tab-item","role","presentation",3,"tooltip",4,"ngIf"],["class","ds-tab-item","role","presentation",4,"ngIf"],[1,"col-sm-12"],["role","presentation",1,"ds-tab-item",3,"tooltip"],["routerLink","/survey/deploy-survey/channels",1,"ds-tab-link"],["src","assets/icons/task-square.svg",1,"ds-tab-icon-img"],["routerLink","/survey/deploy-survey/deployments",1,"ds-tab-link"],["src","assets/icons/shuffle-random.png",1,"ds-tab-icon-img"],["role","presentation",1,"ds-tab-item"],["routerLink","/survey/deploy-survey/email","routerLinkActive","ds-tab-active",1,"ds-tab-link"],[1,"fa","fa-envelope","ds-tab-icon"],["routerLink","/survey/deploy-survey/options","routerLinkActive","ds-tab-active",1,"ds-tab-link"],[1,"fa","fa-sliders","ds-tab-icon"]],template:function(i,n){1&i&&(e.nrm(0,"app-survey-pages-header",0),e.j41(1,"section",1)(2,"div",2)(3,"ul",3),e.DNE(4,Le,4,3,"li",4)(5,$e,4,3,"li",4)(6,Be,4,0,"li",5)(7,Xe,4,0,"li",5),e.k0s()(),e.j41(8,"div",6),e.nrm(9,"router-outlet"),e.k0s()()),2&i&&(e.Y8G("pageTitle",n.surveyName),e.R7$(4),e.Y8G("ngIf",!(n.router.url.startsWith("/survey/deploy-survey/email")||n.router.url.startsWith("/survey/deploy-survey/push-msg")||n.router.url.startsWith("/survey/deploy-survey/crm")||n.router.url.startsWith("/survey/deploy-survey/facebook-embedded")||n.router.url.startsWith("/survey/deploy-survey/facebook-templates")||n.router.url.startsWith("/survey/deploy-survey/facebook-push"))),e.R7$(),e.Y8G("ngIf",!(n.router.url.startsWith("/survey/deploy-survey/email")||n.router.url.startsWith("/survey/deploy-survey/push-msg")||n.router.url.startsWith("/survey/deploy-survey/crm")||n.router.url.startsWith("/survey/deploy-survey/facebook-embedded")||n.router.url.startsWith("/survey/deploy-survey/facebook-templates")||n.router.url.startsWith("/survey/deploy-survey/facebook-push"))),e.R7$(),e.Y8G("ngIf",n.router.url.startsWith("/survey/deploy-survey/email")),e.R7$(),e.Y8G("ngIf",!(n.router.url.startsWith("/survey/deploy-survey/email")||n.router.url.startsWith("/survey/deploy-survey/push-msg")||n.router.url.startsWith("/survey/deploy-survey/crm")||n.router.url.startsWith("/survey/deploy-survey/facebook-embedded")||n.router.url.startsWith("/survey/deploy-survey/facebook-templates")||n.router.url.startsWith("/survey/deploy-survey/facebook-push"))))},dependencies:[p.bT,g.n3,g.Wk,g.wQ,Ve.f],styles:["a.disabled[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.ds-section[_ngcontent-%COMP%]{background:#101116;min-height:100vh}.ds-tab-bar[_ngcontent-%COMP%]{padding:0 23px}.ds-tabs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;list-style:none;padding:0;margin:0;gap:48px}.ds-tab-item[_ngcontent-%COMP%]{display:flex}.ds-tab-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:7px;padding:14px 0;font-size:18px;color:#9ca3af;text-decoration:none!important;border-bottom:2px solid transparent;transition:color .15s,border-color .15s;cursor:pointer;white-space:nowrap}.ds-tab-link[_ngcontent-%COMP%]:hover{color:#f79522;text-decoration:none}.ds-tab-link[_ngcontent-%COMP%]:hover   .ds-tab-icon[_ngcontent-%COMP%]{color:#f79522}.ds-tab-link.ds-tab-active[_ngcontent-%COMP%]{color:#f79522;border-bottom-color:#f79522}.ds-tab-link.ds-tab-active[_ngcontent-%COMP%]   .ds-tab-icon[_ngcontent-%COMP%]{color:#f79522}.ds-tab-icon[_ngcontent-%COMP%]{font-size:13px;color:#9ca3af;transition:color .15s}.ds-tab-icon-img[_ngcontent-%COMP%]{width:14px;
1height:14px;object-fit:contain;flex-shrink:0;filter:brightness(0) saturate(100%) invert(69%) sepia(11%) saturate(405%) hue-rotate(176deg) brightness(91%) contrast(87%);transition:filter .15s}.ds-tab-link.ds-tab-active[_ngcontent-%COMP%]   .ds-tab-icon-img[_ngcontent-%COMP%], .ds-tab-link[_ngcontent-%COMP%]:hover   .ds-tab-icon-img[_ngcontent-%COMP%]{filter:brightness(0) saturate(100%) invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%)}.borderbottobm[_ngcontent-%COMP%]{border-top:1px solid #272B37}@media (max-width: 640px){.ds-tab-bar[_ngcontent-%COMP%]{padding:0 14px;overflow-x:auto;-webkit-overflow-scrolling:touch}.ds-tab-bar[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.ds-tabs[_ngcontent-%COMP%]{gap:24px;flex-wrap:nowrap}.ds-tab-link[_ngcontent-%COMP%]{font-size:18px;padding:12px 0;white-space:nowrap}}"]})}return o})();var O=h(5084),G=h(9631),A=h(2102);const Ye=["recurringscheduleModal"],qe=["recurringscheduleOffModal"],Ue=["reminderOnModal"],Je=["reminderOffModal"],We=o=>({"opt-disabled":o});function He(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",62),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.editRecurring())}),e.nrm(1,"i",63),e.k0s()}}function Ke(o,s){if(1&o&&(e.j41(0,"p",64),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(t.recurringMsgstr)}}function Qe(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",65),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.editReminder())}),e.nrm(1,"i",63),e.k0s()}}function Ze(o,s){if(1&o&&(e.j41(0,"p",64),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(t.reminderMsgstr)}}function et(o,s){if(1&o){const t=e.RV6();e.j41(0,"section",50)(1,"div",51)(2,"div",52)(3,"div",53)(4,"label",54)(5,"input",55),e.bIt("change",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.disablesaveRecurringSurveyDetails(n))}),e.k0s(),e.j41(6,"span",56),e.nrm(7,"span",57),e.k0s()(),e.j41(8,"span",58),e.EFF(9,"Recurring Survey"),e.k0s(),e.DNE(10,He,2,0,"button",59),e.k0s(),e.DNE(11,Ke,2,1,"p",60),e.k0s(),e.j41(12,"div",52)(13,"div",53)(14,"label",54)(15,"input",55),e.bIt("change",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.disablesaveReminderOnOff(n))}),e.k0s(),e.j41(16,"span",56),e.nrm(17,"span",57),e.k0s()(),e.j41(18,"span",58),e.EFF(19,"Reminder"),e.k0s(),e.DNE(20,Qe,2,0,"button",61),e.k0s(),e.DNE(21,Ze,2,1,"p",60),e.k0s()()()}if(2&o){const t=e.XpG();e.R7$(),e.Y8G("ngClass",e.eq3(11,We,"CLOSED"===t.surveyDetails.status)),e.R7$(),e.AVh("opt-row--expanded",t.isRecurringSurvey&&t.recurringMsgstr),e.R7$(3),e.Y8G("checked",1==t.isRecurringSurvey),e.R7$(5),e.Y8G("ngIf",1==t.isRecurringSurvey),e.R7$(),e.Y8G("ngIf",1==t.isRecurringSurvey&&t.recurringMsgstr),e.R7$(),e.AVh("opt-row--expanded",t.isReminder&&t.reminderMsgstr),e.R7$(3),e.Y8G("checked",1==t.isReminder),e.R7$(5),e.Y8G("ngIf",1==t.isReminder),e.R7$(),e.Y8G("ngIf",1==t.isReminder&&t.reminderMsgstr)}}function tt(o,s){1&o&&(e.j41(0,"section",66)(1,"div",67)(2,"span",68),e.EFF(3,"Loading..."),e.k0s()()())}function nt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",71),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG(2);return n.isSelected=!n.isSelected,e.Njj(a.setWeeklyDays())}),e.EFF(1),e.k0s()}if(2&o){const t=s.$implicit;e.AVh("opt-day--active",1==t.isSelected),e.R7$(),e.SpI(" ",t.viewValue," ")}}function it(o,s){if(1&o&&(e.j41(0,"div",19)(1,"label",20),e.EFF(2,"Select Day "),e.j41(3,"span",21),e.EFF(4,"*"),e.k0s()(),e.j41(5,"div",69),e.DNE(6,nt,2,3,"div",70),e.k0s()()),2&o){const t=e.XpG();e.R7$(6),e.Y8G("ngForOf",t.weekDayArr)}}function ot(o,s){if(1&o&&(e.j41(0,"div",19)(1,"label",20),e.EFF(2,"Repeat On "),e.j41(3,"span",21),e.EFF(4,"*"),e.k0s()(),e.nrm(5,"ng-select",72),e.k0s()),2&o){const t=e.XpG();e.R7$(5),e.Y8G("items",t.monthdateArr)("clearable",!1)("searchable",!1)}}let at=(()=>{class o{constructor(t,i,n,a,l){this.toastr=t,this.ss=i,this.route=n,this.authenticationService=a,this.surveyService=l,this.recurtype=[],this.isRecurringSurvey=!1,this.isReminder=!1,this.recurringType="daily",this.submitted=!1,this.isSubmitted=!1,this.isLoading=!0,this.minDate=new Date((new Date).valueOf()-864e5),this.recurringSureyDetails={recurringType:"",time_hours:12,time_minutes:15,startDate:new Date,endD
1ate:new Date,day:2,repeatOn:2},this.recurringMsgstr="",this.reminderMsgstr="",this.repeatEveryArr=[{value:"daily",viewValue:"Daily"},{value:"weekly",viewValue:"Weekly"},{value:"monthly",viewValue:"Monthly"}],this.hoursArr=[{value:0,viewValue:"00"},{value:1,viewValue:"01"},{value:2,viewValue:"02"},{value:3,viewValue:"03"},{value:4,viewValue:"04"},{value:5,viewValue:"05"},{value:6,viewValue:"06"},{value:7,viewValue:"07"},{value:8,viewValue:"08"},{value:9,viewValue:"09"},{value:10,viewValue:"10"},{value:11,viewValue:"11"},{value:12,viewValue:"12"},{value:13,viewValue:"13"},{value:14,viewValue:"14"},{value:15,viewValue:"15"},{value:16,viewValue:"16"},{value:17,viewValue:"17"},{value:18,viewValue:"18"},{value:19,viewValue:"19"},{value:20,viewValue:"20"},{value:21,viewValue:"21"},{value:22,viewValue:"22"},{value:23,viewValue:"23"}],this.minuteArr=[{value:0,viewValue:"00"},{value:15,viewValue:"15"},{value:30,viewValue:"30"},{value:45,viewValue:"45"}],this.weekDayArr=[{value:1,viewValue:"M",isSelected:!1},{value:2,viewValue:"T",isSelected:!1},{value:3,viewValue:"W",isSelected:!1},{value:4,viewValue:"T",isSelected:!1},{value:5,viewValue:"F",isSelected:!1},{value:6,viewValue:"S",isSelected:!1},{value:7,viewValue:"S",isSelected:!1}],this.monthdateArr=[{value:1,viewValue:"01"},{value:2,viewValue:"02"},{value:3,viewValue:"03"},{value:4,viewValue:"04"},{value:5,viewValue:"05"},{value:6,viewValue:"06"},{value:7,viewValue:"07"},{value:8,viewValue:"08"},{value:9,viewValue:"09"},{value:10,viewValue:"10"},{value:11,viewValue:"11"},{value:12,viewValue:"12"},{value:13,viewValue:"13"},{value:14,viewValue:"14"},{value:15,viewValue:"15"},{value:16,viewValue:"16"},{value:17,viewValue:"17"},{value:18,viewValue:"18"},{value:19,viewValue:"19"},{value:20,viewValue:"20"},{value:21,viewValue:"21"},{value:22,viewValue:"22"},{value:23,viewValue:"23"},{value:24,viewValue:"24"},{value:25,viewValue:"25"},{value:26,viewValue:"26"},{value:27,viewValue:"27"},{value:28,viewValue:"28"},{value:29,viewValue:"29"},{value:30,viewValue:"30"},{value:31,viewValue:"31"}],this.hoursArr1=[{value:6,viewValue:"6 Hours"},{value:12,viewValue:"12 Hours"},{value:24,viewValue:"24 Hours"}],this.repeatationArr=[{value:1,viewValue:"1 Time"},{value:2,viewValue:"2 Times"},{value:3,viewValue:"3 Times"}],this.reminderOnOffDetails={time_hours:0,repeatedtime:0},this.weeklyselectedDays=[],this.isRecurringEdit=!1,this.isReminderEdit=!1,this.surveyDetails={},this.recurringForm=new r.gE({recurringType:new r.MJ(null,[r.k0.required]),time_hours:new r.MJ(0,[r.k0.required]),time_minutes:new r.MJ(0,[r.k0.required]),startDate:new r.MJ("",[r.k0.required]),endDate:new r.MJ("",[r.k0.required]),repeatOn:new r.MJ(1,[r.k0.required])}),this.reminderForm=new r.gE({time_hours:new r.MJ(6,[r.k0.required]),repeatedtime:new r.MJ(1,[r.k0.required])}),this.reminderDetails={}}ngOnInit(){console.log("======authenticationService",this.authenticationService.accessibilityData?.userId),this.getRecurringSurveyDetails(),this.getReminderOnOffDetails(),this.getSurveyDetails()}setCheckBoxEvent(t){this.globalEvent=t}setCheckBox(){this.weekDayArr=[{value:1,viewValue:"M",isSelected:!1},{value:2,viewValue:"T",isSelected:!1},{value:3,viewValue:"W",isSelected:!1},{value:4,viewValue:"T",isSelected:!1},{value:5,viewValue:"F",isSelected:!1},{value:6,viewValue:"S",isSelected:!1},{value:7,viewValue:"S",isSelected:!1}],0==this.isRecurringEdit&&(this.globalEvent.target.checked=!this.globalEvent.target.checked),this.resetForm(),this.ngOnInit()}setCheckBoxForReminder(){0==this.isReminderEdit&&(this.globalEvent.target.checked=!this.globalEvent.target.checked),1==this.reminderOnOffDetails.isReminder?(this.reminderOnOffDetails=this.reminderOnOffDetails.reminderOnOffDetails,this.reminderForm.controls.repeatedtime.setValue(this.reminderOnOffDetails.reminderOnOffDetails.repeatedtime),this.reminderForm.controls.time_hours.setValue(this.reminderOnOffDetails.reminderOnOffDetails.time_hours)):(this.resetreminderForm(),this.ngOnInit())}getRecurringSurveyDetails(){this.isLoading=!0,this.ss.getRecurringSurveyDetails(localStorage.getItem("surveyId")).subscribe(t=>
1{if(console.log(t),t&&null!=t&&(this.isRecurringSurvey=!!t.isRecurringSurvey&&t.isRecurringSurvey,1==this.isRecurringSurvey?(this.recurringSureyDetails=t.recurringsurveyDetails,"weekly"==t.recurringsurveyDetails.recurringType&&t.recurringsurveyDetails.day.map(i=>{this.weekDayArr.map(n=>{i.value==n.value&&(n.isSelected=!0)})}),this.setWeeklyDays(),this.recurringType=t.recurringsurveyDetails.recurringType,this.recurringForm.controls.recurringType.setValue(t.recurringsurveyDetails.recurringType),this.recurringForm.controls.time_hours.setValue(t.recurringsurveyDetails.time_hours),this.recurringForm.controls.time_minutes.setValue(t.recurringsurveyDetails.time_minutes),this.recurringForm.controls.repeatOn.setValue(t.recurringsurveyDetails.repeatOn),this.recurringForm.controls.startDate.setValue(t.recurringsurveyDetails.startDate),this.recurringForm.controls.endDate.setValue(t.recurringsurveyDetails.endDate)):this.recurringType="daily"),this.recurringMsgstr="","weekly"==this.recurringType){let i=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],n="";this.weekDayArr.map(a=>{1==a.isSelected&&(n=n+i[a.value-1]+",")}),this.recurringMsgstr=`Every Survey Participant will receive the same survey\n          ${this.recurringSureyDetails.recurringType} on every ${n.replace(/,*$/,"")} at ${this.recurringSureyDetails.time_hours} : ${this.recurringSureyDetails.time_minutes?this.recurringSureyDetails.time_minutes:"00"} HRS starting from\n          ${new Date(this.recurringSureyDetails.startDate).toDateString()} to\n          ${new Date(this.recurringSureyDetails.endDate).toDateString()}`}"daily"==this.recurringType&&(this.recurringMsgstr=`Every Survey Participant will receive the same survey\n          ${this.recurringSureyDetails.recurringType} at ${this.recurringSureyDetails.time_hours} : ${this.recurringSureyDetails.time_minutes?this.recurringSureyDetails.time_minutes:"00"} HRS starting from\n          ${new Date(this.recurringSureyDetails.startDate).toDateString()} to\n          ${new Date(this.recurringSureyDetails.endDate).toDateString()}`),"monthly"==this.recurringType&&(this.recurringMsgstr=`Every Survey Participant will receive the same survey\n          ${this.recurringSureyDetails.recurringType} on day ${this.recurringSureyDetails.repeatOn} at ${this.recurringSureyDetails.time_hours} : ${this.recurringSureyDetails.time_minutes?this.recurringSureyDetails.time_minutes:"00"} HRS starting from\n          ${new Date(this.recurringSureyDetails.startDate).toDateString()} to\n          ${new Date(this.recurringSureyDetails.endDate).toDateString()}`),this.isLoading=!1},t=>{this.isLoading=!1,console.error(t)})}get f(){return this.recurringForm.controls}setWeeklyDays(){this.weeklyselectedDays.length=0,this.weekDayArr.map(t=>{1==t.isSelected&&this.weeklyselectedDays.push(t)})}saveRecurringSurveyDetails(){if(console.log(this.recurringForm),this.submitted=!0,this.recurringForm.invalid)return!1;if("weekly"==this.recurringType&&0==this.weeklyselectedDays.length)return this.toastr.error("Please select days"),!1;if(new Date(this.recurringForm.controls.startDate.value).getTime()>new Date(this.recurringForm.controls.endDate.value).getTime())return this.toastr.error("Start date should be less than end date."),!1;let t={surveyId:localStorage.getItem("surveyId"),isRecurringSurvey:!0,recurringsurveyDetails:{recurringType:this.recurringForm.controls.recurringType.value,time_hours:this.recurringForm.controls.time_hours.value,time_minutes:this.recurringForm.controls.time_minutes.value,repeatOn:this.recurringForm.controls.repeatOn.value,startDate:this.recurringForm.controls.startDate.value,endDate:this.recurringForm.controls.endDate.value,day:this.weeklyselectedDays}};console.log(t),this.ss.saveRecurringSurveyDetails(t).subscribe(i=>{this.getRecurringSurveyDetails(),this.toastr.success("Recurring Survey Data Saved Successfully"),document.getElementById("closeModal").click()},i=>{console.error(i),this.toastr.error("Recurring Survey Data Not saved.")})}editRecurring(){this.isRecurringEdit=!0}resetForm(){this.recurringForm=new r.gE({recurringType:new r.MJ(null,[r.k0.required]),time_hours:new r.MJ(0,[r.k0.required]),time_minutes:new r.MJ(0,[r.k0.required]),startDate:new r.MJ("",[r.k0.required]),endDate:new r.MJ("",[r.k0.required]),repeatOn:new r.MJ(1,[r.k0.required])})}disablesaveRecurringSurveyDetails(t){if(this.globalEvent=t,this.isRecurringEdit=!1,1==t.target.checked)return this.recurringscheduleModal.nativeElement.click(),!1;0==t.target.checked&&this.recurringscheduleOffModal.nativeElement.click()}offRecurringSurvey(){let t={surveyId:localStorage.getItem("surveyId"),isRecurringSurvey:!1,recurringsurveyDetails:this.recurringSureyDetails};this.ss.saveRecurringSurveyDetails(t).subscribe(i=>{this.toastr.success("Recurring Survey Turned Off"),this.resetForm(),this.weekDayArr=[{value:1,viewValue:"M",isSelected:!1},{value:2,viewValue:"T",isSelected:!1},{value:3,viewValue:"W",isSelected:!1},{value:4,viewValue:"T",isSelected:!1},{value:5,viewValue:"F",isSelected:!1},{value:6,viewValue:"S",isSelected:!1},{value:7,viewValue:"S",isSelected:!1}],this.ngOnInit()},i=>{console.error(i),this.toastr.error("Recurring Survey Data Not saved.")})}getReminderOnOffDetails(){this.isLoading=!0,this.ss.getReminderOnOffDetails(localStorage.getItem("surveyId")).subscribe(t=>{console.log(t),t&&null!=t&&(this.isReminder=!!t.isReminder&&t.isReminder,this.reminderOnOffDetails=t.reminderOnOffDetails,1==this.isReminder&&(this.reminderDetails=t,this.reminderOnOffDetails=t.reminderOnOffDetails,this.reminderForm.controls.repeatedtime.setValue(t.reminderOnOffDetails.repeatedtime),this.reminderForm.controls.time_hours.setValue(t.reminderOnOffDetails.time_hours),this.reminderMsgstr=`Reminders will be sent every ${this.reminderOnOffDetails.time_hours} hours\n            for ${this.reminderOnOffDetails.repeatedtime} times to the participants who\n            have started the survey but not completed.`)),this.isLoading=!1},t=>{this.isLoading=!1,console.error(t)})}get h(){return this.reminderForm.controls}
1saveReminderOnOffDetails(){if(console.log(this.reminderForm),this.isSubmitted=!0,this.reminderForm.invalid)return!1;let t={surveyId:localStorage.getItem("surveyId"),isReminder:!0,reminderOnOffDetails:{time_hours:this.reminderForm.controls.time_hours.value,repeatedtime:this.reminderForm.controls.repeatedtime.value}};console.log(t),this.ss.saveReminderOnOffDetails(t).subscribe(i=>{this.getReminderOnOffDetails(),console.log(i),this.toastr.success("Reminders Turned On")},i=>{console.error(i),this.toastr.error(" Reminders Are Not Turned On ")})}editReminder(){this.isReminderEdit=!0}resetreminderForm(){this.reminderForm=new r.gE({time_hours:new r.MJ(6,[r.k0.required]),repeatedtime:new r.MJ(1,[r.k0.required])}),1==this.reminderOnOffDetails.isReminder&&(this.reminderOnOffDetails=this.reminderOnOffDetails.reminderOnOffDetails,this.reminderForm.controls.repeatedtime.setValue(this.reminderOnOffDetails.reminderOnOffDetails.repeatedtime),this.reminderForm.controls.time_hours.setValue(this.reminderOnOffDetails.reminderOnOffDetails.time_hours))}disablesaveReminderOnOff(t){if(this.globalEvent=t,this.isReminderEdit=!1,1==t.target.checked)return this.reminderOnModal.nativeElement.click(),!1;0==t.target.checked&&(console.log("event uncheck"),this.reminderOffModal.nativeElement.click())}offReminder(){let t={surveyId:localStorage.getItem("surveyId"),isReminder:!1,reminderOnOffDetails:this.reminderOnOffDetails};this.ss.saveReminderOnOffDetails(t).subscribe(i=>{this.toastr.success("Reminder is Turned Off"),this.resetreminderForm(),this.ngOnInit()},i=>{console.error(i),this.toastr.error("Reminder is Not Turned On")})}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t})}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(x.tw),e.rXU(b.I),e.rXU(g.Ix),e.rXU(F.k),e.rXU(b.I))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-options"]],viewQuery:function(i,n){if(1&i&&(e.GBs(Ye,5),e.GBs(qe,5),e.GBs(Ue,5),e.GBs(Je,5)),2&i){let a;e.mGM(a=e.lsd())&&(n.recurringscheduleModal=a.first),e.mGM(a=e.lsd())&&(n.recurringscheduleOffModal=a.first),e.mGM(a=e.lsd())&&(n.reminderOnModal=a.first),e.mGM(a=e.lsd())&&(n.reminderOffModal=a.first)}},decls:120,vars:29,consts:[["recurringscheduleModal",""],["closeModal",""],["picker1",""],["picker2",""],["recurringscheduleOffModal",""],["reminderOnModal",""],["reminderOffModal",""],["class","opt-section",4,"ngIf"],["class","opt-loading",4,"ngIf"],["type","button","data-bs-toggle","modal","data-bs-target","#recurringscheduleModal",1,"btn","d-none"],["id","recurringscheduleModal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","opt-modal-dialog"],[1,"modal-content","opt-modal"],[1,"opt-modal-header"],[1,"opt-modal-title"],["type","button","id","closeModal","data-bs-dismiss","modal",1,"opt-modal-close",3,"click"],[1,"fa","fa-times"],[1,"opt-modal-body"],["role","form",3,"formGroup"],[1,"opt-field"],[1,"opt-field-label"],[1,"text-danger"],["formControlName","recurringType","bindLabel","viewValue","bindValue","value","placeholder","Select recurring type",1,"opt-ng-select",3,"change","items","clearable","searchable"],[1,"opt-row-fields"],["formControlName","time_hours","bindLabel","viewValue","bindValue","value","placeholder","00 (hh)",1,"opt-ng-select",3,"items","clearable","searchable"],["formControlName","time_minutes","bindLabel","viewValue","bindValue","value","placeholder","00 (mm)",1,"opt-ng-select",3,"items","clearable","searchable"],["class","opt-field",4,"ngIf"],[1,"opt-datepicker-wrap"],["appearance","outline",1,"opt-mat-field"],["matInput","","formControlName","startDate","placeholder","Start Date",3,"matDatepicker","min"],["matIconSuffix","",3,"for"],["matInput","","formControlName","endDate","placeholder","End Date",3,"matDatepicker","min"],[1,"opt-modal-footer"],["type","button",1,"opt-btn","opt-btn-primary",3,"click","disabled"],["type","button","data-bs-toggle","modal","data-bs-target","#recurringscheduleOffModal",1,"btn","d-none"],["id","recurringscheduleOffModal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],["type","button","data-bs-dismiss","modal",1,"opt-modal-close",3,"click"],[1,"opt-modal-body","text-center"],[1,"opt-modal-msg"],[1,"opt-modal-footer","opt-modal-footer--center"],["type","button","data-bs-dismiss","modal",1,"opt-btn","opt-btn-outline",3,"click"],["type","button","data-bs-dismiss","modal",1,"opt-btn","opt-btn-primary",3,"click"],["type","button","data-bs-toggle","modal","data-bs-target","#reminderOnModal",1,"btn","d-none"],["id","reminderOnModal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-hidden","true",1,"modal","fade"],["formControlName","time_hours","bindLabel","viewValue","bindValue","value","placeholder","Select Hours",1,"opt-ng-select",3,"items","clearable","searchable"],["formControlName","repeatedtime","bindLabel","viewValue","bindValue","value","placeholder","Select Times",1,"opt-ng-select",3,"items","clearable","searchable"],["type","button","data-bs-dismiss","modal",1,"opt-btn","opt-btn-primary",3,"click","disabled"],["type","button","data-bs-toggle","modal","data-bs-target","#reminderOffModal",1,"btn","d-none"],["id","reminderOffModal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"opt-section"],[3,"ngClass"],[1,"opt-row"],[1,"opt-row-top"],[1,"opt-toggle-wrap"],["type","checkbox","data-bs-toggle","modal","data-bs-target","#publishSurvy",1,"opt-toggle-input",3,"change","checked"],[1,"opt-toggle-track"],[1,"opt-toggle-thumb"],[1,"opt-label"],["type","button","class","opt-edit-btn","data-bs-toggle","modal","data-bs-target","#recurringscheduleModal",3,"click",4,"ngIf"],["class","opt-sub-text",4,"ngIf"],["type","button","class","opt-edit-btn","data-bs-toggle","modal","data-bs-target","#reminderOnModal",3,"click",4,"ngIf"],["type","button","data-bs-toggle","modal","data-bs-target","#recurringscheduleModal",1,"opt-edit-btn",3,"click"],[1,"fa","fa-pencil"],[1,"opt-sub-text"],["type","button","data-bs-toggle","modal","data-bs-target","#reminderOnModal",1,"opt-edit-btn",3,"click"],[1,"opt-loading"],["role","status",1,"spinner-grow",2,"width","2rem","height","2rem","color","#F79522"],[1,"sr-only"],[1,"opt-weekdays"],["class","opt-day",3,"opt-day--active","click",4,"ngFor","ngForOf"],[1,"opt-day",3,"click"],["formControlName","repeatOn","bindLabel","viewValue","bindValue","value","placeholder","Select",1,"opt-ng-select",3,"items","clearable","searchable"]],template:function(i,n){if(1&i){const a=e.RV6();e.DNE(0,et,22,13,"section",7)(1,tt,4,0,"section",8),e.j41(2,"button",9,0),e.EFF(4,"Recurring Schedule"),e.k0s(),e.j41(5,"div",10)(6,"div",11)(7,"div",12)(8,"div",13)(9,"h5",14),e.EFF(10,"Recurring Schedule"),e.k0s(),e.j41(11,"button",15,1),e.bIt("click",function(){return e.eBV(a),e.Njj(n.setCheckBox())}),e.nrm(13,"i",16),e.k0s()(),e.j41(14,"div",17)(15,"form",18)(16,"div",19)(17,"label",20),e.EFF(18,"Repeat every "),e.j41(19,"span",21),e.EFF(20,"*"),e.k0s()(),e.j41(21,"ng-select",22),e.bIt("change",function(c){return e.eBV(a),e.Njj(n.recurringType=null==c?null:c.value)}),e.k0s()(),e.j41(22,"div",19)(23,"label",20),e.EFF(24,"Time "),e.j41(25,"span",21),e.EFF(26,"*"),e.k0s()(),e.j41(27,"div",23),e.nrm(28,"ng-select",24)(29,"ng-select",25),e.k0s()(),e.DNE(30,it,7,1,"div",26)(31,ot,6,3,"div",26),e.j41(32,"div",19)(33,"label",20),e.EFF(34,"Start Date "),e.j41(35,"span",21),e.EFF(36,"*"),e.k0s()(),e.j41(37,"div",27)(38,"mat-form-field",28),e.nrm(39,"input",29)(40,"mat-datepicker-toggle",30)(41,"mat-datepicker",null,2),e.k0s()()(),e.j41(43,"div",19)(44,"label",20),e.EFF(45,"End Date "),e.j41(46,"span",21),e.EFF(47,"*"),e.k0s()(),e.j41(48,"div",27)(49,"mat-form-field",28),e.nrm(50,"input",31)(51,"mat-datepicker-toggle",30)(52,"mat-datepicker",null,3),e.k0s()()(),e.j41(54,"div",32)(55,"button",33),e.bIt("click",function(){return e.eBV(a),e.Njj(n.saveRecurringSurveyDetails())}),e.EFF(56," Schedule "),e.k0s()()()()()()(),e.j41(57,"button",34,4),e.EFF(59,"Recurring Survey Off"),e.k0s(),e.j41(60,"div",35)(61,"div",36)(62,"div",12)(63,"div",13)(64,"h5",14),e.EFF(65,"Turn Off Recurring Survey"),e.k0s(),e.j41(66,"button",37),e.bIt("click",function(){return e.eBV(a),e.Njj(n.setCheckBox())}),e.nrm(67,"i",16),e.k0s()(),e.j41(68,"div",38)(69,"p",39),e.EFF(70,"Are you sure you want to turn off the recurring survey?"),e.k0s(),e.j41(71,"div",40)(72,"button",41),e.bIt("click",function(){return e.eBV(a),e.Njj(n.setCheckBox())}),e.EFF(73,"Cancel"),e.k0s(),e.j41(74,"button",42),e.bIt("click",function(){return e.eBV(a),e.Njj(n.offRecurringSurvey())}),e.EFF(75,"Confirm"),e.k0s()()()()()(),e.j41(76,"button",43,5),e.EFF(78,"Reminder On"),e.k0s(),e.j41(79,"div",44)(80,"div",11)(81,"div",12)(82,"div",13)(83,"h5",14),e.EFF(84,"Reminder On"),e.k0s(),e.j41(85,"button",37),e.bIt("click",function(){return e.eBV(a),e.Njj(n.setCheckBoxForReminder())}),e.nrm(86,"i",16),e.k0s()(),e.j41(87,"div",17)(88,"form",18)(89,"div",19)(90,"label",20),e.EFF(91,"Remind After Every"),e.k0s(),e.nrm(92,"ng-select",45),e.k0s(),e.j41(93,"div",19)(94,"label",20),e.EFF(95,"For"),e.k0s(),e.nrm(96,"ng-select",46),e.k0s(),e.j41(97,"div",32)(98,"button",47,1),e.bIt("click",function(){return e.eBV(a),e.Njj(n.saveReminderOnOffDetails())}),e.EFF(100," Save "),e.k0s()()()()()()(),e.j41(101,"button",48,6),e.EFF(103,"Reminder Off"),e.k0s(),e.j41(104,"div",49)(105,"div",36)(106,"div",12)(107,"div",13)(108,"h5",14),e.EFF(109,"Turn Off Reminder"),e.k0s(),e.j41(110,"button",37),e.bIt("click",function(){return e.eBV(a),e.Njj(n.setCheckBoxForReminder())}),e.nrm(111,"i",16),e.k0s()(),e.j41(112,"div",38)(113,"p",39),e.EFF(114,"Are you sure you want to turn off the reminders?"),e.k0s(),e.j41(115,"div",40)(116,"button",41),e.bIt("click",function(){return e.eBV(a),e.Njj(n.setCheckBoxForReminder())}),e.EFF(117,"Cancel"),e.k0s(),e.j41(118,"button",42),e.bIt("click",function(){return e.eBV(a),e.Njj(n.offReminder())}),e.EFF(119,"Confirm"),e.k0s()()()()()()}if(2&i){const a=e.sdS(42),l=e.sdS(53);e.Y8G("ngIf",!n.isLoading),e.R7$(),e.Y8G("ngIf",n.isLoading),e.R7$(14),e.Y8G("formGroup",n.recurringForm),e.R7$(6),e.Y8G("items",n.repeatEveryArr)("clearable",!1)("searchable",!1),e.R7$(7),e.Y8G("items",n.hoursArr)("clearable",!1)("searchable",!1),e.R7$(),e.Y8G("items",n.minuteArr)("clearable",!1)("searchable",!1),e.R7$(),e.Y8G("ngIf","weekly"==n.recurringType),e.R7$(),e.Y8G("ngIf","monthly"==n.recurringType),e.R7$(8),e.Y8G("matDatepicker",a)("min",n.minDate),e.R7$(),e.Y8G("for",a),e.R7$(10),e.Y8G("matDatepicker",l)("min",n.minDate),e.R7$(),e.Y8G("for",l),e.R7$(4),e.Y8G("disabled",n.recurringForm.invali
1d||0==n.weeklyselectedDays.length&&"weekly"==n.recurringType),e.R7$(33),e.Y8G("formGroup",n.reminderForm),e.R7$(4),e.Y8G("items",n.hoursArr1)("clearable",!1)("searchable",!1),e.R7$(4),e.Y8G("items",n.repeatationArr)("clearable",!1)("searchable",!1),e.R7$(2),e.Y8G("disabled",n.reminderForm.invalid)}},dependencies:[p.YU,p.Sq,p.bT,O.Vh,O.bZ,O.bU,G.fg,A.rl,A.yw,r.qT,r.me,r.BC,r.cb,r.j4,r.JD,M.vr],styles:["@charset \"UTF-8\";.opt-section[_ngcontent-%COMP%]{padding:20px 20px 0 0}.opt-disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.5}.opt-loading[_ngcontent-%COMP%]{width:100%;min-height:70vh;display:flex;align-items:center;justify-content:center;background:#101116}.opt-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;background:#1d1f26;border-radius:10px;padding:14px 22px;margin-bottom:12px}.opt-row-top[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px}.opt-label[_ngcontent-%COMP%]{flex:1;font-size:16px;color:#fff}.opt-sub-text[_ngcontent-%COMP%]{color:#9ca3af;font-size:16px;margin:10px -22px 0;padding:10px 22px 0;border-top:1px solid rgba(255,255,255,.06);line-height:1.5}.opt-edit-btn[_ngcontent-%COMP%]{background:transparent;border:transparent;border-radius:9999px;color:#9ca3af;font-size:12px;padding:5px 14px;cursor:pointer;white-space:nowrap;transition:color .15s,border-color .15s}.opt-edit-btn[_ngcontent-%COMP%]:hover{color:#fff}.opt-toggle-wrap[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;cursor:pointer;flex-shrink:0;margin:0}.opt-toggle-input[_ngcontent-%COMP%]{position:absolute;opacity:0;width:0;height:0}.opt-toggle-track[_ngcontent-%COMP%]{width:36px;height:20px;background:#363a47;border-radius:9999px;position:relative;transition:background .2s;display:block}.opt-toggle-thumb[_ngcontent-%COMP%]{position:absolute;top:3px;left:3px;width:14px;height:14px;background:#fff;border-radius:50%;transition:transform .2s;display:block}.opt-toggle-input[_ngcontent-%COMP%]:checked ~ .opt-toggle-track[_ngcontent-%COMP%]{background:#f79522}.opt-toggle-input[_ngcontent-%COMP%]:checked ~ .opt-toggle-track[_ngcontent-%COMP%]   .opt-toggle-thumb[_ngcontent-%COMP%]{transform:translate(16px)}.opt-modal-dialog[_ngcontent-%COMP%]{max-width:480px}.opt-modal[_ngcontent-%COMP%]{background-color:#1c1d26!important;border:1px solid #2A2D38!important;border-radius:14px!important;overflow:hidden;box-shadow:0 24px 48px #0009!important}.opt-modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 16px}.opt-modal-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#fff;margin:0}.opt-modal-close[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:1.5px solid #BCBCBC;background:transparent;color:#9ca3af;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px;flex-shrink:0}.opt-modal-close[_ngcontent-%COMP%]:hover{background:#0b0d12;color:#fff}.opt-modal-body[_ngcontent-%COMP%]{padding:20px 24px}.opt-modal-msg[_ngcontent-%COMP%]{color:#e0e0e0;font-size:14px;line-height:1.6;margin-bottom:0}.opt-field[_ngcontent-%COMP%]{margin-bottom:18px}.opt-field-label[_ngcontent-%COMP%]{display:block;font-size:13px;font-weight:500;color:#e0e0e0;margin-bottom:6px}.opt-select[_ngcontent-%COMP%]{appearance:none!important;color-scheme:dark;background-color:#191b21!important;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\")!important;background-repeat:no-repeat!important;background-position:right 14px center!important;border:1px solid #43444D!important;border-radius:8px!important;color:#fff!important;padding:10px 40px 10px 14px;font-size:14px;width:100%;height:44px;outline:none}.opt-select[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#0b0d12;color:#fff}.opt-select[_ngcontent-%COMP%]   option[disabled][_ngcontent-%COMP%]{color:#b0b0b0}.opt-select[_ngcontent-%COMP%]:has(option[value=\"\"]:checked){color:#b0b0b0!important}.opt-select[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important;outline:none}.opt-row-fields[_ngcontent-%COMP%]{display:flex;gap:12px}.opt-row-fields[_ngcontent-%COMP%]   .opt-select[_ngcontent-%COMP%], .opt-row-fields[_ngcontent-%COMP%]   .opt-ng-select[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]     .opt-ng-select .ng-select-container{background:#191b21!important;border:1px solid #43444D!important;border-radius:8px!important;color:#fff!important;min-height:44px!important;padding:0 4px 0 10px}[_nghost-%COMP%]     .opt-ng-select .ng-value-label{color:#fff!important;font-size:14px!important}[_nghost-%COMP%]     .opt-ng-select .ng-placeholder{color:#b0b0b0!important;font-size:14px!important}[_nghost-%COMP%]     .opt-ng-select .ng-arrow-wrapper .ng-arrow{border-color:#9ca3af transparent transparent!important}[_nghost-%COMP%]     .opt-ng-select.ng-select-opened>.ng-select-container{border-color:#3a7bfd!important;border-radius:8px 8px 0 0!important}[_nghost-%COMP%]     .opt-ng-select .ng-dropdown-panel{background:#191b21!important;border:1px solid #43444D!important;border-top:none!important;border-radius:0 0 8px 8px!important;box-shadow:0 8px 24px #00000080!important}[_nghost-%COMP%]     .opt-ng-select .ng-option{background:#191b21!important;color:#e0e0e0!important;font-size:14px!important;padding:10px 14px!important}[_nghost-%COMP%]     .opt-ng-select .ng-option.ng-option-highlighted{background:#2a2d38!important;color:#fff!important}[_nghost-%COMP%]     .opt-ng-select .ng-option.ng-option-selected{background:#3a7bfd26!important;color:#fff!important}.opt-weekdays[_ngcontent-%COMP%]{display:flex;gap:8px;flex-wrap:wrap}.opt-day[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:50%;background:#1d1f26;border:1px solid #2A2D38;color:#9ca3af;font-size:11px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,color .15s}.opt-day--active[_ngcontent-%COMP%]{background:#f79522;border-color:#f79522;color:#fff}.opt-datepicker-wrap[_ngcontent-%COMP%], .opt-mat-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%]     .opt-mat-field .mat-mdc-text-field-wrapper{background:#191b21!important;border:1px solid #43444D!important;border-radius:8px!important;padding:0 12px!important}[_nghost-%COMP%]     .opt-mat-field .mdc-notched-outline__leading, [_nghost-%COMP%]     .opt-mat-field .mdc-notched-outline__notch, [_nghost-%COMP%]     .opt-mat-field .mdc-notched-outline__trailing{border:none!important}[_nghost-%COMP%]     .opt-mat-field input.mat-mdc-input-element{color:#fff!important;font-size:14px!important;caret-color:#fff}[_nghost-%COMP%]     .opt-mat-field input.mat-mdc-input-element::placeholder{color:#b0b0b0!important;opacity:1!important}[_nghost-%COMP%]     .opt-mat-field .mat-mdc-form-field-label, [_nghost-%COMP%]     .opt-mat-field .mat-mdc-floating-label{color:#fff!important}[_nghost-%COMP%]     .opt-mat-field .mat-datepicker-toggle button{color:#9ca3af!important}[_nghost-%COMP%]     .opt-mat-field .mat-mdc-form-field-subscript-wrapper{display:none!important}[_nghost-%COMP%]     .mat-datepicker-content{background:#0f1116!important;border:1px solid #2A2D38!important;border-radius:10px!important;color:#fff!important}[_nghost-%COMP%]     .mat-calendar-body-cell-content{color:#e0e0e0!important}[_nghost-%COMP%]     .mat-calendar-body-selected{background:#3a7bfd!important;color:#fff!important}[_nghost-%COMP%]     .mat-calendar-body-today:not(.mat-calendar-body-selected){border-color:#3a7bfd!important}[_nghost-%COMP%]     .mat-calendar-arrow{fill:#9ca3af!important}[_nghost-%COMP%]     .mat-calendar-table-header th, [_nghost-%COMP%]     .mat-calendar-period-button{color:#9ca3af!important}.opt-modal-footer[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:12px;padding-top:8px}.opt-modal-footer--center[_ngcontent-%COMP%]{margin-top:16px}.opt-btn[_ngcontent-%COMP%]{border-radius:9999px;font-size:14px;font-weight:500;padding:10px 32px;
1cursor:pointer;border:1px solid transparent;transition:background .15s,opacity .15s}.opt-btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.opt-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border-color:#3a7bfd;color:#fff}.opt-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1260fd}.opt-btn-outline[_ngcontent-%COMP%]{background:transparent;border-color:#3a7bfd;color:#3a7bfd}.opt-btn-outline[_ngcontent-%COMP%]:hover:not(:disabled){background:#3a7bfd1a}@media (max-width: 640px){.opt-section[_ngcontent-%COMP%]{padding:20px 0 0}.opt-ng-select[_ngcontent-%COMP%]{width:100%!important}.opt-row-fields[_ngcontent-%COMP%]{flex-direction:column;gap:10px}.opt-btn-primary[_ngcontent-%COMP%]{width:100%}}"]})}return o})();var V=h(152);const st=["publishsurveyModel"],rt=["createLinkModel"],lt=["questioncoutzeroModel"],ct=["checkActiveCampaignModel"],dt=["createDisscutionModel"],pt=o=>({"pointer-events":o});function ut(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",34),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return n.createLink(),e.Njj(n.linkType="Whatsapp")}),e.nrm(1,"img",35),e.j41(2,"span",36),e.EFF(3,"Whatsapp Link"),e.k0s()()}}function mt(o,s){1&o&&(e.j41(0,"div",37),e.nrm(1,"img",38),e.j41(2,"span",36),e.EFF(3,"Whatsapp Push"),e.k0s()())}function gt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",39),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return n.createLink(),e.Njj(n.linkType="Webchat")}),e.nrm(1,"img",40),e.j41(2,"span",36),e.EFF(3,"Webchatbot link"),e.k0s()()}}function ht(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",41),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return n.createLink(),e.Njj(n.linkType="Facebook")}),e.nrm(1,"img",42),e.j41(2,"span",36),e.EFF(3,"Facebook Link"),e.k0s()()}}function ft(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",43),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.createSalesforce("salesforce"))}),e.nrm(1,"img",44),e.j41(2,"span",36),e.EFF(3,"Salesforce Integration"),e.k0s()()}}function _t(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",43),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.createSalesforce("freshsales"))}),e.nrm(1,"img",45),e.j41(2,"span",36),e.EFF(3,"Freshsales Integration"),e.k0s()()}}function bt(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.onConnectFB())}),e.EFF(1,"CONNECT"),e.k0s()}}function vt(o,s){if(1&o&&(e.j41(0,"div",46),e.nrm(1,"img",47),e.j41(2,"div",48)(3,"span",36),e.EFF(4,"Your WhatsApp Business Number"),e.k0s(),e.DNE(5,bt,2,0,"button",49),e.k0s()()),2&o){const t=e.XpG(2);e.R7$(5),e.Y8G("ngIf",!t.isFBConnected)}}function xt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",43),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return!n.voiceTabDisabled&&n.createGuide(),e.Njj(n.linkType="disscutionguide")}),e.nrm(1,"i",51),e.j41(2,"span",36),e.EFF(3,"Voice"),e.k0s()()}if(2&o){const t=e.XpG(2);e.AVh("disabled-tab",t.voiceTabDisabled)("pointer-events-none",t.voiceTabDisabled)}}function kt(o,s){if(1&o&&(e.j41(0,"section")(1,"div",26),e.DNE(2,ut,4,0,"div",27)(3,mt,4,0,"div",28)(4,gt,4,0,"div",29)(5,ht,4,0,"div",30)(6,ft,4,0,"div",31)(7,_t,4,0,"div",31)(8,vt,6,1,"div",32)(9,xt,4,4,"div",33),e.k0s()()),2&o){const t=e.XpG();e.R7$(),e.Y8G("ngStyle",e.eq3(9,pt,t.surveyDetails.status&&"CLOSED"!=t.surveyDetails.status?"auto":"none")),e.R7$(),e.Y8G("ngIf",0==t.surveyDetails.isDGSurvey),e.R7$(),e.Y8G("ngIf",1==(null==t.authenticationService.accessibilityData?null:t.authenticationService.accessibilityData.isGupshpPushAllowed)&&0==t.surveyDetails.isDGSurvey),e.R7$(),e.Y8G("ngIf",0==t.surveyDetails.isDGSurvey),e.R7$(),e.Y8G("ngIf",0==t.surveyDetails.isDGSurvey),e.R7$(),e.Y8G("ngIf",0==t.surveyDetails.isDGSurvey),e.R7$(),e.Y8G("ngIf",0==t.surveyDetails.isDGSurvey),e.R7$(),e.Y8G("ngIf",1==(null==t.authenticationService.accessibilityData?null:t.authenticationService.accessibilityData.isFBPushAllowed)&&0==t.surveyDetails.isDGSurvey),e.R7$(),e.Y8G("ngIf",1==t.surveyDetails.isDGSurvey)}}function yt(o,s){1&o&&(e.j41(0,"section",52)(1,"div",53)(2,"span",54),e.
1EFF(3,"Loading..."),e.k0s()()())}function Ct(o,s){1&o&&(e.j41(0,"section",52)(1,"div",53)(2,"span",54),e.EFF(3,"Loading..."),e.k0s()()())}function Ft(o,s){if(1&o&&(e.j41(0,"option",75),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG(3);e.FS9("value",t.phone),e.Y8G("selected",i.gupshupPhone==t.phone),e.R7$(),e.JRh(t.displayName)}}function jt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",76),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.dropdownOpen=!1)}),e.k0s()}}function Mt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",79),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG(4);return e.Njj(a.selectPhone(n))}),e.EFF(1),e.k0s()}if(2&o){const t=s.$implicit,i=e.XpG(4);e.AVh("ch-option-selected",i.gupshupPhone==t.phone),e.R7$(),e.SpI(" ",t.displayName," ")}}function wt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",77),e.bIt("click",function(n){return e.eBV(t),e.Njj(n.stopPropagation())}),e.DNE(1,Mt,2,3,"div",78),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.phoneNumbersArr)}}function Pt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",60)(1,"label",61),e.EFF(2,"Send Survey From "),e.j41(3,"span",62),e.EFF(4,"*"),e.k0s()(),e.j41(5,"select",67),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.gupshupPhone=n.target.value)}),e.j41(6,"option",68),e.EFF(7,"Select phone"),e.k0s(),e.DNE(8,Ft,2,3,"option",69),e.k0s(),e.DNE(9,jt,1,0,"div",70),e.j41(10,"div",71),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.dropdownOpen=!n.dropdownOpen)}),e.j41(11,"div",72)(12,"span"),e.EFF(13),e.k0s(),e.nrm(14,"i",73),e.k0s(),e.DNE(15,wt,2,1,"div",74),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(8),e.Y8G("ngForOf",t.phoneNumbersArr),e.R7$(),e.Y8G("ngIf",t.dropdownOpen),e.R7$(),e.AVh("ch-custom-open",t.dropdownOpen),e.R7$(3),e.JRh(t.selectedPhoneLabel||"Select phone"),e.R7$(2),e.Y8G("ngIf",t.dropdownOpen)}}function Ot(o,s){if(1&o){const t=e.RV6();e.qex(0),e.j41(1,"div",55)(2,"h5",56),e.EFF(3,"Create Campaign"),e.k0s(),e.j41(4,"button",57),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.isLinkCreated=!1,e.Njj(n.resetform())}),e.nrm(5,"i",58),e.k0s()(),e.j41(6,"div",59)(7,"div",60)(8,"label",61),e.EFF(9,"Campaign Title "),e.j41(10,"span",62),e.EFF(11,"*"),e.k0s()(),e.j41(12,"input",63),e.bIt("keydown",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.validateInput(n))})("input",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.CommonService.onPaste(n))})("input",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.linkName=n.target.value)}),e.k0s()(),e.DNE(13,Pt,16,6,"div",64),e.j41(14,"div",65)(15,"button",17),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.isLinkCreated=!1,e.Njj(n.resetform())}),e.EFF(16,"Close"),e.k0s(),e.j41(17,"button",66),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.saveData())}),e.EFF(18,"Create"),e.k0s()()(),e.bVm()}if(2&o){const t=e.XpG();e.R7$(12),e.FS9("value",t.linkName),e.R7$(),e.Y8G("ngIf","Facebook"!=t.linkType&&"Webchat"!=t.linkType),e.R7$(4),e.Y8G("disabled",!t.areAllFieldsFilled())}}function St(o,s){if(1&o){const t=e.RV6();e.qex(0),e.j41(1,"div",55)(2,"h5",56),e.EFF(3,"Campaign Link"),e.k0s(),e.j41(4,"button",80),e.nrm(5,"i",58),e.k0s()(),e.j41(6,"div",59)(7,"div",60)(8,"label",61),e.EFF(9,"Survey Link"),e.k0s(),e.nrm(10,"input",81),e.k0s(),e.j41(11,"div",65)(12,"button",23),e.EFF(13,"Close"),e.k0s(),e.j41(14,"button",82),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.copyNewLink(n.surveyLink))}),e.EFF(15,"Copy Link"),e.k0s()()(),e.bVm()}if(2&o){const t=e.XpG();e.R7$(10),e.FS9("value",t.surveyLink)}}function Et(o,s){if(1&o){const t=e.RV6();e.qex(0),e.j41(1,"div",59)(2,"div",60)(3,"label",61),e.EFF(4,"Campaign Title "),e.j41(5,"span",62),e.EFF(6,"*"),e.k0s()(),e.j41(7,"input",83),e.mxI("ngModelChange",function(n){e.eBV(t);const a=e.XpG();return e.DH7(a.linkName,n)||(a.linkName=n),e.Njj(n)}),e.bIt("keydown",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.validateInput(n))})("paste",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.CommonService.onPaste(n))}),e.k0s()(),e.j41(8,"div",65)(9,"button",17),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return n.isLinkCreated=!1,e.Njj(n.resetform())}),e.EFF(10,"Close"),e.k0s(),e.j41(11,"button",66),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.createDicussionGuide())}),e.EFF(12,"Create"),e.k0s()()(),e.bVm()}if(2&o){const t=e.XpG();e.R7$(7),e.R50("ngModel",t.linkName),e.R7$(4),e.Y8G("disabled",!t.areAllFieldsFilled())}}function It(o,s){if(1&o){const t=e.RV6();e.qex(0),e.j41(1,"div",55)(2,"h5",56),e.EFF(3,"Campaign Link"),e.k0s(),e.j41(4,"button",8
10),e.nrm(5,"i",58),e.k0s()(),e.j41(6,"div",59)(7,"div",60)(8,"label",61),e.EFF(9,"Survey Link"),e.k0s(),e.nrm(10,"input",81),e.k0s(),e.j41(11,"div",65)(12,"button",23),e.EFF(13,"Close"),e.k0s(),e.j41(14,"button",82),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.copyNewLink(n.surveyLink))}),e.EFF(15,"Copy Link"),e.k0s()()(),e.bVm()}if(2&o){const t=e.XpG();e.R7$(10),e.FS9("value",t.surveyLink)}}let Rt=(()=>{class o{constructor(t,i,n,a,l,c){this.surveyService=t,this.toastrService=i,this.router=n,this.CommonService=a,this.authenticationService=l,this.dashboardService=c,this.surveyDetails={},this.embedCode="",this.surveyLink="",this.ongoingSurveysArr=[],this.createSurveyLink=!1,this.currentTutorial=null,this.currentIndex=-1,this.title="",this.totalitems=[],this.surveyName="",this.isLoading=!1,this.linkType="Whatsapp",this.isLinkCreated=!1,this.linkName="",this.phoneNumbersArr=[],this.gupshupPhone="",this.length=0,this.pageIndex=0,this.showPageSizeOptions=!0,this.pageSizeOptions=[5,10,25],this.pageSize=5,this.isFBConnected=!1,this.dropdownOpen=!1,this.selectedPhoneLabel="",this.voiceTabDisabled=!1,this.isSalesforceIntegration=!1,this.crmType="",this.showLoading=!1,this.createGuideModel=!1;let m=new Date;m=new Date(m.getTime()+864e5),this.minDate=m.toISOString().split("T")[0]}ngOnInit(){this.isLoading=!0,this.surveyCategory=localStorage.getItem("surveyCategory"),this.surveyName=localStorage.getItem("surveyName"),this.getSurveyDetails(),this.embedCode='<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSfTVOGCeSWQwtnU4Yc_fTeON07LrB_6f4eF8EvfrUyCRzggBA/viewform?embedded=true" width="640" height="2151" frameborder="0" marginheight="0" marginwidth="0">Loading\u2026</iframe>';const t=JSON.parse(localStorage.getItem("currentUser")||"{}");this.dashboardService.checkAlreadyEmbeddedUser(t?.email).subscribe(i=>{!0===i?.isAlreadyEmbeddedUser&&(this.isFBConnected=!0)},i=>{console.error(i)})}getPhoneNumbers(){this.surveyService.getPhoneNumbers().subscribe(t=>{t&&(this.phoneNumbersArr=t.whatsAppPhones,0!=this.phoneNumbersArr&&(this.gupshupPhone=this.phoneNumbersArr[0].phone,this.selectedPhoneLabel=this.phoneNumbersArr[0].displayName))},t=>{console.error(t)})}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t,console.log("Survey Details: ",this.surveyDetails),this.voiceTabDisabled=!(t?.key_information_areas&&t.key_information_areas.length>0),this.isLoading=!1,this.surveyID=t?._id,this.getPhoneNumbers()})}createLink(){this.isLinkCreated=!1,this.isSalesforceIntegration=!1,"DRAFT"==this.surveyDetails.status?0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click():this.createLinkModel.nativeElement.click()}createGuide(){this.isLinkCreated=!1,this.isSalesforceIntegration=!1,this.createGuideModel=!0,!0!==this.surveyDetails?.is_media_required||this.surveyDetails?.DGMedia&&0!==this.surveyDetails.DGMedia.length?"DRAFT"==this.surveyDetails.status?0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click():this.createDisscutionModel.nativeElement.click():this.toastrService.error("Please upload Media before publishing the discussion guide")}createSalesforce(t){if(this.createGuideModel=!1,this.isLinkCreated=!1,this.isSalesforceIntegration=!0,this.crmType=t,"DRAFT"==this.surveyDetails.status)0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click();else{let i=localStorage.getItem("currentUser");i&&(i=JSON.parse(i)),this.showLoading=!0,this.surveyService.checkActiveCampaign({surveyId:localStorage.getItem("surveyId"),email:i?.email}).subscribe(n=>{this.showLoading=!1,1==n?.isActiveSurveyFound?this.checkActiveCampaign.nativeElement.click():this.router.navigateByUrl("/survey/deploy-survey/crm/"+t)})}}updateStatus(t){t&&this.surveyService.updateSurveyStatus({id:this.surveyID,is_published:!0}).subscribe(n=>{this.toastrService.success("Survey Published successfully."),this.isSalesforceIntegration?this.checkCampgin():this.createGuideModel?this.createDisscutionModel.nativeElement.click():this.createLinkModel.nativeElement.click(),this.get
1SurveyDetails()},n=>{console.error(n)})}onConnectFB(){const t=JSON.parse(localStorage.getItem("currentUser")||"{}");this.dashboardService.checkAlreadyEmbeddedUser(t?.email).subscribe(i=>{this.router.navigateByUrl(!0===i?.isAlreadyEmbeddedUser?"/survey/deploy-survey/facebook-push":"/survey/deploy-survey/facebook-embedded")},i=>{console.error(i)})}checkCampgin(){let t=localStorage.getItem("currentUser");t&&(t=JSON.parse(t)),this.showLoading=!0,this.surveyService.checkActiveCampaign({surveyId:localStorage.getItem("surveyId"),email:t?.email}).subscribe(i=>{this.showLoading=!1,1==i?.isActiveSurveyFound?this.checkActiveCampaign.nativeElement.click():this.router.navigateByUrl("/survey/deploy-survey/crm/"+this.crmType)})}copyLink(t){var i=document.createElement("textarea");document.body.appendChild(i),i.value=t.collectorLink,i.select(),document.execCommand("copy"),document.body.removeChild(i),this.toastrService.success("Copied")}copyNewLink(t){navigator.clipboard.writeText(t),this.toastrService.success("Copied")}getRequestParams(t,i){let n={};return t&&(n.page=t-1),i&&(n.size=i),n}setActiveTutorial(t,i){this.currentTutorial=t,this.currentIndex=i}goToSocial(t){console.log(t)}saveData(){this.checkCampName({collectorType:this.linkType,linkName:this.linkName,sender_phone:this.gupshupPhone,surveyId:this.surveyID,campaignName:this.linkName})}checkCampName(t){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.linkName).subscribe(i=>{this.createNewLink(t),console.log(i)},i=>{this.toastrService.error(i)})}createDicussionGuide(){const t=localStorage.getItem("surveyId");t?this.surveyService.createDicussionGuide({surveyId:t}).subscribe(n=>{this.isLinkCreated=!0,this.linkName="",this.toastrService.success("Link Created sucessfully."),this.surveyLink=n.collectorLink,this.router.navigateByUrl("/survey/deploy-survey/deployments")},n=>{console.error(n),this.createSurveyLink=!1,this.toastrService.error(n.message)}):this.toastrService.error("Survey ID not found.")}createNewLink(t){this.surveyService.createSurveyLink(localStorage.getItem("surveyId"),t).subscribe(i=>{console.log("==========",i),this.isLinkCreated=!0,this.linkName="",this.toastrService.success("Link Created sucessfully."),this.surveyLink=i.collectorLink,localStorage.setItem("surveyLink",this.surveyLink),this.router.navigateByUrl("/survey/deploy-survey/deployments")},i=>{console.error(i),this.createSurveyLink=!1,this.toastrService.error(i.message)})}selectPhone(t){this.gupshupPhone=t.phone,this.selectedPhoneLabel=t.displayName,this.dropdownOpen=!1}resetform(){this.linkName=""}updatePreviewAndTest(t){this.surveyService.updateSurveyLink({_id:t._id,isActive:!1}).subscribe(n=>{console.log(n),this.toastrService.success("Link deactivated sucessfully.")},n=>{console.error(n),this.toastrService.error("Oh! Not saved please try again.")})}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}areAllFieldsFilled(){return this.linkName&&""!==this.linkName.trim()&&this.gupshupPhone&&""!==this.gupshupPhone.trim()}restrictNegativeNumbers(t){const i=t.target.value;i.startsWith("-")&&(t.target.value=i.replace("-",""))}validateInput(t){let i=t.which?t.which:t.keyCode;return!!(8===i||9===i||13===i||i>=37&&i<=40||46===i||/^[A-Za-z0-9\s]+$/.test(t.key))||(t.preventDefault(),!1)}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(b.I),e.rXU(x.tw),e.rXU(g.Ix),e.rXU(j.h),e.rXU(F.k),e.rXU(V.I))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-channels"]],viewQuery:function(i,n){if(1&i&&(e.GBs(st,7),e.GBs(rt,7),e.GBs(lt,7),e.GBs(ct,7),e.GBs(dt,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.createLinkModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first),e.mGM(a=e.lsd())&&(n.checkActiveCampaign=a.first),e.mGM(a=e.lsd())&&(n.createDisscutionModel=a.first)}},decls:57,vars:7,consts:[["createLinkModel",""],["publishsurveyModel",""],["closeModal",""],["questioncoutzeroModel",""],["checkActiveCampaignModel",""],["createDisscutionModel",""],[4,"ngIf"],["class","ch-loading",4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#createLink",2,"display","none"],["id","createLink","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content","ch-modal"],["data-bs-toggle","modal","data-bs-target","#publishSurvy",2,"display","none"],["id","publishSurvy","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"ch-modal-body","text-center"],[1,"ch-modal-msg"],[1,"ch-modal-footer","ch-modal-footer--center"],["type","button","data-bs-dismiss","modal",1,"ch-btn","ch-btn-outline",3,"click"],["type","button","data-bs-dismiss","modal",1,"ch-btn","ch-btn-primary",3,"click"],["data-bs-toggle","modal","data-bs-target","#questioncoutzero",2,"display","none"],["id","questioncoutzero","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],["data-bs-toggle","modal","data-bs-target","#checkActiveCampaign",2,"display","none"],["id","checkActiveCampaign","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],["type","button","data-bs-dismiss","modal",1,"ch-btn","ch-btn-outline"],["data-bs-toggle","modal","data-bs-target","#createGuide",2,"display","none"],["id","createGuide","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"channels-grid","mt-3",3,"ngStyle"],["class","channel-card","tooltip","Create new link for Whatsapp",3,"click",4,"ngIf"],["class","channel-card","style","gap: 9px;","tooltip","Import Recepients","routerLink","/survey/deploy-survey/push-msg",4,"ngIf"],["class","channel-card ","tooltip","Create new link for Webchat",3,"click",4,"ngIf"],["class","channel-card","tooltip","Create new link for Facebook",3,"click",4,"ngIf"],["class","channel-card","tooltip","Import Recepients",3,"click",4,"ngIf"],["class","channel-card channel-card--connect","tooltip","Facebook Embed","routerLink","/survey/deploy-survey/facebook-embedded",4,"ngIf"],["class","channel-card","tooltip","Import Recepients",3,"disabled-tab","pointer-events-none","click",4,"ngIf"],["tooltip","Create new link for Whatsapp",1,"channel-card",3,"click"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/whatapp.svg",1,"ch-icon"],[1,"ch-name"],["tooltip","Import Recepients","routerLink","/survey/deploy-survey/push-msg",1,"channel-card",2,"gap","9px"],["src","/assets/icons/Frame (1).svg",1,"ch-icon"],["tooltip","Create new link for Webchat",1,"channel-card",3,"click"],["src","/assets/icons/rect6094-5-9.svg",1,"ch-icon"],["tooltip","Create new link for Facebook",1,"channel-card",3,"click"],["src","https://merrenbucket.s3.ap-south-1.amazonaws.com/facebookm.svg",1,"ch-icon"],["tooltip","Import Recepients",1,"channel-card",3,"click"],["src","../assets/img/salesforce-logo 1.svg",1,"ch-icon"],["src","../assets/img/freshsales.svg",1,"ch-icon"],["tooltip","Facebook Embed","routerLink","/survey/deploy-survey/facebook-embedded",1,"channel-card","channel-card--connect"],["src","../assets/icons/whatsapp-svgrepo-com (1).svg",1,"ch-icon"],[1,"ch-meta"],["class","ch-connect-btn",3,"click",4,"ngIf"],[1,"ch-connect-btn",3,"click"],[1,"fas","fa-microphone","ch-icon-fa",2,"color","#fd7e14"],[1,"ch-loading"],["role","status",1,"spinner-grow",2,"width","2rem","height","2rem","color","#F79522"],[1,"sr-only"],[1,"ch-modal-header"],[1,"ch-modal-title"],["type","button","data-bs-dismiss","modal",1,"ch-modal-close",3,"click"],[1,"fa","fa-times"],[1,"ch-modal-body"],[1,"ch-form-group"],[1,"ch-label"],[1,"text-danger"],["type","text","id","Title","maxlength","30","placeholder","Enter campaign title",1,"ch-input",3,"keydown","input","value"],["class","ch-form-group",4,"ngIf"],[1,"ch-modal-footer"],["type","button","data-bs-dismiss","modal",1,"ch-btn","ch-btn-primary",3,"click","disabled"],[1,"ch-select","ch-select-desktop",3,"change"],["selected","","disabled",""],[3,"selected","value",4,"ngFor","ngForOf"],["class","ch-custom-backdrop",3,"click",4,"ngIf"],[1,"ch-custom-select","ch-select-mobile",3,"click"],[1,"ch-custom-display"],[1,"fa","fa-chevron-down","ch-custom-arrow"],["class","ch-custom-options",3,"click",4,"ngIf"],[3,"selected","value"],[1,"ch-custom-backdrop",3,"click"],[1,"ch-custom-options",3,"click"],["class","ch-custom-option",3,"ch-option-selected","click",4,"ngFor","ngForOf"],[1,"ch-custom-option",3,"click"],["type","button","data-bs-dismiss","modal",1,"ch-modal-close"],["type","text","placeholder","Link","readonly","",1,"ch-input",3,"value"],["type","button",1,"ch-btn","ch-btn-primary",3,"click"],["type","text","maxlength","30","placeholder","Enter campaign title",1,"ch-input",3,"ngModelChange","keydown","paste","ngModel"]],template:function(i,n){if(1&i){const a=e.RV6();e.DNE(0,kt,10,11,"section",6)(1,yt,4,0,"section",7)(2,Ct,4,0,"section",7),e.nrm(3,"a",8,0),e.j41(5,"div",9)(6,"div",10)(7,"div",11),e.DNE(8,Ot,19,3,"ng-container",6)(9,St,16,1,"ng-container",6),e.k0s()()(),e.nrm(10,"a",12,1),e.j41(12,"div",13)(13,"div",10)(14,"div",11)(15,"div",14)(16,"p",15),e.EFF(17,"Are you sure you want to publish this 
1survey?"),e.k0s(),e.j41(18,"div",16)(19,"button",17),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.EFF(20,"Close"),e.k0s(),e.j41(21,"button",18,2),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!0))}),e.EFF(23,"Publish"),e.k0s()()()()()(),e.nrm(24,"a",19,3),e.j41(26,"div",20)(27,"div",10)(28,"div",11)(29,"div",14)(30,"p",15),e.EFF(31,"Survey looks empty."),e.nrm(32,"br"),e.EFF(33,"Please add questions to publish the survey."),e.k0s(),e.j41(34,"div",16)(35,"button",17),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!0))}),e.EFF(36,"My Dashboard"),e.k0s(),e.j41(37,"button",18),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!1))}),e.EFF(38,"Add Questions"),e.k0s()()()()()(),e.nrm(39,"a",21,4),e.j41(41,"div",22)(42,"div",10)(43,"div",11)(44,"div",14)(45,"p",15),e.EFF(46,"You can't enable Salesforce integration for this survey. There is already a Salesforce integration live for another survey."),e.k0s(),e.j41(47,"div",16)(48,"button",23),e.EFF(49,"Close"),e.k0s()()()()()(),e.nrm(50,"a",24,5),e.j41(52,"div",25)(53,"div",10)(54,"div",11),e.DNE(55,Et,13,2,"ng-container",6)(56,It,16,1,"ng-container",6),e.k0s()()()}2&i&&(e.Y8G("ngIf",!n.isLoading&&!n.showLoading),e.R7$(),e.Y8G("ngIf",n.showLoading),e.R7$(),e.Y8G("ngIf",n.isLoading),e.R7$(6),e.Y8G("ngIf",!n.isLinkCreated),e.R7$(),e.Y8G("ngIf",n.isLinkCreated),e.R7$(46),e.Y8G("ngIf",!n.isLinkCreated),e.R7$(),e.Y8G("ngIf",n.isLinkCreated))},dependencies:[p.Sq,p.bT,p.B3,g.Wk,r.xH,r.y7,r.me,r.BC,r.tU,r.vS],styles:['@charset "UTF-8";.ch-loading[_ngcontent-%COMP%]{width:100%;min-height:70vh;display:flex;align-items:center;justify-content:center;background:#101116}.channels-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:80px;gap:16px;padding:24px 10px}@media (max-width: 1024px){.channels-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)}}@media (max-width: 768px){.channels-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}@media (max-width: 480px){.channels-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.channel-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px;height:100%;box-sizing:border-box;background:#1d1f26;border:1px solid #363A47;border-radius:12px;padding:10px;cursor:pointer;transition:background .15s,border-color .15s}.channel-card[_ngcontent-%COMP%]:hover{background:#23262f;border-color:#484d5e}.channel-card--connect[_ngcontent-%COMP%]{align-items:center}.ch-icon[_ngcontent-%COMP%]{width:36px;height:36px;object-fit:contain;flex-shrink:0}.ch-icon-fa[_ngcontent-%COMP%]{font-size:26px;width:36px;text-align:center;flex-shrink:0}.ch-name[_ngcontent-%COMP%]{color:#e0e0e0;font-size:14px;font-weight:500;line-height:1.3}.ch-meta[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.ch-meta[_ngcontent-%COMP%]   .ch-name[_ngcontent-%COMP%]{font-size:12px;line-height:1.25}.ch-connect-btn[_ngcontent-%COMP%]{background:transparent;border:none;padding:0;font-size:12px;font-weight:600;color:#3a7bfd;cursor:pointer;text-align:left;letter-spacing:.5px}.ch-connect-btn[_ngcontent-%COMP%]:hover{text-decoration:underline}.ch-modal[_ngcontent-%COMP%]{background-color:#0f1116!important;border:1px solid #2A2D38!important;border-radius:14px!important;overflow:hidden;box-shadow:0 24px 48px #0009!important}.ch-modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 16px;background-color:#16181f;border-bottom:1px solid #2A2D38}.ch-modal-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#fff;margin:0}.ch-modal-close[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:1px solid #2A2D38;background:transparent;color:#9ca3af;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px;flex-shrink:0}.ch-modal-close[_ngcontent-%COMP%]:hover{background:#191b21;color:#fff}.ch-modal-body[_ngcontent-%COMP%]{padding:20px 24px}.ch-modal-msg[_ngcontent-%COMP%]{color:#e0e0e0;font-size:18px;line-height:1.6;margin-bottom:0}.ch-form-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.ch-label[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#9ca3af}.ch-input[_ngcontent-%COMP%]{background-color:#191b21!important;border:1px solid #2A2D38!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;width:100%;outline:none;transition:border-color .15s}.ch-input[_ngcontent-%COMP%]::placeholder{color:#555868}.ch-input[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important;box-shadow:0 0 0 3px #3a7bfd26!important}.ch-input[readonly][_ngcontent-%COMP%]{opacity:.7;cursor:default}.ch-select[_ngcontent-%COMP%]{background-color:#191b21!important;border:1px solid #2A2D38!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;width:100%;height:44px;outline:none;appearance:auto}.ch-select[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}.ch-select[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important;outline:none}.ch-modal-footer[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:12px;padding-top:8px}.ch-modal-footer--center[_ngcontent-%COMP%]{justify-content:center;margin-top:16px}.ch-btn[_ngcontent-%COMP%]{border-radius:9999px;font-size:14px;font-weight:500;padding:9px 22px;
1cursor:pointer;border:1px solid transparent;transition:background .15s,border-color .15s,opacity .15s}.ch-btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ch-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border-color:#3a7bfd;color:#fff}.ch-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1260fd}.ch-btn-outline[_ngcontent-%COMP%]{background:transparent;border-color:#3a7bfd;color:#3a7bfd}.ch-btn-outline[_ngcontent-%COMP%]:hover:not(:disabled){background:#3a7bfd1a}.disabled-tab[_ngcontent-%COMP%]{opacity:.6;cursor:not-allowed}.pointer-events-none[_ngcontent-%COMP%]{pointer-events:none}.ch-select-mobile[_ngcontent-%COMP%]{display:none}.ch-select-desktop[_ngcontent-%COMP%]{display:block}@media (max-width: 640px){[_nghost-%COMP%]     .modal-dialog{margin:12px!important;max-width:calc(100vw - 24px)!important;width:calc(100vw - 24px)!important}[_nghost-%COMP%]     .modal-content{overflow:visible!important}.ch-modal[_ngcontent-%COMP%]{overflow:visible!important}.ch-modal-header[_ngcontent-%COMP%]{border-radius:14px 14px 0 0}.ch-modal-body[_ngcontent-%COMP%]{padding:16px!important;overflow:visible!important}.ch-select-desktop[_ngcontent-%COMP%]{display:none!important}.ch-select-mobile[_ngcontent-%COMP%]{display:block}.ch-input[_ngcontent-%COMP%]{font-size:13px!important}.ch-modal-footer[_ngcontent-%COMP%]{gap:10px}.ch-btn[_ngcontent-%COMP%]{font-size:13px!important;padding:8px 16px!important;flex:1 1 0;max-width:160px}.ch-modal-title[_ngcontent-%COMP%]{font-size:14px!important}.ch-custom-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1060}.ch-custom-select[_ngcontent-%COMP%]{position:relative;background-color:#191b21;border:1px solid #2A2D38;border-radius:8px;cursor:pointer;-webkit-user-select:none;user-select:none;z-index:1061}.ch-custom-select.ch-custom-open[_ngcontent-%COMP%]{border-color:#3a7bfd;box-shadow:0 0 0 3px #3a7bfd26}.ch-custom-display[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;font-size:13px;color:#fff}.ch-custom-display[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.ch-custom-arrow[_ngcontent-%COMP%]{font-size:10px;color:#9ca3af;margin-left:8px;flex-shrink:0;transition:transform .2s}.ch-custom-open[_ngcontent-%COMP%]   .ch-custom-arrow[_ngcontent-%COMP%]{transform:rotate(180deg)}.ch-custom-options[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 4px);left:0;right:0;background:#16181f;border:1px solid #2A2D38;border-radius:8px;z-index:1062;max-height:180px;overflow-y:auto;box-shadow:0 8px 24px #00000080}.ch-custom-option[_ngcontent-%COMP%]{padding:11px 14px;font-size:13px;color:#e0e0e0;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom:1px solid rgba(255,255,255,.05)}.ch-custom-option[_ngcontent-%COMP%]:last-child{border-bottom:none}.ch-custom-option[_ngcontent-%COMP%]:hover, .ch-custom-option.ch-option-selected[_ngcontent-%COMP%]{background:#3a7bfd26;color:#fff}}.radio-item[_ngcontent-%COMP%]{display:inline-block;position:relative;padding:0 6px;margin:10px 0 0}.radio-item[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]{display:none}.radio-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{color:#000;font-weight:600}.radio-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]:before{content:" ";display:inline-block;position:relative;top:5px;margin:0 5px 0 0;width:20px;height:20px;border-radius:11px;border:2px solid var(--secondaryColor);background-color:transparent}.radio-item[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{border-radius:11px;width:12px;height:12px;position:absolute;top:9px;left:10px;content:" ";display:block;background:var(--secondaryColor)}']})}return o})();var I=h(4902),R=h(2262);const Tt=["publishsurveyModel"],Nt=["questioncoutzeroModel"],Dt=["restrictMediaModel"],y=o=>({"submit-clicked":o}),w=o=>({"is-invalid":o}),Gt=o=>({selected:o}),At=(o,s,t)=>({totalItems:o,itemsPerPage:s,currentPage:t});function Vt(o,s){1&o&&(e.j41(0,"div",49)(1,"button",50),e.EFF(2,"Back"),e.k0s()())}function Lt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",51)(1,"i",52),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.refreshButton())}),e.k0s(),e.j41(2,"button",53),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.createLink())}),e.EFF(3,"CREATE NEW CAMPAIGN"),e.k0s()()}}function $t(o,s){if(1&o&&(e.j41(0,"div",46),e.DNE(1,Vt,3,0,"div",47)(2,Lt,4,0,"div",48),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",!t.isCreateCampaign),e.R7$(),e.Y8G("ngIf",!t.isCreateCampaign)}}function Bt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",57)(1,"button",53),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.createLink())}),e.EFF(2,"CREATE NEW CAMPAIGN"),e.k0s()()}}function Xt(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",46)(1,"div",54)(2,"button",55),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.backbutton())}),e.EFF(3,"Back"),e.k0s()(),e.DNE(4,Bt,3,0,"div",56),e.k0s()}if(2&o){const t=e.XpG(2);e.R7$(4),e.Y8G("ngIf",!t.isCreateCampaign)}}function zt(o,s){if(1&o&&e.nrm(0,"div",63),2&o){const t=e.XpG(3);e.Y8G("ngClass",e.eq3(1,y,t.submitClicked2))}}function Yt(o,s){if(1&o&&(e.j41(0,"div",60)(1,"div",67)(2,"h3",62),e.
1EFF(3,"Xoxoday rewards"),e.k0s()()()),2&o){const t=e.XpG(3);e.Y8G("ngClass",e.eq3(1,y,t.submitClicked3))}}function qt(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Campaign name is required. "),e.k0s())}function Ut(o,s){if(1&o&&(e.j41(0,"div",100),e.DNE(1,qt,2,0,"div",70),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.campaignName.errors.required)}}function Jt(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Subject line is required. "),e.k0s())}function Wt(o,s){if(1&o&&(e.j41(0,"div",100),e.DNE(1,Jt,2,0,"div",70),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.subject.errors.required)}}function Ht(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"pre-header text is required."),e.k0s())}function Kt(o,s){if(1&o&&(e.j41(0,"div",100),e.DNE(1,Ht,2,0,"div",70),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.preHeader.errors.required)}}function Qt(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"From name is required."),e.k0s())}function Zt(o,s){if(1&o&&(e.j41(0,"div",100),e.DNE(1,Qt,2,0,"div",70),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.fromName.errors.required)}}function en(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Email is required"),e.k0s())}function tn(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Email is invalid"),e.k0s())}function nn(o,s){if(1&o&&(e.j41(0,"div",100),e.DNE(1,en,2,0,"div",70)(2,tn,2,0,"div",70),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.replyTo.errors.required),e.R7$(),e.Y8G("ngIf",t.f1.replyTo.errors.pattern)}}function on(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",71)(1,"form",72),e.bIt("ngSubmit",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.onSubmit())}),e.j41(2,"div",73)(3,"div",74)(4,"h5",75),e.EFF(5,"Add Details"),e.k0s()(),e.nrm(6,"span",76),e.j41(7,"div",77)(8,"div",78)(9,"div",79)(10,"label")(11,"strong"),e.EFF(12,"Campaign Name"),e.k0s(),e.j41(13,"span",80),e.EFF(14,"*"),e.k0s()(),e.j41(15,"input",81),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.CommonService.onPaste(n))}),e.k0s(),e.DNE(16,Ut,2,1,"div",82),e.k0s(),e.j41(17,"div",79)(18,"label")(19,"strong"),e.EFF(20,"Subject Line"),e.k0s(),e.j41(21,"span",80),e.EFF(22,"*"),e.k0s()(),e.j41(23,"input",83,5),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.CommonService.onPaste(n))})("input",function(){e.eBV(t);const n=e.sdS(24),a=e.XpG(3);return e.Njj(a.getValuesubject(n.value))}),e.k0s(),e.DNE(25,Wt,2,1,"div",82),e.k0s(),e.j41(26,"div",79)(27,"label")(28,"strong"),e.EFF(29,"Pre-header Text"),e.k0s(),e.j41(30,"span",80),e.EFF(31,"*"),e.k0s()(),e.j41(32,"input",84,6),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.CommonService.onPaste(n))})("input",function(){e.eBV(t);const n=e.sdS(33),a=e.XpG(3);return e.Njj(a.getValuePreheader(n.value))}),e.k0s(),e.DNE(34,Kt,2,1,"div",82),e.k0s(),e.j41(35,"div",79)(36,"label")(37,"strong"),e.EFF(38,"From Name"),e.k0s(),e.j41(39,"span",80),e.EFF(40,"*"),e.k0s()(),e.j41(41,"input",85,7),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.CommonService.onPaste(n))})("input",function(){e.eBV(t);const n=e.sdS(42),a=e.XpG(3);return e.Njj(a.getValue(n.value))}),e.k0s(),e.DNE(43,Zt,2,1,"div",82),e.k0s(),e.j41(44,"div",79)(45,"label")(46,"strong"),e.EFF(47,"Reply To Email"),e.k0s(),e.j41(48,"span",80),e.EFF(49,"*"),e.k0s()(),e.j41(50,"input",86),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.CommonService.onPaste(n))}),e.k0s(),e.DNE(51,nn,3,2,"div",82),e.k0s()(),e.j41(52,"div",87)(53,"div",88)(54,"div",89)(55,"div",90)(56,"strong"),e.EFF(57),e.k0s()(),e.j41(58,"div",91)(59,"div",92)(60,"h4",93)(61,"strong"),e.EFF(62),e.k0s()(),e.j41(63,"h4",94),e.EFF(64),e.k0s(),e.j41(65,"h4",93),e.EFF(66),e.k0s()()()()()()()(),e.j41(67,"div",95)(68,"div",96)(69,"button",97),e.EFF(70,"NEXT"),e.k0s()(),e.j41(71,"div",98)(72,"button",99),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.gotoCampaign())}),e.EFF(73,"CANCEL"),e.k0s()()()()()}if(2&o){const t=e.XpG(3);e.R7$(),e.Y8G("formGroup",t.form2),e.R7$(14),e.Y8G("ngClass",e.eq3(16,w,t.submitted&&t.f1.campaignName.errors&&t.f1.campaignName.touched)),e.R7$(),e.Y8G("ngIf",t.submitted&&t.f1.campaignName.errors&&t.f1.campaignName.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(18,w,t.submitted&&t.f1.subject.errors&&t.f1.subject.touched)),e.R7$(2),e.Y8G("ngIf",t.submitted&&t.f1.subject.errors&&t.f1.subject.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(20,w,t.submitted&&t.f1.preHeader.errors&&t.f1.preHeader.touched)),e.R7$(2),e.Y8G("ngIf",t.submitted&&t.f1.preHeader.errors&&t.f1.preHeader.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(22,w,t.submitted&&t.f1.fromName.errors&&t.f1.fromName.touched)),e.R7$(2),e.Y8G("ngIf",t.submitted&&t.f1.fromName.errors&&t.f1.fromName.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(24,w,(t.f1.replyTo.touched||t.submitted)&&t.f1.replyTo.invalid)),e.R7$(),e.Y8G("ngIf",t.form2.controls.replyTo.invalid&&t.form2.controls.replyTo.touched),e.R7$(6),e.JRh(null==(t.displayVal||t.defaultName)?null:(t.displayVal||t.defaultName).charAt(0).toUpperCase()),e.R7$(5),e.JRh(t.displayVal||t.defaultName),e.R7$(2),e.JRh(t.displayValsub||t.defaultSubName),e.R7$(2),e.JRh(t.displayValpre||t.defaultPre),e.R7$(3),e.Y8G("disabled",t.form2.invalid)}}function an(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",110)(1,"div",111),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG(4);return e.Njj(a.chosenTemplate(n))}),e.j41(2,"div",112)(3,"div",113),e.nrm(4,"img",114),e.k0s(),e.j41(5,"div",115)(6,"h6",116),e.EFF(7),e.k0s()()()()()}if(2&o){const t=s.$implicit,i=e.XpG(4);e.R7$(),e.Y8G("ngClass",e.eq3(3,Gt,t===i.templateData)),e.R7$(3),e.Y8G("src",t.thumbnail_url,e.B4B),e.R7$(3),e.JRh(t.name)}}function sn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",71)(1,"div",73)(2,"div",74)(3,"h5",75),e.EFF(4,"Select Template"),e.k0s()(),e.nrm(5,"span",76),e.j41(6,"div",101),e.DNE(7,an,8,5,"div",102),e.j41(8,"div",103)(9,"div",104),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(!n.isRequestCreated&&n.requestMoreTemplates())}),e.j41(10,"div",105)(11,"h1",106),e.EFF(12,"+"),e.k0s()(),e.j41(13,"div",107)(14,"h6",108),e.EFF(15),e.k0s()()()()()(),e.j41(16,"div",95)(17,"div",96)(18,"button",109),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.selectTemplate())}),e.EFF(19,"NEXT"),e.k0s()(),e.j41(20,"div",98)(21,"button",99),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.backtocreate())}),e.EFF(22,"BACK"),e.k0s()()()()}if(2&o){const t=e.XpG(3);e.R7$(7),e.Y8G("ngForOf",t.templateList),e.R7$(),e.AVh("disabled",t.isRequestCreated),e.R7$(7),e.JRh(t.isRequestCreated?"Request is pending...":"Request for new templates"),e.R7$(3),e.Y8G("disabled",!t.selectedTemplate)}}function rn(o,s){if(1&o&&(e.j41(0,"option",124),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG(5);e.FS9("value",t.campaignId),e.Y8G("selected",i.selectedCampaign==t.campaignId),e.R7$(),e.SpI(" ",t.campaignName,"")}}function ln(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",125)(1,"label",119)(2,"strong"),e.EFF(3,"Number Of Rewards "),e.k0s(),e.j41(4,"span",80),e.EFF(5,"*"),e.k0s()(),e.j41(6,"input",126),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(5);return a.reward=n.target.value,e.Njj(a.onRewardInput(n.target.value))}),e.k0s()()}if(2&o){const t=e.XpG(5);e.R7$(6),e.FS9("value",t.reward)}}function cn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",125)(1,"label",119)(2,"strong"),e.EFF(3,"Rewards Expiry Date "),e.k0s(),e.j41(4,"span",80),e.EFF(5,"*"),e.k0s()(),e.j41(6,"input",127),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(5);return a.expiryDate=n.target.value,e.Njj(a.onExpiryInput(n.target.value))}),e.k0s()()}if(2&o){const t=e.XpG(5);e.R7$(6),e.FS9("value",t.expiryDate),e.Y8G("min",t.minDate)}}function dn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",71)(1,"div",73)(2,"div",74)(3,"h5",75),e.EFF(4,"Xoxoday Rewards Details"),e.k0s()(),e.nrm(5,"span",76),e.j41(6,"form")(7,"div",77)(8,"div",117)(9,"div",118)(10,"label",119)(11,"strong"),e.EFF(12,"Select Xoxoday Rewards Campaign (Optional)"),e.k0s()(),e.j41(13,"select",120),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(4);return a.xoxodayCampaignId=n.target.value,e.Njj(a.onCampaignSelected(n.target.value))}),e.j41(14,"option",121),e.EFF(15),e.k0s(),e.DNE(16,rn,2,3,"option",122),e.k0s()(),e.DNE(17,ln,7,1,"div",123)(18,cn,7,2,"div",123),e.k0s()()()(),e.j41(19,"div",95)(20,"div",96)(21,"button",109),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(n.xoxoDetails())}),e.EFF(22,"NEXT"),e.k0s()(),e.j41(23,"div",98)(24,"button",99),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(n.goToTemplate())}),e.EFF(25,"BACK"),e.k0s()()()()}if(2&o){const t=e.XpG(4);e.R7$(14),e.Y8G("selected",""==t.selectedCampaign),e.R7$(),e.JRh(""==t.xoxodayCampaignId?"Select Campaign Name":"Unselect 
1Campaign Name"),e.R7$(),e.Y8G("ngForOf",t.compaignlist),e.R7$(),e.Y8G("ngIf",t.selectedCampaign),e.R7$(),e.Y8G("ngIf",t.selectedCampaign),e.R7$(3),e.Y8G("disabled",!(t.xoxodayCampaignId&&t.reward&&t.expiryDate)&&t.xoxodayCampaignId)}}function pn(o,s){if(1&o&&(e.j41(0,"div"),e.DNE(1,dn,26,6,"div",69),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Y8G("ngIf",t.isxoxoDay&&!t.isUploadEmails&&!t.isSelectTemplate)}}function un(o,s){if(1&o&&(e.j41(0,"option",146),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.FS9("value",t),e.R7$(),e.JRh(t)}}function mn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",142)(1,"label",143),e.EFF(2,"Select Survey Language"),e.j41(3,"span",80),e.EFF(4,"*"),e.k0s()(),e.j41(5,"select",144),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(4);return e.Njj(a.surveyLanguage=n.target.value)}),e.DNE(6,un,2,2,"option",145),e.k0s()()}if(2&o){const t=e.XpG(4);e.R7$(6),e.Y8G("ngForOf",null==t.surveyDetails?null:t.surveyDetails.languages)}}function gn(o,s){1&o&&e.nrm(0,"span",147)}function hn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",58),e.DNE(1,mn,7,1,"div",128),e.j41(2,"div",129)(3,"div",130)(4,"label",131),e.EFF(5,"Upload Email Id"),e.j41(6,"span",80),e.EFF(7,"*"),e.k0s()()(),e.j41(8,"div",132)(9,"a",133),e.EFF(10,"Download Sample File"),e.k0s()()(),e.j41(11,"div",134)(12,"div",135)(13,"div",136)(14,"input",137),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.handleFileSelect(n))}),e.k0s()()()(),e.j41(15,"div",138)(16,"button",139),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.gotoxoxoday())}),e.EFF(17,"BACK"),e.k0s(),e.j41(18,"button",140),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.uploadDoc())}),e.DNE(19,gn,1,0,"span",141),e.EFF(20," UPLOAD & SEND"),e.k0s()()()}if(2&o){const t=e.XpG(3);e.R7$(),e.Y8G("ngIf",t.isUploadEmails&&!t.isSelectTemplate&&!t.isxoxoDay),e.R7$(17),e.Y8G("disabled",t.disbaledFlag||t.isFileUploaded),e.R7$(),e.Y8G("ngIf",t.isFileUploaded)}}function fn(o,s){if(1&o&&(e.j41(0,"div",58)(1,"div",59)(2,"div",60)(3,"div",61)(4,"h3",62),e.EFF(5,"Add details"),e.k0s()()(),e.nrm(6,"div",63),e.j41(7,"div",60)(8,"div",64)(9,"h3",62),e.EFF(10,"Select Template"),e.k0s()()(),e.DNE(11,zt,1,3,"div",65)(12,Yt,4,3,"div",66),e.nrm(13,"div",63),e.j41(14,"div",60)(15,"div",67)(16,"h3",62),e.EFF(17,"Upload Email"),e.k0s()()(),e.nrm(18,"div",63),e.j41(19,"div",60)(20,"div",68)(21,"h3",62),e.EFF(22,"Send"),e.k0s()()()(),e.DNE(23,on,74,26,"div",69)(24,sn,23,5,"div",69)(25,pn,2,1,"div",70)(26,hn,21,3,"div",44),e.k0s()),2&o){const t=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(13,y,t.submitClicked)),e.R7$(4),e.Y8G("ngClass",e.eq3(15,y,t.submitClicked)),e.R7$(),e.Y8G("ngClass",e.eq3(17,y,t.submitClicked2)),e.R7$(4),e.Y8G("ngIf",0!=t.isXoxodayEnabled),e.R7$(),e.Y8G("ngIf",0!=t.isXoxodayEnabled),e.R7$(),e.Y8G("ngClass",e.eq3(19,y,t.submitClicked3)),e.R7$(),e.Y8G("ngClass",e.eq3(21,y,t.submitClicked4)),e.R7$(4),e.Y8G("ngClass",e.eq3(23,y,t.submitClicked4)),e.R7$(),e.Y8G("ngClass",e.eq3(25,y,t.submitClicked5
1)),e.R7$(4),e.Y8G("ngIf",!t.isUploadEmails&&!t.isSelectTemplate&&!t.isxoxoDay),e.R7$(),e.Y8G("ngIf",t.isSelectTemplate&&!t.isUploadEmails&&!t.isxoxoDay),e.R7$(),e.Y8G("ngIf",0!=t.isXoxodayEnabled),e.R7$(),e.Y8G("ngIf",t.isUploadEmails&&!t.isSelectTemplate&&!t.isxoxoDay)}}function _n(o,s){if(1&o&&(e.j41(0,"tr",160)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s(),e.j41(7,"td"),e.EFF(8),e.k0s(),e.j41(9,"td"),e.EFF(10),e.k0s(),e.j41(11,"td"),e.EFF(12),e.k0s(),e.j41(13,"td"),e.EFF(14),e.k0s(),e.j41(15,"td"),e.EFF(16),e.k0s(),e.j41(17,"td"),e.EFF(18),e.k0s()()),2&o){const t=s.$implicit;e.R7$(2),e.JRh(null==t?null:t.campaignName),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.sent)?t.status.sent:0),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.delivered)?t.status.delivered:0),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.opens)?t.status.opens:0),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.clicks)?t.status.clicks:0),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.submission)?t.status.submission:0),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.unsubscribed)?t.status.unsubscribed:0),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.bounced)?t.status.bounced:0),e.R7$(2),e.JRh(null!=(null==t||null==t.status?null:t.status.blocked)?t.status.blocked:0)}}function bn(o,s){if(1&o&&(e.j41(0,"option",161),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.Y8G("ngValue",t),e.R7$(),e.SpI(" ",t," ")}}function vn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",150)(1,"div",151)(2,"table",152)(3,"thead")(4,"tr")(5,"th",153),e.EFF(6,"Campaign Name"),e.k0s(),e.j41(7,"th",153),e.EFF(8,"Sent"),e.k0s(),e.j41(9,"th",153),e.EFF(10,"Delivered"),e.k0s(),e.j41(11,"th",153),e.EFF(12,"Opens"),e.k0s(),e.j41(13,"th",153),e.EFF(14,"Clicks"),e.k0s(),e.j41(15,"th",153),e.EFF(16,"Submissions"),e.k0s(),e.j41(17,"th",153),e.EFF(18,"Unsubscribes"),e.k0s(),e.j41(19,"th",153),e.EFF(20,"Bounces"),e.k0s(),e.j41(21,"th",153),e.EFF(22,"Blocked"),e.k0s()()(),e.j41(23,"tbody"),e.DNE(24,_n,19,9,"tr",154),e.nI1(25,"paginate"),e.k0s()()(),e.j41(26,"div",155)(27,"pagination-controls",156),e.bIt("pageChange",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.handlePageChange(n))}),e.k0s()(),e.j41(28,"div",157)(29,"select",158),e.mxI("ngModelChange",function(n){e.eBV(t);const a=e.XpG(3);return e.DH7(a.pageSize,n)||(a.pageSize=n),e.Njj(n)}),e.bIt("change",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.handlePageSizeChange())}),e.DNE(30,bn,2,2,"option",159),e.k0s()()()}if(2&o){const t=e.XpG(3);e.R7$(24),e.Y8G("ngForOf",e.i5U(25,3,t.campaignList,e.sMw(6,At,t.count,t.pageSize,t.page))),e.R7$(5),e.R50("ngModel",t.pageSize),e.R7$(),e.Y8G("ngForOf",t.pageSizes)}}function xn(o,s){if(1&o&&(e.j41(0,"div",148),e.DNE(1,vn,31,10,"div",149),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.campaignList.length>0)}}function kn(o,s){if(1&o&&(e.j41(0,"section",41)(1,"div",42),e.DNE(2,$t,3,2,"div",43)(3,Xt,5,1,"div",43),e.k0s(),e.DNE(4,fn,27,27,"div",44)(5,xn,2,1,"div",45),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.Y8G("ngIf",t.campaignList&&0!=t.campaignList.length),e.R7$(),e.Y8G("ngIf",t.campaignList&&0==t.campaignList.length),e.R7$(),e.Y8G("ngIf",t.isCreateCampaign),e.R7$(),e.Y8G("ngIf",!t.isCreateCampaign)}}function yn(o,s){1&o&&(e.j41(0,"section",162)(1,"div",163)(2,"div",164)(3,"div",165)(4,"span",166),e.EFF(5,"Loading..."),e.k0s()(),e.j41(6,"strong"),e.EFF(7,"Loading..."),e.k0s()()()())}function Cn(o,s){if(1&o&&(e.j41(0,"div",167)(1,"h5",168),e.EFF(2),e.j41(3,"span",169),e.EFF(4),e.k0s()()()),2&o){const t=s.$implicit;e.R7$(2),e.SpI("",null==t?null:t.questionRefernceNo,"."),e.R7$(2),e.JRh(null==t?null:t.text)}}let Fn=(()=>{class o{constructor(t,i,n,a,l,c){this.formBuilder=t,this.surveyService=i,this.toastrService=n,this.papa=a,this.router=l,this.CommonService=c,this.submitted=!1,this.pageSizes=[5,10,15,50,100],this.currentPage=0,this.page=0,this.count=0,this.pageSize=5,this.userData=JSON.parse(localStorage.getItem("currentUser")),this.test=[],this.campaignList=[],this.templateList=[],this.isCreateCampaign=!1,this.isUploadEmail
1=!1,this.disbaledFlag=!0,this.isUploadEmails=!1,this.showHelloSection=!1,this.displayVal="",this.displayValsub="",this.displayValpre="",this.defaultName="From Name",this.defaultSubName="Your subject line comes here",this.defaultPre="Your preheader comes here",this.submitClicked=!1,this.submitClicked2=!1,this.submitClicked3=!1,this.submitClicked4=!1,this.submitClicked5=!1,this.isSelectTemplate=!1,this.isxoxoDay=!1,this.surveyDetails={},this.campaignDetails={},this.isLoading=!0,this.showCreateCampBtn=!1,this.xoxodayCampaignId="",this.surveyLanguage="English",this.form=new r.gE({campaignname:new r.MJ(""),subjectname:new r.MJ(""),mailbody:new r.MJ("")}),this.questionsArr=[],this.isCampignSubmitting=!1,this.isFileUploaded=!1,this.isRequestCreated=!1;let m=new Date;m=new Date(m.getTime()+864e5),this.minDate=m.toISOString().split("T")[0]}ngOnInit(){this.getAllTemplates(),this.pageSize=this.pageSizes[0],this.campaignDetails={},this.form2=this.formBuilder.group({campaignName:["",r.k0.required],subject:["",r.k0.required],preHeader:["",r.k0.required],fromName:["",r.k0.required],replyTo:["",[r.k0.required,r.k0.email,j.h.validEmail]]}),this.form=this.formBuilder.group({replyTo:["",[r.k0.required,r.k0.email,j.h.validEmail]]}),this.getSurveyDetails(),this.getAllCampaignList()}getValue(t){this.displayVal=t}getValuesubject(t){this.displayValsub=t}getValuePreheader(t){this.displayValpre=t}get f(){return this.form.controls}get f1(){return this.form2.controls}onSubmit(){1==this.isXoxodayEnabled?(this.submitClicked2=!0,this.submitted=!0):(this.submitClicked2=!0,this.submitClicked3=!0),!this.form2.invalid&&(this.campaignDetails={campaignName:this.form2.controls.campaignName.value,subject:this.form2.controls.subject.value,preHeader:this.form2.controls.preHeader.value,fromName:this.form2.controls.fromName.value,replyTo:this.form2.controls.replyTo.value},this.checkCampName(),this.checkRequestCreated())}resetForms(){this.form2.patchValue({campaignName:"",subject:"",preHeader:"",fromName:"",replyTo:""})}getAllCampaignList(){this.isLoading=!0,this.surveyService.getAllCampaignList(localStorage.getItem("surveyId"),this.currentPage,this.pageSize).subscribe(t=>{this.campaignList=t.data,this.count=t.count,this.isLoading=!1},t=>{console.log(t),this.isLoading=!1})}checkCampRecords(){this.surveyService.checkCampNameUnique(localStorage.getItem("surveyId"),this.campaignDetails.campaignName).subscribe(t=>{this.getAllTemplates(),this.isSelectTemplate=!0},t=>{this.toastrService.error(t)})}goToTemplate(){this.isSelectTemplate=!0,1==this.isXoxodayEnabled?(this.submitClicked3=!1,this.isxoxoDay=!1):this.submitClicked=!1,this.disbaledFlag=!0}gotoxoxoday(){this.isUploadEmails=!1,1==this.isXoxodayEnabled?(this.isxoxoDay=!0,this.xoxodayCampaignId=this.savexoxoDaydataDetail
1s.xoxodayCampaignId):this.isSelectTemplate=!0,this.submitClicked4=!1,this.disbaledFlag=!0}gotoemailpage(){}createLink(){if(!this.surveyDetails||!this.surveyDetails.status)return console.warn("Survey details are not available yet. Retrying in 500ms..."),void setTimeout(()=>this.createLink(),500);console.log("Survey Status:",this.surveyDetails.status),0===this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.checkMediaQuestions()?this.restrictMediaModel.nativeElement.click():"DRAFT"===this.surveyDetails.status?this.publishsurveyModel.nativeElement.click():this.gotoCampaign()}checkMediaQuestions(){this.questionsArr=[];var t=!1;return this.surveyDetails.sections?.map(i=>{i?.questions?.map(n=>{"Image/Video"==n.type&&("Image"==n.mediaType||"Video"==n.mediaType||"Audio"==n.mediaType||"Pdf"==n.mediaType)&&(t=!0,this.questionsArr.push(n))})}),t}publishContinue(){"DRAFT"===this.surveyDetails.status?this.publishsurveyModel.nativeElement.click():this.gotoCampaign()}backbutton(){this.isCreateCampaign?this.gotoCampaign():this.router.navigateByUrl("/survey/deploy-survey/deployments")}gotoCampaign(){this.submitClicked=!0,this.submitClicked2=!1,this.submitClicked3=!1,this.submitClicked4=!1,this.submitClicked5=!1,this.displayVal="",this.displayValpre="",this.displayValsub="",this.selectedTemplate="",this.submitted=!1,this.disbaledFlag=!0,this.resetForms(),this.isUploadEmails=!1,this.isSelectTemplate=!1,this.isCreateCampaign=!this.isCreateCampaign,this.getAllCampaignList()}backtocreate(){this.isUploadEmail=!1,this.isSelectTemplate=!1,this.selectedTemplate=!1,this.isCreateCampaign=this.isCreateCampaign,1==this.isXoxodayEnabled?this.submitClicked2=!1:this.submitClicked3=!1}gotoUploadEmail(){this.isUploadEmails=!this.isUploadEmails,this.resetForms()}resetForm(){this.form.patchValue({campaignName:"",mailSubject:"",mailBody:""})}handleFileSelect(t){this.disbaledFlag=!0,this.test=[];var n=t.target.files[0],a=new FileReader;a.readAsText(n),a.onload=l=>{this.papa.parse(l.target.result,{skipEmptyLines:!0,header:!0,complete:m=>{for(let d=0;d<m.data.length;d++)this.test.push({email:m.data[d].Email,firstName:m.data[d]["First Name"],lastName:m.data[d]["Last Name"]}),this.disbaledFlag=!1}})}}checkCampName(){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.campaignDetails.campaignName).subscribe(t=>{this.getAllTemplates(),this.isSelectTemplate=!0,console.log(t)},t=>{this.toastrService.error(t)})}uploadDoc(){this.submitClicked5=!0,this.isFileUploaded=!0;let t={campaignName:this.campaignDetails.campaignName,subject:this.campaignDetails.subject,preHeader:this.campaignDetails.preHeader,fromName:this.campaignDetails.fromName,replyTo:this.campaignDetails.replyTo,emails:this.test,surveyId:localStorage.getItem("surveyId"),mmApiKey:this.templateData.mmApiKey,formId:this.templateData.formId,templateName:this.selectedTemplate,templateId:this.templateData.id,triggerURL:localStorage.getItem("triggerURL"),xoxodayCampaignId:null,xoxodayLink_expiry:null,isXoxodayEnabled:null,xoxodayNoOfRewards:null,surveyLanguage:this.surveyLanguage};0==this.isXoxodayEnabled?(t.xoxodayCampaignId="",t.xoxodayLink_expiry="",t.xoxodayNoOfRewards=""):(t.xoxodayCampaignId=this.savexoxoDaydataDetail
1s.xoxodayCampaignId,t.xoxodayLink_expiry=this.savexoxoDaydataDetails.xoxodayLink_expiry,t.isXoxodayEnabled=this.savexoxoDaydataDetails.isXoxodayEnabled,t.xoxodayNoOfRewards=this.savexoxoDaydataDetails.xoxodayNoOfRewards),this.isCampignSubmitting=!0,this.surveyService.saveCampaignDetails(t).subscribe(i=>{this.toastrService.success(i?.message?i?.message:"Recipient Files uploaded sucessfully."),this.isFileUploaded=!1,this.gotoCampaign(),this.selectedCampaign="",this.reward="",this.expiryDate="",this.xoxodayCampaignId="",this.isCampignSubmitting=!1},i=>{this.isFileUploaded=!1,this.toastrService.error("Error: "+i),this.isCampignSubmitting=!1})}handlePageChange(t){1===t?(this.page=t,this.currentPage=t-1):t>1&&(this.page=t,this.currentPage=this.pageSize*(t-1)),this.getAllCampaignList()}handlePageSizeChange(){this.pageSize=this.pageSize,this.page=1,this.currentPage=0,this.getAllCampaignList()}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t,this.isXoxodayEnabled=t.isXoxodayEnabled,1==this.isXoxodayEnabled&&this.getxoxodayCampginList()})}getAllTemplates(){this.surveyService.getAmpTemplates(this.userData.userId).subscribe(t=>{this.templateList=t},t=>{console.log(t)})}chosenTemplate(t){this.templateData===t?(this.templateData=null,this.selectedTemplate=null):(this.templateData=t,this.selectedTemplate=this.templateData.name)}selectTemplate(){this.isSelectTemplate=!this.isSelectTemplate,1==this.isXoxodayEnabled?(this.isxoxoDay=!0,this.submitClicked3=!0):(this.isUploadEmails=!0,this.submitClicked4=!0,this.submitClicked3=!0)}updateStatus(t){if(t){let i={id:localStorage.getItem("surveyId"),is_published:!0};this.surveyService.updateSurveyStatus(i).subscribe(n=>{this.toastrService.success("Survey Published sucessfully."),this.getSurveyDetails(),this.gotoCampaign()},n=>{console.error(n)})}}refreshButton(){this.ngOnInit()}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}getxoxodayCampginList(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.getxoxodayCampginList(t.userId).subscribe(i=>{this.compaignlist=i.data&&i.data.campaignList&&i.data.campaignList.data?i.data.campaignList.data:[]},i=>{console.log(i)})}formatDate(t){const i=new Date(t),n=i.getDate(),a=i.getMonth()+1,l=i.getFullYear();return`${n.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}-${l}`}xoxoDetails(){this.submitClicked4=!0,this.isUploadEmails=!0;let t={xoxodayCampaignId:this.xoxodayCampaignId,xoxodayNoOfRewards:this.reward,isXoxodayEnabled:!0,xoxodayLink_expiry:this.formatDate(this.expiryDate),surveyId:this.surveyID};
1this.savexoxoDaydataDetails=t,this.isxoxoDay=!this.isxoxoDay}onCampaignSelected(t){this.selectedCampaign=t,""===t?(this.selectedCampaign="",this.reward=null,this.expiryDate=null):this.selectedCampaign=t}onRewardInput(t){this.reward=parseInt(t)||null}onExpiryInput(t){this.expiryDate=t}backtoselecttemplate(){this.isUploadEmail=!1,this.isSelectTemplate=!0,this.isCreateCampaign=!1,this.submitClicked2=!1,this.isxoxoDay=!1}requestMoreTemplates(){let i={userId:JSON.parse(localStorage.getItem("currentUser")).userId,isActive:!0};this.surveyService.requestNewTemplate(i).subscribe(n=>{console.log(n),this.toastrService.success("Request has been sent successfully!"),this.checkRequestCreated()},n=>{this.toastrService.error(n)})}checkRequestCreated(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.checkRequestCreated(t.userId).subscribe(i=>{this.isRequestCreated=null!==i},i=>{console.log(i),this.isRequestCreated=!1})}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(r.ok),e.rXU(b.I),e.rXU(x.tw),e.rXU(I.F),e.rXU(g.Ix),e.rXU(j.h))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-email"]],viewQuery:function(i,n){if(1&i&&(e.GBs(Tt,7),e.GBs(Nt,7),e.GBs(Dt,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first),e.mGM(a=e.lsd())&&(n.restrictMediaModel=a.first)}},decls:65,vars:4,consts:[["discardChangesModal",""],["closeModal",""],["publishsurveyModel",""],["questioncoutzeroModel",""],["restrictMediaModel",""],["box2",""],["box3",""],["box",""],["style","padding: 0px;",4,"ngIf"],["type","button","data-bs-toggle","modal","data-bs-target","#discardChangesModal",1,"btn","btn-primary","d-none"],["id","discardChangesModal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-labelledby","discardChangesModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-lg"],[1,"modal-content","bg-white"],[1,"modal-body"],[1,"py-4","text-danger","text-center"],[1,"pb-4","text-center"],[1,"col-sm-12","text-center","py-3"],["id","closeModal","data-bs-dismiss","modal",1,"btn","btn-outline-primary","text-uppercase","btn1","ml-1","mr-4"],["id","closeModal","data-bs-dismiss","modal",1,"btn","btn-danger","text-uppercase","ml-4","btn4"],["data-bs-toggle","modal","data-bs-target","#publishSurvy",2,"display","none"],["id","publishSurvy","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content","formWrapper","noBg","bg-white"],[1,"modal-body","d-flex","flex-column","py-4","justify-content-between","align-items-center","py-5"],["className","btn-outline-primary text-uppercase btnClose mr-1","btnLabel","close","data-bs-dismiss","modal",3,"click"],["className","btn-primary text-uppercase ml-2","btnLabel","Publish","data-bs-dismiss","modal",3,"click"],["style","height: 40vh;display: flex;",4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#questioncoutzero",2,"display","none"],["id","questioncoutzero","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"py-4","text-center"],[1,"text-center","pb-4"],["className","btn-outline-primary mr-3","btnLabel","MY DASHBOARD","data-bs-dismiss","modal",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary","text-uppercase",3,"click"],["data-bs-toggle","modal","data-bs-target","#restricMedia",2,"display","none"],["id","restricMedia","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","p-0"],[1,"py-2","text-center"],[1,"text-center",2,"font-size","20px !important","font-weight","500"],["class","col-sm-12 px-2",4,"ngFor","ngForOf"],["data-bs-dismiss","modal",1,"btn","btn-outline-primary","mr-4"],["data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"],[2,"padding","0px"],[1,"fisrt","row","px-0"],["class","col-sm-12 mt-3",4,"ngIf"],["class","col-sm-12 px-0",4,"ngIf"],["class","content",4,"ngIf"],[1,"col-sm-12","mt-3"],["class","col-sm-2 mt-3 text-left px-0",4,"ngIf"],["class","col-sm-12 text-right px-0",4,"ngIf"],[1,"col-sm-2","mt-3","text-left","px-0"],["type","button","routerLink","/survey/deploy-survey/deployments",1,"btn","btn-outline-primary"],[1,"col-sm-12","text-right","px-0"],["aria-hidden","true","tooltip","Refresh",1,"fa","fa-refresh","primary-color","pr-3",2,"cursor","pointer",3,"click"],["placement","top",1,"nav-link","btn","btn-primary","newcampaign",3,"click"],[1,"col-sm-2","mt-2","ml-1","text-left","px-0"],["type","button",1,"btn","btn-outline-primary",3,"click"],["class","col-sm-12 text-center px-0","style","padding-top: 130px;",4,"ngIf"],[1,"col-sm-12","text-center","px-0",2,"padding-top","130px"],[1,"col-sm-12","px-0"],[1,"container","d-flex","justify-content-center","row","pb-5"],["id","add-details",1,"circles","text-center","m-2",3,"ngClass"],[1,"row","mt-4",2,"margin-left","-17px"],[1,"f-h3"],["id","add-details",1,"line",3,"ngClass"],[1,"row","mt-4",2,"margin-left","-30px"],["class","line","id","add-details",3,"ngClass",4,"ngIf"],["class","circles text-center m-2","id","add-details",3,"ngClass",4,"ngIf"],[1,"row","mt-4",2,"margin-left","-25px"],[1,"row","mt-4",2,"margin-left","-6px"],["class","",4,"ngIf"],[4,"ngIf"],[1,""],[3,"ngSubmit","formGroup"],[1,"col-sm-12","shadow","p-0","m-p","bg-body","rounded"],[1,"col-sm-12","pt-3","px-4","header","p-0"],[1,"m-0"],[1,"col-sm-12","border","border-grey"],[1,"col-sm-12","row"],[1,"col-sm-6"],[1,"form-group","px-2"],[1,"text-danger"],["type","text","formControlName","campaignName","required","","maxlength","70","placeholder","Campaign - 24-03-2023 - 11:12",1,"form-control",3,"input","ngClass"],["class","invalid-feedback",4,"ngIf"],["type","text","formControlName","subject","maxlength","100","required","","placeholder","Add an intriguing subject line",1,"form-control",3,"input","ngClass"],["type","text","formControlName","preHeader","maxlength","100","required","","s","","placeholder","A preheader comes after the subject line, Use it to explain m..",1,"form-control",3,"input","ngClass"],["type","text","formControlName","fromName","required","","maxlength","30","placeholder","Example: Sumit from Merren",1,"form-control",3,"input","ngClass"],["type","text","formControlName","replyTo","placeholder","Email for users to reply back. Example:[email protected]","required","",1,"form-control",3,"input","ngClass"],[1,"col-sm-6","cardheader"],[1,"align-self-center","card1"],[1,"col-sm-12","row","cardinfom","mx-3"],[1,"col-sm-2","m-0","circlef","text-center"],[1,"col-sm-8"],[1,"col-sm-12","pl-4"],[1,"m-0","details","stitle-ellipsis"],[1,"m-0","details","pt-1","stitle-ellipsis"],[1,"col-sm-12","d-flex","flex-row-reverse","p-0","mt-4"],[1,"form-group","pl-3"],["type","submit","id","submit-btn",1,"btn","btn-primary",3,"disabled"],[1,"pl-3"],["type","submit",1,"btn","btn-outline-primary","pl-3",3,"click"],[1,"invalid-feedback"],[1,"mx-auto","mt-4","d-flex","justify-content-start"],["class","card shadow card-template mb-4 mx-3",4,"ngFor","ngForOf"],[1,"card","shadow","card-template","mb-4","mx-3",2,"cursor","pointer","height","330px"],[1,"card-body","justify-content-center","align-items-center",3,"click"],[1,"d-flex","mb-4",2,"height","208px","width","100%"],[1,"m-auto",2,"font-size","5rem"],[1,"col-sm-12","text-center","p-3"],[1,"card-title","mb-0"],["type","submit","id","submit-btn",1,"btn","btn-primary",3,"click","disabled"],[1,"card","shadow","card-template","mb-4","mx-3"],[1,"clickable-area",3,"click","ngClass"],[1,"card-body","p-0"],[2,"height","250px","width","100%"],["alt","Template Image",1,"card-img-top",3,"src"],[1,"col-sm-12","p-3"],[1,"card-title","text-center","mb-0"],[1,"col-sm-6","py-2"],[1,"col-md-12","text-left","mb-3","px-3"],["for","exampleFormControlSelect1"],["id","exampleFormControlSelect1",1,"form-control",3,"change"],["value","",3,"selected"],[3,"value","selected",4,"ngFor","ngForOf"],["class","form-group text-left col-sm-12",4,"ngIf"],[3,"value","selected"],[1,"form-group","text-left","col-sm-12"],["type","number","id","Title","aria-describedby","Title","placeholder","Rewards","pattern","[0-9]*","onkeypress","return event.charCode >= 48 && event.charCode <= 57",1,"form-control",2,"height","46px",3,"input","value"],["type","date","id","Title","aria-describedby","Title","placeholder","Rewards",1,"form-control",2,"height","46px",3,"input","value","min"],["class","px-0 col-sm-12 mb-3",4,"ngIf"],[1,"col-sm-12","d-flex","py-1","px-0"],[1,"col-sm-4","px-0"],[2,"font-weight","600"],[1,"col-sm-8","text-right","px-0","text-primary"],["href","https://merrenbucket.s3.ap-south-1.amazonaws.com/amp_sample/amp-email_samplefile.csv","target","blank",2,"text-align","right","font-size","1rem"],[1,"col-sm-12","p-3","upload"],[1,"col-sm-12","cover"],[1,"col-sm-12"],["type","file","accept",".csv",2,"font-size","16px",3,"change"],[1,"col-sm-12","text-right","py-5","px-0"],["type","button","placement","top",1,"btn1","btn","btn-outline-primary","mr-2","p-2",3,"click"],["placement","top",1,"btn3","btn","btn-primary","ml-2","p-2",3,"click","disabled"],["class","spinner-grow spinner-grow-sm","role","status","aria-hidden","true",4,"ngIf"],[1,"px-0","col-sm-12","mb-3"],["for","l1",2,"font-weight","600"],["id","l1",1,"form-control",3,"change"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["role","status","aria-hidden","true",1,"spinner-grow","spinner-grow-sm"],[1,"content"],["class","fisrt row px-0 py-3",4,"ngIf"],[1,"fisrt","row","px-0","py-3"],[1,"col-sm-12","d-flex"],[1,"table","table-borderless"],["scope","col"],["class","shadow-md bg-white",4,"ngFor","ngForOf"],[1,"row","col-sm-11","d-flex","justify-content-end","align-items-center","mt-3","content"],["previousLabel","Prev","nextLabel","Next","responsive","true",3,"pageChange"],[1,"col-sm-1","d-flex","justify-content-end","align-items-center","px-0",2,"margin-left","12px"],[1,"custom-select","form-select","form-select-sm",3,"ngModelChange","change","ngModel"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"shadow-md","bg-white"],[3,"ngValue"],[2,"height","40vh","display","flex"],[1,"m-auto"],["
1id","",1,"d-flex","flex-column","justify-content-center","align-items-center"],["role","status",1,"spinner-grow","mb-2"],[1,"sr-only"],[1,"col-sm-12","px-2"],[2,"display","flex","font-size","16px"],[1,"que"]],template:function(i,n){if(1&i){const a=e.RV6();e.DNE(0,kn,6,4,"section",8),e.j41(1,"button",9,0),e.EFF(3," Discard Changes\n"),e.k0s(),e.j41(4,"div",10)(5,"div",11)(6,"div",12)(7,"div",13)(8,"h3",14),e.EFF(9," Are you sure? "),e.k0s(),e.j41(10,"h4",15),e.EFF(11,"Do you want to discard some unsaved changes?"),e.k0s(),e.j41(12,"div",16)(13,"button",17,1),e.EFF(15," CANCEL "),e.k0s(),e.j41(16,"button",18,1),e.EFF(18," DISCARD "),e.k0s()()()()()(),e.nrm(19,"a",19,2),e.j41(21,"div",20)(22,"div",21)(23,"div",22)(24,"div",23)(25,"h5",15),e.EFF(26,"Are you sure, you want to Publish this Survey?"),e.k0s(),e.j41(27,"div")(28,"app-button",24),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.k0s(),e.j41(29,"app-button",25,1),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!0))}),e.k0s()()()()()(),e.DNE(31,yn,8,0,"section",26),e.nrm(32,"a",27,3),e.j41(34,"div",28)(35,"div",21)(36,"div",22)(37,"div",29)(38,"h5"),e.EFF(39,"Survey looks empty."),e.k0s(),e.j41(40,"h5"),e.EFF(41,"Please add question to publish the survey."),e.k0s()(),e.j41(42,"div",30)(43,"app-button",31),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!0))}),e.k0s(),e.j41(44,"button",32),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!1))}),e.EFF(45,"Add Questions"),e.k0s()()()()(),e.nrm(46,"a",33,4),e.j41(48,"div",34)(49,"div",35)(50,"div",22)(51,"div",36)(52,"h5",37),e.EFF(53,"WARNING:"),e.k0s(),e.j41(54,"h4"),e.EFF(55," Below questions won't be shown in interactive emails."),e.k0s(),e.nrm(56,"hr"),e.k0s(),e.DNE(57,Cn,5,2,"div",38),e.j41(58,"div",30)(59,"h4"),e.EFF(60),e.k0s(),e.j41(61,"button",39),e.EFF(62,"Cancel"),e.k0s(),e.j41(63,"button",40),e.bIt("click",function(){return e.eBV(a),e.Njj(n.publishContinue())}),e.EFF(64,"Continue"),e.k0s()()()()()}2&i&&(e.Y8G("ngIf",!n.isLoading),e.R7$(31),e.Y8G("ngIf",n.isLoading),e.R7$(26),e.Y8G("ngForOf",n.questionsArr),e.R7$(3),e.SpI("Would you like to continue ","DRAFT"===n.surveyDetails.status?"Publishing":"","?"))},dependencies:[p.YU,p.Sq,p.bT,g.Wk,v.ej,R.Q,r.qT,r.xH,r.y7,r.me,r.wz,r.BC,r.cb,r.YS,r.tU,r.vS,r.cV,r.j4,r.JD,v.kf],styles:[".header[_ngcontent-%COMP%]{border-bottom:1px solid dark}.cardheader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.card1[_ngcontent-%COMP%]{width:400px;height:200px;background-image:url(https://merrenbucket.s3.ap-south-1.amazonaws.com/background-image.png);background-size:100%;background-repeat:no-repeat}.btn1[_ngcontent-%COMP%]{padding-top:160px}.cardinfom[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding-top:47px}.card2[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;border:1px solid dark;background-color:#fff;height:80px}.text-danger[_ngcontent-%COMP%]{font-size:larger;padding-left:4px}label[_ngcontent-%COMP%]{font-weight:500;font-family:Lato;font-size:14px}input[_ngcontent-%COMP%]{font-family:Lato;font-size:12px}.details[_ngcontent-%COMP%]{font-weight:400;font-family:Lato;font-size:13px;color:#000;overflow-wrap:break-word;white-space:pre-wrap}.details2[_ngcontent-%COMP%]{font-weight:400;font-family:Lato;font-size:11px;color:#000;overflow-wrap:break-word;white-space:pre-wrap;padding-top:3px}.upload[_ngcontent-%COMP%]{border:.5px solid grey;border-radius:5px}.circle[_ngcontent-%COMP%]{background-color:#f69522;border-radius:50%}.container[_ngcontent-%COMP%]{display:flex}.circles[_ngcontent-%COMP%]{width:10px;height:23px;border-radius:50%;background-color:#d5d5d8}.line[_ngcontent-%COMP%]{width:160px;height:3px;background-color:#d5d5d8;align-self:center}.mat-mdc-form-field[_ngcontent-%COMP%]{margin-top:16px}th[_ngcontent-%COMP%]{color:#666;font-family:Lato;font-size:14px;font-weight:400}tr[_ngcontent-%COMP%]{border-radius:5px}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0 5px}table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{vertical-align:baseline;text-align:left}table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:middle;text-align:left;padding-top:15px;padding-bottom:15px;font-family:Lato;font-size:12px;font-weight:600}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{border-top-left-radius:5px;border-bottom-left-radius:5px}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{border-top-right-radius:5px;border-bottom-right-radius:5px}.submit-clicked[_ngcontent-%COMP%]{background-color:#f69522}.submit-clicked2[_ngcontent-%COMP%]{background-color:gray}.circles[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{display:inline-block;font-size:12px;font-weight:600;margin:0;padding:0;white-space:nowrap}.circlef[_ngcontent-%COMP%]{height:60px;background-color:#5bdfb0;border-radius:50%;color:#fff;padding-top:20px}.header[_ngcontent-%COMP%]{white-space:nowrap;font-size:18px;font-weight:600;font-family:Lato}.primary-color[_ngcontent-%COMP%]{color:#007bff}.card-template[_ngcontent-%COMP%]{width:calc(25% - 24px)}.card-img-top[_ngcontent-%COMP%]{height:100%;width:100%}
1.card-template[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]{padding:1rem}.card-template[_ngcontent-%COMP%]   h6[_ngcontent-%COMP%]{font-size:1rem;margin-bottom:0}.clickable-area[_ngcontent-%COMP%]{position:relative;height:100%;cursor:pointer}.card-template[_ngcontent-%COMP%]:hover{box-shadow:0 .5rem 1rem #0000001a;cursor:pointer!important;color:#f79522;text-decoration:none}.selected[_ngcontent-%COMP%]{outline:3px solid #F69522;outline-offset:-3px;border-radius:5px}.disabled[_ngcontent-%COMP%]{pointer-events:none}.stitle-ellipsis[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:14px}.f-h4[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:400}.f-h3[_ngcontent-%COMP%]{font-size:12px;font-weight:600}.card[_ngcontent-%COMP%]{border:1px solid white!important;border-radius:.25rem}.que[_ngcontent-%COMP%]{font-size:16px;color:#000;overflow:hidden;line-height:20px;text-overflow:ellipsis;-webkit-line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical}"]})}return o})(),jn=(()=>{class o{constructor(){}ngOnInit(){}static#e=this.\u0275fac=function(i){return new(i||o)};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-whatapp-push"]],decls:2,vars:0,template:function(i,n){1&i&&(e.j41(0,"p"),e.EFF(1,"whatapp-push works!"),e.k0s())}})}return o})(),Mn=(()=>{class o{constructor(){}ngOnInit(){}static#e=this.\u0275fac=function(i){return new(i||o)};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-facebook"]],decls:2,vars:0,template:function(i,n){1&i&&(e.j41(0,"p"),e.EFF(1,"facebook works!"),e.k0s())}})}return o})();const wn=["publishsurveyModel"],Pn=["questioncoutzeroModel"],On=(o,s,t)=>({totalItems:o,itemsPerPage:s,currentPage:t});function Sn(o,s){1&o&&(e.j41(0,"div",35)(1,"p"),e.EFF(2,"No Campaigns"),e.k0s()())}function En(o,s){if(1&o){const t=e.RV6();e.j41(0,"tr",47)(1,"td",48),e.EFF(2),e.k0s(),e.j41(3,"td",49),e.EFF(4),e.k0s(),e.j41(5,"td",49),e.EFF(6),e.k0s(),e.j41(7,"td",49),e.EFF(8),e.k0s(),e.j41(9,"td",49)(10,"img",50),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG(2);return e.Njj(a.deleteCampId=n._id)}),e.k0s()()()}if(2&o){const t=s.$implicit;e.R7$(2),e.JRh(null==t?null:t.campName),e.R7$(2),e.SpI("",null==t?null:t.integration," "),e.R7$(2),e.JRh(null==t?null:t.noOfTriggers),e.R7$(2),e.JRh(null==t?null:t.noOfResponses)}}function In(o,s){if(1&o&&(e.j41(0,"option",51),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.Y8G("ngValue",t),e.R7$(),e.SpI(" ",t," ")}}function Rn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",36)(1,"div",37)(2,"table",38)(3,"thead")(4,"tr")(5,"th",39),e.EFF(6,"Campaign Name"),e.k0s(),e.j41(7,"th",40),e.EFF(8,"Integration"),e.k0s(),e.j41(9,"th",40),e.EFF(10,"Triggers"),e.k0s(),e.j41(11,"th",40),e.EFF(12,"Responses"),e.k0s(),e.j41(13,"th",40),e.EFF(14,"Actions"),e.k0s()()(),e.j41(15,"tbody"),e.DNE(16,En,11,4,"tr",41),e.nI1(17,"paginate"),e.k0s()()(),e.j41(18,"div",42)(19,"pagination-controls",43),e.bIt("pageChange",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.handlePageChange(n))}),e.k0s()(),e.j41(20,"div",44)(21,"select",45),e.mxI("ngModelChange",function(n){e.eBV(t);const a=e.XpG();return e.DH7(a.pageSize,n)||(a.pageSize=n),e.Njj(n)}),e.bIt("change",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.handlePageSizeChange())}),e.DNE(22,In,2,2,"option",46),e.k0s()()()}if(2&o){const t=e.XpG();e.R7$(16),e.Y8G("ngForOf",e.i5U(17,3,t.campaignList,e.sMw(6,On,t.count,t.pageSize,t.page))),e.R7$(5),e.R50("ngModel",t.pageSize),e.R7$(),e.Y8G("ngForOf",t.pageSizes)}}function Tn(o,s){1&o&&(e.j41(0,"section",52)(1,"div",53)(2,"div",54)(3,"div",55)(4,"span",56),e.EFF(5,"Loading..."),e.k0s()(),e.j41(6,"strong"),e.EFF(7,"Loading..."),e.k0s()()()())}let Nn=(()=>{class o{constructor(t,i,n){this.surveyService=t,this.toastrService=i,this.router=n,this.submitted=!1,this.pageSizes=[5,10,15,50,100],this.currentPage=0,this.page=0,this.count=0,this.pageSize=5,this.userData=JSON.parse(localStorage.getItem("currentUser")),this.isLoading=!0,this.surveyDetails={}}ngOnInit(){this.getAllCampaignList(),this.getSurveyDetails()}getAllCampaignList(){this.isLoading=!0,this.surveyService.getIntegrationCampList(localStorage.getItem("surveyId"),this.currentPage,this.pageSize).subscribe(t=>{this.campaignList=t.data,console.log(t.data),console.log(this.campaignList),this.campId=t.data._id,this.count=t.count,this.isLoading=!1},t=>{console.log(t),this.isLoading=!1})}
1deleteCampaign(){this.surveyService.deleteCampaign(this.deleteCampId).subscribe(t=>{this.toastrService.success("Campaign deleted sucessfully."),this.getAllCampaignList()},t=>{this.toastrService.error("Please try again.")})}handlePageChange(t){1===t?(this.page=t,this.currentPage=t-1):t>1&&(this.page=t,this.currentPage=this.pageSize*(t-1)),this.getAllCampaignList()}handlePageSizeChange(){this.pageSize=this.pageSize,this.page=1,this.currentPage=0,this.getAllCampaignList()}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t})}goToMoengage(){0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():"DRAFT"==this.surveyDetails.status?this.publishsurveyModel.nativeElement.click():this.router.navigate(["/survey/deploy-survey/integrations/moEngage"])}goToCustom(){0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():"DRAFT"==this.surveyDetails.status?this.publishsurveyModel.nativeElement.click():this.router.navigate(["/survey/deploy-survey/integrations/custom"])}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}updateStatus(t){if(t){let i={id:localStorage.getItem("surveyId"),is_published:!0};this.surveyService.updateSurveyStatus(i).subscribe(n=>{this.toastrService.success("Survey Published sucessfully."),this.getSurveyDetails()},n=>{console.error(n)})}}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(b.I),e.rXU(x.tw),e.rXU(g.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-integrations"]],viewQuery:function(i,n){if(1&i&&(e.GBs(wn,7),e.GBs(Pn,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first)}},decls:56,vars:3,consts:[["closeModal",""],["publishsurveyModel",""],["questioncoutzeroModel",""],[1,"col-sm-12"],[1,"col-sm-10","row","pt-2","px-0"],[1,"col-sm-2","text-center","shadow","p-3","m-2","content-link",2,"text-decoration","none","border-radius","4px","cursor","pointer",3,"click"],[1,"content"],["src","../../../../../assets/icons/moEngage.png","height","50","width","50","alt","MoEngage Logo",1,"m-0",2,"border-radius","6px"],[1,"mt-2","mb-0"],["src","../../../../../assets/img/integration.png","height","50","width","50","alt","MoEngage Logo",1,"m-0",2,"border-radius","6px"],[1,"content","mt-5"],[1,"col-sm-12","text-left","pl-0"],[1,"mb-0"],["class","d-flex align-items-center justify-content-center contents","style","font-weight: 400; margin-top:5rem; font-size: 24px; color: #898989",4,"ngIf"],["class","fisrt row px-0 py-10",4,"ngIf"],["id","deleteCamp","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content","formWrapper","noBg","bg-white"],[1,"modal-body","d-flex","flex-column","justify-content-between","align-items-center","text-center","py-4"],[1,"pb-4","text-danger"],["className","btn-outline-primary text-uppercase btnClose mr-1","btnLabel","close","data-bs-dismiss","modal"],["className","btn-danger text-uppercase ml-2","btnLabel","Delete","data-bs-dismiss","modal",3,"click"],["data-bs-toggle","modal","data-bs-target","#publishSurvy",2,"display","none"],["id","publishSurvy","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-body","d-flex","flex-column","py-4","justify-content-between","align-items-center","py-5"],[1,"pb-4","text-center"],["className","btn-outline-primary text-uppercase btnClose mr-1","btnLabel","close","data-bs-dismiss","modal",3,"click"],["className","btn-primary text-uppercase ml-2","btnLabel","Publish","data-bs-dismiss","modal",3,"click"],["style","height: 40vh;display: flex;",4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#questioncoutzero",2,"display","none"],["id","questioncoutzero","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"py-4","text-center"],[1,"text-center","pb-4"],["className","btn-outline-primary mr-3","btnLabel","MY DASHBOARD","data-bs-dismiss","modal",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary","text-uppercase",3,"click"],[1,"d-flex","align-items-center","justify-content-center","contents",2,"font-weight","400","margin-top","5rem","font-size","24px","color","#898989"],[1,"fisrt","row","px-0","py-10"],[1,"col-sm-12","d-flex"],[1,"table","table-borderless"],["scope","col",2,"width","40%","padding-left","30px"],["scope","col",2,"width","15%","text-align","center"],["class","bg-white shadow-md","style","border-radius: 6px; ",4,"ngFor","ngForOf"],[1,"row","col-sm-11","d-flex","justify-content-end","align-items-center","mt-3","content"],["previousLabel","Prev","nextLabel","Next","responsive","true",3,"pageChange"],[1,"col-sm-1","d-flex","justify-content-end","align-items-center","px-0",2,"margin-left","12px"],[1,"custom-select","form-select","form-select-sm",3,"ngModelChange","change","ngModel"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"bg-white","shadow-md",2,"border-radius","6px"],[2,"padding-left","30px"],[2,"text-align","center"],["src","../../../../../assets/icons/trash.svg","title","Delete Campaign","alt","Delete Records","data-bs-toggle","modal","data-bs-target","#deleteCamp",1,"ico","px-3",2,"cursor","pointer",3,"click"],[3,"ngValue"],[2,"height","40vh","display","flex"],[1,"m-auto"],["id","",1,"d-flex","flex-column","justify-content-center","align-items-center"],["role","status",1,"spinner-grow","mb-2"],[1,"sr-only"]],template:function(i,n){if(1&i){const a=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"a",5),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goToMoengage())}),e.j41(3,"div",6),e.nrm(4,"img",7),e.j41(5,"p",8),e.EFF(6,"MoEngage"),e.k0s()()(),e.j41(7,"a",5),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goToCustom())}),e.j41(8,"div",6),e.nrm(9,"img",9),e.j41(10,"p",8),e.EFF(11,"Custom"),e.k0s()()()()(),e.j41(12,"div",10)(13,"div",11)(14,"p",12)(15,"strong"),e.EFF(16,"Campaigns"),e.k0s()()(),e.DNE(17,Sn,3,0,"div",13)(18,Rn,23,10,"div",14),e.k0s(),e.j41(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18)(23,"h5",19),e.EFF(24,"Are you sure, you want to delete this campaign?"),e.k0s(),e.j41(25,"div"),e.nrm(26,"app-button",20),e.j41(27,"app-button",21,0),e.bIt("click",function(){return e.eBV(a),e.Njj(n.deleteCampaign())}),e.k0s()()()()()(),e.nrm(29,"a",22,1),e.j41(31,"div",23)(32,"div",16)(33,"div",17)(34,"div",24)(35,"h5",25),e.EFF(36,"Are you sure, you want to Publish this Survey?"),e.k0s(),e.j41(37,"div")(38,"app-button",26),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.k0s(),e.j41(39,"app-button",27,0),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!0))}),e.k0s()()()()()(),e.DNE(41,Tn,8,0,"section",28),e.nrm(42,"a",29,2),e.j41(44,"div",30)(45,"div",16)(46,"div",17)(47,"div",31)(48,"h5"),e.
1EFF(49,"Survey looks empty."),e.k0s(),e.j41(50,"h5"),e.EFF(51,"Please add question to publish the survey."),e.k0s()(),e.j41(52,"div",32)(53,"app-button",33),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!0))}),e.k0s(),e.j41(54,"button",34),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!1))}),e.EFF(55,"Add Questions"),e.k0s()()()()()}2&i&&(e.R7$(17),e.Y8G("ngIf",0===(null==n.campaignList?null:n.campaignList.length)),e.R7$(),e.Y8G("ngIf",(null==n.campaignList?null:n.campaignList.length)>0),e.R7$(23),e.Y8G("ngIf",n.isLoading))},dependencies:[p.Sq,p.bT,v.ej,R.Q,r.xH,r.y7,r.wz,r.BC,r.vS,v.kf],styles:["table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0 5px}table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{vertical-align:baseline;text-align:left;color:#666;font-size:14px;font-family:Lato;font-weight:400}table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:middle;text-align:left;padding-top:15px;padding-bottom:15px;font-size:14px}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}"]})}return o})();const S=o=>({"is-invalid":o});function Dn(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Campaign name is required. "),e.k0s())}function Gn(o,s){if(1&o&&(e.j41(0,"div",53),e.DNE(1,Dn,2,0,"div",54),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.f.campName.errors.required)}}function An(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",61),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG();return a.removeHeader(n),e.Njj(a.checkValudationError())}),e.k0s()}}function Vn(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",62),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.addHeader())}),e.k0s()}}function Ln(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",36)(1,"div",37)(2,"input",55),e.bIt("input",function(n){const a=e.eBV(t).$implicit,l=e.XpG();return a.key=n.target.value,e.Njj(l.checkValudationError())}),e.k0s()(),e.j41(3,"div",56)(4,"input",57),e.bIt("input",function(n){const a=e.eBV(t).$implicit,l=e.XpG();return a.value=n.target.value,e.Njj(l.checkValudationError())}),e.k0s()(),e.j41(5,"div",58),e.DNE(6,An,1,0,"i",59)(7,Vn,1,0,"i",60),e.k0s()()}if(2&o){const t=s.$implicit,i=s.index,n=e.XpG();e.R7$(2),e.FS9("value",null==t?null:t.key),e.Y8G("ngClass",e.eq3(6,S,null==t?null:t.isError)),e.R7$(2),e.FS9("value",null==t?null:t.value),e.Y8G("ngClass",e.eq3(8,S,null==t?null:t.isError)),e.R7$(2),e.Y8G("ngIf",n.headersArr.length>1),e.R7$(),e.Y8G("ngIf",n.headersArr.length-1==i)}}function $n(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",63),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.testConnection())}),e.EFF(1,"Test Connection"),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("disabled",""==t.setupResponseUrl)}}function Bn(o,s){1&o&&(e.j41(0,"p",64),e.EFF(1,"Successfully Connected!"),e.k0s())}function Xn(o,s){if(1&o&&(e.j41(0,"option",74),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG().index,n=e.XpG();e.Y8G("value",t._id)("disabled",n.isQuestionSelected(t._id,i)),e.R7$(),e.JRh(t.text)}}function zn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",75)(1,"i",76),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG();return e.Njj(a.removeRow(n))}),e.k0s()()}}function Yn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",75)(1,"i",77),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG();return a.addRow(),e.Njj(a.updateQuesDisable(n))}),e.k0s()()}}function qn(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",65)(1,"div",66)(2,"select",67),e.bIt("change",function(n){const a=e.eBV(t).index,l=e.XpG();return e.Njj(l.onQuestionChange(n,a))}),e.j41(3,"option",68),e.EFF(4,"Select Question"),e.k0s(),e.DNE(5,Xn,2,3,"option",69),e.k0s()(),e.j41(6,"div",70),e.nrm(7,"input",71),e.k0s(),e.j41(8,"div",72),e.DNE(9,zn,2,0,"div",73)(10,Yn,2,0,"div",73),e.k0s()()}if(2&o){const t=s.index,i=e.XpG();e.Y8G("formGroupName",t),e.R7$(3),e.Y8G("value",null),e.R7$(2),e.Y8G("ngForOf",i.questionsList),e.R7$(4),e.Y8G("ngIf",i.rows.length>1),e.R7$(),e.Y8G("ngIf",i.rows.length-1==t)}}let Un=(()=>{class o{constructor(t,i,n,a){this.toastrService=t,this.fb=i,this.surveyService=n,this.router=a,this.userDetails=JSON.parse(localStorage.getItem("currentUser")),this.questionsList=[],this.connected=!1,this.submitted=!1,this.maxRows=6,this.headersArr=[{key:"",value:"",isError:!1}],this.setupResponseUrl="",this.dynamicForm=new r.gE({rows:new r.Yp([],[r.k0.required])}),this.connectSuccess=!1,this.dynamicForm=this.fb.group({rows:this.fb.array([])}),this.rowCounter=new r.MJ(1)}ngOnInit(){this.getQuestions(),this.addRow(),this.getTriggerUrl(),this.campForm=this.fb.group({campName:["",r.k0.required],triggerUrl:[{value:"",disabled:!0},r.k0.required],triggerApiKey:[{value:"",disabled:!0},r.k0.required],triggerSecretKey:[{value:"",disabled:!0},r.k0.required],responseUrl:[],responseApiKey:[],responseSecretKey:[]}),this.getUserSecretCode(),this.submitted=!1}get rows(){return this.dynamicForm.get("rows")}get f(){return this.campForm.controls}addRow(){if(this.rowCounter.value<this.maxRows){const t=this.fb.group({question:["Select Question",r.k0.required],questionId:[null,r.k0.required],attribute:["",r.k0.required]});this.rows.push(t),this.rowCounter.setValue(this.rowCounter.value+1)}}removeRow(t){this.rows.removeAt(t),this.rowCounter.setValue(this.rowCounter.value-1),this.updateQuesEnable(t)}isQuestionSelected(t,i){for(let n=0;n<this.rows.length;n++)if(n!==i&&this.rows.at(n).get("questionId").value===t)return!0;return!1}updateQuesDisable(t){const i=this.dynamicForm.value.rows[t].questionId;if(i)for(let n=0;n<this.rows.length;n++)if(n!==t){const l=this.rows.at(n).get("questionId");l.value===i&&l.disable()}}updateQuesEnable(t){const i=this.rows.at(t);i.get("questionId").value&&(i.get("questionId").enable(),i.get("question").setValue(null),i.get("attribute").setValue(null))}
1copyData(t){navigator.clipboard.writeText(t),this.toastrService.success("Copied")}testConnection(){let t=!1;if(this.headersArr.map(a=>{""==a?.key||""==a?.value?(a.isError=!0,t=!0):a.isError=!1}),t)return!1;let i=this.headersArr.map(a=>({key:a?.key,value:a?.value})),n={surveyId:localStorage.getItem("surveyId"),apiUrl:this.setupResponseUrl,headers:i};this.surveyService.setupResponse(n).subscribe(a=>{a.success?this.connectSuccess=!0:(this.connectSuccess=!1,this.toastrService.error(a.error)),console.log(a)},a=>{console.log(a),this.connectSuccess=!1,this.toastrService.error(a)})}checkValudationError(){this.connectSuccess=!1;let t=!1;if(this.headersArr.map(i=>{""==i?.key||""==i?.value?(i.isError=!1,t=!0):i.isError=!1}),t)return!1}addHeader(){this.checkValudationError(),this.headersArr.push({key:"",value:"",isError:!1})}removeHeader(t){this.headersArr.splice(t,1)}getQuestions(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{t&&t.sections&&t.sections.length>0?t.sections.forEach(i=>{i.questions&&i.questions.length>0&&i.questions.forEach(n=>{"Message"!==n.type&&"Image/Media"!==n.type&&this.questionsList.push(n)})}):console.log("No sections or questions found in the response.")})}getTriggerUrl(){this.surveyService.generateUniqueLink(localStorage.getItem("surveyId")).subscribe(t=>{this.uniqueId=t.uniqueId,this.campForm.patchValue({triggerUrl:t.link})},t=>{console.log(t)})}getUserSecretCode(){this.surveyService.getUserSecretCode(this.userDetails.userId).subscribe(t=>{null!=t&&this.campForm.patchValue({triggerApiKey:t.userId,triggerSecretKey:t.secretId})},t=>{console.error(t)})}onQuestionChange(t,i){const n=t.target.value,a=t.target.options[t.target.selectedIndex].text,l=this.rows.at(i);l.get("questionId").setValue(n),l.get("question").setValue(a)}saveCampaign(){if(this.submitted=!0,this.campForm.invalid)return;const t=this.dynamicForm.value.rows.map(a=>({question:a.question,questionId:a.questionId,attribute:a.attribute}));let i=this.headersArr.map(a=>({key:a?.key,value:a?.value})),n={campId:this.uniqueId,surveyId:localStorage.getItem("surveyId"),campName:this.campForm.controls.campName.value,triggerUrl:this.campForm.controls.triggerUrl.value,triggerApiKey:this.campForm.controls.triggerApiKey.value,triggerSecretKey:this.campForm.controls.triggerSecretKey.value,responseUrl:this.setupResponseUrl,headers:i,fieldMap:t};this.surveyService.saveMoengage(n).subscribe(a=>{this.toastrService.success("Campaign saved successfully!."),this.router.navigate(["/survey/deploy-survey/integrations"]),console.log(a)},a=>{this.toastrService.error(a),console.log(a)})}checkEmptyRecord(){this.surveyService.checkEmptyRecord(this.uniqueId).subscribe(t=>{console.log(t)},t=>{console.log(t)})}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(x.tw),e.rXU(r.ok),e.rXU(b.I),e.rXU(g.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-mo-engage-integration"]],decls:88,vars:15,consts:[[1,"col-sm-12"],[1,"col-sm-12","row","pt-4","px-0"],["src","../../../../../assets/icons/moEngage.png","height","30","width","30","alt","MoEngage Logo",1,"logo","m-0",2,"border-radius","6px"],[1,"ml-3","mt-1","mb-0"],[3,"ngSubmit","formGroup"],[1,"form-group","col-sm-12","mt-4","px-0"],[1,"col-form-label"],["type","text","formControlName","campName","required","","placeholder","Enter campaign name","maxlength","20",1,"form-control","shadow-sm","pl-4",3,"ngClass"],["class","invalid-feedback",4,"ngIf"],["id","accordionExample",1,"accordion","col-sm-12","mt-4","mb-3","px-0"],[1,"card","shadow-sm"],["id","headingOne","data-bs-toggle","collapse","data-bs-target","#collapseOne","aria-expanded","true","aria-controls","collapseOne",1,"card-header","bg-white"],[1,"mb-0"],[1,"col-sm-12","btn","btn-block","text-left"],[1,"fas","fa-chevron-down","float-right"],["id","collapseOne","aria-labelledby","headingOne","data-parent","#accordionExample",1,"collapse"],[1,"card-body"],[1,"form-group","row"],["for","url",1,"col-sm-2","mb-3","pl-5","col-form-label"],[1,"col-sm-10","position-relative"],["type","text","formControlName","triggerUrl","placeholder","Unique link goes here",1,"form-control","pr-5","bg-white"],[1,"copy-icon",2,"background-image","url('../../../../../../assets/icons/copy-svgrepo-com 1.svg')",3,"click"],["for","apiKey",1,"col-sm-2","mb-3","pl-5","col-form-label"],[1,"col-sm-10"],["type","text","formControlName","triggerApiKey",1,"form-control","bg-white"],["for","secretKey",1,"col-sm-2","mb-3","pl-5","col-form-label"],["type","password","formControlName","triggerSecretKey",1,"form-control","bg-white"],["id","accordionExample",1,"accordion","col-sm-12","mb-3","px-0"],["id","headingTwo","data-bs-toggle","collapse","data-bs-target","#collapseTwo","aria-expanded","true","aria-controls","collapseTwo",1,"card-header","bg-white"],[1,"col-sm-12","px-0","btn","btn-block","text-left"],["id","collapseTwo","aria-labelledby","headingTwo","data-
1parent","#accordionExample",1,"collapse"],[1,"col-sm-12","row","m-0","mb-3"],[1,"col-sm-2","px-0"],[1,"pl-5","col-form-label"],["type","text","required","","placeholder","Enter URL here",1,"form-control",3,"input","value","ngClass"],[1,"col-sm-12","p-0"],[1,"col-sm-12","px-0","m-0","row","mb-3"],[1,"col-sm-5"],[1,"pl-7"],[1,"col-sm-7"],["class","col-sm-12 px-0 m-0 row mb-3",4,"ngFor","ngForOf"],[1,"col-sm-12","text-right","px-0","mt-4"],["type","button","class","btn btn-primary","placement","top",3,"disabled","click",4,"ngIf"],["class","mb-0","style","color:#1FAD08;",4,"ngIf"],["id","headingThree","data-bs-toggle","collapse","data-bs-target","#collapseThree","aria-expanded","true","aria-controls","collapseThree",1,"card-header","bg-white"],[2,"color","#807F7F","display","inline","font-size","15px","margin-left","10px"],["id","collapseThree","aria-labelledby","headingThree","data-parent","#accordionExample",1,"collapse"],[3,"formGroup"],["formArrayName","rows"],["class","col-sm-12 row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"py-4","text-right"],["type","button","data-bs-dismiss","modal","routerLink","/survey/deploy-survey/integrations",1,"btn","btn-outline-primary","mx-2","px-4",3,"click"],["type","submit","id","submit-btn",1,"btn","btn-primary","mx-1","px-4",3,"disabled"],[1,"invalid-feedback"],[4,"ngIf"],["type","text","required","","placeholder","Enter key here",1,"form-control",3,"input","value","ngClass"],[1,"col-sm-6"],["type","text","required","","placeholder","Enter value here",1,"form-control",3,"input","ngClass","value"],[1,"col-sm-1","px-0","d-flex"],["class","fal fa-minus-circle icon-md m-auto","type","button",3,"click",4,"ngIf"],["class","fal fa-plus-circle icon-md m-auto","type","button",3,"click",4,"ngIf"],["type","button",1,"fal","fa-minus-circle","icon-md","m-auto",3,"click"],["type","button",1,"fal","fa-plus-circle","icon-md","m-auto",3,"click"],["type","button","placement","top",1,"btn","btn-primary",3,"click","disabled"],[1,"mb-0",2,"color","#1FAD08"],[1,"col-sm-12","row",3,"formGroupName"],[1,"col-sm-6","mb-3"],["formControlName","questionId",1,"form-control",3,"change"],["disabled","",3,"value"],[3,"value","disabled",4,"ngFor","ngForOf"],[1,"col-sm-5","mb-3"],["type","text","formControlName","attribute","placeholder","Enter attribute name","maxlength","20",1,"form-control"],[1,"col-sm-1","mb-3","d-flex"],["style","margin: 10px;",4,"ngIf"],[3,"value","disabled"],[2,"margin","10px"],["type","button",1,"fal","fa-minus-circle","icon-md",3,"click"],["type","button",1,"fal","fa-plus-circle","icon-md",3,"click"]],template:function(i,n){1&i&&(e.j41(0,"div",0)(1,"div",1),e.nrm(2,"img",2),e.j41(3,"h5",3),e.EFF(4,"MoEngage"),e.k0s()()(),e.j41(5,"form",4),e.bIt("ngSubmit",function(){return n.saveCampaign()}),e.j41(6,"div",5)(7,"label",6),e.EFF(8,"Campaign Name"),e.k0s(),e.nrm(9,"input",7),e.DNE(10,Gn,2,1,"div",8),e.j41(11,"div",9)(12,"div",10)(13,"div",11)(14,"h2",12)(15,"div",13),e.EFF(16," Setup Trigger "),e.nrm(17,"i",14),e.k0s()()(),e.j41(18,"div",15)(19,"div",16)(20,"div",17)(21,"label",18)(22,"strong"),e.EFF(23,"URL"),e.k0s()(),e.j41(24,"div",19),e.nrm(25,"input",20),e.j41(26,"span",21),e.bIt("click",function(){return n.copyData(n.campForm.get("triggerUrl").value)}),e.k0s()(),e.j41(27,"label",22)(28,"strong"),e.EFF(29,"API Key"),e.k0s()(),e.j41(30,"div",23),e.nrm(31,"input",24),e.j41(32,"span",21),e.bIt("click",function(){return n.copyData(n.campForm.get("triggerApiKey").value)}),e.k0s()(),e.j41(33,"label",25)(34,"strong"),e.EFF(35,"Secret Key"),e.k0s()(),e.j41(36,"div",23),e.nrm(37,"input",26),e.j41(38,"span",21),e.bIt("click",function(){return n.copyData(n.campForm.get("triggerSecretKey").value)}),e.k0s()()()()()()(),e.j41(39,"div",27)(40,"div",10)(41,"div",28)(42,"h2",12)(43,"div",29),e.EFF(44," Setup Response Collection "),e.nrm(45,"i",14),e.k0s()()(),e.j41(46,"div",30)(47,"div",16)(48,"div",31)(49,"div",32)(50,"label",33)(51,"strong"),e.EFF(52,"URL"),e.k0s()()(),e.j41(53,"div",23)(54,"input",34),e.bIt("input",function(l){return n.setupResponseUrl=l.target.value,n.connectSuccess=!1}),e.k0s()()(),e.j41(55,"div",35)(56,"div",36)(57,"div",37)(58,"label",38)(59,"strong"),e.EFF(60,"Header Key"),e.k0s()()(),e.j41(61,"div",39)(62,"label",38)(63,"strong"),e.EFF(64,"Header Value"),e.k0s()()()(),e.DNE(65,Ln,8,10,"div",40),e.k0s(),e.j41(66,"div",41),e.DNE(67,$n,2,1,"button",42)(68,Bn,2,0,"p",43),e.k0s()()()()(),e.j41(69,"div",27)(70,"div",10)(71,"div",44)(72,"h2",12)(73,"div",13),e.EFF(74," Field Mapping "),e.j41(75,"span",45),e.EFF(76," (Max 5)"),e.k0s(),e.nrm(77,"i",14),e.k0s()()(),e.j41(78,"div",46)(79,"div",16)(80,"form",47)(81,"div",48),e.DNE(82,qn,11,5,"div",49),e.k0s()()()()()(),e.j41(83,"div",50)(84,"button",51),e.bIt("click",function(){return n.checkEmptyRecord()}),e.EFF(85,"Cancel"),e.k0s(),e.j41(86,"button",52),e.EFF(87,"Save"),e.k0s()()()()),2&i&&(e.R7$(5),e.Y8G("formGroup",n.campForm),e.R7$(4),e.Y8G("ngClass",e.eq3(11,S,n.f.campName.errors&&n.f.campName.touched)),e.R7$(),e.Y8G("ngIf",n.f.campName.errors&&n.f.campName.touched),e.R7$(44),e.FS9("value",n.setupResponseUrl),e.Y8G("ngClass",e.eq3(13,S,n.submitted&&n.f.responseUrl.errors)),e.R7$(11),e.Y8G("ngForOf",n.headersArr),e.R7$(2),e.Y8G("ngIf",!n.connectSuccess),e.R7$(),e.Y8G("ngIf",n.connectSuccess),e.R7$(12),e.Y8G("formGroup",n.dynamicForm),e.R7$(2),e.Y8G("ngForOf",n.rows.controls),e.R7$(4),e.Y8G("disabled",n.campForm.invali
1d||n.dynamicForm.invalid||!n.connectSuccess))},dependencies:[p.YU,p.Sq,p.bT,g.Wk,r.qT,r.xH,r.y7,r.me,r.wz,r.BC,r.cb,r.YS,r.tU,r.j4,r.JD,r.$R,r.v8],styles:[".logo[_ngcontent-%COMP%]{display:block;margin:0 auto;border-radius:10px}.copy-icon[_ngcontent-%COMP%]{position:absolute;top:35%;right:35px;transform:translateY(-50%);width:15px;height:15px;background-size:contain;background-repeat:no-repeat;cursor:pointer}.icon-md[_ngcontent-%COMP%]{font-size:20px}"]})}return o})();const Jn=["publishsurveyModel"],Wn=["questioncoutzeroModel"],k=o=>({"is-invalid":o}),P=o=>({"submit-clicked":o}),Hn=o=>({selected:o});function Kn(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Campaign name is required. "),e.k0s())}function Qn(o,s){if(1&o&&(e.j41(0,"div",88),e.DNE(1,Kn,2,0,"div",89),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.f.campName.errors.required)}}function Zn(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",96),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG();return a.removeHeader(n),e.Njj(a.checkValudationError())}),e.k0s()}}function ei(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",97),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.addHeader())}),e.k0s()}}function ti(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",43)(1,"div",44)(2,"input",90),e.bIt("input",function(n){const a=e.eBV(t).$implicit,l=e.XpG();return a.key=n.target.value,e.Njj(l.checkValudationError())}),e.k0s()(),e.j41(3,"div",91)(4,"input",92),e.bIt("input",function(n){const a=e.eBV(t).$implicit,l=e.XpG();return a.value=n.target.value,e.Njj(l.checkValudationError())}),e.k0s()(),e.j41(5,"div",93),e.DNE(6,Zn,1,0,"i",94)(7,ei,1,0,"i",95),e.k0s()()}if(2&o){const t=s.$implicit,i=s.index,n=e.XpG();e.R7$(2),e.FS9("value",null==t?null:t.key),e.Y8G("ngClass",e.eq3(6,k,null==t?null:t.isError)),e.R7$(2),e.FS9("value",null==t?null:t.value),e.Y8G("ngClass",e.eq3(8,k,null==t?null:t.isError)),e.R7$(2),e.Y8G("ngIf",n.headersArr.length>1),e.R7$(),e.Y8G("ngIf",n.headersArr.length-1==i)}}function ni(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",98),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.testConnection())}),e.EFF(1,"Test Connection"),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("disabled",""==t.setupResponseUrl)}}function ii(o,s){1&o&&(e.j41(0,"p",99),e.EFF(1,"Successfully Connected!"),e.k0s())}function oi(o,s){if(1&o&&(e.j41(0,"option",114),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG().index,n=e.XpG(2);e.Y8G("value",t._id)("disabled",n.isQuestionSelected(t._id,i)),e.R7$(),e.JRh(t.text)}}function ai(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",115)(1,"i",116),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG(2);return e.Njj(a.removeRow(n))}),e.k0s()()}}function si(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",115)(1,"i",117),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG(2);return a.addRow(),e.Njj(a.updateQuesDisable(n))}),e.k0s()()}}function ri(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",105)(1,"div",106)(2,"select",107),e.bIt("change",function(n){const a=e.eBV(t).index,l=e.XpG(2);return e.Njj(l.onQuestionChange(n,a))}),e.j41(3,"option",108),e.EFF(4,"Select Question"),e.k0s(),e.DNE(5,oi,2,3,"option",109),e.k0s()(),e.j41(6,"div",110),e.nrm(7,"input",111),e.k0s(),e.j41(8,"div",112),e.DNE(9,ai,2,0,"div",113)(10,si,2,0,"div",113),e.k0s()()}if(2&o){const t=s.index,i=e.XpG(2);e.Y8G("formGroupName",t),e.R7$(5),e.Y8G("ngForOf",i.questionsList),e.R7$(4),e.Y8G("ngIf",i.rows.length>1),e.R7$(),e.Y8G("ngIf",i.rows.length-1==t)}}function li(o,s){if(1&o&&(e.j41(0,"div",35)(1,"div",18)(2,"div",100)(3,"h2",20)(4,"div",53),e.EFF(5," Field Mapping "),e.j41(6,"span",101),e.EFF(7," (Max 5)"),e.k0s(),e.nrm(8,"i",22),e.k0s()()(),e.j41(9,"div",102)(10,"div",24)(11,"form",11)(12,"div",103),e.DNE(13,ri,11,4,"div",104),e.k0s()()()()()()),2&o){const t=e.XpG();e.R7$(11),e.Y8G("formGroup",t.dynamicForm),e.R7$(2),e.Y8G("ngForOf",t.rows.controls)}}function ci(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",96),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG(2);return a.removeField(n),e.Njj(a.checkValudationError())}),e.k0s()}}function di(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",97),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.addField())}),e.k0s()}}function pi(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",43)(1,"div",121)(2,"input",90),e.bIt("input",function(n){const a=e.eBV(t).$implicit;return e.Njj(a.key=n.target.value)}),e.k0s()(),e.j41(3,"div",93),e.DNE(4,ci,1,0,"i",94)(5,di,1,0,"i",95),e.k0s()()}if(2&o){const t=s.$implicit,i=s.index,n=e.XpG(2);e.R7$(2),e.FS9("value",null==t?null:t.key),e.Y8G("ngClass",e.eq3(4,k,null==t?null:t.isError)),e.R7$(2),e.Y8G("ngIf",n.responseRequriedKeysArr.length>1),e.R7$(),e.Y8G("ngIf",n.responseRequriedKeysArr.length-1==i)}}function ui(o,s){if(1&o&&(e.j41(0,"div",118)(1,"div",18)(2,"div",119)(3,"h2",20)(4,"div",53),e.EFF(5," Requried Fields For Response "),e.nrm(6,"i",22),e.k0s()()(),e.j41(7,"div",120)(8,"div",24)(9,"div",42)(10,"div",43)(11,"div",44)(12,"h5",40),e.EFF(13,"Requied Key"),e.k0s()()(),e.DNE(14,pi,6,6,"div",46),e.k0s()()()()()),2&o){const t=e.XpG();e.R7$(14),e.Y8G("ngForOf",t.responseRequriedKeysArr)}}function mi(o,s){if(1&o&&e.nrm(0,"div",128),2&o){const t=e.XpG(3);e.Y8G("ngClass",e.eq3(1,P,t.submitClicked2))}}function gi(o,s){if(1&o&&(e.j41(0,"div",126)(1,"div",134)(2,"h3"),e.EFF(3,"Xoxoday rewards"),e.k0s()()()),2&o){const t=e.XpG(3);e.Y8G("ngClass",e.eq3(1,P,t.submitClicked3))}}function hi(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Campaign name is required. "),e.k0s())}function fi(o,s){if(1&o&&(e.j41(0,"div",88),e.DNE(1,hi,2,0,"div",89),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.campaignName.errors.required)}}function _i(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Subject line is required. "),e.k0s())}function bi(o,s){if(1&o&&(e.j41(0,"div",88),e.DNE(1,_i,2,0,"div",89),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.subject.errors.required)}}function vi(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"pre-header text is required."),e.k0s())}function xi(o,s){if(1&o&&(e.j41(0,"div",88),e.DNE(1,vi,2,0,"div",89),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.preHeader.errors.required)}}function ki(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"From name is required."),e.k0s())}function yi(o,s){if(1&o&&(e.j41(0,"div",88),e.DNE(1,ki,2,0,"div",89),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.fromName.errors.required)}}function Ci(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Email is required"),e.k0s())}
1function Fi(o,s){1&o&&(e.j41(0,"div"),e.EFF(1,"Email is invalid"),e.k0s())}function ji(o,s){if(1&o&&(e.j41(0,"div",88),e.DNE(1,Ci,2,0,"div",89)(2,Fi,2,0,"div",89),e.k0s()),2&o){const t=e.XpG(4);e.R7$(),e.Y8G("ngIf",t.f1.replyTo.errors.required),e.R7$(),e.Y8G("ngIf",t.f1.replyTo.errors.replyTo)}}function Mi(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",135)(1,"form",11)(2,"div",136)(3,"div",137)(4,"h5",138),e.EFF(5,"Add Details"),e.k0s()(),e.nrm(6,"span",139),e.j41(7,"div",140)(8,"div",91)(9,"div",141)(10,"label")(11,"strong"),e.EFF(12,"Campaign Name"),e.k0s(),e.j41(13,"span",14),e.EFF(14,"*"),e.k0s()(),e.j41(15,"input",142),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.onChageCampignName(n.target.value))}),e.k0s(),e.DNE(16,fi,2,1,"div",16),e.k0s(),e.j41(17,"div",143)(18,"label")(19,"strong"),e.EFF(20,"Subject Line"),e.k0s(),e.j41(21,"span",14),e.EFF(22,"*"),e.k0s()(),e.j41(23,"input",144,4),e.bIt("input",function(){e.eBV(t);const n=e.sdS(24),a=e.XpG(3);return e.Njj(a.getValuesubject(n.value))}),e.k0s(),e.DNE(25,bi,2,1,"div",16),e.k0s(),e.j41(26,"div",143)(27,"label")(28,"strong"),e.EFF(29,"Pre-header Text"),e.k0s(),e.j41(30,"span",14),e.EFF(31,"*"),e.k0s()(),e.j41(32,"input",145,5),e.bIt("input",function(){e.eBV(t);const n=e.sdS(33),a=e.XpG(3);return e.Njj(a.getValuePreheader(n.value))}),e.k0s(),e.DNE(34,xi,2,1,"div",16),e.k0s(),e.j41(35,"div",143)(36,"label")(37,"strong"),e.EFF(38,"From Name"),e.k0s(),e.j41(39,"span",14),e.EFF(40,"*"),e.k0s()(),e.j41(41,"input",146,6),e.bIt("input",function(){e.eBV(t);const n=e.sdS(42),a=e.XpG(3);return e.Njj(a.getValue(n.value))}),e.k0s(),e.DNE(43,yi,2,1,"div",16),e.k0s(),e.j41(44,"div",143)(45,"label")(46,"strong"),e.EFF(47,"Reply To Email"),e.k0s(),e.j41(48,"span",14),e.EFF(49,"*"),e.k0s()(),e.nrm(50,"input",147),e.DNE(51,ji,3,2,"div",16),e.k0s()(),e.j41(52,"div",148)(53,"div",149)(54,"div",150)(55,"div",151)(56,"strong"),e.EFF(57),e.k0s()(),e.j41(58,"div",152)(59,"div",153)(60,"h4",154)(61,"strong"),e.EFF(62),e.k0s()(),e.j41(63,"h4",155),e.EFF(64),e.k0s(),e.j41(65,"h4",154),e.EFF(66),e.k0s()()()()()()()(),e.j41(67,"div",156)(68,"div",157)(69,"button",158),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.onSubmit())}),e.EFF(70,"Select Template"),e.k0s()()()()()}if(2&o){const t=e.XpG(3);e.R7$(),e.Y8G("formGroup",t.form2),e.R7$(14),e.Y8G("ngClass",e.eq3(17,k,t.submitted&&t.f1.campaignName.errors&&t.f1.campaignName.touched)),e.R7$(),e.Y8G("ngIf",t.submitted&&t.f1.campaignName.errors&&t.f1.campaignName.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(19,k,t.submitted&&t.f1.subject.errors&&t.f1.subject.touched)),e.R7$(2),e.Y8G("ngIf",t.submitted&&t.f1.subject.errors&&t.f1.subject.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(21,k,t.submitted&&t.f1.preHeader.errors&&t.f1.preHeader.touched)),e.R7$(2),e.Y8G("ngIf",t.submitted&&t.f1.preHeader.errors&&t.f1.preHeader.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(23,k,t.submitted&&t.f1.fromName.errors&&t.f1.fromName.touched)),e.R7$(2),e.Y8G("ngIf",t.submitted&&t.f1.fromName.errors&&t.f1.fromName.touched),e.R7$(7),e.Y8G("ngClass",e.eq3(25,k,t.submitted&&t.f1.replyTo.errors&&t.f1.replyTo.touched)),e.R7$(),e.Y8G("ngIf",t.submitted&&t.f1.replyTo.errors&&t.f1.replyTo.touched),e.R7$(6),e.JRh(null==(t.displayVal||t.defaultName)?null:(t.displayVal||t.defaultName).charAt(0).toUpperCase()),e.R7$(5),e.JRh(t.displayVal||t.defaultName),e.R7$(2),e.JRh(t.displayValsub||t.defaultSubName),e.R7$(2),e.JRh(t.displayValpre||t.defaultPre),e.R7$(3),e.Y8G("ngClass",t.form2.invalid?"btn-outline-primary":"btn-primary ")("disabled",t.form2.invalid)}}function wi(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",165),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG(4);return e.Njj(a.chosenTemplate(n))}),e.j41(1,"div",166),e.nrm(2,"img",167),e.j41(3,"div",24)(4,"h6",168),e.EFF(5),e.k0s()()()()}if(2&o){const t=s.$implicit,i=e.XpG(4);e.R7$(),e.Y8G("ngClass",e.eq3(3,Hn,(null==t?null:t.id)===(null==i.templateData?null:i.templateData.id))),e.R7$(),e.Y8G("src",t.thumbnail_url,e.B4B),e.R7$(3),e.JRh(t.name)}}function Pi(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",135)(1,"div",159)(2,"div",137)(3,"h5",138),e.EFF(4,"Select Template"),e.k0s()(),e.nrm(5,"span",139),e.j41(6,"div",160)(7,"div",161),e.DNE(8,wi,6,5,"div",162),e.k0s()()(),e.j41(9,"div",156)(10,"div",163)(11,"button",164),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.backtocreate())}),e.EFF(12,"BACK"),e.k0s()()()()}if(2&o){const t=e.XpG(3);e.R7$(8),e.Y8G("ngForOf",t.templateList)}}function Oi(o,s){if(1&o&&(e.j41(0,"option",179),e.EFF(1),e.k0s()),2&o){const t=s.$implicit,i=e.XpG(5);e.FS9("value",t.campaignId),e.Y8G("selected",i.selectedCampaign==t.campaignId),e.R7$(),e.SpI(" ",t.campaignName,"")}}function Si(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",180)(1,"label",172)(2,"strong"),e.EFF(3,"Number Of Rewards "),e.k0s(),e.j41(4,"span",14),e.EFF(5,"*"),e.k0s()(),e.j41(6,"input",181),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(5);return a.reward=n.target.value,e.Njj(a.onRewardInput(n.target.value))}),e.k0s()()}if(2&o){const t=e.XpG(5);e.R7$(6),e.FS9("value",t.reward)}}function Ei(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",180)(1,"label",172)(2,"strong"),e.EFF(3,"Rewards Expiry Date "),e.k0s(),e.j41(4,"span",14),e.EFF(5,"*"),e.k0s()(),e.j41(6,"input",182),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(5);return a.expiryDate=n.target.value,e.Njj(a.onExpiryInput(n.target.value))}),e.k0s()()}if(2&o){const t=e.XpG(5);e.R7$(6),e.FS9("value",t.expiryDate),e.Y8G("min",t.minDate)}}function Ii(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",135)(1,"div",159)(2,"div",137)(3,"h5",138),e.EFF(4,"Xoxoday Rewards Details"),e.k0s()(),e.nrm(5,"span",139),e.j41(6,"form")(7,"div",169)(8,"div",170)(9,"div",171)(10,"label",172)(11,"strong"),e.EFF(12,"Select Xoxoday Rewards Campaign (Optional)"),e.k0s()(),e.j41(13,"select",173),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(4);return a.xoxodayCampaignId=n.target.value,e.Njj(a.onCampaignSelected(n.target.value))}),e.j41(14,"option",174),e.EFF(15),e.k0s(),e.DNE(16,Oi,2,3,"option",175),e.k0s()(),e.DNE(17,Si,7,1,"div",176)(18,Ei,7,2,"div",176),e.k0s()()()(),e.j41(19,"div",156)(20,"div",157)(21,"button",177),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(n.xoxoDetails())}),e.EFF(22,"NEXT"),e.k0s()(),e.j41(23,"div",163)(24,"button",178),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(n.goToTemplate())}),e.EFF(25,"BACK"),e.k0s()()()()}if(2&o){const t=e.XpG(4);e.R7$(14),e.Y8G("selected",""==t.selectedCampaign),e.R7$(),e.JRh(""==t.xoxodayCampaignId?"Select Campaign Name":"Unselect 
1Campaign Name"),e.R7$(),e.Y8G("ngForOf",t.compaignlist),e.R7$(),e.Y8G("ngIf",t.selectedCampaign),e.R7$(),e.Y8G("ngIf",t.selectedCampaign),e.R7$(3),e.Y8G("disabled",!(t.xoxodayCampaignId&&t.reward&&t.expiryDate)&&t.xoxodayCampaignId)}}function Ri(o,s){if(1&o&&(e.j41(0,"div"),e.DNE(1,Ii,26,6,"div",132),e.k0s()),2&o){const t=e.XpG(3);e.R7$(),e.Y8G("ngIf",t.isxoxoDay&&!t.isUploadEmails&&!t.isSelectTemplate)}}function Ti(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",183)(1,"div",184)(2,"div",185)(3,"h4"),e.EFF(4,"Upload Email Id"),e.k0s()(),e.j41(5,"div",186)(6,"a",187),e.EFF(7,"Download Sample File"),e.k0s()()(),e.j41(8,"div",188)(9,"div",189)(10,"div",7)(11,"input",190),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.handleFileSelect(n))}),e.k0s()()()(),e.j41(12,"div",191)(13,"button",192),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.gotoxoxoday())}),e.EFF(14,"BACK"),e.k0s(),e.j41(15,"button",193),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.uploadDoc())}),e.EFF(16,"UPLOAD & SEND"),e.k0s()()()}if(2&o){const t=e.XpG(3);e.R7$(15),e.Y8G("disabled",t.disbaledFlag)}}function Ni(o,s){if(1&o&&(e.j41(0,"div",124)(1,"div",125)(2,"div",126)(3,"div",127)(4,"h3"),e.EFF(5,"Add details"),e.k0s()()(),e.nrm(6,"div",128),e.j41(7,"div",126)(8,"div",129)(9,"h3"),e.EFF(10,"Select Template"),e.k0s()()(),e.DNE(11,mi,1,3,"div",130)(12,gi,4,3,"div",131),e.k0s(),e.DNE(13,Mi,71,27,"div",132)(14,Pi,13,1,"div",132)(15,Ri,2,1,"div",89)(16,Ti,17,1,"div",133),e.k0s()),2&o){const t=e.XpG(2);e.R7$(2),e.Y8G("ngClass",e.eq3(9,P,t.submitClicked)),e.R7$(4),e.Y8G("ngClass",e.eq3(11,P,t.submitClicked)),e.R7$(),e.Y8G("ngClass",e.eq3(13,P,t.submitClicked2)),e.R7$(4),e.Y8G("ngIf",0!=t.isXoxodayEnabled),e.R7$(),e.Y8G("ngIf",0!=t.isXoxodayEnabled),e.R7$(),e.Y8G("ngIf",!t.isUploadEmails&&!t.isSelectTemplate&&!t.isxoxoDay),e.R7$(),e.Y8G("ngIf",t.isSelectTemplate&&!t.isUploadEmails&&!t.isxoxoDay),e.R7$(),e.Y8G("ngIf",0!=t.isXoxodayEnabled),e.R7$(),e.Y8G("ngIf",t.isUploadEmails&&!t.isSelectTemplate&&!t.isxoxoDay)}}function Di(o,s){if(1&o&&(e.j41(0,"section",122),e.DNE(1,Ni,17,15,"div",123),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("ngIf","AMP"==t.mediumType)}}function Gi(o,s){1&o&&(e.j41(0,"section",194)(1,"div",195)(2,"div",196)(3,"div",197)(4,"span",198),e.EFF(5,"Loading..."),e.k0s()(),e.j41(6,"strong"),e.EFF(7,"Loading..."),e.k0s()()()())}let Ai=(()=>{class o{constructor(t,i,n,a,l,c){this.toastrService=t,this.fb=i,this.formBuilder=n,this.surveyService=a,this.router=l,this.papa=c,this.userDetails=JSON.parse(localStorage.getItem("currentUser")),this.questionsList=[],this.mediumType="AMP",this.connected=!1,this.submitted=!1,this.maxRows=6,this.headersArr=[{key:"",value:"",isError:!1}],this.responseRequriedKeysArr=[{key:"",value:"",isError:!1}],this.setupResponseUrl="",this.dynamicForm=new r.gE({rows:new r.Yp([],[r.k0.required])}),this.connectSuccess=!1,this.submitted1=!1,this.pageSizes=[5,10,15,50,100],this.currentPage=0,this.page=0,this.count=0,this.pageSize=5,this.userData=JSON.parse(localStorage.getItem("currentUser")),this.test=[],this.campaignList=[],this.templateList=[],this.isCreateCampaign=!1,this.isUploadEmail=!1,this.disbaledFlag=!0,this.isUploadEmails=!1,this.showHelloSection=!1,this.displayVal="",this.displayValsub="",this.displayValpre="",this.defaultName="From Name",this.defaultSubName="Your subject line comes here",this.defaultPre="Your preheader comes here",this.submitClicked=!1,this.submitClicked2=!1,this.submitClicked3=!1,this.submitClicked4=!1,this.submitClicked5=!1,this.isSelectTemplate=!1,this.isxoxoDay=!1,this.surveyDetails={},this.campaignDetails={},this.isLoading=!1,this.showCreateCampBtn=!1,this.xoxodayCampaignId="",this.form=new r.gE({campaignname:new r.MJ(""),subjectname:new r.MJ(""),mailbody:new r.MJ("")}),this.ampFormDetails={},this.dynamicForm=this.fb.group({rows:this.fb.array([])}),this.rowCounter=new r.MJ(1);let m=new Date;m=new Date(m.getTime()+864e5),this.minDate=m.toISOString().split("T")[0],this.createLink()}ngOnInit(){this.getQuestions(),this.addRow(),this.getTriggerUrl(),this.campForm=this.fb.group({campName:["",r.k0.required],triggerUrl:[{value:"",disabled:!0},r.k0.required],triggerApiKey:[{value:"",disabled:!0},r.k0.required],triggerSecretKey:[{value:"",disabled:!0},r.k0.required],responseUrl:[""],responseApiKey:[""],responseSecretKey:[""]}),this.getUserSecretCode(),this.submitted=!1,this.getAllTemplates(),this.pageSize=this.pageSizes[0],this.campaignDetails={},this.form2=this.formBuilder.group({campaignName:["",r.k0.required],subject:["",r.k0.required],preHeader:["",r.k0.required],fromName:["",r.k0.required],replyTo:["",[r.k0.required,r.k0.pattern("[A-Za-z0-9._]{1,}@[A-Za-z]{4,}[.]{1}[a-z.]{2,6}")]]}),this.form=this.formBuilder.group({replyTo:["",[r.k0.required,r.k0.email]]}),this.getAllCampaignList(),this.getxoxodayCampginList()}
1addHeader(){this.checkValudationError(),this.headersArr.push({key:"",value:"",isError:!1})}removeHeader(t){this.headersArr.splice(t,1)}addField(){this.checkValudationError(),this.responseRequriedKeysArr.push({key:"",value:"",isError:!1})}removeField(t){this.responseRequriedKeysArr.splice(t,1)}get rows(){return this.dynamicForm.get("rows")}get f3(){return this.campForm.controls}addRow(){if(this.rowCounter.value<this.maxRows){const t=this.fb.group({question:["Select Question",r.k0.required],questionId:[null,r.k0.required],attribute:["",r.k0.required]});this.rows.push(t),this.rowCounter.setValue(this.rowCounter.value+1)}}removeRow(t){this.rows.removeAt(t),this.rowCounter.setValue(this.rowCounter.value-1),this.updateQuesEnable(t)}copyData(t){navigator.clipboard.writeText(t),this.toastrService.success("Copied")}checkValudationError(){this.connectSuccess=!1;let t=!1;if(this.headersArr.map(i=>{""==i?.key||""==i?.value?(i.isError=!1,t=!0):i.isError=!1}),t)return!1}testConnection(){let t=!1;if(this.headersArr.map(a=>{""==a?.key||""==a?.value?(a.isError=!1,t=!0):a.isError=!1}),1==this.headersArr.length){if(""==this.headersArr[0]?.key&&""!=this.headersArr[0]?.value||""!=this.headersArr[0]?.key&&""==this.headersArr[0]?.value)return this.toastrService.error("Header key and value are requried"),!1}else if(t)return this.toastrService.error("Header key and value are requried"),!1;let i=this.headersArr.map(a=>({key:a?.key,value:a?.value})),n={surveyId:localStorage.getItem("surveyId"),apiUrl:this.setupResponseUrl,headers:i};this.surveyService.setupResponse(n).subscribe(a=>{a.success?this.connectSuccess=!0:(this.connectSuccess=!1,this.toastrService.error(a.error)),console.log(a)},a=>{console.log(a),this.connectSuccess=!1,this.toastrService.error(a)})}getQuestions(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{t&&t.sections&&t.sections.length>0?(t.sections.forEach(i=>{i.questions&&i.questions.length>0&&i.questions.forEach(n=>{"Message"!==n.type&&"Image/Media"!==n.type&&this.questionsList.push(n)})}),this.surveyDetails=t,this.isXoxodayEnabled=t.isXoxodayEnabled):console.log("No sections or questions found in the response.")})}getTriggerUrl(){this.surveyService.generateUniqueLink(localStorage.getItem("surveyId")).subscribe(t=>{this.uniqueId=t.uniqueId,this.campForm.patchValue({triggerUrl:t.link})},t=>{console.log(t)})}getUserSecretCode(){this.surveyService.getUserSecretCode(this.userDetails.userId).subscribe(t=>{null!=t&&this.campForm.patchValue({triggerApiKey:t.userId,triggerSecretKey:t.secretId})},t=>{console.error(t)})}isQuestionSelected(t,i){for(let n=0;n<this.rows.length;n++)if(n!==i&&this.rows.at(n).get("questionId").value===t)return!0;return!1}updateQuesDisable(t){const i=this.dynamicForm.value.rows[t].questionId;if(i)for(let n=0;n<this.rows.length;n++)if(n!==t){const l=this.rows.at(n).get("questionId");l.value===i&&l.disable()}}updateQuesEnable(t){const i=this.rows.at(t);i.get("questionId").value&&(i.get("questionId").enable(),i.get("question").setValue(null),i.get("attribute").setValue(null))}onQuestionChange(t,i){const n=t.target.value,a=t.target.options[t.target.selectedIndex].text,l=this.rows.at(i);l.get("questionId").setValue(n),l.get("question").setValue(a)}saveCampaign(){if(this.submitted=!0,this.campForm.invalid)return;let t=!1;if(this.responseRequriedKeysArr.map(l=>{""==l?.responseRequriedKeysArr?(l.isError=!1,t=!0):l.isError=!1}),1==this.responseRequriedKeysArr.length){if(""==this.responseRequriedKeysArr[0]?.key)return this.toastrService.error("Response key are requried"),!1}else if(t)return this.toastrService.error("Response key are requried"),!1;console.log(this.dynamicForm.value);const i=this.dynamicForm.value.rows.map(l=>({question:l.question,questionId:l.questionId,attribute:l.attribute}));let n=!1;if(1==this.connectSuccess){for(let l of i)(""==l.question||""==l.attribute||null==l.questionId)&&(this.toastrService.error("Question and Attribut field is requried"),n=!0);if(n)return!1}let a={campId:this.uniqueId,surveyId:localStorage.getItem("surveyId"),campName:this.campForm.controls.campName.value,triggerUrl:this.campForm.controls.triggerUrl.value,triggerApiKey:this.campForm.controls.triggerApiKey.value,triggerSecretKey:this.campForm.controls.triggerSecretKey.value,headers:this.headersArr,isSetupResponseCollectionRequried:this.connectSuccess,responseUrl:this.setupResponseUrl,responseRequriedKeys:1==this.connectSuccess?this.responseRequriedKeysArr:[],responseApiKey:this.campForm.controls.responseApiKey.value,responseSecretKey:this.campForm.controls.responseSecretKey.value,fieldMap:i,integration:"Custom",mediumType:this.mediumType};"AMP"==this.mediumType&&(a.ampFields=this.ampFormDetails),this.surveyService.saveMoengage(a).subscribe(l=>{this.toastrService.success("Campaign saved successfully!."),this.router.navigate(["/survey/deploy-survey/integrations"]),console.log(l)},l=>{this.toastrService.error("Error: "+l)})}onChageCampignName(t){this.campForm.controls.campName.setValue(t),this.form2.controls.campaignName.setValue(t)}getValue(t){this.displayVal=t}getValuesubject(t){this.displayValsub=t}getValuePreheader(t){this.displayValpre=t}get f(){return this.form.controls}get f1(){return this.form2.controls}onSubmit(){1==this.isXoxodayEnabled?(this.submitClicked2=!0,this.submitted=!0):(this.submitClicked2=!0,this.submitClicked3=!0),!this.form2.invalid&&(this.campaignDetails={campaignName:this.form2.controls.campaignName.value,subject:this.form2.controls.subject.value,preHeader:this.form2.controls.preHeader.value,fromName:this.form2.controls.fromName.value,replyTo:this.form2.controls.replyTo.value},this.checkCampName())}resetForms(){this.form2.patchValue({campaignName:"",subject:"",preHeader:"",fromName:"",replyTo:""})}getAllCampaignList(){this.isLoading=!0,this.surveyService.getAllCampaignList(localStorage.getItem("surveyId"),this.currentPage,this.pageSize).subscribe(t=>{this.campaignList=t.data,this.count=t.count,this.isLoading=!1},t=>{console.log(t),this.isLoading=!1})}checkCampRecords(){this.surveyService.checkCampNameUnique(localStorage.getItem("surveyId"),this.campaignDetails.campaignName).subscribe(t=>{this.getAllTemplates(),this.isSelectTemplate=!0},t=>{this.toastrService.error(t)})}goToTemplate(){this.isSelectTemplate=!0,1==this.isXoxodayEnabled?(this.submitClicked3=!1,this.isxoxoDay=!1):this.submitClicked=!1,this.disbaledFlag=!0}gotoxoxoday(){this.isUploadEmails=!1,1==this.isXoxodayEnabled?(this.isxoxoDay=!0,this.xoxodayCampaignId=this.savexoxoDaydataDetail
1s.xoxodayCampaignId):this.isSelectTemplate=!0,this.submitClicked4=!1,this.disbaledFlag=!0}gotoemailpage(){}createLink(){0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():"DRAFT"==this.surveyDetails.status?this.publishsurveyModel.nativeElement.click():this.gotoCampaign()}gotoCampaign(){this.submitClicked=!0,this.submitClicked2=!1,this.submitClicked3=!1,this.submitClicked4=!1,this.submitClicked5=!1,this.displayVal="",this.displayValpre="",this.displayValsub="",this.selectedTemplate="",this.submitted=!1,this.disbaledFlag=!0,this.isUploadEmails=!1,this.isSelectTemplate=!1,this.isCreateCampaign=!this.isCreateCampaign}backtocreate(){this.isUploadEmail=!1,this.isSelectTemplate=!1,this.isCreateCampaign=this.isCreateCampaign,1==this.isXoxodayEnabled?this.submitClicked2=!1:this.submitClicked3=!1}gotoUploadEmail(){this.isUploadEmails=!this.isUploadEmails,this.resetForms()}resetForm(){this.form.patchValue({campaignName:"",mailSubject:"",mailBody:""})}handleFileSelect(t){this.disbaledFlag=!0,this.test=[];var n=t.target.files[0],a=new FileReader;a.readAsText(n),a.onload=l=>{this.papa.parse(l.target.result,{skipEmptyLines:!0,header:!0,complete:m=>{for(let d=0;d<m.data.length;d++)this.test.push({email:m.data[d].Email,firstName:m.data[d]["First Name"],lastName:m.data[d]["Last Name"]}),this.disbaledFlag=!1}})}}checkCampName(){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.campaignDetails.campaignName).subscribe(t=>{this.getAllTemplates(),this.isSelectTemplate=!0,console.log(t)},t=>{this.toastrService.error(t)})}uploadDoc(){this.campaignDetails={campaignName:this.form2.controls.campaignName.value,subject:this.form2.controls.subject.value,preHeader:this.form2.controls.preHeader.value,fromName:this.form2.controls.fromName.value,replyTo:this.form2.controls.replyTo.value},this.submitClicked5=!0;let t={campaignName:this.campaignDetails.campaignName,subject:this.campaignDetails.subject,preHeader:this.campaignDetails.preHeader,fromName:this.campaignDetails.fromName,replyTo:this.campaignDetails.replyTo,emails:[],surveyId:localStorage.getItem("surveyId"),mmApiKey:this.templateData.mmApiKey,formId:this.templateData.formId,templateName:this.selectedTemplate,templateId:this.templateData.id,isusedtemplate:this.isusedtemplate,triggerURL:localStorage.getItem("triggerURL"),xoxodayCampaignId:null,xoxodayLink_expiry:null,isXoxodayEnabled:null,xoxodayNoOfRewards:null,isCustomAMP:!0};0==this.isXoxodayEnabled?(t.xoxodayCampaignId="",t.xoxodayLink_expiry="",t.xoxodayNoOfRewards=""):(t.xoxodayCampaignId=this.savexoxoDaydataDetail
1s.xoxodayCampaignId,t.xoxodayLink_expiry=this.savexoxoDaydataDetails.xoxodayLink_expiry,t.isXoxodayEnabled=this.savexoxoDaydataDetails.isXoxodayEnabled,t.xoxodayNoOfRewards=this.savexoxoDaydataDetails.xoxodayNoOfRewards),this.ampFormDetails=t}handlePageChange(t){1===t?(this.page=t,this.currentPage=t-1):t>1&&(this.page=t,this.currentPage=this.pageSize*(t-1)),this.getAllCampaignList()}handlePageSizeChange(){this.pageSize=this.pageSize,this.page=1,this.currentPage=0,this.getAllCampaignList()}getAllTemplates(){this.surveyService.getAmpTemplates(this.userData.userId).subscribe(t=>{this.templateList=t},t=>{console.log(t)})}chosenTemplate(t){this.templateData=t,this.isusedtemplate=!0,this.selectedTemplate=this.templateData.name,this.uploadDoc()}selectTemplate(){this.isSelectTemplate=!this.isSelectTemplate,1==this.isXoxodayEnabled?(this.isxoxoDay=!0,this.submitClicked3=!0):(this.isUploadEmails=!0,this.submitClicked4=!0,this.submitClicked3=!0)}updateStatus(t){if(t){let i={id:localStorage.getItem("surveyId"),is_published:!0};this.surveyService.updateSurveyStatus(i).subscribe(n=>{this.toastrService.success("Survey Published sucessfully."),this.gotoCampaign()},n=>{console.error(n)})}}refreshButton(){this.ngOnInit()}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}getxoxodayCampginList(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.getxoxodayCampginList(t.userId).subscribe(i=>{this.compaignlist=i&&i.data&&i.data.campaignList&&i.data.campaignList.data?i.data.campaignList.data:[]},i=>{console.log(i)})}formatDate(t){const i=new Date(t),n=i.getDate(),a=i.getMonth()+1,l=i.getFullYear();return`${n.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}-${l}`}xoxoDetails(){this.submitClicked4=!0,this.isUploadEmails=!0;let t={xoxodayCampaignId:this.xoxodayCampaignId,xoxodayNoOfRewards:this.reward,isXoxodayEnabled:!0,xoxodayLink_expiry:this.formatDate(this.expiryDate),surveyId:this.surveyID};
1this.savexoxoDaydataDetails=t,this.isxoxoDay=!this.isxoxoDay}onCampaignSelected(t){this.selectedCampaign=t,""===t?(this.selectedCampaign="",this.reward=null,this.expiryDate=null):this.selectedCampaign=t}onRewardInput(t){this.reward=parseInt(t)||null}onExpiryInput(t){this.expiryDate=t}backtoselecttemplate(){this.isUploadEmail=!1,this.isSelectTemplate=!0,this.isCreateCampaign=!1,this.submitClicked2=!1,this.isxoxoDay=!1}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(x.tw),e.rXU(r.ok),e.rXU(r.ok),e.rXU(b.I),e.rXU(g.Ix),e.rXU(I.F))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-custom-integration"]],viewQuery:function(i,n){if(1&i&&(e.GBs(Jn,7),e.GBs(Wn,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first)}},decls:136,vars:18,consts:[["discardChangesModal",""],["closeModal",""],["publishsurveyModel",""],["questioncoutzeroModel",""],["box2",""],["box3",""],["box",""],[1,"col-sm-12"],[1,"col-sm-12","row","pt-4","px-0"],["src","../../../../../assets/img/integration.png","height","30","width","30","alt","MoEngage Logo",1,"logo","m-0",2,"border-radius","6px"],[1,"ml-3","mt-1","mb-0"],[3,"formGroup"],[1,"form-group","col-sm-12","mt-4","px-0"],[1,"col-form-label"],[1,"text-danger"],["type","text","formControlName","campName","required","","placeholder","Enter campaign name","maxlength","20",1,"form-control","shadow-sm","pl-4",3,"input","ngClass"],["class","invalid-feedback",4,"ngIf"],["id","accordionExample",1,"accordion","col-sm-12","mt-4","mb-3","px-0"],[1,"card","shadow-sm"],["id","headingOne","data-bs-toggle","collapse","data-bs-target","#collapseOne","aria-expanded","true","aria-controls","collapseOne",1,"card-header","bg-white"],[1,"mb-0"],[1,"col-sm-12","px-0","btn","btn-block","text-left"],[1,"fas","fa-chevron-down","float-right"],["id","collapseOne","aria-labelledby","headingOne","data-parent","#accordionExample",1,"collapse"],[1,"card-body"],[1,"form-group","row"],["for","url",1,"col-sm-2","mb-3","pl-5","col-form-label"],[1,"col-sm-10","position-relative"],["type","text","formControlName","triggerUrl","placeholder","Unique link goes here",1,"form-control","pr-5","bg-white"],[1,"copy-icon",2,"background-image","url('../../../../../../assets/icons/copy-svgrepo-com 1.svg')",3,"click"],["for","apiKey",1,"col-sm-2","pl-5","mb-3","col-form-label"],[1,"col-sm-10"],["type","text","formControlName","triggerApiKey",1,"form-control","bg-white"],["for","secretKey",1,"col-sm-2","pl-5","mb-3","col-form-label"],["type","password","formControlName","triggerSecretKey",1,"form-control","bg-white"],["id","accordionExample",1,"accordion","col-sm-12","mb-3","px-0"],["id","headingTwo","data-bs-toggle","collapse","data-bs-target","#collapseTwo","aria-expanded","true","aria-controls","collapseTwo",1,"card-header","bg-white"],["id","collapseTwo","aria-labelledby","headingTwo","data-parent","#accordionExample",1,"collapse"],[1,"col-sm-12","row","m-0","mb-3"],[1,"col-sm-2","px-0"],[1,"headers"],["type","text","required","","placeholder","Enter URL here",1,"form-control",3,"input","value","ngClass"],[1,"col-sm-12","p-0"],[1,"col-sm-12","px-0","m-0","row","mb-3"],[1,"col-sm-5"],[1,"col-sm-7"],["class","col-sm-12 px-0 m-0 row mb-3",4,"ngFor","ngForOf"],[1,"col-sm-12","text-right","px-0","mt-4"],["type","button","class","btn btn-primary","placement","top",3,"disabled","click",4,"ngIf"],["class","mb-0","style","color:#1FAD08;",4,"ngIf"],["class","accordion col-sm-12 mb-3 px-0","id","accordionExample",4,"ngIf"],["class","accordion col-sm-12 mb-3 px-0","id","accordionExample11",4,"ngIf"],["id","headingMType","data-bs-toggle","collapse","data-bs-target","#collapseheadingMType","aria-expanded","true","aria-controls","collapseheadingMType",1,"card-header","bg-white"],[1,"col-sm-12","btn","btn-block","text-left"],["id","collapseheadingMType","aria-labelledby","headingMType","data-parent","#accordionExample",1,"collapse"],[1,"col-sm-12","mb-3","row","m-0"],[1,"col-sm-3","p-0"],[1,"radio-item"],["type","radio","id","ritemd","name","ritem","value","AMP",3,"change","checked"],["for","ritemd"],["style","padding: 0px;",4,"ngIf"],["type","button","data-bs-toggle","modal","data-bs-target","#discardChangesMo
1dal",1,"btn","btn-primary","d-none"],["id","discardChangesModal","data-bs-backdrop","static","data-bs-keyboard","false","tabindex","-1","aria-labelledby","discardChangesModalLabel","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered","modal-lg"],[1,"modal-content","bg-white"],[1,"modal-body"],[1,"py-4","text-danger","text-center"],[1,"pb-4","text-center"],[1,"col-sm-12","text-center","py-3"],["id","closeModal","data-bs-dismiss","modal",1,"btn","btn-outline-primary","text-uppercase","btn1","ml-1","mr-4"],["id","closeModal","data-bs-dismiss","modal",1,"btn","btn-danger","text-uppercase","ml-4","btn4"],["data-bs-toggle","modal","data-bs-target","#publishSurvy",2,"display","none"],["id","publishSurvy","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal-dialog-centered"],[1,"modal-content","formWrapper","noBg","bg-white"],[1,"modal-body","d-flex","flex-column","py-4","justify-content-between","align-items-center","py-5"],["className","btn-outline-primary text-uppercase btnClose mr-1","btnLabel","close","data-bs-dismiss","modal",3,"click"],["className","btn-primary text-uppercase ml-2","btnLabel","Publish","data-bs-dismiss","modal",3,"click"],["style","height: 40vh;display: flex;",4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#questioncoutzero",2,"display","none"],["id","questioncoutzero","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"py-4","text-center"],[1,"text-center","pb-4"],["className","btn-outline-primary mr-3","btnLabel","MY DASHBOARD","data-bs-dismiss","modal",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary","text-uppercase",3,"click"],[1,"py-4","text-right"],["type","button","data-bs-dismiss","modal","routerLink","/survey/deploy-survey/integrations",1,"btn","btn-outline-primary","mx-2","px-4"],["type","submit","id","submit-btn",1,"btn","btn-primary","mx-1","px-4",3,"click","disabled"],[1,"invalid-feedback"],[4,"ngIf"],["type","text","required","","placeholder","Enter key here",1,"form-control",3,"input","value","ngClass"],[1,"col-sm-6"],["type","text","required","","placeholder","Enter value here",1,"form-control",3,"input","ngClass","value"],[1,"col-sm-1","px-0","d-flex"],["class","fal fa-minus-circle icon-md m-auto","type","button",3,"click",4,"ngIf"],["class","fal fa-plus-circle icon-md m-auto","type","button",3,"click",4,"ngIf"],["type","button",1,"fal","fa-minus-circle","icon-md","m-auto",3,"click"],["type","button",1,"fal","fa-plus-circle","icon-md","m-auto",3,"click"],["type","button","placement","top",1,"btn","btn-primary",3,"click","disabled"],[1,"mb-0",2,"color","#1FAD08"],["id","headingThree","data-bs-toggle","collapse","data-bs-target","#collapseThree","aria-expanded","true","aria-controls","collapseThree",1,"card-header","bg-white"],[2,"color","#807F7F","display","inline","font-size","15px","margin-left","10px"],["id","collapseThree","aria-labelledby","headingThree","data-parent","#accordionExample",1,"collapse"],["formArrayName","rows"],["class","col-sm-12 row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"col-sm-12","row",3,"formGroupName"],[1,"col-sm-6","mb-3"],["formControlName","questionId",1,"form-control",3,"change"],["value","null"],[3,"value","disabled",4,"ngFor","ngForOf"],[1,"col-sm-5","mb-3"],["type","text","formControlName","attribute","maxlength","20","placeholder","Enter attribute name",1,"form-control"],[1,"col-sm-1","mb-3","d-flex"],["style","margin: 10px;",4,"ngIf"],[3,"value","disabled"],[2,"margin","10px"],["type","button",1,"fal","fa-minus-circle","icon-md",3,"click"],["type","button",1,"fal","fa-plus-circle","icon-md",3,"click"],["id","accordionExample11",1,"accordion","col-sm-12","mb-3","px-0"],["id","headingThreeqq","data-bs-toggle","collapse","data-bs-target","#collapseThree1","aria-expanded","true","aria-controls","collapseThree1",1,"card-header","bg-white"],["id","collapseThree1","aria-labelledby","headingThreeqq","data-parent","#accordionExample11",1,"collapse"],[1,"col-sm-11"],[2,"padding","0px"],["class","col-sm-12 px-0",4,"ngIf"],[1,"col-sm-12","px-0"],[1,"container","d-flex","justify-content-center","row","pb-5",2,"display","none !important"],["id","add-details",1,"circles","text-center","m-2",3,"ngClass"],[1,"row","mt-4",2,"margin-left","-17px"],["id","add-details",1,"line",3,"ngClass"],[1,"row","mt-4",2,"margin-left","-30px"],["class","line","id","add-details",3,"ngClass",4,"ngIf"],["class","circles text-center m-2","id","add-details",3,"ngClass",4,"ngIf"],["class","",4,"ngIf"],["class","fisrt row px-0 py-3 px-2",4,"ngIf"],[1,"row","mt-4",2,"margin-left","-25px"],[1,""],[1,"col-sm-12","p-0","m-p","bg-body","rounded"],[1,"col-sm-12","pt-3","px-4","header","p-0"],[1,"m-0"],[1,"col-sm-12","border","border-grey"],[1,"col-sm-12","row","m-0","px-0"],[1,"form-group","px-2","d-none"],["type","text","formControlName","campaignName","required","","placeholder","Campaign - 24-03-2023 - 11:12",1,"form-control",3,"input","ngClass"],[1,"form-group","px-2"],["type","text","formControlName","subject","required","","placeholder","Add an intriguing subject line",1,"form-control",3,"input","ngClass"],["type","text","formControlName","preHeader","required","","placeholder","A preheader comes after the subject line, Use it to explain m..",1,"form-control",3,"input","ngClass"],["type","text","formControlName","fromName","required","","placeholder","Example: Sumit from Merren",1,"form-control",3,"input","ngClass"],["type","text","formControlName","replyTo","required","","placeholder","Email for users to reply back. Example:[email protected]",1,"form-control",3,"ngClass"],[1,"col-sm-6","cardheader","px-0"],[1,"align-self-center","card1","col-sm-12","px-0","d-flex"],[1,"col-sm-12","row","cardinfom","mx-3","my-auto"],[1,"col-sm-2","m-0","circlef","text-center"],[1,"col-sm-10","p-0"],[1,"col-sm-12","pl-4"],[1,"m-0","details"],[1,"m-0","details","pt-1"],[1,"col-sm-12","d-flex","flex-row-reverse","p-0","mt-4"],[1,"form-group","pl-3"],["type","submit","id","submit-btn",1,"btn",3,"click","ngClass","disabled"],[1,"col-sm-12","shadow","p-0","m-p","bg-body","rounded"],[1,"container","mx-auto","mt-4"],[1,"row"],["class","col-md-3 mb-4",3,"click",4,"ngFor","ngForOf"],[1,"pl-3"],[1,"btn","btn-outline-primary","pl-3",3,"click"],[1,"col-md-3","mb-4",3,"click"],[1,"card","card-template","h-100",3,"ngClass"],["alt","Template Image",1,"card-img-top",2,"height","200px","object-fit","cover",3,"src"],[1,"card-title","mb-0"],[1,"col-sm-12","row"],[1,"col-sm-6","py-2"],[1,"col-md-12","text-left","mb-3","px-3"],["for","exampleFormControlSelect1"],["id","exampleFormControlSelect1",1,"form-control",3,"change"],["value","",3,"selected"],[3,"value","selected",4,"ngFor","ngForOf"],["class","form-group text-left col-sm-12",4,"ngIf"],["type","submit","id","submit-btn",1,"btn","btn-primary",3,"click","disabled"],["type","submit",1,"btn","btn-outline-primary","pl-3",3,"click"],[3,"value","selected"],[1,"form-group","text-left","col-sm-12"],["type","number","id","Title","aria-describedby","Title","placeholder","Rewards","pattern","[0-9]*","onkeypress","return event.charCode >= 48 && event.charCode <= 57",1,"form-control",2,"height","46px",3,"input","value"],["type","date","id","Title","aria-describedby","Title","placeholder","Rewards",1,"form-control",2,"height","46px",3,"input","value","min"],[1,"fisrt","row","px-0","py-3","px-2"],[1,"col-sm-12","d-flex","py-3","px-0"],[1,"col-sm-4","px-0"],[1,"col-sm-8","text-right","px-0","text-primary"],["href","https://merrenbucket.s3.ap-south-1.amazonaws.com/amp_sample/amp-email_samplefile.csv","target","blank",2,"text-align","right"],[1,"col-sm-12","p-3","upload"],[1,"col-sm-12","cover"],["type","file","accept",".csv",2,"font-size","16px",3,"change"],[1,"col-sm-12","text-right","py-5","px-0"],["type","button","placement","top",1,"btn1","btn","btn-outline-primary","mr-2","p-2",3,"click"],["placement","top",1,"btn3","btn","btn-primary","ml-2","p-2",3,"click","disabled"],[2,"height","40vh","display","flex"],[1,"m-auto"],["
1id","",1,"d-flex","flex-column","justify-content-center","align-items-center"],["role","status",1,"spinner-grow","mb-2"],[1,"sr-only"]],template:function(i,n){if(1&i){const a=e.RV6();e.j41(0,"div",7)(1,"div",8),e.nrm(2,"img",9),e.j41(3,"h5",10),e.EFF(4,"Custom"),e.k0s()()(),e.j41(5,"form",11)(6,"div",12)(7,"label",13),e.EFF(8,"Campaign Name"),e.j41(9,"span",14),e.EFF(10,"*"),e.k0s()(),e.j41(11,"input",15),e.bIt("input",function(c){return e.eBV(a),e.Njj(n.onChageCampignName(c.target.value))}),e.k0s(),e.DNE(12,Qn,2,1,"div",16),e.j41(13,"div",17)(14,"div",18)(15,"div",19)(16,"h2",20)(17,"div",21),e.EFF(18," Setup Trigger "),e.nrm(19,"i",22),e.k0s()()(),e.j41(20,"div",23)(21,"div",24)(22,"div",25)(23,"label",26)(24,"strong"),e.EFF(25,"URL"),e.k0s()(),e.j41(26,"div",27),e.nrm(27,"input",28),e.j41(28,"span",29),e.bIt("click",function(){return e.eBV(a),e.Njj(n.copyData(n.campForm.get("triggerUrl").value))}),e.k0s()(),e.j41(29,"label",30)(30,"strong"),e.EFF(31,"API Key"),e.k0s()(),e.j41(32,"div",31),e.nrm(33,"input",32),e.j41(34,"span",29),e.bIt("click",function(){return e.eBV(a),e.Njj(n.copyData(n.campForm.get("triggerApiKey").value))}),e.k0s()(),e.j41(35,"label",33)(36,"strong"),e.EFF(37,"Secret Key"),e.k0s()(),e.j41(38,"div",31),e.nrm(39,"input",34),e.j41(40,"span",29),e.bIt("click",function(){return e.eBV(a),e.Njj(n.copyData(n.campForm.get("triggerSecretKey").value))}),e.k0s()()()()()()(),e.j41(41,"div",35)(42,"div",18)(43,"div",36)(44,"h2",20)(45,"div",21),e.EFF(46," Setup Response Collection (Optional) "),e.nrm(47,"i",22),e.k0s()()(),e.j41(48,"div",37)(49,"div",24)(50,"div",38)(51,"div",39)(52,"h5",40),e.EFF(53,"URL"),e.k0s()(),e.j41(54,"div",31)(55,"input",41),e.bIt("input",function(c){return e.eBV(a),n.setupResponseUrl=c.target.value,e.Njj(n.connectSuccess=!1)}),e.k0s()()(),e.j41(56,"div",42)(57,"div",43)(58,"div",44)(59,"h5",40),e.EFF(60,"Header Key"),e.k0s()(),e.j41(61,"div",45)(62,"h5",40),e.EFF(63,"Header Value"),e.k0s()()(),e.DNE(64,ti,8,10,"div",46),e.k0s(),e.j41(65,"div",47),e.DNE(66,ni,2,1,"button",48)(67,ii,2,0,"p",49),e.k0s()()()()(),e.DNE(68,li,14,2,"div",50)(69,ui,15,1,"div",51),e.j41(70,"div",17)(71,"div",18)(72,"div",52)(73,"h2",20)(74,"div",53),e.EFF(75," Select Type "),e.nrm(76,"i",22),e.k0s()()(),e.j41(77,"div",54)(78,"div",24)(79,"div",55)(80,"div",56)(81,"div",57)(82,"input",58),e.bIt("change",function(){return e.eBV(a),n.mediumType="AMP",e.Njj(n.createLink())}),e.k0s(),e.j41(83,"label",59),e.EFF(84,"AMP"),e.k0s()()()(),e.DNE(85,Di,2,1,"section",60),e.j41(86,"button",61,0),e.EFF(88," Discard Changes "),e.k0s(),e.j41(89,"div",62)(90,"div",63)(91,"div",64)(92,"div",65)(93,"h3",66),e.EFF(94," Are you sure? "),e.k0s(),e.j41(95,"h4",67),e.EFF(96,"Do you want to discard some unsaved changes?"),e.k0s(),e.j41(97,"div",68)(98,"button",69,1),e.EFF(100," CANCEL "),e.k0s(),e.j41(101,"button",70,1),e.EFF(103," DISCARD "),e.k0s()()()()()(),e.nrm(104,"a",71,2),e.j41(106,"div",72)(107,"div",73)(108,"div",74)(109,"div",75)(110,"h5",67),e.EFF(111,"Are you sure, you want to Publish this Survey?"),e.k0s(),e.j41(112,"div")(113,"app-button",76),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.k0s(),e.j41(114,"app-button",77,1),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!0))}),e.k0s()()()()()(),e.DNE(116,Gi,8,0,"section",78),e.nrm(117,"a",79,3),e.j41(119,"div",80)(120,"div",73)(121,"div",74)(122,"div",81)(123,"h5"),e.EFF(124,"Survey looks empty."),e.k0s(),e.j41(125,"h5"),e.EFF(126,"Please add question to publish the survey."),e.k0s()(),e.j41(127,"div",82)(128,"app-button",83),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!0))}),e.k0s(),e.j41(129,"button",84),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!1))}),e.EFF(130,"Add Questions"),e.k0s()()()()()()()()(),e.j41(131,"div",85)(132,"button",86),e.EFF(133,"Cancel"),e.k0s(),e.j41(134,"button",87),e.bIt("click",function(){return e.eBV(a),e.Njj(n.saveCampaign())}),e.EFF(135,"Save"),e.k0s()()()()}2&i&&(e.R7$(5),e.Y8G("formGroup",n.campForm),e.R7$(6),e.Y8G("ngClass",e.eq3(14,k,n.submitted&&n.f3.campName.errors&&n.f3.campName.touched)),e.R7$(),e.Y8G("ngIf",n.submitted&&n.f3.campName.errors&&n.f3.campName.touched),e.R7$(43),e.FS9("value",n.setupResponseUrl),e.Y8G("ngClass",e.eq3(16,k,n.submitted&&n.f3.responseUrl.errors)),e.R7$(9),e.Y8G("ngForOf",n.headersArr),e.R7$(2),e.Y8G("ngIf",!n.connectSuccess),e.R7$(),e.Y8G("ngIf",n.connectSuccess),e.R7$(),e.Y8G("ngIf",n.connectSuccess),e.R7$(),e.Y8G("ngIf",n.connectSuccess),e.R7$(13),e.Y8G("checked","AMP"==n.mediumType),e.R7$(3),e.Y8G("ngIf",!n.isLoading),e.R7$(31),e.Y8G("ngIf",n.isLoading),e.R7$(18),e.Y8G("disabled",n.campForm.invali
1d||"AMP"==n.mediumType&&(n.form2.invalid||!n.selectedTemplate)))},dependencies:[p.YU,p.Sq,p.bT,g.Wk,R.Q,r.qT,r.xH,r.y7,r.me,r.wz,r.BC,r.cb,r.YS,r.tU,r.cV,r.j4,r.JD,r.$R,r.v8],styles:['.logo[_ngcontent-%COMP%]{display:block;margin:0 auto;border-radius:10px}.copy-icon[_ngcontent-%COMP%]{position:absolute;top:35%;right:35px;transform:translateY(-50%);width:15px;height:15px;background-size:contain;background-repeat:no-repeat;cursor:pointer}.icon-md[_ngcontent-%COMP%]{font-size:20px}.radio-item[_ngcontent-%COMP%]{display:inline-block;position:relative;padding:0 6px;margin:10px 0 0}.radio-item[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]{display:none}.radio-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{color:#000;font-weight:600}.radio-item[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]:before{content:" ";display:inline-block;position:relative;top:5px;margin:0 5px 0 0;width:20px;height:20px;border-radius:11px;border:2px solid var(--secondaryColor);background-color:transparent}.radio-item[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{border-radius:11px;width:12px;height:12px;position:absolute;top:9px;left:10px;content:" ";display:block;background:var(--secondaryColor)}.header[_ngcontent-%COMP%]{border-bottom:1px solid dark}.cardheader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.card1[_ngcontent-%COMP%]{width:450px;height:180px;background-image:url(https://merrenbucket.s3.ap-south-1.amazonaws.com/background-image.png);background-size:100%;background-repeat:no-repeat}.btn1[_ngcontent-%COMP%]{padding-top:160px}.cardinfom[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.card2[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;border:1px solid dark;background-color:#fff;height:80px}.text-danger[_ngcontent-%COMP%]{font-size:larger;padding-left:4px}label[_ngcontent-%COMP%]{font-weight:500;font-family:Lato;font-size:14px}.headers[_ngcontent-%COMP%]{font-size:16px;font-weight:600}.details[_ngcontent-%COMP%]{font-weight:400;font-family:Lato;font-size:13px;color:#000;overflow-wrap:break-word;white-space:pre-wrap}.details2[_ngcontent-%COMP%]{font-weight:400;font-family:Lato;font-size:11px;color:#000;overflow-wrap:break-word;white-space:pre-wrap;padding-top:3px}.upload[_ngcontent-%COMP%]{border:.5px solid grey;border-radius:5px}.circle[_ngcontent-%COMP%]{background-color:#f69522;border-radius:50%}.container[_ngcontent-%COMP%]{display:flex}.circles[_ngcontent-%COMP%]{width:15px;height:15px;border-radius:50%;background-color:#d5d5d8}.line[_ngcontent-%COMP%]{width:160px;height:3px;background-color:#d5d5d8;align-self:center}.mat-mdc-form-field[_ngcontent-%COMP%]{margin-top:16px}th[_ngcontent-%COMP%]{color:#666;font-family:Lato;font-size:14px;font-weight:400}tr[_ngcontent-%COMP%]{border-radius:5px}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0 5px}table[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{vertical-align:baseline;text-align:left}table[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{vertical-align:middle;text-align:left;padding-top:15px;padding-bottom:15px;font-family:Lato;font-size:12px;font-weight:600}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:first-child{border-top-left-radius:5px;border-bottom-left-radius:5px}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{border-top-right-radius:5px;border-bottom-right-radius:5px}.submit-clicked[_ngcontent-%COMP%]{background-color:#f69522}.submit-clicked2[_ngcontent-%COMP%]{background-color:gray}.circles[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{display:inline-block;font-size:12px;font-weight:600;margin:0;padding:0;white-space:nowrap}.circlef[_ngcontent-%COMP%]{height:62px;background-color:#5bdfb0;border-radius:50%;color:#fff;padding-top:20px}.header[_ngcontent-%COMP%]{white-space:nowrap;font-size:18px;font-weight:600;font-family:Lato}.primary-color[_ngcontent-%COMP%]{color:#007bff}input[_ngcontent-%COMP%]::-webkit-input-placeholder{font-size:12px}.card-template[_ngcontent-%COMP%]{cursor:pointer!important}.card-template[_ngcontent-%COMP%]:hover{box-shadow:0 .5rem 1rem #0000001a;cursor:pointer!important;color:#f79522;text-decoration:none}.selected[_ngcontent-%COMP%]{outline:3px solid #F69522;outline-offset:-3px;border-radius:5px}.details[_ngcontent-%COMP%]{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:95%}']})}return o}
1)();var L=h(7482);const Vi=["publishsurveyModel"],Li=["uploadModel"],$i=["questioncoutzeroModel"],Bi=["confirmationModal"],Xi=o=>({selected:o}),zi=(o,s,t)=>({totalItems:o,itemsPerPage:s,currentPage:t});function Yi(o,s){if(1&o){const t=e.RV6();e.j41(0,"section")(1,"div",23)(2,"knit-auth",24),e.bIt("onNewSession",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onNewSession())})("onFinish",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.onFinish(n))})("onDeactivate",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.onDeactivate(n))})("onKnitClose",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.onKnitClose(n))}),e.j41(3,"button",25),e.EFF(4),e.k0s()()()()}if(2&o){const t=e.XpG();e.R7$(2),e.Y8G("authSessionToken",t.token),e.R7$(2),e.SpI("Integrate with ",t.crmType,"")}}function qi(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",52),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG(4);return e.Njj(a.removecondition(n))}),e.k0s()}}function Ui(o,s){if(1&o&&(e.j41(0,"div",46)(1,"div",34)(2,"label",35),e.EFF(3,"Fields"),e.k0s(),e.nrm(4,"ng-select",47),e.k0s(),e.j41(5,"div",34)(6,"label",35),e.EFF(7,"Operator"),e.k0s(),e.nrm(8,"ng-select",48),e.k0s(),e.j41(9,"div",34)(10,"label",35),e.EFF(11,"Value"),e.k0s(),e.nrm(12,"input",49),e.k0s(),e.j41(13,"div",50),e.DNE(14,qi,1,0,"i",51),e.k0s()()),2&o){const t=s.index,i=e.XpG(4);e.Y8G("formGroupName",t),e.R7$(4),e.Y8G("items",i.fieldsArr)("clearable",!1)("searchable",!1),e.R7$(4),e.Y8G("items",i.operator)("clearable",!1)("searchable",!1),e.R7$(6),e.Y8G("ngIf",i.SalceForceForm.controls.Condition.controls.length>1)}}function Ji(o,s){if(1&o){const t=e.RV6();e.j41(0,"a",53),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(n.addCondition())}),e.EFF(1,"+ Add condition"),e.k0s()}}function Wi(o,s){if(1&o&&e.EFF(0),2&o){const t=s.item;e.SpI(" ",t.displayName?t.displayName:t.phone," ")}}function Hi(o,s){if(1&o&&e.EFF(0),2&o){const t=s.item;e.SpI(" ",t.displayName?t.displayName:t.phone," ")}}function Ki(o,s){if(1&o&&(e.j41(0,"div",34)(1,"label",35),e.EFF(2,"Send Survey From"),e.k0s(),e.j41(3,"ng-select",54),e.DNE(4,Wi,1,1,"ng-template",55)(5,Hi,1,1,"ng-template",56),e.k0s()()),2&o){const t=e.XpG(4);e.R7$(3),e.Y8G("items",t.phoneNumbersArr)("clearable",!1)("searchable",!1)}}function Qi(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",31)(1,"h6",32),e.EFF(2,"Event"),e.k0s(),e.j41(3,"div",33)(4,"div",34)(5,"label",35),e.EFF(6,"Choose Object"),e.k0s(),e.j41(7,"ng-select",36),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(3);return a.getcrmFields(null==n?null:n.value),a.selectedType=null==n?null:n.value,e.Njj(a.onSalesForceObject(null==n?null:n.value))}),e.k0s()(),e.j41(8,"div",34)(9,"label",35),e.EFF(10,"Choose Action"),e.k0s(),e.j41(11,"ng-multiselect-dropdown",37),e.bIt("onSelect",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.onItemSelect(n))})("onSelectAll",function(n){e.eBV(t);const a=e.XpG(3);return e.Njj(a.onSelectAll(n))}),e.k0s()()(),e.j41(12,"h6",38),e.EFF(13,"Condition"),e.k0s(),e.j41(14,"div",39),e.DNE(15,Ui,15,8,"div",40)(16,Ji,2,0,"a",41),e.k0s(),e.j41(17,"h6",38),e.EFF(18,"Send Survey"),e.k0s(),e.j41(19,"div",33)(20,"div",34)(21,"label",35),e.EFF(22),e.k0s(),e.j41(23,"ng-select",42),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(3);return a.showPhoneNumberDropdown="WhatsApp"===n,a.showEmailDetails="Email"===n,e.Njj(a.SelectTemplate="Email"===n)}),e.k0s()(),e.DNE(24,Ki,6,3,"div",43),e.k0s(),e.j41(25,"div",44)(26,"button",45),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.nextcard())}),e.EFF(27,"Next"),e.k0s()()()}if(2&o){const t=e.XpG(3);e.Y8G("formGroup",t.SalceForceForm),e.R7$(7),e.Y8G("items",t.eventsArr)("clearable",!1)("searchable",!1),e.R7$(4),e.Y8G("placeholder","Choose the Action")("settings",t.dropdownSettings)("data",t.actionOptions),e.R7$(4),e.Y8G("ngForOf",t.SalceForceForm.controls.Condition.controls),e.R7$(),e.Y8G("ngIf",2!=t.SalceForceForm.controls.Condition.controls.length),e.R7$(6),e.JRh(t.selectedObjectTitle),e.R7$(),e.Y8G("items",t.object)("clearable",!1)("searchable",!1),e.R7$(),e.Y8G("ngIf",t.showPhoneNumberDropdown),e.R7$(2),e.Y8G("disabled",t.SalceForceForm.invali
1d)}}function Zi(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",31)(1,"div",33)(2,"div")(3,"div",59)(4,"label",35),e.EFF(5,"Subject Line "),e.j41(6,"span",60),e.EFF(7,"*"),e.k0s()(),e.j41(8,"input",61,2),e.bIt("input",function(){e.eBV(t);const n=e.sdS(9),a=e.XpG(4);return e.Njj(a.getValuesubject(n.value))}),e.k0s()(),e.j41(10,"div",59)(11,"label",35),e.EFF(12,"Pre-header Text "),e.j41(13,"span",60),e.EFF(14,"*"),e.k0s()(),e.j41(15,"input",62,3),e.bIt("input",function(){e.eBV(t);const n=e.sdS(16),a=e.XpG(4);return e.Njj(a.getValuePreheader(n.value))}),e.k0s()(),e.j41(17,"div",59)(18,"label",35),e.EFF(19,"From Name "),e.j41(20,"span",60),e.EFF(21,"*"),e.k0s()(),e.j41(22,"input",63,4),e.bIt("input",function(){e.eBV(t);const n=e.sdS(23),a=e.XpG(4);return e.Njj(a.getValue(n.value))}),e.k0s()(),e.j41(24,"div",34)(25,"label",35),e.EFF(26,"Reply To Email "),e.j41(27,"span",60),e.EFF(28,"*"),e.k0s()(),e.nrm(29,"input",64),e.k0s()(),e.j41(30,"div",65)(31,"div",66)(32,"div",67)(33,"div",68)(34,"strong"),e.EFF(35),e.k0s()(),e.j41(36,"div",69)(37,"div",70)(38,"h4",71)(39,"strong"),e.EFF(40),e.k0s()(),e.j41(41,"h4",72),e.EFF(42),e.k0s(),e.j41(43,"h4",71),e.EFF(44),e.k0s()()()()()()(),e.j41(45,"div",44)(46,"button",45),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(n.salesDetails())}),e.EFF(47,"Next"),e.k0s()()()}if(2&o){const t=e.XpG(4);e.Y8G("formGroup",t.form2),e.R7$(35),e.JRh(null==(t.displayVal||t.defaultName)?null:(t.displayVal||t.defaultName).charAt(0).toUpperCase()),e.R7$(5),e.JRh(t.displayVal||t.defaultName),e.R7$(2),e.JRh(t.displayValsub||t.defaultSubName),e.R7$(2),e.JRh(t.displayValpre||t.defaultPre),e.R7$(2),e.Y8G("disabled",t.form2.invalid)}}function eo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",57)(1,"div",27),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.EmailDetVisible())}),e.j41(2,"span",28),e.EFF(3,"Email Details"),e.k0s(),e.nrm(4,"i",58),e.k0s(),e.DNE(5,Zi,48,6,"div",29),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(5),e.Y8G("ngIf",t.EmailVisible)}}function to(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",83)(1,"div",84),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG(5);return e.Njj(a.chosenTemplate(n))}),e.j41(2,"div",85)(3,"div",86),e.nrm(4,"img",87),e.k0s(),e.j41(5,"div",88)(6,"h6",89),e.EFF(7),e.k0s()()()()()}if(2&o){const t=s.$implicit,i=e.XpG(5);e.R7$(),e.Y8G("ngClass",e.eq3(3,Xi,t===i.templateData)),e.R7$(3),e.Y8G("src",t.thumbnail_url,e.B4B),e.R7$(3),e.JRh(t.name)}}function no(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",74)(1,"div",75),e.DNE(2,to,8,5,"div",76),e.j41(3,"div",77)(4,"div",78),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(!n.isRequestCreated&&n.requestMoreTemplates())}),e.j41(5,"div",79)(6,"h1",80),e.EFF(7,"+"),e.k0s()(),e.j41(8,"div",81)(9,"h6",82),e.EFF(10),e.k0s()()()()(),e.j41(11,"div",44)(12,"button",45),e.bIt("click",function(){e.eBV(t);const n=e.XpG(4);return e.Njj(n.selectTemplate())}),e.EFF(13," Select Template "),e.k0s()()()}if(2&o){const t=e.XpG(4);e.R7$(2),e.Y8G("ngForOf",t.templateList),e.R7$(),e.AVh("disabled",t.isRequestCreated),e.R7$(7),e.SpI(" ",t.isRequestCreated?"Request is pending...":"Request for new templates"," "),e.R7$(2),e.Y8G("disabled",!t.selectedTemplate)}}function io(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",57)(1,"div",27),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.EmailTemVisible())}),e.j41(2,"span",28),e.EFF(3,"Select Email Template"),e.k0s(),e.nrm(4,"i",58),e.k0s(),e.DNE(5,no,14,5,"div",73),e.k0s()}if(2&o){const t=e.XpG(3);e.R7$(5),e.Y8G("ngIf",t.SelectTem)}}function oo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",57)(1,"div",90)(2,"span",28),e.EFF(3),e.k0s(),e.j41(4,"button",91),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.Mappin())}),e.EFF(5,"+ New Mapping"),e.k0s()()()}if(2&o){const t=e.XpG(3);e.R7$(3),e.SpI("Sync survey responses to ",t.crmType,"")}}function ao(o,s){if(1&o&&(e.EFF(0),e.nI1(1,"slice")),2&o){const t=s.item;e.Lme(" ",null==t?null:t.questionRefernceNo," ",(null==t||null==t.text?null:t.text.length)>100?e.brH(1,2,null==t?null:t.text,0,100)+"...":null==t?null:t.text," ")}}function so(o,s){if(1&o&&(e.EFF(0),e.nI1(1,"slice")),2&o){const t=s.item;e.Lme(" ",null==t?null:t.questionRefernceNo," ",(null==t||null==t.text?null:t.text.length)>100?e.brH(1,2,null==t?null:t.text,0,100)+"...":null==t?null:t.text," ")}}function ro(o,s){if(1&o){const t=e.RV6();e.j41(0,"i",52),e.bIt("click",function(){e.eBV(t);const n=e.XpG().index,a=e.XpG(5);return e.Njj(a.removeMapping(n))}),e.k0s()}}function lo(o,s){if(1&o&&(e.j41(0,"div",102)(1,"div",103)(2,"label",35),e.EFF(3,"Question"),e.k0s(),e.j41(4,"ng-select",104),e.DNE(
15,ao,2,6,"ng-template",55)(6,so,2,6,"ng-template",56),e.k0s()(),e.j41(7,"div",105)(8,"label",35),e.EFF(9),e.k0s(),e.nrm(10,"ng-select",106),e.k0s(),e.j41(11,"div",105)(12,"label",35),e.EFF(13,"Default Value"),e.k0s(),e.nrm(14,"input",107),e.k0s(),e.j41(15,"div",50),e.DNE(16,ro,1,0,"i",51),e.k0s()()),2&o){const t=s.index,i=e.XpG(5);e.Y8G("formGroupName",t),e.R7$(4),e.Y8G("items",i.questionsArr)("clearable",!1)("searchable",!0),e.R7$(5),e.SpI("",i.crmType," Field"),e.R7$(),e.Y8G("items",i.fieldsArr)("clearable",!1)("searchable",!1),e.R7$(6),e.Y8G("ngIf",i.mapping.controls.length>1)}}function co(o,s){if(1&o){const t=e.RV6();e.j41(0,"a",108),e.bIt("click",function(){e.eBV(t);const n=e.XpG(5);return e.Njj(n.addMapping())}),e.EFF(1,"+ Add another"),e.k0s()}}function po(o,s){if(1&o&&(e.j41(0,"div",98)(1,"h6",32),e.EFF(2),e.k0s(),e.j41(3,"div",99),e.DNE(4,lo,17,9,"div",100),e.k0s(),e.j41(5,"div",98),e.DNE(6,co,2,0,"a",101),e.k0s()()),2&o){const t=e.XpG(4);e.R7$(2),e.SpI("Map your ",t.crmType," fields"),e.R7$(2),e.Y8G("ngForOf",t.mapping.controls),e.R7$(2),e.Y8G("ngIf",t.mapping.controls.length<5)}}function uo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",57)(1,"div",31)(2,"p",92),e.EFF(3),e.k0s(),e.j41(4,"div",33)(5,"div",34)(6,"label",35),e.EFF(7,"Mapping Type"),e.k0s(),e.j41(8,"ng-select",93),e.bIt("change",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.onSelectionChange())}),e.k0s()(),e.j41(9,"div",34)(10,"label",35),e.EFF(11),e.k0s(),e.j41(12,"ng-select",94),e.bIt("change",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.onSelectionChange())}),e.k0s()()(),e.DNE(13,po,7,3,"div",95),e.j41(14,"div",96)(15,"button",97),e.bIt("click",function(){e.eBV(t);const n=e.XpG(3);return e.Njj(n.SalesForceDetails())}),e.EFF(16,"Save"),e.k0s()()()()}if(2&o){const t=e.XpG(3);e.R7$(),e.Y8G("formGroup",t.MappingForm),e.R7$(2),e.SpI("Sync survey responses to ",t.crmType,""),e.R7$(5),e.Y8G("items",t.Mapping)("clearable",!1)("searchable",!1),e.R7$(3),e.SpI("",t.crmType," Object"),e.R7$(),e.Y8G("items",t.eventsArr)("clearable",!1)("searchable",!1),e.R7$(),e.Y8G("ngIf",t.MappingForm.get("mappingType").value||t.MappingForm.get("saleforceType").value),e.R7$(2),e.Y8G("disabled",t.MappingForm.invalid||t.SalceForceForm.invali
1d||t.form2.invalid&&t.showEmailDetails)}}function mo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div")(1,"div",26)(2,"div",27),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.toggleVisibility())}),e.j41(3,"span",28),e.EFF(4),e.k0s()(),e.DNE(5,Qi,28,15,"div",29),e.k0s(),e.DNE(6,eo,6,1,"div",30)(7,io,6,1,"div",30)(8,oo,6,1,"div",30)(9,uo,17,11,"div",30),e.k0s()}if(2&o){const t=e.XpG(2);e.R7$(4),e.SpI("Trigger survey when an event happens in ",t.crmType,""),e.R7$(),e.Y8G("ngIf",t.isVisible),e.R7$(),e.Y8G("ngIf",t.showEmailDetails),e.R7$(),e.Y8G("ngIf",t.SelectTemplate),e.R7$(),e.Y8G("ngIf",0==t.Newmapping),e.R7$(),e.Y8G("ngIf",t.Newmapping)}}function go(o,s){if(1&o&&(e.j41(0,"section"),e.DNE(1,mo,10,6,"div",12),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.isSelectTemplate&&!t.isUploadEmails)}}function ho(o,s){1&o&&(e.j41(0,"section",109)(1,"div",110)(2,"span",111),e.EFF(3,"Loading..."),e.k0s()(),e.j41(4,"strong"),e.EFF(5,"Loading..."),e.k0s()())}function fo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.pushMsgStatusObj?null:t.pushMsgStatusObj.total)}}function _o(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.ampCampaignList[0]||null==t.ampCampaignList[0].status?null:t.ampCampaignList[0].status.sent)}}function bo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.pushMsgStatusObj?null:t.pushMsgStatusObj.sent)}}function vo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.ampCampaignList[0]||null==t.ampCampaignList[0].status?null:t.ampCampaignList[0].status.sent)}}function xo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.pushMsgStatusObj?null:t.pushMsgStatusObj.delivered)}}function ko(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.ampCampaignList[0]||null==t.ampCampaignList[0].status?null:t.ampCampaignList[0].status.delivered)}}function yo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.pushMsgStatusObj?null:t.pushMsgStatusObj.failed)}}function Co(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null!=t.ampCampaignList[0]&&null!=t.ampCampaignList[0].status&&t.ampCampaignList[0].status.failed?null==t.ampCampaignList||null==t.ampCampaignList.status?null:t.ampCampaignList.status.failed:0)}}function Fo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.pushMsgStatusObj?null:t.pushMsgStatusObj.read)}}function jo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.ampCampaignList[0]||null==t.ampCampaignList[0].status?null:t.ampCampaignList[0].status.opens)}}function Mo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.pushMsgStatusObj?null:t.pushMsgStatusObj.started)}}function wo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.ampCampaignList[0]||null==t.ampCampaignList[0].status?null:t.ampCampaignList[0].status.opens)}}function Po(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.pushMsgStatusObj?null:t.pushMsgStatusObj.completed)}}function Oo(o,s){if(1&o&&(e.j41(0,"span",128),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.JRh(null==t.ampCampaignList[0]||null==t.ampCampaignList[0].status?null:t.ampCampaignList[0].status.submission)}}function So(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",129)(1,"button",130),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.exportRespondantDetails())}),e.EFF(2,"Download Report"),e.k0s(),e.j41(3,"div",131),e.qSk(),e.j41(4,"svg",132),e.nrm(5,"circle",133)(6,"line",134),e.k0s(),e.joV(),e.j41(7,"input",135),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.searchSurveyByName(n))}),e.k0s()()()}}function Eo(o,s){if(1&o&&(e.j41(0,"tr")(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s(),e.j41(7,"td"),e.EFF(8),e.nI1(9,"date"),e.k0s(),e.j41(10,"td"),e.EFF(11),e.nI1(12,"date"),e.k0s(),e.j41(13,"td",139),e.EFF(14),e.k0s(),e.j41(15,"td",140),e.EFF(16),e.k0s()()),2&o){const t=s.$implicit;e.R7$(2),e.JRh(t.phone_number?t.phone_number:"-"),e.R7$(2),e.JRh(t.uniqueId),e.R7$(2),e.SpI("",t.surveyProgress,"%"),e.R7$(2),e.JRh(t.created_at?e.i5U(9,8,t.created_at,"
1short"):"-"),e.R7$(3),e.JRh(t.modified_at?e.i5U(12,11,t.modified_at,"short"):"-"),e.R7$(3),e.JRh(t.surveyStatus?t.surveyStatus:"-"),e.R7$(),e.FS9("title",t.failedReason?t.failedReason:"-"),e.R7$(),e.SpI(" ",t.failedReason?t.failedReason:"-"," ")}}function Io(o,s){if(1&o&&(e.j41(0,"div",136)(1,"table",137)(2,"thead")(3,"tr")(4,"th"),e.EFF(5,"User ID"),e.k0s(),e.j41(6,"th"),e.EFF(7,"UID"),e.k0s(),e.j41(8,"th"),e.EFF(9,"Survey Progress"),e.k0s(),e.j41(10,"th"),e.EFF(11,"Trigger On"),e.k0s(),e.j41(12,"th"),e.EFF(13,"Last Action On"),e.k0s(),e.j41(14,"th"),e.EFF(15,"Status"),e.k0s(),e.j41(16,"th"),e.EFF(17,"Status Reason"),e.k0s()()(),e.j41(18,"tbody"),e.DNE(19,Eo,17,14,"tr",138),e.nI1(20,"paginate"),e.k0s()()()),2&o){const t=e.XpG(2);e.R7$(19),e.Y8G("ngForOf",e.i5U(20,1,t.usersArr,e.sMw(4,zi,t.count,t.pageSize,t.page)))}}function Ro(o,s){1&o&&(e.j41(0,"div",141)(1,"p"),e.EFF(2,"No data found..."),e.k0s()())}function To(o,s){if(1&o&&(e.j41(0,"option",146),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.Y8G("value",t),e.R7$(),e.JRh(t)}}function No(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",142)(1,"pagination-controls",143),e.bIt("pageChange",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageChange(n))}),e.k0s(),e.j41(2,"select",144),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageSizeChange(n))}),e.DNE(3,To,2,2,"option",145),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.Y8G("ngForOf",t.pageSizes)}}function Do(o,s){if(1&o){const t=e.RV6();e.j41(0,"section")(1,"div",112)(2,"button",113),e.EFF(3,"Back"),e.k0s(),e.j41(4,"div",114)(5,"button",115),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.toggleIntegrationTable())}),e.EFF(6,"Edit"),e.k0s(),e.j41(7,"label",116)(8,"input",117),e.bIt("change",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.isActive=n.target.checked)}),e.k0s(),e.j41(9,"span",118),e.nrm(10,"span",119),e.k0s()()()(),e.j41(11,"div",120)(12,"div",121),e.DNE(13,fo,2,1,"span",122)(14,_o,2,1,"span",122),e.j41(15,"span",123),e.EFF(16,"Triggered"),e.k0s()(),e.j41(17,"div",121),e.DNE(18,bo,2,1,"span",122)(19,vo,2,1,"span",122),e.j41(20,"span",123),e.EFF(21,"Sent"),e.k0s()(),e.j41(22,"div",121),e.DNE(23,xo,2,1,"span",122)(24,ko,2,1,"span",122),e.j41(25,"span",123),e.EFF(26,"Delivered"),e.k0s()(),e.j41(27,"div",121),e.DNE(28,yo,2,1,"span",122)(29,Co,2,1,"span",122),e.j41(30,"span",123),e.EFF(31,"Failed"),e.k0s()(),e.j41(32,"div",121),e.DNE(33,Fo,2,1,"span",122)(34,jo,2,1,"span",122),e.j41(35,"span",123),e.EFF(36,"Read"),e.k0s()(),e.j41(37,"div",121),e.DNE(38,Mo,2,1,"span",122)(39,wo,2,1,"span",122),e.j41(40,"span",123),e.EFF(41,"Survey Started"),e.k0s()(),e.j41(42,"div",121),e.DNE(43,Po,2,1,"span",122)(44,Oo,2,1,"span",122),e.j41(45,"span",123),e.EFF(46,"Survey Completed"),e.k0s()()(),e.DNE(47,So,8,0,"div",124)(48,Io,21,8,"div",125)(49,Ro,3,0,"div",126)(50,No,4,1,"div",127),e.k0s()}if(2&o){const t=e.XpG();e.R7$(5),e.Y8G("disabled",t.isActive),e.R7$(3),e.Y8G("checked",t.isActive),e.R7$(5),e.Y8G("ngIf","Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf","Email"==(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(4),e.Y8G("ngIf","Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf","Email"==(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(4),e.Y8G("ngIf","Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf","Email"==(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(4),e.Y8G("ngIf","Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf","Email"==(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(4),e.Y8G("ngIf","Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf","Email"==(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(4),e.Y8G("ngIf","Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf","Email"==(null==t.campginDetails?null:t.campginDetail
1s.sendSurveyUsing)),e.R7$(4),e.Y8G("ngIf","Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf","Email"==(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(3),e.Y8G("ngIf",(t.userRecords||t.noDataFound)&&"Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf",0!=t.usersArr.length&&"Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)),e.R7$(),e.Y8G("ngIf",0==t.usersArr.length&&"Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing)&&t.noDataFound),e.R7$(),e.Y8G("ngIf",t.usersArr.length>0&&"Email"!=(null==t.campginDetails?null:t.campginDetails.sendSurveyUsing))}}let Go=(()=>{class o{constructor(t,i,n,a,l,c,m,d){this.fb=t,this.toastr=i,this.surveyService=n,this.authenticationService=a,this.router=l,this.papa=c,this.cd=m,this.activatedRoute=d,this.salceEvent=!1,this.isActive=!1,this.eventsArr=[{name:"Accounts",value:"account"},{name:"Contacts",value:"contact"},{name:"Leads",value:"lead"},{name:"Deals",value:"deal"}],this.actionOptions=[{action_id:1,action:"new"},{action_id:2,action:"update"}],this.operator=["is equal to","is not equal to"],this.object=["WhatsApp","Email"],this.Mapping=["Update an existing entry"],this.salceforce=[],this.fieldsArr=[],this.fields=["FirstName","LastName","Description","Industry","JobTitle","Email","Phones","Addresses"],this.Newmapping=!1,this.showPhoneNumberDropdown=!1,this.selectedObjectTitle="Via",this.selectedMapping="",this.selectedSalesforce="",this.isMapFieldsVisible=!1,this.selectAction=[],this.questionsArr=[],this.isIntegrated=!1,this.length=0,this.isMappingDisabled=!0,this.isOtherFieldsDisabled=!0,this.IntegrationTable=!1,this.usersArr=[],this.page=0,this.count=0,this.pageSize=5,this.pageSizes=[5,10,15],this.currentPage=0,this.test=[],this.disbaledFlag=!0,this.surveyList=[],this.isLoading=!1,this.isFileLoading=!1,this.surveyId="",this.pushMsgStatusObj={},this.searchRecord="",this.surveyDetails={},this.redirectDetails={},this.campaignName="",this.xoxodayCampaignId="",this.isFileSelected=!1,this.isFormDisabled=!1,this.crmType="",this.isVisible=!1,this.showEmailDetails=!1,this.SelectTemplate=!1,this.phoneNumbersArr=[],this.gupshupPhone="",this.dropdownSettings={singleSelection:!1,idField:"action_id",textField:"action",selectAllText:"Select All",unSelectAllText:"UnSelect All",itemsShowLimit:3,allowSearchFilter:!0},this.integrationDetails={},this.token="",this.noDataFound=!1,this.campaignNameValidation="",this.isEditButtonDisabled=!1,this.displayVal="",this.displayValsub="",this.displayValpre="",this.defaultName="From Name",this.defaultSubName="Your subject line comes here",this.defaultPre="Your preheader comes here",this.campaignDetails={},this.isSelectTemplate=!1,this.templateList=[],this.userData=JSON.parse(localStorage.getItem("currentUser")),this.isCreateCampaign=!1,this.campaignList=[],this.isUploadEmails=!1,this.isxoxoDay=!1,this.EmailVisible=!1,this.SelectTem=!1,this.isRequestCreated=!1,this.ampCampaignList=[];let f=new Date;f=new Date(f.getTime()+864e5),this.minDate=f.toISOString().split("T")[0]}ngOnInit(){this.crmType=this.activatedRoute.snapshot.params.name,this.getIntegrationDetails(),this.getsurveydetails(),this.getSalecforceDetails(),this.getAllParticipents(),this.getPushMessageStatus(),this.getAllAMPCampaignList(),this.SalceForceForm=this.fb.group({object:[null,r.k0.required],action:[[],r.k0.required],Condition:this.fb.array([this.ConditionFields()]),object2:[null,r.k0.required],phoneNumber:[null]}),this.onNewSession(),this.MappingForm=this.fb.group({mappingType:[null,r.k0.required],saleforceType:[null,r.k0.required],Mapping:this.fb.array([this.MappingType()])}),this.form2=this.fb.group({subject:[{value:"",disabled:this.isFormDisabled},r.k0.required],preHeader:[{value:"",disabled:this.isFormDisabled},r.k0.required],fromName:[{value:"",disabled:this.isFormDisabled},r.k0.required],replyTo:[{value:"",disabled:this.isFormDisabled},[r.k0.required,r.k0.pattern("[A-Za-z0-9._]{1,}@[A-Za-z]{4,}[.]{1}[a-z.]{2,6}")]]})}toggleVisibility(){this.isVisible=!this.isVisible}getEventName(t){const i=this.eventsArr.find(n=>n.value===t);return i?i.name:""}restoreFormState(){const t=JSON.parse(localStorage.getItem("formState")||"{}");t.IntegrationTable&&(this.IntegrationTable=t.IntegrationTable)}get condition(){return this.SalceForceForm.get("Condition")}ConditionFields(){return this.fb.group({fields:[null],condition:[null,r.k0.required],value:["",r.k0.required]})}addCondition(){this.condition.length>=2?this.toastr.error("Only two conditions are allowed"):this.condition.push(this.ConditionFields())}removecondition(t){this.condition.removeAt(t)}get mapping(){return this.MappingForm.get("Mapping")}MappingType(){return this.fb.group({questionId:[null,r.k0.required],salesforceField:[null,r.k0.required],defaultValue:["",r.k0.required]})}addMapping(){this.mapping.length>=5?this.toastr.error("Only two conditions are allowed"):this.mapping.push(this.MappingType())}removeMapping(t){this.mapping.removeAt(t)}SaveMappingdata(){this.MappingForm.valid?console.log("Mapping Details:",this.MappingForm.value):console.error("Mapping Form is invali
1d")}Mappin(){this.Newmapping=!0,this.isVisible=!1}nextcard(){const t=this.SalceForceForm.get("object2")?.value;t&&(this.SalceForceForm.patchValue({object2:t}),this.showPhoneNumberDropdown="WhatsApp"===t,this.showEmailDetails="Email"===t,this.SelectTemplate="Email"===t,this.showPhoneNumberDropdown&&(this.Newmapping=!0,this.isVisible=!1),this.showEmailDetails&&(this.EmailVisible=!0,this.isVisible=!1))}onObjectChange(t){const i=t.target.value;this.SalceForceForm.patchValue({object2:i}),this.showPhoneNumberDropdown="WhatsApp"===i,this.showEmailDetails="Email"===i,this.SelectTemplate="Email"===i,this.showPhoneNumberDropdown||this.showEmailDetails||this.SelectTemplate?(this.selectedObjectTitle="To",this.getPhoneNumbers(),this.getAllTemplates()):this.selectedObjectTitle="Via","Email"===i?this.Form2Validation():this.disableForm2Validation()}Form2Validation(){Object.keys(this.form2.controls).forEach(t=>{this.form2.controls[t].setValidators(r.k0.required),this.form2.controls[t].updateValueAndValidity()})}disableForm2Validation(){Object.keys(this.form2.controls).forEach(t=>{this.form2.controls[t].clearValidators(),this.form2.controls[t].updateValueAndValidity()})}onSelectionChange(){this.isMapFieldsVisible=!0}getPhoneNumbers(){this.surveyService.getPhoneNumbers().subscribe(t=>{t&&t.whatsAppPhones&&(this.phoneNumbersArr=t.whatsAppPhones)},t=>{console.error("Error fetching phone numbers",t)})}onItemSelect(t){const i=this.SalceForceForm.get("action");if(i){const n=i.value;n.some(a=>a.action_id===t.action_id)||i.setValue([...n,t])}}onSelectAll(t){this.SalceForceForm.get("action")?.setValue(t)}getsurveydetails(){this.questionsArr=[],this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{t&&(this.surveyDetails=t,this.getPhoneNumbers(),this.isXoxodayEnabled=t.isXoxodayEnabled,t?.sections?.map(i=>{i?.questions?.map(n=>{"Message"!==n?.type&&"Image/Media"!==n?.type&&this.questionsArr.push(n)})}))})}SalesForceDetails(){const t=this.SalceForceForm.value,i=this.MappingForm.value,n=this.form2.value;let a=localStorage.getItem("surveyId"),l=localStorage.getItem("surveyName"),c={};"email"==t?.object2?.toLowerCase()&&(c={subject:n?.subject,preHeader:n?.preHeader,fromName:n?.fromName,replyTo:n?.replyTo,templateId:this.templateData?.id,mmApiKey:this.templateData?.mmApiKey,formId:this.templateData?.formId,templateName:this.selectedTemplate});var m={crmIntegrationId:this.integrationDetails?.integrationId,surveyId:a,type:t?.object,campignName:l,isActive:!0,event:t?.object,eventAction:t.action.map(d=>({action:d.action})),eventCondition:t?.Condition.map(d=>({field:d?.fields,condition:d?.condition,value:d?.value})),sendSurveyUsing:t?.object2,phoneNumber:t?.phoneNumber,mappingType:i?.mappingType,saleforceType:i?.saleforceType,fieldMapping:i?.Mapping.map(d=>({questionId:d?.questionId,salesforceField:d?.salesforceField,defaultValue:d?.defaultValue})),...c};this.campginDetails?._id&&(m._id=this.campginDetails?._id),this.isLoading=!0,this.surveyService.savesalesforceCampgin(m).subscribe(d=>{console.log(d),this.campginDetails=d,this.toastr.success("SalceForce details saved successfully."),this.IntegrationTable=!0,this.Newmapping=!1,this.isLoading=!1,this.isFormDisabled=!0,this.updateFormDisabledState(),this.isActive=!0},d=>{console.error(d)})}getSalecforceDetails(){let t=localStorage.getItem("surveyId");this.surveyService.getsalesforceCampgin(t).subscribe(i=>{console.log(i),this.campginDetails=i,this.isActive=!!i?.isActive&&i?.isActive,this.SalceForceForm.patchValue({object:i.type,action:i.eventAction.map(l=>this.actionOptions.find(c=>c.action===l.action)),object2:i.sendSurveyUsing,phoneNumber:i.phoneNumber}),this.MappingForm.patchValue({mappingType:i.mappingType,saleforceType:i.saleforceType});const n=this.SalceForceForm.get("Condition");n.clear(),i.eventCondition.forEach(l=>{n.push(this.fb.group({fields:[l.field],condition:[l.condition,r.k0.required],value:[l.value,r.k0.required]}))});const a=this.MappingForm.get("Mapping");a.clear(),i.fieldMapping.forEach(l=>{a.push(this.fb.group({questionId:[l.questionId,r.k0.required],salesforceField:[l.salesforceField,r.k0.required],defaultValue:[l.defaultValue,r.k0.required]}))}),this.form2.patchValue({subject:i.subject,preHeader:i.preHeader,fromName:i.fromName,replyTo:i.replyTo,templateId:i.templateId}),this.displayVal=i.fromName||this.defaultName,this.displayValsub=i.subject||this.defaultSubName,this.displayValpre=i.preHeader||this.defaultPre,this.showEmailDetails="Email"===i.sendSurveyUsing,this.SelectTemplate="Email"===i.sendSurveyUsing,this.SelectTemplate&&this.SelectedTemplate(i.templateId),this.showPhoneNumberDropdown="WhatsApp"===i.sendSurveyUsing,this.showPhoneNumberDropdown&&this.getPhoneNumbers(),this.isMapFieldsVisible=!!(i.mappingType&&this.Mapping.includes(i.mappingType)&&this.salceforce.includes(i.saleforceType)),this.IntegrationTable=!0,this.salceEvent=i.isActive,this.getcrmFields(i.type),this.isFormDisabled=!0,this.updateFormDisabledState()})}toggleIntegrationTable(){this.IntegrationTable=!1}
1getIntegrationDetails(){let t=localStorage.getItem("currentUser");t&&(t=JSON.parse(t)),this.isLoading=!0,this.surveyService.getIntegrationDetails(t?.email).subscribe(i=>{this.integrationId1=i.integrationId,this.integrationDetails=i,console.log("Knit Integration Details Response:",i),i?(this.isIntegrated=!0,this.getSalecforceDetails(),this.getcrmFields(this.selectedType)):this.isIntegrated=!1,this.isLoading=!1},i=>{console.error("Error fetching integration details:",i),this.isIntegrated=!1,this.isLoading=!1})}getcrmFields(t){if(null==t||null==t)return!1;this.surveyService.getAllCrmFields(this.integrationId1,t).subscribe(i=>{if(this.crmFields=i,this.fieldsArr=i?.data?.fields?.mapped,i?.data?.fields?.unmapped)for(let n of i?.data?.fields?.unmapped){let a={mappedKey:n?.fieldId,...n};this.fieldsArr.push(a)}console.log("CRM Fields Response:",i)},i=>{console.error("Error fetching CRM fields:",i)})}onSalesForceObject(t){this.selectedObject=t,this.SalceForceForm.patchValue({object:t}),this.MappingForm.patchValue({saleforceType:t})}saveFormState(){localStorage.setItem("formState",JSON.stringify({IntegrationTable:this.IntegrationTable}))}onNewSession(){let t=localStorage.getItem("currentUser");t&&(t=JSON.parse(t)),this.authenticationService.onNewSession(t).subscribe(i=>{this.token=i?.msg?.token,console.log(this.token),this.isLoading=!1},i=>{console.error(i)})}onFinish(t){console.log(t.detail.integrationDetails),1==t.detail.integrationDetails?.success&&this.saveIntegrationDetails(t.detail.integrationDetails),this.isLoading=!1}onDeactivate(t){console.log(t.detail.integrationDetails),this.isLoading=!1}onKnitClose(t){console.log(t.detail.knitClosed),this.isLoading=!1}saveIntegrationDetails(t){let i=localStorage.getItem("currentUser");i&&(i=JSON.parse(i));let n={categoryId:"CRM",integrationId:t?.integrationId,originOrgId:t?.originOrgId,crmName:t?.appId,token:this.token,success:!0,userId:i?.userId,originUserEmail:i?.email,originOrgName:t?.originOrgId,originUserName:i?.email};this.isLoading=!0,this.surveyService.saveIntegrationDetails(n).subscribe(a=>{this.toastr.success("Integration details saved successfully."),this.ngOnInit(),this.isLoading=!1}),this.isLoading=!1}handlePageChange(t){1===t?(this.page=t,this.currentPage=t-1):t>1&&(this.page=t,this.currentPage=this.pageSize*(t-1)),this.getAllParticipents()}handlePageSizeChange(t){this.pageSize=Number(t.target.value),this.page=1,this.currentPage=0,this.getAllParticipents()}getAllParticipents(){this.surveyService.getAllParticipents(this.currentPage,this.pageSize,this.searchRecord,!0).subscribe(t=>{this.usersArr=t.data,this.userRecords=this.usersArr.length>0,this.count=t.count,console.log(t)},t=>{console.error(t)})}getPushMessageStatus(){this.surveyService.getPushMessageStatus(!0).subscribe(t=>{this.pushMsgStatusObj=t},t=>{console.error(t)})}exportRespondantDetails(){this.isFileLoading=!0,this.surveyService.exportRepondantDetailsBySurveyID(localStorage.getItem("surveyId")).subscribe(t=>{this.isFileLoading=!1;const i=new Blob([t],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(i),a=document.createElement("a");a.href=n,a.download=`${this.surveyId}+${new Date}.csv`,a.click()},t=>{this.isFileLoading=!1})}createLink(){"DRAFT"==this.surveyDetails.status?0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click():this.uploadModel.nativeElement.click()}searchSurveyByName(t){this.searchRecord=t.target.value,this.searchRecord=this.searchRecord.trim(),this.noDataFound=!(this.userRecords.length>0),this.getAllParticipents()}updateStatus(t){if(t){let i={id:localStorage.getItem("surveyId"),is_published:!0};this.surveyService.updateSurveyStatus(i).subscribe(n=>{this.toastr.success("Survey Published sucessfully."),this.uploadModel.nativeElement.click(),this.getsurveydetails()},n=>{console.error(n)})}}onFileChanged(t){this.fileEvent=t,this.selectedFile=t.target.files[0],this.isFileSelected=!0}createChunk(t,i){let n=[],a=0;const l=t.length+t.length%i+1;for(let c=i;c<l;c+=i)n.push(t.slice(a,c)),a=c;console.log(n),n.map(c=>{this.upload(n)})}getUserAccessibility(){this.isLoading=!0,this.surveyService.getRedirectDetails().subscribe(t=>{this.isLoading=!1,!t||400==t.status&&401==t.status?this.toastr.error("Access denied"):(this.redirectDetails=t,this.getsurveydetails(),this.getAllParticipents(),this.getPushMessageStatus())},t=>{this.isLoading=!1,this.toastr.error("Access denied")})}getUniqueListBy(t,i){return[...new Map(t.map(n=>[n[i],n])).values()]}checkCampName(t){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.campaignName).subscribe(i=>{this.upload(t),console.log(i),this.nameEvent.target.value="",this.fileEvent.target.value=""},i=>{this.toastr.error(i),this.nameEvent.target.value="",this.fileEvent.target.value=""})}upload(t){document.getElementById("close-modal").click(),this.surveyService.uploadParticipent(t,this.surveyDetails.surveyPhone).subscribe(n=>{this.xoxodayCampaignId="",this.reward="",this.expiryDate="",this.campaignName="",this.toastr.success(n.message)},n=>{this.toastr.error(n?.message)})}getxoxodayCampginList(){const t=JSON.parse(localStorage.getItem("currentUser"));
1this.surveyService.getxoxodayCampginList(t.userId).subscribe(i=>{i.data&&i.data.campaignList&&i.data.campaignList.data?(this.compaignlist=i.data.campaignList.data,console.log(this.compaignlist)):this.compaignlist=[]},i=>{console.log(i)})}formatDate(t){const i=new Date(t),n=i.getDate(),a=i.getMonth()+1,l=i.getFullYear();return`${n.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}-${l}`}onCampaignSelected(t){this.selectedCampaign=t}validateCampName(t){this.nameEvent=t;const i=/^[a-zA-Z0-9\s]+$/;return i.test(t.target.value)?(this.campaignName=t.target.value,this.campaignNameValidation=""):this.campaignNameValidation="Campaign Name can only contain letters, numbers and spaces.",this.isCampNameValid=i.test(t.target.value),this.isCampNameValid}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}refreshButton(){this.ngOnInit()}toggleEditButton(){this.isEditButtonDisabled=!this.isEditButtonDisabled,this.isEditButtonDisabled&&this.confirmationModal.nativeElement.click()}confirmDisableEditing(){this.confirmationModal.nativeElement.click("hide")}changeCRMCamiagnStatus(){0==this.isActive?this.deactivateSync():this.surveyService.changeCRMCamiagnStatus({dataType:this.campginDetails?.event,campId:this.campginDetails?._id,surveyId:this.campginDetails?.surveyId,integrationId:this.integrationDetails?.integrationId}).subscribe(i=>{this.toastr.success(`Campign ${1==this.isActive?"enabled":"disabled"} successfully.`),1==this.isActive&&this.toastr.success("Data sync process has been successfully started")},i=>{this.toastr.error("Oh something wents wrong, please try again")})}startSyc(){this.surveyService.startSyc({integrationId:this.integrationDetails?.integrationId,dataType:this.campginDetails?.event,surveyId:this.campginDetails?.surveyId}).subscribe(t=>{console.log(t),this.toastr.success("Data sync process has been successfully started")},t=>{this.toastr.error("Data sync api failed")})}getValue(t){this.displayVal=t}getValuesubject(t){this.displayValsub=t}getValuePreheader(t){this.displayValpre=t}salceforceEvnt(t){this.salceEvent=t.target.checked,this.salceEvent||(this.IntegrationTable=!1)}gotoCampaign(){this.displayVal="",this.displayValpre="",this.displayValsub="",this.selectedTemplate=""}salesDetails(){this.SelectTem=!0,this.campaignDetails={subject:this.form2.controls.subject.value,preHeader:this.form2.controls.preHeader.value,fromName:this.form2.controls.fromName.value,replyTo:this.form2.controls.replyTo.value},this.checkCampName2(),this.checkRequestCreated(),this.EmailVisible=!1}getAllTemplates(){this.surveyService.getAmpTemplates(this.userData.userId).subscribe(t=>{this.templateList=t},t=>{console.log(t)})}SelectedTemplate(t){this.surveyService.getAmpTemplates(this.userData.userId).subscribe(i=>{this.templateList=i,t&&(this.templateData=this.templateList.find(n=>n.id===t),this.selectedTemplate=this.templateData?.name,this.cd.detectChanges())},i=>{console.log(i)})}updateFormDisabledState(){Object.keys(this.form2.controls).forEach(t=>{const i=this.form2.get(t);this.isFormDisabled?i.disable():i.enable()})}selectTemplate(){this.SelectTem=!1,this.Newmapping=!0}chosenTemplate(t){this.templateData===t?(this.templateData=null,this.selectedTemplate=null):(this.templateData=t,this.selectedTemplate=this.templateData.name)}checkCampName2(){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.campaignDetails.campaignName).subscribe(t=>{this.getAllTemplates(),console.log(t)},t=>{this.toastr.error(t)})}requestMoreTemplates(){let i={userId:JSON.parse(localStorage.getItem("currentUser")).userId,isActive:!0};this.surveyService.requestNewTemplate(i).subscribe(n=>{console.log(n),this.toastr.success("Request has been sent successfully!"),this.checkRequestCreated()},n=>{this.toastr.error(n)})}checkRequestCreated(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.checkRequestCreated(t.userId).subscribe(i=>{this.isRequestCreated=null!==i},i=>{console.log(i),this.isRequestCreated=!1})}backtocreate(){this.isSelectTemplate=!1,this.selectedTemplate=!1,this.isCreateCampaign=this.isCreateCampaign}getAllCampaignList(){this.isLoading=!0,this.surveyService.getAllCampaignList(localStorage.getItem("surveyId"),this.currentPage,this.pageSize).subscribe(t=>{this.campaignList=t.data,this.count=t.count,this.isLoading=!1},t=>{console.log(t),this.isLoading=!1})}EmailDetVisible(){this.EmailVisible=!this.EmailVisible}EmailTemVisible(){this.SelectTem=!this.SelectTem}EditButton(){this.salceEvent=!0}getAllAMPCampaignList(){this.isLoading=!0,this.surveyService.getAllCampaignList(localStorage.getItem("surveyId"),this.currentPage,this.pageSize,!0).subscribe(t=>{this.ampCampaignList=t.data,this.isLoading=!1},t=>{console.log(t),this.isLoading=!1})}deactivateSync(){this.surveyService.deactivateSync({campId:this.campginDetail
1s?._id,dataType:this.campginDetails?.event,surveyId:this.campginDetails?.surveyId,integrationId:this.integrationDetails?.integrationId}).subscribe(i=>{this.toastr.success(`Campign ${1==this.isActive?"enabled":"disabled"} successfully.`),1==this.isActive&&this.toastr.success("Data sync process has been successfully started")},i=>{this.toastr.error("Oh something wents wrong, please try again")})}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(r.ok),e.rXU(x.tw),e.rXU(b.I),e.rXU(F.k),e.rXU(g.Ix),e.rXU(I.F),e.rXU(e.gRc),e.rXU(g.nX))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-salesforce"]],viewQuery:function(i,n){if(1&i&&(e.GBs(Vi,7),e.GBs(Li,7),e.GBs($i,7),e.GBs(Bi,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.uploadModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first),e.mGM(a=e.lsd())&&(n.confirmationModal=a.first)}},decls:28,vars:7,consts:[["confirmationModal",""],["closeModal",""],["box2",""],["box3",""],["box",""],[1,"sf-page","borderbottobm"],[1,"sf-breadcrumb"],["routerLink","/survey/deploy-survey/deployments",1,"sf-bc-link"],["src","assets/icons/shuffle-random.png","alt","",1,"sf-bc-icon"],[1,"sf-bc-sep"],[1,"sf-bc-current"],["src","assets/icons/task-square.svg","alt","",1,"sf-bc-icon","sf-bc-icon--active"],[4,"ngIf"],["class","sf-loading-wrap",4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#confirmation",2,"display","none"],["id","confirmation","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"modal-content","sf-modal"],[1,"sf-modal-body","text-center"],[1,"sf-modal-msg"],[1,"sf-modal-footer","sf-modal-footer--center"],["data-bs-dismiss","modal",1,"sf-btn-outline",3,"click"],["data-bs-dismiss","modal",1,"sf-btn-primary",3,"click"],[1,"sf-center-wrap"],[3,"onNewSession","onFinish","onDeactivate","onKnitClose","authSessionToken"],["slot","trigger"],[1,"sf-card"],[1,"sf-card-header",3,"click"],[1,"sf-card-title"],["class","sf-card-body",3,"formGroup",4,"ngIf"],["class","sf-card mt-3",4,"ngIf"],[1,"sf-card-body",3,"formGroup"],[1,"sf-section-label"],[1,"sf-row-2col"],[1,"sf-field"],[1,"sf-label"],["formControlName","object","bindLabel","name","bindValue","value","placeholder","Select",1,"sf-ng-select",3,"change","items","clearable","searchable"],["formControlName","action",1,"sf-multiselect",3,"onSelect","onSelectAll","placeholder","settings","data"],[1,"sf-section-label","mt-3"],["formArrayName","Condition"],["class","sf-condition-row mt-2",3,"formGroupName",4,"ngFor","ngForOf"],["class","sf-add-link mt-2",3,"click",4,"ngIf"],["formControlName","object2","placeholder","Select",1,"sf-ng-select",3,"change","items","clearable","searchable"],["class","sf-field",4,"ngIf"],[1,"sf-footer-right","mt-3"],["type","submit",1,"sf-btn-primary",3,"click","disabled"],[1,"sf-condition-row","mt-2",3,"formGroupName"],["formControlName","fields","bindLabel","fieldLabel","bindValue","mappedKey","placeholder","Select",1,"sf-ng-select",3,"items","clearable","searchable"],["formControlName","condition","placeholder","Select",1,"sf-ng-select",3,"items","clearable","searchable"],["formControlName","value",1,"sf-input"],[1,"sf-field-action"],["class","fa fa-trash sf-trash",3,"click",4,"ngIf"],[1,"fa","fa-trash","sf-trash",3,"click"],[1,"sf-add-link","mt-2",3,"click"],["formControlName","phoneNumber","bindValue","phone","placeholder","Select",1,"sf-ng-select",3,"items","clearable","searchable"],["ng-label-tmp",""],["ng-option-tmp",""],[1,"sf-card","mt-3"],[1,"fa","fa-angle-down",2,"color","#9ca3af"],[1,"sf-field","mb-3"],[1,"sf-required"],["type","text","formControlName","subject","placeholder","Add an intriguing subject line",1,"sf-input",3,"input"],["type","text","formControlName","preHeader","placeholder","A preheader comes after the subject line...",1,"sf-input",3,"input"],["type","text","formControlName","fromName","placeholder","Example: Sumit from Merren",1,"sf-input",3,"input"],["type","text","formControlName","replyTo","placeholder","Email for users to reply back. Example: [email protected]",1,"sf-input"],[1,"cardheader"],[1,"align-self-center","card1"],[1,"col-sm-12","row","shadow","cardinfom","mx-0"],[1,"col-sm-2","m-0","circlef","text-center"],[1,"col-sm-8"],[1,"col-sm-12","pl-4"],[1,"m-0","stitle-ellipsis"],[1,"m-0","pt-1","stitle-ellipsis"],["class","sf-card-body",4,"ngIf"],[1,"sf-card-body"],[1,"sf-template-grid"],["class","card card-template mb-4 mx-3",4,"ngFor","ngForOf"],[1,"card","card-template","mb-4","mx-3",2,"cursor","pointer","height","330px"],[1,"card-body","justify-content-center","align-items-center",3,"click"],[1,"d-flex","mb-4",2,"height","208px","width","100%"],[1,"m-auto",2,"font-size","5rem"],[1,"col-sm-12","text-center","p-3"],[1,"card-title","mb-0"],[1,"card","card-template","mb-4","mx-3"],[1,"clickable-area",3,"click","ngClass"],[1,"card-body","p-0"],[2,"height","250px","width","100%"],["alt","Template Image",1,"card-img-top",3,"src"],[1,"col-sm-12","p-3"],[1,"card-title","text-center","mb-0"],[1,"sf-card-header"],[1,"sf-btn-primary",3,"click"],[1,"sf-card-title","mb-3"],["formControlName","mappingType","placeholder","Select",1,"sf-ng-select",3,"change","items","clearable","searchable"],["formControlName","saleforceType","bindLabel","name","bindValue","value","placeholder","Select",1,"sf-ng-select",3,"change","items","clearable","searchable"],["class","mt-3",4,"ngIf"],[1,"mt-3","savebtn"],[1,"sf-btn-primary",3,"click","disabled"],[1,"mt-3"],["formArrayName","Mapping"],["class","sf-map-row mt-2",3,"formGroupName",4,"ngFor","ngForOf"],["class","sf-add-link",3,"click",4,"ngIf"],[1,"sf-map-row","mt-2",3,"formGroupName"],[1,"sf-field",2,"flex","3"],["formControlName","questionId","bindValue","_id","placeholder","Select question",1,"sf-ng-select",3,"items","clearable","searchable"],[1,"sf-field",2,"flex","2"],["formControlName","salesforceField","bindLabel","fieldLabel","bindValue","mappedKey","placeholder","Select",1,"sf-ng-select",3,"items","clearable","searchable"],["type","text","formControlName","defaultValue","placeholder","+Add Default Value",1,"sf-input"],[1,"sf-add-link",3,"click"],[1,"sf-loading-wrap"],["role","status",1,"spinner-grow","mb-2"],[1,"sr-only"],[1,"sf-topbar","mb-4"],["type","button","routerLink","/survey/deploy-survey/deployments",1,"sf-btn-back"],[1,"d-flex","align-items-center",2,"gap","12px"],[1,"sf-btn-outline",3,"click","disabled"],[1,"sf-toggle-wrap"],["type","checkbox","id","togBtn","data-bs-toggle","modal","data-bs-target","#confirmation",1,"sf-toggle-input",3,"change","checked"],[1,"sf-toggle-track"],[1,"sf-toggle-thumb"],[1,"sf-stats-row"],[1,"sf-stat-card"],["class","sf-stat-value",4,"ngIf"],[1,"sf-stat-label"],["class","sf-table-toolbar",4,"ngIf"],["class","sf-table-card",4,"ngIf"],["class","sf-empty",4,"ngIf"],["class","sf-pagination-row",4,"ngIf"],[1,"sf-stat-value"],[1,"sf-table-toolbar"],[1,"sf-btn-outline",3,"click"],[1,"sf-search-wrap"],["width","16","height","16","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"sf-search-icon"],["cx","11","cy","11","r","8"],["x1","21","y1","21","x2","16.65","y2","16.65"],["type","text","placeholder","Search",1,"sf-search-input",3,"input"],[1,"sf-table-card"],[1,"sf-table"],[4,"ngFor","ngForOf"],[1,"text-capitalize"],[1,"text-capitalize",3,"title"],[1,"sf-empty"],[1,"sf-pagination-row"],["previousLabel","Prev","nextLabel","Next","responsive","true",3,"pageChange"],[1,"sf-page-size",3,"change"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(i,n){if(1&i){const a=e.RV6();
1e.j41(0,"div",5)(1,"nav",6)(2,"a",7),e.nrm(3,"img",8),e.EFF(4," Deployments "),e.k0s(),e.j41(5,"span",9),e.EFF(6,"\u203a"),e.k0s(),e.j41(7,"span",10),e.nrm(8,"img",11),e.EFF(9),e.k0s()(),e.DNE(10,Yi,5,2,"section",12)(11,go,2,1,"section",12)(12,ho,6,0,"section",13)(13,Do,51,20,"section",12),e.k0s(),e.nrm(14,"a",14,0),e.j41(16,"div",15)(17,"div",16)(18,"div",17)(19,"div",18)(20,"p",19),e.EFF(21),e.k0s(),e.j41(22,"div",20)(23,"button",21),e.bIt("click",function(){return e.eBV(a),e.Njj(n.isActive=!n.isActive)}),e.EFF(24,"Close"),e.k0s(),e.j41(25,"button",22,1),e.bIt("click",function(){return e.eBV(a),e.Njj(n.changeCRMCamiagnStatus())}),e.EFF(27,"YES"),e.k0s()()()()()()}2&i&&(e.R7$(9),e.SpI(" ",n.crmType," CRM "),e.R7$(),e.Y8G("ngIf",!n.isIntegrated&&!n.isLoading),e.R7$(),e.Y8G("ngIf",n.isIntegrated&&!n.IntegrationTable&&!n.isLoading),e.R7$(),e.Y8G("ngIf",n.isLoading),e.R7$(),e.Y8G("ngIf",n.isIntegrated&&n.IntegrationTable),e.R7$(8),e.Lme(" Are you sure you want to ",1==n.isActive?"enable":"disable"," ",n.crmType," Integration? "))},dependencies:[p.YU,p.Sq,p.bT,g.Wk,v.ej,L.b,r.xH,r.y7,r.me,r.BC,r.cb,r.j4,r.JD,r.$R,r.v8,M.vr,M.Uq,M.ZZ,p.P9,p.vh,v.kf],styles:["@charset \"UTF-8\";.sf-page[_ngcontent-%COMP%]{padding:20px 0 24px;display:flex;flex-direction:column;gap:0}.sf-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:14px;margin-bottom:24px}.sf-bc-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#9ca3af;text-decoration:none;cursor:pointer}.sf-bc-link[_ngcontent-%COMP%]:hover{color:#fff}.sf-bc-current[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#f79522;font-weight:500;border-bottom:2px solid #F79522;padding-bottom:4px}.sf-bc-sep[_ngcontent-%COMP%]{color:#9ca3af}.sf-bc-icon[_ngcontent-%COMP%]{width:16px;height:16px;object-fit:contain;flex-shrink:0;filter:brightness(0) saturate(100%) invert(69%) sepia(11%) saturate(405%) hue-rotate(176deg) brightness(91%) contrast(87%);transition:filter .15s}.sf-bc-icon--active[_ngcontent-%COMP%]{filter:brightness(0) saturate(100%) invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%)}.sf-bc-link[_ngcontent-%COMP%]:hover   .sf-bc-icon[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}.sf-loading-wrap[_ngcontent-%COMP%]{height:40vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:#e0e0e0}.sf-center-wrap[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin-top:100px}knit-auth[_ngcontent-%COMP%]   button[slot=trigger][_ngcontent-%COMP%]{background-color:#f79522;color:#fff;padding:15px 20px;font-size:16px;border:none;border-radius:4px;cursor:pointer;display:inline-block}.sf-btn-back[_ngcontent-%COMP%]{background:transparent;border:1px solid #363A47;border-radius:9999px;color:#e0e0e0;font-size:13px;font-weight:500;padding:7px 18px;cursor:pointer;transition:background .15s}.sf-btn-back[_ngcontent-%COMP%]:hover{background:#ffffff0d}.sf-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border:1px solid #3a7bfd;border-radius:9999px;color:#fff;font-size:14px;font-weight:500;padding:9px 24px;cursor:pointer;transition:background .15s}.sf-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1260fd}.sf-btn-primary[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.sf-btn-outline[_ngcontent-%COMP%]{background:transparent;border:1px solid #363A47;border-radius:9999px;color:#e0e0e0;font-size:14px;font-weight:500;padding:9px 24px;cursor:pointer;transition:background .15s}.sf-btn-outline[_ngcontent-%COMP%]:hover:not(:disabled){background:#ffffff0d}.sf-btn-outline[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.sf-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:12px;overflow:hidden}.sf-card-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;cursor:pointer;transition:background .15s}.sf-card-header[_ngcontent-%COMP%]:hover{background:#ffffff05}.sf-card-title[_ngcontent-%COMP%]{font-size:15px;font-weight:500;color:#fff;margin:0}.sf-card-body[_ngcontent-%COMP%]{padding:20px;border-top:1px solid #363A47}.sf-section-label[_ngcontent-%COMP%]{font-size:16px;font-weight:500;color:#fff;letter-spacing:.5px;margin-bottom:10px;margin-top:0}.sf-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;flex:1}.sf-field-action[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:11px;flex-shrink:0}.sf-label[_ngcontent-%COMP%]{font-size:14px;color:#a3a3a3}.sf-required[_ngcontent-%COMP%]{color:#ef4444;margin-left:2px}.sf-input[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;width:100%;height:44px;outline:none;font-family:Lato,sans-serif;box-sizing:border-box}.sf-input[_ngcontent-%COMP%]::placeholder{color:#555868}.sf-input[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important}.sf-input[_ngcontent-%COMP%]:disabled{opacity:.7;cursor:default}.sf-select[_ngcontent-%COMP%]{appearance:none;-webkit-appearance:none;background-color:#191b21!important;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\")!important;background-repeat:no-repeat!important;background-position:right 12px center!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:0 36px 0 14px;font-size:14px;width:100%;height:44px;outline:none;box-sizing:border-box;
1cursor:pointer;color-scheme:dark}.sf-select[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}.sf-select[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important;outline:none}.sf-row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}.sf-condition-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:12px;align-items:end}.sf-map-row[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:flex-end;margin-bottom:12px}.sf-add-link[_ngcontent-%COMP%]{color:#3a7bfd;font-size:14px;cursor:pointer;display:inline-block;text-decoration:none}.sf-add-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.sf-trash[_ngcontent-%COMP%]{font-size:16px!important;color:#ef4444!important;cursor:pointer}.sf-trash[_ngcontent-%COMP%]:hover{opacity:.75}.sf-footer-right[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}[_nghost-%COMP%]     .sf-multiselect .dropdown-btn{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;min-height:44px;padding:8px 14px!important;font-size:14px}[_nghost-%COMP%]     .sf-multiselect .dropdown-btn .selected-item{background:#f79522!important;border:1px solid #F79522!important;color:#fff!important;border-radius:4px!important;max-width:200px!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-btn span:not(.selected-item){color:#9ca3af!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-btn .selected-item span{color:#fff!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-btn .dropdown-multiselect__caret{filter:invert(.6)}[_nghost-%COMP%]     .sf-multiselect .dropdown-list{background:#1d1f26!important;border:1px solid #363A47!important;border-radius:8px!important;width:auto!important;min-width:160px!important;max-width:260px!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-list li{color:#e0e0e0!important;background:transparent!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-list li:hover{background:#ffffff0d!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-list li div, [_nghost-%COMP%]     .sf-multiselect .dropdown-list li span, [_nghost-%COMP%]     .sf-multiselect .dropdown-list li label{color:#e0e0e0!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-list .multiselect-item-checkbox div{color:#e0e0e0!important}[_nghost-%COMP%]     .sf-multiselect .dropdown-list .filter-textbox input{background:#191b21!important;color:#fff!important;border:1px solid #363A47!important;border-radius:6px!important}.sf-topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}.sf-toggle-wrap[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;cursor:pointer;margin:0}.sf-toggle-input[_ngcontent-%COMP%]{position:absolute;opacity:0;width:0;height:0}.sf-toggle-track[_ngcontent-%COMP%]{width:36px;height:20px;background:#363a47;border-radius:9999px;position:relative;transition:background .2s;display:block}.sf-toggle-thumb[_ngcontent-%COMP%]{position:absolute;top:3px;left:3px;width:14px;height:14px;background:#fff;border-radius:50%;transition:transform .2s;display:block}.sf-toggle-input[_ngcontent-%COMP%]:checked ~ .sf-toggle-track[_ngcontent-%COMP%]{background:#f79522}.sf-toggle-input[_ngcontent-%COMP%]:checked ~ .sf-toggle-track[_ngcontent-%COMP%]   .sf-toggle-thumb[_ngcontent-%COMP%]{transform:translate(16px)}.sf-toggle-input[_ngcontent-%COMP%]:disabled ~ .sf-toggle-track[_ngcontent-%COMP%]{opacity:.4;cursor:not-allowed}.sf-stats-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;margin-bottom:24px}@media (max-width: 1024px){.sf-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(4,1fr)}}@media (max-width: 600px){.sf-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}.sf-stat-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:10px;padding:18px 12px;display:flex;flex-direction:column;align-items:center;gap:6px}.sf-stat-value[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#fff;line-height:1}.sf-stat-label[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af;text-align:center;white-space:nowrap}.sf-table-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;
1gap:12px;margin-bottom:16px}.sf-search-wrap[_ngcontent-%COMP%]{position:relative}.sf-search-icon[_ngcontent-%COMP%]{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:#9ca3af;pointer-events:none}.sf-search-input[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:9px 14px 9px 36px;font-size:14px;width:280px;height:40px;outline:none;font-family:Lato,sans-serif}.sf-search-input[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.sf-search-input[_ngcontent-%COMP%]:focus{border-color:#f79522!important}.sf-table-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:12px;overflow:hidden;overflow-x:auto}.sf-table[_ngcontent-%COMP%]{width:100%;--bs-table-border-color: transparent;border-spacing:0}.sf-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{color:#9ca3af!important;background:transparent!important;border-bottom:1px solid #363A47!important;padding:14px 16px!important;font-size:13px;font-weight:600;white-space:nowrap;vertical-align:middle!important}.sf-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{color:#e0e0e0!important;background:transparent!important;padding:14px 16px!important;font-size:13px;vertical-align:middle!important;border-top:none!important;border-bottom:none!important}.sf-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] + tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border-top:1px solid rgba(255,255,255,.06)!important}.sf-empty[_ngcontent-%COMP%]{text-align:center;padding:48px 0;color:#9ca3af;font-size:14px}.sf-pagination-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:12px;padding:16px 0}.sf-page-size[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:4px 8px;font-size:13px;height:34px;flex-shrink:0}.sf-page-size[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}[_nghost-%COMP%]     .sf-pagination-row .ngx-pagination{display:flex;align-items:center;list-style:none;padding:0;margin:0;gap:2px;flex-shrink:0}[_nghost-%COMP%]     .sf-pagination-row .ngx-pagination a, [_nghost-%COMP%]     .sf-pagination-row .ngx-pagination button, [_nghost-%COMP%]     .sf-pagination-row .ngx-pagination span{color:#9ca3af!important;font-size:13px}[_nghost-%COMP%]     .sf-pagination-row .ngx-pagination a:hover, [_nghost-%COMP%]     .sf-pagination-row .ngx-pagination button:hover{color:#fff!important;background:transparent!important}[_nghost-%COMP%]     .sf-pagination-row .ngx-pagination .current{background:#3a7bfd!important;color:#fff!important;border-radius:6px;padding:3px 10px}[_nghost-%COMP%]     .sf-pagination-row .ngx-pagination .disabled{opacity:.4}.sf-modal[_ngcontent-%COMP%]{background:#0f1116!important;border:1px solid #2A2D38!important;border-radius:14px!important;overflow:hidden;box-shadow:0 24px 48px #0009!important}.sf-modal-body[_ngcontent-%COMP%]{padding:24px}.sf-modal-msg[_ngcontent-%COMP%]{color:#e0e0e0;font-size:15px;line-height:1.6;margin-bottom:20px}.sf-modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding-top:8px}.sf-modal-footer--center[_ngcontent-%COMP%]{justify-content:center}.sf-template-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;margin-top:16px}.card-template[_ngcontent-%COMP%]{width:calc(25% - 24px);background:#191b21!important;border:1px solid #363A47!important;color:#e0e0e0}.card-template[_ngcontent-%COMP%]   .card-body[_ngcontent-%COMP%]{padding:1rem;background:#191b21!important}.card-template[_ngcontent-%COMP%]   h6[_ngcontent-%COMP%]{font-size:1rem;margin-bottom:0;color:#e0e0e0}.card-template[_ngcontent-%COMP%]:hover{box-shadow:0 .5rem 1rem #0006;color:#f79522;cursor:pointer}.card-img-top[_ngcontent-%COMP%]{height:100%;width:100%}.clickable-area[_ngcontent-%COMP%]{position:relative;height:100%;cursor:pointer}.selected[_ngcontent-%COMP%]{outline:3px solid #F79522;outline-offset:-3px;border-radius:5px}.cardheader[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.card1[_ngcontent-%COMP%]{width:400px;height:185px;background-image:url(https://merrenbucket.s3.ap-south-1.amazonaws.com/background-image.png);background-size:100%;background-repeat:no-repeat}.cardinfom[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;margin-top:42px;border-radius:5px}.circlef[_ngcontent-%COMP%]{height:60px;background-color:#5bdfb0;border-radius:50%;color:#fff;padding-top:20px;font-size:23px}.stitle-ellipsis[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:14px;color:#fff}.borderbottobm[_ngcontent-%COMP%]{border-top:1px solid #272B37}[_nghost-%COMP%]     .sf-ng-select.ng-select .ng-select-container{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;min-height:44px;color:#fff!important}[_nghost-%COMP%]     .sf-ng-select.ng-select .ng-select-container .ng-value-container{padding-left:14px}[_nghost-%COMP%]     .sf-ng-select.ng-select .ng-select-container .ng-value-container .ng-placeholder{color:#9ca3af!important}[_nghost-%COMP%]     .sf-ng-select.ng-select .ng-select-container .ng-value-container .ng-input>input{color:#fff!important}[_nghost-%COMP%]     .sf-ng-select.ng-select .ng-select-container .ng-arrow-wrapper .ng-arrow{border-color:#9ca3af transparent transparent}[_nghost-%COMP%]     .sf-ng-select.ng-select.ng-select-focused .ng-select-container{border-color:#3a7bfd!important;box-shadow:none!important}[_nghost-%COMP%]     .sf-ng-select.ng-select .ng-select-container .ng-value-container .ng-value{background:transparent!important;border:none!important;color:#fff!important;font-size:14px}[_nghost-%COMP%]     .sf-ng-select .ng-dropdown-panel{background:#1d1f26!important;border:1px solid #363A47!important;border-radius:10px!important;box-shadow:0 8px 24px #00000080!important}[_nghost-%COMP%]     .sf-ng-select .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background:#1d1f26!important;color:#e0e0e0!important;font-size:14px}[_nghost-%COMP%]     .sf-ng-select .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected, [_nghost-%COMP%]     .sf-ng-select .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked{background:#f795221f!important;color:#fff!important}[_nghost-%COMP%]     .sf-ng-select .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked{background:#2d2f3e!important;color:#fff!important}@media (max-width: 640px){.sf-select[_ngcontent-%COMP%]{font-size:16px;max-width:100%}.sf-input[_ngcontent-%COMP%]{font-size:16px}.sf-page[_ngcontent-%COMP%]{padding:12px 0 80px}.sf-loading-wrap[_ngcontent-%COMP%]{width:100%;height:60vh;justify-content:center;align-items:center}.sf-card-body[_ngcontent-%COMP%]{padding:14px}.sf-card-header[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:12px}.sf-row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}.sf-condition-row[_ngcontent-%COMP%]{position:relative;grid-template-columns:1fr!important;gap:8px!important;background:#ffffff08;border:1px solid #363A47;border-radius:10px;padding:14px;margin-bottom:10px}.sf-condition-row[_ngcontent-%COMP%]   .sf-field[_ngcontent-%COMP%]{width:100%;gap:2px}.sf-field-action[_ngcontent-%COMP%]{position:absolute;top:10px;right:12px;padding:0}.sf-btn-primary[_ngcontent-%COMP%]{width:180px;align-self:center;display:block;text-align:center}[_nghost-%COMP%]     .sf-condition-row .sf-ng-select{width:100%!important;display:block!important}.sf-map-row[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;border:1px solid #363A47;border-radius:10px;padding:12px;margin-bottom:10px}.sf-footer-right[_ngcontent-%COMP%]{justify-content:center}.sf-footer-right[_ngcontent-%COMP%]   .sf-btn-primary[_ngcontent-%COMP%]{width:180px}.savebtn[_ngcontent-%COMP%]{display:flex;justify-content:center}[_nghost-%COMP%]     .sf-multiselect .dropdown-list{max-width:calc(100vw - 48px)!important}.sf-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)!important}.sf-stat-card[_ngcontent-%COMP%]:last-child{grid-column:1/-1}.sf-table-toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch}.sf-search-input[_ngcontent-%COMP%]{width:100%}}"]})}return o}
1)(),Ao=(()=>{class o{static#e=this.\u0275fac=function(i){return new(i||o)};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-salceforce-integration"]],decls:2,vars:0,template:function(i,n){1&i&&(e.j41(0,"p"),e.EFF(1,"salceforce-integration works!"),e.k0s())}})}return o})();var Vo=h(1917);function Lo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",10)(1,"div",11),e.nrm(2,"img",12),e.j41(3,"h3",13),e.EFF(4,"Success!"),e.k0s(),e.j41(5,"p",14),e.EFF(6,"Your WhatsApp Business APIs are successfully set-up"),e.k0s(),e.j41(7,"button",15),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onFacebookTemplateClick())}),e.EFF(8,"OK"),e.k0s()()()}}function $o(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",10)(1,"div",11)(2,"h3",16),e.nrm(3,"i",17),e.k0s(),e.j41(4,"p",14),e.EFF(5,"Failed to set-up your WhatsApp Business APIs."),e.k0s(),e.j41(6,"button",15),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onClickErrorMsg())}),e.EFF(7,"OK"),e.k0s()()()}}function Bo(o,s){1&o&&(e.j41(0,"small"),e.EFF(1,"Title is required."),e.k0s())}function Xo(o,s){1&o&&(e.j41(0,"small"),e.EFF(1,"Only lowercase, numbers, and underscores are allowed."),e.k0s())}function zo(o,s){if(1&o&&(e.j41(0,"div",38),e.DNE(1,Bo,2,0,"small",39)(2,Xo,2,0,"small",39),e.k0s()),2&o){let t,i;const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",null==(t=n.templateForm.get("title"))||null==t.errors?null:t.errors.required),e.R7$(),e.Y8G("ngIf",null==(i=n.templateForm.get("title"))||null==i.errors?null:i.errors.pattern)}}function Yo(o,s){if(1&o&&(e.j41(0,"option",40),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.FS9("value",null==t?null:t.code),e.R7$(),e.JRh(null==t?null:t.language)}}function qo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",10)(1,"div",18)(2,"h2",19),e.EFF(3,"Create Template"),e.k0s(),e.j41(4,"form",20)(5,"div",21)(6,"label",22),e.EFF(7,"Title "),e.j41(8,"span",23),e.EFF(9,"*"),e.k0s()(),e.nrm(10,"input",24),e.DNE(11,zo,3,2,"div",25),e.k0s(),e.j41(12,"div",21)(13,"label",22),e.EFF(14,"Language "),e.j41(15,"span",23),e.EFF(16,"*"),e.k0s()(),e.j41(17,"select",26)(18,"option",27),e.EFF(19,"Select language"),e.k0s(),e.DNE(20,Yo,2,2,"option",28),e.k0s()(),e.j41(21,"div",21)(22,"label",22),e.EFF(23,"Body "),e.j41(24,"span",23),e.EFF(25,"*"),e.k0s()(),e.nrm(26,"textarea",29),e.k0s(),e.j41(27,"div",21)(28,"label",22),e.EFF(29,"Template Category "),e.j41(30,"span",23),e.EFF(31,"*"),e.k0s()(),e.j41(32,"select",30)(33,"option",31),e.EFF(34,"Select Category"),e.k0s(),e.j41(35,"option",32),e.EFF(36,"AUTHENTICATION"),e.k0s(),e.j41(37,"option",33),e.EFF(38,"MARKETING"),e.k0s(),e.j41(39,"option",34),e.EFF(40,"UTILITY"),e.k0s()()(),e.j41(41,"div",35)(42,"button",36),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.closeTemplatePopup())}),e.EFF(43,"Close"),e.k0s(),e.j41(44,"button",37),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onCreateTemplate())}),e.EFF(45,"Create"),e.k0s()()()()()}if(2&o){let t;const i=e.XpG();e.R7$(4),e.Y8G("formGroup",i.templateForm),e.R7$(7),e.Y8G("ngIf",(null==(t=i.templateForm.get("title"))?null:t.touched)&&(null==(t=i.templateForm.get("title"))?null:t.invalid)),e.R7$(9),e.Y8G("ngForOf",i.languages)}}function Uo(o,s){1&o&&(e.j41(0,"section",41)(1,"h5",42),e.EFF(2,"Your WhatsApp Business APIs are getting set-up. Please wait a moment..."),e.k0s(),e.j41(3,"div",43)(4,"span",44),e.EFF(5,"Loading..."),e.k0s()()())}function Jo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",10)(1,"div",45)(2,"div",46)(3,"button",47),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.backToChannel())}),e.EFF(4,"\xd7"),e.k0s()(),e.j41(5,"div",48)(6,"div",49)(7,"p",50),e.EFF(8,"Connect your business number to WhatsApp API"),e.k0s(),e.j41(9,"div",51)(10,"div",52),e.nrm(11,"img",53),e.k0s(),e.j41(12,"span",54),e.EFF(13,"\u21c4"),e.k0s(),e.j41(14,"div",52),e.nrm(15,"img",55),e.k0s()()(),e.j41(16,"div",56),e.nrm(17,"img",57),e.k0s()(),e.j41(18,"div",58)(19,"button",59),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.backToChannel())}),e.EFF(20,"Previous"),e.k0s(),e.j41(21,"button",15),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.goToNext())}),e.EFF(22,"Continue"),e.k0s()()()()}}function Wo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",10)(1,"div",45)(2,"button",47),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.backToCard())}),e.EFF(3,"\xd7"),e.k0s(),e.j41(4,"h2",19),e.EFF(5,"Pre-requisites to connect your phone number with WhatsApp Business API"),e.k0s(),e.j41(6,"div",60),e.nrm(7,"img",61),e.j41(8,"span",62),e.EFF(9,"\u21c4"),e.k0s(),e.nrm(10,"img",63),e.j41(11,"span",62),e.EFF(12,"\u21c4"),e.k0s(),e.nrm(13,"img",64),e.k0s(),e.j41(14,"ul",65)(15,"li")(16,"span",66),e.nrm(17,"img",67),e.k0s(),e.EFF(18," A suitable business phone number to receive the OTP. This should not be your personal WhatsApp number "),e.k0s(),e.j41(19,"li")(20,"span",68),e.nrm(21,"img",69),e.k0s(),e.EFF(22," If you are currently using WhatsApp with that number, please delete that account. "),e.k0s(),e.j41(23,"li")(24,"span",70),e.nrm(25,"img",71),e.k0s(),e.EFF(26," Access to facebook "),e.k0s()(),e.j41(27,"div",72)(28,"input",73),e.mxI("ngModelChange",function(n){e.eBV(t);const a=e.XpG();return e.DH7(a.isConfirmed,n)||(a.isConfirmed=n),e.Njj(n)}
1),e.k0s(),e.j41(29,"label",74),e.EFF(30,"I am ready with the above pre-requisites"),e.k0s()(),e.j41(31,"div",35)(32,"button",59),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.goToBack())}),e.EFF(33,"Previous"),e.k0s(),e.j41(34,"button",75),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.login())}),e.EFF(35,"Continue"),e.k0s()()()()}if(2&o){const t=e.XpG();e.R7$(28),e.R50("ngModel",t.isConfirmed),e.R7$(6),e.Y8G("disabled",!t.isConfirmed)}}function Ho(o,s){1&o&&(e.j41(0,"section",41)(1,"div",43)(2,"span",44),e.EFF(3,"Loading..."),e.k0s()()())}function Qo(o,s){if(1&o){const t=e.RV6();e.j41(0,"tr")(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s(),e.j41(7,"td"),e.EFF(8),e.k0s(),e.j41(9,"td"),e.EFF(10),e.k0s(),e.j41(11,"td")(12,"button",16),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG();return e.Njj(a.openTemplates(n.waba_id))}),e.EFF(13,"View Templates"),e.k0s()()()}if(2&o){const t=s.$implicit;e.R7$(2),e.JRh(t.display_phone_number),e.R7$(2),e.JRh(t.verified_name),e.R7$(2),e.JRh(t.phone_number_id),e.R7$(2),e.JRh(t.business_id),e.R7$(2),e.JRh(t.waba_id)}}function Zo(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",17)(1,"div",18)(2,"span",19),e.EFF(3,"Phone Number"),e.k0s(),e.j41(4,"span",20),e.EFF(5),e.k0s()(),e.j41(6,"div",18)(7,"span",19),e.EFF(8,"Display Name"),e.k0s(),e.j41(9,"span",20),e.EFF(10),e.k0s()(),e.j41(11,"div",18)(12,"span",19),e.EFF(13,"Phone No.ID"),e.k0s(),e.j41(14,"span",20),e.EFF(15),e.k0s()(),e.j41(16,"div",18)(17,"span",19),e.EFF(18,"Business ID"),e.k0s(),e.j41(19,"span",20),e.EFF(20),e.k0s()(),e.j41(21,"div",21)(22,"span",22),e.EFF(23),e.k0s(),e.j41(24,"button",23),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG();return e.Njj(a.openTemplates(n.waba_id))}),e.EFF(25,"View Templates"),e.k0s()()()}if(2&o){const t=s.$implicit;e.R7$(5),e.JRh(t.display_phone_number||"NA"),e.R7$(5),e.JRh(t.verified_name||"NA"),e.R7$(5),e.JRh(t.phone_number_id||"NA"),e.R7$(5),e.JRh(t.business_id||"NA"),e.R7$(3),e.SpI("Waba_ID : ",t.waba_id||"NA","")}}function ta(o,s){if(1&o&&(e.j41(0,"div")(1,"div",15)(2,"div",16)(3,"span",17),e.EFF(4),e.k0s()(),e.j41(5,"div",18)(6,"p",19),e.EFF(7),e.k0s(),e.j41(8,"button",20),e.EFF(9,"Yes, Thank you."),e.k0s(),e.j41(10,"p",21),e.EFF(11),e.k0s()()()()),2&o){const t=s.$implicit,i=e.XpG();e.R7$(3),e.Y8G("ngClass",i.getStatusClass(t.status)),e.R7$(),e.JRh(t.status),e.R7$(2),e.FS9("title",null==t||null==t.components[0]?null:t.components[0].text),e.R7$(),e.SpI(" ",null==t||null==t.components[0]?null:t.components[0].text," "),e.R7$(4),e.JRh(null==t?null:t.name)}}function na(o,s){1&o&&(e.j41(0,"small"),e.EFF(1,"Title is required."),e.k0s())}function ia(o,s){1&o&&(e.j41(0,"small"),e.EFF(1,"Only lowercase, numbers, and underscores are allowed."),e.k0s())}function oa(o,s){if(1&o&&(e.j41(0,"div",27),e.DNE(1,na,2,0,"small",42)(2,ia,2,0,"small",42),e.k0s()),2&o){let t,i;const n=e.XpG(2);e.R7$(),e.Y8G("ngIf",null==(t=n.templateForm.get("title"))||null==t.errors?null:t.errors.required),e.R7$(),e.Y8G("ngIf",null==(i=n.templateForm.get("title"))||null==i.errors?null:i.errors.pattern)}}function aa(o,s){if(1&o&&(e.j41(0,"option",43),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.FS9("value",null==t?null:t.code),e.R7$(),e.JRh(null==t?null:t.language)}}function sa(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",22)(1,"div",23)(2,"h2",24),e.EFF(3,"Create Template"),e.k0s(),e.j41(4,"form",25)(5,"div",26)(6,"label"),e.EFF(7,"Title "),e.j41(8,"span",27),e.EFF(9,"*"),e.k0s()(),e.nrm(10,"input",28),e.DNE(11,oa,3,2,"div",29),e.k0s(),e.j41(12,"div",26)(13,"label"),e.EFF(14,"Language "),e.j41(15,"span",27),e.EFF(16,"*"),e.k0s()(),e.j41(17,"select",30)(18,"option",31),e.EFF(19,"Select language"),e.k0s(),e.DNE(20,aa,2,2,"option",32),e.k0s()(),e.j41(21,"div",26)(22,"label"),e.EFF(23,"Body "),e.j41(24,"span",27),e.EFF(25,"*"),e.k0s()(),e.nrm(26,"textarea",33),e.k0s(),e.j41(27,"div",26)(28,"label"),e.EFF(29,"Template Category "),e.j41(30,"span",27),e.EFF(31,"*"),e.k0s()(),e.j41(32,"select",34)(33,"option",35),e.EFF(34,"Select Category"),e.k0s(),e.j41(35,"option",36),e.EFF(36,"AUTHENTICATION"),e.k0s(),e.j41(37,"option",37),e.EFF(38,"MARKETING"),e.k0s(),e.j41(39,"option",38),e.EFF(40,"UTILITY"),e.k0s()()(),e.j41(41,"div",39)(42,"button",40),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.closeTemplatePopup())}),e.EFF(43,"Close"),e.k0s(),e.j41(44,"button",41),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onCreateTemplate())}),e.EFF(45,"Create"),e.k0s()()()()()}if(2&o){let t;const i=e.XpG();e.R7$(4),e.Y8G("formGroup",i.templateForm),e.R7$(7),e.Y8G("ngIf",(null==(t=i.templateForm.get("title"))?null:t.touched)&&(null==(t=i.templateForm.get("title"))?null:t.invali
1d)),e.R7$(9),e.Y8G("ngForOf",i.languages)}}const la=["publishsurveyModel"],ca=["uploadModel"],da=["questioncoutzeroModel"],$=(o,s,t)=>({totalItems:o,itemsPerPage:s,currentPage:t});function pa(o,s){1&o&&(e.j41(0,"div",59),e.qSk(),e.j41(1,"svg",60),e.nrm(2,"circle",61)(3,"line",62)(4,"line",63),e.k0s(),e.EFF(5," Push message upload is in progress... "),e.k0s())}function ua(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",76),e.qSk(),e.j41(1,"svg",77),e.nrm(2,"circle",78)(3,"line",79),e.k0s(),e.joV(),e.j41(4,"input",80),e.bIt("input",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.searchSurveyByName(n))}),e.k0s()()}}function ma(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",81),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.exportRespondantDetails())}),e.qSk(),e.j41(1,"svg",82),e.nrm(2,"path",83)(3,"polyline",84)(4,"line",85),e.k0s(),e.EFF(5," Export CSV "),e.k0s()}}function ga(o,s){1&o&&(e.j41(0,"div",86),e.nrm(1,"div",87),e.k0s())}function ha(o,s){if(1&o&&(e.j41(0,"tr")(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s(),e.j41(7,"td"),e.EFF(8),e.k0s(),e.j41(9,"td"),e.EFF(10),e.nI1(11,"date"),e.k0s(),e.j41(12,"td"),e.EFF(13),e.nI1(14,"date"),e.k0s(),e.j41(15,"td")(16,"span",91),e.EFF(17),e.k0s()(),e.j41(18,"td",92),e.EFF(19),e.k0s()()),2&o){const t=s.$implicit;e.R7$(2),e.JRh(t.phone_number?t.phone_number:"-"),e.R7$(2),e.JRh(t.uniqueId||"\u2014"),e.R7$(2),e.SpI("",t.surveyProgress||"\u2014","%"),e.R7$(2),e.JRh(t.campaignName?t.campaignName:"-"),e.R7$(2),e.JRh(t.created_at?e.i5U(11,11,t.created_at,"dd-MMM-yyyy h:mm a"):"-"),e.R7$(3),e.JRh(t.modified_at?e.i5U(14,14,t.modified_at,"dd-MMM-yyyy h:mm a"):"-"),e.R7$(3),e.AVh("pm-status--active","sent"===t.surveyStatus||"delivered"===t.surveyStatus),e.R7$(),e.SpI(" ",t.surveyStatus?t.surveyStatus:"-"," "),e.R7$(),e.FS9("title",t.failedReason?t.failedReason:"-"),e.R7$(),e.SpI(" ",t.failedReason?t.failedReason:"-"," ")}}function fa(o,s){if(1&o&&(e.j41(0,"div",88)(1,"table",89)(2,"thead")(3,"tr")(4,"th"),e.EFF(5,"Number"),e.k0s(),e.j41(6,"th"),e.EFF(7,"UID"),e.k0s(),e.j41(8,"th"),e.EFF(9,"Survey Progress"),e.k0s(),e.j41(10,"th"),e.EFF(11,"Campaign"),e.k0s(),e.j41(12,"th"),e.EFF(13,"Created At"),e.k0s(),e.j41(14,"th"),e.EFF(15,"Last Event On"),e.k0s(),e.j41(16,"th"),e.EFF(17,"Status"),e.k0s(),e.j41(18,"th"),e.EFF(19,"Status Reason"),e.k0s()()(),e.j41(20,"tbody"),e.DNE(21,ha,20,17,"tr",90),e.nI1(22,"paginate"),e.k0s()()()),2&o){const t=e.XpG(2);e.R7$(21),e.Y8G("ngForOf",e.i5U(22,1,t.usersArr,e.sMw(4,$,t.count,t.pageSize,t.page)))}}function _a(o,s){if(1&o&&(e.j41(0,"div",95)(1,"div",96)(2,"span",97),e.EFF(3),e.k0s(),e.j41(4,"span",98),e.EFF(5),e.k0s()(),e.j41(6,"div",99)(7,"div",100),e.EFF(8),e.k0s(),e.j41(9,"div",100),e.EFF(10),e.k0s(),e.j41(11,"div",100),e.EFF(12),e.k0s(),e.j41(13,"div",100),e.EFF(14),e.nI1(15,"date"),e.k0s(),e.j41(16,"div",101),e.EFF(17),e.nI1(18,"date"),e.k0s()(),e.j41(19,"div",102),e.EFF(20),e.k0s()()),2&o){const t=s.$implicit;e.R7$(3),e.JRh(t.phone_number?t.phone_number:"-"),e.R7$(),e.AVh("fp-mob-badge--complete","sent"===t.surveyStatus||"delivered"===t.surveyStatus)("fp-mob-badge--failed","failed"===t.surveyStatus),e.R7$(),e.SpI(" ",t.surveyStatus?t.surveyStatus:"\u2014"," "),e.R7$(3),e.SpI("UID : ",t.uniqueId||"\u2014",""),e.R7$(2),e.SpI("Campaign : ",t.campaignName||"\u2014",""),e.R7$(2),e.SpI("Survey Progress : ",t.surveyProgress||"0","%"),e.R7$(2),e.SpI("Created At : ",t.created_at?e.i5U(15,12,t.created_at,"M/d/yy, h:mm a"):"\u2014",""),e.R7$(3),e.SpI("Last Event On : ",t.modified_at?e.i5U(18,15,t.modified_at,"M/d/yy, h:mm a"):"NA",""),e.R7$(3),e.SpI("Status Reason : ",t.failedReason?t.failedReason:"NA","")}}function ba(o,s){if(1&o&&(e.j41(0,"div",93),e.DNE(1,_a,21,18,"div",94),e.nI1(2,"paginate"),e.k0s()),2&o){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",e.i5U(2,1,t.usersArr,e.sMw(4,$,t.count,t.pageSize,t.page)))}}function va(o,s){if(1&o&&(e.j41(0,"option",106),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.Y8G("value",t),e.R7$(),e.JRh(t)}}function xa(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",103)(1,"pagination-controls",104),e.bIt("pageChange",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageChange(n))}),e.k0s(),e.j41(2,"select",105),e.bIt("change",function(n){e.eBV(t);const a=e.XpG(2);return e.Njj(a.handlePageSizeChange(n))}),e.DNE(3,va,2,2,"option",42),e.k0s()()}if(2&o){const t=e.XpG(2);e.R7$(3),e.Y8G("ngForOf",t.pageSizes)}}function ka(o,s){1&o&&(e.j41(0,"div",107)(1,"p"),e.EFF(2,"No recipients found."),e.k0s()())}function ya(o,s){if(1&o&&(e.qex(0),e.j41(1,"div",64)(2,"div",65)(3,"span",66),e.EFF(4),e.k0s(),e.j41(5,"span",67),e.EFF(6,"Total"),e.k0s()(),e.j41(7,"div",65)(8,"span",66),e.EFF(9),e.k0s(),e.j41(10,"span",67),e.EFF(11,"Sent"),e.k0s()(),e.j41(12,"div",65)(13,"span",66),e.EFF(14),e.k0s(),e.j41(15,"span",67),e.EFF(16,"Delivered"),e.k0s()(),e.j41(17,"div",65)(18,"span",66),e.EFF(19),e.k0s(),e.j41(20,"span",67),e.EFF(21,"Failed"),e.k0s()(),e.j41(22,"div",65)(23,"span",66),e.EFF(24),e.k0s(),e.j41(25,"span",67),e.EFF(26,"Read"),e.k0s()(),e.j41(27,"div",65)(28,"span",66),e.EFF(29),e.k0s(),e.j41(30,"span",67),e.EFF(31,"Survey Started"),e.k0s()(),e.j41(32,"div",65)(33,"span",66),e.EFF(34),e.k0s(),e.j41(35,"span",67),e.EFF(36,"
1Survey Completed"),e.k0s()()(),e.j41(37,"div",68),e.DNE(38,ua,5,0,"div",69)(39,ma,6,0,"button",70),e.k0s(),e.DNE(40,ga,2,0,"div",71)(41,fa,23,8,"div",72)(42,ba,3,8,"div",73)(43,xa,4,1,"div",74)(44,ka,3,0,"div",75),e.bVm()),2&o){let t,i,n,a,l,c,m;const d=e.XpG();e.R7$(4),e.JRh(null!==(t=null==d.pushMsgStatusObj?null:d.pushMsgStatusObj.total)&&void 0!==t?t:0),e.R7$(5),e.JRh(null!==(i=null==d.pushMsgStatusObj?null:d.pushMsgStatusObj.sent)&&void 0!==i?i:0),e.R7$(5),e.JRh(null!==(n=null==d.pushMsgStatusObj?null:d.pushMsgStatusObj.delivered)&&void 0!==n?n:0),e.R7$(5),e.JRh(null!==(a=null==d.pushMsgStatusObj?null:d.pushMsgStatusObj.failed)&&void 0!==a?a:0),e.R7$(5),e.JRh(null!==(l=null==d.pushMsgStatusObj?null:d.pushMsgStatusObj.read)&&void 0!==l?l:0),e.R7$(5),e.JRh(null!==(c=null==d.pushMsgStatusObj?null:d.pushMsgStatusObj.started)&&void 0!==c?c:0),e.R7$(5),e.JRh(null!==(m=null==d.pushMsgStatusObj?null:d.pushMsgStatusObj.completed)&&void 0!==m?m:0),e.R7$(4),e.Y8G("ngIf",0!=d.usersArr.length),e.R7$(),e.Y8G("ngIf",0!=d.usersArr.length),e.R7$(),e.Y8G("ngIf",d.isLoading),e.R7$(),e.Y8G("ngIf",!d.isLoading&&(null==d.usersArr?null:d.usersArr.length)>0),e.R7$(),e.Y8G("ngIf",!d.isLoading&&(null==d.usersArr?null:d.usersArr.length)>0),e.R7$(),e.Y8G("ngIf",!d.isLoading&&(null==d.usersArr?null:d.usersArr.length)>0),e.R7$(),e.Y8G("ngIf",!(d.isLoading||d.usersArr&&0!==d.usersArr.length))}}function Ca(o,s){if(1&o&&(e.j41(0,"span",108),e.EFF(1),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.JRh(t.campaignNameValidation)}}function Fa(o,s){if(1&o&&(e.j41(0,"option",106),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.FS9("value",t.display_phone_number),e.R7$(),e.Lme(" (",null==t?null:t.verified_name,") - ",t.display_phone_number," ")}}function ja(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",109),e.bIt("click",function(){const n=e.eBV(t).$implicit,a=e.XpG();return e.Njj(a.selectTemplate(n))}),e.j41(1,"p",110),e.EFF(2),e.k0s(),e.j41(3,"div",111)(4,"button",112),e.EFF(5,"Yes, Thank you."),e.k0s(),e.j41(6,"span",113),e.EFF(7),e.k0s()()()}if(2&o){const t=s.$implicit,i=e.XpG();e.AVh("pm-template-card--selected",i.selectedTemplate===t),e.R7$(2),e.JRh(null==t||null==t.components[0]?null:t.components[0].text),e.R7$(5),e.JRh(null==t?null:t.name)}}function Ma(o,s){if(1&o&&(e.j41(0,"option",106),e.EFF(1),e.k0s()),2&o){const t=s.$implicit;e.FS9("value",t.campaignId),e.R7$(),e.SpI(" ",t.campaignName," ")}}function wa(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",35)(1,"label",36),e.EFF(2,"Select Xoxoday Rewards Campaign (Optional)"),e.k0s(),e.j41(3,"select",40),e.bIt("change",function(n){e.eBV(t);const a=e.XpG();return a.xoxodayCampaignId=n.target.value,e.Njj(a.onCampaignSelected(n.target.value))}),e.j41(4,"option",114),e.EFF(5),e.k0s(),e.DNE(6,Ma,2,2,"option",42),e.k0s()()}if(2&o){const t=e.XpG();
1e.R7$(4),e.Y8G("selected",""==t.xoxodayCampaignId),e.R7$(),e.SpI(" ",""==t.xoxodayCampaignId?"Select Campaign Name":"Unselect Campaign Name"," "),e.R7$(),e.Y8G("ngForOf",t.compaignlist)}}function Pa(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",35)(1,"label",36),e.EFF(2,"Number of Rewards "),e.j41(3,"span",37),e.EFF(4,"*"),e.k0s()(),e.j41(5,"input",115),e.bIt("input",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.reward=n.target.value)}),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(5),e.FS9("value",t.reward)}}function Oa(o,s){if(1&o){const t=e.RV6();e.j41(0,"div",35)(1,"label",36),e.EFF(2,"Rewards Expiry Date "),e.j41(3,"span",37),e.EFF(4,"*"),e.k0s()(),e.j41(5,"input",116),e.bIt("input",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.expiryDate=n.target.value)}),e.mxI("ngModelChange",function(n){e.eBV(t);const a=e.XpG();return e.DH7(a.selectedDate,n)||(a.selectedDate=n),e.Njj(n)}),e.k0s()()}if(2&o){const t=e.XpG();e.R7$(5),e.FS9("value",t.expiryDate),e.R50("ngModel",t.selectedDate),e.Y8G("min",t.minDate)}}const Ea=[{path:"",component:ze,canActivateChild:[_.q],data:{roles:[u.X.Customer,u.X.Creator,u.X.Viewer]},children:[{path:"",redirectTo:"channels",pathMatch:"full"},{path:"deployments",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:me},{path:"push-msg",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:we},{path:"webchat-push",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Ae},{path:"options",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:at},{path:"channels",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Rt},{path:"email",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Fn},{path:"whatsapp-push",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:jn},{path:"facebook",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Mn},{path:"crm/:name",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Go},{path:"integrations",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Nn},{path:"integrations/moEngage",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Un},{path:"integrations/custom",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Ai},{path:"salceforceintegration",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:Ao},{path:"facebook-embedded",canActivate:[_.q],data:{roles:[u.X.Creator,u.X.Customer]},component:(()=>{class o{constructor(t,i,n,a,l,c,m){this.fbAuthService=t,this.dashboardService=i,this.router=n,this.authenticationService=a,this.toastrService=l,this.fb=c,this.route=m,this.showSuccess=!1,this.showSignupForm=!1,this.showTemplatePopup=!1,this.isLoading=!0,this.isLoginLoading=!1,this.pageLoader=!1,this.showError=!1,this.whatsappapicard=!1,this.WPcard=!1,this.isConfirmed=!1,this.isCardLoading=!1,this.languages=[{language:"Afrikaans",code:"af"},{language:"Albanian",code:"sq"},{language:"Arabic",code:"ar"},{language:"Arabic (EGY)",code:"ar_EG"},{language:"Arabic (UAE)",code:"ar_AE"},{language:"Arabic (LBN)",code:"ar_LB"},{language:"Arabic (MAR)",code:"ar_MA"},{language:"Arabic (QAT)",code:"ar_QA"},{language:"Azerbaijani",code:"az"},{language:"Belarusian",code:"be_BY"},{language:"Bengali",code:"bn"},{language:"Bengali (IND)",code:"bn_IN"},{language:"Bulgarian",code:"bg"},{language:"Catalan",code:"ca"},{language:"Chinese (CHN)",code:"zh_CN"},{language:"Chinese (HKG)",code:"zh_HK"},{language:"Chinese (TAI)",code:"zh_TW"},{language:"Croatian",code:"hr"},{language:"Czech",code:"cs"},{language:"Danish",code:"da"},{language:"Dari",code:"prs_AF"},{language:"Dutch",code:"nl"},{language:"Dutch (BEL)",code:"nl_BE"},{language:"English",code:"en"},{language:"English (UK)",code:"en_GB"},{language:"English (US)",code:"en_US"},{language:"English (UAE)",code:"en_AE"},{language:"English (AUS)",code:"en_AU"},{language:"English (CAN)",code:"en_CA"},{language:"English (GHA)",code:"en_GH"},{language:"English (IRL)",code:"en_IE"},{language:"English (IND)",code:"en_IN"},{language:"English (JAM)",code:"en_JM"},{language:"English (MYS)",code:"en_MY"},{language:"English (NZL)",code:"en_NZ"},{language:"English (QAT)",code:"en_QA"},{language:"English (SGP)",code:"en_SG"},{language:"English (UGA)",code:"en_UG"},{language:"English (ZAF)",code:"en_ZA"},{language:"Estonian",code:"et"},{language:"Filipino",code:"fil"},{language:"Finnish",code:"fi"},{language:"French",code:"fr"},{language:"French (BEL)",code:"fr_BE"},{language:"French (CAN)",code:"fr_CA"},{language:"French (CHE)",code:"fr_CH"},{language:"French (CIV)",code:"fr_CI"},{language:"French (MAR)",code:"fr_MA"},{language:"Georgian",code:"ka"},{language:"German",code:"de"}
1,{language:"German (AUT)",code:"de_AT"},{language:"German (CHE)",code:"de_CH"},{language:"Greek",code:"el"},{language:"Gujarati",code:"gu"},{language:"Hausa",code:"ha"},{language:"Hebrew",code:"he"},{language:"Hindi",code:"hi"},{language:"Hungarian",code:"hu"},{language:"Indonesian",code:"id"},{language:"Irish",code:"ga"},{language:"Italian",code:"it"},{language:"Japanese",code:"ja"},{language:"Kannada",code:"kn"},{language:"Kazakh",code:"kk"},{language:"Kinyarwanda",code:"rw_RW"},{language:"Korean",code:"ko"},{language:"Kyrgyz (Kyrgyzstan)",code:"ky_KG"},{language:"Lao",code:"lo"},{language:"Latvian",code:"lv"},{language:"Lithuanian",code:"lt"},{language:"Macedonian",code:"mk"},{language:"Malay",code:"ms"},{language:"Malayalam",code:"ml"},{language:"Marathi",code:"mr"},{language:"Norwegian",code:"nb"},{language:"Pashto",code:"ps_AF"},{language:"Persian",code:"fa"},{language:"Polish",code:"pl"},{language:"Portuguese (BR)",code:"pt_BR"},{language:"Portuguese (POR)",code:"pt_PT"},{language:"Punjabi",code:"pa"},{language:"Romanian",code:"ro"},{language:"Russian",code:"ru"},{language:"Serbian",code:"sr"},{language:"Sinhala",code:"si_LK"},{language:"Slovak",code:"sk"},{language:"Slovenian",code:"sl"},{language:"Spanish",code:"es"},{language:"Spanish (ARG)",code:"es_AR"},{language:"Spanish (CHL)",code:"es_CL"},{language:"Spanish (COL)",code:"es_CO"},{language:"Spanish (CRI)",code:"es_CR"},{language:"Spanish (DOM)",code:"es_DO"},{language:"Spanish (ECU)",code:"es_EC"},{language:"Spanish (HND)",code:"es_HN"},{language:"Spanish (MEX)",code:"es_MX"},{language:"Spanish (PAN)",code:"es_PA"},{language:"Spanish (PER)",code:"es_PE"},{language:"Spanish (SPA)",code:"es_ES"},{language:"Spanish (URY)",code:"es_UY"},{language:"Swahili",code:"sw"},{language:"Swedish",code:"sv"},{language:"Tamil",code:"ta"},{language:"Telugu",code:"te"},{language:"Thai",code:"th"},{language:"Turkish",code:"tr"},{language:"Ukrainian",code:"uk"},{language:"Urdu",code:"ur"},{language:"Uzbek",code:"uz"},{language:"Vietnamese",code:"vi"},{language:"Zulu",code:"zu"}],this.handleMessageEvent=d=>{if("https://www.facebook.com"!==d.origin&&"https://web.facebook.com"!==d.origin)return;let f;if(this.isLoginLoading=!0,"string"==typeof d.data)try{f=JSON.parse(d.data)}catch{return void console.warn("Non-JSON message received:",d.data)}else f=d.data;"WA_EMBEDDED_SIGNUP"===f?.type&&setTimeout(()=>{console.log("WhatsApp Signup Event Received:",f);const C=JSON.parse(localStorage.getItem("currentUser"));this.waba_id=f?.data?.waba_id;const Aa={phone_number_id:f?.data?.phone_number_id,waba_id:f?.data?.waba_id,business_id:f?.data?.business_id,event:f?.event,type:f?.type,version:f?.version,email:C?.email,accessToken:localStorage.getItem("fbaccesscode")},Va=this.authenticationService.accessibilityData?._id;this.dashboardService.saveEmbddedDetails(Aa,Va).subscribe(T=>{this.isLoginLoading=!1,this.showSuccess=!0,console.log("Saved successfully:",T)},T=>{this.isLoginLoading=!1,this.showSuccess=!1,console.error("Error saving details:",T)})},1e4),"FB_LOGIN_SUCCESS"===f?.type&&(console.log("FB Login Code received:",f.code),console.log("The access code is",f.code)),"FB_LOGIN_FAILURE"===f?.type&&(console.error("FB login failed:",f.response),this.showError=!0)},this.loadSDK()}ngOnInit(){this.templateForm=this.fb.group({title:["",[r.k0.required,r.k0.pattern("^[a-z0-9_]+$")]],language:["en_US",r.k0.required],body:["",r.k0.required],category:["MARKETING",r.k0.required]}),this.checkAlreadyEmbeddedUser(),window.addEventListener("message",this.handleMessageEvent)}loadSDK(){window.fbAsyncInit=function(){FB.init({appId:"1731186714036694",autoLogAppEvents:!0,xfbml:!0,version:"v22"})}}checkAlreadyEmbeddedUser(){this.isCardLoading=!0;const t=JSON.parse(localStorage.getItem("currentUser"));this.dashboardService.checkAlreadyEmbeddedUser(t?.email).subscribe(i=>{this.isCardLoading=!1,this.isLoading=!1,1==i?.isAlreadyEmbeddedUser?this.router.navigateByUrl("/survey/deploy-survey/facebook-push"):this.WPcard=!0,console.log(i)},i=>{this.isCardLoading=!1,this.isLoading=!1,console.error(i)})}login(){if(this.whatsappapicard=!1,"https:"!==window.location.protocol)return console.error("Facebook login requires HTTPS."),this.toastrService.error("Something went wrong. Please try again."),void this.router.navigate(["/survey/deploy-survey/channels"]);try{launchWhatsAppSignup(),console.log("Signup function triggered.")}catch(t){console.error("Unexpected error:",t),this.toastrService.error("Something went wrong. Please try again."),this.router.navigate(["/survey/deploy-survey/channels"])}}login1(){"function"==typeof window.launchWhatsAppSignup?window.launchWhatsAppSignup().then(t=>{console.log("WhatsApp signup success:",t),alert(t)}).catch(t=>{console.error("WhatsApp signup failed:",t)}):console.error("launchWhatsAppSignup is not defined.")}saveData(t,i){this.dashboardService.saveEmbddedDetails(t,i).subscribe(n=>{console.log(t)},n=>{console.error(n)})}ngOnDestroy(){window.removeEventListener("message",this.handleMessageEvent)}onClickErrorMsg(){this.showError=!1,this.isLoading=!1,this.pageLoader=!1}onFacebookTemplateClick(){this.showTemplatePopup=!1,this.showSuccess=!1,this.router.navigateByUrl("/survey/deploy-survey/facebook-embedded-phone-list")}closeTemplatePopup(){this.showTemplatePopup=!1,this.showSuccess=!1,this.router.navigateByUrl("/survey/deploy-survey/facebook-embedded-phone-list")}createTemplate(){this.templateForm.valid?(console.log("Template Created:",this.templateForm.value),this.showTemplatePopup=!1):this.templateForm.markAllAsTouched()}onFacebookLoginClick(){console.log("Button clicked!"),this.showSuccess=!0}openSignupForm(){this.showSuccess=!1,this.showSignupForm=!0}
1onCreateTemplate(){if(this.templateForm.invalid)return void this.toastrService.error("Please fill all required fields");this.pageLoader=!0;const t=this.templateForm.value;this.dashboardService.createFbTemplate({name:t.title,category:t.category,language:t?.language||"en_US",text:t.body,waba_id:this.waba_id}).subscribe({next:n=>{this.toastrService.success("Template created successfully"),this.pageLoader=!1,this.templateForm.reset(),this.closeTemplatePopup(),this.WPcard=!0},error:n=>{this.toastrService.error(n?.message),console.error("Error:",n),this.pageLoader=!1}})}goToNext(){this.whatsappapicard=!0,this.WPcard=!1}goToWb(){this.isConfirmed&&this.router.navigateByUrl("/survey/deploy-survey/facebook-push")}goToBack(){this.whatsappapicard=!1,this.WPcard=!0}backToChannel(){this.router.navigateByUrl("/survey/deploy-survey/channels")}backToCard(){this.whatsappapicard=!1,this.WPcard=!0}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(Vo.W),e.rXU(V.I),e.rXU(g.Ix),e.rXU(F.k),e.rXU(x.tw),e.rXU(r.ok),e.rXU(g.nX))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-facebook-embed"]],decls:23,vars:7,consts:[[1,"fb-page"],[1,"fb-breadcrumb"],["routerLink","/survey/deploy-survey/channels",1,"fb-bc-link"],[1,"fb-bc-sep"],["routerLink","/survey/deploy-survey/facebook-embedded",1,"fb-bc-link"],[1,"fb-bc-current"],[1,"fb-page-title"],[1,"fb-title-accent"],["class","fb-overlay",4,"ngIf"],["class","fb-loading-wrap",4,"ngIf"],[1,"fb-overlay"],[1,"fb-card","text-center"],["src","../assets/icons/tick-2-svgrepo-com 1.svg","alt","Success Icon",1,"fb-success-icon"],[1,"fb-success-title"],[1,"fb-card-msg"],[1,"fb-btn-primary",3,"click"],[1,"fb-error-title"],[1,"fa","fa-exclamation-triangle"],[1,"fb-modal"],[1,"fb-modal-title"],[3,"formGroup"],[1,"fb-form-group"],[1,"fb-label"],[1,"fb-required"],["formControlName","title","type","text","maxlength","40","placeholder","Template Title",1,"fb-input"],["class","fb-error",4,"ngIf"],["formControlName","language",1,"fb-select"],["selected","","default",""],[3,"value",4,"ngFor","ngForOf"],["formControlName","body","placeholder","Add your message",1,"fb-textarea"],["formControlName","category",1,"fb-select"],["value","","disabled","","selected",""],["value","AUTHENTICATION"],["value","MARKETING"],["value","UTILITY"],[1,"fb-modal-footer"],["type","button",1,"fb-btn-outline",3,"click"],["type","submit",1,"fb-btn-primary",3,"click"],[1,"fb-error"],[4,"ngIf"],[3,"value"],[1,"fb-loading-wrap"],[1,"fb-loading-msg"],["role","status",1,"spinner-grow",2,"color","#F79522"],[1,"sr-only"],[1,"fb-modal","fb-modal--wide"],[1,"close-header"],[1,"fb-close-btn",3,"click"],[1,"fb-wp-content"],[1,"fb-wp-left"],[1,"fb-wp-title"],[1,"fb-icon-row"],[1,"fb-icon-circle"],["src","../assets/icons/whatapp.svg","alt","WhatsApp"],[1,"fb-icon-arrow"],["src","../assets/icons/people-svgrepo-com 1.svg","alt","Team"],[1,"fb-wp-right"],["src","../assets/icons/phone_14_01 [Converted] 2.svg","alt","Phone",1,"fb-phone-img"],[1,"fb-modal-footer","fb-modal-footer--wpcard"],[1,"fb-btn-outline",3,"click"],[1,"fb-icon-flow"],["src","../assets/icons/facebook-color-svgrepo-com.svg","alt","Facebook",1,"fb-flow-icon","fb-flow-icon--fb"],[1,"fb-flow-arrow"],["src","../assets/icons/new whatsap.svg","alt","WhatsApp",1,"fb-flow-icon","fb-flow-icon--wp"],["src","../assets/icons/Group 1584.svg","alt","Business",1,"fb-flow-icon"],[1,"fb-req-list"],[1,"fb-req-icon","fb-req-icon--wp"],["src","../assets/icons/new whatsap.svg"],[1,"fb-req-icon","fb-req-icon--tras
1h"],["src","../assets/icons/trash.png"],[1,"fb-req-icon","fb-req-icon--fb"],["src","../assets/icons/facebook-color-svgrepo-com.svg"],[1,"fb-checkbox-row"],["type","checkbox","id","confirm",1,"fb-checkbox",3,"ngModelChange","ngModel"],["for","confirm",1,"fb-checkbox-label"],[1,"fb-btn-primary",3,"click","disabled"]],template:function(i,n){1&i&&(e.j41(0,"div",0)(1,"nav",1)(2,"a",2),e.EFF(3,"Channels"),e.k0s(),e.j41(4,"span",3),e.EFF(5,"\u203a"),e.k0s(),e.j41(6,"a",4),e.EFF(7,"Facebook Embed"),e.k0s(),e.j41(8,"span",3),e.EFF(9,"\u203a"),e.k0s(),e.j41(10,"span",5),e.EFF(11,"Facebook Embedded Signup"),e.k0s()(),e.j41(12,"h2",6)(13,"span",7),e.EFF(14,"Facebook"),e.k0s(),e.EFF(15," Embedded Signup "),e.k0s()(),e.DNE(16,Lo,9,0,"div",8)(17,$o,8,0,"div",8)(18,qo,46,3,"div",8)(19,Uo,6,0,"section",9)(20,Jo,23,0,"div",8)(21,Wo,36,2,"div",8)(22,Ho,4,0,"section",9)),2&i&&(e.R7$(16),e.Y8G("ngIf",n.showSuccess),e.R7$(),e.Y8G("ngIf",n.showError),e.R7$(),e.Y8G("ngIf",n.showTemplatePopup),e.R7$(),e.Y8G("ngIf",n.isLoginLoading),e.R7$(),e.Y8G("ngIf",n.WPcard),e.R7$(),e.Y8G("ngIf",n.whatsappapicard),e.R7$(),e.Y8G("ngIf",n.isCardLoading))},dependencies:[p.Sq,p.bT,g.Wk,r.qT,r.xH,r.y7,r.me,r.Zm,r.wz,r.BC,r.cb,r.tU,r.vS,r.j4,r.JD],styles:['@charset "UTF-8";.fb-page[_ngcontent-%COMP%]{padding:20px 0 24px}.fb-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:14px;margin-bottom:20px}.fb-bc-link[_ngcontent-%COMP%]{color:#9ca3af;text-decoration:none}.fb-bc-link[_ngcontent-%COMP%]:hover{color:#fff}.fb-bc-sep[_ngcontent-%COMP%]{color:#9ca3af}.fb-bc-current[_ngcontent-%COMP%]{color:#f79522;font-weight:500;border-bottom:2px solid #F79522;padding-bottom:3px}.fb-page-title[_ngcontent-%COMP%]{font-size:22px;font-weight:500;color:#fff;margin-bottom:20px}.fb-title-accent[_ngcontent-%COMP%]{font-size:22px;font-weight:500;color:#fff;border-bottom:2px solid #F79522;display:inline-block;margin-right:5px}.fb-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0009;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;z-index:1000}.fb-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:14px;padding:32px 28px;max-width:360px;width:100%;box-shadow:0 24px 48px #0009}.fb-success-icon[_ngcontent-%COMP%]{width:56px;height:56px;margin-bottom:12px}.fb-success-title[_ngcontent-%COMP%]{color:#22c55e;font-size:20px;font-weight:700;margin-bottom:10px}.fb-error-title[_ngcontent-%COMP%]{color:#ef4444;font-size:32px;margin-bottom:10px}.fb-card-msg[_ngcontent-%COMP%]{font-size:15px;color:#e0e0e0;margin-bottom:20px;line-height:1.5}.fb-modal[_ngcontent-%COMP%]{background:#1c1d26;border:1px solid #606060;border-radius:14px;padding:30px;width:420px;max-width:95vw;box-shadow:0 24px 48px #0009;position:relative;max-height:100vh;overflow-y:auto}.fb-modal--wide[_ngcontent-%COMP%]{width:720px}.fb-modal-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#fff;text-align:center;margin-bottom:24px}.fb-form-group[_ngcontent-%COMP%]{margin-bottom:16px}.fb-label[_ngcontent-%COMP%]{display:block;font-size:13px;font-weight:500;color:#9ca3af;margin-bottom:6px}.fb-required[_ngcontent-%COMP%]{color:#ef4444;margin-left:2px}.fb-error[_ngcontent-%COMP%]{color:#ef4444;font-size:12px;margin-top:4px}.fb-input[_ngcontent-%COMP%], .fb-select[_ngcontent-%COMP%], .fb-textarea[_ngcontent-%COMP%]{width:100%;background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;outline:none;box-sizing:border-box}.fb-input[_ngcontent-%COMP%]::placeholder, .fb-select[_ngcontent-%COMP%]::placeholder, .fb-textarea[_ngcontent-%COMP%]::placeholder{color:#555868}.fb-input[_ngcontent-%COMP%]:focus, .fb-select[_ngcontent-%COMP%]:focus, .fb-textarea[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important}.fb-input[_ngcontent-%COMP%]   option[_ngcontent-%COMP%], .fb-select[_ngcontent-%COMP%]   option[_ngcontent-%COMP%], .fb-textarea[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}.fb-input[_ngcontent-%COMP%]{height:44px}.fb-select[_ngcontent-%COMP%]{height:44px;padding:0 14px}.fb-textarea[_ngcontent-%COMP%]{resize:vertical;min-height:90px;height:auto;padding:10px 14px}.fb-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border:1px solid #3a7bfd;border-radius:9999px;color:#fff;font-size:14px;font-weight:500;padding:9px 24px;
1cursor:pointer;transition:background .15s}.fb-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1260fd}.fb-btn-primary[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.fb-btn-outline[_ngcontent-%COMP%]{background:transparent;border:1px solid #363A47;border-radius:9999px;color:#e0e0e0;font-size:14px;font-weight:500;padding:9px 24px;cursor:pointer;transition:background .15s}.fb-btn-outline[_ngcontent-%COMP%]:hover{background:#ffffff0d}.fb-modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;justify-content:flex-end;padding-top:20px}.fb-close-btn[_ngcontent-%COMP%]{position:absolute;top:10px;right:14px;width:30px;height:30px;border-radius:50%;border:1px solid #BCBCBC;background:transparent;color:#bcbcbc;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}.fb-close-btn[_ngcontent-%COMP%]:hover{background:#191b21;color:#fff}.fb-wp-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;background:linear-gradient(90deg,#fff1e0,#f79522cc);border:1px solid rgba(247,149,34,.25);align-items:center;justify-content:space-between;flex-wrap:wrap;border-radius:16px;margin-bottom:8px;overflow:hidden}.fb-wp-left[_ngcontent-%COMP%]{flex:1;padding:28px;min-width:260px}.fb-wp-title[_ngcontent-%COMP%]{font-size:20px;font-weight:500;color:#000;margin-bottom:24px;line-height:1.5}.fb-icon-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px}.fb-icon-circle[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:50%;border:1.5px solid #FFFFFF;background:#ffffff14;display:flex;align-items:center;justify-content:center}.fb-icon-circle[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:24px;height:24px}.fb-icon-arrow[_ngcontent-%COMP%]{font-size:20px;color:#f79522}.fb-wp-right[_ngcontent-%COMP%]{flex:1;display:flex;justify-content:center;align-items:center;min-width:260px}.fb-phone-img[_ngcontent-%COMP%]{width:200px;max-width:100%;height:auto;padding-top:16px}.fb-icon-flow[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:12px;margin-bottom:24px}.fb-flow-icon[_ngcontent-%COMP%]{height:36px;width:36px;border-radius:6px;padding:5px}.fb-flow-icon--fb[_ngcontent-%COMP%]{background:#c8d9ff}.fb-flow-icon--wp[_ngcontent-%COMP%]{background:#99ffcd}.fb-flow-icon[_ngcontent-%COMP%]:not(.fb-flow-icon--fb):not(.fb-flow-icon--wp){background:#ffebd3}.fb-flow-arrow[_ngcontent-%COMP%]{font-size:18px;color:#9ca3af}.fb-req-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0 0 20px}.fb-req-list[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;margin-bottom:16px;font-size:14px;font-weight:400;color:#e0e0e0;line-height:1.5}.fb-req-icon[_ngcontent-%COMP%]{flex-shrink:0;width:32px;height:32px;border-radius:6px;display:flex;align-items:center;justify-content:center;padding:4px}.fb-req-icon[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:20px;height:20px;object-fit:contain}.fb-req-icon--fb[_ngcontent-%COMP%]{background:#c8d9ff}.fb-req-icon--wp[_ngcontent-%COMP%]{background:#99ffcd}
1.fb-req-icon--trash[_ngcontent-%COMP%]{background:#ffe4e4}.fb-checkbox-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-top:20px}.fb-checkbox[_ngcontent-%COMP%]{width:auto!important;height:auto!important;padding:0!important;margin:0!important;accent-color:#3a7bfd;flex-shrink:0}.fb-checkbox-label[_ngcontent-%COMP%]{font-size:14px;color:#e0e0e0;font-weight:400;margin:0}.fb-loading-wrap[_ngcontent-%COMP%]{height:40vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}.fb-loading-msg[_ngcontent-%COMP%]{font-size:15px;color:#e0e0e0;text-align:center;max-width:480px;font-weight:500}.close-header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-bottom:20px}@media (max-width: 640px){.fb-modal[_ngcontent-%COMP%]{padding:20px 14px 28px;overflow:visible}.fb-modal--wide[_ngcontent-%COMP%]{width:95vw}.close-header[_ngcontent-%COMP%]{margin-bottom:32px}.fb-wp-content[_ngcontent-%COMP%]{flex-wrap:nowrap;align-items:stretch;overflow:visible;min-height:190px}.fb-wp-left[_ngcontent-%COMP%]{min-width:0;flex:1;padding:20px 10px 20px 16px;display:flex;flex-direction:column;justify-content:flex-start}.fb-wp-title[_ngcontent-%COMP%]{top:0;font-size:15px;margin-bottom:10px}.fb-icon-circle[_ngcontent-%COMP%]{width:38px;height:38px}.fb-icon-circle[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:18px;height:18px}.fb-icon-arrow[_ngcontent-%COMP%]{font-size:16px}.fb-wp-right[_ngcontent-%COMP%]{min-width:0;flex:0 0 auto;display:flex;align-items:flex-end;justify-content:flex-end;overflow:visible}.fb-phone-img[_ngcontent-%COMP%]{width:105px;padding-top:0;margin-top:-10px;align-self:flex-end}.fb-modal-footer--wpcard[_ngcontent-%COMP%]{justify-content:center;padding-top:16px}.fb-modal-footer--wpcard[_ngcontent-%COMP%]   .fb-btn-outline[_ngcontent-%COMP%]{display:none!important}.fb-modal-footer--wpcard[_ngcontent-%COMP%]   .fb-btn-primary[_ngcontent-%COMP%]{min-width:70%;text-align:center}.fb-modal-footer[_ngcontent-%COMP%]:not(.fb-modal-footer--wpcard){flex-wrap:wrap;gap:10px;padding-top:16px}.fb-modal-footer[_ngcontent-%COMP%]:not(.fb-modal-footer--wpcard)   .fb-btn-outline[_ngcontent-%COMP%], .fb-modal-footer[_ngcontent-%COMP%]:not(.fb-modal-footer--wpcard)   .fb-btn-primary[_ngcontent-%COMP%]{flex:1;text-align:center;min-width:0}.fb-modal-title[_ngcontent-%COMP%]{font-size:16px;font-weight:400;line-height:1.3;margin-top:24px;margin-bottom:16px;text-align:left}.fb-icon-flow[_ngcontent-%COMP%]{justify-content:flex-start}.fb-req-list[_ngcontent-%COMP%]   li[_ngcontent-%COMP%], .fb-checkbox-label[_ngcontent-%COMP%]{font-size:13px}}']})}return o})()},{path:"facebook-embedded-phone-list",component:(()=>{class o{constructor(t,i){this.surveyService=t,this.router=i,this.phoneList=[]}openTemplates(t){this.router.navigate(["/survey/deploy-survey/facebook-templates"],{queryParams:{wabaId:t}})}ngOnInit(){this.loadPhoneList()}loadPhoneList(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.getEmbeddedPhoneList(t?.email).subscribe({next:i=>{console.log("API Success Response:",i),this.phoneList=i?.data||i},error:i=>{console.error("API error:",i)}})}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(b.I),e.rXU(g.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-facebook-embedded-phone-list"]],decls:38,vars:2,consts:[[1,"fp-page"],[1,"fp-breadcrumb"],[1,"fp-bc-items"],["routerLink","/survey/deploy-survey/channels",1,"fp-bc-link"],["src","assets/icons/task-square.svg","alt","",1,"fp-bc-icon"],["routerLink","/survey/deploy-survey/facebook-push",1,"fp-bc-link"],[1,"fab","fa-whatsapp","fp-bc-wa-icon"],[1,"fp-bc-active"],["src","assets/icons/task-square.svg","alt","",1,"fp-bc-icon","fp-bc-icon--orange"],["routerLink","/survey/deploy-survey/facebook-push",1,"btn","fp-btn-primary"],[1,"fp-table-wrap"],[1,"fp-card"],[1,"fp-table"],[4,"ngFor","ngForOf"],[1,"fp-mob-cards"],["class","fp-mob-card",4,"ngFor","ngForOf"],[1,"btn","fp-btn-outline",3,"click"],[1,"fp-mob-card"],[1,"fp-mob-row"],[1,"fp-mob-label"],[1,"fp-mob-value"],[1,"fp-mob-row","fp-mob-row--footer"],[1,"fp-mob-waba"],[1,"btn","fp-btn-outline","fp-mob-view-btn",3,"click"]],template:function(i,n){1&i&&(e.j41(0,"div",0)(1,"nav",1)(2,"div",2)(3,"a",3),e.nrm(4,"img",4),e.EFF(5," Channels "),e.k0s(),e.j41(6,"span",2),e.EFF(7,">"),e.k0s(),e.j41(8,"a",5),e.nrm(9,"i",6),e.EFF(10," Your WhatsApp Business Number "),e.k0s(),e.j41(11,"span",2),e.EFF(12,">
1"),e.k0s(),e.j41(13,"span",7),e.nrm(14,"img",8),e.EFF(15," Business Number Details "),e.k0s()(),e.j41(16,"button",9),e.EFF(17,"WhatsApp Push"),e.k0s()(),e.j41(18,"div",10)(19,"div",11)(20,"table",12)(21,"thead")(22,"tr")(23,"th"),e.EFF(24,"Phone Number"),e.k0s(),e.j41(25,"th"),e.EFF(26,"Display Name"),e.k0s(),e.j41(27,"th"),e.EFF(28,"Phone No. ID"),e.k0s(),e.j41(29,"th"),e.EFF(30,"Business ID"),e.k0s(),e.j41(31,"th"),e.EFF(32,"Waba ID"),e.k0s(),e.nrm(33,"th"),e.k0s()(),e.j41(34,"tbody"),e.DNE(35,Qo,14,5,"tr",13),e.k0s()()()(),e.j41(36,"div",14),e.DNE(37,Zo,26,5,"div",15),e.k0s()()),2&i&&(e.R7$(35),e.Y8G("ngForOf",n.phoneList),e.R7$(2),e.Y8G("ngForOf",n.phoneList))},dependencies:[p.Sq,g.Wk],styles:['@charset "UTF-8";.fp-page[_ngcontent-%COMP%]{padding:24px 24px 40px 4px;min-height:100vh;background:#101116}.fp-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.fp-bc-items[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:13px;color:#9ca3af;flex-wrap:nowrap;white-space:nowrap}.fp-bc-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#9ca3af;text-decoration:none;transition:color .15s}.fp-bc-link[_ngcontent-%COMP%]   .fp-bc-icon[_ngcontent-%COMP%]{transition:filter .15s}.fp-bc-link[_ngcontent-%COMP%]   .fp-bc-wa-icon[_ngcontent-%COMP%]{transition:color .15s}.fp-bc-link[_ngcontent-%COMP%]:hover{color:#f79522}.fp-bc-link[_ngcontent-%COMP%]:hover   .fp-bc-icon[_ngcontent-%COMP%]{filter:invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%);opacity:1}.fp-bc-link[_ngcontent-%COMP%]:hover   .fp-bc-wa-icon[_ngcontent-%COMP%]{color:#f79522}.fp-bc-icon[_ngcontent-%COMP%]{width:16px;height:16px;opacity:.6;vertical-align:middle}.fp-bc-icon--orange[_ngcontent-%COMP%]{filter:invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%);opacity:1}.fp-bc-wa-icon[_ngcontent-%COMP%]{font-size:16px;color:#9ca3af}.fp-bc-active[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#f79522;font-weight:500;border-bottom:1.5px solid #F79522;padding-bottom:2px}.fp-sep[_ngcontent-%COMP%]{color:#363a47}.fp-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:28px}.fp-title[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#fff;margin:0}.fp-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd!important;border:1px solid #3a7bfd!important;color:#fff!important;border-radius:9999px!important;padding:8px 22px!important;font-size:14px!important;cursor:pointer;transition:background .15s}.fp-btn-primary[_ngcontent-%COMP%]:hover{background:#2563eb!important;border-color:#2563eb!important}.fp-btn-outline[_ngcontent-%COMP%]{background:transparent!important;border:1px solid #3a7bfd!important;color:#3a7bfd!important;border-radius:9999px!important;padding:6px 18px!important;font-size:13px!important;cursor:pointer;white-space:nowrap;transition:background .15s,color .15s}.fp-btn-outline[_ngcontent-%COMP%]:hover{background:#3a7bfd1a!important}.fp-table-wrap[_ngcontent-%COMP%]{width:100%;overflow-x:auto}.fp-card[_ngcontent-%COMP%]{background:#1d1f26;border-radius:12px;overflow:hidden}.fp-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.fp-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]{border-bottom:1px solid #363A47}.fp-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{padding:14px 16px;font-size:13px;font-weight:500;color:#9ca3af;white-space:nowrap;text-align:left}.fp-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:14px 16px;font-size:14px;color:#e0e0e0;white-space:nowrap}.fp-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:last-child{text-align:right}.fp-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] + tr[_ngcontent-%COMP%]{border-top:1px solid #363A47}.fp-mob-cards[_ngcontent-%COMP%]{display:none}@media (max-width: 640px){.fp-page[_ngcontent-%COMP%]{padding:12px 14px 80px}.fp-breadcrumb[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:10px;margin-bottom:16px}div.fp-bc-items[_ngcontent-%COMP%]{display:block;font-size:13px;line-height:2;overflow:hidden}span.fp-bc-items[_ngcontent-%COMP%]{display:inline;font-size:13px;margin:0 5px}.fp-bc-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;max-width:227px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;font-size:16px;font-weight:400}.fp-bc-active[_ngcontent-%COMP%]{display:block;width:-moz-fit-content;width:fit-content;margin-top:4px;font-size:16px;font-weight:400;white-space:nowrap}.fp-btn-primary[_ngcontent-%COMP%]{width:100%!important;text-align:center!important;border-radius:9999px!important}.fp-table-wrap[_ngcontent-%COMP%]{display:none}.fp-mob-cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.fp-mob-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:12px;overflow:hidden;padding:14px 14px 0}.fp-mob-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding-bottom:10px;font-size:13px}.fp-mob-label[_ngcontent-%COMP%]{color:#9ca3af;font-size:11px}.fp-mob-value[_ngcontent-%COMP%]{color:#e0e0e0;font-size:13px;word-break:break-all}.fp-mob-row--footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:space-between;border-top:1px solid #363A47;margin:0 -14px;padding:10px 14px}.fp-mob-waba[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af;word-break:break-all;flex:1;margin-right:10px}.fp-mob-view-btn[_ngcontent-%COMP%]{flex-shrink:0;font-size:12px!important;padding:5px 14px!important}}']})}return o}
1)(),data:{roles:[u.X.Creator,u.X.Customer]}},{path:"facebook-templates",component:(()=>{class o{constructor(t,i,n,a){this.fb=t,this.surveyService=i,this.toastrService=n,this.route=a,this.showTemplatePopup=!1,this.templates=[],this.wabaId="",this.languages=[{language:"Afrikaans",code:"af"},{language:"Albanian",code:"sq"},{language:"Arabic",code:"ar"},{language:"Arabic (EGY)",code:"ar_EG"},{language:"Arabic (UAE)",code:"ar_AE"},{language:"Arabic (LBN)",code:"ar_LB"},{language:"Arabic (MAR)",code:"ar_MA"},{language:"Arabic (QAT)",code:"ar_QA"},{language:"Azerbaijani",code:"az"},{language:"Belarusian",code:"be_BY"},{language:"Bengali",code:"bn"},{language:"Bengali (IND)",code:"bn_IN"},{language:"Bulgarian",code:"bg"},{language:"Catalan",code:"ca"},{language:"Chinese (CHN)",code:"zh_CN"},{language:"Chinese (HKG)",code:"zh_HK"},{language:"Chinese (TAI)",code:"zh_TW"},{language:"Croatian",code:"hr"},{language:"Czech",code:"cs"},{language:"Danish",code:"da"},{language:"Dari",code:"prs_AF"},{language:"Dutch",code:"nl"},{language:"Dutch (BEL)",code:"nl_BE"},{language:"English",code:"en"},{language:"English (UK)",code:"en_GB"},{language:"English (US)",code:"en_US"},{language:"English (UAE)",code:"en_AE"},{language:"English (AUS)",code:"en_AU"},{language:"English (CAN)",code:"en_CA"},{language:"English (GHA)",code:"en_GH"},{language:"English (IRL)",code:"en_IE"},{language:"English (IND)",code:"en_IN"},{language:"English (JAM)",code:"en_JM"},{language:"English (MYS)",code:"en_MY"},{language:"English (NZL)",code:"en_NZ"},{language:"English (QAT)",code:"en_QA"},{language:"English (SGP)",code:"en_SG"},{language:"English (UGA)",code:"en_UG"},{language:"English (ZAF)",code:"en_ZA"},{language:"Estonian",code:"et"},{language:"Filipino",code:"fil"},{language:"Finnish",code:"fi"},{language:"French",code:"fr"},{language:"French (BEL)",code:"fr_BE"},{language:"French (CAN)",code:"fr_CA"},{language:"French (CHE)",code:"fr_CH"},{language:"French (CIV)",code:"fr_CI"},{language:"French (MAR)",code:"fr_MA"},{language:"Georgian",code:"ka"},{language:"German",code:"de"},{language:"German (AUT)",code:"de_AT"},{language:"German (CHE)",code:"de_CH"},{language:"Greek",code:"el"},{language:"Gujarati",code:"gu"},{language:"Hausa",code:"ha"},{language:"Hebrew",code:"he"},{language:"Hindi",code:"hi"},{language:"Hungarian",code:"hu"},{language:"Indonesian",code:"id"},{language:"Irish",code:"ga"},{language:"Italian",code:"it"},{language:"Japanese",code:"ja"},{language:"Kannada",code:"kn"},{language:"Kazakh",code:"kk"},{language:"Kinyarwanda",code:"rw_RW"},{language:"Korean",code:"ko"},{language:"Kyrgyz (Kyrgyzstan)",code:"ky_KG"},{language:"Lao",code:"lo"},{language:"Latvian",code:"lv"},{language:"Lithuanian",code:"lt"},{language:"Macedonian",code:"mk"},{language:"Malay",code:"ms"},{language:"Malayalam",code:"ml"},{language:"Marathi",code:"mr"},{language:"Norwegian",code:"nb"},{language:"Pashto",code:"ps_AF"},{language:"Persian",code:"fa"},{language:"Polish",code:"pl"},{language:"Portuguese (BR)",code:"pt_BR"},{language:"Portuguese (POR)",code:"pt_PT"},{language:"Punjabi",code:"pa"},{language:"Romanian",code:"ro"},{language:"Russian",code:"ru"},{language:"Serbian",code:"sr"},{language:"Sinhala",code:"si_LK"},{language:"Slovak",code:"sk"},{language:"Slovenian",code:"sl"},{language:"Spanish",code:"es"},{language:"Spanish (ARG)",code:"es_AR"},{language:"Spanish (CHL)",code:"es_CL"},{language:"Spanish (COL)",code:"es_CO"},{language:"Spanish (CRI)",code:"es_CR"},{language:"Spanish (DOM)",code:"es_DO"},{language:"Spanish (ECU)",code:"es_EC"},{language:"Spanish (HND)",code:"es_HN"},{language:"Spanish (MEX)",code:"es_MX"},{language:"Spanish (PAN)",code:"es_PA"},{language:"Spanish (PER)",code:"es_PE"},{language:"Spanish (SPA)",code:"es_ES"},{language:"Spanish (URY)",code:"es_UY"},{language:"Swahili",code:"sw"},{language:"Swedish",code:"sv"},{language:"Tamil",code:"ta"},{language:"Telugu",code:"te"},{language:"Thai",code:"th"},{language:"Turkish",code:"tr"},{language:"Ukrainian",code:"uk"},{language:"Urdu",code:"ur"},{language:"Uzbek",code:"uz"},{language:"Vietnamese",code:"vi"},{language:"Zulu",code:"zu"}]}ngOnInit(){this.route.queryParams.subscribe(t=>
1{const i=t.wabaId;i&&(this.wabaId=i,this.loadTemplates(i))}),this.templateForm=this.fb.group({title:["",[r.k0.required,r.k0.pattern("^[a-z0-9_]+$")]],language:["en_US",r.k0.required],body:["",r.k0.required],category:["MARKETING",r.k0.required]})}loadTemplates(t){this.surveyService.getMessageTemplatesFromFB(t).subscribe({next:i=>{console.log("this is template data ",i.data),this.templates=i?.data||i},error:i=>{console.error("Error loading templates:",i)}})}onFacebookTemplateClick(){this.showTemplatePopup=!0}closeTemplatePopup(){this.showTemplatePopup=!1,this.templateForm.reset()}onCreateTemplate(){if(this.templateForm.invalid)return void this.toastrService.error("Please fill all required fields");const t=this.templateForm.value;this.surveyService.createFbTemplate({name:t.title,category:t.category,language:t?.language||"en_US",text:t.body,waba_id:this.wabaId}).subscribe({next:n=>{this.toastrService.success("Template created successfully"),this.closeTemplatePopup(),this.templateForm.reset(),this.ngOnInit()},error:n=>{this.toastrService.error("Error creating template"),console.error("Error:",n)}})}getStatusClass(t){return t?t.toLowerCase():""}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(r.ok),e.rXU(b.I),e.rXU(x.tw),e.rXU(g.nX))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-facebook-templates"]],decls:24,vars:2,consts:[[1,"ft-page","pl-2"],[1,"ft-breadcrumb"],[1,"ft-bc-items"],["routerLink","/survey/deploy-survey/channels",1,"ft-bc-link"],["src","assets/icons/shuffle-random.png","alt","",1,"ft-bc-icon"],[1,"ft-sep"],["routerLink","/survey/deploy-survey/facebook-push",1,"ft-bc-link"],[1,"fab","fa-whatsapp","ft-bc-wa-icon"],["routerLink","/survey/deploy-survey/facebook-embedded-phone-list",1,"ft-bc-link"],["src","assets/icons/task-square.svg","alt","",1,"ft-bc-icon"],[1,"ft-bc-active"],["src","assets/icons/task-square.svg","alt","",1,"ft-bc-icon","ft-bc-icon--orange"],[1,"ft-grid"],[4,"ngFor","ngForOf"],["class","ft-modal-backdrop",4,"ngIf"],[1,"ft-card"],[1,"ft-header"],[1,"ft-badge",3,"ngClass"],[1,"ft-card-body"],[1,"ft-desc",3,"title"],[1,"ft-action-btn"],[1,"ft-name"],[1,"ft-modal-backdrop"],[1,"ft-modal"],[1,"ft-modal-title"],[3,"formGroup"],[1,"ft-form-group"],[1,"ft-required"],["formControlName","title","type","text","maxlength","40","placeholder","Template Title"],["class","ft-required",4,"ngIf"],["formControlName","language"],["selected","","default",""],[3,"value",4,"ngFor","ngForOf"],["formControlName","body","placeholder","Add your message"],["formControlName","category"],["value","","disabled","","selected",""],["value","AUTHENTICATION"],["value","MARKETING"],["value","UTILITY"],[1,"ft-modal-actions"],["type","button",1,"ft-btn-outline",3,"click"],["type","submit","data-bs-dismiss","modal",1,"ft-btn-primary",3,"click"],[4,"ngIf"],[3,"value"]],template:function(i,n){1&i&&(e.j41(0,"div",0)(1,"nav",1)(2,"div",2)(3,"a",3),e.nrm(4,"img",4),e.EFF(5," Deployments "),e.k0s(),e.j41(6,"span",5),e.EFF(7,"\u203a"),e.k0s(),e.j41(8,"a",6),e.nrm(9,"i",7),e.EFF(10," Your WhatsApp Business Number "),e.k0s(),e.j41(11,"span",5),e.EFF(12,"\u203a"),e.k0s(),e.j41(13,"a",8),e.nrm(14,"img",9),e.EFF(15," Business Number Details "),e.k0s(),e.j41(16,"span",5),e.EFF(17,"\u203a"),e.k0s(),e.j41(18,"span",10),e.nrm(19,"img",11),e.EFF(20," Facebook Templates "),e.k0s()()(),e.j41(21,"div",12),e.DNE(22,ta,12,5,"div",13),e.k0s()(),e.DNE(23,sa,46,3,"div",14)),2&i&&(e.R7$(22),e.Y8G("ngForOf",n.templates),e.R7$(),e.Y8G("ngIf",n.showTemplatePopup))},dependencies:[p.YU,p.Sq,p.bT,g.Wk,r.qT,r.xH,r.y7,r.me,r.wz,r.BC,r.cb,r.tU,r.j4,r.JD],styles:['@charset "UTF-8";.ft-page[_ngcontent-%COMP%]{padding:24px 24px 40px;min-height:100vh;background:#101116}.ft-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:28px}.ft-bc-items[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:13px;color:#9ca3af;flex-wrap:nowrap;white-space:nowrap}.ft-bc-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#9ca3af;text-decoration:none;transition:color .15s}.ft-bc-link[_ngcontent-%COMP%]   .ft-bc-icon[_ngcontent-%COMP%]{transition:filter .15s}.ft-bc-link[_ngcontent-%COMP%]   .ft-bc-wa-icon[_ngcontent-%COMP%]{transition:color .15s}.ft-bc-link[_ngcontent-%COMP%]:hover{color:#f79522}.ft-bc-link[_ngcontent-%COMP%]:hover   .ft-bc-icon[_ngcontent-%COMP%]{filter:invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%);opacity:1}.ft-bc-link[_ngcontent-%COMP%]:hover   .ft-bc-wa-icon[_ngcontent-%COMP%]{color:#f79522}.ft-bc-icon[_ngcontent-%COMP%]{width:16px;height:16px;filter:brightness(0) invert(1);opacity:.6;vertical-align:middle}.ft-bc-icon--orange[_ngcontent-%COMP%]{filter:invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%);opacity:1}.ft-bc-wa-icon[_ngcontent-%COMP%]{font-size:16px;color:#9ca3af}.ft-bc-active[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#f79522;font-weight:500;border-bottom:1.5px solid #F79522;padding-bottom:2px}.ft-sep[_ngcontent-%COMP%]{color:#363a47}.ft-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));grid-auto-rows:360px;gap:20px;padding-top:20px}.ft-grid[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:100%}.ft-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid rgba(255,255,255,.06);border-radius:16px;height:100%;overflow:hidden;display:flex;flex-direction:column}.ft-header[_ngcontent-%COMP%]{padding:16px 20px 0}.ft-card-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;padding:12px 20px 20px}.ft-badge[_ngcontent-%COMP%]{display:inline-block;align-self:flex-start;font-size:12px;font-weight:600;color:#fff;padding:8px 18px;border-radius:9999px;margin-left:-32px;margin-bottom:14px;text-transform:lowercase}.ft-badge[_ngcontent-%COMP%]:first-letter{text-transform:uppercase}.ft-badge.approved[_ngcontent-%COMP%]{background:#3baf3a}.ft-badge.pending[_ngcontent-%COMP%]{background:#f59e0b}.ft-badge.rejected[_ngcontent-%COMP%]{background:#ef4444}.ft-desc[_ngcontent-%COMP%]{font-size:14px;color:#fff;line-height:1.65;max-height:115.5px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;cursor:pointer;margin-bottom:20px}.ft-action-btn[_ngcontent-%COMP%]{display:block;width:-moz-fit-content;width:fit-content;margin:auto auto 4px;background:transparent;border:1.5px solid #3a7bfd;color:#3a7bfd;border-radius:9999px;padding:9px 28px;font-size:14px;font-weight:500;cursor:pointer;transition:background .15s}.ft-action-btn[_ngcontent-%COMP%]:hover{background:#3a7bfd1a}
1.ft-name[_ngcontent-%COMP%]{text-align:center;margin:16px -20px 0;padding:12px 20px 0;border-top:1px solid rgba(255,255,255,.08);font-size:15px;font-weight:500;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ft-modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;background:#0000008c;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;z-index:1000}.ft-modal[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:14px;padding:30px;width:420px;max-width:95vw}.ft-modal-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:#fff;margin-bottom:22px;text-align:center}.ft-form-group[_ngcontent-%COMP%]{margin-bottom:16px}.ft-form-group[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;font-size:13px;font-weight:500;color:#e0e0e0;margin-bottom:6px}.ft-form-group[_ngcontent-%COMP%]   input[_ngcontent-%COMP%], .ft-form-group[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%], .ft-form-group[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{width:100%;background:#13151c;border:1px solid #363A47;border-radius:8px;color:#fff;font-size:13px;padding:10px 12px;outline:none;box-sizing:border-box}.ft-form-group[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder, .ft-form-group[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]::placeholder, .ft-form-group[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.ft-form-group[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .ft-form-group[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]:focus, .ft-form-group[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]:focus{border-color:#3a7bfd}.ft-form-group[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]   option[_ngcontent-%COMP%], .ft-form-group[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]   option[_ngcontent-%COMP%], .ft-form-group[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#13151c;color:#fff}.ft-form-group[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]{resize:vertical;min-height:80px}.ft-required[_ngcontent-%COMP%]{color:#ef4444;font-size:12px;margin-top:4px}.ft-modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:12px;margin-top:20px}.ft-btn-outline[_ngcontent-%COMP%]{background:transparent;border:1px solid #9ca3af;color:#e0e0e0;border-radius:9999px;padding:8px 24px;font-size:14px;cursor:pointer}.ft-btn-outline[_ngcontent-%COMP%]:hover{background:#ffffff14}.ft-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border:1px solid #3a7bfd;color:#fff;border-radius:9999px;padding:8px 24px;font-size:14px;cursor:pointer}.ft-btn-primary[_ngcontent-%COMP%]:hover{background:#2563eb}.ft-header[_ngcontent-%COMP%]{padding-top:20px}@media (max-width: 640px){.ft-page[_ngcontent-%COMP%]{padding:12px 14px 80px}.ft-bc-items[_ngcontent-%COMP%]{flex-wrap:wrap;gap:4px;white-space:normal}.ft-sep[_ngcontent-%COMP%]{font-size:20px}.ft-bc-link[_ngcontent-%COMP%]{display:inline-block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;font-size:16px;font-weight:400}.ft-bc-items[_ngcontent-%COMP%]   .ft-bc-link[_ngcontent-%COMP%]:nth-child(3){max-width:196px}.ft-bc-active[_ngcontent-%COMP%]{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;font-size:16px;font-weight:400}.ft-grid[_ngcontent-%COMP%]{grid-template-columns:1fr;grid-auto-rows:auto;gap:14px;padding-top:12px}.ft-card[_ngcontent-%COMP%]{height:auto}.ft-header[_ngcontent-%COMP%]{padding:12px 14px 0 0}.ft-card-body[_ngcontent-%COMP%]{padding:8px 14px 14px}.ft-badge[_ngcontent-%COMP%]{margin-left:0;margin-right:0;margin-bottom:10px;font-size:11px;padding:5px 16px 5px 14px;border-radius:0 9999px 9999px 0}.ft-desc[_ngcontent-%COMP%]{-webkit-line-clamp:unset;max-height:none;overflow:visible;display:block;font-size:13px;margin-bottom:14px}.ft-action-btn[_ngcontent-%COMP%]{padding:8px 24px;font-size:13px}.ft-name[_ngcontent-%COMP%]{font-size:13px;margin:12px -14px 0;padding:10px 14px 0}}']})}return o})(),data:{roles:[u.X.Creator,u.X.Customer]}},{path:"facebook-push",component:(()=>
1{class o{constructor(t,i,n,a,l){this.tostr=t,this.surveyService=i,this.CommonService=n,this.authenticationService=a,this.router=l,this.usersArr=[],this.page=0,this.count=0,this.pageSize=5,this.pageSizes=[5,10,15],this.currentPage=0,this.test=[],this.disbaledFlag=!0,this.surveyList=[],this.isLoading=!1,this.isFileLoading=!1,this.surveyId="",this.pushMsgStatusObj={},this.searchRecord="",this.surveyDetails={},this.redirectDetails={},this.campaignName="",this.xoxodayCampaignId="",this.phoneNumbers=[],this.templates=[],this.phoneList=[],this.phoneNumberslist=[],this.wabaId="",this.selectedPhoneNumber="",this.isFileSelected=!1,this.isNumberFetched=!1,this.phoneNumbersArr=[],this.gupshupPhone="",this.campaignNameValidation="";let c=new Date;c=new Date(c.getTime()+864e5),this.minDate=c.toISOString().split("T")[0]}ngOnInit(){this.getSurveyDetails(),this.getAllParticipents(),this.getPushMessageStatus(),this.getxoxodayCampginList(),this.loadPhoneList()}loadPhoneList(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.getEmbeddedPhoneList(t?.email).subscribe(i=>{this.phoneNumberslist=i,i.length>0&&(this.wabaId=i[0].waba_id,console.log(this.wabaId),this.loadTemplates())},i=>{console.log(i)})}getFBPhoneNumbers(){this.surveyService.getFBPhoneNumbers(this.wabaId).subscribe(t=>{console.log(t.data),this.phoneNumbers=t.data})}loadTemplates(){this.surveyService.getMessageTemplatesFromFB(this.wabaId).subscribe({next:t=>{console.log("this is template data ",t.data),this.templates=t?.data||t},error:t=>{console.error("Error loading templates:",t)}})}selectTemplate(t){this.selectedTemplate=t}selectPhnFb(t){this.selectPhnFB=t}handleFileSelect(t){var i=t.target.files;if(i&&i.length>0){this.isFileSelected=!0;var n=i[0];this.uploadedFiles=i[0],(new FileReader).readAsText(n)}}onFileChanged(t){this.fileEvent=t,this.selectedFile=t.target.files[0],this.isFileSelected=!0}createChunk(t,i){let n=[],a=0;const l=t.length+t.length%i+1;for(let c=i;c<l;c+=i)n.push(t.slice(a,c)),a=c;console.log(n),n.map(c=>{this.upload(n)})}getUserAccessibility(){this.isLoading=!0,this.surveyService.getRedirectDetails().subscribe(t=>{this.isLoading=!1,!t||400==t.status&&401==t.status?this.tostr.error("Access denied"):(this.redirectDetails=t,this.getSurveyDetails(),this.getAllParticipents(),this.getPushMessageStatus())},t=>{this.isLoading=!1,this.tostr.error("Access denied")})}getUniqueListBy(t,i){return[...new Map(t.map(n=>[n[i],n])).values()]}saveData1(){let t={surveyId:localStorage.getItem("surveyId"),userData:this.getUniqueListBy(this.test,"phoneNumber"),phone:this.gupshupPhone,campaignName:""!=this.campaignName&&null!=this.campaignName&&null!=this.campaignName?this.campaignName:this.surveyDetails.name,xoxodayCampaignId:this.xoxodayCampaignId,xoxodayLink_expiry:this.formatDate(this.expiryDate),xoxodayNoOfRewards:this.reward,isXoxodayEnabled:!0};this.checkCampName(t)}saveData(){const t=new FormData;t.append("surveyId",localStorage.getItem("surveyId")),t.append("file",this.selectedFile,this.selectedFile?.name),t.append("phone",this.gupshupPhone),console.log("Phone Number: ",this.gupshupPhone),t.append("campaignName",""!=this.campaignName&&null!=this.campaignName&&null!=this.campaignName?this.campaignName:this.surveyDetails.name),this.selectedTemplate&&(t.append("fbTemplateName",this.selectedTemplate.name),t.append("templateLanguage",this.selectedTemplate?.language),this.surveyService.checkTemplateType(this.selectedTemplate)?t.append("isParameterizedTemplate","false"):t.append("isParameterizedTemplate","true")),this.xoxodayCampaignId&&(t.append("xoxodayCampaignId",this.xoxodayCampaignId),t.append("xoxodayLink_expiry",this.formatDate(this.expiryDate)),t.append("xoxodayNoOfRewards",this.reward)),this.checkCampName(t)}checkCampName(t){this.surveyService.checkCampName(localStorage.getItem("surveyId"),this.campaignName).subscribe(i=>{this.upload(t),console.log(i),this.nameEvent.target.value="",this.fileEvent.target.value=""},i=>{this.tostr.error(i),this.nameEvent.target.value="",this.fileEvent.target.value=""})}upload(t){document.getElementById("close-modal").click(),this.surveyService.uploadParticipent(t,this.surveyDetails.surveyPhone).subscribe(n=>{this.xoxodayCampaignId="",this.reward="",this.expiryDate="",this.campaignName="",this.tostr.success(n.message)},n=>{this.tostr.error(n?.message)})}handlePageChange(t){1===t?(this.page=t,this.currentPage=t-1):t>1&&(this.page=t,this.currentPage=this.pageSize*(t-1)),this.getAllParticipents()}handlePageSizeChange(t){this.pageSize=Number(t.target.value),this.page=1,this.currentPage=0,this.getAllParticipents()}getAllParticipents(){this.surveyService.getAllParticipents(this.currentPage,this.pageSize,this.searchRecord).subscribe(t=>{this.usersArr=t.data,this.count=t.count,console.log(t)},t=>{console.error(t)})}getPushMessageStatus(){this.surveyService.getPushMessageStatus().subscribe(t=>{this.pushMsgStatusObj=t},t=>{console.error(t)})}exportRespondantDetails(){this.isFileLoading=!0,this.surveyService.exportRepondantDetailsBySurveyID(localStorage.getItem("surveyId")).subscribe(t=>{this.isFileLoading=!1;const i=new Blob([t],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(i),a=document.createElement("a");a.href=n,a.download=`${this.surveyId}+${new Date}.csv`,a.click()},t=>{this.isFileLoading=!1})}getSurveyDetails(){this.surveyService.getSurveyDetails(localStorage.getItem("surveyId")).then(t=>{this.surveyDetails=t,0==this.isNumberFetched&&this.getPhoneNumbers(),this.isNumberFetched=!0,1==this.surveyDetails?.isPushMessageUpo
1ad&&(this.refreshPush(),this.getPushMessageStatus()),this.isXoxodayEnabled=t.isXoxodayEnabled})}createLink(){"DRAFT"==this.surveyDetails.status?0==this.surveyDetails?.totalNoOfQuestions?this.questioncoutzeroModel.nativeElement.click():this.publishsurveyModel.nativeElement.click():this.uploadModel.nativeElement.click()}refreshPush(){setTimeout(()=>{this.getSurveyDetails()},5e3)}searchSurveyByName(t){this.searchRecord=t.target.value,this.searchRecord=this.searchRecord.trim(),this.getAllParticipents()}updateStatus(t){if(t){let i={id:localStorage.getItem("surveyId"),is_published:!0};this.surveyService.updateSurveyStatus(i).subscribe(n=>{this.tostr.success("Survey Published sucessfully."),this.uploadModel.nativeElement.click(),this.getSurveyDetails()},n=>{console.error(n)})}}goto(t){this.router.navigateByUrl(t?"/dashboard":"/survey/questions")}getPhoneNumbers(){this.surveyService.getPhoneNumbers().subscribe(t=>{t&&(this.phoneNumbersArr=t.whatsAppPhones,0!=this.phoneNumbersArr&&(this.gupshupPhone=this.phoneNumbersArr[0].phone))},t=>{console.error(t)})}getxoxodayCampginList(){const t=JSON.parse(localStorage.getItem("currentUser"));this.surveyService.getxoxodayCampginList(t.userId).subscribe(i=>{i.data&&i.data.campaignList&&i.data.campaignList.data?(this.compaignlist=i.data.campaignList.data,console.log(this.compaignlist)):this.compaignlist=[]},i=>{console.log(i)})}formatDate(t){const i=new Date(t),n=i.getDate(),a=i.getMonth()+1,l=i.getFullYear();return`${n.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}-${l}`}onCampaignSelected(t){this.selectedCampaign=t}validateCampName(t){this.nameEvent=t;const i=/^[a-zA-Z0-9\s]+$/;return i.test(t.target.value)?(this.campaignName=t.target.value,this.campaignNameValidation=""):this.campaignNameValidation="Campaign Name can only contain letters, numbers and spaces.",this.isCampNameValid=i.test(t.target.value),this.isCampNameValid}isFormComplete(){return!(!this.campaignName||!this.gupshupPhone||!this.isFileSelected||!this.isCampNameValid||this.selectedCampaign&&(!this.reward||!this.expiryDate))}resetform(){this.xoxodayCampaignId="",this.campaignName="",this.selectedCampaign="",this.reward="",this.expiryDate="",this.nameEvent.target.value="",this.fileEvent.target.value=""}refreshButton(){this.ngOnInit()}validateInput(t){let i=t.which?t.which:t.keyCode;return!!(8===i||9===i||13===i||i>=37&&i<=40||46===i||/^[A-Za-z0-9\s]+$/.test(t.key))||(t.preventDefault(),!1)}static#e=this.\u0275fac=function(i){return new(i||o)(e.rXU(x.tw),e.rXU(b.I),e.rXU(j.h),e.rXU(F.k),e.rXU(g.Ix))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["app-facebook-push"]],viewQuery:function(i,n){if(1&i&&(e.GBs(la,7),e.GBs(ca,7),e.GBs(da,7)),2&i){let a;e.mGM(a=e.lsd())&&(n.publishsurveyModel=a.first),e.mGM(a=e.lsd())&&(n.uploadModel=a.first),e.mGM(a=e.lsd())&&(n.questioncoutzeroModel=a.first)}},decls:113,vars:9,consts:[["uploadModel",""],["publishsurveyModel",""],["questioncoutzeroModel",""],[1,"pm-page"],[1,"pm-topbar"],[1,"pm-breadcrumb"],[1,"pm-bc-trail"],["routerLink","/survey/deploy-survey/channels",1,"pm-bc-link"],["src","assets/icons/task-square.svg","alt","",1,"pm-bc-icon"],[1,"pm-bc-sep"],[1,"pm-bc-current"],[1,"fab","fa-whatsapp","pm-bc-wa-icon"],[1,"pm-actions-row"],["routerLink","/survey/deploy-survey/facebook-embedded-phone-list",1,"pm-outline-btn"],[1,"d-flex","justify-content-end"],["title","Refresh",1,"pm-refresh-btn",3,"click"],["width","18","height","18","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round"],["d","M23 4v6h-6"],["d","M1 20v-6h6"],["d","M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"],[1,"ml-2","pm-import-btn",3,"click"],["class","pm-inprogress",4,"ngIf"],[4,"ngIf"],["data-bs-toggle","modal","data-bs-target","#fbUploadModal",2,"display","none"],["data-bs-toggle","modal","data-bs-target","#fbPublishSurvy",2,"display","none"],["data-bs-toggle","modal","data-bs-target","#fbQuestionZero",2,"display","none"],["id","close-modal","data-bs-dismiss","modal","data-bs-target","#fbUploadModal",2,"display","none"],["id","fbUploadModal","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered","modal-lg"],[1,"modal-content","pm-modal"],[1,"pm-modal-header"],[1,"pm-modal-title"],["type","button","data-bs-dismiss","modal",1,"pm-modal-close",3,"click"],[1,"fa","fa-times"],[1,"pm-modal-body"],[1,"pm-field"],[1,"pm-label"],[1,"pm-required"],["type","text","placeholder","Campaign name","maxlength","30",1,"pm-input",3,"input","keydown"],["class","pm-error",4,"ngIf"],[1,"pm-select",3,"change"],["value","","disabled","","selected",""],[3,"value",4,"ngFor","ngForOf"],[1,"pm-templates-wrap"],["class","pm-template-card",3,"pm-template-card--selected","click",4,"ngFor","ngForOf"],[1,"pm-label-row"],["href","https://merrenbucket.s3.ap-south-1.amazonaws.com/assets/WhatsApp_Push_Msg/sample_for_whatsapp_push.csv","target","_blank",1,"pm-sample-link"],["type","file","accept",".csv",1,"pm-input",3,"change"],["class","pm-field",4,"ngIf"],[1,"pm-modal-footer"],["data-bs-dismiss","modal",1,"pm-btn-outline",3,"click"],[1,"pm-btn-primary",3,"click","disabled"],["id","fbPublishSurvy","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"modal-dialog","modal
1-dialog-centered"],[1,"pm-modal-body","text-center"],[1,"pm-modal-msg"],[1,"pm-modal-footer","pm-modal-footer--center"],["data-bs-dismiss","modal",1,"pm-btn-primary",3,"click"],["id","fbQuestionZero","data-bs-backdrop","static","tabindex","-1","aria-hidden","true",1,"modal","fade"],[1,"pm-inprogress"],["width","16","height","16","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["cx","12","cy","12","r","10"],["x1","12","y1","8","x2","12","y2","12"],["x1","12","y1","16","x2","12.01","y2","16"],[1,"pm-stats-row"],[1,"pm-stat-card"],[1,"pm-stat-value"],[1,"pm-stat-label"],[1,"pm-toolbar"],["class","pm-search-wrap",4,"ngIf"],["class","pm-export-btn",3,"click",4,"ngIf"],["class","pm-loading",4,"ngIf"],["class","pm-table-card",4,"ngIf"],["class","fp-mob-cards",4,"ngIf"],["class","pm-pagination-row",4,"ngIf"],["class","pm-empty",4,"ngIf"],[1,"pm-search-wrap"],["width","16","height","16","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"pm-search-icon"],["cx","11","cy","11","r","8"],["x1","21","y1","21","x2","16.65","y2","16.65"],["type","text","placeholder","Search",1,"pm-search-input",3,"input"],[1,"pm-export-btn",3,"click"],["width","14","height","14","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"],["points","7 10 12 15 17 10"],["x1","12","y1","15","x2","12","y2","3"],[1,"pm-loading"],["role","status",1,"spinner-grow",2,"color","#F79522"],[1,"pm-table-card"],[1,"pm-table"],[4,"ngFor","ngForOf"],[1,"pm-status"],[3,"title"],[1,"fp-mob-cards"],["class","fp-mob-card",4,"ngFor","ngForOf"],[1,"fp-mob-card"],[1,"fp-mob-card-header"],[1,"fp-mob-phone"],[1,"fp-mob-badge"],[1,"fp-mob-fields"],[1,"fp-mob-field"],[1,"fp-mob-field","fp-mob-field--full"],[1,"fp-mob-footer"],[1,"pm-pagination-row"],["previousLabel","Prev","nextLabel","Next","responsive","true",3,"pageChange"],[1,"pm-page-size",3,"change"],[3,"value"],[1,"pm-empty"],[1,"pm-error"],[1,"pm-template-card",3,"click"],[1,"pm-template-desc"],[1,"pm-template-footer"],[1,"pm-template-action-btn"],[1,"pm-template-name"],["value","",3,"selected"],["type","number","placeholder","Rewards","pattern","[0-9]*","onkeypress","return event.charCode >= 48 && event.charCode <= 57",1,"pm-input",3,"input","value"],["type","date",1,"pm-input",3,"input","ngModelChange","value","ngModel","min"]],template:function(i,n){if(1&i){const a=e.RV6();e.j41(0,"div",3)(1,"div",4)(2,"nav",5)(3,"div",6)(4,"a",7),e.nrm(5,"img",8),e.EFF(6," Deployments "),e.k0s(),e.j41(7,"span",9),e.EFF(8,"\u203a"),e.k0s()(),e.j41(9,"span",10),e.nrm(10,"i",11),e.EFF(11," Your WhatsApp Business Number "),e.k0s()(),e.j41(12,"div",12)(13,"button",13),e.EFF(14," WA Business Number Details "),e.k0s()()(),e.j41(15,"div",14)(16,"button",15),e.bIt("click",function(){return e.eBV(a),n.refreshButton(),e.Njj(n.getPushMessageStatus())}),e.qSk(),e.j41(17,"svg",16),e.nrm(18,"path",17)(19,"path",18)(20,"path",19),e.k0s()(),e.joV(),e.j41(21,"button",20),e.bIt("click",function(){return e.eBV(a),e.Njj(n.createLink())}),e.EFF(22," Import Recipients "),e.k0s()(),e.DNE(23,pa,6,0,"div",21)(24,ya,45,14,"ng-container",22),e.k0s(),e.nrm(25,"a",23,0)(27,"a",24,1)(29,"a",25,2)(31,"button",26),e.j41(32,"div",27)(33,"div",28)(34,"div",29)(35,"div",30)(36,"h5",31),e.EFF(37,"Push Survey via WhatsApp"),e.k0s(),e.j41(38,"button",32),e.bIt("click",function(){return e.eBV(a),e.Njj(n.resetform())}),e.nrm(39,"i",33),e.k0s()(),e.j41(40,"div",34)(41,"div",35)(42,"label",36),e.EFF(43,"Campaign Name "),e.j41(44,"span",37),e.EFF(45,"*"),e.k0s()(),e.j41(46,"input",38),e.bIt("input",function(c){return e.eBV(a),n.validateCampName(c),e.Njj(n.CommonService.onPaste(c))})("keydown",function(c){return e.eBV(a),e.Njj(n.validateInput(c))}),e.k0s(),e.DNE(47,Ca,2,1,"span",39),e.k0s(),e.j41(48,"div",35)(49,"label",36),e.EFF(50,"Send Survey From "),e.j41(51,"span",37),e.EFF(52,"*"),e.k0s()(),e.j41(53,"select",40),e.bIt("change",function(c){return e.eBV(a),e.Njj(n.gupshupPhone=c.target.value)}),e.j41(54,"option",41),e.EFF(55,"Select phone"),e.k0s(),e.DNE(56,Fa,2,3,"option",42),e.k0s()(),e.j41(57,"div",35)(58,"label",36),e.EFF(59,"Select Template "),e.j41(60,"span",37),e.EFF(61,"*"),e.k0s()(),e.j41(62,"div",43),e.DNE(63,ja,8,4,"div",44),e.k0s()(),e.j41(64,"div",35)(65,"div",45)(66,"label",36),e.EFF(67,"Import Recipients via CSV "),e.j41(68,"span",37),e.EFF(69,"*"),e.k0s()(),e.j41(70,"a",46),e.EFF(71,"Sample File"),e.k0s()(),e.j41(72,"input",47),e.bIt("change",function(c){return e.eBV(a),e.Njj(n.onFileChanged(c))}),e.k0s()(),e.DNE(73,wa,7,3,"div",48)(74,Pa,6,1,"div",48)(75,Oa,6,3,"div",48),e.j41(76,"div",49)(77,"button",50),e.bIt("click",function(){return e.eBV(a),e.Njj(n.resetform())}),e.EFF(78,"Close"),e.k0s(),e.j41(79,"button",51),e.bIt("click",function(){return e.eBV(a),e.Njj(n.saveData())}),e.EFF(80,"Send Survey"),e.k0s()()()()()(),e.j41(81,"div",52)(82,"div",53)(83,"div",29)(84,"div",30)(85,"h5",31),e.EFF(86,"Publish Survey"),e.k0s(),e.j41(87,"button",32),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.nrm(88,"i",33),e.k0s()(),e.j41(89,"div",54)(90,"p",55),e.EFF(91,"Are you sure you want to publish this 
1survey?"),e.k0s(),e.j41(92,"div",56)(93,"button",50),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!1))}),e.EFF(94,"Close"),e.k0s(),e.j41(95,"button",57),e.bIt("click",function(){return e.eBV(a),e.Njj(n.updateStatus(!0))}),e.EFF(96,"Publish"),e.k0s()()()()()(),e.j41(97,"div",58)(98,"div",53)(99,"div",29)(100,"div",30)(101,"h5",31),e.EFF(102,"Survey Empty"),e.k0s()(),e.j41(103,"div",54)(104,"p",55),e.EFF(105,"Survey looks empty."),e.nrm(106,"br"),e.EFF(107,"Please add questions to publish the survey."),e.k0s(),e.j41(108,"div",56)(109,"button",50),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!0))}),e.EFF(110,"My Dashboard"),e.k0s(),e.j41(111,"button",57),e.bIt("click",function(){return e.eBV(a),e.Njj(n.goto(!1))}),e.EFF(112,"Add Questions"),e.k0s()()()()()()}2&i&&(e.R7$(23),e.Y8G("ngIf",1==(null==n.surveyDetails?null:n.surveyDetails.isPushMessageUpoad)),e.R7$(),e.Y8G("ngIf",(null==n.authenticationService.accessibilityData?null:n.authenticationService.accessibilityData.pushMessagesCount)>0),e.R7$(23),e.Y8G("ngIf",n.campaignNameValidation),e.R7$(9),e.Y8G("ngForOf",n.phoneNumberslist),e.R7$(7),e.Y8G("ngForOf",n.templates),e.R7$(10),e.Y8G("ngIf",0!=n.isXoxodayEnabled),e.R7$(),e.Y8G("ngIf",n.selectedCampaign&&0!=n.isXoxodayEnabled),e.R7$(),e.Y8G("ngIf",n.selectedCampaign&&0!=n.isXoxodayEnabled),e.R7$(4),e.Y8G("disabled",!n.isFormComplete()))},dependencies:[p.Sq,p.bT,g.Wk,v.ej,r.xH,r.y7,r.me,r.BC,r.vS,p.vh,v.kf],styles:['@charset "UTF-8";.pm-page[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:20px;padding:20px 0 24px}.pm-topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}.pm-breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:14px}.pm-bc-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#9ca3af;text-decoration:none;cursor:pointer}.pm-bc-link[_ngcontent-%COMP%]:hover{color:#fff}.pm-bc-current[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:#f79522;font-weight:500;border-bottom:2px solid #F79522;padding-bottom:4px}.pm-bc-sep[_ngcontent-%COMP%]{color:#9ca3af}.pm-bc-icon[_ngcontent-%COMP%]{width:16px;height:16px;object-fit:contain;flex-shrink:0;filter:brightness(0) saturate(100%) invert(69%) sepia(11%) saturate(405%) hue-rotate(176deg) brightness(91%) contrast(87%);transition:filter .15s}.pm-bc-icon--active[_ngcontent-%COMP%]{filter:brightness(0) saturate(100%) invert(65%) sepia(60%) saturate(800%) hue-rotate(349deg) brightness(108%) contrast(95%)}.pm-bc-link[_ngcontent-%COMP%]:hover   .pm-bc-icon[_ngcontent-%COMP%]{filter:brightness(0) invert(1)}.pm-actions-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.pm-refresh-btn[_ngcontent-%COMP%]{width:36px;height:36px;color:#fff;display:flex;background-color:transparent;border:none;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,color .15s}.pm-refresh-btn[_ngcontent-%COMP%]:hover{background:#191b21;color:#fff}.pm-outline-btn[_ngcontent-%COMP%]{background:transparent;border:1px solid #363A47;border-radius:9999px;color:#e0e0e0;font-size:13px;font-weight:500;padding:8px 16px;cursor:pointer;text-decoration:none;transition:background .15s,border-color .15s}.pm-outline-btn[_ngcontent-%COMP%]:hover{background:#191b21;border-color:#9ca3af;color:#fff}.pm-import-btn[_ngcontent-%COMP%]{background:#3a7bfd;border:1px solid #3a7bfd;border-radius:9999px;color:#fff;font-size:14px;font-weight:500;padding:8px 20px;cursor:pointer;transition:background .15s}.pm-import-btn[_ngcontent-%COMP%]:hover{background:#1260fd}.pm-inprogress[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;background:#f7952214;border:1px solid rgba(247,149,34,.25);border-radius:8px;padding:10px 16px;font-size:13px;color:#f79522}.pm-inprogress[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{flex-shrink:0}.pm-stats-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}@media (max-width: 1024px){.pm-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(4,1fr)}}@media (max-width: 600px){.pm-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}.pm-stat-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:10px;padding:18px 12px;display:flex;flex-direction:column;align-items:center;gap:6px}.pm-stat-value[_ngcontent-%COMP%]{font-size:24px;font-weight:600;color:#fff;line-height:1}.pm-stat-label[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af;text-align:center;white-space:nowrap}.pm-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.pm-search-wrap[_ngcontent-%COMP%]{position:relative;max-width:280px;flex:1}.pm-search-icon[_ngcontent-%COMP%]{position:absolute;
1left:12px;top:50%;transform:translateY(-50%);color:#9ca3af;pointer-events:none}.pm-search-input[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:9999px!important;color:#fff!important;padding:9px 14px 9px 36px;font-size:14px;width:100%;outline:none;height:40px;transition:border-color .15s}.pm-search-input[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.pm-search-input[_ngcontent-%COMP%]:focus{border-color:#f79522!important}.pm-export-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;background:transparent;border:1px solid #363A47;border-radius:9999px;color:#e0e0e0;font-size:13px;font-weight:500;padding:8px 16px;cursor:pointer;transition:background .15s,border-color .15s}.pm-export-btn[_ngcontent-%COMP%]:hover{background:#191b21;border-color:#9ca3af;color:#fff}.pm-table-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:12px;overflow:hidden}.pm-table[_ngcontent-%COMP%]{width:100%;border-spacing:0}.pm-table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{color:#9ca3af!important;background:transparent!important;border-bottom:1px solid #363A47!important;padding:14px 16px!important;font-size:13px;font-weight:600;white-space:nowrap;vertical-align:middle!important}.pm-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{color:#e0e0e0!important;background:transparent!important;padding:14px 16px!important;font-size:13px;vertical-align:middle!important;border-top:none!important;border-bottom:none!important}.pm-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] + tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{border-top:1px solid rgba(255,255,255,.06)!important}.pm-status[_ngcontent-%COMP%]{font-size:12px;color:#9ca3af}.pm-status--active[_ngcontent-%COMP%]{color:#22c55e}.pm-pagination-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:12px;padding:12px 16px}.pm-page-size[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #363A47!important;border-radius:8px!important;color:#fff!important;padding:4px 8px;font-size:13px;height:34px;flex-shrink:0}.pm-page-size[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination{display:flex;align-items:center;list-style:none;padding:0;margin:0;gap:2px;flex-shrink:0}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination a, [_nghost-%COMP%]     .pm-pagination-row .ngx-pagination button, [_nghost-%COMP%]     .pm-pagination-row .ngx-pagination span{color:#9ca3af!important;font-size:13px}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination a:hover, [_nghost-%COMP%]     .pm-pagination-row .ngx-pagination button:hover{color:#fff!important;background:transparent!important}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination .current{background:#3a7bfd!important;color:#fff!important;border-radius:6px;padding:3px 10px}[_nghost-%COMP%]     .pm-pagination-row .ngx-pagination .disabled{color:#727c8d!important}.pm-empty[_ngcontent-%COMP%]{text-align:center;padding:48px 0;color:#9ca3af;font-size:14px}.pm-loading[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:48px 0}.pm-modal[_ngcontent-%COMP%]{background:#0f1116!important;border:1px solid #2A2D38!important;border-radius:14px!important;overflow:hidden;box-shadow:0 24px 48px #0009!important}.pm-modal-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:18px 24px;background:#16181f;border-bottom:1px solid #2A2D38}.pm-modal-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#fff;margin:0}.pm-modal-close[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:1px solid #2A2D38;background:transparent;color:#9ca3af;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px}.pm-modal-close[_ngcontent-%COMP%]:hover{background:#191b21;color:#fff}.pm-modal-body[_ngcontent-%COMP%]{padding:24px}.pm-modal-msg[_ngcontent-%COMP%]{color:#e0e0e0;font-size:14px;line-height:1.6;margin-bottom:20px}.pm-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.pm-label-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.pm-label[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#9ca3af}.pm-required[_ngcontent-%COMP%]{color:#ef4444;margin-left:2px}.pm-sample-link[_ngcontent-%COMP%]{font-size:12px;color:#3a7bfd;text-decoration:none}.pm-sample-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.pm-input[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #2A2D38!important;border-radius:8px!important;color:#fff!important;padding:10px 14px;font-size:14px;width:100%;height:44px;outline:none}.pm-input[_ngcontent-%COMP%]::placeholder{color:#555868}.pm-input[_ngcontent-%COMP%]:focus{border-color:#3a7bfd!important}.pm-select[_ngcontent-%COMP%]{background:#191b21!important;border:1px solid #2A2D38!important;border-radius:8px!important;color:#fff!important;padding:0 14px;font-size:14px;width:100%;height:44px;outline:none}.pm-select[_ngcontent-%COMP%]   option[_ngcontent-%COMP%]{background:#191b21;color:#fff}.pm-error[_ngcontent-%COMP%]{color:#ef4444;font-size:12px}.pm-templates-wrap[_ngcontent-%COMP%]{display:flex;gap:14px;overflow-x:auto;padding:4px 2px 8px;flex-wrap:nowrap}.pm-template-card[_ngcontent-%COMP%]{background:#191b21;border:1px solid #363A47;border-radius:10px;padding:10px;
1width:200px;min-height:280px;max-height:280px;display:flex;flex-direction:column;justify-content:space-between;flex-shrink:0;cursor:pointer;transition:border-color .15s}.pm-template-card--selected[_ngcontent-%COMP%]{border-color:#f79522;background:#f795220f}.pm-template-desc[_ngcontent-%COMP%]{font-size:12px;color:#e0e0e0;font-weight:400;overflow:hidden;display:-webkit-box;-webkit-line-clamp:9;-webkit-box-orient:vertical;margin:0}.pm-template-footer[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:6px;margin-top:8px}.pm-template-action-btn[_ngcontent-%COMP%]{background:#ffffff0f;border:1px solid #363A47;color:#3a7bfd;font-size:12px;font-weight:500;border-radius:12px;height:30px;width:150px;cursor:pointer;transition:background .2s}.pm-template-action-btn[_ngcontent-%COMP%]:hover{background:#3a7bfd1f}.pm-template-name[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#9ca3af;text-align:center;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pm-modal-footer[_ngcontent-%COMP%]{display:flex;gap:12px;padding-top:8px}.pm-modal-footer--center[_ngcontent-%COMP%]{justify-content:center;margin-top:12px}.pm-btn-primary[_ngcontent-%COMP%]{background:#3a7bfd;border:1px solid #3a7bfd;border-radius:9999px;color:#fff;font-size:14px;font-weight:500;padding:9px 24px;cursor:pointer;transition:background .15s}.pm-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#1260fd}.pm-btn-primary[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.pm-btn-outline[_ngcontent-%COMP%]{background:transparent;border:1px solid #363A47;border-radius:9999px;color:#e0e0e0;font-size:14px;font-weight:500;padding:9px 24px;cursor:pointer;transition:background .15s}.pm-btn-outline[_ngcontent-%COMP%]:hover{background:#ffffff0f}.pm-bc-trail[_ngcontent-%COMP%]{display:contents}.pm-bc-wa-icon[_ngcontent-%COMP%]{font-size:16px;color:#9ca3af}.fp-mob-cards[_ngcontent-%COMP%]{display:none}@media (max-width: 640px){.pm-page[_ngcontent-%COMP%]{padding:12px 14px 80px;gap:14px}.pm-topbar[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:8px}.pm-breadcrumb[_ngcontent-%COMP%]{overflow-x:auto;white-space:nowrap;width:100%;flex-wrap:nowrap;scrollbar-width:none}.pm-breadcrumb[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.pm-bc-trail[_ngcontent-%COMP%]{display:contents}.pm-bc-link[_ngcontent-%COMP%]{font-size:13px;font-weight:400}.pm-bc-current[_ngcontent-%COMP%]{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;font-size:16px;font-weight:400}.pm-bc-current[_ngcontent-%COMP%]   .pm-bc-wa-icon[_ngcontent-%COMP%]{color:#f79522}.pm-actions-row[_ngcontent-%COMP%]{width:100%}.pm-outline-btn[_ngcontent-%COMP%]{width:100%;text-align:center;display:block;color:#2285f7!important;border-color:#2285f7!important}.pm-import-btn[_ngcontent-%COMP%]{flex:1;text-align:center}.pm-stats-row[_ngcontent-%COMP%]{grid-template-columns:repeat(3,1fr)!important;gap:8px}.pm-stat-card[_ngcontent-%COMP%]{padding:12px 6px}.pm-stat-card[_ngcontent-%COMP%]:last-child{grid-column:1/-1}.pm-stat-value[_ngcontent-%COMP%]{font-size:20px}.pm-stat-label[_ngcontent-%COMP%]{font-size:11px}.pm-toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch;gap:8px}.pm-search-wrap[_ngcontent-%COMP%]{max-width:100%}.pm-table-card[_ngcontent-%COMP%]{display:none!important}.fp-mob-cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.fp-mob-card[_ngcontent-%COMP%]{background:#1d1f26;border:1px solid #363A47;border-radius:12px;overflow:hidden}.fp-mob-card-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 14px 10px}.fp-mob-phone[_ngcontent-%COMP%]{font-size:15px;font-weight:500;color:#fff}.fp-mob-badge[_ngcontent-%COMP%]{font-size:11px;font-weight:600;padding:3px 10px;border-radius:8px;background:#9ca3af26;color:#9ca3af;text-transform:capitalize}.fp-mob-badge--complete[_ngcontent-%COMP%]{background:#22c55e26;color:#22c55e}.fp-mob-badge--failed[_ngcontent-%COMP%]{background:#ef444426;color:#ef4444}.fp-mob-fields[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px;padding:0 14px 10px;font-size:12px;color:#9ca3af}.fp-mob-field--full[_ngcontent-%COMP%]{grid-column:1/-1}.fp-mob-footer[_ngcontent-%COMP%]{background:#1d1f26;border-top:1px solid #363A47;padding:8px 14px;font-size:12px;color:#9ca3af;line-height:1.5}.pm-pagination-row[_ngcontent-%COMP%]{flex-wrap:wrap;justify-content:center;padding:10px}}']}
1)}return o})(),data:{roles:[u.X.Creator,u.X.Customer]}}]}];let Ia=(()=>{class o{static#e=this.\u0275fac=function(i){return new(i||o)};static#t=this.\u0275mod=e.$C({type:o});static#n=this.\u0275inj=e.G2t({imports:[g.iI.forChild(Ea),g.iI]})}return o})();var B=h(1827),Ra=h(7419),Ta=h(1852),E=h(1626),Na=h(964),Da=h(1697),X=h(9242);let Ga=(()=>{class o{static#e=this.\u0275fac=function(i){return new(i||o)};static#t=this.\u0275mod=e.$C({type:o});static#n=this.\u0275inj=e.G2t({providers:[{provide:E.a7,useClass:B.Vw,multi:!0},{provide:E.a7,useClass:B.wZ,multi:!0},Ra.Q,{provide:E.a7,useClass:Na.H,multi:!0}],imports:[p.MD,Ia,Ta.R,v.ed,L.O,O.X6,G.fS,E.q1,Da.N,r.YN,r.X1,X.cm,X.P1,M.MQ]})}return o})()}}]);

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.