PageSourceSearch

https://www.myctb.org/CCB/chunk-LDR2RHJE.js

js myctb.org collected 2026-10-02 07:21:15 UTC 156,936 bytes, 1 lines download raw bytes

1import{a as ze}from"./chunk-FNV3CEER.js";import{a as ft}from"./chunk-X5NLO6JN.js";import{a as yt}from"./chunk-PHGOZ2ID.js";import{a as E}from"./chunk-B5LOWAZW.js";import{a as vt}from"./chunk-PWUVYAS2.js";import{a as qe}from"./chunk-EA3NEFI5.js";import{a as Le}from"./chunk-TVUZLLX3.js";import{a as N}from"./chunk-HQ5SKEFL.js";import{a as It}from"./chunk-DNOHK4YX.js";import{a as Je}from"./chunk-GPQ4OVZK.js";import{a as mt,b as ut,c as St,d as Ct,e as bt,f as gt}from"./chunk-66RXVJVJ.js";import"./chunk-XM7SSGOC.js";import"./chunk-FUMJD5GW.js";import{a as We}from"./chunk-N67FURLJ.js";import"./chunk-5QXZCXF6.js";import{a as ve}from"./chunk-LXZ4VA7X.js";import{a as dt}from"./chunk-KSXSMGJY.js";import{a as ht}from"./chunk-FNHF6VAT.js";import"./chunk-AUWGNVLW.js";import{a as pt}from"./chunk-W4USPYZA.js";import{c as _t}from"./chunk-RYJ4KCCS.js";import{a as ot}from"./chunk-WXF64LMS.js";import{a as nt}from"./chunk-PHZPJRAA.js";import{a as Fe}from"./chunk-LO2MBLEN.js";import"./chunk-EXHSCDC3.js";import{b as ct}from"./chunk-C5V53OZG.js";import{a as Oe}from"./chunk-YIJQH7TD.js";import{a as se}from"./chunk-PFN5DFHE.js";import"./chunk-JKQN4G4W.js";import{a as ge}from"./chunk-7P5XWWGR.js";import{c as lt}from"./chunk-QQND4BMK.js";import"./chunk-EZAL3R2H.js";import"./chunk-UDNYWWOT.js";import{a as ue}from"./chunk-PI24M5HJ.js";import"./chunk-Y43FC3AS.js";import"./chunk-3N7DBALK.js";import"./chunk-7ZON52JP.js";import"./chunk-EKREHPEO.js";import"./chunk-7AE5LMA3.js";import"./chunk-LM35THS4.js";import"./chunk-DUQ7DZLR.js";import"./chunk-B5CSPY5N.js";import{c as H,d as we,f as X,g as Z,h as $,j as C,l as ee,o as te,p as ie,u as re,v as ae,x as ne}from"./chunk-TZTN4RLU.js";import{a as A}from"./chunk-ULAERONH.js";import"./chunk-VG4SL3BH.js";import"./chunk-BA5VPHX4.js";import{a as Q}from"./chunk-DO7FQJLW.js";import{a as I}from"./chunk-JBDIS2F7.js";import"./chunk-TV7WHFF3.js";import{c as q,d as J}from"./chunk-FMWK4SCN.js";import"./chunk-LS72AEKE.js";import{l as xe}from"./chunk-HCLUYBSA.js";import{k as me}from"./chunk-Z6UAK5F5.js";import"./chunk-6UMDV57G.js";import{a as Ye}from"./chunk-QBGGSKLA.js";import"./chunk-PNUPKFHZ.js";import{h as rt,k as at}from"./chunk-ZJEN5QU6.js";import{ia as z,qa as De}from"./chunk-NNTKKQKG.js";import{b as Ue,c as Ve,e as st}from"./chunk-WVJGHZ5K.js";import{$ as Ie,Bb as o,Cb as n,Db as s,Eb as b,Ka as pe,Mb as F,Ob as x,P as $e,Pa as a,Pb as p,Tb as et,Ub as fe,Vb as ye,Ya as L,Z as _,_ as D,ac as y,bb as Y,cc as c,cd as tt,dc as v,dd as W,ec as be,ed as Re,fa as ce,fc as B,gd as it,hb as w,hc as j,ic as P,ja as R,jc as M,kc as O,lc as he,m as K,mc as _e,nc as U,oc as f,pc as de,wc as h,xc as d}from"./chunk-WFCD7VQN.js";import{i as u}from"./chunk-Z2O5QKTL.js";var Dt=(()=>{class i{getSeriesTypeIdByChartTypeId(e,t){let r=0;switch(e){case 1:switch(t){case"ODSS-INDICATORS":r=1;break;case"ODSS-KEYEVENTS":r=2;break;case"ODSS-ACCOMPLISHMENTS":r=3;break;case"ODSS-PARTICIPANTSDESCRIPTION":r=4;break}break;case 2:switch(t){case"ODSS-ACCOMPLISHMENTS":r=6;break;case"ODSS-PARTICIPANTSDESCRIPTION":r=7;break}break;case 3:case 4:switch(t){case"ODSS-ACCOMPLISHMENTS":r=9;break;case"ODSS-PARTICIPANTSDESCRIPTION":r=10;break}case 5:break;case 6:break;default:break}return r}getChartSeriesTypeIdFromSeriesTypeIdLine(e){let t=0;switch(e){case 9:t=3;break;case 6:t=3;break;case 10:t=4;break;case 7:t=4;break;case 8:t=5;break}return t}getChartSeriesTypeIdFromSeriesTypeIdColumnBar(e){let t=0;switch(e){case 3:t=9;break;case 6:t=9;break;case 4:t=10;break;case 7:t=10;break}return t}getChartSeriesTypeIdFromSeriesTypeIdPie(e){let t=0;switch(e){case 3:t=6;break;case 9:t=6;break;case 4:t=7;break;case 10:t=7;break;case 5:t=8;break}return t}getChartSeriesType(e){let t="";switch(e){case 1:t="Indicators";break;case 2:t="KeyEvents";break;case 3:t="Accomplishments";break;case 4:t="ProgramDelivery";break;case 5:t="ProgramOutcomes";break;case 6:t="AccomplishmentsPie";break;case 7:t="ProgramDeliveryPie";break;case 8:t="ProgramOutcomesPie";break;case 9:t="AccomplishmentsComparison";break;case 10:t="ProgramDeliveryComparison";break}return t}getPChartType(e){let t="";switch(e){case 1:t="line";break;case 2:t="pie";break;case 3:t="bar";break;case 4:t="bar";break;case 5:t="doughnut";break;case 6:t="polarArea";break;case 7:t="radar";break}return t}getChartType(e){let t="";switch(e){case 1:t="Series";break;case 2:t="Pie";break;case 3:t="ColumnComparison";break;case 4:t="BarComparison";break;case 5:t="Doughnut";break;case 6:t="PolarArea";break;case 7:t="Radar";break}return t}getPointLabelDisplay(e){let t="";switch(e){case 0:t="Hide";break;case 1:t="Show";break;case 2:t="ShowPieAdvanced";break}return t}getSeriesDisplay(e){let t="";switch(e){case 1:t="Count";break;case 2:t="Sum";break;case 3:t="Average";break}return t}getDisplayScale(e){let t="";switch(e){case 1:t="Month";break;case 2:t="Quarter";break;case 3:t="Year";break;case 4:t="Day";break;case 5:t="Week";break}return t}static \u0275fac=function(t){return new(t||i)};static \u0275prov=$e({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var je={addChartSeriesKeyEvents:i=>u(null,null,function*(){return Ve("api/ChartSeriesKeyEvents/AddChartSeriesKeyEvents",i)}),getChartSeriesKeyEventsBySeriesId:i=>u(null,null,function*(){return Ue("api/ChartSeriesKeyEvents/GetChartSeriesKeyEventsBySeriesId/"+i)}),updateChartSeriesKeyEvents:i=>u(null,null,function*(){return Ve("api/ChartSeriesKeyEvents/UpdateChartSeriesKeyEvents",i)})};var G=()=>({"min-width":"90%","max-width":"90%"}),He=()=>({"min-width":"90%"}),xt=()=>({minWidth:"100%"});function Bt(i,m){i&1&&(n(0,"strong",18),c(1),h(2,"translate"),s()),i&2&&(a(),v(d(2,1,"lblTitle")))}function Vt(i,m){i&1&&(n(0,"strong",18),c(1),h(2,"translate"),h(3,"translate"),s()),i&2&&(a(),B("",d(2,2,"lblLegend")," ",d(3,4,"lblLabel")))}function jt(i,m){i&1&&(n(0,"div")(1,"strong",8),c(2),h(3,"translate"),s()()),i&2&&(a(2),be("",d(3,1,"lblDuplicateGraphTitleExists")," "))}function Pt(i,m){i&1&&(n(0,"div")(1,"strong",8),c(2),h(3,"translate"),s()()),i&2&&(a(2),v(d(3,1,"lblGraphMaxLength")))}function Mt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",19),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s(),b(7,"br"),n(8,"strong",19),c(9),h(10,"translate"),s()(),n(11,"div",9)(12,"p-select",20),h(13,"translate"),x("onChange",function(r){_(e);let l=p(2);return D(l.graphsTemplateOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,7,"lblCreateGraphFromTemplate")),a(6),v(d(10,9,"lblTemplate")),a(3),y(f(13,G)),o("placeholder",O(d(13,11,"lblDefaultSelect")))("options",e.graphsTemplateList)}}function kt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",21),c(3),h(4,"translate"),h(5,"translate"),s(),n(6,"strong",8),c(7," *"),s()(),n(8,"div",9)(9,"p-select",22),h(10,"translate"),x("onChange",function(r){_(e);let l=p(2);return D(l.chartSitesOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),B("",d(4,7,"lblSelectText"),"\xA0",d(5,9,"lblSites")),a(6),y(f(13,He)),o("placeholder",O(d(10,11,"lblDefaultSelect")))("options",e.ccbSites)}}function Kt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",23),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9)(8,"p-select",24),h(9,"translate"),x("onChange",function(r){_(e);let l=p(2);return D(l.ccbFormOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,6,"lblForm")),a(5),y(f(10,G)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbForms)}}function Rt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",25),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9)(8,"p-select",26),h(9,"translate"),x("onChange",function(r){_(e);let l=p(2);return D(l.metaFieldsOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,6,"lblWhatSpecificInformationTOGraph")),a(5),y(f(10,G)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.metaFields)}}function Yt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",27),c(3),h(4,"translate"),s()(),n(5,"div",9)(6,"p-multiSelect",28),M("ngModelChange",function(r){_(e);let l=p(2);return P(l.selectedChoices,r)||(l.selectedChoices=r),D(r)}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,6,"lblValuesToGraph")),a(3),y(f(8,He)),o("options",e.ccbFieldChoices),j("ngModel",e.selectedChoices),o("panelStyle",f(9,xt))}}function Ut(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",29),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9)(8,"p-select",30),M("ngModelChange",function(r){_(e);let l=p(2);return P(l.selectedPDTypeName,r)||(l.selectedPDTypeName=r),D(r)}),x("onChange",function(r){_(e);let l=p(2);return D(l.PDTypeNameOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,5,"lblCategory")),a(5),y(f(7,G)),o("options",e.ccbPDTypes),j("ngModel",e.selectedPDTypeName)}}function Wt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",31),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9)(8,"p-select",32),M("ngModelChange",function(r){_(e);let l=p(2);return P(l.selectedPDSubCategory,r)||(l.selectedPDSubCategory=r),D(r)}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,5,"lblSubCategory")),a(5),y(f(7,G)),o("options",e.ccbPDSubCategories),j("ngModel",e.selectedPDSubCategory)}}function qt(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",33),
1c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"p-select",34),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblPDService")),a(5),y(f(6,G)),o("options",e.PDServiceOptions)}}function Jt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",35),c(3),h(4,"translate"),s()(),n(5,"div",9)(6,"p-select",36),x("onChange",function(r){_(e);let l=p(2);return D(l.indicatorCategoriesOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,4,"lblCategory")),a(3),y(f(6,G)),o("options",e.ccbIndicatorCategories)}}function zt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",37),c(3),h(4,"translate"),s()(),n(5,"div",9)(6,"p-select",38),x("onChange",function(r){_(e);let l=p(2);return D(l.indicatorDataSourceOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,4,"lblResource")),a(3),y(f(6,G)),o("options",e.ccbIndicatorDataSources)}}function Qt(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",39),c(3),h(4,"translate"),s()(),n(5,"div",9),b(6,"p-select",40),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblTopicArea")),a(3),y(f(6,G)),o("options",e.ccbIndicatorTopics)}}function Ht(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",41),c(3),h(4,"translate"),s()(),n(5,"div",9),b(6,"p-select",42),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblInitative")),a(3),y(f(6,G)),o("options",e.ccbIndicatorInitiatives)}}function Xt(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",43),c(3),h(4,"translate"),s()(),n(5,"div",9)(6,"p-select",44),x("onChange",function(r){_(e);let l=p(2);return D(l.geographicLevelsOnChange(r))}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,4,"lblGeographicLevel")),a(3),y(f(6,G)),o("options",e.ccbIndicatorGeographicLevels)}}function Zt(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",45),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"p-select",46),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCensusTract")),a(5),y(f(10,G)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCensusTractList)}}function $t(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",47),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"p-select",48),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCustomLocation")),a(5),y(f(10,G)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCustomLocationList)}}function ei(i,m){i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",49),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"input",50),s()()),i&2&&(a(3),v(d(4,3,"lblStreetAddress")),a(5),y(f(5,G)))}function ti(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",51),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"p-select",52),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCity")),a(5),y(f(10,G)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCityList)}}function ii(i,m){i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",53),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"input",54),s()()),i&2&&(a(3),v(d(4,3,"lblZip")),a(5),y(f(5,G)))}function ri(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",55),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"p-select",56),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblState")),a(5),y(f(10,G)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorStateList)}}function ai(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",57),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9),b(8,"p-select",58),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCounty")),a(5),y(f(10,G)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCountyList)}}function ni(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",59),c(3),h(4,"translate"),s()(),n(5,"div",9),b(6,"p-select",60),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblIndicator")),a(3),y(f(6,G)),o("options",e.ccbIndicatorNames)}}function si(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",61),c(3),s()(),n(4,"div",9),b(5,"p-select",62),h(6,"translate"),s()()),i&2){let e=p(2);a(3),v(e.Custom1Label),a(2),y(f(8,G)),o("placeholder",O(d(6,6,"lblDefaultSelect")))("options",e.ccbIndicatorCustom1List)}}function oi(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",63),c(3),s()(),n(4,"div",9),b(5,"p-select",64),h(6,"translate"),s()()),i&2){let e=p(2);a(3),v(e.Custom2Label),a(2),y(f(8,G)),o("placeholder",O(d(6,6,"lblDefaultSelect")))("options",e.ccbIndicatorCustom2List)}}function li(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",65),c(3),s()(),n(4,"div",9),b(5,"p-select",66),h(6,"translate"),s()()),i&2){let e=p(2);a(3),v(e.Custom3Label),a(2),y(f(8,G)),o("placeholder",O(d(6,6,"lblDefaultSelect")))("options",e.ccbIndicatorCustom3List)}}function ci(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",67),c(3),s()(),n(4,"div",9),b(5,"p-select",68),h(6,"translate"),s()()),i&2){let e=p(2);a(3),v(e.Custom4Label),a(2),y(f(8,G)),o("placeholder",O(d(6,6,"lblDefaultSelect")))("options",e.ccbIndicatorCustom4List)}}function pi(i,m){if(i&1&&(n(0,"div",5)(1,"div",6)(2,"strong",69),c(3),s()(),n(4,"div",9),b(5,"p-select",70),h(6,"translate"),s()()),i&2){let e=p(2);a(3),v(e.Custom5Label),a(2),y(f(8,G)),o("placeholder",O(d(6,6,"lblDefaultSelect")))("options",e.ccbIndicatorCustom5List)}}function hi(i,m){if(i&1){let e=F();n(0,"div",5)(1,"div",6)(2,"strong",71),c(3),h(4,"translate"),s(),n(5,"strong",8),c(6," *"),s()(),n(7,"div",9)(8,"p-multiSelect",72),h(9,"translate"),M("ngModelChange",function(r){_(e);let l=p(2);return P(l.selectedKeyEvents,r)||(l.selectedKeyEvents=r),D(r)}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,8,"lblKeyEvents")),a(5),y(f(12,He)),o("placeholder",O(d(9,10,"lblDefaultSelect")))("options",e.ccbKeyEvents),j("ngModel",e.selectedKeyEvents),o("panelStyle",f(13,xt))}}function di(i,m){if(i&1&&(b(0,"button",73),h(1,"translate")),i&2){let e=p(2);o("label",O(d(1,3,"lblCreateGraph")))("disabled",e.graphForm.invali
1d)}}function mi(i,m){if(i&1){let e=F();n(0,"form",3),x("ngSubmit",function(){_(e);let r=p();return D(r.saveGraph(r.graphForm))}),n(1,"div",4)(2,"div",5)(3,"div",6),w(4,Bt,3,3,"strong",7)(5,Vt,4,6,"strong",7),n(6,"strong",8),c(7," *"),s()(),n(8,"div",9),b(9,"input",10)(10,"br"),w(11,jt,4,3,"div",11)(12,Pt,4,3,"div",11),s()(),n(13,"div",5)(14,"div",6)(15,"strong",12),c(16),h(17,"translate"),s(),n(18,"strong",8),c(19," *"),s()(),n(20,"div",9)(21,"p-select",13),h(22,"translate"),x("onChange",function(r){_(e);let l=p();return D(l.graphsDataTypeOnChange(r))}),s()()(),w(23,Mt,14,14,"div",14)(24,kt,11,14,"div",14)(25,Kt,10,11,"div",14)(26,Rt,10,11,"div",14)(27,Yt,7,10,"div",14)(28,Ut,9,8,"div",14)(29,Wt,9,8,"div",14)(30,qt,9,7,"div",14)(31,Jt,7,7,"div",14)(32,zt,7,7,"div",14)(33,Qt,7,7,"div",14)(34,Ht,7,7,"div",14)(35,Xt,7,7,"div",14)(36,Zt,10,11,"div",14)(37,$t,10,11,"div",14)(38,ei,9,6,"div",14)(39,ti,10,11,"div",14)(40,ii,9,6,"div",14)(41,ri,10,11,"div",14)(42,ai,10,11,"div",14)(43,ni,7,7,"div",14)(44,si,7,9,"div",14)(45,oi,7,9,"div",14)(46,li,7,9,"div",14)(47,ci,7,9,"div",14)(48,pi,7,9,"div",14)(49,hi,10,14,"div",14),n(50,"div",5)(51,"div",6),c(52," \xA0 "),s(),n(53,"div",15),w(54,di,2,5,"button",16),n(55,"button",17),h(56,"translate"),x("click",function(){_(e);let r=p();return D(r.showHelp())}),s()()()()()}if(i&2){let e,t=p();o("formGroup",t.graphForm),a(4),o("ngIf",!t.ChartId),a(),o("ngIf",t.ChartId),a(6),o("ngIf",t.isDuplicateGraphTitle),a(),o("ngIf",t.graphForm.invalid&&(t.graphForm.dirty||t.graphForm.touched)&&((e=t.graphForm.get("Title").errors)==null?null:e.maxlength)),a(4),v(d(17,41,"lblWhatDataType")),a(5),y(f(47,G)),o("placeholder",O(d(22,43,"lblDefaultSelect")))("options",t.DefaultGraphsDataTypesOptions),a(2),o("ngIf",t.selectedDataTypeToGraph==="ODSS-TEMPLATE"),a(),o("ngIf",(t.selectedDataTypeToGraph==="ODSS-ACCOMPLISHMENTS"||t.selectedDataTypeToGraph==="ODSS-INDICATORS")&&!t.isNewGraph),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-ACCOMPLISHMENTS"||t.selectedDataTypeToGraph==="ODSS-PARTICIPANTSDESCRIPTION"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-ACCOMPLISHMENTS"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-ACCOMPLISHMENTS"&&t.graphSpecificValues),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-PARTICIPANTSDESCRIPTION"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-PARTICIPANTSDESCRIPTION"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-PARTICIPANTSDESCRIPTION"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.selectedGeographicLevel==="CensusTract"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.selectedGeographicLevel==="CustomLocation"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.selectedGeographicLevel==="SpecificAddress"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&(t.selectedGeographicLevel==="SpecificAddress"||t.selectedGeographicLevel==="City")),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&(t.selectedGeographicLevel==="SpecificAddress"||t.selectedGeographicLevel==="Zip")),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&(t.selectedGeographicLevel==="SpecificAddress"||t.selectedGeographicLevel==="State")),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&(t.selectedGeographicLevel==="SpecificAddress"||t.selectedGeographicLevel==="County")),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.Custom1Used),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.Custom2Used),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.Custom3Used),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.Custom4Used),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-INDICATORS"&&t.Custom3Used),a(),o("ngIf",t.selectedDataTypeToGraph==="ODSS-KEYEVENTS"),a(5),o("ngIf",t.isNewGraph),a(),o("label",O(d(56,45,"lblHelp")))}}var wt=(()=>{class i{_graphsService;_ccbContextService;_commonService;_siteSettingsService;_translate;ChartId;FolderId;onSave=new ce;newChartId;newChartCreationObj={};newChartSeriesCreationObj={};chartSeriesKeyEvents=[];chartObj;spSiteId;spSiteUrl;graphForm;group={};translatedKeyValues;menuitems;msgs=R([]);
1isDuplicateGraphTitle=!1;isNewGraph;loading=!0;displayDialog;ccbSites=[];selectedSite;ccbForms=[];selectedCCBForm;metaFields=[];selectedCCBField;ccbFieldChoices;selectedChoices;graphSpecificValues=!1;ccbPDTypes;selectedPDTypeName;ccbPDSubCategories;selectedPDSubCategory;ccbIndicatorCategories=[];ccbIndicatorDataSources=[];ccbIndicatorTopics=[];ccbIndicatorInitiatives=[];ccbIndicatorGeographicLevels=[];ccbIndicatorNames=[];ccbIndicatorCustom1List=[];ccbIndicatorCustom2List=[];ccbIndicatorCustom3List=[];ccbIndicatorCustom4List=[];ccbIndicatorCustom5List=[];ccbIndicatorCityList=[];ccbIndicatorStateList=[];ccbIndicatorCountyList=[];ccbIndicatorCensusTractList=[];ccbIndicatorCustomLocationList=[];IndicatorsData;Custom1Used=!1;Custom2Used=!1;Custom3Used=!1;Custom4Used=!1;Custom5Used=!1;Custom1Label;Custom2Label;Custom3Label;Custom4Label;Custom5Label;ccbKeyEvents=[];chartTemplates;graphsTemplateList=[];chartSeriesDatas;selectedTemplateId="";chartWithOutTemplates;comparisonChartOptions=[];ObserverOptions;DefaultGraphsDataTypesOptions;selectedDataTypeToGraph;PDServiceOptions;selectedGeographicLevel;OriginalIndicatorsData;constructor(e,t,r,l,g){this._graphsService=e,this._ccbContextService=t,this._commonService=r,this._siteSettingsService=l,this._translate=g}ngOnInit(){this.getRequiredTranslations()}getRequiredTranslations(){return u(this,null,function*(){let e=yield K(this._translate.get(["lblAccomplishments","lblParticipantDescription","lblIndicators","lblKeyEvents","lblCreateGraphFromTemplate","lblPDNumberServed","lblPDParticipants","lblCreateNewGraph","lblMsgCreationComplete","lblSelect","lblGraphMaxLength","lblResource"]));this.translatedKeyValues=e,this.spSiteId=this._ccbContextService.getSPSiteId(),this.spSiteUrl=this._ccbContextService.getSPSiteUrl(),this.ChartId?(this.isNewGraph=!1,yield this.getChartData()):(this.isNewGraph=!0,this.loadChoices(),this.buildFormGroup(),yield this.initializeNewGraphDefaults())})}initializeNewGraphDefaults(){return u(this,null,function*(){let e="ODSS-ACCOMPLISHMENTS";this.graphForm.controls.GraphsDataType.setValue(e),yield this.graphsDataTypeOnChange({value:e}),this._siteSettingsService.hasSiteSettings()||(yield this._siteSettingsService.getSiteInfo(this.spSiteId));let t=this._siteSettingsService.getDefaultFormId();if(t&&this.ccbForms&&this.ccbForms.length>0){let r=this.ccbForms.find(l=>l.FormId==t);r&&(this.selectedCCBForm=r,this.graphForm.controls.IntervalFormId.setValue(r),yield this.ccbFormOnChange({value:r}))}this.loading=!1})}getChartData(){return u(this,null,function*(){let e=yield N.getChartsByChartId(this.ChartId);e&&(this.chartObj=e,this.loadChoices(),this.buildFormGroup())})}loadChoices(){this.ObserverOptions=[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3}],this.DefaultGraphsDataTypesOptions=[{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblAccomplishments","~Accomplishments~"),value:"ODSS-ACCOMPLISHMENTS"},{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblParticipantDescription","~Participant Description~"),value:"ODSS-PARTICIPANTSDESCRIPTION"},{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblIndicators","~Indicators~"),value:"ODSS-INDICATORS"},{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblKeyEvents","~Key Events~"),value:"ODSS-KEYEVENTS"},{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblCreateGraphFromTemplate","~Create Graph from Template~"),value:"ODSS-TEMPLATE"}],this.isNewGraph?this.DefaultGraphsDataTypesOptions=this.DefaultGraphsDataTypesOptions.filter(e=>e.value!="ODSS-KEYEVENTS"):(this.chartObj.ChartTypeId!=1&&(this.DefaultGraphsDataTypesOptions=this.DefaultGraphsDataTypesOptions.filter(e=>e.value!="ODSS-KEYEVENTS")),this.DefaultGraphsDataTypesOptions=this.DefaultGraphsDataTypesOptions.filter(e=>e.value!="ODSS-TEMPLATE")),this.PDServiceOptions=[{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblPDNumberServed","~Number Served~"),value:"Number Served"},{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblPDParticipants","~New Participants~"),value:"New Participants"}]}buildFormGroup(){this.group.Title=new C("",[we.required,we.maxLength(75)]),this.group.GraphsDataType=new C("",[we.required]),this.group.TemplateID=new C("",[]),this.group.IntervalSiteId=new C("",[]),this.group.IntervalFormId=new C("",[]),this.group.MetaFieldId=new C("",[]),this.group.MetaFieldChoices=new C("",[]),this.group.Observer=new C("",[]),this.group.PDTypeName=new C("",[]),this.group.PDSubCategory=new C("",[]),this.group.PDService=new C("",[]),this.group.DataSource=new C("",[]),this.group.ResourceId=new C("",[]),this.group.Series=new C("",[]),this.group.Initiative=new C("",[]),this.group.Category=new C("",[]),this.group.GeographicLevel=new C("",[]),this.group.CustomLocation=new C("",[]),this.group.CensusTract=new C("",[]),this.group.StreetAddress=new C("",[]),this.group.City=new C("",[]),this.group.State=new C("",[]),this.group.Zip=new C("",[]),this.group.County=new C("",[]),this.group.IndicatorName=new C("",[]),this.group.IndicatorCustom1=new C("",[]),this.group.IndicatorCustom2=new C("",[]),this.group.IndicatorCustom3=new C("",[]),this.group.IndicatorCustom4=new C("",[]),this.group.IndicatorCustom5=new C("",[]),this.group.KeyEvents=new C("",[]),this.graphForm=new $(this.group)}getChartTemplates(){return u(this,null,function*(){this.graphsTemplateList=[];let e=yield N.getChartTemplatesBySiteId(this.spSiteId);e&&(this.chartTemplates=e,this.chartTemplates&&this.chartTemplates.length>
10&&this.chartTemplates.forEach(t=>{let r=t.Title,l=t.ChartId,g={label:r,value:l};this.graphsTemplateList.push(g)}))})}getCCBSites=()=>u(this,null,function*(){this.ccbSites=yield Le.getSiteAllWebs()});getMetaForms(e){return u(this,null,function*(){let t=yield Fe.getMetaFormsBySiteId(e);t&&(this.ccbForms=t)})}getMetaFields(e){return u(this,null,function*(){if(e){let t=yield We.getMetaFieldsByFormId(e);this.metaFields=t,this.metaFields.sort(function(r,l){var g=r.DisplayName.toUpperCase(),T=l.DisplayName.toUpperCase();return g<T?-1:g>T?1:0}),this.metaFields=this.metaFields.filter(r=>r.GraphShow==!0)}})}getPDTypes(){return u(this,null,function*(){this.graphForm.controls.PDService.setValue("Number Served"),this.ccbPDTypes=[];let e=yield Je.getProgramDeliveryTypesBySiteId(this.spSiteId);e&&(this.ccbPDTypes=e,this.ccbPDTypes.length>0&&(this.selectedPDTypeName=this.ccbPDTypes[0],this.getPDSubCategories(this.ccbPDTypes[0])))})}getPDSubCategories(e){this.ccbPDSubCategories=[],this.ccbPDSubCategories=e.ProgramDeliveryOptions,this.ccbPDSubCategories.sort(function(t,r){return t.OrderNumber>r.OrderNumber?1:r.OrderNumber>t.OrderNumber?-1:0}),this.ccbPDSubCategories.length>0&&(this.selectedPDSubCategory=this.ccbPDSubCategories[0])}getChartIndicatorCategories(){return u(this,arguments,function*(e=this.spSiteId){let t=yield ze.getIndicatorsBySiteId(e);t&&t.length>0?(this.ccbIndicatorCategories=this._commonService.getDefaultAllDropDownOption(),this.IndicatorsData=this.OriginalIndicatorsData=t,this.IndicatorsData.length>0&&(this.getIndicatorListDefaults(),this.IndicatorsData.forEach(r=>{this.getIndicatorCategories(r),this.getIndicatorDataSourceList(r),this.getOtherIndicatorsDropDowns(r)}),this.ccbIndicatorDataSources.length>0&&this.graphForm.controls.ResourceId.setValue(this.ccbIndicatorDataSources[0].value))):(this.IndicatorsData=null,this.ccbIndicatorCategories=null,this.ccbIndicatorDataSources=null,this.clearOtherIndicators())})}getIndicatorDataSourceList(e){if(!I(e.ResourceName)&&this.ccbIndicatorDataSources.filter(t=>t.label===e.ResourceName).length==0){let t={label:e.ResourceName,value:e.ResourceId};this.ccbIndicatorDataSources.push(t)}}getIndicatorCategories(e){let t=this.ccbIndicatorCategories.filter(r=>r.label===e.Category).length;if(!I(e.Category)&&t===0){let r={label:e.Category,value:e.Category};this.ccbIndicatorCategories.push(r)}}clearOtherIndicators(){this.ccbIndicatorTopics=null,this.ccbIndicatorInitiatives=null,this.ccbIndicatorGeographicLevels=null,this.ccbIndicatorNames=null,this.ccbIndicatorCustom1List=null,this.ccbIndicatorCustom2List=null,this.ccbIndicatorCustom3List=null,this.ccbIndicatorCustom4List=null,this.ccbIndicatorCustom5List=null,this.ccbIndicatorCityList=null,this.ccbIndicatorStateList=null,this.ccbIndicatorCountyList=null,this.ccbIndicatorCensusTractList=null,this.ccbIndicatorCustomLocationList=null}getOtherIndicatorsDropDowns(e){let t=e.GeographicLevel;if(!I(t)&&t!=""&&this.ccbIndicatorGeographicLevels.filter(S=>S.label===t).length==0){let S={label:t,value:t};this.ccbIndicatorGeographicLevels.push(S)}let r=e.County;if(!I(r)&&r!=""&&this.ccbIndicatorCountyList.filter(S=>S.label===r).length==0){let S={label:r,value:r};this.ccbIndicatorCountyList.push(S)}let l=e.State;if(!I(l)&&l!=""&&this.ccbIndicatorStateList.filter(S=>S.label===l).length==0){let S={label:l,value:l};this.ccbIndicatorStateList.push(S)}let g=e.CustomLocation;if(!I(g)&&g!=""&&this.ccbIndicatorCustomLocationList.filter(S=>S.label===g).length==0){let S={label:g,value:g};this.ccbIndicatorCustomLocationList.push(S)}let T=e.City;if(!I(T)&&T!=""&&this.ccbIndicatorCityList.filter(S=>S.label===T).length==0){let S={label:T,value:T};this.ccbIndicatorCityList.push(S)}let k=e.CensusTract;if(!I(k)&&k!=""&&this.ccbIndicatorCensusTractList.filter(S=>S.label===k).length==0){let S={label:k,value:k};this.ccbIndicatorCensusTractList.push(S)}let oe=e.IndicatorName;if(!I(oe)&&oe!=""&&this.ccbIndicatorNames.filter(S=>S.label===oe).length==0){let S={label:oe,value:oe};this.ccbIndicatorNames.push(S)}let Se=e.Initiative;if(!I(Se)&&Se!=""&&this.ccbIndicatorInitiatives.filter(S=>S.label===Se).length==0){let S={label:Se,value:Se};this.ccbIndicatorInitiatives.push(S)}let Ce=e.TopicArea;if(!I(Ce)&&Ce!=""&&this.ccbIndicatorTopics.filter(S=>S.label===Ce).length==0){let S={label:Ce,value:Ce};this.ccbIndicatorTopics.push(S)}if(this.Custom1Used=e.Custom1Used,this.Custom1Label=e.Custom1Label,this.Custom1Used&&e.Custom1Type==="Drop Down List"){let S=e.Custom1;if(!I(S)&&S!=""&&this.ccbIndicatorCustom1List.filter(V=>V.label===S).length==0){let V={label:S,value:S};this.ccbIndicatorCustom1List.push(V)}}if(this.Custom2Used=e.Custom2Used,this.Custom2Label=e.Custom2Label,this.Custom2Used&&e.Custom2Type==="Drop Down List"){let S=e.Custom2;if(!I(S)&&S!=""&&this.ccbIndicatorCustom2List.filter(V=>V.label===S).length==0){let V={label:S,value:S};this.ccbIndicatorCustom3List.push(V)}}if(this.Custom3Used=e.Custom3Used,this.Custom3Label=e.Custom3Label,this.Custom3Used&&e.Custom3Type==="Drop Down List"){let S=e.Custom3;if(!I(S)&&S!=""&&this.ccbIndicatorCustom3List.filter(V=>V.label===S).length==0){let V={label:S,value:S};this.ccbIndicatorCustom3List.push(V)}}if(this.Custom4Used=e.Custom4Used,this.Custom4Label=e.Custom4Label,this.Custom4Used&&e.Custom4Type==="Drop Down List"){let S=e.Custom4;if(!I(S)&&S!=""&&this.ccbIndicatorCustom4List.filter(V=>V.label===S).length==0){let V={label:S,value:S};this.ccbIndicatorCustom4List.push(V)}}if(this.Custom5Used=e.Custom5Used,this.Custom5Label=e.Custom5Label,this.Custom5Used&&e.Custom5Type==="Drop Down List"){let S=e.Custom5;if(!I(S)&&S!=""&&this.ccbIndicatorCustom5List.filter(V=>V.label===S).length==0){let V={label:S,value:S};this.ccbIndicatorCustom5List.push(V)}}this.setIsUsed()}getIndicatorListDefaults(){this.ccbIndicatorCityList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorStateList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCountyList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCensusTractList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCustomLocationList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorGeographicLevels=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorNames=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorInitiatives=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorTopics=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCustom1List=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCustom2List=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCustom3List=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCustom4List=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCustom5List=this._commonService.getDefaultAllDropDownOption()}geographicLevelsOnChange(e){this.selectedGeographicLevel=e.value}setIsUsed(){this.Custom1Used=!I(this.ccbIndicatorCustom1List)&&this.ccbIndicatorCustom1List.length>1,this.Custom2Used=!I(this.ccbIndicatorCustom2List)&&this.ccbIndicatorCustom2List.length>1,this.Custom3Used=!I(this.ccbIndicatorCustom3List)&&this.ccbIndicatorCustom3List.length>1,this.Custom4Used=!I(this.ccbIndicatorCustom4List)&&this.ccbIndicatorCustom4List.length>1,this.Custom5Used=!I(this.ccbIndicatorCustom5List)&&this.ccbIndicatorCustom5List.length>1}getKeyEvents(){return u(this,null,function*(){let e=yield qe.getKeyEventsBySiteId(this.spSiteId);this.ccbKeyEvents=e})}graphsDataTypeOnChange(e){return u(this,null,function*(){switch(this.selectedDataTypeToGraph=e.value,this.clearIndicatorFields(),this.clearPDFields(),this.clearAccomplishmentFields(),this.clearKeyEventFields(),this.selectedDataTypeToGraph){case"ODSS-INDICATORS":this.ChartId?yield this.getCCBSites():yield this.getChartIndicatorCategories();break;case"ODSS-PARTICIPANTSDESCRIPTION":yield this.getMetaForms(this.spSiteId),yield this.getPDTypes();break;case"ODSS-ACCOMPLISHMENTS":this.ChartId?yield this.getCCBSites():yield this.getMetaForms(this.spSiteId);break;case"ODSS-KEYEVENTS":yield this.getKeyEvents();break;case"ODSS-TEMPLATE":yield this.getChartTemplates();break}})}graphsTemplateOnChange(e){this.selectedTemplateId=e.value}chartSitesOnChange(e){return u(this,null,function*(){this.selectedSite=e.value,this.selectedDataTypeToGraph==="ODSS-ACCOMPLISHMENTS"?yield this.getMetaForms(this.selectedSite.SPSiteId):yield this.getChartIndicatorCategories(this.selectedSite.SPSiteId)})}ccbFormOnChange(e){return u(this,null,function*(){this.selectedCCBForm=e.value,this.selectedDataTypeToGraph==="ODSS-ACCOMPLISHMENTS"&&(yield this.getMetaFields(this.selectedCCBForm.FormId))})}metaFieldsOnChange(e){this.selectedCCBField=e.value,this.ccbFieldChoices=[],this.selectedCCBField.Choices!=""?(this.graphSpecificValues=!0,this.selectedChoices=this._commonService.convertPipedToArray(this.selectedCCBField.Choices),this.selectedChoices.forEac
1h(t=>{let r={label:t,value:t};this.ccbFieldChoices.push(r)})):this.graphSpecificValues=!1}PDTypeNameOnChange(e){let t=e.value;this.getPDSubCategories(t)}indicatorCategoriesOnChange(e){this.IndicatorsData=this.OriginalIndicatorsData.filter(t=>t.Category==e.value),this.ccbIndicatorDataSources=[],this.clearOtherIndicators(),this.getIndicatorListDefaults(),this.IndicatorsData.forEach(t=>{this.getIndicatorDataSourceList(t),this.getOtherIndicatorsDropDowns(t)}),this.ccbIndicatorDataSources.length>0&&this.graphForm.controls.ResourceId.setValue(this.ccbIndicatorDataSources[0].value)}indicatorDataSourceOnChange(e){this.IndicatorsData=this.OriginalIndicatorsData.filter(t=>t.ResourceId==e.value),this.clearOtherIndicators(),this.getIndicatorListDefaults(),this.IndicatorsData.forEach(t=>{this.getOtherIndicatorsDropDowns(t)})}clearAllFields(){this.selectedDataTypeToGraph=null,this.graphForm.controls.Title.setValue(""),this.graphForm.controls.GraphsDataType.setValue(""),this.clearIndicatorFields(),this.clearPDFields(),this.clearAccomplishmentFields(),this.clearKeyEventFields()}clearIndicatorFields(){this.ccbIndicatorCategories=[],this.ccbIndicatorDataSources=[],this.ccbIndicatorTopics=[],this.ccbIndicatorInitiatives=[],this.ccbIndicatorGeographicLevels=[],this.ccbIndicatorNames=[],this.ccbIndicatorCustom1List=[],this.ccbIndicatorCustom2List=[],this.ccbIndicatorCustom3List=[],this.ccbIndicatorCustom4List=[],this.ccbIndicatorCustom5List=[]}clearAccomplishmentFields(){this.ccbSites=[],this.ccbForms=[],this.metaFields=[],this.ccbFieldChoices=[]}clearPDFields(){this.ccbPDTypes=[],this.ccbPDSubCategories=[]}clearKeyEventFields(){this.ccbKeyEvents=[]}postNewChart(){return u(this,null,function*(){try{(yield N.postODSChart(this.newChartCreationObj))&&(yield this.postNewChartSeries())}catch(e){this.msgs.set([{severity:"error",summary:e._body??e}])}})}postNewChartSeries(){return u(this,null,function*(){try{yield E.postODSChartSeries(this.newChartSeriesCreationObj),this.newChartId=this.newChartSeriesCreationObj.ChartId,this.selectedDataTypeToGraph==="ODSS-KEYEVENTS"?yield this.postNewChartSeriesKeyEvents():(this.clearAllFields(),this.onSave.emit(this.newChartId))}catch(e){this.msgs.set([{severity:"error",summary:e}])}})}postNewChartSeriesKeyEvents(){return u(this,null,function*(){try{(yield je.addChartSeriesKeyEvents(this.chartSeriesKeyEvents))&&(this.clearAllFields(),this.onSave.emit(this.newChartId))}catch(e){this.msgs.set([{severity:"error",summary:e}])}})}createNewGraphFromDataType(){return u(this,null,function*(){switch(this.selectedDataTypeToGraph){case"ODSS-INDICATORS":this.isNewGraph?yield this.createNewIndicatorGraphType():yield this.createNewIndicatorSeries();break;case"ODSS-PARTICIPANTSDESCRIPTION":this.isNewGraph?yield this.createNewPDGraphType():yield this.createNewPDSeries();break;case"ODSS-ACCOMPLISHMENTS":this.isNewGraph?yield this.createNewAccomplishmentGraphType():yield this.createNewAccomplishmentSeries();break;case"ODSS-KEYEVENTS":yield this.createNewKeyEventSeries();break;case"ODSS-TEMPLATE":yield this.createNewGraphFromTemplate();break}})}setDefaultChartCreationObject(){this.newChartCreationObj.ChartId=this._commonService.newGuid(),this.newChartCreationObj.Title=this.graphForm.controls.Title.value,this.newChartCreationObj.StartDate=new Date(new Date().getFullYear(),0,1),this.newChartCreationObj.StopDate=new Date(new Date().getFullYear(),11,31),this.newChartCreationObj.DisplayScale=1,this.newChartCreationObj.ChartTypeId=1,this.newChartCreationObj.IsTemplate=!1,this.newChartCreationObj.ShowNEqualsStatement=!0,this.newChartCreationObj.Palette="Default",this.newChartCreationObj.SiteId=this.spSiteId,this.newChartCreationObj.XAxisLabel="",this.newChartCreationObj.YAxisLabel="",this.newChartCreationObj.YAxis2Label="Default",this.newChartCreationObj.IsMonochrome=!1,this.newChartCreationObj.PointLabels=!1,this.newChartCreationObj.ShowSubTitle=!0,this.newChartCreationObj.CustomYScaleMaxValue=null,this.newChartCreationObj.IsStacked=!1,this.newChartCreationObj.CustomY2ScaleMaxValue=null,this.newChartCreationObj.LastUpdated=null,this.newChartCreationObj.PointLabelDisplay=0,this.newChartCreationObj.ComparisonChartId=null,this.newChartCreationObj.IsCumulativeLine=!1,this.newChartCreationObj.CreatedOn=new Date,this.newChartCreationObj.CreatedBy=this._ccbContextService.getSPUserDisplayName(),this.newChartCreationObj.ModifiedOn=new Date,this.newChartCreationObj.ModifiedBy=this._ccbContextService.getSPUserDisplayName(),this.newChartCreationObj.ComparisonSPListChartId=null,this.newChartCreationObj.ShowGraphRepresentsStatement=!1,this.newChartCreationObj.FolderId=this.FolderId??null}getSelectedValuesToGraph(){let e=this.graphForm.controls.MetaFieldChoices?.value??this.selectedChoices??[];return(Array.isArray(e)?e:[]).map(r=>typeof r=="string"?r:r?.value).filter(r=>r!=null&&String(r).trim()!=="").map(r=>String(r))}setDefaultSeriesCreationObject(){this.newChartSeriesCreationObj.SeriesId=this._commonService.newGuid(),this.newChartSeriesCreationObj.ChartId=this.newChartCreationObj.ChartId,this.newChartSeriesCreationObj.SeriesDisplayId=1,this.newChartSeriesCreationObj.SeriesTypeId=3,this.newChartSeriesCreationObj.AttributeDisplayId=this._commonService.newEmptyGuid(),this.newChartSeriesCreationObj.SeriesName=this.graphForm.controls.Title.value,this.newChartSeriesCreationObj.SeriesGrouping=1,this.newChartSeriesCreationObj.DisplayOnOff=!0,this.newChartSeriesCreationObj.AttributeValue=null,this.newChartSeriesCreationObj.IndicatorResourceId=this._commonService.newEmptyGuid(),this.newChartSeriesCreationObj.IndicatorName=null,this.newChartSeriesCreationObj.IndicatorSeries=null,this.newChartSeriesCreationObj.IndicatorMetric=null,this.newChartSeriesCreationObj.Gallery=1,this.newChartSeriesCreationObj.HatchStyle=0,this.newChartSeriesCreationObj.ProgramDeliveryServiceColumnName=null,this.newChartSeriesCreationObj.ProgramOutcomeColumnName=null,this.newChartSeriesCreationObj.CategoryId=null,this.newChartSeriesCreationObj.Observer=1,this.newChartSeriesCreationObj.IndicatorInitiative=null,this.newChartSeriesCreationObj.IndicatorCommunity=null,this.newChartSeriesCreationObj.IndicatorCity=null,this.newChartSeriesCreationObj.IndicatorCounty=null,this.newChartSeriesCreationObj.IndicatorState=null,this.newChartSeriesCreationObj.IndicatorStreetAddress=null,this.newChartSeriesCreationObj.IndicatorCustomLocation=null,this.newChartSeriesCreationObj.IndicatorZip=null,this.newChartSeriesCreationObj.IndicatorCensusTract=null,this.newChartSeriesCreationObj.IntervalFormId=null,this.newChartSeriesCreationObj.IntervalSiteId=this.spSiteId,this.newChartSeriesCreationObj.IndicatorCustom1=null,this.newChartSeriesCreationObj.IndicatorCustom2=null,this.newChartSeriesCreationObj.IndicatorCustom3=null,this.newChartSeriesCreationObj.IndicatorCustom4=null,this.newChartSeriesCreationObj.IndicatorCustom5=null,this.newChartSeriesCreationObj.IsCumulativeLine=null,this.newChartSeriesCreationObj.GroupAttributeDisplayId=null}createNewIndicatorGraphType(){return u(this,null,function*(){this.setDefaultChartCreationObject(),this.newChartCreationObj.YAxis2Label="Indicators",this.newChartCreationObj.ChartTypeId=1,this.setDefaultSeriesCreationObject(),this.newChartSeriesCreationObj.SeriesTypeId=1,this.newChartSeriesCreationObj.IndicatorResourceId=this.graphForm.controls.ResourceId.value,this.newChartSeriesCreationObj.IndicatorName=this.graphForm.controls.IndicatorName.value,this.newChartSeriesCreationObj.IndicatorSeries=this.graphForm.controls.Series.value,this.newChartSeriesCreationObj.IndicatorInitiative=this.graphForm.controls.Initiative.value,this.newChartSeriesCreationObj.IndicatorCommunity=this.graphForm.controls.GeographicLevel.value,this.newChartSeriesCreationObj.IndicatorCity=this.graphForm.controls.City.value,this.newChartSeriesCreationObj.IndicatorCounty=this.graphForm.controls.County.value,this.newChartSeriesCreationObj.IndicatorState=this.graphForm.controls.State.value,this.newChartSeriesCreationObj.IndicatorStreetAddress=this.graphForm.controls.StreetAddress.value,this.newChartSeriesCreationObj.IndicatorCustomLocation=this.graphForm.controls.CustomLocation.value,this.newChartSeriesCreationObj.IndicatorZip=this.graphForm.controls.Zip.value,this.newChartSeriesCreationObj.IndicatorCensusTract=this.graphForm.controls.CensusTract.value,this.newChartSeriesCreationObj.IndicatorCustom1=this.graphForm.controls.IndicatorCustom1.value,this.newChartSeriesCreationObj.IndicatorCustom2=this.graphForm.controls.IndicatorCustom2.value,this.newChartSeriesCreationObj.IndicatorCustom3=this.graphForm.controls.IndicatorCustom3.value,this.newChartSeriesCreationObj.IndicatorCustom4=this.graphForm.controls.IndicatorCustom4.value,this.newChartSeriesCreationObj.IndicatorCustom5=this.graphForm.controls.IndicatorCustom5.value,this.newChartSeriesCreationObj.SeriesDisplayId=2,yield this.postNewChart()})}createNewIndicatorSeries(){return u(this,null,function*(){this.newChartCreationObj=this.chartObj,this.setDefaultSeriesCreationObject(),this.newChartSeriesCreationObj.SeriesTypeId=1,this.newChartSeriesCreationObj.IndicatorResourceId=this.graphForm.controls.ResourceId.value,this.newChartSeriesCreationObj.IndicatorName=this.graphForm.controls.IndicatorName.value,this.newChartSeriesCreationObj.IndicatorSeries=this.graphForm.controls.Series.value,this.newChartSeriesCreationObj.IndicatorInitiative=this.graphForm.controls.Initiative.value,this.newChartSeriesCreationObj.IndicatorCommunity=this.graphForm.controls.GeographicLevel.value,this.newChartSeriesCreationObj.IndicatorCity=this.graphForm.controls.City.value,this.newChartSeriesCreationObj.IndicatorCounty=this.graphForm.controls.County.value,this.newChartSeriesCreationObj.IndicatorState=this.graphForm.controls.State.value,this.newChartSeriesCreationObj.IndicatorStreetAddress=this.graphForm.controls.StreetAddress.value,this.newChartSeriesCreationObj.IndicatorCustomLocation=this.graphForm.controls.CustomLocation.value,this.newChartSeriesCreationObj.IndicatorZip=this.graphForm.controls.Zip.value,this.newChartSeriesCreationObj.IndicatorCensusTract=this.graphForm.controls.CensusTract.value,this.newChartSeriesCreationObj.IndicatorCustom1=this.graphForm.controls.IndicatorCustom1.value,this.newChartSeriesCreationObj.IndicatorCustom2=this.graphForm.controls.IndicatorCustom2.value,this.newChartSeriesCreationObj.IndicatorCustom3=this.graphForm.controls.IndicatorCustom3.value,this.newChartSeriesCreationObj.IndicatorCustom4=this.graphForm.controls.IndicatorCustom4.value,this.newChartSeriesCreationObj.IndicatorCustom5=this.graphForm.controls.IndicatorCustom5.value,this.newChartSeriesCreationObj.SeriesDisplayId=2,this.newChartSeriesCreationObj.IntervalSiteId=this.graphForm.controls.IntervalSiteId.value.SPSiteId,yield this.postNewChartSeries()})}createNewPDGraphType(){return u(this,null,function*(){if(I(this.selectedCCBForm))this.msgs.set([{severity:"error",summary:"Must select CCB Form"}]);else{this.setDefaultChartCreationObject(),this.newChartCreationObj.YAxis2Label="Participant Description",this.newChartCreationObj.ChartTypeId=3,this.setDefaultSeriesCreationObject(),I(this.selectedSite)?this.newChartSeriesCreationObj.IntervalSiteId=this.spSiteId:this.newChartSeriesCreationObj.IntervalSiteId=this.selectedSite.SPSiteId,this.newChartSeriesCreationObj.IntervalFormId=this.selectedCCBForm.FormId,this.newChartSeriesCreationObj.SeriesTypeId=this._graphsService.getSeriesTypeIdByChartTypeId(this.newChartCreationObj.ChartTypeId,"ODSS-PARTICIPANTSDESCRIPTION"),this.newChartSeriesCreationObj.SeriesDisplayId=2;let e=this.graphForm.controls.PDSubCategory.value;this.newChartSeriesCreationObj.CategoryId=e.ProgramDeliveryOptionId,this.newChartSeriesCreationObj.ProgramDeliveryServiceColumnName=this.graphForm.controls.PDService.value,yield this.postNewChart()}})}createNewPDSeries(){return u(this,null,function*(){if(I(this.selectedCCBForm))this.msgs.set([{severity:"error",summary:"Must select CCB Form"}]);else{this.newChartCreationObj=this.chartObj,this.setDefaultSeriesCreationObject(),I(this.selectedSite)?this.newChartSeriesCreationObj.IntervalSiteId=this.spSiteId:this.newChartSeriesCreationObj.IntervalSiteId=this.selectedSite.SPSiteId,this.newChartSeriesCreationObj.IntervalFormId=this.selectedCCBForm.FormId,this.newChartSeriesCreationObj.SeriesTypeId=this._graphsService.getSeriesTypeIdByChartTypeId(this.newChartCreationObj.ChartTypeId,"ODSS-PARTICIPANTSDESCRIPTION"),this.newChartSeriesCreationObj.SeriesDisplayId=2;let e=this.graphForm.controls.PDSubCategory.value;this.newChartSeriesCreationObj.CategoryId=e.ProgramDeliveryOptionId,this.newChartSeriesCreationObj.ProgramDeliveryServiceColumnName=this.graphForm.controls.PDService.value,yield this.postNewChartSeries()}})}createNewAccomplishmentGraphType(){return u(this,null,function*(){if(!I(this.selectedCCBForm)&&!I(this.selectedCCBField)){if
1(this.setDefaultChartCreationObject(),this.newChartCreationObj.YAxis2Label="Accomplishments",this.newChartCreationObj.ChartTypeId=4,this.setDefaultSeriesCreationObject(),this.selectedCCBField.AttributeTypeId!=this._commonService.newEmptyGuid().toString()&&(this.selectedCCBField.AttributeTypeId==="00000000-0000-0000-00AA-110000000019"||this.selectedCCBField.AttributeTypeId==="00000000-0000-0000-00AA-11000000001D")&&(this.newChartSeriesCreationObj.SeriesDisplayId=2),I(this.selectedSite)?this.newChartSeriesCreationObj.IntervalSiteId=this.spSiteId:this.newChartSeriesCreationObj.IntervalSiteId=this.selectedSite.SPSiteId,this.newChartSeriesCreationObj.IntervalFormId=this.selectedCCBForm.FormId,this.newChartSeriesCreationObj.AttributeDisplayId=this.selectedCCBField.DisplayId,this.graphSpecificValues){let e=this.getSelectedValuesToGraph();e.length>0?(this.newChartSeriesCreationObj.SeriesGrouping=2,this.newChartSeriesCreationObj.AttributeValue=this._commonService.convertArrayToPiped(e)):(this.newChartSeriesCreationObj.SeriesGrouping=1,this.newChartSeriesCreationObj.AttributeValue=null)}this.newChartSeriesCreationObj.SeriesTypeId=this._graphsService.getSeriesTypeIdByChartTypeId(this.newChartCreationObj.ChartTypeId,"ODSS-ACCOMPLISHMENTS"),yield this.postNewChart()}else this.msgs.set([{severity:"error",summary:"Must select CCB Form and Field"}])})}createNewAccomplishmentSeries(){return u(this,null,function*(){if(!I(this.selectedCCBForm)&&!I(this.selectedCCBField)){if(this.newChartCreationObj=this.chartObj,this.setDefaultSeriesCreationObject(),this.selectedCCBField.AttributeTypeId!=this._commonService.newEmptyGuid().toString()&&(this.selectedCCBField.AttributeTypeId==="00000000-0000-0000-00AA-110000000019"||this.selectedCCBField.AttributeTypeId==="00000000-0000-0000-00AA-11000000001D")&&(this.newChartSeriesCreationObj.SeriesDisplayId=2),I(this.selectedSite)?this.newChartSeriesCreationObj.IntervalSiteId=this.spSiteId:this.newChartSeriesCreationObj.IntervalSiteId=this.selectedSite.SPSiteId,this.newChartSeriesCreationObj.IntervalFormId=this.selectedCCBForm.FormId,this.newChartSeriesCreationObj.AttributeDisplayId=this.selectedCCBField.DisplayId,this.graphSpecificValues){let e=this.getSelectedValuesToGraph();e.length>0?(this.newChartSeriesCreationObj.SeriesGrouping=2,this.newChartSeriesCreationObj.AttributeValue=this._commonService.convertArrayToPiped(e)):(this.newChartSeriesCreationObj.SeriesGrouping=1,this.newChartSeriesCreationObj.AttributeValue=null)}this.newChartSeriesCreationObj.SeriesTypeId=this._graphsService.getSeriesTypeIdByChartTypeId(this.newChartCreationObj.ChartTypeId,"ODSS-ACCOMPLISHMENTS"),yield this.postNewChartSeries()}else this.msgs.set([{severity:"error",summary:"Must select CCB Form and Field"}])})}createNewKeyEventSeries(){return u(this,null,function*(){this.newChartCreationObj=this.chartObj,this.setDefaultSeriesCreationObject(),this.newChartSeriesCreationObj.SeriesTypeId=2;let e=this.graphForm.controls.KeyEvents.value;this.chartSeriesKeyEvents=[],e.forEach(t=>{let r={SeriesId:this.newChartSeriesCreationObj.SeriesId,KeyEventId:t.KeyEventId};this.chartSeriesKeyEvents.push(r)}),yield this.postNewChartSeries()})}createNewGraphFromTemplate(){return u(this,null,function*(){this.newChartId=this._commonService.newGuid();let e=this.graphForm.controls.Title.value;if(e!="")try{let t=yield N.postCreateChartFromTemplate(this.selectedTemplateId,this.newChartId,e,this.FolderId??null);if(!I(t)){let r=yield E.getChartSeriesByChartId(this.selectedTemplateId);if(r){this.chartSeriesDatas=r,this.chartSeriesDatas.forEach(g=>{g.SeriesId=this._commonService.newGuid(),g.ChartId=this.newChartId});let l=yield E.postMultipleODSChartSeries(this.chartSeriesDatas);I(l)||(this.msgs.set([{severity:"success",summary:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblMsgCreationComplete","~Record Creation Complete~"),detail:""}]),this.onSave.emit(this.newChartId))}}}catch(t){this.msgs.set([{severity:"error",summary:t}])}})}saveGraph(){return u(this,null,function*(){let e=this.graphForm.controls.Title.value;if(this.isDuplicateGraphTitle=!1,e!=""){this.loading=!0;let t=!0;switch(this.selectedDataTypeToGraph){case"ODSS-INDICATORS":break;case"ODSS-PARTICIPANTSDESCRIPTION":(I(this.selectedCCBForm)||I(this.graphForm.controls.PDTypeName)||I(this.graphForm.controls.PDSubCategory)||I(this.graphForm.controls.PDService))&&(t=!1),(this.selectedCCBForm.FormId==""||this.graphForm.controls.PDTypeName.value==""||this.graphForm.controls.PDSubCategory.value==""||this.graphForm.controls.PDService.value=="")&&(t=!1);break;case"ODSS-ACCOMPLISHMENTS":this.isNewGraph?((I(this.selectedCCBForm)||I(this.selectedCCBField))&&(t=!1),(this.selectedCCBForm.FormId==""||this.selectedCCBField.DisplayId=="")&&(t=!1)):((I(this.selectedSite)||I(this.selectedCCBForm)||I(this.selectedCCBField))&&(t=!1),(this.selectedSite.SPSiteId==""||this.selectedCCBForm.FormId==""||this.selectedCCBField.DisplayId=="")&&(t=!1));break;case"ODSS-KEYEVENTS":(I(this.graphForm.controls.KeyEvents)||this.graphForm.controls.KeyEvents.value=="")&&(t=!1);break;case"ODSS-TEMPLATE":(I(this.graphForm.controls.TemplateID)||this.graphForm.controls.TemplateID.value=="")&&(t=!1);break}if(t)try{let r=yield N.checkIfGraphTitleIsDuplicate(this.spSiteId,this._commonService.newGuid(),e);r&&r.length>0?this.isDuplicateGraphTitle=!0:this.selectedDataTypeToGraph==="ODSS-TEMPLATE"?yield this.createNewGraphFromTemplate():yield this.createNewGraphFromDataType()}catch(r){this.msgs.set([{severity:"error",summary:r}])}finally{this.loading=!1}else this.loading=!1,this.msgs.set([{severity:"error",summary:"Missing Required Fields"}])}})}showHelp(){this.displayDialog=!0}static \u0275fac=function(t){return new(t||i)(L(Dt),L(Q),L(A),L(ot),L(q))};static \u0275cmp=Y({type:i,selectors:[["graphnewseries"]],inputs:{ChartId:"ChartId",FolderId:"FolderId"},outputs:{onSave:"onSave"},features:[U([z])],decls:29,vars:5,consts:[[3,"messages"],["novalidate","","class","form-horizontal",3,"formGroup","ngSubmit",4,"ngIf"],["id","dialogid1","header","Graph Creation Help","showEffect","fade","maximizable","true",3,"visibleChange","visible","modal","baseZIndex"],["novalidate","",1,"form-horizontal",3,"ngSubmit","formGroup"],[1,"p-grid","p-fluid","form-group"],[1,"p-md-12"],[1,"p-col-12","p-md-4"],["id","lblTitle",4,"ngIf"],[2,"color","#7A4FA0"],[1,"p-col-12","p-md-8"],["ariaLabelledBy","lblTitle","type","text","pInputText","","formControlName","Title",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","90%"],[4,"ngIf"],["id","GraphsDataTypelabel"],["ariaLabelledBy","GraphsDataTypelabel","formControlName","GraphsDataType",3,"onChange","placeholder","options"],["class","p-md-12",4,"ngIf"],[1,"p-col-12","submit-button-container"],["pButton","","type","submit",3,"disabled","label",4,"ngIf"],["pButton","","type","button","severity","secondary",3,"click","label"],["id","lblTitle"],["id","TemplateIDlabel"],["ariaLabelledBy","TemplateIDlabel","formControlName","TemplateID",3,"onChange","placeholder","options"],["id","IntervalSiteIdlabel"],["ariaLabelledBy","IntervalSiteIdlabel","optionLabel","SPSiteTitle","formControlName","IntervalSiteId",3,"onChange","placeholder","options"],["id","IntervalFormIdlabel"],["ariaLabelledBy","IntervalFormIdlabel","optionLabel","FormName","formControlName","IntervalFormId",3,"onChange","placeholder","options"],["id","MetaFieldIdlabel"],["ariaLabelledBy","MetaFieldIdlabel","optionLabel","DisplayName","formControlName","MetaFieldId",3,"onChange","placeholder","options"],["id","MetaFieldChoiceslabel"],["accessableMultiselect","","id","MetaFieldChoiceslabelid","ariaLabelledBy","MetaFieldChoiceslabel","formControlName","MetaFieldChoices",3,"ngModelChange","options","ngModel","panelStyle"],["id","PDTypeNamelabel"],["ariaLabelledBy","PDTypeNamelabel","optionLabel","DeliveryTypeName","formControlName","PDTypeName",3,"ngModelChange","onChange","options","ngModel"],["id","PDSubCategorylabel"],["ariaLabelledBy","PDSubCategorylabel","optionLabel","ProgramDeliveryOptionName","formControlName","PDSubCategory",3,"ngModelChange","options","ngModel"],["id","PDServicelabel"],["ariaLabelledBy","PDServicelabel","formControlName","PDService",3,"options"],["id","Categorylabel"],["ariaLabelledBy","Categorylabel","formControlName","Category",3,"onChange","options"],["id","ResourceIdlabel"],["ariaLabelledBy","ResourceIdlabel","formControlName","ResourceId",3,"onChange","options"],["id","Serieslabel"],["ariaLabelledBy","Serieslabel","formControlName","Series",3,"options"],["id","Initiativelabel"],["ariaLabelledBy","Initiativelabel","formControlName","Initiative",3,"options"],["id","GeographicLevellabel"],["ariaLabelledBy","GeographicLevellabel","formControlName","GeographicLevel",3,"onChange","options"],["id","CensusTractlabel"],["ariaLabelledBy","CensusTractlabel","formControlName","CensusTract",3,"placeholder","options"],["id","CustomLocationlabel"],["ariaLabelledBy","CustomLocationlabel","formControlName","CustomLocation",3,"placeholder","options"],["id","StreetAddresslabel"],["ariaLabelledBy","StreetAddresslabel","type","text","pInputText","","formControlName","StreetAddress",1,"p-inputtext","p-corner-all","p-state-default","p-component"],["id","Citylabel"],["ariaLabelledBy","Citylabel","formControlName","City",3,"placeholder","options"],["id","Ziplabel"],["ariaLabelledBy","Ziplabel","type","text","pInputText","","formControlName","Zip",1,"p-inputtext","p-corner-all","p-state-default","p-component"],["id","Statelabel"],["ariaLabelledBy","Statelabel","formControlName","State",3,"placeholder","options"],["id","Countylabel"],["ariaLabelledBy","Countylabel","formControlName","County",3,"placeholder","options"],["id","IndicatorNamelabel"],["ariaLabelledBy","IndicatorNamelabel","formControlName","IndicatorName",3,"options"],["id","Custom1Label"],["ariaLabelledBy","Custom1Label","formControlName","IndicatorCustom1",3,"placeholder","options"],["id","Custom2Label"],["ariaLabelledBy","Custom2Label","formControlName","IndicatorCustom2",3,"placeholder","options"],["id","Custom3Label"],["ariaLabelledBy","Custom3Label","formControlName","IndicatorCustom3",3,"placeholder","options"],["id","Custom4Label"],["ariaLabelledBy","Custom4Label","formControlName","IndicatorCustom4",3,"placeholder","options"],["id","Custom5Label"],["ariaLabelledBy","Custom5Label","formControlName","IndicatorCustom5",3,"placeholder","options"],["id","lblKeyEventsLabel"],["accessableMultiselect","","id","lblKeyEventsLabelid","ariaLabelledBy","lblKeyEventsLabel","optionLabel","ExtendedLabel","formControlName","KeyEvents",3,"ngModelChange","placeholder","options","ngModel","panelStyle"],["pButton","","type","submit",3,"disabled","label"]],template:function(t,r){t&1&&(b(0,"app-messages",0),w(1,mi,57,48,"form",1),n(2,"p-dialog",2),M("visibleChange",function(g){return P(r.displayDialog,g)||(r.displayDialog=g),g}),n(3,"p")(4,"span"),c(5,"When creating a graph, you may create a new (unique) graph by selecting "),n(6,"strong"),c(7,"Create a new graph"),s(),c(8,". You can also use a pre-existing template to help expedite your graph creation process. If you would like to create a new template, you may do so by creating a new graph and then selecting "),n(9,"strong"),c(10,"Save as template"),s(),c(11,". In the future, that new template will show as an option from the drop-down menu. "),b(12,"br")(13,"br"),n(14,"strong"),c(15,"More about Graphs, Reflection Questions, and Supports for Improvement"),s(),c(16,": "),b(17,"br")(18,"br"),c(19," Using online graphs, community and research partners can visually display and reflect on what is happening. By clicking on "),n(20,"strong"),c(21,"Reflection Questions"),s(),c(22,", those reviewing graphs can systematically reflect on what we are seeing, what it means, and implications for adju
1stment. By clicking on "),n(23,"strong"),c(24,"Supports for Improvement"),s(),c(25,", the system offers further questions and guidance for addressing community challenges (e.g., not enough participation, not enough improvement). "),b(26,"br")(27,"br"),c(28," Data featured in the graph may come from one of the Community Check Box tools (e.g., Accomplishments, Participants\u2019 Description, Community-level indicators) or from a custom list created to capture specific data relevant to your project. "),s()()()),t&2&&(o("messages",r.msgs()),a(),o("ngIf",r.graphForm),a(),j("visible",r.displayDialog),o("modal",!0)("baseZIndex",1e4))},dependencies:[se,me,dt,re,ee,H,X,Z,ne,Oe,W,ae,ie,te,ue,J],encapsulation:2})}return i})();var Be=()=>({"min-width":"90%"}),Pe=i=>({"border-style":i});function ui(i,m){i&1&&(n(0,"div")(1,"strong",21),c(2),h(3,"translate"),s()()),i&2&&(a(2),be("",d(3,1,"lblDuplicateGraphTitleExists")," "))}function Si(i,m){i&1&&(n(0,"div")(1,"strong",21),c(2),h(3,"translate"),s()()),i&2&&(a(2),be(" ",d(3,1,"lblGraphMaxLength")))}function Ci(i,m){i&1&&(n(0,"div",4)(1,"div",5)(2,"strong",22),c(3),h(4,"translate"),s()(),n(5,"div",7),b(6,"input",23),s()()),i&2&&(a(3),v(d(4,1,"lblXAxisLabel")))}function bi(i,m){i&1&&(n(0,"div",4)(1,"div",5)(2,"strong",24),c(3),h(4,"translate"),s()(),n(5,"div",7),b(6,"input",25),s()()),i&2&&(a(3),v(d(4,1,"lblYAxisLabel")))}function gi(i,m){if(i&1){let e=F();n(0,"div",4)(1,"div",5)(2,"strong",26),c(3),h(4,"translate"),s()(),n(5,"div",7)(6,"p-selectButton",27),M("ngModelChange",function(r){_(e);let l=p(2);return P(l.selectedCustomYScaleMaxField,r)||(l.selectedCustomYScaleMaxField=r),D(r)}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,5,"lblYAxisScaleMax")),a(3),y(f(7,Be)),o("options",e.CustomY2ScaleMaxValueOptions),j("ngModel",e.selectedCustomYScaleMaxField)}}function vi(i,m){i&1&&(n(0,"div",4)(1,"div",5)(2,"strong",28),c(3,"Y Axis Max"),s()(),n(4,"div",7),b(5,"input",29),s()())}function Ii(i,m){i&1&&(n(0,"div",4)(1,"div",5)(2,"strong",30),c(3),h(4,"translate"),s()(),n(5,"div",7),b(6,"input",31),s()()),i&2&&(a(3),v(d(4,1,"lblYAxis2Label")))}function fi(i,m){i&1&&b(0,"input",35)}function yi(i,m){if(i&1){let e=F();n(0,"div",4)(1,"div",5)(2,"strong",32),c(3),h(4,"translate"),s()(),n(5,"div",7)(6,"p-selectButton",33),M("ngModelChange",function(r){_(e);let l=p(2);return P(l.selectedCustomY2ScaleMaxField,r)||(l.selectedCustomY2ScaleMaxField=r),D(r)}),s(),w(7,fi,1,0,"input",34),s()()}if(i&2){let e=p(2);a(3),v(d(4,6,"lblYAxis2ScaleMax")),a(3),y(f(8,Be)),o("options",e.CustomY2ScaleMaxValueOptions),j("ngModel",e.selectedCustomY2ScaleMaxField),a(),o("ngIf",e.selectedCustomY2ScaleMaxField=="Customize")}}function _i(i,m){if(i&1&&(n(0,"div",4)(1,"div",5)(2,"strong",36),c(3),h(4,"translate"),h(5,"translate"),s()(),n(6,"div",7),b(7,"p-selectButton",37),s()()),i&2){let e=p(2);a(3),B("",d(4,5,"lblLabels"),"\xA0",d(5,7,"lblDisplay")),a(4),y(f(9,Be)),o("options",e.PointLabelDisplayOptions)}}function Di(i,m){if(i&1&&(n(0,"div",4)(1,"div",5)(2,"strong",38),c(3),h(4,"translate"),s()(),n(5,"div",7),b(6,"p-selectButton",39),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblSeriesDisplay")),a(3),y(f(6,Be)),o("options",e.IsStackedOptions)}}function xi(i,m){if(i&1){let e=F();n(0,"a",42),x("click",function(){_(e);let r=p(3);return D(r.lineChartOnClick())}),b(1,"img",43),s()}if(i&2){let e=p(3);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Line-chart64.png"),pe)("ngStyle",de(3,Pe,e.getBorderStyleForGraphType("line")))}}function wi(i,m){if(i&1){let e=F();n(0,"a",42),x("click",function(){_(e);let r=p(3);return D(r.cumulativeLineChartOnClick())}),b(1,"img",44),s()}if(i&2){let e=p(3);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Cumulative-Line-chart64.png"),pe)("ngStyle",de(3,Pe,e.getBorderStyleForGraphType("cumulativeline")))}}function Ti(i,m){if(i&1){let e=F();n(0,"a",42),x("click",function(){_(e);let r=p(3);return D(r.columnChartOnClick())}),b(1,"img",45),s()}if(i&2){let e=p(3);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Column-chart64.png"),pe)("ngStyle",de(3,Pe,e.getBorderStyleForGraphType("column")))}}function Fi(i,m){if(i&1){let e=F();n(0,"a",42),x("click",function(){_(e);let r=p(3);return D(r.barChartOnClick())}),b(1,"img",46),s()}if(i&2){let e=p(3);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Bar-chart64.png"),pe)("ngStyle",de(3,Pe,e.getBorderStyleForGraphType("bar")))}}function Oi(i,m){if(i&1){let e=F();n(0,"a",42),x("click",function(){_(e);let r=p(3);return D(r.pieChartOnClick())}),b(1,"img",47),s()}if(i&2){let e=p(3);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Pie-chart64.png"),pe)("ngStyle",de(3,Pe,e.getBorderStyleForGraphType("pie")))}}function Li(i,m){if(i&1&&(n(0,"div",4)(1,"div",5)(2,"strong",40),c(3),h(4,"translate"),s()(),n(5,"div",7),w(6,xi,2,5,"a",41)(7,wi,2,5,"a",41)(8,Ti,2,5,"a",41)(9,Fi,2,5,"a",41)(10,Oi,2,5,"a",41),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblGraphType")),a(3),o("ngIf",e.showIconLineChart),a(),o("ngIf",e.showIconCumulativeLineChart),a(),o("ngIf",e.showIconColumnChart),a(),o("ngIf",e.showIconBarChart),a(),o("ngIf",e.showIconPieChart)}}function Ei(i,m){if(i&1){let e=F();n(0,"form",2),x("ngSubmit",function(){_(e);let r=p();return D(r.saveGraph(r.graphForm))}),n(1,"div",3)(2,"div",4)(3,"div",5)(4,"strong",6),c(5),h(6,"translate"),h(7,"translate"),s()(),n(8,"div",7),b(9,"input",8)(10,"br"),w(11,ui,4,3,"div",9)(12,Si,4,3,"div",9),s()(),n(13,"div",4)(14,"div",5)(15,"strong",10),c(16),h(17,"translate"),s()(),n(18,"div",7),b(19,"p-selectButton",11),s()(),n(20,"div",4)(21,"div",5)(22,"strong",12),c(23),h(24,"translate"),s()(),n(25,"div",7),b(26,"p-datepicker",13),n(27,"strong",14),
1c(28," - "),s(),b(29,"p-datepicker",15),s()(),n(30,"div",4)(31,"div",5)(32,"strong",16),c(33),h(34,"translate"),h(35,"translate"),s()(),n(36,"div",7)(37,"p-selectButton",17),x("onChange",function(r){_(e);let l=p();return D(l.displayScaleOnChange(r))}),s()()(),w(38,Ci,7,3,"div",18)(39,bi,7,3,"div",18)(40,gi,7,8,"div",18)(41,vi,6,0,"div",18),n(42,"div",4)(43,"div",5)(44,"strong",19),c(45,"X Axis Max"),s()(),n(46,"div",7),b(47,"input",20),s()(),w(48,Ii,7,3,"div",18)(49,yi,8,9,"div",18)(50,_i,8,10,"div",18)(51,Di,7,7,"div",18)(52,Li,11,8,"div",18),s()()}if(i&2){let e,t=p();o("formGroup",t.graphForm),a(5),B(" ",d(6,26,"lblGraph"),"\xA0 ",d(7,28,"lblTitle")),a(6),o("ngIf",t.isDuplicateGraphTitle),a(),o("ngIf",t.graphForm.invalid&&(t.graphForm.dirty||t.graphForm.touched)&&((e=t.graphForm.get("Title").errors)==null?null:e.maxlength)),a(4),be(" ",d(17,30,"lblThisGraphRepresents")),a(3),y(f(38,Be)),o("options",t.YesNoOptions),a(4),v(d(24,32,"lblDateRange")),a(3),o("showIcon",!0),a(3),o("showIcon",!0),a(4),B("",d(34,34,"lblDate"),"\xA0",d(35,36,"lblDisplay")),a(4),y(f(39,Be)),o("options",t.dateDisplayScaleColl),a(),o("ngIf",t.showPanelAxisLabelsDisplay),a(),o("ngIf",t.showPanelAxisLabelsDisplay),a(),o("ngIf",t.showPanelAxisLabelsDisplay),a(),o("ngIf",t.selectedCustomYScaleMaxField=="Customize"),a(7),o("ngIf",t.showPanelYAxis2),a(),o("ngIf",t.showPanelYAxis2),a(),o("ngIf",!t.isComparisionChart),a(),o("ngIf",!t.isComparisionChart&&t.IsStackedOptions),a(),o("ngIf",!t.isComparisionChart)}}var Tt=(()=>{class i{_ccbContextService;_commonService;_translate;ChartId;onSave=new ce;newChartId;newChartCreationObj={};chartSeriesDatas=[];chartObj;graphIconBaseUrl=Ye.ImagesPath;spSiteId;spSiteUrl;graphForm;group={};translatedKeyValues;menuitems;msgs=R([]);isNewGraph;loading=!0;selecteDisplayScale=1;selectedCustomYScaleMaxField="Default";selectedCustomY2ScaleMaxField="Default";selectedCustomYScaleMaxValue=null;selectedCustomY2ScaleMaxValue=null;selectedPointLabelDisplay;selectedComparisonChartId;selectedDataTypeToGraph="";IsStacked="";showIsStacked=!1;showIconLineChart=!0;showIconCumulativeLineChart=!0;showIconColumnChart=!0;showIconBarChart=!0;showIconPieChart=!0;showSeriesDisplay=!1;showPanelAxisLabelsDisplay=!1;showPanelStacked=!1;showPanelYAxis2=!1;graphSpecificValues=!1;selectedGraphType="";isDuplicateGraphTitle=!1;isComparisionChart=!1;YesNoOptions;dateDisplayScaleColl;PointLabelDisplayOptions;IsStackedOptions;CustomY2ScaleMaxValueOptions;constructor(e,t,r){this._ccbContextService=e,this._commonService=t,this._translate=r}ngOnInit(){this.init()}init=()=>u(this,null,function*(){yield this.getRequiredTranslations()});getRequiredTranslations(){return u(this,null,function*(){let e=yield K(this._translate.get(["lblSelect","lblMsgUpdateComplete","lblGraphMaxLength"]));this.translatedKeyValues=e,this.spSiteId=this._ccbContextService.getSPSiteId(),this.spSiteUrl=this._ccbContextService.getSPSiteUrl(),this.ChartId&&(this.isNewGraph=!1,yield this.getChartData())})}getChartData(){return u(this,null,function*(){try{let e=yield N.getChartsByChartId(this.ChartId);e&&(this.chartObj=e,this.loadChoices(),this.buildFormGroup(),this.loadChartData(),yield this.getChartSeries())}catch(e){this.showError(e)}})}getChartSeries(){return u(this,null,function*(){if(this.ChartId)try{let e=yield E.getChartSeriesByChartId(this.ChartId);e&&(this.chartSeriesDatas=e,this.chartSeriesDatas.forEach(t=>{t.SeriesTypeId===1&&(this.showIconColumnChart=!1,this.showIconBarChart=!1,this.showIconPieChart=!1,this.showPanelYAxis2=!0)}))}catch(e){this.showError(e)}})}loadChoices(){this.YesNoOptions=[{label:"Yes",value:!0},{label:"No",value:!1}],this.dateDisplayScaleColl=[{label:"Day",value:4},{label:"Week",value:5},{label:"Month",value:1},{label:"Quarter",value:2},{label:"Year",value:3}],this.PointLabelDisplayOptions=[{label:"Hide",value:0},{label:"Show #",value:1},{label:"Show %",value:2}],this.IsStackedOptions=[{label:"Clustered",value:!1},{label:"Stacked",value:!0}],this.CustomY2ScaleMaxValueOptions=[{label:"Default",value:"Default"},{label:"Customize",value:"Customize"}]}buildFormGroup(){this.group.Title=new C("",[we.required,we.maxLength(75)]),this.group.StartDate=new C("",[]),this.group.StopDate=new C("",[]),this.group.DisplayScale=new C("",[]),this.group.XAxisLabel=new C("Time",[]),this.group.YAxisLabel=new C("Count",[]),this.group.YAxis2Label=new C("Indicators",[]),this.group.PointLabelDisplay=new C(0,[]),this.group.IsStacked=new C("",[]),this.group.ShowGraphRepresentsStatement=new C(!1,[]),this.group.CustomYScaleMaxField=new C("Customize",[]),this.group.CustomY2ScaleMaxField=new C("Default",[]),this.group.CustomYScaleMaxValue=new C(null,[]),this.group.CustomXScaleMaxValue=new C(null,[]),this.group.CustomY2ScaleMaxValue=new C(null,[]),this.graphForm=new $(this.group)}
1loadChartData(){this.chartObj&&(this.graphForm.controls.Title.setValue(this.chartObj.Title),this.graphForm.controls.ShowGraphRepresentsStatement.setValue(this.chartObj.ShowGraphRepresentsStatement),this.graphForm.controls.StartDate.setValue(new Date(this.chartObj.StartDate)),this.graphForm.controls.StopDate.setValue(new Date(this.chartObj.StopDate)),this.chartObj.DisplayScale&&this.chartObj.DisplayScale>=0&&this.chartObj.DisplayScale<=5&&this.graphForm.controls.DisplayScale.setValue(this.chartObj.DisplayScale),this.setXAxisLabel(),this.setYAxisLabel(),this.setCustomYScaleMaxValue(),this.setYAxis2Label(),this.setCustomY2ScaleMaxValue(),this.setPointLabelDisplay(),this.setIsStacked(),this.adjustColumnDisplayForCurrentChart())}setXAxisLabel(){I(this.chartObj.XAxisLabel)?this.graphForm.controls.XAxisLabel.setValue("Time"):this.graphForm.controls.XAxisLabel.setValue(this.chartObj.XAxisLabel)}setYAxisLabel(){I(this.chartObj.YAxisLabel)?this.graphForm.controls.YAxisLabel.setValue("Count"):this.graphForm.controls.YAxisLabel.setValue(this.chartObj.YAxisLabel)}setYAxis2Label(){I(this.chartObj.YAxis2Label)?this.graphForm.controls.YAxis2Label.setValue("Indicators"):this.graphForm.controls.YAxis2Label.setValue(this.chartObj.YAxis2Label)}setCustomY2ScaleMaxValue(){I(this.chartObj.CustomY2ScaleMaxValue)?this.selectedCustomY2ScaleMaxField="Default":this.selectedCustomY2ScaleMaxField="Customize",this.graphForm.controls.CustomY2ScaleMaxValue.setValue(this.chartObj.CustomY2ScaleMaxValue)}setCustomYScaleMaxValue(){I(this.chartObj.CustomYScaleMaxValue)?this.selectedCustomYScaleMaxField="Default":this.selectedCustomYScaleMaxField="Customize",this.graphForm.controls.CustomYScaleMaxValue.setValue(this.chartObj.CustomYScaleMaxValue)}setCustomXScaleMaxValue(){I(this.chartObj.CustomXScaleMaxValue)||this.graphForm.controls.CustomYScaleMaxValue.setValue(this.chartObj.CustomXScaleMaxValue)}setPointLabelDisplay(){(this.chartObj.ChartTypeId==1||this.chartObj.ChartTypeId==3||this.chartObj.ChartTypeId==4)&&this.PointLabelDisplayOptions.length==3&&this.PointLabelDisplayOptions.splice(2,1),this.chartObj.ChartTypeId!==null&&this.graphForm.controls.PointLabelDisplay.setValue(this.chartObj.PointLabelDisplay)}setIsStacked(){this.showIsStacked=!1,(this.chartObj.ChartTypeId==1||this.chartObj.ChartTypeId==3||this.chartObj.ChartTypeId==4)&&(this.showIsStacked=!0,this.graphForm.controls.IsStacked.setValue(this.chartObj.IsStacked))}adjustColumnDisplayForCurrentChart(){this.chartObj.ChartTypeId==1?(this.showSeriesDisplay=!0,this.showPanelAxisLabelsDisplay=!0):this.chartObj.ChartTypeId==3||this.chartObj.ChartTypeId==4?(this.showPanelAxisLabelsDisplay=!0,this.showPanelStacked=!0):this.chartObj.ChartTypeId==2}getBorderStyleForGraphType(e){return e===this.selectedGraphType?"solid":""}pointLabelDisplayOnChange(e){this.selectedPointLabelDisplay=e.value}displayScaleOnChange(e){this.selecteDisplayScale=e.value}lineChartOnClick(){this.selectedGraphType="line"}cumulativeLineChartOnClick(){this.selectedGraphType="cumulativeline"}columnChartOnClick(){this.selectedGraphType="column"}barChartOnClick(){this.selectedGraphType="bar"}pieChartOnClick(){this.selectedGraphType="pie"}saveGraph(){return u(this,null,function*(){this.isDuplicateGraphTitle=!1,yield this.checkIfDuplicateGraphTitleExistsEdit("ApplyGraphChanges")})}checkIfDuplicateGraphTitleExistsEdit(e){return u(this,null,function*(){this.chartObj.Title=this.graphForm.controls.Title.value,this.loading=!0;try{let t=yield N.checkIfGraphTitleIsDuplicate(this.spSiteId,this.chartObj.ChartId,this.chartObj.Title);t&&t.length>0&&(this.isDuplicateGraphTitle=!0),e=="ApplyGraphChanges"&&(yield this.applyGraphChanges())}catch(t){this.showError(t)}finally{this.loading=!1}})}applyGraphChanges(){return u(this,null,function*(){let e=new Date(this.graphForm.controls.StartDate.value),t=new Date(this.graphForm.controls.StopDate.value);this.chartObj.StartDate=e,this.chartObj.StopDate=t,this.chartObj.DisplayScale=this.graphForm.controls.DisplayScale.value,this.chartObj.XAxisLabel=this.graphForm.controls.XAxisLabel.value,this.chartObj.YAxisLabel=this.graphForm.controls.YAxisLabel.value,this.chartObj.YAxis2Label=this.graphForm.controls.YAxis2Label.value,this.graphForm.controls.PointLabelDisplay.value!=null&&(this.chartObj.PointLabelDisplay=this.graphForm.controls.PointLabelDisplay.value);let r=this.graphForm.controls.IsStacked.value;this.chartObj.IsStacked=r===!0||r===1||r==="1",this.chartObj.ShowNEqualsStatement=!0,this.chartObj.ShowGraphRepresentsStatement=this.graphForm.controls.ShowGraphRepresentsStatement.value,this.selectedCustomYScaleMaxField=="Default"?this.chartObj.CustomYScaleMaxValue=null:this.chartObj.CustomYScaleMaxValue=this.graphForm.controls.CustomYScaleMaxValue.value,this.selectedCustomY2ScaleMaxField=="Default"?this.chartObj.CustomY2ScaleMaxValue=null:this.chartObj.CustomY2ScaleMaxValue=this.graphForm.controls.CustomY2ScaleMaxValue.value,this.graphForm.controls.CustomXScaleMaxValue.value!=null&&(this.chartObj.CustomXScaleMaxValue=this.graphForm.controls.CustomXScaleMaxValue.value),this.chartObj.ModifiedOn=new Date,this.chartObj.ModifiedBy=this._ccbContextService.getSPUserDisplayName();let l=this.chartObj.ChartTypeId,g=0;if(this.chartObj.ChartId!=this._commonService.newEmptyGuid()){switch(this.selectedGraphType){case"line":this.chartObj.ShowNEqualsStatement=!0,l=1;for(let T of this.chartSeriesDatas)g=this._commonService.getChartSeriesTypeIdFromSeriesTypeIdLine(T.SeriesTypeId),g>0&&(T.SeriesTypeId=g),T.IsCumulativeLine=!1,this.chartObj.IsCumulativeLine=!1,this.chartObj.DisplayScale=this.selecteDisplayScale,yield this.updateExistingGraphSeriesObject(T);break;case"cumulativeline":this.chartObj.ShowNEqualsStatement=!0,l=1;for(let T of this.chartSeriesDatas)g=this._commonService.getChartSeriesTypeIdFromSeriesTypeIdLine(T.SeriesTypeId),g>0&&(T.SeriesTypeId=g),T.IsCumulativeLine=!0,this.chartObj.IsCumulativeLine=!0,this.chartObj.DisplayScale=this.selecteDisplayScale,yield this.updateExistingGraphSeriesObject(T);break;case"column":this.chartObj.ShowNEqualsStatement=!1,l=3;for(let T of this.chartSeriesDatas)g=this._commonService.getChartSeriesTypeIdFromSeriesTypeIdColumnBar(T.SeriesTypeId),g>0&&(T.SeriesTypeId=g,yield this.updateExistingGraphSeriesObject(T));break;case"bar":this.chartObj.ShowNEqualsStatement=!1,l=4;for(let T of this.chartSeriesDatas)g=this._commonService.getChartSeriesTypeIdFromSeriesTypeIdColumnBar(T.SeriesTypeId),g>0&&(T.SeriesTypeId=g,yield this.updateExistingGraphSeriesObject(T));break;case"pie":this.chartObj.ShowNEqualsStatement=!0,l=2;for(let T of this.chartSeriesDatas)g=this._commonService.getChartSeriesTypeIdFromSeriesTypeIdPie(T.SeriesTypeId),g>0&&(T.SeriesTypeId=g,yield this.updateExistingGraphSeriesObject(T));break}this.chartObj.ChartTypeId=l,yield this.updateExistingGraphObject()}})}updateExistingGraphObject(){return u(this,null,function*(){this.loading=!0;try{let e=this.chartObj;e.ComparisonChartId=e.ComparisonChartId||null,e.ComparisonSPListChartId=e.ComparisonSPListChartId||null,e.FolderId=e.FolderId||null,e.SiteId=e.SiteId||null,yield N.putODSChart(e.ChartId,e)}catch(e){this.showError(e)}finally{this.loading=!1}})}updateExistingGraphSeriesObject(e){return u(this,null,function*(){this.loading=!0;try{yield E.putODSChartSeries(e.SeriesId,e)}catch(t){this.showError(t)}finally{this.loading=!1}})}showError(e){this.msgs.set([{severity:"error",summary:e.message}])}static \u0275fac=function(t){return new(t||i)(L(Q),L(A),L(q))};static \u0275cmp=Y({type:i,selectors:[["grapheditinfo"]],inputs:{ChartId:"ChartId"},outputs:{onSave:"onSave"},features:[U([z,it])],decls:2,vars:2,consts:[[3,"messages"],["novalidate","","class","form-horizontal",3,"formGroup","ngSubmit",4,"ngIf"],["novalidate","",1,"form-horizontal",3,"ngSubmit","formGroup"],[1,"p-grid","p-fluid","form-group"],[1,"p-md-12"],[1,"p-col-12","p-md-4"],["id","lblGraphLabel"],[1,"p-col-12","p-md-8"],["ariaLabelledBy","lblGraphLabel","type","text","pInputText","","formControlName","Title",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","90%"],[4,"ngIf"],["id","lblThisGraphRepresentsLabel"],["id","lblThisGraphRepresentsLabelctl","ariaLabelledBy","lblThisGraphRepresentsLabel","formControlName","ShowGraphRepresentsStatement",3,"options"],["id","lblDateRangeLabel"],["id","StartDateLabelId","ariaLabelledBy","lblDateRangeLabel","formControlName","StartDate",3,"showIcon"],[2,"padding-left","20px","padding-right","20px"],["id","StopDateLabelId","ariaLabelledBy","lblDateRangeLabel","formControlName","StopDate",3,"showIcon"],["id","lblDateLAbel"],["id","lblDateLAbelctl","ariaLabelledBy","lblDateLAbel","formControlName","DisplayScale",3,"onChange","options"],["class","p-md-12",4,"ngIf"],["id","lblXAxisMaxLabel"],["ariaLabelledBy","lblXAxisMaxLabel","type","text","pInputText","","formControlName","CustomXScaleMaxValue",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","40%"],[2,"color","#7A4FA0"],["id","lblXAxisLabel"],["ariaLabelledBy","lblXAxisLabel","type","text","pInputText","","formControlName","XAxisLabel",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","40%"],["
1id","lblYAxisLabel"],["ariaLabelledBy","lblYAxisLabel","type","text","pInputText","","formControlName","YAxisLabel",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","40%"],["id","lblYAxisScaleMaxLabel"],["id","lblYAxisScaleMaxLabelctl","ariaLabelledBy","lblYAxisScaleMaxLabel","formControlName","CustomYScaleMaxField",3,"ngModelChange","options","ngModel"],["id","lblYAxisMaxLabel"],["ariaLabelledBy","lblYAxisMaxLabel","type","text","pInputText","","formControlName","CustomYScaleMaxValue",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","40%"],["id","lblYAxis2Label"],["ariaLabelledBy","lblYAxis2Label","type","text","pInputText","","formControlName","YAxis2Label",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","40%"],["id","lblYAxis2ScaleMaxLabel"],["id","lblYAxis2ScaleMaxLabelctl","ariaLabelledBy","lblYAxis2ScaleMaxLabel","formControlName","CustomY2ScaleMaxField",3,"ngModelChange","options","ngModel"],["ariaLabelledBy","lblYAxis2ScaleMaxLabel","class","p-inputtext p-corner-all p-state-default p-component","type","text","pInputText","","formControlName","CustomY2ScaleMaxValue","style","width:40%",4,"ngIf"],["ariaLabelledBy","lblYAxis2ScaleMaxLabel","type","text","pInputText","","formControlName","CustomY2ScaleMaxValue",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","40%"],["id","PointLabelDisplayLabel"],["id","PointLabelDisplayLabelctl","ariaLabelledBy","PointLabelDisplayLabel","formControlName","PointLabelDisplay",3,"options"],["id","lblSeriesDisplayLabel"],["id","lblSeriesDisplayLabelctl","ariaLabelledBy","lblSeriesDisplayLabel","formControlName","IsStacked",3,"options"],["id","lblGraphTypeLabel"],[3,"click",4,"ngIf"],[3,"click"],["alt","Line-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Cumulative-Line-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Column-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Bar-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Pie-chart64","height","42","width","42",3,"src","ngStyle"]],template:function(t,r){t&1&&(b(0,"app-messages",0),w(1,Ei,53,40,"form",1)),t&2&&(o("messages",r.msgs()),a(),o("ngIf",r.graphForm))},dependencies:[se,W,re,ee,H,X,Z,ae,ie,te,ne,ge,lt,Re,J],encapsulation:2})}return i})();var le=()=>({"min-width":"90%","max-width":"90%"}),Ft=()=>({"min-width":"90%"}),Me=i=>({"border-style":i});function Gi(i,m){i&1&&(Ie(),b(0,"svg",3))}function Ni(i,m){i&1&&(n(0,"strong",31),c(1),h(2,"translate"),h(3,"translate"),s()),i&2&&(a(),B("",d(2,2,"lblLegend")," ",d(3,4,"lblLabel")))}function Ai(i,m){i&1&&(n(0,"strong",32),c(1),h(2,"translate"),s()),i&2&&(a(),v(d(2,1,"lblDataSource")))}function Bi(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",33),
1c(3),h(4,"translate"),s()(),n(5,"div",10),b(6,"p-selectButton",34),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblSeriesDisplay")),a(3),y(f(6,Ft)),o("options",e.SeriesDisplayOptions)}}function Vi(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",35),c(3),h(4,"translate"),s(),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"p-select",36),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCensusTract")),a(5),y(f(10,le)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCensusTractList)}}function ji(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",37),c(3),h(4,"translate"),s(),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"p-select",38),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCustomLocation")),a(5),y(f(10,le)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCustomLocationList)}}function Pi(i,m){i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",39),c(3),h(4,"translate"),s(),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"input",40),s()()),i&2&&(a(3),v(d(4,3,"lblStreetAddress")),a(5),y(f(5,le)))}function Mi(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",41),c(3),h(4,"translate"),s(),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"p-select",42),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCity")),a(5),y(f(10,le)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCityList)}}function ki(i,m){i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",43),c(3),h(4,"translate"),s(),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"input",44),s()()),i&2&&(a(3),v(d(4,3,"lblZip")),a(5),y(f(5,le)))}function Ki(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",45),c(3),h(4,"translate"),s(),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"p-select",46),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblState")),a(5),y(f(10,le)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorStateList)}}function Ri(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",47),c(3),h(4,"translate"),s(),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"p-select",48),h(9,"translate"),s()()),i&2){let e=p(2);a(3),v(d(4,6,"lblCounty")),a(5),y(f(10,le)),o("placeholder",O(d(9,8,"lblDefaultSelect")))("options",e.ccbIndicatorCountyList)}}function Yi(i,m){if(i&1){let e=F();n(0,"a",49),x("click",function(){_(e);let r=p(2);return D(r.lineChartOnClick())}),b(1,"img",50),s()}if(i&2){let e=p(2);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Line-chart64.png"),pe)("ngStyle",de(3,Me,e.getBorderStyleForGraphType("line")))}}function Ui(i,m){if(i&1){let e=F();n(0,"a",49),x("click",function(){_(e);let r=p(2);return D(r.cumulativeLineChartOnClick())}),b(1,"img",51),s()}if(i&2){let e=p(2);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Cumulative-Line-chart64.png"),pe)("ngStyle",de(3,Me,e.getBorderStyleForGraphType("cumulativeline")))}}function Wi(i,m){if(i&1){let e=F();n(0,"a",49),x("click",function(){_(e);let r=p(2);return D(r.columnChartOnClick())}),b(1,"img",52),s()}if(i&2){let e=p(2);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Column-chart64.png"),pe)("ngStyle",de(3,Me,e.getBorderStyleForGraphType("column")))}}function qi(i,m){if(i&1){let e=F();n(0,"a",49),x("click",function(){_(e);let r=p(2);return D(r.barChartOnClick())}),b(1,"img",53),s()}if(i&2){let e=p(2);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Bar-chart64.png"),pe)("ngStyle",de(3,Me,e.getBorderStyleForGraphType("bar")))}}function Ji(i,m){if(i&1){let e=F();n(0,"a",49),x("click",function(){_(e);let r=p(2);return D(r.pieChartOnClick())}),b(1,"img",54),s()}if(i&2){let e=p(2);a(),o("src",he("",e.graphIconBaseUrl,"/graphs/Pie-chart64.png"),pe)("ngStyle",de(3,Me,e.getBorderStyleForGraphType("pie")))}}function zi(i,m){if(i&1){let e=F();n(0,"button",55),h(1,"translate"),h(2,"translate"),x("click",function(){_(e);let r=p(2);return D(r.deleteSeries())}),s()}if(i&2){let e=p(2);o("label",_e("",d(1,4,"lblActionDelete")," \xA0",d(2,6,"lblData")))("disabled",e.graphForm.invalid)}}function Qi(i,m){if(i&1){let e=F();n(0,"form",4),x("ngSubmit",function(){_(e);let r=p();return D(r.onSubmit(r.graphForm))}),n(1,"div",5)(2,"div",6)(3,"div",7),w(4,Ni,4,6,"strong",8),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"input",11),s()(),n(9,"div",6)(10,"div",7),w(11,Ai,3,3,"strong",12),s(),n(12,"div",10),b(13,"p-select",13),s()(),n(14,"div",6)(15,"div",7)(16,"strong",14),
1c(17),h(18,"translate"),h(19,"translate"),s(),n(20,"strong",9),c(21," *"),s()(),n(22,"div",10),b(23,"p-select",15),h(24,"translate"),s()(),w(25,Bi,7,7,"div",16),n(26,"div",6)(27,"div",7)(28,"strong",17),c(29),h(30,"translate"),s()(),n(31,"div",10)(32,"p-select",18),x("onChange",function(r){_(e);let l=p();return D(l.indicatorDataSourceOnChange(r))}),s()()(),n(33,"div",6)(34,"div",7)(35,"strong",19),c(36),h(37,"translate"),s()(),n(38,"div",10),b(39,"p-select",20),s()(),n(40,"div",6)(41,"div",7)(42,"strong",21),c(43),h(44,"translate"),s()(),n(45,"div",10),b(46,"p-select",22),s()(),n(47,"div",6)(48,"div",7)(49,"strong",23),c(50),h(51,"translate"),s()(),n(52,"div",10)(53,"p-select",24),x("onChange",function(r){_(e);let l=p();return D(l.geographicLevelsOnChange(r))}),s()()(),w(54,Vi,10,11,"div",16)(55,ji,10,11,"div",16)(56,Pi,9,6,"div",16)(57,Mi,10,11,"div",16)(58,ki,9,6,"div",16)(59,Ki,10,11,"div",16)(60,Ri,10,11,"div",16),n(61,"div",6)(62,"div",7)(63,"strong",25),c(64),h(65,"translate"),s()(),n(66,"div",10),b(67,"p-select",26),s()(),n(68,"div",6)(69,"div",7)(70,"strong",27),c(71),h(72,"translate"),s()(),n(73,"div",10),w(74,Yi,2,5,"a",28)(75,Ui,2,5,"a",28)(76,Wi,2,5,"a",28)(77,qi,2,5,"a",28)(78,Ji,2,5,"a",28),s()(),n(79,"div",6)(80,"div",7),c(81," \xA0 "),s(),n(82,"div",29),w(83,zi,3,8,"button",30),s()()()()}if(i&2){let e=p();o("formGroup",e.graphForm),a(4),o("ngIf",e.ChartId),a(7),o("ngIf",e.ChartId),a(2),y(f(66,le)),o("options",e.DefaultGraphsDataTypesOptions),a(4),B("",d(18,48,"lblSelectText"),"\xA0",d(19,50,"lblSites")),a(6),y(f(67,Ft)),o("placeholder",O(d(24,52,"lblDefaultSelect")))("options",e.ccbSites),a(2),o("ngIf",e.PanelSeriesDisplay),a(4),v(d(30,54,"lblResource")),a(3),y(f(68,le)),o("options",e.ccbIndicatorDataSources),a(4),v(d(37,56,"lblTopicArea")),a(3),y(f(69,le)),o("options",e.ccbIndicatorTopics),a(4),v(d(44,58,"lblInitative")),a(3),y(f(70,le)),o("options",e.ccbIndicatorInitiatives),a(4),v(d(51,60,"lblGeographicLevel")),a(3),y(f(71,le)),o("options",e.ccbIndicatorGeographicLevels),a(),o("ngIf",e.selectedGeographicLevel==="CensusTract"),a(),o("ngIf",e.selectedGeographicLevel==="CustomLocation"),a(),o("ngIf",e.selectedGeographicLevel==="SpecificAddress"),a(),o("ngIf",e.selectedGeographicLevel==="SpecificAddress"||e.selectedGeographicLevel==="City"),a(),o("ngIf",e.selectedGeographicLevel==="SpecificAddress"||e.selectedGeographicLevel==="Zip"),a(),o("ngIf",e.selectedGeographicLevel==="SpecificAddress"||e.selectedGeographicLevel==="State"),a(),o("ngIf",e.selectedGeographicLevel==="SpecificAddress"||e.selectedGeographicLevel==="County"),a(4),v(d(65,62,"lblIndicator")),a(3),y(f(72,le)),o("options",e.ccbIndicatorNames),a(4),v(d(72,64,"lblGraphType")),a(3),o("ngIf",e.showIconLineChart),a(),o("ngIf",e.showIconCumulativeLineChart),a(),o("ngIf",e.showIconColumnChart),a(),o("ngIf",e.showIconBarChart),a(),o("ngIf",e.showIconPieChart),a(5),o("ngIf",e.showDeleteSeriesButton)}}var Ot=(()=>{class i{_ccbContextService;_commonService;_translate;_confirmationService;ChartId;SeriesId;onSave=new ce;SeriesTypeId;translatedKeyValues;chartObj;spSiteId;spSiteUrl;graphForm;group={};loading=!1;msgs=R([]);selectedGraphType="";doesInitialLoadComplete=!0;chartSeriesObj;graphIconBaseUrl=Ye.ImagesPath;showDeleteSeriesButton=!1;ccbIndicatorCategories=[];ccbIndicatorDataSources=[];ccbIndicatorTopics=[];ccbIndicatorInitiatives=[];ccbIndicatorGeographicLevels=[];ccbIndicatorCityList=[];ccbIndicatorStateList=[];ccbIndicatorCountyList=[];ccbIndicatorCensusTractList=[];ccbIndicatorCustomLocationList=[];ccbIndicatorNames=[];IndicatorsData;DefaultGraphsDataTypesOptions;SeriesDisplayOptions;PanelSeriesDisplay=!1;showIconLineChart=!0;showIconCumulativeLineChart=!0;showIconColumnChart=!0;showIconBarChart=!0;showIconPieChart=!0;selectedGeographicLevel;ccbSites;selectedSite;OriginalIndicatorsData;constructor(e,t,r,l){this._ccbContextService=e,this._commonService=t,this._translate=r,this._confirmationService=l}ngOnInit(){this.init()}init=()=>u(this,null,function*(){yield this.getRequiredTranslations()});getRequiredTranslations(){return u(this,null,function*(){let e=yield K(this._translate.get(["lblAccomplishments","lblParticipantDescription","lblIndicators","lblKeyEvents","lblCreateGraphFromTemplate","lblPDNumberServed","lblPDParticipants","lblCreateNewGraph","lblMsgCreationComplete","lblSelect","lblMsgDeletionComplete","lblActionDelete","lblMsgDeleteConfirm","lblResource"]));e&&(this.translatedKeyValues=e,this.spSiteId=this._ccbContextService.getSPSiteId(),this.spSiteUrl=this._ccbContextService.getSPSiteUrl(),this.loadChoices(),this.buildFormGroup(),yield this.bindSeriesData(),yield this.manageDeleteSeriesButton())})}loadChoices(){this.SeriesDisplayOptions=[{label:"Amount",value:1},{label:"Value",value:2},{label:"Average",value:3}],this.DefaultGraphsDataTypesOptions=[{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblIndicators","~Indicators~"),value:"ODSS-INDICATORS"}]}buildFormGroup(){this.group.DataSource=new C("",[]),this.group.ResourceId=new C("",[]),this.group.TopicArea=new C("",[]),this.group.Initiative=new C("",[]),this.group.Category=new C("",[]),this.group.GeographicLevel=new C("",[]),this.group.CensusTract=new C("",[]),this.group.CustomLocation=new C("",[]),this.group.StreetAddress=new C("",[]),this.group.City=new C("",[]),this.group.State=new C("",[]),this.group.Zip=new C("",[]),this.group.County=new C("",[]),this.group.IntervalSiteId=new C("",[]),this.group.IndicatorName=new C("",[]),this.group.SeriesName=new C("",[]),this.group.SeriesDisplayId=new C("",[]),this.group.GraphsDataType=new C("",[]),this.graphForm=new $(this.group)}getIndicatorDataSources(e){return u(this,null,function*(){this.ccbIndicatorDataSources=[];try{let t=yield ft.getIndicatorResourcesBySiteId(this.spSiteId);t&&(t.forEach(l=>{let g={label:l.ResourceName,value:l.ResourceId};this.ccbIndicatorDataSources.push(g)}),e!=null?(this.graphForm.controls.ResourceId.setValue(e),this.getOtherIndicatorsDropDowns(e)):this.ccbIndicatorDataSources.length>0&&(this.graphForm.controls.ResourceId.setValue(this.ccbIndicatorDataSources[0].value),this.getOtherIndicatorsDropDowns(this.ccbIndicatorDataSources[0].value)))}catch(t){this.showError(t)}})}chartSitesOnChange(e){return u(this,null,function*(){this.spSiteId=e.value,yield this.bindSeriesData()})}geographicLevelsOnChange(e){this.selectedGeographicLevel=e.value}getIndicatorListDefaults(){this.ccbIndicatorCityList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorStateList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCountyList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCensusTractList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorCustomLocationList=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorGeographicLevels=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorNames=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorInitiatives=this._commonService.getDefaultAllDropDownOption(),this.ccbIndicatorTopics=this._commonService.getDefaultAllDropDownOption()}getChartIndicatorCategories(){return u(this,arguments,function*(e=this.spSiteId){try{let t=yield ze.getIndicatorsBySiteId(e);if(t){this.graphForm.controls.ResourceId.setValue(this.chartSeriesObj.IndicatorResourceId),this.graphForm.controls.TopicArea.setValue(this.chartSeriesObj.IndicatorSeries),this.graphForm.controls.Initiative.setValue(this.chartSeriesObj.IndicatorInitiative),this.graphForm.controls.GeographicLevel.setValue(this.chartSeriesObj.IndicatorCommunity),this.graphForm.controls.CensusTract.setValue(this.chartSeriesObj.IndicatorCensusTract),this.graphForm.controls.CustomLocation.setValue(this.chartSeriesObj.IndicatorCustomLocation),this.graphForm.controls.StreetAddress.setValue(this.chartSeriesObj.IndicatorStreetAddress),this.graphForm.controls.City.setValue(this.chartSeriesObj.IndicatorCity),this.graphForm.controls.State.setValue(this.chartSeriesObj.IndicatorState),this.graphForm.controls.Zip.setValue(this.chartSeriesObj.IndicatorZip),this.graphForm.controls.County.setValue(this.chartSeriesObj.IndicatorCounty);let r=this.ccbSites.filter(l=>l.SPSiteId==this.chartSeriesObj.IntervalSiteId)[0];this.graphForm.controls.IntervalSiteId.setValue(r),this.graphForm.controls.IndicatorName.setValue(this.chartSeriesObj.IndicatorName),t&&t.length>0?(this.ccbIndicatorCategories=this._commonService.getDefaultAllDropDownOption(),this.IndicatorsData=this.OriginalIndicatorsData=t,this.IndicatorsData.length>0&&(this.getIndicatorListDefaults(),this.IndicatorsData.forEach(l=>{this.getIndicatorCategories(l),this.getIndicatorDataSourceList(l),this.getOtherIndicatorsDropDowns(l)}),this.ccbIndicatorDataSources.length>0&&this.graphForm.controls.ResourceId.setValue(this.ccbIndicatorDataSources[0].value))):(this.IndicatorsData=null,this.ccbIndicatorCategories=null,this.ccbIndicatorDataSources=null,this.clearOtherIndicators())}}catch(t){this.showError(t)}})}getIndicatorDataSourceList(e){if(!I(e.ResourceName)&&this.ccbIndicatorDataSources.filter(t=>t.label===e.ResourceName).length==0){let t={label:e.ResourceName,value:e.ResourceId};this.ccbIndicatorDataSources.push(t)}}getIndicatorCategories(e){let t=this.ccbIndicatorCategories.filter(r=>r.label===e.Category).length;if(!I(e.Category)&&t===0){let r={label:e.Category,value:e.Category};this.ccbIndicatorCategories.push(r)}}clearOtherIndicators(){this.ccbIndicatorTopics=null,this.ccbIndicatorInitiatives=null,this.ccbIndicatorGeographicLevels=null,this.ccbIndicatorNames=null,this.ccbIndicatorCityList=null,this.ccbIndicatorStateList=null,this.ccbIndicatorCountyList=null,this.ccbIndicatorCensusTractList=null,this.ccbIndicatorCustomLocationList=null}getOtherIndicatorsDropDowns(e){let t=e.GeographicLevel;if(!I(t)&&t!=""&&this.ccbIndicatorGeographicLevels.filter(S=>S.label===t).length==0){let S={label:t,value:t};this.ccbIndicatorGeographicLevels.push(S)}let r=e.County;if(!I(r)&&r!=""&&this.ccbIndicatorCountyList.filter(S=>S.label===r).length==0){let S={label:r,value:r};this.ccbIndicatorCountyList.push(S)}let l=e.State;if(!I(l)&&l!=""&&this.ccbIndicatorStateList.filter(S=>S.label===l).length==0){let S={label:l,value:l};this.ccbIndicatorStateList.push(S)}let g=e.CustomLocation;if(!I(g)&&g!=""&&this.ccbIndicatorCustomLocationList.filter(S=>S.label===g).length==0){let S={label:g,value:g};this.ccbIndicatorCustomLocationList.push(S)}let T=e.City;if(!I(T)&&T!=""&&this.ccbIndicatorCityList.filter(S=>S.label===T).length==0){let S={label:T,value:T};this.ccbIndicatorCityList.push(S)}let k=e.CensusTract;if(!I(k)&&k!=""&&this.ccbIndicatorCensusTractList.filter(S=>S.label===k).length==0){let S={label:k,value:k};this.ccbIndicatorCensusTractList.push(S)}let oe=e.IndicatorName;if(!I(oe)&&oe!=""&&this.ccbIndicatorNames.filter(S=>S.label===oe).length==0){let S={label:oe,value:oe};this.ccbIndicatorNames.push(S)}let Se=e.Initiative;if(!I(Se)&&Se!=""&&this.ccbIndicatorInitiatives.filter(S=>S.label===Se).length==0){let S={label:Se,value:Se};this.ccbIndicatorInitiatives.push(S)}let Ce=e.TopicArea;if(!I(Ce)&&Ce!=""&&this.ccbIndicatorTopics.filter(S=>S.label===Ce).length==0){let S={label:Ce,value:Ce};this.ccbIndicatorTopics.push(S)}}bindSeriesData=()=>u(this,null,function*(){try{this.ccbSites=[],this.ccbSites=yield Le.getSiteAllWebs(),this.doesInitialLoadComplete=!0;let e=yield E.getChartSeriesBySeriesId(this.SeriesId);if(e&&e.length>0){this.chartSeriesObj=e[0],I(this.chartSeriesObj)||(this.selectedGeographicLevel=this.chartSeriesObj.IndicatorCommunity);let t=yield N.getChartsByChartId(this.ChartId);t?(this.chartObj=t,this.graphForm.controls.SeriesName.setValue(this.chartSeriesObj.SeriesName),this.graphForm.controls.GraphsDataType.setValue("ODSS-INDICATORS"),this.setSeriesDisplayId(),this.setGraphTypes(1),I(this.chartSeriesObj.IntervalSiteId)?yield this.getChartIndicatorCategories():yield this.getChartIndicatorCategories(this.chartSeriesObj.IntervalSiteId)):yield this.getChartIndicatorCategories()}}catch(e){this.showError(e)}});setGraphTypes(e){switch(e){case 1:this.showIconColumnChart=!1,this.showIconBarChart=!1,this.showIconPieChart=!1;break;case 5:case 8:this.showIconColumnChart=!1,this.showIconBarChart=!1;break;default:break}}setSeriesDisplayId(){this.chartSeriesObj.SeriesDisplayId>=1&&this.chartSeriesObj.SeriesDisplayId<=3&&this.graphForm.controls.SeriesDisplayId.setValue(this.chartSeriesObj.SeriesDisplayId),(this.chartObj.ChartTypeId==1||this.chartSeriesObj.SeriesDisplayId==2||this.chartSeriesObj.SeriesDisplayId==3)&&(this.PanelSeriesDisplay=!0)}indicatorDataSourceOnChange(e){this.getOtherIndicatorsDropDowns(e.value)}getBorderStyleForGraphType(e){return e===this.selectedGraphType?"solid":""}saveSeries(){return u(this,null,function*(){switch(this.selectedGraphType){case"line":this.chartSeriesObj.IsCumulativeLine=!1;break;case"cumulativeline":this.chartSeriesObj.IsCumulativeLine=!0;break}this.chartSeriesObj.SeriesName=this.graphForm.controls.SeriesName.value,this.chartSeriesObj.IndicatorResourceId=this.graphForm.controls.ResourceId.value,this.chartSeriesObj.IndicatorName=this.graphForm.controls.IndicatorName.value,this.chartSeriesObj.IndicatorSeries=this.graphForm.controls.TopicArea.value,this.chartSeriesObj.IndicatorInitiative=this.graphForm.controls.Initiative.value,this.chartSeriesObj.IndicatorCommunity=this.graphForm.controls.GeographicLevel.value,this.chartSeriesObj.IndicatorCensusTract=this.graphForm.controls.CensusTract.value,this.chartSeriesObj.IndicatorCustomLocation=this.graphForm.controls.CustomLocation.value,this.chartSeriesObj.IndicatorStreetAddress=this.graphForm.controls.StreetAddress.value,this.chartSeriesObj.IndicatorCity=this.graphForm.controls.City.value,this.chartSeriesObj.IndicatorState=this.graphForm.controls.State.value,this.chartSeriesObj.IndicatorZip=this.graphForm.controls.Zip.value,this.chartSeriesObj.IndicatorCounty=this.graphForm.controls.County.value,this.chartSeriesObj.SeriesDisplayId=this.graphForm.controls.SeriesDisplayId.value,this.chartSeriesObj.IntervalSiteId=this.graphForm.controls.IntervalSiteId.value.SPSiteId,yield this.updateExistingGraphSeriesObject(this.chartSeriesObj)})}updateExistingGraphSeriesObject(e){return u(this,null,function*(){try{this.loading=!0,yield E.putODSChartSeries(e.SeriesId,e)}catch(t){this.showError(t)}finally{this.loading=!1}})}manageDeleteSeriesButton(){return u(this,null,function*(){if(this.ChartId)try{let e=yield E.getChartSeriesByChartId(this.ChartId);e&&e.length>1&&(this.showDeleteSeriesButton=!0)}catch(e){this.showError(e)}})}deleteSeries(){return u(this,null,function*(){this.SeriesId&&this._confirmationService.confirm({message:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblMsgDeleteConfirm","~Delete Confirm: ~")+this.chartSeriesObj.SeriesName+"?",header:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblActionDelete","~Delete~"),accept:()=>u(this,null,function*(){try{yield E.deleteODSChartSeries(this.SeriesId),this.onSave.emit(this.chartObj.ChartId)}catch(e){this.showError(e)}})})})}lineChartOnClick(){this.selectedGraphType="line"}cumulativeLineChartOnClick(){this.selectedGraphType="cumulativeline"}columnChartOnClick(){this.selectedGraphType="column"}barChartOnClick(){this.selectedGraphType="bar"}pieChartOnClick(){this.selectedGraphType="pie"}showError(e){this.msgs.set([{severity:"error",summary:e.message}])}static \u0275fac=function(t){return new(t||i)(L(Q),L(A),L(q),L(z))};static \u0275cmp=Y({type:i,selectors:[["grapheditindicators"]],inputs:{ChartId:"ChartId",SeriesId:"SeriesId"},outputs:{onSave:"onSave"},features:[U([A])],decls:4,vars:2,consts:[[3,"messages"],["pTemplate","icon"],["novalidate","","class","form-horizontal",3,"formGroup","ngSubmit",4,"ngIf"],["lucideCircleQuestionMark","","aria-hidden","true",1,"menu-icon"],["novalidate","",1,"form-horizontal",3,"ngSubmit","formGroup"],[1,"p-grid","p-fluid","form-group"],[1,"p-md-12"],[1,"p-col-12","p-md-4"],["id","lblLegendLAbel",4,"ngIf"],[2,"color","#7A4FA0"],[1,"p-col-12","p-md-8"],["ariaLabelledBy","lblLegendLAbel","type","text","pInputText","","formControlName","SeriesName",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","90%"],["id","lblDataSourceLabel",4,"ngIf"],["ariaLabelledBy","lblDataSourceLabel","formControlName","GraphsDataType","readonly","readonly",3,"options"],["id","lblSelectTextLabel"],["a
1riaLabelledBy","lblSelectTextLabel","optionLabel","SPSiteTitle","dataKey","SPSiteId","disabled","true","formControlName","IntervalSiteId",3,"placeholder","options"],["class","p-md-12",4,"ngIf"],["id","lblResourceLabel"],["ariaLabelledBy","lblResourceLabel","formControlName","ResourceId",3,"onChange","options"],["id","lblTopicAreaLabel"],["ariaLabelledBy","lblTopicAreaLabel","formControlName","TopicArea",3,"options"],["id","lblInitativeLAbel"],["ariaLabelledBy","lblInitativeLAbel","formControlName","Initiative",3,"options"],["id","lblGeographicLevelLabel"],["ariaLabelledBy","lblGeographicLevelLabel","formControlName","GeographicLevel",3,"onChange","options"],["id","lblIndicatorLabel"],["ariaLabelledBy","lblIndicatorLabel","formControlName","IndicatorName",3,"options"],["id","lblGraphTypeLabel"],[3,"click",4,"ngIf"],[1,"p-col-12","submit-button-container"],["pButton","","type","button","severity","danger",3,"disabled","label","click",4,"ngIf"],["id","lblLegendLAbel"],["id","lblDataSourceLabel"],["id","lblSeriesDisplayLabel"],["id","lblSeriesDisplayLabelctl","ariaLabelledBy","lblSeriesDisplayLabel","formControlName","SeriesDisplayId",3,"options"],["id","lblCensusTractLabel"],["ariaLabelledBy","lblCensusTractLabel","formControlName","CensusTract",3,"placeholder","options"],["id","lblCustomLocationLabel"],["ariaLabelledBy","lblCustomLocationLabel","formControlName","CustomLocation",3,"placeholder","options"],["id","lblStreetAddressLabel"],["ariaLabelledBy","lblStreetAddressLabel","type","text","pInputText","","formControlName","StreetAddress",1,"p-inputtext","p-corner-all","p-state-default","p-component"],["id","lblCityLabel"],["ariaLabelledBy","lblCityLabel","formControlName","City",3,"placeholder","options"],["id","lblZipLabel"],["ariaLabelledBy","lblZipLabel","type","text","pInputText","","formControlName","Zip",1,"p-inputtext","p-corner-all","p-state-default","p-component"],["id","lblStateLabel"],["ariaLabelledBy","lblStateLabel","formControlName","State",3,"placeholder","options"],["id","lblCountyLabel"],["ariaLabelledBy","lblCountyLabel","formControlName","County",3,"placeholder","options"],[3,"click"],["alt","Line-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Cumulative-Line-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Column-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Bar-chart64","height","42","width","42",3,"src","ngStyle"],["alt","Pie-chart64","height","42","width","42",3,"src","ngStyle"],["pButton","","type","button","severity","danger",3,"click","disabled","label"]],template:function(t,r){t&1&&(b(0,"app-messages",0),n(1,"p-confirmDialog"),w(2,Gi,1,0,"ng-template",1),s(),w(3,Qi,84,73,"form",2)),t&2&&(o("messages",r.msgs()),a(3),o("ngIf",r.graphForm))},dependencies:[se,me,ve,re,ee,H,X,Z,ne,xe,W,Re,De,ae,ie,te,ue,ge,J],encapsulation:2})}return i})();var Hi=()=>({"min-width":"90%","max-width":"90%"}),Lt=()=>({"min-width":"90%"}),Xi=()=>({minWidth:"100%"});function Zi(i,m){i&1&&(Ie(),b(0,"svg",3))}function $i(i,m){i&1&&(n(0,"strong",19),c(1),h(2,"translate"),h(3,"translate"),s()),i&2&&(a(),B("",d(2,2,"lblLegend")," ",d(3,4,"lblLabel")))}function er(i,m){i&1&&(n(0,"strong",20),c(1),h(2,"translate"),s()),i&2&&(a(),v(d(2,1,"lblDataSource")))}function tr(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",21),c(3),h(4,"translate"),s()(),n(5,"div",10),b(6,"p-selectButton",22),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblSeriesDisplay")),a(3),y(f(6,Lt)),o("options",e.SeriesDisplayOptions)}}function ir(i,m){if(i&1){let e=F();n(0,"button",23),h(1,"translate"),h(2,"translate"),x("click",function(){_(e);let r=p(2);return D(r.deleteSeries())}),s()}if(i&2){let e=p(2);o("label",_e("",d(1,4,"lblActionDelete")," \xA0",d(2,6,"lblData")))("disabled",e.graphForm.invalid)}}function rr(i,m){if(i&1){let e=F();n(0,"form",4),x("ngSubmit",function(){_(e);let r=p();return D(r.onSubmit(r.graphForm))}),n(1,"div",5)(2,"div",6)(3,"div",7),w(4,$i,4,6,"strong",8),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"input",11),s()(),n(9,"div",6)(10,"div",7),w(11,er,3,3,"strong",12),s(),n(12,"div",10),b(13,"p-select",13),s()(),w(14,tr,7,7,"div",14),n(15,"div",6)(16,"div",7)(17,"strong",15),c(18),h(19,"translate"),s(),n(20,"strong",9),c(21," *"),s()(),n(22,"div",10)(23,"p-multiSelect",16),h(24,"translate"),M("ngModelChange",function(r){_(e);let l=p();return P(l.selectedKeyEvents,r)||(l.selectedKeyEvents=r),D(r)}),s()()(),n(25,"div",6)(26,"div",7),c(27," \xA0 "),s(),n(28,"div",17),w(29,ir,3,8,"button",18),s()()()()}if(i&2){let e=p();o("formGroup",e.graphForm),a(4),o("ngIf",e.ChartId),a(7),o("ngIf",e.ChartId),a(2),y(f(20,Hi)),o("options",e.DefaultGraphsDataTypesOptions),a(),o("ngIf",e.PanelSeriesDisplay),a(4),v(d(19,16,"lblKeyEvents")),a(5),y(f(21,Lt)),o("placeholder",O(d(24,18,"lblDefaultSelect")))("options",e.ccbKeyEvents),j("ngModel",e.selectedKeyEvents),o("panelStyle",f(22,Xi)),a(6),o("ngIf",e.showDeleteSeriesButton)}}var Et=(()=>{class i{_ccbContextService;_commonService;_translate;_confirmationService;ChartId;SeriesId;onSave=new ce;SeriesTypeId;translatedKeyValues;chartObj;spSiteId;spSiteUrl;graphForm;group={};loading=!1;msgs=R([]);selectedGraphType="";doesInitialLoadComplete=!0;chartSeriesObj;showDeleteSeriesButton=!1;ccbKeyEvents;DefaultGraphsDataTypesOptions;SeriesDisplayOptions;PanelSeriesDisplay=!1;chartSeriesKeyEvents;selectedKeyEvents;constructor(e,t,r,l){this._ccbContextService=e,this._commonService=t,this._translate=r,this._confirmationService=l}ngOnInit(){this.init()}init=()=>u(this,null,function*(){yield this.getRequiredTranslations()});getRequiredTranslations(){return u(this,null,function*(){let e=yield K(this._translate.get(["lblKeyEvents","lblMsgCreationComplete","lblSelect","lblMsgDeletionComplete","lblActionDelete","lblMsgDeleteConfirm"]));this.translatedKeyValues=e,this.spSiteId=this._ccbContextService.getSPSiteId(),this.spSiteUrl=this._ccbContextService.getSPSiteUrl(),this.loadChoices(),this.buildFormGroup(),yield this.bindSeriesData(),yield this.manageDeleteSeriesButton()})}loadChoices(){this.SeriesDisplayOptions=[{label:"Count",value:1},{label:"Sum",value:2},{label:"Average",value:3}],this.DefaultGraphsDataTypesOptions=[{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblKeyEvents","~Key Events~"),value:"ODSS-KEYEVENTS"}]}buildFormGroup(){this.group.KeyEvents=new C("",[]),this.group.SeriesName=new C("",[]),this.group.SeriesDisplayId=new C("",[]),this.group.GraphsDataType=new C("",[]),this.graphForm=new $(this.group)}bindSeriesData(){return u(this,null,function*(){try{this.doesInitialLoadComplete=!0;let e=yield E.getChartSeriesBySeriesId(this.SeriesId);if(e&&e.length>0){this.chartSeriesObj=e[0];let t=yield N.getChartsByChartId(this.ChartId);this.chartObj=t,this.graphForm.controls.SeriesName.setValue(this.chartSeriesObj.SeriesName),this.graphForm.controls.GraphsDataType.setValue("ODSS-KEYEVENTS"),this.setSeriesDisplayId(),this.ccbKeyEvents=[];let r=yield qe.getKeyEventsBySiteId(this.spSiteId);if(r){this.setccbKeyEvents(r);let l=yield je.getChartSeriesKeyEventsBySeriesId(this.SeriesId);if(l){this.selectedKeyEvents=[];let g="";l.forEach(T=>{this.selectedKeyEvents.push(T.KeyEventId),g=","})}}}}catch(e){this.showError(e)}})}setccbKeyEvents(e){this.ccbKeyEvents=[],e.forEach(t=>{t.label=t.ExtendedLabel,t.value=t.KeyEventId}),this.ccbKeyEvents=e}setSeriesDisplayId(){this.chartSeriesObj.SeriesDisplayId>=1&&this.chartSeriesObj.SeriesDisplayId<=3&&this.graphForm.controls.SeriesDisplayId.setValue(this.chartSeriesObj.SeriesDisplayId),(this.chartObj.ChartTypeId==1||this.chartSeriesObj.SeriesDisplayId==2||this.chartSeriesObj.SeriesDisplayId==3)&&(this.PanelSeriesDisplay=!0)}saveSeries(){return u(this,null,function*(){this.chartSeriesObj.SeriesName=this.graphForm.controls.SeriesName.value;let e=this.graphForm.controls.KeyEvents.value;this.chartSeriesKeyEvents=[],e?.forEach(t=>{let r={SeriesId:this.chartSeriesObj.SeriesId,KeyEventId:t};this.chartSeriesKeyEvents.push(r)}),this.chartSeriesObj.SeriesDisplayId=this.graphForm.controls.SeriesDisplayId.value;try{yield E.putODSChartSeries(this.chartSeriesObj.SeriesId,this.chartSeriesObj),yield je.updateChartSeriesKeyEvents(this.chartSeriesKeyEvents)}catch(t){this.showError(t)}finally{this.loading=!1}})}manageDeleteSeriesButton(){return u(this,null,function*(){if(this.ChartId)try{let e=yield E.getChartSeriesByChartId(this.ChartId);e&&e.length>1&&(this.showDeleteSeriesButton=!0)}catch(e){this.showError(e)}})}deleteSeries(){return u(this,null,function*(){this.SeriesId&&this._confirmationService.confirm({message:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblMsgDeleteConfirm","~Delete Confirm: ~")+this.chartSeriesObj.SeriesName+"?",header:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblActionDelete","~Delete~"),accept:()=>u(this,null,function*(){try{yield E.deleteODSChartSeries(this.SeriesId),this.onSave.emit(this.chartObj.ChartId)}catch(e){this.showError(e)}})})})}showError(e){this.msgs.set([{severity:"error",summary:e.message}])}static \u0275fac=function(t){return new(t||i)(L(Q),L(A),L(q),L(z))};static \u0275cmp=Y({type:i,selectors:[["grapheditkeyevents"]],inputs:{ChartId:"ChartId",SeriesId:"SeriesId"},outputs:{onSave:"onSave"},features:[U([A])],decls:4,vars:2,consts:[[3,"messages"],["pTemplate","icon"],["novalidate","","class","form-horizontal",3,"formGroup","ngSubmit",4,"ngIf"],["lucideCircleQuestionMark","","aria-hidden","true",1,"menu-icon"],["novalidate","",1,"form-horizontal",3,"ngSubmit","formGroup"],[1,"p-grid","p-fluid","form-group"],[1,"p-md-12"],[1,"p-col-12","p-md-4"],["id","lblLegendLAbel",4,"ngIf"],[2,"color","#7A4FA0"],[1,"p-col-12","p-md-8"],["ariaLabelledBy","lblLegendLAbel","type","text","pInputText","","formControlName","SeriesName",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","90%"],["id","lblDataSourceLabel",4,"ngIf"],["ariaLabelledBy","lblDataSourceLabel","formControlName","GraphsDataType","readonly","readonly",3,"options"],["class","p-md-12",4,"ngIf"],["id","lblKeyEventsLabel"],["accessableMultiselect","","id","lblKeyEventsLabelid","ariaLabelledBy","lblKeyEventsLabel","formControlName","KeyEvents",3,"ngModelChange","placeholder","options","ngModel","panelStyle"],[1,"p-col-12","submit-button-container"],["pButton","","type","button","severity","danger",3,"disabled","label","click",4,"ngIf"],["id","lblLegendLAbel"],["id","lblDataSourceLabel"],["id","lblSeriesDisplayLabel"],["id","lblSeriesDisplayLabelctl","ariaLabelledBy","SeriesDisplayIdLabel","formControlName","SeriesDisplayId",3,"options"],["pButton","","type","button","severity","danger",3,"click","disabled","label"]],template:function(t,r){t&1&&(b(0,"app-messages",0),n(1,"p-confirmDialog"),w(2,Zi,1,0,"ng-template",1),s(),w(3,rr,30,23,"form",2)),t&2&&(o("messages",r.msgs()),a(3),o("ngIf",r.graphForm))},dependencies:[se,ve,De,xe,W,re,ee,H,X,Z,ae,ie,te,ne,ue,ge,Oe,me,J],encapsulation:2})}return i})();var ke={getODSChartSeriesAccomplishmentFiltersBySeriesId:i=>u(null,null,function*(){return Ue("api/ChartSeriesAccomplishmentFilters/GetODSChartSeriesAccomplishmentFiltersBySeriesId/"+i)}),deleteODSChartSeriesAccomplishmentFilter:i=>u(null,null,function*(){return st("api/ChartSeriesAccomplishmentFilters/DeleteODSChartSeriesAccomplishmentFilter/"+i)}),postAccomplishmentFilters:i=>u(null,null,function*(){return Ve("api/ChartSeriesAccomplishmentFilters/PostAccomplishmentFilters",i)})};var Ze=()=>({"min-width":"90%","max-width":"90%"}),Qe=()=>({"min-width":"90%"}),ar=()=>({minWidth:"100%"});function nr(i,m){i&1&&(Ie(),b(0,"svg",3))}function sr(i,m){i&1&&(n(0,"strong",25),c(1),h(2,"translate"),h(3,"translate"),s()),i&2&&(a(),B("",d(2,2,"lblLegend")," ",d(3,4,"lblLabel")))}function or(i,m){i&1&&(n(0,"strong",26),c(1),h(2,"translate"),s()),i&2&&(a(),v(d(2,1,"lblDataSource")))}function lr(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",27),c(3),h(4,"translate"),s()(),n(5,"div",10),b(6,"p-selectButton",28),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblSeriesDisplay")),a(3),y(f(6,Qe)),o("options",e.SeriesDisplayOptions)}}function cr(i,m){if(i&1){let e=F();n(0,"div",6)(1,"div",7)(2,"strong",29),c(3),h(4,"translate"),s()(),n(5,"div",10)(6,"p-multiSelect",30),M("ngModelChange",function(r){_(e);let l=p(2);return P(l.selectedChoices,r)||(l.selectedChoices=r),D(r)}),s()()()}if(i&2){let e=p(2);a(3),v(d(4,6,"lblValuesToGraph")),a(3),y(f(8,Qe)),o("options",e.ccbFieldChoices),j("ngModel",e.selectedChoices),o("panelStyle",f(9,ar))}}function pr(i,m){if(i&1){let e=F();n(0,"div",6)(1,"div",31)(2,"filterlist",32),x("onFilter",function(r){_(e);let l=p(2);return D(l.onFilterClicked(r))})("onClearFilter",function(r){_(e);let l=p(2);return D(l.onClearFilterClicked(r))}),s()()()}if(i&2){let e=p(2);a(2),o("formId",e.selectedFormId)("initialData",e.filterValues)("dataColl",e.filteredColl)("showAdvanced",e.showAdvancedFilters)("forPDReport",e.forPDReport)}}function hr(i,m){if(i&1){let e=F();n(0,"button",33),h(1,"translate"),h(2,"translate"),x("click",function(){_(e);let r=p(2);return D(r.deleteSeries())}),s()}if(i&2){let e=p(2);o("label",_e("",d(1,4,"lblActionDelete")," \xA0",d(2,6,"lblData")))("disabled",e.graphForm.invali
1d)}}function dr(i,m){if(i&1){let e=F();n(0,"form",4),x("ngSubmit",function(){_(e);let r=p();return D(r.onSubmit(r.graphForm))}),n(1,"div",5)(2,"div",6)(3,"div",7),w(4,sr,4,6,"strong",8),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"input",11),s()(),n(9,"div",6)(10,"div",7),w(11,or,3,3,"strong",12),s(),n(12,"div",10),b(13,"p-select",13),s()(),w(14,lr,7,7,"div",14),n(15,"div",6)(16,"div",7)(17,"strong",15),c(18),h(19,"translate"),s(),n(20,"strong",9),c(21," *"),s()(),n(22,"div",10),b(23,"p-select",16),s()(),n(24,"div",6)(25,"div",7)(26,"strong",17),c(27),h(28,"translate"),h(29,"translate"),s(),n(30,"strong",9),c(31," *"),s()(),n(32,"div",10)(33,"p-select",18),h(34,"translate"),x("onChange",function(r){_(e);let l=p();return D(l.chartSitesOnChange(r))}),s()()(),n(35,"div",6)(36,"div",7)(37,"strong",19),c(38),h(39,"translate"),s(),n(40,"strong",9),c(41," *"),s()(),n(42,"div",10)(43,"p-select",20),h(44,"translate"),x("onChange",function(r){_(e);let l=p();return D(l.ccbFormOnChange(r))}),s()()(),n(45,"div",6)(46,"div",7)(47,"strong",21),c(48),h(49,"translate"),s(),n(50,"strong",9),c(51," *"),s()(),n(52,"div",10)(53,"p-select",22),h(54,"translate"),x("onChange",function(r){_(e);let l=p();return D(l.metaFieldsOnChange(r))}),s()()(),w(55,cr,7,10,"div",14)(56,pr,3,5,"div",14),n(57,"div",6)(58,"div",23),w(59,hr,3,8,"button",24),s()()()()}if(i&2){let e=p();o("formGroup",e.graphForm),a(4),o("ngIf",e.ChartId),a(7),o("ngIf",e.ChartId),a(2),y(f(49,Ze)),o("options",e.DefaultGraphsDataTypesOptions),a(),o("ngIf",e.PanelSeriesDisplay),a(4),v(d(19,33,"lblObserver")),a(5),y(f(50,Qe)),o("options",e.ObserverOptions),a(4),B("",d(28,35,"lblSelectText"),"\xA0",d(29,37,"lblSites")),a(6),y(f(51,Qe)),o("placeholder",O(d(34,39,"lblDefaultSelect")))("options",e.ccbSites),a(5),v(d(39,41,"lblForm")),a(5),y(f(52,Ze)),o("placeholder",O(d(44,43,"lblDefaultSelect")))("options",e.ccbForms),a(5),v(d(49,45,"lblWhatSpecificInformationTOGraph")),a(5),y(f(53,Ze)),o("placeholder",O(d(54,47,"lblDefaultSelect")))("options",e.metaFields),a(2),o("ngIf",e.graphSpecificValues),a(),o("ngIf",e.showFilters),a(3),o("ngIf",e.showDeleteSeriesButton)}}var Gt=(()=>{class i{_ccbContextService;_commonService;_translate;_confirmationService;ChartId;SeriesId;onSave=new ce;SeriesTypeId;translatedKeyValues;chartObj;spSiteId;spSiteUrl;graphForm;group={};loading=!1;msgs=R([]);selectedGraphType="";doesInitialLoadComplete=!0;chartSeriesObj;showDeleteSeriesButton=!1;showAdvancedFilters=!1;forPDReport=!1;ccbSites=[];selectedSite;ccbForms=[];selectedCCBForm;selectedFormId="";metaFields;selectedCCBField;ccbFieldChoices;selectedChoices;graphSpecificValues;ObserverOptions;DefaultGraphsDataTypesOptions;selectedDataTypeToGraph;SeriesDisplayOptions;PanelSeriesDisplay=!1;showFilters=!1;AccomplishmentFiltersColl;filteredColl;filterValues;constructor(e,t,r,l){this._ccbContextService=e,this._commonService=t,this._translate=r,this._confirmationService=l}ngOnInit(){this.init()}init=()=>u(this,null,function*(){yield this.getRequiredTranslations()});getRequiredTranslations(){return u(this,null,function*(){let e=yield K(this._translate.get(["lblAccomplishments","lblMsgCreationComplete","lblSelect","lblMsgDeletionComplete","lblActionDelete","lblMsgDeleteConfirm"]));e&&(this.translatedKeyValues=e,this.spSiteId=this._ccbContextService.getSPSiteId(),this.spSiteUrl=this._ccbContextService.getSPSiteUrl(),this.loadChoices(),this.buildFormGroup(),yield this.bindSeriesData(),yield this.manageDeleteSeriesButton())})}loadChoices(){this.ObserverOptions=[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3}],this.SeriesDisplayOptions=[{label:"Count",value:1},{label:"Sum",value:2},{label:"Average",value:3}],this.DefaultGraphsDataTypesOptions=[{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblAccomplishments","~Accomplishments~"),value:"ODSS-ACCOMPLISHMENTS"}]}buildFormGroup(){this.group.SeriesName=new C("",[]),this.group.SeriesDisplayId=new C("",[]),this.group.GraphsDataType=new C("",[]),this.group.IntervalSiteId=new C("",[]),this.group.IntervalFormId=new C("",[]),this.group.MetaFieldId=new C("",[]),this.group.MetaFieldChoices=new C("",[]),this.group.Observer=new C("",[]),this.graphForm=new $(this.group)}bindSeriesData(){return u(this,null,function*(){try{this.doesInitialLoadComplete=!0;let e=yield E.getChartSeriesBySeriesId(this.SeriesId);if(e&&e.length>0){this.chartSeriesObj=e[0];let t=yield N.getChartsByChartId(this.ChartId);t&&(this.chartObj=t,this.graphForm.controls.SeriesName.setValue(this.chartSeriesObj.SeriesName),this.graphForm.controls.Observer.setValue(this.chartSeriesObj.Observer),this.graphForm.controls.GraphsDataType.setValue("ODSS-ACCOMPLISHMENTS"),this.setSeriesDisplayId(),yield this.getCCBSites())}}catch(e){this.showError(e)}})}getCCBSites=()=>u(this,null,function*(){try{let e=this._ccbContextService.getSPParentSiteId();this.ccbSites=yield Le.getSiteAllWebs(),this.ccbSites&&this.ccbSites.length>0&&(I(this.chartSeriesObj.IntervalSiteId)?(this.selectedSite=this.ccbSites.filter(t=>t.SPSiteId==e)[0],this.graphForm.controls.IntervalSiteId.setValue(e),yield this.getMetaForms(e)):(this.selectedSite=this.ccbSites.filter(t=>t.SPSiteId==this.chartSeriesObj.IntervalSiteId)[0],this.graphForm.controls.IntervalSiteId.setValue(this.selectedSite),yield this.getMetaForms(this.chartSeriesObj.IntervalSiteId)))}catch(e){this.showError(e)}});getMetaForms(e){return u(this,null,function*(){try{let t=yield Fe.getMetaFormsBySiteId(e);t&&t.length>0&&(this.ccbForms=t,I(this.chartSeriesObj.IntervalFormId)||(this.selectedCCBForm=this.ccbForms.filter(r=>r.FormId==this.chartSeriesObj.IntervalFormId)[0],this.graphForm.controls.IntervalFormId.setValue(this.selectedCCBForm),this.selectedFormId=this.chartSeriesObj.IntervalFormId,yield this.getMetaFields(this.chartSeriesObj.IntervalFormId)))}catch(t){this.showError(t)}})}getMetaFields(e){return u(this,null,function*(){if(e)try{this.metaFields=[];let t=yield We.getMetaFieldsByFormId(e);t&&t.length>0&&(this.metaFields=t,this.metaFields.sort(function(r,l){var g=r.DisplayName.toUpperCase(),T=l.DisplayName.toUpperCase();return g<T?-1:g>T?1:0}),this.metaFields=this.metaFields.filter(r=>r.GraphShow==!0),I(this.chartSeriesObj.AttributeDisplayId)||(this.selectedCCBField=this.metaFields.filter(r=>r.DisplayId==this.chartSeriesObj.AttributeDisplayId)[0],this.graphForm.controls.MetaFieldId.setValue(this.selectedCCBField),!I(this.selectedCCBField)&&!I(this.selectedCCBField.Choices)&&(this.chartSeriesObj.AttributeValue==null&&(this.chartSeriesObj.AttributeValue=this.selectedCCBField.Choices),this.selectedChoices=this._commonService.convertPipedToArray(this.chartSeriesObj.AttributeValue),yield this.processMetaFieldsBinding(this.selectedCCBField))),this.show
1Filters=!0,yield this.loadAccomplishmentsFilters())}catch(t){this.showError(t)}})}setSeriesDisplayId(){this.chartSeriesObj.SeriesDisplayId>=1&&this.chartSeriesObj.SeriesDisplayId<=3&&this.graphForm.controls.SeriesDisplayId.setValue(this.chartSeriesObj.SeriesDisplayId),(this.chartObj.ChartTypeId==1||this.chartSeriesObj.SeriesDisplayId==2||this.chartSeriesObj.SeriesDisplayId==3)&&(this.PanelSeriesDisplay=!0)}processMetaFieldsBinding(e){return u(this,null,function*(){this.ccbFieldChoices=[],!I(e.Choices)&&e.Choices!=""?(this.graphSpecificValues=!0,this._commonService.convertPipedToArray(e.Choices).forEach(r=>{let l={label:r,value:r};this.ccbFieldChoices.push(l)})):e.MetaQuestionTypeId==8?(this.graphSpecificValues=!0,((yield ct.getLookupsValuesByFormFieldList({formId:e.FormId,fieldId:e.SPListField,listId:e.SPListId}))||[]).filter(l=>this._commonService.isLookupValueSelectable(l)).map(l=>({label:l.Value,value:l.Value})).forEach(l=>{let g={label:l.label,value:l.value};this.ccbFieldChoices.push(g)})):(this.graphSpecificValues=!1,this.chartSeriesObj.AttributeValue=null,this.chartSeriesObj.AttributeDisplayId=e.DisplayId,this.chartSeriesObj.SeriesGrouping=1,this.graphForm.patchValue({MetaFieldChoices:null}))})}getBorderStyleForGraphType(e){return e===this.selectedGraphType?"solid":""}saveSeries(){return u(this,null,function*(){if(this.chartSeriesObj.SeriesName=this.graphForm.controls.SeriesName.value,this.chartSeriesObj.IntervalSiteId=this.selectedSite.SPSiteId,this.chartSeriesObj.IntervalFormId=this.selectedCCBForm.FormId,this.chartSeriesObj.SeriesDisplayId=this.graphForm.controls.SeriesDisplayId.value,this.chartSeriesObj.Observer=this.graphForm.controls.Observer.value,this.selectedCCBField!=null&&(this.chartSeriesObj.AttributeDisplayId=this.selectedCCBField.DisplayId),this.graphSpecificValues){let e=this.getSelectedValuesToGraph();e.length>0?(this.chartSeriesObj.SeriesGrouping=2,this.chartSeriesObj.AttributeValue=this._commonService.convertArrayToPiped(e)):(this.chartSeriesObj.SeriesGrouping=1,this.chartSeriesObj.AttributeValue=null)}yield this.updateExistingGraphSeriesObject(this.chartSeriesObj)})}getSelectedValuesToGraph(){let e=this.graphForm.controls.MetaFieldChoices?.value??this.selectedChoices??[];return(Array.isArray(e)?e:[]).map(r=>typeof r=="string"?r:r?.value).filter(r=>r!=null&&String(r).trim()!=="").map(r=>String(r))}updateExistingGraphSeriesObject(e){return u(this,null,function*(){try{this.loading=!0;let t=yield E.putODSChartSeries(e.SeriesId,e);yield this.saveAccomplishmentFilters()}catch(t){this.showError(t)}finally{this.loading=!1}})}manageDeleteSeriesButton(){return u(this,null,function*(){if(this.ChartId)try{let e=yield E.getChartSeriesByChartId(this.ChartId);e&&e.length>1&&(this.showDeleteSeriesButton=!0)}catch(e){this.showError(e)}})}deleteSeries(){return u(this,null,function*(){this.SeriesId&&this._confirmationService.confirm({message:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblMsgDeleteConfirm","~Delete Confirm: ~")+this.chartSeriesObj.SeriesName+"?",header:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblActionDelete","~Delete~"),accept:()=>u(this,null,function*(){try{yield E.deleteODSChartSeries(this.SeriesId),this.onSave.emit(this.chartObj.ChartId)}catch(e){this.showError(e)}})})})}chartSitesOnChange(e){return u(this,null,function*(){this.selectedSite=e.value,yield this.getMetaForms(this.selectedSite.SPSiteId)})}ccbFormOnChange(e){return u(this,null,function*(){this.selectedCCBForm=e.value,this.selectedFormId=this.selectedCCBForm.FormId,yield this.getMetaFields(this.selectedFormId)})}metaFieldsOnChange(e){return u(this,null,function*(){this.selectedCCBField=e.value,yield this.processMetaFieldsBinding(this.selectedCCBField)})}loadAccomplishmentsFilters(){return u(this,null,function*(){try{let r=yield ke.getODSChartSeriesAccomplishmentFiltersBySeriesId(this.SeriesId);if(r&&r.length>0){this.AccomplishmentFiltersColl=r;var e={},t=function(l,g){e[l]=g};this.AccomplishmentFiltersColl.forEach(l=>{let g=this.metaFields.filter(oe=>oe.DisplayId==l.DisplayId)[0];var T=g.AttributeName,k=l.FilterValue;(this._commonService.getFieldType(g.MetaQuestionTypeId,g.AttributeTypeId)=="ListBox"||this._commonService.getFieldType(g.MetaQuestionTypeId,g.AttributeTypeId)=="DropDown"||this._commonService.getFieldType(g.MetaQuestionTypeId,g.AttributeTypeId)=="MultiSelect"||this._commonService.getFieldType(g.MetaQuestionTypeId,g.AttributeTypeId)=="Radio")&&(g.Choices!=""||g.MetaQuestionTypeId==8)&&(k=this._commonService.convertPipedToArray(k)),t(T,k)}),this.filterValues=e}}catch(r){this.showError(r)}})}onFilterClicked(e){this.filterValues=e}onClearFilterClicked(){this.filterValues=null}saveAccomplishmentFilters(){return u(this,null,function*(){try{if(I(this.filterValues))yield ke.deleteODSChartSeriesAccomplishmentFilter(this.SeriesId);else{let e=[];for(let t in this.filterValues){let r=this.filterValues[t];if(r!=""){let l=this.metaFields.filter(g=>g.AttributeName===t);if(l.length>0){Array.isArray(r)&&(r=this._commonService.convertArrayToPiped(r));let g={};g.SeriesId=this.SeriesId,g.DisplayId=l[0].DisplayId,g.FilterValue=r,e.push(g)}}}yield ke.deleteODSChartSeriesAccomplishmentFilter(this.SeriesId),yield ke.postAccomplishmentFilters(e)}}catch(e){this.showError(e)}})}showError(e){this.msgs.set([{severity:"error",summary:e.message}])}static \u0275fac=function(t){return new(t||i)(L(Q),L(A),L(q),L(z))};static \u0275cmp=Y({type:i,selectors:[["grapheditaccomplishments"]],inputs:{ChartId:"ChartId",SeriesId:"SeriesId"},outputs:{onSave:"onSave"},features:[U([A])],decls:4,vars:2,consts:[[3,"messages"],["pTemplate","icon"],["novalidate","","class","form-horizontal",3,"formGroup","ngSubmit",4,"ngIf"],["lucideCircleQuestionMark","","aria-hidden","true",1,"menu-icon"],["novalidate","",1,"form-horizontal",3,"ngSubmit","formGroup"],[1,"p-grid","p-fluid","form-group"],[1,"p-md-12"],[1,"p-col-12","p-md-4"],["id","lblLegendLabel",4,"ngIf"],[2,"color","#7A4FA0"],[1,"p-col-12","p-md-8"],["ariaLabelledBy","lblLegendLabel","type","text","pInputText","","formControlName","SeriesName",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","90%"],["id","lblDataSourceLabel",4,"ngIf"],["ariaLabelledBy","lblDataSourceLabel","formControlName","GraphsDataType","readonly","readonly",3,"options"],["class","p-md-12",4,"ngIf"],["id","lblObserverLabel"],["ariaLabelledBy","lblObserverLabel","formControlName","Observer",3,"options"],["id","lblSelectTextLabel"],["ariaLabelledBy","lblSelectTextLabel","optionLabel","SPSiteTitle","formControlName","IntervalSiteId",3,"onChange","placeholder","options"],["id","lblFormLAbel"],["ariaLabelledBy","lblFormLAbel","optionLabel","FormName","formControlName","IntervalFormId",3,"onChange","placeholder","options"],["id","lblWhatSpecificInformationTOGraphLabel"],["id","lblWhatSpecificInformationTOGraphLabel","optionLabel","DisplayName","formControlName","MetaFieldId",3,"onChange","placeholder","options"],[1,"p-col-12","submit-button-container"],["pButton","","type","button","severity","danger",3,"disabled","label","click",4,"ngIf"],["id","lblLegendLabel"],["id","lblDataSourceLabel"],["id","lblSeriesDisplayLabel"],["id","lblSeriesDisplayLabelctl","ariaLabelledBy","lblSeriesDisplayLabel","formControlName","SeriesDisplayId",3,"options"],["id","lblValuesToGraphLAbel"],["accessableMultiselect","","id","lblValuesToGraphLAbelid","ariaLabelledBy","lblValuesToGraphLAbel","formControlName","MetaFieldChoices",3,"ngModelChange","options","ngModel","panelStyle"],[1,"p-col-12","p-md-12"],[3,"onFilter","onClearFilter","formId","initialData","dataColl","showAdvanced","forPDReport"],["pButton","","type","button","severity","danger",3,"click","disabled","label"]],template:function(t,r){t&1&&(b(0,"app-messages",0),n(1,"p-confirmDialog"),w(2,nr,1,0,"ng-template",1),s(),w(3,dr,60,54,"form",2)),t&2&&(o("messages",r.msgs()),a(3),o("ngIf",r.graphForm))},dependencies:[se,ve,De,xe,W,re,ee,H,X,Z,ae,ie,te,ne,ue,ge,Oe,yt,me,J],encapsulation:2})}return i})();var Ke=()=>({"min-width":"90%","max-width":"90%"}),mr=()=>({"min-width":"90%"});function ur(i,m){i&1&&(Ie(),b(0,"svg",3))}function Sr(i,m){i&1&&(n(0,"strong",25),c(1),h(2,"translate"),h(3,"translate"),s()),i&2&&(a(),B("",d(2,2,"lblLegend")," ",d(3,4,"lblLabel")))}function Cr(i,m){i&1&&(n(0,"strong",26),c(1),h(2,"translate"),s()),i&2&&(a(),v(d(2,1,"lblDataSource")))}function br(i,m){if(i&1&&(n(0,"div",6)(1,"div",7)(2,"strong",27),c(3),h(4,"translate"),s()(),n(5,"div",10),b(6,"p-selectButton",28),s()()),i&2){let e=p(2);a(3),v(d(4,4,"lblSeriesDisplay")),a(3),y(f(6,mr)),o("options",e.SeriesDisplayOptions)}}function gr(i,m){if(i&1){let e=F();n(0,"button",29),h(1,"translate"),h(2,"translate"),x("click",function(){_(e);let r=p(2);return D(r.deleteSeries())}),s()}if(i&2){let e=p(2);o("label",_e("",d(1,4,"lblActionDelete")," \xA0",d(2,6,"lblData")))("disabled",e.graphForm.invali
1d)}}function vr(i,m){if(i&1){let e=F();n(0,"form",4),x("ngSubmit",function(){_(e);let r=p();return D(r.onSubmit(r.graphForm))}),n(1,"div",5)(2,"div",6)(3,"div",7),w(4,Sr,4,6,"strong",8),n(5,"strong",9),c(6," *"),s()(),n(7,"div",10),b(8,"input",11),s()(),n(9,"div",6)(10,"div",7),w(11,Cr,3,3,"strong",12),s(),n(12,"div",10),b(13,"p-select",13),s()(),w(14,br,7,7,"div",14),n(15,"div",6)(16,"div",7)(17,"strong",15),c(18),h(19,"translate"),s(),n(20,"strong",9),c(21," *"),s()(),n(22,"div",10)(23,"p-select",16),h(24,"translate"),M("ngModelChange",function(r){_(e);let l=p();return P(l.selectedIntervalFormId,r)||(l.selectedIntervalFormId=r),D(r)}),s()()(),n(25,"div",6)(26,"div",7)(27,"strong",17),c(28),h(29,"translate"),s(),n(30,"strong",9),c(31," *"),s()(),n(32,"div",10)(33,"p-select",18),M("ngModelChange",function(r){_(e);let l=p();return P(l.selectedPDTypeName,r)||(l.selectedPDTypeName=r),D(r)}),x("onChange",function(r){_(e);let l=p();return D(l.PDTypeNameOnChange(r))}),s()()(),n(34,"div",6)(35,"div",7)(36,"strong",19),c(37),h(38,"translate"),s(),n(39,"strong",9),c(40," *"),s()(),n(41,"div",10)(42,"p-select",20),M("ngModelChange",function(r){_(e);let l=p();return P(l.selectedPDSubCategory,r)||(l.selectedPDSubCategory=r),D(r)}),s()()(),n(43,"div",6)(44,"div",7)(45,"strong",21),c(46),h(47,"translate"),s()(),n(48,"div",10),b(49,"p-select",22),s()(),n(50,"div",6)(51,"div",7),c(52," \xA0 "),s(),n(53,"div",23),w(54,gr,3,8,"button",24),s()()()()}if(i&2){let e=p();o("formGroup",e.graphForm),a(4),o("ngIf",e.ChartId),a(7),o("ngIf",e.ChartId),a(2),y(f(39,Ke)),o("options",e.DefaultGraphsDataTypesOptions),a(),o("ngIf",e.PanelSeriesDisplay),a(4),v(d(19,29,"lblForm")),a(5),y(f(40,Ke)),o("placeholder",O(d(24,31,"lblDefaultSelect")))("options",e.ccbForms),j("ngModel",e.selectedIntervalFormId),a(5),v(d(29,33,"lblCategory")),a(5),y(f(41,Ke)),o("options",e.ccbPDTypes),j("ngModel",e.selectedPDTypeName),a(4),v(d(38,35,"lblSubCategory")),a(5),y(f(42,Ke)),o("options",e.ccbPDSubCategories),j("ngModel",e.selectedPDSubCategory),a(4),v(d(47,37,"lblPDService")),a(3),y(f(43,Ke)),o("options",e.PDServiceOptions),a(5),o("ngIf",e.showDeleteSeriesButton)}}var Nt=(()=>{class i{_ccbContextService;_commonService;_translate;_confirmationService;ChartId;SeriesId;onSave=new ce;SeriesTypeId;translatedKeyValues;chartObj;spSiteId;spSiteUrl;graphForm;group={};loading=!1;msgs=R([]);selectedGraphType="";chartSeriesObj;showDeleteSeriesButton=!1;ccbForms=[];ccbPDTypes;selectedPDTypeName;ccbPDSubCategories;selectedPDSubCategory;ProgramDeliveryOptionsObj;DefaultGraphsDataTypesOptions;selectedIntervalFormId;SeriesDisplayOptions;PanelSeriesDisplay=!1;PDServiceOptions;constructor(e,t,r,l){this._ccbContextService=e,this._commonService=t,this._translate=r,this._confirmationService=l}ngOnInit(){this.init()}init=()=>u(this,null,function*(){yield this.getRequiredTranslations()});getRequiredTranslations(){return u(this,null,function*(){let e=yield K(this._translate.get(["lblAccomplishments","lblMsgCreationComplete","lblSelect","lblMsgDeletionComplete","lblActionDelete","lblMsgDeleteConfirm","lblParticipantDescription","lblPDNumberServed","lblPDParticipants"]));this.translatedKeyValues=e,this.spSiteId=this._ccbContextService.getSPSiteId(),this.spSiteUrl=this._ccbContextService.getSPSiteUrl(),this.loadChoices(),this.buildFormGroup(),yield this.bindSeriesData(),yield this.manageDeleteSeriesButton()})}loadChoices(){this.SeriesDisplayOptions=[{label:"Count",value:1},{label:"Sum",value:2},{label:"Average",value:3}],this.DefaultGraphsDataTypesOptions=[{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblParticipantDescription","~Participant Description~"),value:"ODSS-PARTICIPANTSDESCRIPTION"}],this.PDServiceOptions=[{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblPDNumberServed","~Number Served~"),value:"Number Served"},{label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblPDParticipants","~New Participants~"),value:"New Participants"}]}buildFormGroup(){this.group.SeriesName=new C("",[]),this.group.SeriesDisplayId=new C("",[]),this.group.GraphsDataType=new C("",[]),this.group.IntervalSiteId=new C("",[]),this.group.IntervalFormId=new C("",[]),this.group.PDTypeName=new C("",[]),this.group.PDSubCategory=new C("",[]),this.group.PDService=new C("",[]),this.graphForm=new $(this.group)}bindSeriesData(){return u(this,null,function*(){try{let e=yield E.getChartSeriesBySeriesId(this.SeriesId);this.chartSeriesObj=e[0];let t=yield N.getChartsByChartId(this.ChartId);this.chartObj=t,this.graphForm.controls.SeriesName.setValue(this.chartSeriesObj.SeriesName),this.graphForm.controls.GraphsDataType.setValue("ODSS-PARTICIPANTSDESCRIPTION"),this.setSeriesDisplayId();let r=this.chartSeriesObj.IntervalFormId;this.ccbForms=[];let l=yield Fe.getMetaFormsBySiteId(this.spSiteId);this.ccbForms=this.populateCCBForms(l),this.graphForm.controls.IntervalFormId.setValue(r),this.graphForm.controls.PDService.setValue("Number Served"),this.ccbPDTypes=[];let g=yield Je.getProgramDeliveryTypesBySiteId(this.spSiteId);if(this.setccbPDTypes(g),this.ccbPDTypes.length>0&&(this.selectedPDTypeName=this.ccbPDTypes[0],this.setPDSubCategories(this.ccbPDTypes[0].DeliveryTypeId),this.graphForm.controls.PDSubCategory.setValue(this.chartSeriesObj.CategoryId),this.graphForm.controls.PDService.setValue(this.chartSeriesObj.ProgramDeliveryServiceColumnName)),!I(this.chartSeriesObj.CategoryId)){let T=yield It.getProgramDeliveryOption(this.chartSeriesObj.CategoryId);this.ProgramDeliveryOptionsObj=T[0],this.graphForm.controls.PDTypeName.setValue(this.ProgramDeliveryOptionsObj.ProgramDeliveryTypeId),this.graphForm.controls.PDSubCategory.setValue(this.chartSeriesObj.CategoryId)}}catch(e){this.showError(e)}})}populateCCBForms(e){let t=[];return e&&e.length>0&&e.forEach(r=>{let l=r.FormName,g=r.FormId,T={label:l,value:g};t.push(T)}),t}setccbPDTypes(e){this.ccbPDTypes=[],e.forEach(t=>{t.label=t.DeliveryTypeName,t.value=t.DeliveryTypeId}),this.ccbPDTypes=e}setPDSubCategories(e){let t=null;
1this.ccbPDTypes.forEach(r=>{r.DeliveryTypeId==e&&(t=r)}),t&&!I(t.ProgramDeliveryOptions)&&(this.ccbPDSubCategories=t.ProgramDeliveryOptions,this.ccbPDSubCategories.sort(function(r,l){return r.OrderNumber>l.OrderNumber?1:l.OrderNumber>r.OrderNumber?-1:0}),this.ccbPDSubCategories.forEach(r=>{r.label=r.ProgramDeliveryOptionName,r.value=r.ProgramDeliveryOptionId}),this.ccbPDSubCategories.length>0&&(this.selectedPDSubCategory=this.ccbPDSubCategories[0]))}setSeriesDisplayId(){this.chartSeriesObj.SeriesDisplayId>=1&&this.chartSeriesObj.SeriesDisplayId<=3&&this.graphForm.controls.SeriesDisplayId.setValue(this.chartSeriesObj.SeriesDisplayId),(this.chartObj.ChartTypeId==1||this.chartSeriesObj.SeriesDisplayId==2||this.chartSeriesObj.SeriesDisplayId==3)&&(this.PanelSeriesDisplay=!0)}saveSeries(){return u(this,null,function*(){this.chartSeriesObj.SeriesName=this.graphForm.controls.SeriesName.value,this.chartSeriesObj.IntervalFormId=this.graphForm.controls.IntervalFormId.value,this.chartSeriesObj.SeriesDisplayId=this.graphForm.controls.SeriesDisplayId.value,this.chartSeriesObj.CategoryId=this.graphForm.controls.PDSubCategory.value,this.chartSeriesObj.ProgramDeliveryServiceColumnName=this.graphForm.controls.PDService.value,yield this.updateExistingGraphSeriesObject(this.chartSeriesObj)})}updateExistingGraphSeriesObject(e){return u(this,null,function*(){this.loading=!0;try{yield E.putODSChartSeries(e.SeriesId,e)}catch(t){this.showError(t)}finally{this.loading=!1}})}manageDeleteSeriesButton(){return u(this,null,function*(){if(this.ChartId)try{let e=yield E.getChartSeriesByChartId(this.ChartId);e&&e.length>1&&(this.showDeleteSeriesButton=!0)}catch(e){this.showError(e)}})}deleteSeries(){return u(this,null,function*(){this.SeriesId&&this._confirmationService.confirm({message:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblMsgDeleteConfirm","~Delete Confirm: ~")+this.chartSeriesObj.SeriesName+"?",header:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblActionDelete","~Delete~"),accept:()=>u(this,null,function*(){try{yield E.deleteODSChartSeries(this.SeriesId),this.onSave.emit(this.chartObj.ChartId)}catch(e){this.showError(e)}})})})}PDTypeNameOnChange(e){let t=e.value;this.setPDSubCategories(t)}showError=e=>{this.msgs.set([{severity:"error",summary:e}])};static \u0275fac=function(t){return new(t||i)(L(Q),L(A),L(q),L(z))};static \u0275cmp=Y({type:i,selectors:[["grapheditpd"]],inputs:{ChartId:"ChartId",SeriesId:"SeriesId"},outputs:{onSave:"onSave"},features:[U([A])],decls:4,vars:2,consts:[[3,"messages"],["pTemplate","icon"],["novalidate","","class","form-horizontal",3,"formGroup","ngSubmit",4,"ngIf"],["lucideCircleQuestionMark","","aria-hidden","true",1,"menu-icon"],["novalidate","",1,"form-horizontal",3,"ngSubmit","formGroup"],[1,"p-grid","p-fluid","form-group"],[1,"p-md-12"],[1,"p-col-12","p-md-4"],["id","lblLegendLabel",4,"ngIf"],[2,"color","#7A4FA0"],[1,"p-col-12","p-md-8"],["ariaLabelledBy","lblLegendLabel","type","text","pInputText","","formControlName","SeriesName",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","90%"],["id","lblDataSourceLAbel",4,"ngIf"],["ariaLabelledBy","lblDataSourceLAbel","formControlName","GraphsDataType","readonly","readonly",3,"options"],["class","p-md-12",4,"ngIf"],["id","lblFormLAbel"],["ariaLabelledBy","lblFormLAbel","formControlName","IntervalFormId",3,"ngModelChange","placeholder","options","ngModel"],["id","lblCategoryLabel"],["ariaLabelledBy","lblCategoryLabel","formControlName","PDTypeName",3,"ngModelChange","onChange","options","ngModel"],["id","lblSubCategoryLabel"],["ariaLabelledBy","lblSubCategoryLabel","formControlName","PDSubCategory",3,"ngModelChange","options","ngModel"],["id","lblPDServiceLabel"],["ariaLabelledBy","lblPDServiceLabel","formControlName","PDService",3,"options"],[1,"p-col-12","submit-button-container"],["pButton","","type","button","severity","danger",3,"disabled","label","click",4,"ngIf"],["id","lblLegendLabel"],["id","lblDataSourceLAbel"],["id","lblSeriesDisplayLabel"],["id","lblSeriesDisplayLabelctl","ariaLabelledBy","lblSeriesDisplayLabel","formControlName","SeriesDisplayId",3,"options"],["pButton","","type","button","severity","danger",3,"click","disabled","label"]],template:function(t,r){t&1&&(b(0,"app-messages",0),n(1,"p-confirmDialog"),w(2,ur,1,0,"ng-template",1),s(),w(3,vr,55,44,"form",2)),t&2&&(o("messages",r.msgs()),a(3),o("ngIf",r.graphForm))},dependencies:[se,ve,De,xe,W,re,ee,H,X,Z,ae,ie,te,ne,ue,ge,me,J],encapsulation:2})}return i})();var Ir=["cmpInfo"],fr=["cmpNewSeries"],yr=["focusErrors"],_r=["cmpIndicators"],Dr=["cmpKeyEvents"],xr=["cmpAccomplishments"],wr=["cmpPD"],Tr=()=>({width:"90%"});function Fr(i,m){if(i&1&&(n(0,"p-tab",17),c(1),s()),i&2){let e=m.$implicit,t=m.index,r=p(2);o("value",r.getSeriesTabValue(t))("disabled",r.isNewGraph),a(),v(e.header)}}function Or(i,m){if(i&1&&(n(0,"p-tab",17),c(1),s()),i&2){let e=p(2);o("value",e.legendTabValue)("disabled",e.isNewGraph),a(),v(e.otherTabItems[3])}}function Lr(i,m){if(i&1){let e=F();n(0,"div")(1,"grapheditindicators",33,2),x("onSave",function(r){_(e);let l=p(3);return D(l.onGraphRefresh(r))}),s()()}if(i&2){let e=p().index,t=p(2);a(),o("ChartId",t.chartId)("SeriesId",t.chartSeriesDatas[e].SeriesId)}}function Er(i,m){if(i&1){let e=F();n(0,"div")(1,"grapheditkeyevents",33,3),x("onSave",function(r){_(e);let l=p(3);return D(l.onGraphRefresh(r))}),s()()}if(i&2){let e=p().index,t=p(2);a(),o("ChartId",t.chartId)("SeriesId",t.chartSeriesDatas[e].SeriesId)}}function Gr(i,m){if(i&1){let e=F();n(0,"div")(1,"grapheditaccomplishments",33,4),x("onSave",function(r){_(e);let l=p(3);return D(l.onGraphRefresh(r))}),s()()}if(i&2){let e=p().index,t=p(2);a(),o("ChartId",t.chartId)("SeriesId",t.chartSeriesDatas[e].SeriesId)}}function Nr(i,m){if(i&1){let e=F();n(0,"div")(1,"grapheditpd",33,5),x("onSave",function(r){_(e);let l=p(3);return D(l.onGraphRefresh(r))}),s()()}if(i&2){let e=p().index,t=p(2);a(),o("ChartId",t.chartId)("SeriesId",t.chartSeriesDatas[e].SeriesId)}}function Ar(i,m){if(i&1&&(n(0,"p-tabpanel",21),w(1,Lr,3,2,"div",32)(2,Er,3,2,"div",32)(3,Gr,3,2,"div",32)(4,Nr,3,2,"div",32),s()),i&2){let e=m.index,t=p(2);o("value",t.getSeriesTabValue(e)),a(),o("ngIf",t.chartSeriesDatas[e].SeriesTypeId===1),a(),o("ngIf",t.chartSeriesDatas[e].SeriesTypeId===2),a(),o("ngIf",t.chartSeriesDatas[e].SeriesTypeId===3||t.chartSeriesDatas[e].SeriesTypeId===6||t.chartSeriesDatas[e].SeriesTypeId===9),a(),o("ngIf",t.chartSeriesDatas[e].SeriesTypeId===4||t.chartSeriesDatas[e].SeriesTypeId===7||t.chartSeriesDatas[e].SeriesTypeId===10)}}function Br(i,m){if(i&1&&(n(0,"div",15)(1,"div",35),c(2),s(),n(3,"div",29),b(4,"input",36),s()()),i&2){let e=m.$implicit;a(2),be(" ",e.DataLabel," "),a(2),o("formControlName",O(e.LegendId))}}function Vr(i,m){if(i&1&&(n(0,"p-tabpanel",21)(1,"div",26)(2,"div",15)(3,"div",27)(4,"strong"),c(5),h(6,"translate"),s()(),n(7,"div",29)(8,"strong"),c(9),h(10,"translate"),h(11,"translate"),s()()(),w(12,Br,5,3,"div",34),n(13,"div",15)(14,"div",8)(15,"strong"),c(16),h(17,"translate"),s()()()()()),i&2){let e=p(2);o("value",e.legendTabValue),a(5),be("",d(6,6,"lblDataLabel")," "),a(4),B("",d(10,8,"lblLegend"),"\xA0",d(11,10,"lblLabel")),a(3),o("ngForOf",e.chartLegendData),a(4),be("*",d(17,12,"lblThirtyCharLimitText"))}}function jr(i,m){if(i&1){let e=F();n(0,"div",37),b(1,"div",38),n(2,"div",39)(3,"button",40),h(4,"translate"),x("click",function(r){_(e);let l=p(2);return D(l.saveGraph(r,!1))}),s(),n(5,"button",40),h(6,"translate"),x("click",function(r){_(e);let l=p(2);return D(l.saveGraph(r,!0))}),s(),n(7,"button",41),h(8,"translate"),x("click",function(){_(e);let r=p(2);return D(r.goToGraph())}),s()()()}if(i&2){let e=p(2);a(3),o("label",O(d(4,9,"lblUpdateGraph")))("disabled",e.graphForm.invali
1d||e.isNewGraph),a(2),o("label",O(d(6,11,"lblSaveAndGoToGraph")))("disabled",e.graphForm.invalid||e.isNewGraph),a(2),o("label",O(d(8,13,"lblReturnToGraph")))("disabled",e.graphForm.invalid||e.isNewGraph)}}function Pr(i,m){if(i&1){let e=F();n(0,"form",14),x("ngSubmit",function(){_(e);let r=p();return D(r.onSubmit(r.graphForm))}),n(1,"div",15)(2,"p-tabs",16),M("valueChange",function(r){_(e);let l=p();return P(l.activeTabIndex,r)||(l.activeTabIndex=r),D(r)}),n(3,"p-tablist")(4,"p-tab",17),c(5),s(),n(6,"p-tab",17),c(7),s(),w(8,Fr,2,3,"p-tab",18),n(9,"p-tab",17),c(10),s(),w(11,Or,2,3,"p-tab",19),n(12,"p-tab",17),c(13),s()(),n(14,"div",20)(15,"p-tabpanels")(16,"p-tabpanel",21)(17,"graphnewseries",22),x("onSave",function(r){_(e);let l=p();return D(l.onNewGraphSeriesSave(r))}),s()(),n(18,"p-tabpanel",21)(19,"grapheditinfo",23,0),x("onSave",function(r){_(e);let l=p();return D(l.onNewGraphSeriesSave(r))}),s()(),w(21,Ar,5,5,"p-tabpanel",24),n(22,"p-tabpanel",21)(23,"graphnewseries",22,1),x("onSave",function(r){_(e);let l=p();return D(l.onNewGraphSeriesSave(r))}),s()(),w(25,Vr,18,14,"p-tabpanel",25),n(26,"p-tabpanel",21)(27,"div",26)(28,"div",15)(29,"div",27)(30,"strong",28),c(31),h(32,"translate"),s()(),n(33,"div",29),b(34,"p-select",30),s()()()()(),w(35,jr,9,15,"div",31),s()()()()}if(i&2){let e=p();o("formGroup",e.graphForm),a(2),j("value",e.activeTabIndex),o("pt",e.tabsVerticalPt),a(2),o("value",0)("disabled",!e.isNewGraph),a(),v(e.otherTabItems[0]),a(),o("value",1)("disabled",e.isNewGraph),a(),v(e.otherTabItems[1]),a(),o("ngForOf",e.tabItems),a(),o("value",e.addDataTabValue)("disabled",e.isNewGraph),a(),v(e.otherTabItems[2]),a(),o("ngIf",e.showTabEditLegend),a(),o("value",e.comparisonTabValue)("disabled",e.isNewGraph),a(),v(e.otherTabItems[5]),a(3),o("value",0),a(),o("ChartId",e.chartId)("FolderId",e.folderId),a(),o("value",1),a(),o("ChartId",e.chartId),a(2),o("ngForOf",e.tabItems),a(),o("value",e.addDataTabValue),a(),o("ChartId",e.chartId)("FolderId",e.folderId),a(2),o("ngIf",e.showTabEditLegend),a(),o("value",e.comparisonTabValue),a(5),v(d(32,33,"lblSelectComparisonGraph")),a(3),y(f(35,Tr)),o("options",e.comparisonChartOptions),a(),o("ngIf",!e.isNewGraph)}}var Zo=(()=>{class i{_router;_ccbContextService;_commonService;_breadcrumbService;_translate;_activatedRoute;grapheditinfo;graphnewseries;focusErrors;grapheditindicators;graphKeyEventCmps;graphAccomplishmentCmps;graphPDCmps;chartId;folderId;newChartCreationObj={};newChartSeriesCreationObj={};chartLegendData;chartObj;spSiteId;spSiteUrl;graphForm;group={};translatedKeyValues;menuitems;msgs=R([]);dataTypesToGraphList=[];isNewGraph=!0;isDuplicateGraphTitle=!1;loading=!0;titleError=!1;chartSeriesDatas;tabItems;otherTabItems=[];activeTabIndex=0;showTabEditLegend=!1;tabsVerticalPt=_t;chartTemplates;graphsTemplateList=[];selectedTemplateId;chartWithOutTemplates;comparisonChartOptions=[];constructor(e,t,r,l,g,T){this._router=e,this._ccbContextService=t,this._commonService=r,this._breadcrumbService=l,this._translate=g,this._activatedRoute=T,this.chartId=this._activatedRoute.snapshot.params.id,this.folderId=this._activatedRoute.snapshot.params.folderid}ngOnInit(){this.init()}init=()=>u(this,null,function*(){(yield this._ccbContextService.checkPermission("Create"))||(yield this._ccbContextService.checkPermission("Update"))?yield this.getRequiredTranslations():this._router.navigateByUrl(this._ccbContextService.getAppCCBRoute()+"graphs")});getRequiredTranslations(){return u(this,null,function*(){let e=yield K(this._translate.get(["lblGraph","lblForm","lblCreateNewGraph","lblEditBasicInfo","lblEditData","lblAddAdditionalData","lblAddAdditionalSites","lblFormatGraph","lblAddComparisonGraph","lblSelect","lblEditLegend","lblMsgUpdateComplete","lblGraphNone"]));this.translatedKeyValues=e,this._breadcrumbService.setItems([{labelKeys:["lblGraph","lblForm"]}]);let t=this._commonService.newEmptyGuid();this.chartId&&this.chartId!=t?(this.isNewGraph=!1,this.activeTabIndex=1):(this.isNewGraph=!0,this.activeTabIndex=0),this.chartId===t&&!I(this.folderId)&&(this.isNewGraph=!0,this.activeTabIndex=0,this.chartId=null),this.spSiteId=this._ccbContextService.getSPSiteId(),this.spSiteUrl=this._ccbContextService.getSPSiteUrl(),yield this.getChartSeries()})}getChartSeries(){return u(this,null,function*(){if(this.buildFormGroup(),this.chartId)try{let e=yield E.getChartSeriesByChartId(this.chartId);e&&(this.chartSeriesDatas=e,this.loadTabMenus(),yield this.getChartData())}catch(e){this.showError(e)}else this.loadTabMenus()})}loadTabMenus(){this.tabItems=[],this.chartSeriesDatas&&this.chartSeriesDatas.length>
10&&this.chartSeriesDatas.forEach(e=>{let t=e.SeriesName;this.tabItems.push({header:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblEditData","~Edit Data~")+" "+t,type:"EditData",icon:"",command:r=>this.tabItemEditDataOnClick(e.SeriesId),disabled:!1})}),this.otherTabItems.push(this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblCreateNewGraph","~Create New Graph~")),this.otherTabItems.push(this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblEditBasicInfo","~Edit Basic Info")),this.otherTabItems.push(this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblAddAdditionalData","~Add Additional Data~")),this.otherTabItems.push(this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblEditLegend","~Edit Legend~")),this.otherTabItems.push(this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblFormatGraph","~Format Graph~")),this.otherTabItems.push(this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblAddComparisonGraph","~Add Comparison Graph~"))}tabItemEditDataOnClick(e){}getSeriesTabValue(e){return 2+e}get addDataTabValue(){return 2+(this.tabItems?.length??0)}get legendTabValue(){return this.addDataTabValue+1}get comparisonTabValue(){return this.showTabEditLegend?this.legendTabValue+1:this.addDataTabValue+1}getChartData(){return u(this,null,function*(){try{let e=yield N.getChartsByChartId(this.chartId);e&&(this.chartObj=e,yield this.getComparisonCharts())}catch(e){this.showError(e)}})}getComparisonCharts(){return u(this,null,function*(){try{let e=yield N.getChartsWithNoTemplatesBySiteId(this.spSiteId);e&&(this.chartWithOutTemplates=e),this.loadComparisonChartOptions(),yield this.loadChartData()}catch(e){this.showError(e)}finally{this.loading=!1}})}loadComparisonChartOptions(){if(this.chartWithOutTemplates&&this.chartWithOutTemplates.length>0){let e={label:this._commonService.getKeyValueFromJson(this.translatedKeyValues,"lblGraphNone","~No Graph~"),value:""};this.comparisonChartOptions.push(e),this.chartWithOutTemplates.forEac
1h(t=>{if(t.ChartId!=this.chartId){let r=t.Title,l=t.ChartId,g={label:r,value:l};this.comparisonChartOptions.push(g)}})}}loadChartData(){return u(this,null,function*(){this.chartObj&&(yield this.setLegendLabelTabData(),this.setPaletteType(),this.setComparisonChartId())})}setLegendLabelTabData(){return u(this,null,function*(){if(this.chartObj.ChartTypeId==2||this.chartObj.ChartTypeId==3||this.chartObj.ChartTypeId==4){this.showTabEditLegend=!0;try{let e=yield vt.getPieChartLegendDataByChartId(this.chartId);e&&e.length>0&&(this.chartLegendData=e,this.chartLegendData.forEach(t=>{this.group[t.LegendId]=new C(t.LegendLabel)}))}catch(e){this.showError(e)}}})}setPaletteType(){this.chartObj&&this.graphForm.controls.Palette.setValue(this.chartObj.Palette)}setComparisonChartId(){I(this.chartObj.ComparisonChartId)?this.graphForm.controls.ComparisonChartId.setValue(""):this.graphForm.controls.ComparisonChartId.setValue(this.chartObj.ComparisonChartId)}buildFormGroup(){this.group.Palette=new C("Default",[]),this.group.ComparisonChartId=new C("",[]),this.graphForm=new $(this.group)}saveChart(e){return u(this,null,function*(){try{yield N.putODSChart(this.chartId,this.chartObj),this.msgs.set([{severity:"success",summary:"lblMsgUpdateComplete",detail:""}])}catch(t){this.showError(t)}})}saveLegendData(){return u(this,null,function*(){if(this.chartLegendData!=null)try{for(let e of this.chartLegendData)e.LegendLabel=this.group[e.LegendId].value,yield N.putODSChartLegendData(this.chartId,e)}catch(e){this.showError(e)}})}saveGraph(e,t){return u(this,null,function*(){if(this.isNewGraph)return;if(this.grapheditinfo.graphForm.controls.Title.value.length>100){this.msgs.set([{severity:"error",summary:"Title field limit 75 characters"}]),this.focusErrors?.nativeElement?.focus();return}this.chartSeriesDatas?.length>1&&(this.grapheditinfo.chartObj.IsGrouped=!0),this.grapheditinfo.chartObj.Palette=this.graphForm.controls.Palette.value;let l=this.graphForm.controls.ComparisonChartId.value;this.grapheditinfo.chartObj.ComparisonChartId=l||null;try{yield this.grapheditinfo.saveGraph(),yield Promise.all([...this.grapheditindicators.map(g=>g.saveSeries()),...this.graphKeyEventCmps.map(g=>g.saveSeries()),...this.graphAccomplishmentCmps.map(g=>g.saveSeries()),...this.graphPDCmps.map(g=>g.saveSeries())]),yield this.graphnewseries?.saveGraph(),this.showTabEditLegend&&(yield this.saveLegendData()),this.msgs.set([{severity:"success",summary:"lblMsgUpdateComplete",detail:""}]),t&&this._router.navigateByUrl(this._ccbContextService.getAppCCBRoute()+"graphdisplay/"+this.chartId)}catch(g){this.showError(g)}})}goToGraph(){this._router.navigateByUrl(this._ccbContextService.getAppCCBRoute()+"graphdisplay/"+this.chartId)}onNewGraphSeriesSave(e){this.chartId=e,this.activeTabIndex=1,this.ngOnInit(),this._router.navigateByUrl(this._ccbContextService.getAppCCBRoute()+"graphform/"+this.chartId)}onGraphRefresh(e){this.chartId=e,this.activeTabIndex=1,this.ngOnInit()}showError=e=>{this.msgs.set([{severity:"error",summary:e}])};static \u0275fac=function(t){return new(t||i)(L(at),L(Q),L(A),L(nt),L(q),L(rt))};static \u0275cmp=Y({type:i,selectors:[["graph-form"]],viewQuery:function(t,r){if(t&1&&et(Ir,5)(fr,5)(yr,5)(_r,5)(Dr,5)(xr,5)(wr,5),t&2){let l;fe(l=ye())&&(r.grapheditinfo=l.first),fe(l=ye())&&(r.graphnewseries=l.first),fe(l=ye())&&(r.focusErrors=l.first),fe(l=ye())&&(r.grapheditindicators=l),fe(l=ye())&&(r.graphKeyEventCmps=l),fe(l=ye())&&(r.graphAccomplishmentCmps=l),fe(l=ye())&&(r.graphPDCmps=l)}},features:[U([z])],decls:15,vars:8,consts:[["cmpInfo",""],["cmpNewSeries",""],["cmpIndicators",""],["cmpKeyEvents",""],["cmpAccomplishments",""],["cmpPD",""],[1,"p-grid","admin"],[1,"p-col-12","p-fluid"],[1,"p-col-12","p-md-12"],[1,"card","card-w-title"],[1,"page-header"],[3,"messages"],["id","confirmdialog"],["novalidate","","class","form-horizontal",3,"formGroup","ngSubmit",4,"ngIf"],["novalidate","",1,"form-horizontal",3,"ngSubmit","formGroup"],[1,"p-md-12"],["scrollable","",3,"valueChange","value","pt"],[3,"value","disabled"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled",4,"ngIf"],[1,"graph-form-tab-content"],[3,"value"],[3,"onSave","ChartId","FolderId"],[3,"onSave","ChartId"],[3,"value",4,"ngFor","ngForOf"],[3,"value",4,"ngIf"],[1,"p-grid","p-fluid","form-group"],[1,"p-col-12","p-md-4"],["id","lblSelectComparisonGraphLAbel"],[1,"p-col-12","p-md-8"],["ariaLabelledBy","lblSelectComparisonGraphLAbel","optionLabel","label","optionValue","value","formControlName","ComparisonChartId",3,"options"],["class","graph-form-actions flex flex-wrap items-center gap-1",4,"ngIf"],[4,"ngIf"],[3,"onSave","ChartId","SeriesId"],["class","p-md-12",4,"ngFor","ngForOf"],["id","LegendIdLabel",1,"p-col-12","p-md-4"],["ariaLabelledBy","LegendIdLabel","type","text","pInputText","",1,"p-inputtext","p-corner-all","p-state-default","p-component",2,"width","90%",3,"formControlName"],[1,"graph-form-actions","flex","flex-wrap","items-center","gap-1"],["aria-hidden","true",1,"hidden","md:block","md:basis-1/3","md:shrink-0"],[1,"submit-button-container","basis-full","md:basis-2/3","md:shrink-0"],["pButton","","type","button",3,"click","disabled","label"],["pButton","","type","button","severity","secondary",3,"click","disabled","label"]],template:function(t,r){t&1&&(n(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"div",10),b(5,"backbutton"),n(6,"h1"),c(7),h(8,"translate"),h(9,"translate"),b(10,"app-sectionhelp-link"),s()(),b(11,"app-messages",11)(12,"p-confirmDialog",12)(13,"hr"),w(14,Pr,36,36,"form",13),s()()()()),t&2&&(a(7),B("",d(8,4,"lblGraph")," ",d(9,6,"lblForm")),a(4),o("messages",r.msgs()),a(3),o("ngIf",r.graphForm))},dependencies:[se,pt,me,ve,re,ee,H,X,Z,Gt,Ot,Tt,Et,Nt,wt,ne,tt,W,ae,ie,te,ht,ue,gt,mt,bt,Ct,ut,St,J],encapsulation:2})}return i})();export{Zo as default};

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.