1"use strict";(self.webpackChunkdemo1=self.webpackChunkdemo1||[]).push([[392],{4995:(w,U,n)=>{n.d(U,{n:()=>v});var f=n(520),u=n(2340),y=n(5e3);let v=(()=>{class p{constructor(g){this.apiUrl=`${u.N.apiUrl}/containers/storage/download`,this.http=new f.eN(g)}downloadFileWithContainer(g){return this.http.get(`${this.apiUrl}/${g}`,{responseType:"blob"})}}return p.\u0275fac=function(g){return new(g||p)(y.LFG(f.jN))},p.\u0275prov=y.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),p})()},2271:(w,U,n)=>{n.d(U,{m:()=>Y});var f=n(9808),u=n(2042),y=n(3075),v=n(4107),p=n(6856),_=n(7531),g=n(7423),I=n(508),C=n(7621),D=n(5245),h=n(5899),q=n(9943),x=n(5e3);let Y=(()=>{class S{}return S.\u0275fac=function(k){return new(k||S)},S.\u0275mod=x.oAB({type:S}),S.\u0275inj=x.cJS({imports:[f.ez,u.mH,q.q,y.UX,y.u5,v.LD,p.FA,_.c,g.ot,I.XK,C.M,D.Ps,h.Cv]}),S})()},7392:(w,U,n)=>{n.r(U),n.d(U,{DrugSupplyModule:()=>pe});var f=n(7621),u=n(3075),y=n(7442),v=n(9826),p=n(4107),_=n(6856),g=n(7531),I=n(7423),C=n(508),D=n(9808),h=n(8279),q=n(5245),x=n(6087),Y=n(5899),S=n(4847),E=n(5226),k=n.n(E),z=n(727),X=n(5439),N=n.n(X),B=n(1227),t=n(5e3),J=n(4995),tt=n(2340),et=n(520);let M=(()=>{class r{constructor(e){this.http=e,this.apiUrl=`${tt.N.apiUrl}/DrugSupplyReportings`}getDrugReport(e){return this.http.post(`${this.apiUrl}/getRawData`,e)}getDrugSupplyCount(e){return this.http.post(`${this.apiUrl}/getDrugSupplyCount`,e)}createDrugSupply(e){return this.http.post(this.apiUrl,e)}getDrugSupply(e){const i=`${this.apiUrl}?filter=${JSON.stringify(e)}`;return this.http.get(i)}}return r.\u0275fac=function(e){return new(e||r)(t.LFG(et.eN))},r.\u0275prov=t.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),r})();var P=n(89),Q=n(6115),$=n(7665),rt=n(1225),O=n(4946),it=n(9783),b=n(7120),H=n(9667),F=n(7322),L=n(9814);function ot(r,l){1&r&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please Select report type "),t.qZA()())}function at(r,l){if(1&r&&(t.TgZ(0,"mat-option",26),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.districtName," ")}}function lt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1,"District is required!!!"),t.qZA())}function nt(r,l){if(1&r&&(t.TgZ(0,"mat-option",26),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.Q6J("value",e.id),t.xp6(1),t.hij(" ",e.blockName," ")}}function st(r,l){if(1&r){const e=t.EpF();t.TgZ(0,"mat-option",29),t.NdJ("click",function(){const a=t.CHM(e).$implicit,s=t.oxw(2);return t.KtG(s.designationHandler(a))}),t._uU(1),t.qZA()}if(2&r){const e=l.$implicit;t.Q6J("value",e.value),t.xp6(1),t.hij(" ",e.label," ")}}function ut(r,l){1&r&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please Select designation for cumulative report "),t.qZA()())}function dt(r,l){if(1&r&&(t.TgZ(0,"div",11)(1,"mat-form-field",12)(2,"mat-label"),t._uU(3,"Designation"),t.qZA(),t.TgZ(4,"mat-select",27),t.YNc(5,st,2,2,"mat-option",28),t.qZA()(),t.YNc(6,ut,3,0,"div",10),t.qZA()),2&r){const e=t.oxw();let i;t.xp6(5),t.Q6J("ngForOf",e.rolesHirechie),t.xp6(1),t.Q6J("ngIf",(null==(i=e.form.get("roleBy"))?null:i.hasError("required"))&&(null==(i=e.form.get("actionType"))?null:i.touched))}}function ct(r,l){1&r&&t._UZ(0,"mat-error")}function mt(r,l){if(1&r){const e=t.EpF();t.TgZ(0,"button",30),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.filterCoughReport())}),t._uU(1,"View Report"),t.qZA()}if(2&r){const e=t.oxw();t.Q6J("disableRipple",!1)("disabled",e.form.invalid)}}function pt(r,l){if(1&r){const e=t.EpF();t.TgZ(0,"button",30),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.generateCoughReport())}),t._uU(1,"Download Report"),t.qZA()}if(2&r){const e=t.oxw();t.Q6J("disableRipple",!1)("disabled",e.form.invalid)}}let gt=(()=>{class r{constructor(e,i,o,a,s,d,m){this._auth=e,this.fb=i,this.drugSupplyService=o,this.fileLibraryServices=a,this.districtService=s,this.blockService=d,this.changeDetectedRef=m,this.dataChanged=new t.vpe,this.title="",this.formType="",this.roleWiseDesignation="",this.disableBlock=!1,this.disableDistrict=!1,this.rolesHirechie=[],this.currentUser=this._auth.currentUserValue}ngOnInit(){var e,i,o,a,s,d,m,c,T,Z;!(null===(e=this.currentUser)||void 0===e)&&e.stateId&&(this.districts$=this.districtService.getDistricts({stateId:null===(i=this.currentUser)||void 0===i?void 0:i.stateId})),this.form=this.createCoughForm();const R=H.U.find(A=>
1{if(A.name==this.formType)return A.hierarchy});this.rolesHirechie=R?R.hierarchy:[],((null===(o=this.currentUser)||void 0===o?void 0:o.districtId)||(null===(a=this.currentUser)||void 0===a?void 0:a.blockId)||(null===(s=this.currentUser)||void 0===s?void 0:s.phiId))&&(this.getBlocks(null,null===(d=this.currentUser)||void 0===d?void 0:d.districtId),this.disableDistrict=!(null===(m=this.currentUser)||void 0===m||!m.districtId),this.disableBlock=!(null===(c=this.currentUser)||void 0===c||!c.blockId)),null===(T=this.form.get("actionType"))||void 0===T||T.valueChanges.subscribe(A=>{this.updateRoleByValidators(A)}),this.updateRoleByValidators(null===(Z=this.form.get("actionType"))||void 0===Z?void 0:Z.value),this.updatedHierarchy()}updatedHierarchy(){this.form.value.districtId&&this.form.value.blockId?this.rolesHirechie=this.rolesHirechie.filter(e=>"districtId"!==e.value&&"blockId"!==e.value):this.form.value.districtId?this.rolesHirechie=this.rolesHirechie.filter(e=>"districtId"!==e.value):this.form.value.blockId&&(this.rolesHirechie=this.rolesHirechie.filter(e=>"blockId"!==e.value)),this.changeDetectedRef.detectChanges()}createCoughForm(){var e,i,o,a,s;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict}],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(o=this.currentUser)||void 0===o?void 0:o.blockId:"",disabled:this.disableBlock}],roleBy:["",{value:null!==(a=this.currentUser)&&void 0!==a&&a.designation?null===(s=this.currentUser)||void 0===s?void 0:s.designation:""},this.getRoleByValidators()],actionType:["download",u.kI.required],startDate:[""],endDate:[""]})}getRoleByValidators(e="filterReport"){return"download"===e?[u.kI.required]:[]}updateRoleByValidators(e){const i=this.form.get("roleBy");i&&(i.clearValidators(),i.setValidators(this.getRoleByValidators(e)),i.updateValueAndValidity())}getBlocks(e,i){var o,a;this.form.value.blockId="";const s=H.U.find(d=>{if(d.name==this.formType)return d.hierarchy});this.rolesHirechie=s?s.hierarchy:[],this.rolesHirechie=this.rolesHirechie.filter(d=>"districtId"!==d.value),this.changeDetectedRef.detectChanges(),i=null!==(a=null===(o=null==this?void 0:this.form)||void 0===o?void 0:o.value)&&void 0!==a&&a.hasOwnProperty("districtId")?this.form.value.districtId:this.currentUser.districtId,this.blocks$=this.blockService.getBlocks({districtId:i})}filterCoughReport(){let e={fromDate:this.form.value.startDate,toDate:this.form.value.endDate,districtId:this.form.value.districtId,blockId:this.form.value.blockId};console.log(this.form.value),this.currentUser.designation&&(e.designation=this.currentUser.designation),this.form.value.roleBy&&(e.roleBy=this.form.value.roleBy),this.drugSupplyService.getDrugSupplyCount(e).subscribe(i=>{const o=(0,B.J)(i);this.dataChanged.emit(o)})}blockChangeHandler(e){this.rolesHirechie=this.rolesHirechie.filter(i=>"blockId"!==i.value)}designationHandler(e){["District","Block"].includes(e.label)||("Private Practitioner"===e.label?this.roleWiseDesignation="privatePractioner":"Rural Practitioner"===e.label&&(this.roleWiseDesignation="ruralPractioner"),this.roleWiseDesignation=e.label)}generateCoughReport(){const e={fromDate:this.form.value.startDate,toDate:this.form.value.endDate};this.form.value.districtId&&(e.districtId=this.form.value.districtId),this.form.value.blockId&&(e.blockId=this.form.value.blockId),"download"===this.form.value.actionType&&(e.roleBy=this.form.value.roleBy,e.formType="Allopathy_referral",e.designation=this.roleWiseDesignation),this.drugSupplyService.getDrugReport(e).subscribe(i=>{i?k().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(o=>{o.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(a=>{const s=new Blob([a],{type:a.type}),d=window.URL.createObjectURL(s),m=document.createElement("a");m.href=d,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(d)})}):k().fire({title:"No Data Found",text:"There is no data available to download.",icon:"warning",showConfirmButton:!0,confirmButtonText:"OK"})})}getTableData(){let e={};this.currentUser.districtId&&(e.districtId=this.currentUser.districtId),this.currentUser.blockId&&(e.blockId=this.currentUser.blockId),this.currentUser.designation===b.K.TU&&(e.userId=this.currentUser.id,e.designation=this.currentUser.designation),this.drugSupplyService.getDrugSupplyCount(e).subscribe(i=>{const o=(0,B.J)(i);this.dataChanged.emit(o),this.changeDetectedRef.detectChanges()})}}return r.\u0275fac=function(e){return new(e||r)(t.Y36(P.e8),t.Y36(u.qu),t.Y36(M),t.Y36(J.n),t.Y36(Q.R),t.Y36($.g),t.Y36(t.sBO))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-drug-supply-filter"]],inputs:{title:"title",formType:"formType"},outputs:{dataChanged:"dataChanged"},decls:50,vars:16,consts:[[1,"card-body"],[1,"card-title"],[1,"card-text"],[3,"formGroup"],[1,"row"],[1,"col-lg-12","readonly-wrapper"],[1,"mb-2"],["aria-label","actionType","formControlName","actionType",1,""],["value","download",1,"px-2"],["value","filterReport",1,"px-2"],[4,"ngIf"],[1,"my-2","col-xs-12","col-sm-12","col-md-3"],["appearance","outline",2,"width","100%"],["placeholder","Select District","formControlName","districtId",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],["placeholder","Select Block","formControlName","blockId",3,"selectionChange"],["class","my-2 col-xs-12 col-sm-12 col-md-3",4,"ngIf"],[1,"flex","justify-items-center"],[1,"date-range-container"],[3,"rangePicker"],["matStartDate","","formControlName","startDate","placeholder","Start date"],["matEndDate","","formControlName","endDate","placeholder","End date"],["matIconSuffix","",3,"for"],["picker",""],[1,"d-flex","align-items-center","justify-content-between"],["mat-raised-button","","color","primary","style","margin-top: 0.5rem;",3,"disableRipple","disabled","click",4,"ngIf"],[3,"value"],["placeholder","Select Roles","formControlName","roleBy"],[3,"value","click",4,"ngFor","ngForOf"],[3,"value","click"],["mat-raised-button","","color","primary",2,"margin-top","0.5rem",3,"disableRipple","disabled","click"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"h3",1),t._uU(2),t.qZA(),t.TgZ(3,"p",2),t._uU(4,"Download the raw data report"),t.qZA(),t.TgZ(5,"form",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"mat-label"),t._uU(10,"Report Type"),t.qZA()(),t.TgZ(11,"mat-radio-group",7)(12,"mat-radio-button",8),t._uU(13,"Download"),t.qZA(),t.TgZ(14,"mat-radio-button",9),t._uU(15,"Filter View Report"),t.qZA()(),t.YNc(16,ot,3,0,"div",10),t.qZA(),t.TgZ(17,"div",11)(18,"mat-form-field",12)(19,"mat-label"),t._uU(20,"District"),t.qZA(),t.TgZ(21,"mat-select",13),t.NdJ("selectionChange",function(a){return i.getBlocks(a,"")}),t.YNc(22,at,2,2,"mat-option",14),t.ALo(23,"async"),t.qZA(),t.YNc(24,lt,2,0,"mat-error",10),t.qZA()(),t.TgZ(25,"div",11)(26,"mat-form-field",12)(27,"mat-label"),t._uU(28,"Block"),t.qZA(),t.TgZ(29,"mat-select",15),t.NdJ("selectionChange",function(a){return i.blockChangeHandler(a)}),t.YNc(30,nt,2,2,"mat-option",14),t.ALo(31,"async"),t.qZA()()(),t.YNc(32,dt,7,2,"div",16),t.TgZ(33,"div",11)(34,"mat-form-field",12)(35,"mat-label"),t._uU(36,"Date Range"),t.qZA(),t.TgZ(37,"div",17)(38,"div",18)(39,"mat-date-range-input",19),t._UZ(40,"input",20)(41,"input",21),t.qZA(),t._UZ(42,"mat-datepicker-toggle",22),t.qZA(),t._UZ(43,"mat-date-range-picker",null,23),t.qZA(),t.YNc(45,ct,1,0,"mat-error",10),t.qZA()(),t.TgZ(46,"div",11)(47,"div",24),t.YNc(48,mt,2,2,"button",25),t.YNc(49,pt,2,2,"button",25),t.qZA()()()()()),2&e){const o=t.MAs(44);let a,s,d,m;t.xp6(2),t.Oqu(i.title),t.xp6(3),t.Q6J("formGroup",i.form),t.xp6(11),t.Q6J("ngIf",(null==(a=i.form.get("actionType"))?null:a.hasError("required"))&&(null==(a=i.form.get("actionType"))?null:a.touched)),t.xp6(6),t.Q6J("ngForOf",t.lcZ(23,12,i.districts$)),t.xp6(2),t.Q6J("ngIf",i.form.controls.districtId.invalid),t.xp6(6),t.Q6J("ngForOf",t.lcZ(31,14,i.blocks$)),t.xp6(2),t.Q6J("ngIf","download"===(null==(s=i.form.get("actionType"))?null:s.value)),t.xp6(7),t.Q6J("rangePicker",o),t.xp6(3),t.Q6J("for",o),t.xp6(3),t.Q6J("ngIf",i.form.controls.startDate.invali
1d),t.xp6(3),t.Q6J("ngIf","filterReport"===(null==(d=i.form.get("actionType"))?null:d.value)),t.xp6(1),t.Q6J("ngIf","download"===(null==(m=i.form.get("actionType"))?null:m.value))}},dependencies:[D.sg,D.O5,C.ey,I.lW,_.nW,_.wx,_.zY,_.By,_._g,F.TO,F.KE,F.hX,L.VQ,L.U0,p.gD,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,D.Ov]}),r})();function ht(r,l){if(1&r&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.hij(" ",e.header," ")}}function ft(r,l){if(1&r&&(t.TgZ(0,"tr"),t.YNc(1,ht,2,1,"th",7),t.qZA()),2&r){const e=t.oxw();t.xp6(1),t.Q6J("ngForOf",e.cols)}}function vt(r,l){if(1&r&&t._UZ(0,"p-treeTableToggler",10),2&r){const e=t.oxw(2).$implicit;t.Q6J("rowNode",e)}}function _t(r,l){if(1&r&&(t.TgZ(0,"td"),t.YNc(1,vt,1,1,"p-treeTableToggler",9),t._uU(2),t.qZA()),2&r){const e=l.$implicit,i=l.index,o=t.oxw().rowData;t.xp6(1),t.Q6J("ngIf",0===i),t.xp6(1),t.hij(" ",o[e.field]," ")}}function Dt(r,l){if(1&r&&(t.TgZ(0,"tr",8),t.YNc(1,_t,3,2,"td",7),t.qZA()),2&r){const e=l.$implicit,i=t.oxw();t.Q6J("ttRow",e),t.xp6(1),t.Q6J("ngForOf",i.cols)}}let yt=(()=>{class r{constructor(e,i,o,a,s,d,m){this.fb=e,this.fileLibraryServices=i,this.drugSupplyService=o,this._auth=a,this.districtService=s,this.blockService=d,this.PhiService=m,this.subscription=new z.w0,this.disableBlock=!1,this.disableDistrict=!1,this.showDistrictTable=!0,this.showBlockTable=!0,this.showTuTable=!0,this.showPhiChoTable=!0,this.drugSupplyData=[],this.columns=[{columnDef:"state",header:"State",cell:c=>`${c.state}`,isActionField:!0},{columnDef:"district",header:"Districts",cell:c=>`${c.district}`,isActionField:!0},{columnDef:"block",header:"Blocks",cell:c=>`${c.block}`,isActionField:!0},{columnDef:"tu",header:"TU",cell:c=>`${c.tu}`,isActionField:!0},{columnDef:"phiCho",header:"PHI/Cho",cell:c=>`${c.phiCho}`,isActionField:!0},{columnDef:"storeDrugsReceived",header:"Store Drugs Received",cell:c=>`${c.storeDrugsReceived}`},{columnDef:"drugsReceivedBack",header:"Drugs Received Back",cell:c=>`${c.drugsReceivedBack}`},{columnDef:"qtyExpiredDrugs",header:"Qty Of Expired Drugs",cell:c=>`${c.qtyExpiredDrugs}`},{columnDef:"qtyDamagedDrugs",header:"Qty Of Damaged Drugs",cell:c=>`${c.qtyDamagedDrugs}`},{columnDef:"drugIssued",header:"No Of Drugs Issued",cell:c=>`${c.drugIssued}`}],this.cols=[{field:"level",header:"User Level"},{field:"openingBalance",header:"Opening balance as on 1st day of Month [A]"},{field:"storeDrugsReceived",header:"Drugs received from DDS in the month [B]"},{field:"drugIssued",header:"Drugs issued to PHI/HWC [C]"},{field:"drugsReceivedBack",header:"Drugs received back from PHI/HWC, if any [D]"},{field:"qtyExpiredDrugs",header:"Quantity of expired drugs [E]"},{field:"qtyDamagedDrugs",header:"Quanity of damaged drugs [F]"},{field:"closingBalance",header:"Closing balance [G=A+B+D-C+E+F]"}],this.displayedColumns=this.columns.map(c=>c.columnDef),this.currentUser=this._auth.currentUserValue}ngOnInit(){var e,i,o,a,s,d,m,c,T,Z;!(null===(e=this.currentUser)||void 0===e)&&e.stateId&&(this.districts$=this.districtService.getDistricts({stateId:null===(i=this.currentUser)||void 0===i?void 0:i.stateId})),((null===(o=this.currentUser)||void 0===o?void 0:o.districtId)||(null===(a=this.currentUser)||void 0===a?void 0:a.blockId)||(null===(s=this.currentUser)||void 0===s?void 0:s.phiId))&&(this.getBlocks(null,null===(d=this.currentUser)||void 0===d?void 0:d.districtId),this.getPhis(null,null===(m=this.currentUser)||void 0===m?void 0:m.districtId,null===(c=this.currentUser)||void 0===c?void 0:c.blockId),this.disableDistrict=!(null===(T=this.currentUser)||void 0===T||!T.districtId),this.disableBlock=!(null===(Z=this.currentUser)||void 0===Z||!Z.blockId)),this.form=this.createForm(),N()().month()+1>3?(this.fromDate=N()().month(3).startOf("month").format("YYYY-MM-DD"),this.toDate=N()().month(2).endOf("month").add(1,"years").format("YYYY-MM-DD")):(this.fromDate=N()().month(3).startOf("month").subtract(1,"years").format("YYYY-MM-DD"),this.toDate=N()().month(2).endOf("month").format("YYYY-MM-DD")),"State"===this.currentUser.designation?this.getStateTable():"District"===this.currentUser.designation?(this.showDistrictTable=!1,this.getDistrictTable(this.currentUser)):"Block"===this.currentUser.designation?(this.showBlockTable=!1,this.getBlockTable(this.currentUser)):"TU"===this.currentUser.designation?(this.showTuTable=!1,this.getTuTable(this.currentUser)):["PHI","CHO"].includes(this.currentUser.designation)&&(this.showTuTable=!1,this.getPhiChoTable(this.currentUser))}createForm(){var e,i,o;return this.fb.group({districtId:[{value:null!==(e=this.currentUser)&&void 0!==e&&e.districtId?this.currentUser.districtId:"",disabled:this.disableDistrict},[u.kI.required]],blockId:[{value:null!==(i=this.currentUser)&&void 0!==i&&i.blockId?null===(o=this.currentUser)||void 0===o?void 0:o.blockId:"",disabled:this.disableBlock}],startDate:[""],endDate:[""]})}getStateTable(){const e=this.displayedColumns.filter(o=>"district"!==o&&"block"!==o&&"tu"!==o&&"phiCho"!==o);this.displayedColumnsStateWise=e,this.tabelTitle=`State level cummulative data of Drug Supply and Recieve reporting from ${this.fromDate} to ${this.toDate}`,this.drugSupplyService.getDrugSupplyCount({designation:this.currentUser.designation,fromDate:this.fromDate,toDate:this.toDate}).subscribe(o=>{const a=(0,B.J)(o);this.drugSupplyData=a})}getDistrictTable(e){const i=this.displayedColumns.filter(a=>"state"!==a&&"block"!==a&&"tu"!==a&&"phiCho"!==a);this.tabelTitle=`District level cummulative data of Drug Supply and Recieve reporting from ${this.fromDate} to ${this.toDate}`,this.displayedColumnsDistrictWise=i,this.showDistrictTable=!1,this.drugSupplyService.getDrugSupplyCount({fromDate:this.fromDate,toDate:this.toDate,stateId:this.currentUser.stateId?this.currentUser.stateId:e.stateId,districtId:this.currentUser.districtId?this.currentUser.districtId:e.districtId,designation:"District"}).subscribe(a=>{const s=(0,B.J)(a);this.drugSupplyData=s})}getBlockTable(e){this.showBlockTable=!1,this.tabelTitle=`Block level cummulative data of Drug Supply and Recieve reporting from ${this.fromDate} to ${this.toDate}`;const i=this.displayedColumns.filter(a=>"state"!==a&&"district"!==a&&"tu"!==a&&"phiCho"!==a);this.displayedColumnBlock=i,this.drugSupplyService.getDrugSupplyCount({fromDate:this.fromDate,toDate:this.toDate,stateId:this.currentUser.stateId,districtId:e._id?e._id:e.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:e.blockId,designation:"Block"}).subscribe(a=>{const s=(0,B.J)(a);this.drugSupplyData=s})}getTuTable(e){this.showTuTable=!1,this.tabelTitle=`TU level cummulative data of Drug Supply and Recieve reporting from ${this.fromDate} to ${this.toDate}`;const i=this.displayedColumns.filter(a=>"state"!==a&&"district"!==a&&"block"!==a&&"phiCho"!==a);this.displayedColumnUser=i,this.drugSupplyService.getDrugSupplyCount({fromDate:this.fromDate,toDate:this.toDate,stateId:this.currentUser.stateId,districtId:e.districtId,blockId:this.currentUser.blockId,designation:"TU"}).subscribe(a=>{const s=(0,B.J)(a);this.drugSupplyData=s})}getPhiChoTable(e){this.showPhiChoTable=!1,this.tabelTitle=`PHI/Cho level cummulative data of Drug Supply and Recieve reporting from ${this.fromDate} to ${this.toDate}`;const i=this.displayedColumns.filter(a=>"state"!==a&&"district"!==a&&"tu"!==a&&"block"!==a);this.displayedColumnPhiChoTitle=i,this.drugSupplyService.getDrugSupplyCount({fromDate:this.fromDate,toDate:this.toDate,stateId:this.currentUser.stateId,districtId:this.currentUser.districtId,blockId:this.currentUser.blockId,tuId:e.id,designation:e.designation}).subscribe(a=>{const s=(0,B.J)(a);this.drugSupplyData=s})}getBlocks(e,i){var o,a;i=null!==(a=null===(o=null==this?void 0:this.form)||void 0===o?void 0:o.value)&&void 0!==a&&a.hasOwnProperty("districtId")?this.form.value.districtId:this.currentUser.districtId,this.blocks$=this.blockService.getBlocks({districtId:i})}getPhis(e,i,o){}generateReport(){this.drugSupplyService.getDrugReport({fromDate:this.form.value.startDate,toDate:this.form.value.endDate,districtId:this.currentUser.districtId?this.currentUser.districtId:this.form.value.districtId,blockId:this.currentUser.blockId?this.currentUser.blockId:this.form.value.blockId}).subscribe(i=>{k().fire({title:"Download The Report!",showConfirmButton:!0,confirmButtonText:"Download",showCancelButton:!0}).then(o=>{o.value&&this.fileLibraryServices.downloadFileWithContainer(i).subscribe(a=>{const s=new Blob([a],{type:a.type}),d=window.URL.createObjectURL(s),m=document.createElement("a");m.href=d,m.download=i,document.body.appendChild(m),m.click(),document.body.removeChild(m),window.URL.revokeObjectURL(d)})})})}ngOnDestroy(){this.subscription.unsubscribe()}onDataChanged(e){this.drugSupplyData=e}}return r.\u0275fac=function(e){return new(e||r)(t.Y36(u.qu),t.Y36(J.n),t.Y36(M),t.Y36(P.e8),t.Y36(Q.R),t.Y36($.g),t.Y36(rt.B))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-drug-supply-reporting"]],decls:9,vars:3,consts:[[1,"card","w-full",2,"margin-bottom","10px","margin-top","-2.5rem"],["title","Drug Receipt And Supply Report","formType","allopathy_pp_referral",3,"dataChanged"],[1,"card"],[1,"card-body"],[1,"my-indoortable",3,"value","columns"],["pTemplate","header"],["pTemplate","body"],[4,"ngFor","ngForOf"],[3,"ttRow"],[3,"rowNode",4,"ngIf"],[3,"rowNode"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"app-drug-supply-filter",1),t.NdJ("dataChanged",function(a){return i.onDataChanged(a)}),t.qZA()(),t.TgZ(2,"div",2)(3,"div",3)(4,"h4"),t._uU(5),t.qZA()(),t.TgZ(6,"p-treeTable",4),t.YNc(7,ft,2,1,"ng-template",5),t.YNc(8,Dt,2,2,"ng-template",6),t.qZA()()),2&e&&(t.xp6(5),t.Oqu(i.tabelTitle),t.xp6(1),t.Q6J("value",i.drugSupplyData)("columns",i.cols))},dependencies:[D.sg,D.O5,O.iw,it.jx,O.gc,O.V4,gt],styles:[".mat-row:nth-child(even){background-color:#f0f5ef} mat-footer-row, mat-header-row, mat-row, td.mat-cell, td.mat-footer-cell, th.mat-header-cell{border:1px solid #ccc;padding:5px!important} th.mat-header-cell{background-color:#7393b3;color:#fff;font-size:14px} .mat-header-row, .mat-row{height:30px!important;min-height:0px!important} .mat-sort-header-arrow{color:#fff}.mat-datepicker-toggle[_ngcontent-%COMP%]{position:absolute;right:.5rem;top:50%;transform:translateY(-50%)}table[_ngcontent-%COMP%]{width:100%}.my-indoortable[_ngcontent-%COMP%]{border-collapse:collapse}.my-indoortable[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .my-indoortable[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:1px solid #ccc;padding:8px}.my-indoortable[_ngcontent-%COMP%] .table-header[_ngcontent-%COMP%]{background-color:#f5f5f5;font-weight:700}.my-indoortable[_ngcontent-%COMP%] .table-cell[_ngcontent-%COMP%]{text-align:left}"]}),r})();var bt=n(9943),Tt=n(1586),Ct=n(3788),It=n(7243);function St(r,l){if(1&r&&(t.TgZ(0,"mat-option",40),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.Q6J("value",e),t.xp6(1),t.hij(" ",e.name," ")}}function Ut(r,l){1&r&&(t.TgZ(0,"div")(1,"mat-error"),t._uU(2,"Please Select Company Name"),t.qZA()())}function Zt(r,l){if(1&r&&(t.TgZ(0,"mat-option",40),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.Q6J("value",e.value),t.xp6(1),t.Oqu(e.name)}
1}function xt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Opening balance is required. "),t.qZA())}function Bt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Maximum allowed value is 1,000,000,000. "),t.qZA())}function At(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Drug received from TU Store in the month is required. "),t.qZA())}function kt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Maximum allowed value is 1,000,000,000. "),t.qZA())}function Ft(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Drugs issued to patients in the month is required. "),t.qZA())}function Rt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Maximum allowed value is 1,000,000,000. "),t.qZA())}function qt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Drug received back from Patients [D] is required. "),t.qZA())}function Nt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Maximum allowed value is 1,000,000,000. "),t.qZA())}function wt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Quantity of expired drugs[E] is required. "),t.qZA())}function Ot(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Maximum allowed value is 1,000,000,000. "),t.qZA())}function Yt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Quantity of damaged drugs[F] is required. "),t.qZA())}function Et(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Maximum allowed value is 1,000,000,000. "),t.qZA())}function Mt(r,l){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Maximum allowed value is 1,000,000,000. "),t.qZA())}function Pt(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1," Sr. No. "),t.qZA())}function Jt(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.index;t.oxw();const i=t.MAs(112);t.xp6(1),t.hij(" ",e+1+i.pageIndex*i.pageSize,"")}}function Qt(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1," Product Name "),t.qZA())}function $t(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.productName)}}function Ht(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"Opening Balance"),t.qZA())}function Lt(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.openingBalance)}}function Kt(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"Store Drugs Received"),t.qZA())}function Wt(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.storeDrugsReceived)}}function jt(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"drugsReceivedBack"),t.qZA())}function Vt(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.drugsReceivedBack)}}function Gt(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"Qty of Expired Drugs"),t.qZA())}function zt(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.qtyExpiredDrugs)}}function Xt(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"Qty of Damaged Drugs"),t.qZA())}function te(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.qtyDamagedDrugs)}}function ee(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"Closing Balance"),t.qZA())}function re(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.closingBalance)}}function ie(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"Month"),t.qZA())}function oe(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit,i=t.oxw();t.xp6(1),t.Oqu(i.getMonthName(e.month))}}function ae(r,l){1&r&&(t.TgZ(0,"th",41),t._uU(1,"Drug Issued"),t.qZA())}function le(r,l){if(1&r&&(t.TgZ(0,"td",42),t._uU(1),t.qZA()),2&r){const e=l.$implicit;t.xp6(1),t.Oqu(e.drugIssued)}}function ne(r,l){1&r&&t._UZ(0,"tr",43)}function se(r,l){1&r&&t._UZ(0,"tr",44)}function ue(r,l){1&r&&(t.TgZ(0,"tr",45)(1,"td",46),t._uU(2,"No data matching the filter"),t.qZA()())}const de=function(){return[5,10,25,100]};let ce=(()=>{class r{constructor(e,i,o,a,s,d){this.fb=e,this.productService=i,this.drugSupplyService=o,this.formService=a,this.questionService=s,this._auth=d,this.displayedColumns=["sn","productName","openingBalance","storeDrugsReceived","drugsReceivedBack","qtyExpiredDrugs","qtyDamagedDrugs","closingBalance","month","drugIssued"],this.paginator=new t.n_E,this.sort=new t.n_E,this.druglist=[],this.complaintList=[],this.isDisabled=!0,this.months=[{name:"January",value:1},{name:"February",value:2},{name:"March",value:3},{name:"April",value:4},{name:"May",value:5},{name:"June",value:6},{name:"July",value:7},{name:"August",value:8},{name:"September",value:9},{name:"October",value:10},{name:"November",value:11},{name:"December",value:12}],this.currentUser=this._auth.currentUserValue}ngOnInit(){this.getFormId(),this.drugsupplyform=this.createForm(),this.drugsupplyform.valueChanges.subscribe(()=>{this.updateClosingBalance()}),this.getAllProduct(),this.getTableData()}getFormId(){this.formService.getForms({formName:"Drug Reporting Form"}).subscribe(i=>{this.formId=i[0].id,this.questionService.getQuestion({formId:this.formId}).subscribe(a=>{this.complaintList=a[0].questions.complaints.lang[0].optionValues.map(d=>d.value)})})}createForm(){return this.fb.group({productName:["",u.kI.required],month:["",u.kI.required],openingBalance:["",u.kI.required],storeDrugsReceived:["",u.kI.required],drugIssued:["",u.kI.required],drugsReceivedBack:["",u.kI.required],qtyExpiredDrugs:["",u.kI.required],qtyDamagedDrugs:["",u.kI.required],closingBalance:[{value:0,disabled:!0},[u.kI.max(1e9)]]})}updateClosingBalance(){const e=this.drugsupplyform.value,c=(e.openingBalance||0)+(e.storeDrugsReceived||0)+(e.drugsReceivedBack||0)+(e.qtyExpiredDrugs||0)+(e.qtyDamagedDrugs||0)-(e.drugIssued||0),T=c>=0?c:0;return this.drugsupplyform.patchValue({closingBalance:T},{emitEvent:!1}),T}getAllProduct(){this.productService.getProducts({}).subscribe(e=>{this.druglist=e})}getMonthName(e){return!e||e<1||e>12?"Invalid Month":["January","February","March","April","May","June","July","August","September","October","November","December"][e-1]}getFinancialYearDates(){const e=new Date,i=e.getFullYear();let a,s;return e.getMonth()>=3?(a=new Date(i,3,1),s=new Date(i+1,2,31,23,59,59)):(a=new Date(i-1,3,1),s=new Date(i,2,31,23,59,59)),{fromDate:a.getTime(),toDate:s.getTime()}}getTableData(){const{fromDate:e,toDate:i}=this.getFinancialYearDates();this.drugSupplyService.getDrugSupply({where:{createdBy:this.currentUser.id,submissionDate:{between:[e,i]}}}).subscribe(a=>{this.dataSource=new h.by(a),this.dataSource.paginator=this.paginator.toArray()[0],this.dataSource.sort=this.sort.toArray()[0]})}view(){var e,i;const o=this.drugsupplyform.value,a=this.updateClosingBalance(),s=Object.assign(Object.assign({},o),{formId:this.formId,createdBy:this.currentUser.id,productId:null===(e=o.productName)||void 0===e?void 0:e.id,submissionDate:(new Date).getTime(),year:(new Date).getFullYear(),productName:null===(i=o.productName)||void 0===i?void 0:i.name,stateId:void 0!==this.currentUser.stateId?this.currentUser.stateId:void 0,districtId:void 0!==this.currentUser.districtId?this.currentUser.districtId:void 0,blockId:void 0!==this.currentUser.blockId?this.currentUser.blockId:void 0,closingBalance:a});this.drugSupplyService.createDrugSupply(s).subscribe(d=>{d&&(k().fire({title:"Success!",text:"Forms added successfully",icon:"success",showConfirmButton:!0,confirmButtonText:"OK"}),this.getTableData())}),this.drugsupplyform.reset()}}return r.\u0275fac=function(e){return new(e||r)(t.Y36(u.qu),t.Y36(Tt.M),t.Y36(M),t.Y36(Ct.o),t.Y36(It.a),t.Y36(P.e8))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-drug-supply-form"]],viewQuery:function(e,i){if(1&e&&(t.Gf(x.NW,5),t.Gf(S.YE,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.paginator=o),t.iGM(o=t.CRH())&&(i.sort=o)}},decls:113,vars:25,consts:[[1,"container"],[1,"card","w-full",2,"margin-bottom","10px"],[1,"card-body"],[1,"w-full",3,"formGroup"],[1,"flex","justify-evenly","gap-1"],[1,"row"],[1,"col-lg-4","readonly-wrapper"],["appearance","outline",1,"readonly-block",2,"width","100%"],["placeholder","Select Company","formControlName","productName","required",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["formControlName","month","placeholder","Select a month"],["matInput","","formControlName","openingBalance","placeholder","openingBalance","type","number","required","","min","0","max","1000000000"],["matInput","","formControlName","storeDrugsReceived","placeholder","storeDrugsReceived","type","number","required","","min","0","max","1000000000"],["matInput","","formControlName","drugIssued","placeholder","drugIssued","type","number","required","","min","0","max","1000000000"],["matInput","","formControlName","drugsReceivedBack","placeholder","drugsReceivedBack","type","number","required","","min","0","max","1000000000"],["matInput","","formControlName","qtyExpiredDrugs","placeholder","qtyExpiredDrugs","type","number","required","","min","0","max","1000000000"],["matInput","","formControlName","qtyDamagedDrugs","placeholder","qtyDamagedDrugs","type","number","required","","min","0","max","1000000000"],["matInput","","formControlName","closingBalance","type","number","placeholder","Closing Balance",3,"disabled"],[1,"d-flex","justify-content-center"],["mat-raised-button","","color","primary",3,"disableRipple","disabled","click"],[1,"card","w-full"],["mat-table","","matSort","",1,"shadow-xl","w-full","h-full",3,"dataSource"],["matColumnDef","sn"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","productName"],["matColumnDef","openingBalance"],["matColumnDef","storeDrugsReceived"],["matColumnDef","drugsReceivedBack"],["matColumnDef","qtyExpiredDrugs"],["matColumnDef","qtyDamagedDrugs"],["matColumnDef","closingBalance"],["matColumnDef","month"],["matColumnDef","drugIssued"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],["showFirstLastButtons","",3,"pageSizeOptions"],["paginator",""],[3,"value"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-row",""],["mat-row",""],[1,"mat-row"],["colspan","4",1,"mat-cell"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"h1")(2,"b"),t._uU(3,"Drug receipt and supply form"),t.qZA()(),t.TgZ(4,"div",1)(5,"div",2)(6,"form",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"mat-form-field",7)(11,"mat-label"),t._uU(12,"TB Drug "),t.qZA(),t.TgZ(13,"mat-select",8),t.YNc(14,St,2,2,"mat-option",9),t.qZA()(),t.YNc(15,Ut,3,0,"div",10),t.qZA(),t.TgZ(16,"div",6)(17,"mat-form-field",7)(18,"mat-label"),t._uU(19,"Month"),t.qZA(),t.TgZ(20,"mat-select",11),t.YNc(21,Zt,2,2,"mat-option",9),t.qZA()()(),t.TgZ(22,"div",6)(23,"mat-form-field",7)(24,"mat-label"),t._uU(25,"Opening balance as on 1st day on Month [A]"),t.qZA(),t._UZ(26,"input",12),t.YNc(27,xt,2,0,"mat-error",10),t.YNc(28,Bt,2,0,"mat-error",10),t.qZA()()(),t.TgZ(29,"div",5)(30,"div",6)(31,"mat-form-field",7)(32,"mat-label"),t._uU(33,"Drug received from TU Store in the month [B]"),t.qZA(),t._UZ(34,"input",13),t.YNc(35,At,2,0,"mat-error",10),t.YNc(36,kt,2,0,"mat-error",10),t.qZA()(),t.TgZ(37,"div",6)(38,"mat-form-field",7)(39,"mat-label"),t._uU(40,"Drugs issued to Patients in the month [C]"),t.qZA(),t._UZ(41,"input",14),t.YNc(42,Ft,2,0,"mat-error",10),t.YNc(43,Rt,2,0,"mat-error",10),t.qZA()(),t.TgZ(44,"div",6)(45,"mat-form-field",7)(46,"mat-label"),t._uU(47,"Drug received back from Patients any[D]"),t.qZA(),t._UZ(48,"input",15),t.YNc(49,qt,2,0,"mat-error",10),t.YNc(50,Nt,2,0,"mat-error",10),t.qZA()(),t.TgZ(51,"div",5)(52,"div",6)(53,"mat-form-field",7)(54,"mat-label"),t._uU(55,"Quantity of expired drugs[E]"),t.qZA(),t._UZ(56,"input",16),t.YNc(57,wt,2,0,"mat-error",10),t.YNc(58,Ot,2,0,"mat-error",10),t.qZA()(),t.TgZ(59,"div",6)(60,"mat-form-field",7)(61,"mat-label"),t._uU(62,"Quantity of damaged drugs[F]"),t.qZA(),t._UZ(63,"input",17),t.YNc(64,Yt,2,0,"mat-error",10),t.YNc(65,Et,2,0,"mat-error",10),t.qZA()(),t.TgZ(66,"div",6)(67,"mat-form-field",7)(68,"mat-label"),t._uU(69,"Closing balance [G=A+B+D-C+E+F]"),t.qZA(),t._UZ(70,"input",18),t.YNc(71,Mt,2,0,"mat-error",10),t.qZA()()()(),t.TgZ(72,"div",19)(73,"button",20),t.NdJ("click",function(){return i.view()}),t._uU(74,"Add Data"),t.qZA()()()()()(),t.TgZ(75,"div",21)(76,"div",2)(77,"table",22),t.ynx(78,23),t.YNc(79,Pt,2,0,"th",24),t.YNc(80,Jt,2,1,"td",25),t.BQk(),t.ynx(81,26),t.YNc(82,Qt,2,0,"th",24),t.YNc(83,$t,2,1,"td",25),t.BQk(),t.ynx(84,27),t.YNc(85,Ht,2,0,"th",24),t.YNc(86,Lt,2,1,"td",25),t.BQk(),t.ynx(87,28),t.YNc(88,Kt,2,0,"th",24),t.YNc(89,Wt,2,1,"td",25),t.BQk(),t.ynx(90,29),t.YNc(91,jt,2,0,"th",24),t.YNc(92,Vt,2,1,"td",25),t.BQk(),t.ynx(93,30),t.YNc(94,Gt,2,0,"th",24),t.YNc(95,zt,2,1,"td",25),t.BQk(),t.ynx(96,31
1),t.YNc(97,Xt,2,0,"th",24),t.YNc(98,te,2,1,"td",25),t.BQk(),t.ynx(99,32),t.YNc(100,ee,2,0,"th",24),t.YNc(101,re,2,1,"td",25),t.BQk(),t.ynx(102,33),t.YNc(103,ie,2,0,"th",24),t.YNc(104,oe,2,1,"td",25),t.BQk(),t.ynx(105,34),t.YNc(106,ae,2,0,"th",24),t.YNc(107,le,2,1,"td",25),t.BQk(),t.YNc(108,ne,1,0,"tr",35),t.YNc(109,se,1,0,"tr",36),t.YNc(110,ue,3,0,"tr",37),t.qZA(),t._UZ(111,"mat-paginator",38,39),t.qZA()()()),2&e){let o,a,s,d,m,c,T,Z,R,A,W,j,V,G;t.xp6(6),t.Q6J("formGroup",i.drugsupplyform),t.xp6(8),t.Q6J("ngForOf",i.druglist),t.xp6(1),t.Q6J("ngIf",(null==(o=i.drugsupplyform.get("productName"))?null:o.hasError("required"))&&(null==(o=i.drugsupplyform.get("productName"))?null:o.touched)),t.xp6(6),t.Q6J("ngForOf",i.months),t.xp6(6),t.Q6J("ngIf",null==(a=i.drugsupplyform.get("openingBalance"))?null:a.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(s=i.drugsupplyform.get("openingBalance"))?null:s.hasError("max")),t.xp6(7),t.Q6J("ngIf",null==(d=i.drugsupplyform.get("storeDrugsReceived"))?null:d.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(m=i.drugsupplyform.get("storeDrugsReceived"))?null:m.hasError("max")),t.xp6(6),t.Q6J("ngIf",null==(c=i.drugsupplyform.get("drugIssued"))?null:c.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(T=i.drugsupplyform.get("drugIssued"))?null:T.hasError("max")),t.xp6(6),t.Q6J("ngIf",null==(Z=i.drugsupplyform.get("drugsReceivedBack"))?null:Z.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(R=i.drugsupplyform.get("drugsReceivedBack"))?null:R.hasError("max")),t.xp6(7),t.Q6J("ngIf",null==(A=i.drugsupplyform.get("qtyExpiredDrugs"))?null:A.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(W=i.drugsupplyform.get("qtyExpiredDrugs"))?null:W.hasError("max")),t.xp6(6),t.Q6J("ngIf",null==(j=i.drugsupplyform.get("qtyDamagedDrugs"))?null:j.hasError("required")),t.xp6(1),t.Q6J("ngIf",null==(V=i.drugsupplyform.get("qtyDamagedDrugs"))?null:V.hasError("max")),t.xp6(5),t.Q6J("disabled",i.isDisabled),t.xp6(1),t.Q6J("ngIf",null==(G=i.drugsupplyform.get("closingBalance"))?null:G.hasError("max")),t.xp6(2),t.Q6J("disableRipple",!1)("disabled",i.drugsupplyform.invalid),t.xp6(4),t.Q6J("dataSource",i.dataSource),t.xp6(31),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(2),t.Q6J("pageSizeOptions",t.DdM(24,de))}},dependencies:[D.sg,D.O5,C.ey,I.lW,F.TO,F.KE,F.hX,g.Nt,x.NW,p.gD,S.YE,S.nU,h.BZ,h.fO,h.as,h.w1,h.Dz,h.nj,h.ge,h.ev,h.XQ,h.Gk,h.Ee,u._Y,u.Fj,u.wV,u.JJ,u.JL,u.Q7,u.qQ,u.Fd,u.sg,u.u],styles:[".mat-row:nth-child(even){background-color:#f0f5ef} mat-footer-row, mat-header-row, mat-row, td.mat-cell, td.mat-footer-cell, th.mat-header-cell{border:1px solid #ccc;padding:5px!important} th.mat-header-cell{background-color:#7393b3;color:#fff;font-size:14px} .mat-header-row, .mat-row{height:30px!important;min-height:0px!important} .mat-sort-header-arrow{color:#fff}table[_ngcontent-%COMP%]{width:100%}"]}),r})();var K=n(2956),me=n(2271);let pe=(()=>{class r{}return r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({imports:[D.ez,y.m,bt.q,u.UX,u.u5,p.LD,_.FA,g.c,I.ot,C.XK,f.M,q.Ps,x.TU,Y.Cv,S.JX,h.p0,O.dp,me.m,v.Bz.forChild([{path:"report",component:yt,canActivate:[K.p],data:{expectedRoles:[b.K.STATE,b.K.DISTRICT,b.K.BLOCK,b.K.TU,b.K.PHI,b.K.DDS,b.K.SDS]}},{path:"form",component:ce,canActivate:[K.p],data:{expectedRoles:[b.K.PHI,b.K.CHO,b.K.TU,b.K.DDS,b.K.SDS]}}])]}),r})()},9667:(w,U,n)=>{n.d(U,{U:()=>u,s:()=>f});const f={allopathy_pp_referral:"allopathy_pp_referral",ayurvedic_pp_referral:"ayurvedic_pp_referral",rural_hp_referral:"rural_hp_referral",ahc_referral:"ahc_referral",phi_weekly_referral:"phi_weekly_referral",indoor_ward_report:"indoor_ward_report"},u=[{name:f.allopathy_pp_referral,hierarchy:[{label:"District",value:"districtId"},{label:"Block",value:"blockId"},{label:"PHI",value:"createdBy"},{label:"Private Practitioner",value:"createdBy"}]},{name:f.ayurvedic_pp_referral,hierarchy:[{label:"District",value:"districtId"},{label:"Block",value:"blockId"},{label:"PHI",value:"createdBy"},{label:"Rural Practitioner",value:"createdBy"}]},{name:f.rural_hp_referral,hierarchy:[{label:"District",value:"districtId"},{label:"Block",value:"blockId"},{label:"PHI",value:"createdBy"},{label:"Private Practitioner",value:"createdBy"}]},{name:f.ahc_referral,hierarchy:[{label:"District",value:"districtId"},{label:"Block",value:"blockId"},{label:"AHC ",value:"createdBy"},{label:"AHC ayuveda",value:"createdBy"}]},{name:f.phi_weekly_referral,hierarchy:[{label:"District",value:"districtId"},{label:"Block",value:"blockId"},{label:"PHI",value:"createdBy"}]},{name:f.indoor_ward_report,hierarchy:[{label:"District",value:"districtId"},{label:"Block",value:"blockId"},{label:"PHI",value:"createdBy"}]}]},1227:(w,U,n)=>{n.d(U,{J:()=>f});const f=u=>{const y=(v,p)=>{const _={key:p,data:Object.assign({},v),children:[]};return v.districts?_.children=v.districts.map((g,I)=>{const C=`${p}-${I}`,D=y(g,C);return g.blocks&&(D.children=g.blocks.map((h,q)=>y(h,`${C}-${q}`))),D}):v.blocks?_.children=v.blocks.map((g,I)=>y(g,`${p}-${I}`)):v.phis&&(_.children=v.phis.map((g,I)=>y(g,`${p}-${I}`))),_};return u.map((v,p)=>y(v,p.toString()))}}}]);
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.