1"use strict";(self.webpackChunkdzweb=self.webpackChunkdzweb||[]).push([[1448],{38594:(K,H,n)=>{n.d(H,{p:()=>e});var p=n(80529),k=n(4128),A=n(39646),I=n(54004),E=n(70262),m=n(22858),y=n(17489),T=n(94650),M=n(21952),h=n(93531),N=n(38058);let e=(()=>{class x{constructor(l,g,C,u){this.httpClient=l,this._utilService=C,this._flowchartService=u,this.sessionStorage=g}getOrgTransactionStatus(l,g){return this.httpClient.get(m.JBL+"?orgId="+g+"&clientTxnId="+l,{headers:{"Content-Type":"application/json",Authorization:"Bearer "+this.sessionStorage.getItem("token")}})}initiateTransaction(l){const g={headers:new p.WM({"Content-Type":"application/json",Authorization:"Bearer "+this.sessionStorage.getItem("token")})};return this.httpClient.post(m.JBL,l,g)}getTransactionFlowchartDetails(l,g,C,u,O,b){let v=this.sessionStorage.getItem("zdTicket");y.isEqual(l,"salesforce")?v=this.sessionStorage.getItem("sfCaseNumber"):y.isEqual(l,"restrictedPublishedFc")&&(v=this._utilService.getRestrictedPublishedFcTxnId("rpftId"));let D={clientTxnId:v,userSessionId:this._utilService.getCookie("userSessionId"),flowchartId:g,txnStatus:b,orgId:O,publishedCode:null,clientTxnSource:l};var R=m.$J2+C+"/fcRandomId/"+u;return(0,k.D)([this.initiateTransaction(D),this.httpClient.get(R)])}updateAndGetTxnFlowchartDetails(l,g,C){return this.getTransactionFlowchartDetails(l,g.flowchartId,g.goalUrl,g.flowchartRandomId,g.orgId,C).pipe((0,I.U)(u=>{var v,O=u[0].responseBody;O&&(v=this._flowchartService.prepareBoxConnectionsWithMetadata(O,u[1].responseBody),this.sessionStorage.setObject("flowchart",v))}),(0,E.K)(u=>(0,A.of)(null)))}completeTransaction(l){const g={headers:new p.WM({"Content-Type":"application/json",Authorization:"Bearer "+this.sessionStorage.getItem("token")})};return this.httpClient.put(m.JBL,l,g)}sendFlowchartActivityForCurrentTxn(){const l={headers:new p.WM({"Content-Type":"application/json",Authorization:"Bearer "+this.sessionStorage.getItem("token")})};return this.httpClient.post(m.AAh+"?userSessionId="+this._utilService.getCookie("userSessionId"),null,l)}updateTransactionNotes(l){const g={headers:new p.WM({"Content-Type":"application/json",Authorization:"Bearer "+this.sessionStorage.getItem("token")})};return this.httpClient.patch(m.V6I,l,g)}}return x.\u0275fac=function(l){return new(l||x)(T.LFG(p.eN),T.LFG(M.qo),T.LFG(h.f),T.LFG(N.q))},x.\u0275prov=T.Yz7({token:x,factory:x.\u0275fac,providedIn:"root"}),x})()},1448:(K,H,n)=>{n.r(H),n.d(H,{ZendeskUserOrgHomeFcModule:()=>ye});var p=n(36895),k=n(19132),A=n(69814),I=n(24006),E=n(10920),m=n(80529),y=n(29521),B=n(39646),T=n(54004),M=n(70262),h=n(17489),N=n(48811),e=n(94650),x=n(26201),P=n(93531),l=n(56871),g=n(52679),C=n(38594),u=n(38058),O=n(41591),b=n(64918),v=n(99863),D=n(80641),R=n(21952),Y=n(59549),Q=n(4859),G=n(73546),F=n(77331),W=n(97392),$=n(51572),L=n(71948);function q(i,c){1&i&&(e.TgZ(0,"div",3)(1,"p")(2,"span"),e._UZ(3,"mat-spinner",4),e.qZA()()())}function V(i,c){if(1&i&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(t.orgHomeErrMsg)}}function X(i,c){1&i&&(e.TgZ(0,"p"),e._uU(1,"Error in retrieving DeciZone page. Please try again after sometime."),e.qZA())}function ee(i,c){if(1&i&&(e.TgZ(0,"div"),e.YNc(1,V,2,1,"p",1),e.YNc(2,X,2,0,"p",1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.orgHomeErrMsg),e.xp6(1),e.Q6J("ngIf",!t.orgHomeErrMsg)}}function te(i,c){1&i&&(e.TgZ(0,"div")(1,"p"),e._uU(2,"The current ticket is already closed. Please select other open ticket to proceed."),e.qZA()())}function oe(i,c){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.hij(" ",t.txnActiveUser," is currently working on this ticket. ")}}function ie(i,c){1&i&&e._UZ(0,"mat-spinner",16)}function se(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"p"),e._uU(2," Looks like you are currently working on this ticket (may be in another browser) and so this ticket is currently in "),e.TgZ(3,"b"),e._uU(4,"ACTIVE"),e.qZA(),e._uU(5," transaction state. "),e.qZA(),e.TgZ(6,"mat-radio-group",11),e.NdJ("ngModelChange",function(s){e.CHM(t);const r=e.oxw(2);return e.KtG(r.txnActiveOption=s)}),e.TgZ(7,"mat-radio-button",12),e._uU(8,"Resume current ACTIVE transaction and continue working in flowchart, "),e.TgZ(9,"strong"),e._uU(10),e.qZA()(),e.TgZ(11,"mat-radio-button",13),e._uU(12,"Discard current ACTIVE transaction and go to Organization home page"),e.qZA()(),e.TgZ(13,"div")(14,"button",14),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.txnResumeNextAction(s.txnActiveOption))}),e.YNc(15,ie,1,0,"mat-spinner",15),e._uU(16,"Next "),e.qZA()()()}if(2&i){const t=e.oxw(2);e.xp6(6),e.Q6J("ngModel",t.txnActiveOption),e.xp6(4),e.Oqu(t.txnFlowchartName),e.xp6(5),e.Q6J("ngIf",t.txnResumeLo
1ading)}}function re(i,c){1&i&&e._UZ(0,"mat-spinner",16)}function ne(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"p"),e._uU(2,"Looks like someone was working on this ticket recently and so it is currently in "),e.TgZ(3,"b"),e._uU(4,"PENDING"),e.qZA(),e._uU(5," transaction state. Please select how to handle this transaction from the options below."),e.qZA(),e.TgZ(6,"mat-radio-group",17),e.NdJ("ngModelChange",function(s){e.CHM(t);const r=e.oxw(2);return e.KtG(r.selectedTxnResumeOption=s)}),e.TgZ(7,"mat-radio-button",12),e._uU(8,"Resume from last step in flowchart, "),e.TgZ(9,"strong"),e._uU(10),e.qZA(),e._uU(11,", from the pending transaction"),e.qZA(),e.TgZ(12,"mat-radio-button",18),e._uU(13,"Discard this pending transaction and Start a new transaction from beginning of this same flowchart, "),e.TgZ(14,"strong"),e._uU(15),e.qZA()(),e.TgZ(16,"mat-radio-button",13),e._uU(17,"Discard this pending transaction and go to Organization Home page"),e.qZA()(),e.TgZ(18,"div")(19,"button",19),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.txnResumeNextAction(s.selectedTxnResumeOption))}),e.YNc(20,re,1,0,"mat-spinner",15),e._uU(21,"Next "),e.qZA()()()}if(2&i){const t=e.oxw(2);e.xp6(6),e.Q6J("ngModel",t.selectedTxnResumeOption),e.xp6(4),e.Oqu(t.txnFlowchartName),e.xp6(5),e.Oqu(t.txnFlowchartName),e.xp6(5),e.Q6J("ngIf",t.txnResumeLoading)}}function ae(i,c){1&i&&(e.TgZ(0,"mat-icon",36),e._uU(1,"cancel"),e.qZA())}function ce(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"mat-chip",34),e.NdJ("removed",function(){const r=e.CHM(t).$implicit,d=e.oxw(3);return e.KtG(d.removeSearchTag(r))}),e._uU(1),e.YNc(2,ae,2,0,"mat-icon",35),e.qZA()}if(2&i){const t=c.$implicit,o=e.oxw(3);e.Q6J("selectable",o.selectable)("removable",o.removable),e.xp6(1),e.hij(" ",t," "),e.xp6(1),e.Q6J("ngIf",o.removable)}}function le(i,c){1&i&&(e.TgZ(0,"div",37),e._uU(1," No matches found. Please try again with more relevant keywords. "),e.qZA())}function de(i,c){if(1&i&&e._UZ(0,"img",50),2&i){const t=e.oxw().$implicit;e.s9C("src",t.flowchartImageUrl,e.LSH),e.s9C("alt",t.flowchartName)}}function ge(i,c){if(1&i&&e._UZ(0,"img",51),2&i){const t=e.oxw().$implicit;e.s9C("alt",t.flowchartName)}}function he(i,c){1&i&&e._UZ(0,"mat-spinner",16)}function me(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"mat-card",40)(1,"p",41)(2,"span",42),e._uU(3),e.qZA()(),e.TgZ(4,"button",43),e.NdJ("click",function(){const r=e.CHM(t).$implicit,d=e.oxw(4);return e.KtG(d.initiateFlowchartTransaction(r))}),e.TgZ(5,"div",44)(6,"div",45),e.YNc(7,de,1,2,"img",46),e.YNc(8,ge,1,1,"img",47),e.qZA(),e.TgZ(9,"div",48)(10,"div",49),e._uU(11),e.qZA(),e.YNc(12,he,1,0,"mat-spinner",15),e.qZA()()()()}if(2&i){const t=c.$implicit,o=e.oxw(4);e.xp6(3),e.Oqu(t.goalName),e.xp6(1),e.Q6J("disabled",o.ticketStatus&&"closed"===o.ticketStatus),e.xp6(3),e.Q6J("ngIf",t.flowchartImageUrl),e.xp6(1),e.Q6J("ngIf",!t.flowchartImageUrl),e.xp6(3),e.Oqu(t.flowchartName),e.xp6(1),e.Q6J("ngIf",o.fcloading&&o.loadingFcId===t.flowchartId)}}function pe(i,c){if(1&i&&(e.TgZ(0,"div",38),e.YNc(1,me,13,6,"mat-card",39),e.qZA()),2&i){const t=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",t.orgHomeFlowchartSearchResults)}}function ue(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"div",20)(2,"h1",6)(3,"span",7),e._uU(4),e.qZA()(),e.TgZ(5,"div",21)(6,"div",22)(7,"mat-form-field",23)(8,"mat-chip-list",24,25),e.YNc(10,ce,3,4,"mat-chip",26),e.TgZ(11,"input",27),e.NdJ("matChipInputTokenEnd",function(s){e.CHM(t);const r=e.oxw(2);return e.KtG(r.addSearchTag(s))}),e.qZA()()(),e.TgZ(12,"button",28),e.NdJ("click",function(s){e.CHM(t);const r=e.oxw(2);return s.stopPropagation(),e.KtG(r.openAdvancedSearchDialog())}),e.TgZ(13,"mat-icon"),e._uU(14,"more_vert"),e.qZA()(),e.TgZ(15,"button",29),e.NdJ("click",function(s){e.CHM(t);const r=e.oxw(2);return s.stopPropagation(),e.KtG(r.getFuzzySearch())}),e.TgZ(16,"mat-icon"),e._uU(17,"search"),e.qZA()(),e.TgZ(18,"button",30),e.NdJ("click",function(s){e.CHM(t);const r=e.oxw(2);return s.stopPropagation(),e.KtG(r.resetSearchResults())}),e.TgZ(19,"mat-icon"),e._uU(20,"close"),e.qZA()()()()(),e._UZ(21,"div",31),e.YNc(22,le,2,0,"div",32),e.YNc(23,pe,2,1,"div",33),e.qZA()}if(2&i){const t=e.MAs(9),o=e.oxw(2);e.xp6(4),e.Oqu(o.dzOrgName),e.xp6(6),e.Q6J("ngForOf",o.ticketTags),e.xp6(1),e.Q6J("matChipInputFor",t)("matChipInputSeparatorKeyCodes",o.separatorKeysCodes)("matChipInputAddOnBlur",o.addOn
1Blur),e.xp6(11),e.Q6J("ngIf",o.fuzzySearchTried&&o.orgHomeFlowchartSearchResults&&0===o.orgHomeFlowchartSearchResults.length),e.xp6(1),e.Q6J("ngIf",o.orgHomeFlowchartSearchResults&&o.orgHomeFlowchartSearchResults.length>0)}}function fe(i,c){if(1&i&&e._UZ(0,"img",50),2&i){const t=e.oxw().$implicit;e.s9C("src",t.flowchartImageUrl,e.LSH),e.s9C("alt",t.flowchartName)}}function _e(i,c){if(1&i&&e._UZ(0,"img",51),2&i){const t=e.oxw().$implicit;e.s9C("alt",t.flowchartName)}}function xe(i,c){1&i&&e._UZ(0,"mat-spinner",16)}function ve(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div",52)(1,"p",41)(2,"span",42),e._uU(3),e.qZA()(),e.TgZ(4,"button",43),e.NdJ("click",function(){const r=e.CHM(t).$implicit,d=e.oxw(2);return e.KtG(d.initiateFlowchartTransaction(r))}),e.TgZ(5,"div",44)(6,"div",45),e.YNc(7,fe,1,2,"img",46),e.YNc(8,_e,1,1,"img",47),e.qZA(),e.TgZ(9,"div",48)(10,"div",49),e._uU(11),e.qZA(),e.YNc(12,xe,1,0,"mat-spinner",15),e.qZA()()()()}if(2&i){const t=c.$implicit,o=e.oxw(2);e.xp6(3),e.Oqu(t.goalName),e.xp6(1),e.Q6J("disabled",o.ticketStatus&&"closed"===o.ticketStatus),e.xp6(3),e.Q6J("ngIf",t.flowchartImageUrl),e.xp6(1),e.Q6J("ngIf",!t.flowchartImageUrl),e.xp6(3),e.Oqu(t.flowchartName),e.xp6(1),e.Q6J("ngIf",o.fcloading&&o.loadingFcId===t.flowchartId)}}function Te(i,c){if(1&i&&(e.TgZ(0,"div",5)(1,"h1",6)(2,"span",7),e._uU(3),e.qZA()(),e.YNc(4,te,3,0,"div",1),e.YNc(5,oe,2,1,"div",1),e.YNc(6,se,17,3,"div",1),e.YNc(7,ne,22,4,"div",1),e.YNc(8,ue,24,7,"div",1),e.TgZ(9,"div",8),e.YNc(10,ve,13,6,"div",9),e.qZA(),e.TgZ(11,"span",10),e._uU(12),e.qZA()()),2&i){const t=e.oxw();e.xp6(3),e.Oqu(t.dzOrgName),e.xp6(1),e.Q6J("ngIf",t.ticketStatus&&"closed"===t.ticketStatus),e.xp6(1),e.Q6J("ngIf",t.ticketStatus&&"closed"!==t.ticketStatus&&"A"===t.txnStatus&&t.txnActiveUser),e.xp6(1),e.Q6J("ngIf",t.ticketStatus&&"closed"!==t.ticketStatus&&"A"===t.txnStatus&&!t.txnActiveUser),e.xp6(1),e.Q6J("ngIf",t.ticketStatus&&"closed"!==t.ticketStatus&&"P"===t.txnStatus),e.xp6(1),e.Q6J("ngIf","A"!==t.txnStatus&&"P"!==t.txnStatus),e.xp6(2),e.Q6J("ngForOf",t.orgHomeFlowchartList),e.xp6(2),e.hij("T# ",t.zdTicketId,"")}}let Ce=(()=>{class i{constructor(t,o,s,r,d,z,U,Z,a,Oe,Se,ke,Ie,be,f,ze){this.ngZone=t,this.route=o,this.cdr=s,this._cookieService=d,this._utilService=z,this._loginService=U,this._integrationService=Z,this._txnService=a,this._flowchartService=Oe,this._advSearchDialogService=Se,this._flowchartUtilService=ke,this._orgService=Ie,this._userService=be,this.router=ze,this.searchableFcList=[],this.fuzzySearchTried=!1,this.orgHomeFlowchartListCopy=[],this.orgHomeFlowchartSearchResults=[],this.searchText="",this.visible=!0,this.selectable=!0,this.removable=!0,this.addOnBlur=!0,this.separatorKeysCodes=[y.K5,y.OC],this.fcKeywords=!0,this.fcDescription=!1,this.fcName=!1,this.goalName=!0,this.subCategoryName=!1,this.subCategoryDescription=!1,this.categoryName=!1,this.categoryDescription=!1,this.prefix=!0,this.fuzzy=!1,this.selectedCombineTerms="OR",this.combineTerms=["OR","AND"],this.zendeskAccessToken="",this.loading=!1,this.globalError=!1,this.orgHomeErrMsg="",this.dzOrgName="",this.orgHomeFlowchartList=[],this.fcloading=!1,this.txnResumeLoading=!1,this.selectedTxnResumeOption="R",this.txnResumeOptions=[{value:"R",viewValue:"Resume from last step from the pending transaction"},{value:"S",viewValue:"Discard this pending transaction and Start a new transaction from beginning of this same flowchart"},{value:"D",viewValue:"Discard this pending transaction and go to Organization Home page"}],this.txnActiveOption="R",this.zafClient=null,this.zafHandler=w=>{},this.sessionStorage=f,this._httpClient=new m.eN(r),this.sessionStorage.getItem("dzOrgId"),this.dzOrgName=this.sessionStorage.getItem("dzOrgName"),console.dir("OrgHome/start contructor method - ticket from session - "+this.sessionStorage.getItem("zdTicket"));let J,S=this;this.zafClient=this._utilService.getZendeskZAFClient(),this.zafClient.context().then(function(w){J=w.instanceGuid,console.dir("current instance guid - "+J),f.setItem("activeZdTicket",w.ticketId),f.setItem("zdTicket",w.ticketId)}),this.zafHandler=w=>{S.zafClient.context().then(function(_){console.dir("OrgHome App Registered trigger - ticketId from updated context - "+_.ticketId),f.setItem("zdTicket",_.ticketId);var j=S.zafClient._appGuid;f.setItem("zdAppGuid_"+_.ticketId,j),f.setItem("zdAppParams_"+_.ticketId,"?origin="+S.zafClient._origin+"&app_guid="+j)}),S.zafClient.on("app.activated",function(){console.dir("App Activated event triggered"),S.zafClient.context().then(function(_){console.dir("OrgHome App activated trigger - ticketId from updated context - "+_.ticketId),console.log("Updated active ticketId from App.activated event -"+_.ticketId),f.setItem("zdTicket",_.ticketId),f.setItem("activeZdTicket",_.ticketId),S.zdTicketId=f.getItem("activeZdTicket")})})},this.zafClient.on("app.registered",this.zafHandler)}ngOnInit(){this.loading=!0,this._utilService.setFlowchartFlowProperty(!1),this._utilService.setZen
1deskFlowProperty();var t=this.sessionStorage.getItem("dzOrgId");let o;if(this.dzOrgName=this.sessionStorage.getItem("dzOrgName"),this.zdTicketId=this.sessionStorage.getItem("zdTicket"),console.log("init method - ticket from session - "+this.sessionStorage.getItem("zdTicket")),null!=this.sessionStorage.getItem("token")){let s=this.sessionStorage.getItem("zdTicket");this._utilService.getZendeskTicketDetails(Number(s)).then(r=>{this.ticketStatus=r.ticket.status,o=r.ticket.tags,this.ticketTags=r.ticket.tags,this.searchText=h.join(o,o&&o.length>1?",":""),t||(this.loading=!1,this.globalError=!0,this.orgHomeErrMsg="We are not able to verify your organization in DeciZone. Please contact DeciZone Support."),"closed"!==this.ticketStatus?this._prepareZendeskOrgHomeDetails(t):(this.orgHomeErrMsg="",this._userService.getOrganizationHomeFlowcharts(t).subscribe(d=>{console.log("org home flowchart -",d),this.orgHomeFlowchartList=d.responseBody.orgHomeFlowchartList,this._setupMiniSearch(this.orgHomeFlowchartList),this.loading=!1,this.globalError=!1,this.cdr.detectChanges()},d=>{console.log("Error in getting DeciZone Organization details."),this.loading=!1,this.globalError=!0,this.orgHomeErrMsg="Please make sure you have selected your organization home flowcharts from setting page. Admin of this organization should be able to add selected flowcharts to organization home for quick access by the team."}))})}else{let s=this.sessionStorage.getItem("zdTicket");this._utilService.getZendeskTicketDetails(Number(s)).then(r=>{this.ticketStatus=r.ticket.status,o=r.ticket.tags,this.ticketTags=r.ticket.tags,this.searchText=h.join(o,o&&o.length>1?",":"")}),this._utilService.getZendeskUserDetails().then(r=>{let d=r.user.email;console.log("Zendesk user email - ",d);let z={emailAddress:d,authenticationSource:"ZENDESK",integrationName:"Zendesk",ticketId:this.sessionStorage.getItem("zdTicket"),orgIdentifier:this.sessionStorage.getItem("dzIntegrationOrg")};this._loginService.integrationUserLogin(z).subscribe(U=>{this.sessionStorage.setItem("token",U.responseBody.access_token),this._loginService.setUserLoggedInProperty();var Z=document.getElementById("wrapper");Z&&(Z.classList.add("logged-in-user"),Z.classList.remove("logged-out-user")),this._integrationService.getDzOrgDetailFromIntegration(this.sessionStorage.getItem("dzIntegrationOrg")).subscribe(a=>{console.log("DeciZone org details -",a),a&&a.responseBody?(this.dzOrgName=a.responseBody.orgName,this.dzOrgId=a.responseBody.orgId,this.sessionStorage.setItem("dzOrgId",this.dzOrgId.toString()),this.sessionStorage.setItem("dzOrgName",this.dzOrgName),a.responseBody.logoUrl&&a.responseBody.logoUrl.length>0&&(this.sessionStorage.setObject("orgLogoUrl",a.responseBody.logoUrl),this._loginService.showOrgLogo(!0)),a.responseBody.brandPrimaryColor&&a.responseBody.brandPrimaryColor.length>0&&(this.sessionStorage.setObject("brandPrimColor",a.responseBody.brandPrimaryColor),document.documentElement&&document.documentElement.style.setProperty("--primarycolor",a.responseBody.brandPrimaryColor)),a.responseBody.brandSecondaryColor&&a.responseBody.brandSecondaryColor.length>0&&(this.sessionStorage.setObject("brandSecondColor",a.responseBody.brandSecondaryColor),document.documentElement&&document.documentElement.style.setProperty("--secondarycolor",a.responseBody.brandSecondaryColor)),a.responseBody.textPrimaryColor&&a.responseBody.textPrimaryColor.length>0&&(this.sessionStorage.setObject("textPrimaryColor",a.responseBody.textPrimaryColor),document.documentElement&&document.documentElement.style.setProperty("--primarytextcolor",a.responseBody.textPrimaryColor)),a.responseBody.textSecondaryColor&&a.responseBody.textSecondaryColor.length>0&&(this.sessionStorage.setObject("textSecondaryColor",a.responseBody.textSecondaryColor),document.documentElement&&document.documentElement.style.setProperty("--secondarytextcolor",a.responseBody.textSecondaryColor)),a.responseBody.headerTextColor&&a.responseBody.headerTextColor.length>0&&(this.sessionStorage.setObject("headerTextColor",a.responseBody.headerTextColor),document.documentElement&&document.documentElement.style.setProperty("--thirdtextcolor",a.responseBody.headerTextColor)),a.responseBody.backgroundColor&&a.responseBody.backgroundColor.length>0&&(this.sessionStorage.setObject("backgroundColor",a.responseBody.backgroundColor),document.documentElement&&document.documentElement.style.setProperty("--backgroundcolor",a.responseBody.backgroundColor)),a.responseBody.flashCardColor&&a.responseBody.flashCardColor.length>0&&(this.sessionStorage.setObject("flashCardColor",a.responseBody.flashCardColor),document.documentElement&&document.documentElement.style.setProperty("--flashcardcolor",a.responseBody.flashCardColor)),console.log(this.sessionStorage.getItem("zdTicket")),this._prepareZendeskOrgHomeDetails(this.dzOrgId)):(console.log("Error in getting DeciZone Organization details."),this.loading=!1,this.orgHomeErrMsg="We are unable to retrieve your Organization from DeciZone. Please check with DeciZone support team.",this.globalError=!0)},a=>{console.log("Error in getting DeciZone Organization details."),this.loading=!1,this.orgHomeErrMsg="We are unable to retrieve your Organization from DeciZone. Please check with DeciZone support team.",this.globalError=!0})},U=>{console.log("Error in getting DeciZone authorization token"),this.loading=!1,this.orgHomeErrMsg="Please make sure you have access to the correct DeciZone org; If you dont have access, reach out to Admin of your account and get yourself added to your Organization in DeciZone.",this.globalError=!0})})}}_getZendeskUserData(){var t="https://"+this.sessionStorage.getItem("zendeskSubdomain")+"."+this.sessionStorage.getItem("zendeskHost")+".com",o=this._cookieService.get("zdkToken");console.log("Zendesk token in get user data api call - "+o);const s={headers:new m.WM({"Content-Type":"application/json",Authorization:"Bearer "+o})};return this._httpClient.get(t+"/api/v2/users/me.json",s)}_getZendeskTicketData(){var t="https://"+this.sessionStorage.getItem("zendeskSubdomain")+"."+this.sessionStorage.getItem("zendeskHost")+".com",o=this._cookieService.get("zdkToken");console.log("Zendesk token in get ticket data api call - "+o);const s={headers:new m.WM({"Content-Type":"application/json",Authorization:"Bearer "+o})};let r=this.sessionStorage.getItem("zdTicket");return this._httpClient.get(t+"/api/v2/tickets/"+r+".json",s)}_prepareZendeskOrgHomeDetails(t){this._txnService.getOrgTransactionStatus(this.sessionStorage.getItem("zdTicket"),t).subscribe(o=>{console.log("clientTxnStatus",o),this.clientTxnResponse=o.responseBody,!this.clientTxnResponse||"A"!==this.clientTxnResponse.txnStatus&&"P"!==this.clientTxnResponse.txnStatus?(this.orgHomeErrMsg="",this._userService.getOrganizationHomeFlowcharts(t).subscribe(s=>{console.log("org home flowchart -",s),this.orgHomeFlowchartList=s.responseBody.orgHomeFlowchartList,this._setupMiniSearch(this.orgHomeFlowchartList),this.getFuzzySearch(),this.loading=!1,this.cdr.detectChanges()},s=>{console.log("Error in getting DeciZone Organization details."),this.loading=!1,this.globalError=!0,this.orgHomeErrMsg="Please make sure you have selected your organization home flowcharts from setting page. Admin of this organization should be able to add selected flowcharts to organization home for quick access by the team."})):(this.txnStatus=this.clientTxnResponse.txnStatus,this.txnFlowchartName=this.clientTxnResponse.flowchartName,this.clientTxnResponse.initiatedByOtherUser&&(this.txnActiveUser=this.clientTxnResponse.userForClientTxn),this.loading=!1,this.globalError=!1)},o=>{console.log("Error in getting DeciZone txn/ticket status information."),this.orgHomeErrMsg="",this._userService.getOrganizationHomeFlowcharts(t).subscribe(s=>{console.log("org home flowchart -",s),this.orgHomeFlowchartList=s.responseBody.orgHomeFlowchartList,this._setupMiniSearch(this.orgHomeFlowchartList),this.loading=!1,this.globalError=!1,this.cdr.detectChanges()},s=>{console.log("Error in getting DeciZone Organization details."),this.loading=!1,this.globalError=!0,this.orgHomeErrMsg="Please make sure you have selected your organization home flowcharts from setting page. Admin of this organization should be able to add selected flowcharts to organization home for quick access by the team."})})}initiateFlowchartTransaction(t){console.log(t),this.sessionStorage.removeItem("flowchart"),this.fcloading=!0,this.loadingFcId=t.flowchartId,this._flowchartService.getAndUpdateFlowchartPropertyInSession(t.flowchartId);let o=this.sessionStorage.getItem("zdAppGuid_"+this.sessionStorage.getItem("zdTicket")),s=this.sessionStorage.getItem("zdOrigin"),r={};r.origin=s,r.app_guid=o,this.router.navigate([`transaction/${t.orgId}/${t.goalId}/${t.flowchartId}/${t.flowchartRandomId}/${t.goalUrl}/${t.flowchartName}`],{queryParams:r})}
1txnResumeNextAction(t){if(this.globalError=!1,this.txnResumeLoading=!0,this.selectedTxnResumeOption=t,console.log("selected resume option -",this.selectedTxnResumeOption),this.sessionStorage.removeItem("flowchart"),"R"===this.selectedTxnResumeOption||"S"===this.selectedTxnResumeOption)this._txnService.updateAndGetTxnFlowchartDetails("zendesk",this.clientTxnResponse,this.selectedTxnResumeOption).subscribe(o=>{this._flowchartService.getAndUpdateFlowchartPropertyInSession(this.clientTxnResponse.flowchartId);let s=this.sessionStorage.getItem("zdAppGuid_"+this.sessionStorage.getItem("zdTicket")),r=this.sessionStorage.getItem("zdOrigin"),d={};d.origin=r,d.app_guid=s,this.router.navigate([`transaction/${this.clientTxnResponse.orgId}/${this.clientTxnResponse.goalId}/${this.clientTxnResponse.flowchartId}/${this.clientTxnResponse.flowchartRandomId}/${this.clientTxnResponse.goalUrl}/${this.clientTxnResponse.flowchartName}`],{queryParams:d}),this.txnResumeLoading=!1},o=>{this.txnResumeLoading=!1});else if("D"===this.selectedTxnResumeOption){let o={clientTxnId:this.sessionStorage.getItem("zdTicket"),userSessionId:this._utilService.getCookie("userSessionId"),flowchartId:this.clientTxnResponse.flowchartId,txnStatus:this.selectedTxnResumeOption,orgId:this.clientTxnResponse.orgId,clientTxnSource:"zendesk"};this._txnService.initiateTransaction(o).subscribe(s=>{this.txnResumeLoading=!1,this.txnStatus="D",this.orgHomeErrMsg="",this._userService.getOrganizationHomeFlowcharts(this.sessionStorage.getItem("dzOrgId")).subscribe(r=>{console.log("org home flowchart -",r),this.orgHomeFlowchartList=r.responseBody.orgHomeFlowchartList,this._setupMiniSearch(this.orgHomeFlowchartList),this.loading=!1,this.cdr.detectChanges()},r=>{console.log("Error in getting DeciZone Organization details."),this.loading=!1,this.globalError=!0,this.orgHomeErrMsg="Please make sure you have selected your organization home flowcharts from setting page. Admin of this organization should be able to add selected flowcharts to organization home for quick access by the team."})},s=>{this.txnResumeLoading=!1})}}_updateAndGetTxnFlowchartDetails(){return this._txnService.getTransactionFlowchartDetails("zendesk",this.clientTxnResponse.flowchartId,this.clientTxnResponse.goalUrl,this.clientTxnResponse.flowchartRandomId,this.clientTxnResponse.orgId,this.selectedTxnResumeOption).pipe((0,T.U)(t=>{var r,o=t[0].responseBody;o&&(r=this._flowchartService.prepareBoxConnectionsWithMetadata(o,t[1].responseBody),this.sessionStorage.setObject("flowchart",r))}),(0,M.K)(t=>(0,B.of)(null)))}openAdvancedSearchDialog(){this.fuzzySearchTried=!1,console.log("current fields for search",this.miniSearch.fields);const t={miniSearch:this.miniSearch,fcKeywords:this.fcKeywords,fcDescription:this.fcDescription,fcName:this.fcName,goalName:this.goalName,subCategoryName:this.subCategoryName,subCategoryDescription:this.subCategoryDescription,categoryName:this.categoryName,categoryDescription:this.categoryDescription,prefix:this.prefix,fuzzy:this.fuzzy,selectedCombineTerms:this.selectedCombineTerms};this.ngZone.run(()=>{this._advSearchDialogService.open(t)}),this._advSearchDialogService.confirmed().subscribe(o=>{o&&(this.miniSearch._options.fields.includes("flowchartKeywords")&&(this.fcKeywords=!0),this.miniSearch._options.fields.includes("flowchartDescription")&&(this.fcDescription=!0),this.miniSearch._options.fields.includes("flowchartName")&&(this.fcName=!0),this.miniSearch._options.fields.includes("goalName")&&(this.goalName=!0),this.miniSearch._options.fields.includes("subCategoryName")&&(this.subCategoryName=!0),this.miniSearch._options.fields.includes("subCategoryDescription")&&(this.subCategoryDescription=!0),this.miniSearch._options.fields.includes("categoryName")&&(this.categoryName=!0),this.miniSearch._options.fields.includes("categoryDescription")&&(this.categoryDescription=!0),this.miniSearch._options.prefix&&(this.prefix=!0),this.miniSearch._options.fuzzy&&(this.fuzzy=!0),this.miniSearch._options.searchOptions.combineWith&&(this.selectedCombineTerms=this.miniSearch._options.searchOptions.combineWith))})}removeSearchTag(t){const o=this.ticketTags.indexOf(t);o>
1=0&&(this.ticketTags.splice(o,1),this.searchText=h.join(this.ticketTags,this.ticketTags&&this.ticketTags.length>1?",":""),this.getFuzzySearch())}addSearchTag(t){const o=t.input,s=t.value;(s||"").trim()&&(this.ticketTags.push(s.trim()),this.searchText=h.join(this.ticketTags,this.ticketTags&&this.ticketTags.length>1?",":""),this.getFuzzySearch()),o&&(o.value="")}keyPressSearch(t){this.searchText=t.target.value,this.getFuzzySearch()}getFuzzySearch(){let t=this.miniSearch.search(this.searchText);console.log("raw search result",t);let o=this.searchableFcList,s=[];if(h.forEach(t,function(r){let d=h.find(o,function(z){return z.id===r.id});s.push(d)}),this.orgHomeFlowchartSearchResults=s,console.log("search result ",this.orgHomeFlowchartSearchResults),this.fuzzySearchTried=!0,this.cdr.detectChanges(),this.fuzzySearchTried&&this.orgHomeFlowchartSearchResults&&0===this.orgHomeFlowchartSearchResults.length){let r=document.getElementById("no-search-results");r&&(r.style.display="none")}this._orgService.saveOrgSearchTerm(this.sessionStorage.getItem("dzOrgId"),null,this.searchText).subscribe(r=>{},r=>{})}resetSearchResults(){this.searchText="",this.ticketTags=[],this.fuzzySearchTried=!1,this.orgHomeFlowchartList=this.orgHomeFlowchartListCopy,this.orgHomeFlowchartSearchResults=[],this.cdr.detectChanges()}_setupMiniSearch(t){this.orgHomeFlowchartListCopy=h.cloneDeep(t),this.searchableFcList=this._flowchartUtilService._prepareOrgFlowchartListForSearch(t),console.log("searchableFc",this.searchableFcList),this.miniSearch=new N.Z({fields:["flowchartKeywords","flowchartDescription","flowchartName","goalName","subCategoryName","subCategoryDescription","categoryName","categoryDescription"],searchOptions:{fuzzy:this.fuzzy,prefix:this.prefix,combineWith:this.selectedCombineTerms}}),this.miniSearch.addAll(this.searchableFcList)}ngOnDestroy(){this.zafClient.off("app.registered",this.zafHandler)}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(e.R0b),e.Y36(k.gz),e.Y36(e.sBO),e.Y36(m.jN),e.Y36(x.N_),e.Y36(P.f),e.Y36(l.r),e.Y36(g.V),e.Y36(C.p),e.Y36(u.q),e.Y36(D.X),e.Y36(O.c),e.Y36(b.Q),e.Y36(v.K),e.Y36(R.qo),e.Y36(k.F0))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-zendesk-user-orgHome-fc"]],decls:3,vars:3,consts:[["class","integration-orgHome-messages",4,"ngIf"],[4,"ngIf"],["class","orgHome-page",4,"ngIf"],[1,"integration-orgHome-messages"],[1,"app-spinner","spin-center"],[1,"orgHome-page"],[1,"orgHome-title"],[1,"orgHome-orgName"],[1,"orgHome-buttonlist"],["class","orgHome-each-fc",4,"ngFor","ngForOf"],["id","zdticketid","title","This is the Zendesk Ticket ID you are updating. If you changed the Active Ticket Tab, please make sure it is correct, otherwise close that ticket tab and open it again."],["name","txnActiveOption",1,"common-radio-group",3,"ngModel","ngModelChange"],["value","R",1,"common-radio-button"],["value","D",1,"common-radio-button"],["id","zdusr-activetrnx","type","button","mat-raised-button","",3,"click"],["class","app-spinner",4,"ngIf"],[1,"app-spinner"],["name","selectedTxnResumeOption",1,"common-radio-group",3,"ngModel","ngModelChange"],["value","S",1,"common-radio-button"],["id","zdusr-resumetrnx","type","button","mat-raised-button","",3,"click"],[1,"orghome-sticky-search-top"],[1,"org-home-search"],["mat-elevation-z10","",1,"org-home-search-form"],["appearance","fill",1,"form-full-width","orghome-search-chiplist-field"],[1,"orghome-search-chiplist"],["chipList",""],["class","orghome-search-chip",3,"selectable","removable","removed",4,"ngFor","ngForOf"],["placeholder","Comma seperted TAGs &Keywords",1,"orghome-search-chip-input",3,"matChipInputFor","matChipInputSeparatorKeyCodes","matChipInputAddOnBlur","matChipInputTokenEnd"],["id","org-home-advanced-search-icon","mat-icon-button","","aria-label","Click here for Advanced Search Options",1,"org-home-advanced-search-icon",3,"click"],["id","org-home-search","mat-mini-fab","","color","accent","aria-label","Enter some keywords to search Org-Home.",1,"org-home-search-icon",3,"click"],["id","org-home-close","mat-icon-button","","aria-label","Enter some keywords to search the Organization Home.",1,"org-home-search-clear-icon",3,"click"],["id","orghome-search-results-scrollposition"],["id","no-search-results","class","orghome-search-results-container",4,"ngIf"],["class","orghome-search-results-container",4,"ngIf"],[1,"orghome-search-chip",3,"selectable","removable","removed"],["matChipRemove","",4,"ngIf"],["matChipRemove",""],["id","no-search-results",1,"orghome-search-results-container"],[1,"orghome-search-results-container"],["class","orgHome-goal-cards mat-elevation-z8",4,"ngFor","ngForOf"],[1,"orgHome-goal-cards","mat-elevation-z8"],[1,"orgHome-fc-goal"],[1,"orgHome-goalName","gray-text"],["mat-raised-button","",1,"orgHome-fcNameButton",3,"disabled","click"],[1,"orgHome-fcNameButton-container"],[1,"orgHome-fc-btn-img-div"],["class","fc-btn-image","width","75px","height","50px","loading","lazy",3,"src","alt",4,"ngIf"],["class","fc-btn-image","width","75px","height","50px","loading","lazy","src","assets/images/Flowchart-label-gray-18dp.svg",3,"alt",4,"ngIf"],[1,"orgHome-fc-btn-name-div"],[1,"fc-btn-name"],["width","75px","height","50px","loading","lazy",1,"fc-btn-image",3,"src","alt"],["width","75px","height","50px","loading","lazy","src","assets/images/Flowchart-label-gray-18dp.svg",1,"fc-btn-image",3,"alt"],[1,"orgHome-each-fc"]],template:function(t,o){1&t&&(e.YNc(0,q,4,0,"div",0),e.YNc(1,ee,3,2,"div",1),e.YNc(2,Te,13,8,"div",2)),2&t&&(e.Q6J("ngIf",o.loading),e.xp6(1),e.Q6J("ngIf",!o.loading&&o.globalError),e.xp6(1),e.Q6J("ngIf",!o.loading&&!o.globalError))},dependencies:[p.sg,p.O5,I.JJ,I.On,Y.KE,Q.lW,G.a8,F.qn,F.HS,F.oH,F.qH,W.Hw,$.Ou,L.VQ,L.U0],styles:[".orgHome-page[_ngcontent-%COMP%]{width:100%;max-width:500px;padding:30px 0 5px;margin:0 auto;text-align:center;position:relative}.orgHome-title[_ngcontent-%COMP%]{margin:0;font-size:16px;text-align:center;font-weight:700;color:var(--primarytextcolor)}.orgHome-buttonlist[_ngcontent-%COMP%]{display:block}.orgHome-each-fc[_ngcontent-%COMP%]{margin:30px auto 5px}.orgHome-fc-goal[_ngcontent-%COMP%]{margin:5px auto;font-size:small}.orgHome-fcNameButton[_ngcontent-%COMP%]{margin:0 auto;max-width:250px;white-space:pre-line}.orghome-sticky-search-top[_ngcontent-%COMP%]{position:fixed;width:100%;z-index:1;top:0vh;left:0;background:var(--backgroundcolor)}@media screen and (min-width: 1200px){.orghome-sticky-search-top[_ngcontent-%COMP%]{left:calc(50% - 600px);max-width:1200px}}.org-home-search[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{box-sizing:border-box}.org-home-search-form[_ngcontent-%COMP%]{margin:0 auto;width:90%;max-width:500px;position:relative;text-align:center}#org-home-search-input[_ngcontent-%COMP%]{width:calc(100% - 75px);background-color:#ffd740;border:none;margin:10px auto 10px 0;line-height:26px;padding:2px 35px 2px 5px;font-size:14px;color:var(--primarytextcolor);border-radius:10px}
1.org-home-search-icon[_ngcontent-%COMP%]{position:absolute;right:-15px;top:10px;color:gray}.org-home-search-clear-icon[_ngcontent-%COMP%]{position:absolute;right:35px;top:-5px;color:gray}.org-home-advanced-search-icon[_ngcontent-%COMP%]{position:absolute;left:-25px;top:10px;color:gray;background-color:#f5f5f5}#orghome-search-results-scrollposition[_ngcontent-%COMP%]{width:10%;position:absolute;top:-10vh}.orghome-search-results-container[_ngcontent-%COMP%]{max-height:400px;overflow:auto;padding:0 10px 15px;box-sizing:border-box;border:5px solid var(--secondarycolor);border-radius:10px;margin:75px 0 0}@media screen and (max-width: 600px){.orghome-search-results-container[_ngcontent-%COMP%]{max-height:250px}}.orgHome-goal-cards[_ngcontent-%COMP%]{margin-top:15px!important;padding:10px;border-radius:20px!important}.gray-text[_ngcontent-%COMP%]{color:#696969}.embeded-main-container[_ngcontent-%COMP%]{height:100%!important;width:100%;margin:0!important}.main-content.embeded-main-content.mat-card[_ngcontent-%COMP%]{padding:0!important;height:100%!important}.integration-orgHome-messages[_ngcontent-%COMP%]{margin-top:100px}#zdticketid[_ngcontent-%COMP%]{position:fixed;bottom:0;right:0;font-size:10px;z-index:100;color:green;font-weight:700}.orgHome-fcNameButton[_ngcontent-%COMP%]{margin:0 auto;padding:0;width:300px;color:var(--secondarycolor);height:50px}.orgHome-fcNameButton[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{box-sizing:border-box}.orgHome-fcNameButton-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;border-radius:15px;position:relative}.orgHome-fc-btn-img-div[_ngcontent-%COMP%]{height:50px;width:75px;display:flex;align-items:center}.fc-btn-image[_ngcontent-%COMP%]{object-fit:cover;height:100%;border-top-left-radius:4px;border-bottom-left-radius:4px}.orgHome-fc-btn-name-div[_ngcontent-%COMP%]{height:50px;flex-grow:1;display:flex;flex-direction:column;justify-content:space-around;padding:5px}.fc-btn-name[_ngcontent-%COMP%]{white-space:pre-line;font-size:14px;color:var(--secondarytextcolor);line-height:16px}.orghome-search-chiplist-field[_ngcontent-%COMP%]{max-height:100px;overflow-y:auto;margin:0 10px;display:block}"]}),i})(),ye=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[p.ez,A.o9,I.u5,E.K,k.Bz.forChild([{path:"",component:Ce}])]}),i})()}}]);
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.