PageSourceSearch

https://mirame.chduero.es/chduero/4810.7318e24d4857b0fc.js

js chduero.es collected 2026-09-24 18:10:07 UTC 223,882 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkchd_mirame_web=self.webpackChunkchd_mirame_web||[]).push([[4810],{7555:(G,N,l)=>{l.d(N,{b:()=>f});var g=l(7579),c=l(2722),y=l(5e3),T=l(9027);let f=(()=>{class r{constructor(C,P,B){this.viewContainerRef=C,this.templateRef=P,this.rolesService=B,this.stop$=new g.x,this.isVisible=!1}ngOnInit(){this.rolesService.profile$.pipe((0,c.R)(this.stop$)).subscribe(C=>{C||this.viewContainerRef.clear(),0===this.appNothasrole.filter(P=>C===P).length?this.isVisible||(this.isVisible=!0,this.viewContainerRef.createEmbeddedView(this.templateRef)):(this.isVisible=!1,this.viewContainerRef.clear())})}ngOnDestroy(){this.stop$.next(!0)}}return r.\u0275fac=function(C){return new(C||r)(y.Y36(y.s_b),y.Y36(y.Rgc),y.Y36(T.f))},r.\u0275dir=y.lG2({type:r,selectors:[["","appNothasrole",""]],inputs:{appNothasrole:"appNothasrole"}}),r})()},9555:(G,N,l)=>{l.d(N,{B:()=>M});var g=l(3179),c=l(5e3),y=l(60),T=l(4623),f=l(508),r=l(7278),e=l(7238),C=l(4894),P=l(3718);function B(b,O){1&b&&(c.TgZ(0,"span"),c._uU(1,"\xa0"),c.qZA())}function ee(b,O){1&b&&(c.TgZ(0,"span"),c._uU(1,"\xa0"),c.qZA())}function A(b,O){if(1&b&&(c.TgZ(0,"span",7),c._uU(1),c.ALo(2,"number"),c.YNc(3,ee,2,0,"span",4),c._uU(4),c.ALo(5,"translate"),c.qZA()),2&b){const D=c.oxw(2);c.xp6(1),c.Oqu(c.xi3(2,3,D.elem,D.numberConstant)),c.xp6(2),c.Q6J("ngIf",D.unit),c.xp6(1),c.Oqu(c.lcZ(5,6,D.unit))}}function U(b,O){if(1&b&&(c.TgZ(0,"span",7),c._uU(1),c.ALo(2,"number"),c.ALo(3,"transformValue"),c.ALo(4,"transformValue"),c.qZA()),2&b){const D=c.oxw(2);c.xp6(1),c.AsE(" ",c.xi3(2,2,c.xi3(3,5,D.elem,D.transformAction).value,D.numberConstant)," ",c.xi3(4,8,D.elem,D.transformAction).units," ")}}function _(b,O){if(1&b&&(c.TgZ(0,"mat-list-item",1)(1,"div",2)(2,"span",3),c.ALo(3,"translate"),c._uU(4),c.ALo(5,"translate"),c.YNc(6,B,2,0,"span",4),c._uU(7),c.qZA(),c.YNc(8,A,6,8,"span",5),c.YNc(9,U,5,11,"ng-template",null,6,c.W1O),c.qZA()()),2&b){const D=c.MAs(10),L=c.oxw();c.xp6(2),c.s9C("matTooltip",c.lcZ(3,6,L.tooltip)),c.xp6(2),c.Oqu(c.lcZ(5,8,L.label)),c.xp6(2),c.Q6J("ngIf",L.labelExtend),c.xp6(1),c.Oqu(L.labelExtend),c.xp6(1),c.Q6J("ngIf",!L.transformAction)("ngIfElse",D)}}let M=(()=>{class b{constructor(){this.label="",this.labelExtend="",this.tooltip="",this.numberConstant=g.C.numRed}ngOnInit(){}}return b.\u0275fac=function(D){return new(D||b)},b.\u0275cmp=c.Xpm({type:b,selectors:[["app-mat-list-item-number"]],inputs:{elem:"elem",label:"label",labelExtend:"labelExtend",tooltip:"tooltip",numberConstant:"numberConstant",unit:"unit",transformAction:"transformAction"},decls:1,vars:1,consts:[["class","bar-gradient-float-right",4,"ngIf"],[1,"bar-gradient-float-right"],["matLine",""],["appBold","","matTooltipPosition","after","matTooltipClass","custom-tooltip",1,"float-start",3,"matTooltip"],[4,"ngIf"],["class","float-end text-wrap",4,"ngIf","ngIfElse"],["transformElem",""],[1,"float-end","text-wrap"]],template:function(D,L){1&D&&c.YNc(0,_,11,10,"mat-list-item",0),2&D&&c.Q6J("ngIf",null!=L.elem)},directives:[y.O5,T.Tg,f.X2,r.M,e.gM],pipes:[C.X$,y.JJ,P.V],styles:[""]}),b})()},3279:(G,N,l)=>{l.d(N,{f:()=>ee});var g=l(5e3),c=l(60),y=l(4623),T=l(508),f=l(7278),r=l(7238),e=l(4894);function C(A,U){1&A&&(g.TgZ(0,"span"),g._uU(1,"\xa0"),g.qZA())}function P(A,U){1&A&&(g.TgZ(0,"span"),g._uU(1,"\xa0"),g.qZA())}function B(A,U){if(1&A&&(g.TgZ(0,"mat-list-item",1)(1,"div",2)(2,"span",3),g.ALo(3,"translate"),g._uU(4),g.ALo(5,"translate"),g.YNc(6,C,2,0,"span",4),g._uU(7),g.qZA(),g.TgZ(8,"span",5),g._uU(9),g.YNc(10,P,2,0,"span",4),g._uU(11),g.ALo(12,"translate"),g.qZA()()()),2&A){const _=g.oxw();g.xp6(2),g.s9C("matTooltip",g.lcZ(3,7,_.tooltip)),g.xp6(2),g.Oqu(g.lcZ(5,9,_.label)),g.xp6(2),g.Q6J("ngIf",_.labelExtend),g.xp6(1),g.Oqu(_.labelExtend),g.xp6(2),g.hij("",_.elem," "),g.xp6(1),g.Q6J("ngIf",_.unit),g.xp6(1),g.Oqu(g.lcZ(12,11,_.unit))}}let ee=(()=>{class A{constructor(){this.label="",this.labelExtend="",this.tooltip=""}ngOnInit(){}}return A.\u0275fac=function(_){return new(_||A)},A.\u0275cmp=g.Xpm({type:A,selectors:[["app-mat-list-item-text"]],inputs:{elem:"elem",label:"label",labelExtend:"labelExtend",tooltip:"tooltip",unit:"unit"},decls:1,vars:1,consts:[["class","bar-gradient-float-right comentarios",4,"ngIf"],[1,"bar-gradient-float-right","comentarios"],["matLine",""],["appBold","","matTooltipPosition","after","matTooltipClass","custom-tooltip",1,"float-start",3,"matTooltip"],[4,"ngIf"],[1,"float-end","text-wrap"]],template:function(_,M){1&_&&g.YNc(0,B,13,13,"mat-list-item",0),2&_&&g.Q6J("ngIf",M.elem)},directives:[c.O5,y.Tg,T.X2,f.M,r.gM],pipes:[e.X$],styles:[".comentarios[_ngcontent-%COMP%]{padding:10px 0!important;height:auto!important}"]}),A})()},1190:(G,N,l)=>{l.d(N,{u:()=>T}),l(4389);var c=l(5e3),y=l(7663);let T=(()=>{class f{constructor(){this.chartSize={width:300,height:300}}ngOnInit(){}}return f.\u0275fac=function(e){return new(e||f)},f.\u0275cmp=c.Xpm({type:f,selectors:[["app-bar-chart"]],inputs:{chartData:"chartData",chartOptions:"chartOptions",chartSize:"chartSize",chartPlugins:"chartPlugins"},decls:1,vars:5,consts:[["type","bar",3,"data","options","plugins","width","height"]],template:function(e,C){1&e&&c._UZ(0,"p-chart",0),2&e&&(c.s9C("width",C.chartSize.width),c.s9C("height",C.chartSize.width),c.Q6J("data",C.chartData)("options",C.chartOptions)("plugins",C.chartPlugins))},directives:[y.C],styles:[""]}),f})()},2810:(G,N,l)=>{l.d(N,{J:()=>y});var g=l(5e3),c=l(7663);let y=(()=>{class T{constructor(){this.chartSize={width:250,height:250}}ngOnInit(){}}return T.\u0275fac=function(r){return new(r||T)},T.\u0275cmp=g.Xpm({type:T,selectors:[["app-pie-chart"]],inputs:{chartData:"chartData",chartOptions:"chartOptions",chartSize:"chartSize"},decls:1,vars:4,consts:[["type","pie",3,"width","height","data","options"]],template:function(r,e){1&r&&g._UZ(0,"p-chart",0),2&r&&(g.s9C("width",e.chartSize.width),g.s9C("height",e.chartSize.width),g.Q6J("data",e.chartData)("options",e.chartOptions))},directives:[c.C],styles:[""]}),T})()},3718:(G,N,l)=>{l.d(N,{V:()=>y});var g=l(5e3),c=l(4894);let y=(()=>{class T{constructor(r){this.translate=r}transform(r,e){let C={};switch(e){case"transformArea":C=this.transformArea(r);break;case"transformVolume":C=this.transformVolume(r);break;case"transformVolumeSingle":C=this.transformVolumeSingle(r);break;case"transformAreaHa":C=this.transformAreaHa(r);break;case"transformVolumeM3":C=this.transformVolumeM3(r);break;case"transformVolumeM3Ha":C=this.transformVolumeM3Ha(r)}return C}transformArea(r){let e=this.translate.instant("unidades.km2");return r<1&&(r*=1e6,e=this.translate.instant("unidades.m2")),{value:r,units:e}}transformAreaHa(r){let e=this.translate.instant("unidades.ha");return r<1&&(r*=1e4,e=this.translate.instant("unidades.m2")),{value:r,units:e}}transformVolume(r){let e=this.translate.instant("unidades.m3Anyo");return r>1e6&&(r/=1e6,e=this.translate.instant("unidades.hm3Anyo")),{value:r,units:e}}transformVolumeSingle(r){let e=this.translate.instant("unidades.m3");return r>1e6&&(r/=1e6,e=this.translate.instant("unidades.hm3")),{value:r,units:e}}transformVolumeM3Ha(r){let e=this.translate.instant("unidades.m3Ha");return r>1e6&&(r/=1e6,e=this.translate.instant("unidades.hm3Ha")),{value:r,units:e}}transformVolumeM3(r){let e=this.translate.instant("unidades.m3");return r>1e6&&(r/=1e6,e=this.translate.instant("unidades.hm3")),{value:r,units:e}}}return T.\u0275fac=function(r){return new(r||T)(g.Y36(c.sK,16))},T.\u0275pipe=g.Yjl({name:"transformValue",type:T,pure:!0}),T})()},4810:(G,N,l)=>{l.r(N),l.d(N,{AgrarianDemandsModule:()=>Ar,HttpLoaderFactory:()=>Ie});var g=l(4486),c=l(4894),y=l(40),T=l(520),f=l(3932),r=l(3179),e=l(5e3),C=l(33),P=l(7706),B=l(5563);let ee=(()=>{class a{constructor(t,n,o){this.entityMenuService=t,this.translate=n,this.languageChangeService=o,this.languageChangeService.language$.subscribe(s=>{this.translate.currentLang="",this.translate.use(s),this.translate.get("agrarianDemands.fic
1haGeneral.titulo").subscribe(d=>{this.entityMenu={type:d,datalink:"data",searchlink:"search",generalDataLink:"search/general",technicalDataLink:"search/technical",entityType:r.C.tipoEntidad.usosAgricolas},this.entityMenuService.entityMenuChange(this.entityMenu)})})}ngOnInit(){}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(C.$),e.Y36(c.sK),e.Y36(P.S))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-agrarianDemands"]],decls:5,vars:0,consts:[[1,"row"],[1,"col-12","col-md-auto"],[1,"col","col-lg-8","col-xl"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"app-entity-menu"),e.qZA(),e.TgZ(3,"div",2),e._UZ(4,"router-outlet"),e.qZA()())},directives:[B.A,f.lC],styles:[""]}),a})();var A=l(7579),U=l(2722),_=l(7470),M=l(5876),b=l(4497),O=l(8914),D=l(3402),L=l(1250),I=l(4834),x=l(60),J=l(4623),F=l(508),j=l(7278),k=l(7238),Ae=l(2810),le=l(1190),w=l(5397);function Re(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",10)(2,"mat-list",11)(3,"mat-list-item",12)(4,"div",13)(5,"span",14),e.ALo(6,"translate"),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.ALo(11,"number"),e.ALo(12,"translate"),e.qZA()()(),e.TgZ(13,"mat-list",16)(14,"mat-list-item",12)(15,"div",13)(16,"span",14),e.ALo(17,"translate"),e._uU(18),e.ALo(19,"translate"),e.qZA(),e.TgZ(20,"span",15),e._uU(21),e.ALo(22,"number"),e.ALo(23,"translate"),e.qZA()()(),e.TgZ(24,"mat-list-item",12)(25,"div",13)(26,"span",14),e.ALo(27,"translate"),e._uU(28),e.ALo(29,"translate"),e.qZA(),e.TgZ(30,"span",15),e._uU(31),e.ALo(32,"number"),e.ALo(33,"translate"),e.qZA()()()()()(),e.TgZ(34,"div",10)(35,"mat-list",11)(36,"mat-list-item",12)(37,"div",13)(38,"span",14),e.ALo(39,"translate"),e._uU(40),e.ALo(41,"translate"),e.qZA(),e.TgZ(42,"span",15),e._uU(43),e.ALo(44,"number"),e.ALo(45,"translate"),e.qZA()()(),e.TgZ(46,"mat-list",16)(47,"mat-list-item",12)(48,"div",13)(49,"span",14),e.ALo(50,"translate"),e._uU(51),e.ALo(52,"translate"),e.qZA(),e.TgZ(53,"span",15),e._uU(54),e.ALo(55,"number"),e.ALo(56,"translate"),e.qZA()()(),e.TgZ(57,"mat-list-item",12)(58,"div",13)(59,"span",14),e.ALo(60,"translate"),e._uU(61),e.ALo(62,"translate"),e.qZA(),e.TgZ(63,"span",15),e._uU(64),e.ALo(65,"number"),e.ALo(66,"translate"),e.qZA()()()(),e.TgZ(67,"mat-list-item",12)(68,"div",13)(69,"span",14),e.ALo(70,"translate"),e._uU(71),e.ALo(72,"translate"),e.qZA(),e.TgZ(73,"span",15),e._uU(74),e.ALo(75,"number"),e.ALo(76,"translate"),e.qZA()()()()(),e.BQk()),2&a){const t=i.ngIf,n=e.oxw();e.xp6(5),e.s9C("matTooltip",e.lcZ(6,28,"agrarianDemands.data.tltipSuperficieRegadioCuenca")),e.xp6(2),e.hij("",e.lcZ(8,30,"agrarianDemands.data.superficieRegadioCuenca")," "),e.xp6(3),e.AsE("",e.xi3(11,32,t.superficieRegadioCuenca,n.numEnt)," ",e.lcZ(12,35,"unidades.ha"),""),e.xp6(6),e.s9C("matTooltip",e.lcZ(17,37,"agrarianDemands.data.tltipRiegoSuperficial")),e.xp6(2),e.hij("",e.lcZ(19,39,"agrarianDemands.data.riegoSuperficial")," "),e.xp6(3),e.AsE("",e.xi3(22,41,t.riegosSuperficiales,n.numEnt)," ",e.lcZ(23,44,"unidades.ha"),""),e.xp6(5),e.s9C("matTooltip",e.lcZ(27,46,"agrarianDemands.data.tltipRiesgoSubterraneo")),e.xp6(2),e.hij("",e.lcZ(29,48,"agrarianDemands.data.riesgoSubterraneo")," "),e.xp6(3),e.AsE("",e.xi3(32,50,t.riegosSubterraneos,n.numEnt)," ",e.lcZ(33,53,"unidades.ha"),""),e.xp6(7),e.s9C("matTooltip",e.lcZ(39,55,"agrarianDemands.data.tltipSuperficieRegadioEficiente")),e.xp6(2),e.hij("",e.lcZ(41,57,"agrarianDemands.data.superficieRegadioEficiente")," "),e.xp6(3),e.AsE("",e.xi3(44,59,t.superficieRegadioEficiente,n.numEnt)," ",e.lcZ(45,62,"unidades.ha"),""),e.xp6(6),e.s9C("matTooltip",e.lcZ(50,64,"agrarianDemands.data.tltipRiegoSuperficial")),e.xp6(2),e.hij("",e.lcZ(52,66,"agrarianDemands.data.riegoSuperficial")," "),e.xp6(3),e.AsE("",e.xi3(55,68,t.riegosEficienteSuperficiales,n.numEnt)," ",e.lcZ(56,71,"unidades.ha"),""),e.xp6(5),e.s9C("matTooltip",e.lcZ(60,73,"agrarianDemands.data.tltipRiesgoSubterraneo")),e.xp6(2),e.hij("",e.lcZ(62,75,"agrarianDemands.data.riesgoSubterraneo")," "),e.xp6(3),e.AsE("",e.xi3(65,77,t.riegosEficienteSubterraneos,n.numEnt)," ",e.lcZ(66,80,"unidades.ha"),""),e.xp6(5),e.s9C("matTooltip",e.lcZ(70,82,"agrarianDemands.data.tltipSuperficieRegadioNoEficiente")),e.xp6(2),e.hij("",e.lcZ(72,84,"agrarianDemands.data.superficieRegadioNoEficiente")," "),e.xp6(3),e.AsE("",e.xi3(75,86,t.superficieRegadioNoEficiente,n.numEnt)," ",e.lcZ(76,89,"unidades.ha"),"")}}function Le(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",10),e._UZ(2,"app-pie-chart",17),e.qZA(),e.TgZ(3,"div",10),e._UZ(4,"app-pie-chart",17),e.qZA(),e.BQk()),2&a){const t=e.oxw();e.xp6(2),e.Q6J("chartData",t.riego)("chartOptions",t.pieChartOptions)("chartSize",t.chartSize),e.xp6(2),e.Q6J("chartData",t.riegoEficiente)("chartOptions",t.pieChartOptions)("chartSize",t.chartSize)}}function Pe(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",10)(2,"mat-list",11)(3,"mat-list-item",12)(4,"div",13)(5,"span",18),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"span",15),e._uU(9),e.ALo(10,"number"),e.ALo(11,"translate"),e.qZA()()(),e.TgZ(12,"mat-list",16)(13,"mat-list-item",12)(14,"div",13)(15,"span",18),e._uU(16),e.ALo(17,"translate"),e.qZA(),e.TgZ(18,"span",15),e._uU(19),e.ALo(20,"number"),e.ALo(21,"translate"),e.qZA()()(),e.TgZ(22,"mat-list-item",12)(23,"div",13)(24,"span",18),e._uU(25),e.ALo(26,"translate"),e.qZA(),e.TgZ(27,"span",15),e._uU(28),e.ALo(29,"number"),e.ALo(30,"translate"),e.qZA()()()()()(),e.TgZ(31,"div",10)(32,"mat-list",11)(33,"mat-list-item",12)(34,"div",13)(35,"span",14),e.ALo(36,"translate"),e._uU(37),e.ALo(38,"translate"),e.qZA(),e.TgZ(39,"span",15),e._uU(40),e.ALo(4
11,"number"),e.ALo(42,"translate"),e.qZA()()(),e.TgZ(43,"mat-list-item",12)(44,"div",13)(45,"span",14),e.ALo(46,"translate"),e._uU(47),e.ALo(48,"translate"),e.qZA(),e.TgZ(49,"span",15),e._uU(50),e.ALo(51,"number"),e.ALo(52,"translate"),e.qZA()()()()(),e.BQk()),2&a){const t=i.ngIf,n=e.oxw();e.xp6(6),e.Oqu(e.lcZ(7,17,"agrarianDemands.data.volumenDemandado")),e.xp6(3),e.AsE("",e.xi3(10,19,t.volumenDemandado,n.numRed)," ",e.lcZ(11,22,"unidades.hm3Anyo"),""),e.xp6(7),e.Oqu(e.lcZ(17,24,"agrarianDemands.data.riegoSuperficial")),e.xp6(3),e.AsE("",e.xi3(20,26,t.volumenRiegosSuperficiales,n.numRed)," ",e.lcZ(21,29,"unidades.hm3Anyo"),""),e.xp6(6),e.Oqu(e.lcZ(26,31,"agrarianDemands.data.riesgoSubterraneo")),e.xp6(3),e.AsE("",e.xi3(29,33,t.volumenRiegosSubterraneos,n.numRed)," ",e.lcZ(30,36,"unidades.hm3Anyo"),""),e.xp6(7),e.s9C("matTooltip",e.lcZ(36,38,"agrarianDemands.data.tltipVolumenRegadioEficiente")),e.xp6(2),e.hij("",e.lcZ(38,40,"agrarianDemands.data.volumenRegadioEficiente")," "),e.xp6(3),e.AsE("",e.xi3(41,42,t.volumenRegadiosEficientes,n.numRed)," ",e.lcZ(42,45,"unidades.hm3Anyo"),""),e.xp6(5),e.s9C("matTooltip",e.lcZ(46,47,"agrarianDemands.data.tltipVolumenRegadioNoEficiente")),e.xp6(2),e.hij("",e.lcZ(48,49,"agrarianDemands.data.volumenRegadioNoEficiente")," "),e.xp6(3),e.AsE("",e.xi3(51,51,t.volumenRegadiosNoEficientes,n.numRed)," ",e.lcZ(52,54,"unidades.hm3Anyo"),"")}}function we(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",10),e._UZ(2,"app-pie-chart",17),e.qZA(),e.TgZ(3,"div",10),e._UZ(4,"app-pie-chart",17),e.qZA(),e.BQk()),2&a){const t=e.oxw();e.xp6(2),e.Q6J("chartData",t.volumen)("chartOptions",t.pieChartOptions)("chartSize",t.chartSize),e.xp6(2),e.Q6J("chartData",t.volumenRegadio)("chartOptions",t.pieChartOptions)("chartSize",t.chartSize)}}function Qe(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"div",5),e._UZ(3,"app-pie-chart",20),e.qZA()(),e.BQk()),2&a){const t=e.oxw();e.xp6(3),e.Q6J("chartData",t.regadioTipo)("chartOptions",t.pieChartCultivosTipoOptions)}}function Ve(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",21)(2,"div",22)(3,"h3"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div"),e._UZ(7,"app-bar-chart",17),e.qZA()()()),2&a){const t=e.oxw();e.xp6(4),e.hij("",e.lcZ(5,4,"agrarianDemands.data.distribucionCultivosAnio")," "),e.xp6(3),e.Q6J("chartData",t.regadioAnyo)("chartOptions",t.barCharRegadioAnyoOptions)("chartSize",t.barChartSize)}}function Je(a,i){1&a&&e._UZ(0,"app-spinner")}let Ye=(()=>{class a{constructor(t,n,o,s,d){this.udaDemandService=t,this.configService=n,this.translate=o,this.chartConfigurationService=s,this.selectedTabService=d,this.stop$=new A.x,this.numEnt=r.C.numEnt,this.numRed=r.C.numRed,this.chartSize={width:175,height:175},this.barChartSize={width:425,height:425},this.selectedTabService.changeTab(0),this.pieChartCultivosTipoOptions=this.chartConfigurationService.getPieChartOptionsPorcentajeUEL(!0,""),this.barCharRegadioAnyoOptions=this.chartConfigurationService.getUELStackedBarChartOptions(this.translate.instant("unidades.ha"),!0,!1,"",this.translate.instant("agrarianDemands.fichaTendencias.graficas.cultivosPorAnyo.titleEjeY"))}ngOnInit(){this.udaDemandService.getUdaDemandsEnCifras().pipe((0,U.R)(this.stop$)).subscribe(t=>{this.udaEnCifras=t,this.riego=this.buildPieChartConfig(this.preparePieLabel(t.graficaSuperficieRegadioCuenca),this.preparePieData(t.graficaSuperficieRegadioCuenca),this.translate.instant("unidades.ha")),this.riegoEficiente=this.buildPieChartConfig(this.preparePieLabel(t.graficaSuperficieRegadioEficiente),this.preparePieData(t.graficaSuperficieRegadioEficiente),this.translate.instant("unidades.ha")),this.volumen=this.buildPieChartConfig(this.preparePieLabel(t.graficaVolumenDemandado),this.preparePieData(t.graficaVolumenDemandado),this.translate.instant("unidades.hm3Anyo")),this.volumenRegadio=this.buildPieChartConfig(this.preparePieLabel(t.graficaVolumenRegadios),this.preparePieData(t.graficaVolumenRegadios),this.translate.instant("unidades.hm3Anyo")),_.c.getPieChartColors(13),this.regadioTipo=M.K.buildPieChartConfig(this.preparePieLabel1(t.graficaCultivosTipo),this.prepareTooltips(t.graficaCultivosTipo),this.preparePieData1(t.graficaCultivosTipo),this.prepareColors(t.graficaCultivosTipo)),this.buildBarChartConfig(this.prepareBarChartData(t.graficaCultivosAnno))})}preparePieData(t){return t.map(n=>n.dato)}preparePieLabel(t){return t.map(n=>n.nombre)}preparePieData1(t){return t.map(n=>n.surface)}preparePieLabel1(t){return t.map(n=>n.groupDescrip)}prepareTooltips(t){return t.map(n=>n.tooltip)}prepareColors(t){return t.map(n=>n.color)}buildPieChartConfig(t,n,o){this.pieChartOptions=this.chartConfigurationService.getPieChartOptions(!1,o);let s=_.c.getPieChartColors(9);return{labels:t,datasets:[{data:n,backgroundColor:s,hoverBackgroun
1dColor:s}]}}buildBarChartConfig(t){this.regadioAnyo={datasets:t},this.barCharRegadioAnyoOptions=this.chartConfigurationService.getUELStackedBarChartOptions(this.translate.instant("unidades.ha"),!0,!1,"",this.translate.instant("agrarianDemands.data.cultivosPorAnyotitleEjeY"))}prepareBarChartData(t){const n=new Map;t.forEach(d=>{var p;let{groupDescrip:m,anio:v,surface:h,color:Z,porcen:q,descrip:S}=d;_.c.isNullorEmpty(m)&&(m=this.translate.instant("agrarianDemands.data.sinClasificar")),n.has(m)||n.set(m,[]),null===(p=n.get(m))||void 0===p||p.push({anio:v,surface:h,color:Z,porcen:q,descrip:S})});const o=[];return n.forEach((d,p)=>{o.push(this.getBarChartDatasetObject(p,d.map(m=>({label:m.anio.toString(),value:m.surface,color:m.color,porcen:m.porcen,descrip:m.descrip}))))}),o}getBarChartDatasetObject(t,n,o=1){const s=(new Date).getFullYear();let d=!1;return("5Barbecho"===t||"7Otros"===t)&&(d=!0),{label:t,data:n,backgroundColor:n.map(p=>Number(p.label)<s?p.color:`${p.color}80`),borderColor:n.map(p=>Number(p.label)<s?p.color:`${p.color}80`),borderWidth:o,hidden:d}}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(O.E),e.Y36(c.sK),e.Y36(D.E),e.Y36(L.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-data"]],decls:46,vars:33,consts:[[1,"container-title"],[1,"mb-2"],[1,"container-text"],[1,"text-justify"],[1,"container","mb-4"],[1,"row"],[4,"ngIf","ngIfElse"],[1,"container"],["class","row",4,"ngIf","ngIfElse"],["loading",""],[1,"col-md-5"],["dense",""],[1,"bar-gradient"],["matLine",""],["appBold","","matTooltipPosition","below","matTooltipClass","custom-tooltip",1,"float-start",3,"matTooltip"],[1,"float-end"],["dense","",1,"ms-5"],[3,"chartData","chartOptions","chartSize"],["appBold","",1,"float-start"],[1,"col-12"],[3,"chartData","chartOptions"],[1,"col","col-xl-12","mt-5"],[1,"container-subtitle","text-center"]],template:function(t,n){if(1&t&&(e.TgZ(0,"div",0)(1,"h2"),e._uU(2),e.ALo(3,"translate"),e.qZA()(),e._UZ(4,"mat-divider",1),e.TgZ(5,"div",2)(6,"p",3),e._uU(7),e.ALo(8,"translate"),e.qZA()(),e.TgZ(9,"div",2)(10,"p",3),e._uU(11),e.ALo(12,"translate"),e.qZA()(),e.TgZ(13,"div",2)(14,"p",3),e._uU(15),e.ALo(16,"translate"),e.qZA()(),e.TgZ(17,"div",0)(18,"h2"),e._uU(19),e.ALo(20,"translate"),e.qZA()(),e._UZ(21,"mat-divider",1),e.TgZ(22,"div",4)(23,"div",5),e.YNc(24,Re,77,91,"ng-container",6),e.YNc(25,Le,5,6,"ng-container",6),e.qZA()(),e.TgZ(26,"div",4)(27,"div",5),e.YNc(28,Pe,53,56,"ng-container",6),e.YNc(29,we,5,6,"ng-container",6),e.qZA()(),e.TgZ(30,"div",0)(31,"h2"),e._uU(32),e.ALo(33,"translate"),e.qZA()(),e._UZ(34,"mat-divider",1),e.TgZ(35,"div",7)(36,"div",5),e.YNc(37,Qe,4,2,"ng-container",6),e.qZA()(),e.TgZ(38,"div",0)(39,"h2"),e._uU(40),e.ALo(41,"translate"),e.qZA()(),e._UZ(42,"mat-divider",1),e.YNc(43,Ve,8,6,"div",8),e.YNc(44,Je,1,0,"ng-template",null,9,e.W1O)),2&t){const o=e.MAs(45);e.xp6(2),e.Oqu(e.lcZ(3,19,"agrarianDemands.data.queEsUnaDemandaAgraria")),e.xp6(5),e.Oqu(e.l
1cZ(8,21,"agrarianDemands.data.defDemanda1")),e.xp6(4),e.Oqu(e.lcZ(12,23,"agrarianDemands.data.defDemanda2")),e.xp6(4),e.Oqu(e.lcZ(16,25,"agrarianDemands.data.defDemanda3")),e.xp6(4),e.Oqu(e.lcZ(20,27,"agrarianDemands.data.udaCifras")),e.xp6(5),e.Q6J("ngIf",n.udaEnCifras)("ngIfElse",o),e.xp6(1),e.Q6J("ngIf",n.udaEnCifras)("ngIfElse",o),e.xp6(3),e.Q6J("ngIf",n.udaEnCifras)("ngIfElse",o),e.xp6(1),e.Q6J("ngIf",n.udaEnCifras)("ngIfElse",o),e.xp6(3),e.Oqu(e.lcZ(33,29,"agrarianDemands.data.distribucionCultivosTipo")),e.xp6(5),e.Q6J("ngIf",n.udaEnCifras)("ngIfElse",o),e.xp6(3),e.Oqu(e.lcZ(41,31,"agrarianDemands.data.distribucionCultivosAnio")),e.xp6(3),e.Q6J("ngIf",n.udaEnCifras)("ngIfElse",o)}},directives:[I.d,x.O5,J.i$,J.Tg,F.X2,j.M,k.gM,Ae.J,le.u,w.O],pipes:[c.X$,x.JJ],styles:[""]}),a})();var De=l(5105),ye=l(2260),ce=l(99),$=l(5861),u=l(3075),te=l(4107),ae=l(8825),he=l(4209),Ge=l(9547),ne=l(9027),R=l(7322),ie=l(8833),H=l(7318),Y=l(7423);function Be(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.hij("",e.lcZ(2,1,"validacionForm.numEntero")," "))}function Fe(a,i){if(1&a&&(e.TgZ(0,"mat-option",10),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombreProvincia," ")}}function je(a,i){if(1&a&&(e.TgZ(0,"mat-option",10),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombreMunicipio," ")}}function ke(a,i){1&a&&(e.TgZ(0,"h3")(1,"b"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"i",28),e.qZA()),2&a&&(e.xp6(2),e.hij("",e.lcZ(3,1,"agrarianDemands.data.ocultarBusqueda")," "))}function $e(a,i){1&a&&(e.TgZ(0,"h3")(1,"b"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"i",29),e.qZA()),2&a&&(e.xp6(2),e.hij("",e.lcZ(3,1,"agrarianDemands.data.ocultarBusqueda")," "))}function He(a,i){if(1&a&&(e.TgZ(0,"mat-option",10),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function ze(a,i){if(1&a&&(e.TgZ(0,"mat-option",10),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function We(a,i){if(1&a&&(e.TgZ(0,"mat-option",10),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function Ke(a,i){if(1&a&&(e.TgZ(0,"mat-option",10),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function Xe(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-form-field",5)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"mat-select",36),e._UZ(6,"mat-option",10),e.YNc(7,Ke,2,2,"mat-option",11),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.busqueda.formulario.origenRecurso")),e.xp6(4),e.Q6J("ngForOf",t.comboOrigenRecurso)}}function et(a,i){1&a&&e.GkF(0)}function tt(a,i){if(1&a&&e.YNc(0,et,1,0,"ng-container",37),2&a){e.oxw();const t=e.MAs(32);e.Q6J("ngTemplateOutlet",t)}}function at(a,i){1&a&&e.GkF(0)}function nt(a,i){if(1&a&&(e.TgZ(0,"div",3)(1,"div",4),e.YNc(2,at,1,0,"ng-container",37),e.qZA()()),2&a){e.oxw();const t=e.MAs(32);e.xp6(2),e.Q6J("ngTemplateOutlet",t)}}function it(a,i){if(1&a&&(e.TgZ(0,"mat-option",10),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function ot(a,i){if(1&a&&(e.TgZ(0,"mat-form-field",5)(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"mat-select",38),e._UZ(5,"mat-option",10),e.YNc(6,it,2,2,"mat-option",11),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,2,"agrarianDemands.busqueda.formulario.embalseRegulacion")),e.xp6(4),e.Q6J("ngForOf",t.comboEmbalsesRegulacion)}}function rt(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div")(1,"div",3)(2,"div",4)(3,"mat-form-field",5)(4,"mat-label"),e._uU(5),e.ALo(6,"translate"),e.qZA(),e.TgZ(7,"mat-select",30),e._UZ(8,"mat-option",10),e.YNc(9,He,2,2,"mat-option",11),e.qZA()()(),e.TgZ(10,"div",4)(11,"mat-form-field",5)(12,"mat-label"),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"mat-select",31),e._UZ(16,"mat-option",10),e.YNc(17,ze,2,2,"mat-option",11),e.qZA()()(),e.TgZ(18,"div",4)(19,"mat-form-field",5)(20,"mat-label"),e._uU(21),e.ALo(22,"translate"),e.qZA(),e.TgZ(23,"mat-select",32),e.NdJ("selectionChange",function(o){return e.CHM(t),e.oxw().getOrigenRecurso(o)}),e._UZ(24,"mat-option",10),e.YNc(25,We,2,2,"mat-option",11),e.qZA()()(),e.TgZ(26,"div",4),e.YNc(27,Xe,8,4,"ng-container",15),e.YNc(28,tt,1,1,"ng-template",null,33,e.W1O),e.qZA()(),e.YNc(30,nt,3,1,"div",34),e.YNc(31,ot,7,4,"ng-template",null,35,e.W1O),e.qZA()}if(2&a){const t=e.MAs(29),n=e.oxw();
1e.xp6(5),e.Oqu(e.lcZ(6,9,"agrarianDemands.busqueda.formulario.zonaRegable")),e.xp6(4),e.Q6J("ngForOf",n.comboZonaRegableSN),e.xp6(4),e.Oqu(e.lcZ(14,11,"agrarianDemands.busqueda.formulario.sistExplotacion")),e.xp6(4),e.Q6J("ngForOf",n.comboSistExplotacion),e.xp6(4),e.Oqu(e.lcZ(22,13,"agrarianDemands.busqueda.formulario.origenAgua")),e.xp6(4),e.Q6J("ngForOf",n.comboOrigenAgua),e.xp6(2),e.Q6J("ngIf",n.mostrarOrigenRecurso)("ngIfElse",t),e.xp6(3),e.Q6J("ngIf",n.mostrarOrigenRecurso)}}const st=function(a){return{active:a}};function lt(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"label",39),e._UZ(2,"input",40),e.TgZ(3,"i",41),e.NdJ("click",function(){return e.CHM(t),e.oxw().toggleValActivation()}),e.ALo(4,"translate"),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(3),e.s9C("matTooltip",e.lcZ(4,2,"formBusqueda.filtrar")),e.Q6J("ngClass",e.VKq(4,st,t.isActive))}}function ct(a,i){1&a&&e._UZ(0,"app-spinner")}const dt=function(){return["2"]};let mt=(()=>{class a{constructor(t,n,o,s,d,p,m,v){this.searchStatusService=t,this.globalService=n,this.temporaryStorageService=o,this.fb=s,this.rolesService=d,this.router=p,this.activatedRoute=m,this.agrarianDemandService=v,this.typeKey="",this.newSearchEvent=new e.vpe,this.disabledReportButton=!0,this.disabledSearchButton=!0,this.perfilUsuario="",this.stop$=new A.x,this.provinces=[],this.municipalities=[],this.matcher=new ae.o,this.isActive=!1,this.combosCharged=!1,this.mostrarOrigenRecurso=!1,this.isActiveBusqueda=!1,this.globalService.getProvinces().subscribe(h=>{this.provinces=h}),this.rolesService.profile$.pipe((0,U.R)(this.stop$)).subscribe(h=>{this.perfilUsuario=h})}ngOnInit(){this.createForm(),this.agrarianDemandService.combosBusquedaSubject$.pipe((0,U.R)(this.stop$)).subscribe(t=>{this.comboOrigenAgua=t.find(n=>n.listado===r.C.COMBO_TIPOLOGIA_ORIGEN_AGUA).data,this.comboSistExplotacion=t.find(n=>n.listado===r.C.COMBO_TIPO_SUBZONAS_PROPUESTAS).data,this.comboZonaRegableSN=t.find(n=>n.listado===r.C.COMBO_GENERICO_SI_NO).data,this.comboComunidadRegantesSN=t.find(n=>n.listado===r.C.COMBO_GENERICO_SI_NO).data,this.comboPequenoRegadio=t.find(n=>n.listado===r.C.COMBO_GENERICO_SI_NO).data,this.comboOrigenRecurso=t.find(n=>n.listado===r.C.COMBO_TIPOLOGIA_ORIGEN_RECURSO_UEDU).data,this.comboEmbalsesRegulacion=t.find(n=>n.listado===r.C.COMBO_EMBALSES_REGULACION).data}),this.temporaryStorage=this.temporaryStorageService.forKey(this.typeKey+"_search_form"),this.restoreFromTemporaryStorage()}createForm(){this.searchGroup=this.fb.group({nombre:this.fb.control({value:"",disabled:!1}),codigo:this.fb.control({value:"",disabled:!1},u.kI.pattern(r.C.regExpNumEntCodePatternAndSpaceFormatted)),provincia:this.fb.control({value:"",disabled:!1}),municipio:this.fb.control({value:"",disabled:!0}),origenAgua:this.fb.control({value:"",disabled:!1}),sistExplotacion:this.fb.control({value:"",disabled:!1}),zonaRegableSN:this.fb.control({value:"",disabled:!1}),comunidadRegantesSN:this.fb.control({value:"",disabled:!1}),origenRecurso:this.fb.control({value:"",disabled:!0}),pequenoRegadio:this.fb.control({value:"",disabled:!1}),embalseRegulacion:this.fb.control({value:"",disabled:!1}),validadorActivado:this.fb.control({value:!1,disabled:!0})}),this.perfilUsuario===r.C.perfilValidador&&this.searchGroup.get("validadorActivado").enable(),this.initialValues=this.searchGroup.value}clean(){var t;null===(t=this.searchGroup.get("nombreNucleo"))||void 0===t||t.setValue("")}onSubmit(){this.searchGroup.invalid||(this.sendNewSearch(this.searchGroup.value),this.searchStatusService.searchChange(!0),this.temporaryStorage.remove(),this.saveToTemporaryStorage(this.searchGroup.value))}sendNewSearch(t){this.newSearchEvent.emit(t)}restoreFromTemporaryStorage(){var t=this;return(0,$.Z)(function*(){var n;let o=yield t.temporaryStorage.get();if(o){for(const s in o){let d=o[s];if(null===(n=t.searchGroup.get(s))||void 0===n||n.setValue(d),"provincia"!==s||_.c.isNullorEmpty(d)||_.c.isUndefined(d))"validadorActivado"===s?t.isActive=!0===d:"origenAgua"===s&&(t.mostrarOrigenRecurso=d===r.C.TipoOrigenAgua.SUPERFICIAL,t.mostrarOrigenRecurso?t.searchGroup.get("origenRecurso").enable():t.searchGroup.get("origenRecurso").disable());else{let p;yield t.getMunicipalities(new te.mG(p,d))}}t.isActiveBusqueda=_.c.checkOpenExtendedSearch(t.searchGroup),t.onSubmit()}})()}saveToTemporaryStorage(t){this.temporaryStorage.set(t)}getMunicipalities(t){var n=this;return(0,$.Z)(function*(){return n.searchGroup.controls.municipio.setValue(""),new Promise(o=>{null!=t.value&&null!=t.value?n.globalService.getMunicipalitiesByProvId(t.value).subscribe(s=>{n.municipalities=s,n.searchGroup.get("municipio").enable(),o()}):(n.searchGroup.get("municipio").disable(),n.municipalities=[],o())})})()}getOrigenRecurso(t){var n=this;return(0,$.Z)(function*(){return new Promise(o=>{null!=t.value&&null!=t.value&&t.value===r.C.TipoOrigenAgua.SUPERFICIAL?(n.searchGroup.get("origenRecurso").enable(),n.mostrarOrigenRecurso=!0,o()):(n.searchGroup.get("origenRecurso").disable(),n.mostrarOrigenRecurso=!1,o())})})()}resetForm(){this.isActive=!1,this.searchGroup.reset(this.initialValues)}generateReport(){this.router.navigate(["./report"],{relativeTo:this.activatedRoute,state:{searchGroup:this.searchGroup.value,profile:this.perfilUsuario}})}toggleValActivation(){this.isActive=!this.isActive}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(ye.o),e.Y36(he.U),e.Y36(Ge.x),e.Y36(u.qu),e.Y36(ne.f),e.Y36(f.F0),e.Y36(f.gz),e.Y36(b.M))}
1,a.\u0275cmp=e.Xpm({type:a,selectors:[["app-agrarian-demands-search-form"]],inputs:{typeKey:"typeKey",disabledReportButton:"disabledReportButton",disabledSearchButton:"disabledSearchButton"},outputs:{newSearchEvent:"newSearchEvent"},decls:60,vars:38,consts:[[3,"formGroup","ngSubmit"],["searchForm","ngForm"],[1,"container"],[1,"row"],[1,"col","col-xl-3"],["appearance","fill"],["matInput","","id","name","type","text","formControlName","nombre",1,"campoBusqueda",3,"placeholder"],["matInput","","id","code","type","text","formControlName","codigo",1,"campoBusqueda",3,"placeholder","errorStateMatcher"],[4,"ngIf"],["id","province","formControlName","provincia",1,"campoBusqueda",3,"selectionChange"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],["id","municipality","formControlName","municipio",1,"campoBusqueda"],["row","",1,"col","col-xl-4"],[1,"container-subtitle",3,"click"],[4,"ngIf","ngIfElse"],["arriba",""],[1,"row","mt-4"],[1,"col-md-12"],[1,"float-end"],[4,"appHasrole"],["type","button","mat-flat-button","","color","primary",1,"btn-third",3,"click"],[1,"fa-solid","fa-lines-leaning"],["type","submit","mat-flat-button","","color","primary",1,"btn-first"],[1,"fa-solid","fa-magnifying-glass"],["type","button","mat-flat-button","","color","primary",1,"btn-second",3,"disabled","click"],[1,"fa-solid","fa-circle-info"],["loading",""],[1,"fa-sm","fa","fa-chevron-down"],[1,"fa-sm","fa","fa-chevron-up"],["id","zonaRegableSN","formControlName","zonaRegableSN",1,"campoBusqueda"],["id","sistExplotacion","formControlName","sistExplotacion",1,"campoBusqueda"],["id","origenAgua","formControlName","origenAgua",1,"campoBusqueda",3,"selectionChange"],["noMostrarOrigenRecurso",""],["class","row",4,"ngIf"],["embalsesRegulados",""],["id","origenRecurso","formControlName","origenRecurso",1,"campoBusqueda"],[4,"ngTemplateOutlet"],["id","embalseRegulacion","formControlName","embalseRegulacion",1,"campoBusqueda"],[1,"custom-checkbox"],["type","checkbox","formControlName","validadorActivado","id","checkValidacion"],["matTooltipPosition","below","matTooltipClass","custom-tooltip",1,"fa-regular","fa-square-check","fa-lg",3,"ngClass","matTooltip","click"]],template:function(t,n){if(1&t&&(e.ynx(0),e.TgZ(1,"form",0,1),e.NdJ("ngSubmit",function(){return n.onSubmit()}),e.TgZ(3,"div",2)(4,"div",3)(5,"div",4)(6,"mat-form-field",5)(7,"mat-label"),e._uU(8),e.ALo(9,"translate"),e.qZA(),e._UZ(10,"input",6),e.ALo(11,"translate"),e.qZA()(),e.TgZ(12,"div",4)(13,"mat-form-field",5)(14,"mat-label"),e._uU(15),e.ALo(16,"translate"),e.qZA(),e._UZ(17,"input",7),e.ALo(18,"translate"),e.YNc(19,Be,3,3,"mat-error",8),e.qZA()(),e.TgZ(20,"div",4)(21,"mat-form-field",5)(22,"mat-label"),e._uU(23),e.ALo(24,"translate"),e.qZA(),e.TgZ(25,"mat-select",9),e.NdJ("selectionChange",function(s){return n.getMunicipalities(s)}),e._UZ(26,"mat-option",10),e.YNc(27,Fe,2,2,"mat-option",11),e.qZA()()(),e.TgZ(28,"div",4)(29,"mat-form-field",5)(30,"mat-label"),e._uU(31),e.ALo(32,"translate"),e.qZA(),e.TgZ(33,"mat-select",12),e._UZ(34,"mat-option",10),e.YNc(35,je,2,2,"mat-option",11),e.qZA()()()(),e.TgZ(36,"div",13)(37,"div",14),e.NdJ("click",function(){return n.isActiveBusqueda=!n.isActiveBusqueda,n.clean()}),e.YNc(38,ke,5,3,"h3",15),e.YNc(39,$e,5,3,"ng-template",null,16,e.W1O),e.qZA()(),e.YNc(41,rt,33,15,"div",8),e.TgZ(42,"div",17)(43,"div",18)(44,"div",19),e.YNc(45,lt,5,6,"ng-container",20),e.TgZ(46,"button",21),e.NdJ("click",function(){return n.resetForm()}),e._uU(47),e.ALo(48,"translate"),e._UZ(49,"i",22),e.qZA(),e.TgZ(50,"button",23),e._uU(51),e.ALo(52,"translate"),e._UZ(53,"i",24),e.qZA(),e.TgZ(54,"button",25),e.NdJ("click",function(){return n.generateReport()}),e._uU(55),e.ALo(56,"translate"),e._UZ(57,"i",26),e.qZA()()()()()(),e.BQk(),e.YNc(58,ct,1,0,"ng-template",null,27,e.W1O)),2&t){const o=e.MAs(40);let s;
1e.xp6(1),e.Q6J("formGroup",n.searchGroup),e.xp6(7),e.Oqu(e.lcZ(9,19,"formBusqueda.nombre")),e.xp6(2),e.s9C("placeholder",e.lcZ(11,21,"formBusqueda.plcHldrNombre")),e.xp6(5),e.Oqu(e.lcZ(16,23,"formBusqueda.codigo")),e.xp6(2),e.s9C("placeholder",e.lcZ(18,25,"formBusqueda.plcHldrCodigo")),e.Q6J("errorStateMatcher",n.matcher),e.xp6(2),e.Q6J("ngIf",null==(s=n.searchGroup.get("codigo"))?null:s.hasError),e.xp6(4),e.Oqu(e.lcZ(24,27,"formBusqueda.provincia")),e.xp6(4),e.Q6J("ngForOf",n.provinces),e.xp6(4),e.Oqu(e.lcZ(32,29,"formBusqueda.municipio")),e.xp6(4),e.Q6J("ngForOf",n.municipalities),e.xp6(3),e.Q6J("ngIf",!n.isActiveBusqueda)("ngIfElse",o),e.xp6(3),e.Q6J("ngIf",n.isActiveBusqueda),e.xp6(4),e.Q6J("appHasrole",e.DdM(37,dt)),e.xp6(2),e.hij("",e.lcZ(48,31,"botones.limpiar")," "),e.xp6(4),e.hij("",e.lcZ(52,33,"botones.buscar")," "),e.xp6(3),e.Q6J("disabled",n.disabledReportButton),e.xp6(1),e.hij("",e.lcZ(56,35,"botones.informe")," ")}},directives:[u._Y,u.JL,u.sg,R.KE,R.hX,ie.Nt,u.Fj,u.JJ,u.u,x.O5,R.TO,te.gD,F.ey,x.sg,x.tP,H.I,u.Wl,x.mk,k.gM,Y.lW,w.O],pipes:[c.X$],styles:[".mat-checkbox[_ngcontent-%COMP%]{margin:0 8px 8px 0}"]}),a})();var pt=l(4511);function ut(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"h3",5),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"app-search-table",6),e.NdJ("changePageEvent",function(o){return e.CHM(t),e.oxw().updatePage(o)}),e.qZA(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(2),e.Oqu(e.lcZ(3,4,"formBusqueda.resultado")),e.xp6(2),e.Q6J("searchResult",t.uelDemand)("tableColumns",t.tableConfiguration)("dynamicEntityName",!0)}}function _t(a,i){1&a&&(e.TgZ(0,"div")(1,"div",8)(2,"p"),e._uU(3),e.ALo(4,"translate"),e.qZA()()()),2&a&&(e.xp6(3),e.Oqu(e.lcZ(4,1,"formBusqueda.noResultados")))}function gt(a,i){if(1&a&&e.YNc(0,_t,5,3,"div",7),2&a){const t=e.oxw();e.Q6J("ngIf",t.uelDemand&&0===t.uelDemand.data.length)}}let ht=(()=>{class a{constructor(t,n,o,s,d,p){this.agrarianDemandService=t,this.searchStatusService=n,this.translate=o,this.configService=s,this.selectedValueComboService=d,this.selectedTabService=p,this.mensajeEvent=new e.vpe,this.tableConfiguration=[{columnDef:"detalle",header:"",cell:m=>""},{columnDef:"id",header:this.translate.instant("agrarianDemands.busqueda.tabla.id"),cell:m=>`${m.id}`},{columnDef:"nombre",header:this.translate.instant("agrarianDemands.busqueda.tabla.nombre"),cell:m=>`${m.nombre}`},{columnDef:"stage",header:this.translate.instant("agrarianDemands.busqueda.tabla.escenario"),cell:m=>`${m.stage}`},{columnDef:"origenAgua",header:this.translate.instant("agrarianDemands.busqueda.tabla.origenAgua"),cell:m=>`${m.origenAguaDesc}`}],this.visorLink="/viewer/"+r.C.agrarianDemandEntity,this.disabledReportButton=!0,this.disabledSearchButton=!1,this.searchDoneObservable$=this.searchStatusService.searchSubject$.asObservable(),this.formStorageType=_.c.getEntityName(r.C.tipoEntidad.usosAgricolas,!0),this.selectedTabService.changeTab(0),this.numberPipe=new x.JJ(this.translate.currentLang),this.agrarianDemandService.getCombosBusqueda()}ngOnInit(){}ngOnDestroy(){}search(t){this.searchFilter=t,this.disabledSearchButton=!0,this.agrarianDemandService.getAgrarianDemands(t).subscribe(n=>{this.agrarianDemandService.getCountAgrarianDemands(t).subscribe(o=>{this.count=o,this.disabledReportButton=!(this.count>0),this.uelDemand=new De.e(!0,o,this.setViewerQueryParams(n));for(const s of this.uelDemand.data)s.hasGeometry||this.hideOptionsMapAndView(s);this.disabledSearchButton=!1}),this.selectedValueComboService.resetValueDemands()})}hideOptionsMapAndView(t){t.activeMap=!1}updatePage(t){this.agrarianDemandService.getAgrarianDemands(this.searchFilter,t.pageNumber.toString(),t.pageSize.toString(),t.sortDirection,t.sortField).subscribe(n=>{this.uelDemand=new De.e(!1,this.count,this.setViewerQueryParams(n));for(const o of this.uelDemand.data)o.hasGeometry||this.hideOptionsMapAndView(o);this.selectedValueComboService.resetValueDemands()})}setViewerQueryParams(t){for(const n of t){const o=M.K.getAgrarianDemandsViewerData(n,this.configService,n.stageOrden);n.entityName=o.entityName,n.queryParams=o.queryParams}return t}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(ye.o),e.Y36(c.sK),e.Y36(O.E),e.Y36(ce.x),e.Y36(L.O))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-search-list"]],outputs:{mensajeEvent:"mensajeEvent"},decls:10,vars:10,consts:[[1,"container-title"],[1,"mb-2"],[3,"typeKey","disabledReportButton","disabledSearchButton","
1newSearchEvent"],[4,"ngIf","ngIfElse"],["noResultados",""],["appBold",""],[3,"searchResult","tableColumns","dynamicEntityName","changePageEvent"],[4,"ngIf"],[1,"container-subtitle"]],template:function(t,n){if(1&t&&(e.TgZ(0,"div",0)(1,"h2"),e._uU(2),e.ALo(3,"translate"),e.qZA()(),e._UZ(4,"mat-divider",1),e.TgZ(5,"app-agrarian-demands-search-form",2),e.NdJ("newSearchEvent",function(s){return n.search(s)}),e.qZA(),e.YNc(6,ut,5,6,"ng-container",3),e.ALo(7,"async"),e.YNc(8,gt,1,1,"ng-template",null,4,e.W1O)),2&t){const o=e.MAs(9);e.xp6(2),e.Oqu(e.lcZ(3,6,"agrarianDemands.busqueda.titulo")),e.xp6(3),e.Q6J("typeKey",n.formStorageType)("disabledReportButton",n.disabledReportButton)("disabledSearchButton",n.disabledSearchButton),e.xp6(1),e.Q6J("ngIf",!0===e.lcZ(7,8,n.searchDoneObservable$)&&null!=n.uelDemand&&n.uelDemand.data.length>0)("ngIfElse",o)}},directives:[I.d,mt,x.O5,j.M,pt.D],pipes:[c.X$,x.Ov],styles:[""]}),a})(),ft=(()=>{class a{constructor(t,n){this.languageChangeService=t,this.translate=n,this.languageChangeService.language$.subscribe(o=>{this.translate.use(o)})}ngOnInit(){}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(P.S),e.Y36(c.sK))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-search"]],decls:1,vars:0,template:function(t,n){1&t&&e._UZ(0,"router-outlet")},directives:[f.lC],styles:[""]}),a})();var X=l(2170),vt=l(2511),z=l(3468),fe=l(3279),Se=l(9555),xt=l(5194),W=l(1155),Q=l(2600),bt=l(5245);function Ct(a,i){if(1&a&&(e.TgZ(0,"mat-list-item",26)(1,"div",27)(2,"span",28),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"span",29),e._uU(6),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblOrigenAgua")),e.xp6(3),e.Oqu(t.udaDemand.origenAguaDesc)}}function Zt(a,i){if(1&a&&(e.TgZ(0,"mat-list-item",26)(1,"div",27)(2,"span",28),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"span",29),e._uU(6),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblZonaRegableEstado")),e.xp6(3),e.Oqu(t.udaDemand.zonaRegableDesc)}}function Tt(a,i){if(1&a&&(e.TgZ(0,"mat-list-item",26)(1,"div",27)(2,"span",28),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"span",29),e._uU(6),e.ALo(7,"number"),e.ALo(8,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,3,"agrarianDemands.fichaGeneral.lblDotacionRiegoBruta")),e.xp6(3),e.AsE("",e.xi3(7,5,t.udaDemand.trendMod.dotacionBruta,t.numEnt)," ",e.lcZ(8,8,"unidades.m3Ha"),"")}}function At(a,i){if(1&a&&(e.TgZ(0,"mat-list-item",26)(1,"div",27)(2,"span",28),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"span",29),e._uU(6),e.ALo(7,"number"),e.ALo(8,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,3,"agrarianDemands.fichaGeneral.lblEficienciaGlobal")),e.xp6(3),e.AsE("",e.xi3(7,5,t.udaDemand.trendMod.eficienciaGlobal,t.numEnt)," ",e.lcZ(8,8,"unidades.porcentaje"),"")}}function Dt(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"span",34),e._uU(2),e.qZA()()),2&a){const t=i.$implicit;e.xp6(2),e.Oqu(t)}}function yt(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list-item",26)(2,"span",30),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"mat-list",31)(6,"mat-list-item",32),e.YNc(7,Dt,3,1,"div",33),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblSistemaExplotacion")),e.xp6(4),e.Q6J("ngForOf",t.udaDemand.sistExplotacion)}}function St(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"span",34),e._uU(2),e.qZA()()),2&a){const t=i.$implicit;e.xp6(2),e.Oqu(t)}}function Ut(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list-item",26)(2,"span",30),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"mat-list",31)(6,"mat-list-item",32),e.YNc(7,St,3,1,"div",33),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblProvincias")),e.xp6(4),e.Q6J("ngForOf",t.udaDemand.provincias)}}function qt(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"span",34),e._uU(2),e.qZA()()),2&a){const t=i.$implicit;e.xp6(2),e.Oqu(t)}}function Et(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list-item",26)(2,"span",30),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"mat-list",31)(6,"mat-list-item",32),e.YNc(7,qt,3,1,"div",33),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);
1e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblComarcas")),e.xp6(4),e.Q6J("ngForOf",t.udaDemand.comarcasAgrarias)}}function Nt(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"span",34),e._uU(2),e.qZA()()),2&a){const t=i.$implicit;e.xp6(2),e.Oqu(t)}}function Mt(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list-item",26)(2,"span",30),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"mat-list",31)(6,"mat-list-item",32),e.YNc(7,Nt,3,1,"div",33),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblMunicipios")),e.xp6(4),e.Q6J("ngForOf",t.udaDemand.municipios)}}function Ot(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"span",34),e._uU(2),e.ALo(3,"number"),e.ALo(4,"translate"),e.qZA()()),2&a){const t=i.$implicit,n=e.oxw(3);e.xp6(2),e.lnq("",t.nombre," (",e.xi3(3,3,t.habitantes,n.numEnt)," ",e.lcZ(4,6,"unidades.hab"),")")}}function It(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list-item",26)(2,"span",30),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"mat-list",31)(6,"mat-list-item",32),e.YNc(7,Ot,5,8,"div",33),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblNucleos")),e.xp6(4),e.Q6J("ngForOf",t.udaDemand.principalesNucleos)}}function Rt(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"span",34),e._uU(2),e.qZA()()),2&a){const t=i.$implicit;e.xp6(2),e.Oqu(t)}}function Lt(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list-item",26)(2,"span",30),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"mat-list",31)(6,"mat-list-item",32),e.YNc(7,Rt,3,1,"div",33),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaGeneral.lblEspaciosNaturales")),e.xp6(4),e.Q6J("ngForOf",t.udaDemand.espaciosNaturales)}}function Pt(a,i){if(1&a&&e._UZ(0,"app-image-map",35),2&a){const t=e.oxw(2);e.Q6J("entityDataMap",t.photoMap)("entitiesLayers",t.layer)}}function wt(a,i){if(1&a&&(e.TgZ(0,"div"),e._UZ(1,"app-bar-chart",36),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("chartData",t.barChartDemandMensualData)("chartOptions",t.barChartDemandaMensualOptions)}}function Qt(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",37)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e._UZ(5,"app-manage-basic-table",38),e.BQk()),2&a){const t=i.ngIf,n=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,4,"agrarianDemands.tablaMedidas.lblTitulo")),e.xp6(2),e.Q6J("searchResult",t)("tableColumns",n.tableConfiguration)("showPagination",!1)}}function Vt(a,i){if(1&a&&e._UZ(0,"app-map-icon",39),2&a){const t=e.oxw(2);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("target","_blank")}}function Jt(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",2)(1,"div",3)(2,"h2"),e._uU(3),e.qZA()(),e._UZ(4,"mat-divider",4),e.TgZ(5,"div",5)(6,"div",6)(7,"mat-list",7),e._UZ(8,"app-mat-list-item-text",8),e.YNc(9,Ct,7,4,"mat-list-item",9),e.YNc(10,Zt,7,4,"mat-list-item",9),e._UZ(11,"app-mat-list-item-number",10)(12,"app-mat-list-item-number",11),e.YNc(13,Tt,9,10,"mat-list-item",9),e.YNc(14,At,9,10,"mat-list-item",9),e.YNc(15,yt,8,4,"ng-container",12),e.YNc(16,Ut,8,4,"ng-container",12),e.YNc(17,Et,8,4,"ng-container",12),e.YNc(18,Mt,8,4,"ng-container",12),e.YNc(19,It,8,4,"ng-container",12),e.YNc(20,Lt,8,4,"ng-container",12),e.qZA()(),e.TgZ(21,"div",13),e.YNc(22,Pt,1,2,"app-image-map",14),e.TgZ(23,"div",15)(24,"div",16)(25,"h3"),e._uU(26),e.ALo(27,"translate"),e.qZA()(),e.YNc(28,wt,2,2,"div",12),e.TgZ(29,"div",17),e._uU(30),e.ALo(31,"translate"),e.qZA(),e.TgZ(32,"div",18),e._uU(33),e.ALo(34,"translate"),e.qZA()()()(),e.TgZ(35,"div",19)(36,"div",20),e.YNc(37,Qt,6,6,"ng-container",12),e.qZA()(),e.TgZ(38,"div",5)(39,"div",21)(40,"div",22),e.YNc(41,Vt,1,3,"app-map-icon",23),e.TgZ(42,"a",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return o.printData(o.udaDemand.id)}),e.TgZ(43,"mat-icon",25),e.ALo(44,"translate"),e._uU(45,"print"),e.qZA()()()()()()}if(2&a){const t=e.oxw();e.xp6(3),e.AsE("",t.udaDemand.id," - ",t.udaDemand.nombre,""),e.xp6(5),e.Q6J("elem",t.udaDemand.nombre)("label","agrarianDemands.fichaGeneral.lblNombre"),e.xp6(1),e.Q6J("ngIf",t.udaDemand.origenAguaDesc),e.xp6(1),e.Q6J("ngIf",t.udaDemand.zonaRegableDesc),e.xp6(1),e.Q6J("elem",t.udaDemand.trendMod.superfRegableAsignada)("unit","unidades.ha")("numberConstant",t.numEnt)("label","agrarianDemands.fic
1haGeneral.lblSuperficieRegable")("tooltip","agrarianDemands.fichaGeneral.ltltipSuperficieRegable"),e.xp6(1),e.Q6J("elem",t.udaDemand.trendMod.volumenDemandado)("unit","unidades.hm3")("numberConstant",t.numEnt)("label","agrarianDemands.fichaGeneral.lblVolumenDemandado")("tooltip","agrarianDemands.fichaGeneral.tltipVolumenDemandado")("transformAction","transformVolumeSingle"),e.xp6(1),e.Q6J("ngIf",t.udaDemand.trendMod.dotacionBruta),e.xp6(1),e.Q6J("ngIf",t.udaDemand.trendMod.eficienciaGlobal),e.xp6(1),e.Q6J("ngIf",t.udaDemand.sistExplotacion&&t.udaDemand.sistExplotacion.length>0),e.xp6(1),e.Q6J("ngIf",t.udaDemand.provincias&&t.udaDemand.provincias.length>0),e.xp6(1),e.Q6J("ngIf",t.udaDemand.comarcasAgrarias&&t.udaDemand.comarcasAgrarias.length>0),e.xp6(1),e.Q6J("ngIf",t.udaDemand.municipios&&t.udaDemand.municipios.length>0),e.xp6(1),e.Q6J("ngIf",t.udaDemand.principalesNucleos&&t.udaDemand.principalesNucleos.length>0),e.xp6(1),e.Q6J("ngIf",t.udaDemand.espaciosNaturales&&t.udaDemand.espaciosNaturales.length>0),e.xp6(2),e.Q6J("ngIf",t.photoMap),e.xp6(4),e.hij("",e.lcZ(27,33,"agrarianDemands.fichaGeneral.lblGraficaDemandaMensual")," "),e.xp6(2),e.Q6J("ngIf",t.barChartDemandMensualData.datasets.length>0),e.xp6(2),e.hij(" ",e.lcZ(31,35,"agrarianDemands.fichaTendencias.graficas.repartoMensual.tltipDemandaTele")," "),e.xp6(3),e.hij(" ",e.lcZ(34,37,"agrarianDemands.fichaTendencias.graficas.repartoMensual.tltipDemandaPac")," "),e.xp6(4),e.Q6J("ngIf",t.udaDemand.medidas&&t.udaDemand.medidas.length>0&&t.udaDemand.medidas),e.xp6(4),e.Q6J("ngIf",t.showMap),e.xp6(2),e.s9C("matTooltip",e.lcZ(44,39,"tootips.tltipImprimirFicha"))}}function Yt(a,i){1&a&&e._UZ(0,"app-spinner")}let Gt=(()=>{class a{constructor(t,n,o,s,d,p,m,v,h,Z,q){this.route=t,this.entityMenuService=n,this.udaService=o,this.chartConfigurationService=s,this.globalService=d,this.translateService=p,this.selectedTabService=m,this.translate=v,this.rolesService=h,this.dialogModelService=Z,this.configService=q,this.stop$=new A.x,this.perfilUsuario="",this.numRed=r.C.numRed,this.numEnt=r.C.numEnt,this.dateFormat=r.C.dateFormat,this.layer=[],this.entityName=r.C.elementaryAgrarianDemandEntity,this.showMap=!0,this.selectedTabService.changeTab(0),this.rolesService.profile$.pipe((0,U.R)(this.stop$)).subscribe(S=>{this.perfilUsuario=S}),this.barChartDemandaMensualOptions=this.chartConfigurationService.getDataBarUelMensualChartOptions(!0),this.translate.get(["agrarianDemands.tablaMedidas.lblNombre","agrarianDemands.tablaMedidas.lblEstado","agrarianDemands.tablaMedidas.lblInfoAdicional"]).subscribe(S=>{this.tableConfiguration=this.getTableConfiguration(S)})}ngOnInit(){let t=this.route.snapshot.paramMap.get("gid");null!=t&&(this.entityMenuService.submenuChange(!0),this.entityMenuService.gidEntitySubject$.next(t),this.udaService.getAgrarianDemandGeneral(Number(t)).pipe((0,U.R)(this.stop$)).subscribe(n=>{this.udaDemand=n,this.medidas=this.udaDemand.medidas;const o=M.K.getAgrarianDemandsViewerData(this.udaDemand,this.configService);_.c.isNullorEmpty(o.layerId)||this.layer.push(this.configService.getItemLayerById(o.layerId)),this.entityName=o.entityName,this.queryParams=o.queryParams,3!=this.udaDemand.hasGeometry&&(this.showMap=!1),3==this.udaDemand.hasGeometry&&this.udaService.getExtensionFeature(Number(t)).subscribe(s=>{this.photoMap=new X.lC([Number(t)],200===s.status?s.body:[])}),2==this.udaDemand.hasGeometry&&(1==this.udaDemand.origenAgua&&this.layer.push(this.configService.getItemLayerById(r.C.olMap.layerUdaSupDominada0)),2==this.udaDemand.origenAgua&&this.layer.push(this.configService.getItemLayerById(r.C.olMap.layerUdaHgDominada0)),3==this.udaDemand.origenAgua&&this.layer.push(this.configService.getItemLayerById(r.C.olMap.layerUdaHsDominada0)),this.udaService.getExtensionFeatureEnvelope(Number(t)).subscribe(s=>{this.photoMap=new X.lC([Number(t)],200===s.status?s.body:[])})),1==this.udaDemand.hasGeometry&&1==this.udaDemand.origenAgua&&(this.layer.push(this.configService.getItemLayerById(r.C.olMap.layerUdaTramoRegulado0)),this.udaService.getExtensionFeatureRegulatedSection(Number(t)).subscribe(s=>{this.photoMap=new X.lC([Number(t)],200===s.status?s.body:[])})),this.barChartDemandMensualData=M.K.prepareDataBarUelMensual(this.udaDemand.demandaMensual,this.udaDemand.id,this.translateService,this.perfilUsuario)}))}getTableConfiguration(t){return[{columnDef:"nombre",header:t["agrarianDemands.tablaMedidas.lblNombre"],cell:n=>`${n.nombreCorto}`},{columnDef:"estado",header:t["agrarianDemands.tablaMedidas.lblEstado"],cell:n=>`${n.estado}`},{columnDef:"infoAdicional",header:t["agrarianDemands.tablaMedidas.lblInfoAdicional"],cell:n=>`${n.informacionAdicional}`}]}printData(t){var n;let o=null===(n=document.getElementById("grafica"))||void 0===n?void 0:n.getElementsByTagName("canvas")[0];fetch(o.toDataURL()).then(s=>s.blob()).then(s=>{this.formData=new FormData,this.formData.append("imageGrafica",s,"uda.png"),vt.l.printDataImagen(t,r.C.tipoEntidad.usosAgricolasUeda,this.dialogModelService,this.translate,this.globalService,this.formData)})}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(f.gz),e.Y36(C.$),e.Y36(b.M),e.Y36(D.E),e.Y36(he.U),e.Y36(c.sK),e.Y36(L.O),e.Y36(c.sK),e.Y36(ne.f),e.Y36(z.r),e.Y36(O.E))}
1,a.\u0275cmp=e.Xpm({type:a,selectors:[["app-general-data"]],decls:3,vars:2,consts:[["class","container",4,"ngIf","ngIfElse"],["loading",""],[1,"container"],[1,"container-title"],[1,"mb-2"],[1,"row"],[1,"col-5"],["dense",""],[3,"elem","label"],["class","bar-light-blue mb-2",4,"ngIf"],[3,"elem","unit","numberConstant","label","tooltip"],[3,"elem","unit","numberConstant","label","tooltip","transformAction"],[4,"ngIf"],[1,"col-7","iframeMapa"],[3,"entityDataMap","entitiesLayers",4,"ngIf"],[1,"row","mt-5"],[1,"container-subtitle","text-center"],["id","hoverLegend",1,"alert","alert-light","d-none","text-center","w-160","small","black","float-start"],["id","hoverLegend2",1,"alert","alert-light","d-none","text-center","w-160","small","black","float-start"],[1,"row","mt-4"],[1,"col"],[1,"col-md-12","mt-3"],[1,"float-end"],[3,"entityName","queryParams","target",4,"ngIf"],["mat-flat-button","",3,"click"],["matTooltipPosition","below","matTooltipClass","custom-tooltip",1,"btn-icon-mat",3,"matTooltip"],[1,"bar-light-blue","mb-2"],["matLine",""],["appBold","",1,"float-start"],[1,"float-end","text-wrap"],["appBold",""],["dense","",1,"ms-5"],[1,"bar-lighter-blue","mb-2"],["matLine","",4,"ngFor","ngForOf"],[1,"float-start"],[3,"entityDataMap","entitiesLayers"],["id","grafica",3,"chartData","chartOptions"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","showPagination"],[3,"entityName","queryParams","target"]],template:function(t,n){if(1&t&&(e.YNc(0,Jt,46,41,"div",0),e.YNc(1,Yt,1,0,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",n.udaDemand)("ngIfElse",o)}},directives:[x.O5,I.d,J.i$,fe.f,J.Tg,F.X2,j.M,Se.B,x.sg,xt.E,le.u,W.D,Q.N,Y.zs,bt.Hw,k.gM,w.O],pipes:[c.X$,x.JJ],styles:[".container-title[_ngcontent-%COMP%]{border-left:6px solid #1c7696;padding-left:1rem}.container-subtitle[_ngcontent-%COMP%]{color:#1c7696}div.detail-info[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:first-child{font-weight:700}.detail-info[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin-bottom:0}.iframeMapa[_ngcontent-%COMP%]{text-align:-webkit-center;margin-top:1rem}.btn-first[_ngcontent-%COMP%]{background-color:#1b576d;color:#fff;margin:0 8px 8px 0;padding:0 28px;border-radius:unset}.btn-first[_ngcontent-%COMP%]:hover, .btn-first[_ngcontent-%COMP%]:focus, .btn-first[_ngcontent-%COMP%]:active, .btn-first.active[_ngcontent-%COMP%]{background-color:#0b475d;color:#fff}.btn-first.disabled[_ngcontent-%COMP%]:hover, .btn-first.disabled[_ngcontent-%COMP%]:focus, .btn-first.disabled[_ngcontent-%COMP%]:active, .btn-first.disabled.active[_ngcontent-%COMP%], .btn-first[disabled][_ngcontent-%COMP%]:hover, .btn-first[disabled][_ngcontent-%COMP%]:focus, .btn-first[disabled][_ngcontent-%COMP%]:active, .btn-first[disabled].active[_ngcontent-%COMP%], fieldset[disabled][_ngcontent-%COMP%]   .btn-first[_ngcontent-%COMP%]:hover, fieldset[disabled][_ngcontent-%COMP%]   .btn-first[_ngcontent-%COMP%]:focus, fieldset[disabled][_ngcontent-%COMP%]   .btn-first[_ngcontent-%COMP%]:active, fieldset[disabled][_ngcontent-%COMP%]   .btn-first.active[_ngcontent-%COMP%]{background-color:#1b576d;color:#fff}.comentarios[_ngcontent-%COMP%]{padding-top:16px!important;padding-bottom:16px!important;height:auto!important}"]}),a})();var ve=l(3251),Ue=l(7555),V=l(5448);function Bt(a,i){if(1&a&&(e.TgZ(0,"div",4)(1,"h2"),e._uU(2),e.qZA()()),2&a){const t=e.oxw();e.xp6(2),e.AsE("",t.udaDemandsDetail.id," - ",t.udaDemandsDetail.nombre,"")}}function Ft(a,i){if(1&a&&(e.TgZ(0,"div",24)(1,"span",25),e._uU(2),e.qZA()()),2&a){const t=i.$implicit;e.xp6(2),e.Oqu(t)}}function jt(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list",9)(2,"mat-list-item",20)(3,"span"),e._uU(4),e.ALo(5,"translate"),e.qZA()()(),e.TgZ(6,"mat-list",21)(7,"mat-list-item",22),e.YNc(8,Ft,3,1,"div",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,2,"agrarianDemands.fichaTecnica.lblTramoRegulado")),e.xp6(4),e.Q6J("ngForOf",t.udaDemandsDetail.listaTramosRegulados)}}function kt(a,i){if(1&a&&(e.TgZ(0,"div",24)(1,"span",25),e._uU(2),e.qZA()()),2&a){const t=i.$implicit;e.xp6(2),e.Oqu(t)}}function $t(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"mat-list",9)(2,"mat-list-item",20)(3,"span"),e._uU(4),e.ALo(5,"translate"),e.qZA()()(),e.TgZ(6,"mat-list",21)(7,"mat-list-item",22),e.YNc(8,kt,3,1,"div",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);
1e.xp6(4),e.Oqu(e.lcZ(5,2,"agrarianDemands.fichaTecnica.lblEmbalseRegulacion")),e.xp6(4),e.Q6J("ngForOf",t.udaDemandsDetail.listaEmbalsesRegulacion)}}function Ht(a,i){if(1&a&&(e.ynx(0),e._uU(1),e.BQk()),2&a){const t=i.$implicit,n=i.last;e.xp6(1),e.AsE(" ",t,"",n?"":", "," ")}}function zt(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",7)(2,"div",8)(3,"mat-list",9)(4,"mat-list-item",20)(5,"span"),e._uU(6),e.ALo(7,"translate"),e.qZA()()(),e.TgZ(8,"mat-list",21)(9,"mat-list-item",22),e.YNc(10,Ht,2,2,"ng-container",26),e.qZA()()()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(6),e.Oqu(e.lcZ(7,2,"agrarianDemands.fichaTecnica.lblSistemaExplotacion")),e.xp6(4),e.Q6J("ngForOf",t.udaDemandsDetail.sistExplotacion)}}function Wt(a,i){if(1&a&&(e.TgZ(0,"div",7)(1,"div",8)(2,"mat-list",9),e._UZ(3,"app-mat-list-item-text",10),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(3),e.Q6J("elem",t.udaDemandsDetail.comentarios)("label","agrarianDemands.fichaTecnica.lblComentarios")}}const Kt=function(a,i,t){return["../../fieldsHistory",a,i,t]};function Xt(a,i){if(1&a&&(e.TgZ(0,"button",27),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a){const t=e.oxw(2);e.Q6J("routerLink",e.kEZ(4,Kt,t.udaDemandsDetail.id,t.operacionGeneral,t.udaDemandsDetail.nombre)),e.xp6(1),e.Oqu(e.lcZ(2,2,"botones.historico"))}}function ea(a,i){if(1&a&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&a){const t=e.oxw(3);e.Tol(t.udaDemandsDetail.mensajeError.tipoMensaje),e.xp6(1),e.hij(" ",t.udaDemandsDetail.mensajeError.mensaje," ")}}function ta(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",28)(2,"div",29)(3,"h2"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.YNc(6,ea,2,3,"p",30),e._UZ(7,"app-manage-basic-table",31),e.qZA(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,6,"agrarianDemands.fichaTecnica.lblTituloTomasRetornosInfraestructuras")),e.xp6(2),e.Q6J("ngIf",t.udaDemandsDetail&&t.udaDemandsDetail.mensajeError&&null!=t.udaDemandsDetail.mensajeError.mensaje&&t.hasTomasRetornos),e.xp6(1),e.Q6J("searchResult",t.elementosTomasRetornosInfra)("tableColumns",t.tableConfiguration)("showPagination",!1)("visibleButtons",t.visibleButtons)}}function aa(a,i){if(1&a&&e._UZ(0,"app-map-icon",32),2&a){const t=e.oxw(2);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("target","_blank")}}const qe=function(){return["7"]};function na(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",6)(2,"h2"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",7)(6,"div",8)(7,"mat-list",9),e._UZ(8,"app-mat-list-item-text",10),e.qZA()()(),e.TgZ(9,"div",7)(10,"div",11)(11,"mat-list",9),e._UZ(12,"app-mat-list-item-text",10)(13,"app-mat-list-item-text",12)(14,"app-mat-list-item-text",12),e.YNc(15,jt,9,4,"ng-container",13),e.YNc(16,$t,9,4,"ng-container",13),e.qZA()(),e.TgZ(17,"div",11)(18,"mat-list",9),e._UZ(19,"app-mat-list-item-text",10),e.YNc(20,zt,11,4,"ng-container",13),e.qZA()()(),e.YNc(21,Wt,4,2,"div",14),e.TgZ(22,"div",7)(23,"div",15)(24,"div",16),e.YNc(25,Xt,3,8,"button",17),e.qZA()()(),e.YNc(26,ta,8,8,"ng-container",13),e.TgZ(27,"div",7)(28,"div",18)(29,"div",16),e.YNc(30,aa,1,3,"app-map-icon",19),e.qZA()()()()),2&a){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,20,"agrarianDemands.fichaTecnica.lblDatosGenerales")),e.xp6(5),e.Q6J("elem",t.udaDemandsDetail.nombre)("label","agrarianDemands.fichaTecnica.lblNombre"),e.xp6(4),e.Q6J("elem",t.udaDemandsDetail.codigoEuropeo)("label","agrarianDemands.fichaTecnica.lblCodigoEuropeo"),e.xp6(1),e.Q6J("elem",t.udaDemandsDetail.origenAguaDesc)("label","agrarianDemands.fichaTecnica.lblOrigenAgua")("tooltip","agrarianDemands.fichaTecnica.tltOrigenAgua"),e.xp6(1),e.Q6J("elem",t.udaDemandsDetail.origenRecursoDesc)("label","agrarianDemands.fichaTecnica.lblOrigenRecurso")("tooltip","agrarianDemands.fichaTecnica.tltipOrigenRecurso"),e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.listaTramosRegulados&&t.udaDemandsDetail.listaTramosRegulados.length>0),e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.listaEmbalsesRegulacion&&t.udaDemandsDetail.listaEmbalsesRegulacion.length>0),e.xp6(3),e.Q6J("elem",t.udaDemandsDetail.escenarioRefDesc)("label","agrarianDemands.fichaTecnica.lblEscenarioRef"),e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.sistExplotacion&&t.udaDemandsDetail.sistExplotacion.length>
10),e.xp6(1),e.Q6J("appHasrole",e.DdM(22,qe)),e.xp6(4),e.Q6J("appHasrole",e.DdM(23,qe)),e.xp6(1),e.Q6J("ngIf",t.elementosTomasRetornosInfra&&t.elementosTomasRetornosInfra.length>0),e.xp6(4),e.Q6J("ngIf",t.showMap)}}function ia(a,i){1&a&&e._UZ(0,"app-spinner")}let oa=(()=>{class a{constructor(t,n,o){this.tableConfigurationService=t,this.udaDemandsService=n,this.router=o,this.numRed=r.C.numRed,this.dateFormat=r.C.dateFormat,this.hasTomasRetornos=!1,this.operacionGeneral=r.C.operacion.OPERACION_GENERAL,this.visibleButtons={delete:{active:!0}},this.tableConfiguration=this.tableConfigurationService.getUdaTomasRetornosInfraestructurasTablaConfiguration()}ngOnInit(){this.udaDemandsService.getElementosTomasRetornosInfraestructuras(this.udaDemandsDetail.id).subscribe(t=>{this.elementosTomasRetornosInfra=t})}viewRelatedUDA(t){let n=_.c.getGeneralURL(r.C.tipoEntidad.usosAgricolas,t.toString());_.c.isDMADueroURL(n)?window.location.href=n:this.router.navigate([`${n}`])}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(V.A),e.Y36(b.M),e.Y36(f.F0))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-technical-data-no-perfil"]],inputs:{udaDemandsDetail:"udaDemandsDetail",entityName:"entityName",queryParams:"queryParams",entityNameUDA:"entityNameUDA",queryParamsUDA:"queryParamsUDA",showMap:"showMap"},decls:5,vars:4,consts:[["class","container-title mt-1",4,"ngIf","ngIfElse"],[1,"mb-2"],["class","container px-4",4,"ngIf","ngIfElse"],["loading",""],[1,"container-title","mt-1"],[1,"container","px-4"],[1,"container-subtitle"],[1,"row"],[1,"col","col-xl-12"],["dense",""],[3,"elem","label"],[1,"col","col-xl-6"],[3,"elem","label","tooltip"],[4,"ngIf"],["class","row",4,"appHasrole"],[1,"col-md-12"],[1,"float-end"],["class","btn-first","type","button","mat-flat-button","",3,"routerLink",4,"appHasrole"],[1,"col-md-12","mt-4"],[3,"entityName","queryParams","target",4,"ngIf"],[1,"bar-light-blue","mb-2"],["dense","",1,"ms-5"],[1,"bar-lighter-blue","mb-2"],["matLine","",4,"ngFor","ngForOf"],["matLine",""],[1,"float-start"],[4,"ngFor","ngForOf"],["type","button","mat-flat-button","",1,"btn-first",3,"routerLink"],[1,"col"],[1,"container-subtitle","mt-1"],[3,"class",4,"ngIf"],[3,"searchResult","tableColumns","showPagination","visibleButtons"],[3,"entityName","queryParams","target"]],template:function(t,n){if(1&t&&(e.YNc(0,Bt,3,2,"div",0),e._UZ(1,"mat-divider",1),e.YNc(2,na,31,24,"div",2),e.YNc(3,ia,1,0,"ng-template",null,3,e.W1O)),2&t){const o=e.MAs(4);e.Q6J("ngIf",n.udaDemandsDetail)("ngIfElse",o),e.xp6(2),e.Q6J("ngIf",n.udaDemandsDetail)("ngIfElse",o)}},directives:[x.O5,I.d,J.i$,fe.f,J.Tg,x.sg,F.X2,H.I,Y.lW,f.rH,W.D,Q.N,w.O],pipes:[c.X$],styles:[""]}),a})();var de=l(9506),me=l(4533),pe=l(2546);function ra(a,i){if(1&a&&(e.TgZ(0,"div",4)(1,"h2"),e._uU(2),e.qZA()()),2&a){const t=e.oxw();e.xp6(2),e.AsE("",t.udaDemandsDetail.id," - ",t.udaDemandsDetail.nombre,"")}}function sa(a,i){if(1&a&&(e.ynx(0),e._uU(1),e.BQk()),2&a){const t=i.$implicit,n=i.last;e.xp6(1),e.AsE(" ",t,"",n?"":", "," ")}}function la(a,i){if(1&a&&(e.TgZ(0,"div",36)(1,"div",16)(2,"div",10)(3,"div",17)(4,"span",12),e._uU(5),e.ALo(6,"translate"),e.qZA()(),e.TgZ(7,"div",18)(8,"span"),e._uU(9),e.qZA()()()()()),2&a){const t=e.oxw(2);
1e.xp6(5),e.Oqu(e.lcZ(6,2,"agrarianDemands.fichaTecnica.lblOrigenRecurso")),e.xp6(4),e.hij(" ",t.udaDemandsDetail.origenRecursoDesc," ")}}function ca(a,i){if(1&a&&(e.ynx(0),e._uU(1),e.BQk()),2&a){const t=i.$implicit,n=i.last;e.xp6(1),e.AsE(" ",t,"",n?"":", "," ")}}function da(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",11)(2,"span",12),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",13),e.YNc(6,ca,2,2,"ng-container",24),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaTecnica.lblTramoRegulado")),e.xp6(3),e.Q6J("ngForOf",t.udaDemandsDetail.listaTramosRegulados)}}function ma(a,i){if(1&a&&(e.TgZ(0,"div",36),e.YNc(1,da,7,4,"ng-container",32),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.listaTramosRegulados&&t.udaDemandsDetail.listaTramosRegulados.length>0)}}function pa(a,i){if(1&a&&(e.ynx(0),e._uU(1),e.BQk()),2&a){const t=i.$implicit,n=i.last;e.xp6(1),e.AsE(" ",t,"",n?"":", "," ")}}function ua(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",11)(2,"span",12),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",13),e.YNc(6,pa,2,2,"ng-container",24),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaTecnica.lblEmbalseRegulacion")),e.xp6(3),e.Q6J("ngForOf",t.udaDemandsDetail.listaEmbalsesRegulacion)}}function _a(a,i){if(1&a&&(e.TgZ(0,"div",8),e.YNc(1,ua,7,4,"ng-container",32),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.listaEmbalsesRegulacion&&t.udaDemandsDetail.listaEmbalsesRegulacion.length>0)}}const ga=function(a,i,t){return["../../fieldsHistory",a,i,t]};function ha(a,i){if(1&a&&(e.TgZ(0,"div",34)(1,"button",37),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"button",38),e._uU(5),e.ALo(6,"translate"),e._UZ(7,"i",39),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("routerLink",e.kEZ(7,ga,t.udaDemandsDetail.id,t.operacionGeneral,t.udaDemandsDetail.nombre)),e.xp6(1),e.Oqu(e.lcZ(3,3,"botones.historico")),e.xp6(3),e.hij("",e.lcZ(6,5,"botones.guardar")," ")}}function fa(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"button",44),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return o.validateVersions(o.operacionGeneral)}),e._uU(1),e.ALo(2,"translate"),e.qZA()}if(2&a){const t=e.oxw(3);e.Q6J("disabled",t.disableValidateBtn),e.xp6(1),e.Oqu(e.lcZ(2,2,"botones.valSeleccion"))}}const va=function(){return["2"]};function xa(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",8)(1,"div",40)(2,"div",41)(3,"h2"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",8)(7,"app-version-table",42),e.NdJ("newSelectEvent",function(o){e.CHM(t);const s=e.oxw(2);return s.addSelection(o,s.operacionGeneral)})("newValidateVersionEvent",function(o){e.CHM(t);const s=e.oxw(2);return s.validateVersions(s.operacionGeneral,o)})("newDeleteVersionEvent",function(o){return e.CHM(t),e.oxw(2).deleteVersion(o)}),e.qZA()(),e.TgZ(8,"div",8)(9,"div",30)(10,"div",34),e.YNc(11,fa,3,4,"button",43),e.qZA()()()()()}if(2&a){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,6,"versionado.controlVersiones")),e.xp6(3),e.Q6J("searchResult",t.udaControlVersiones)("tableColumns",t.tableConfiguration)("itemName",t.udaDemandsDetail.nombre)("entityType",t.udaDemandType),e.xp6(4),e.Q6J("appHasrole",e.Dd
1M(8,va))}}function ba(a,i){if(1&a&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&a){const t=e.oxw(3);e.Tol(t.udaDemandsDetail.mensajeError.tipoMensaje),e.xp6(1),e.hij(" ",t.udaDemandsDetail.mensajeError.mensaje," ")}}function Ca(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",40)(2,"div",45)(3,"h2"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.YNc(6,ba,2,3,"p",46),e._UZ(7,"app-manage-basic-table",47),e.qZA(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,6,"agrarianDemands.fichaTecnica.lblTituloTomasRetornosInfraestructuras")),e.xp6(2),e.Q6J("ngIf",t.udaDemandsDetail&&t.udaDemandsDetail.mensajeError&&null!=t.udaDemandsDetail.mensajeError.mensaje&&t.hasTomasRetornos),e.xp6(1),e.Q6J("searchResult",t.elementosTomasRetornosInfra)("tableColumns",t.tableConfigurationTomasRetornosInfraestructuras)("showPagination",!1)("visibleButtons",t.visibleButtons)}}function Za(a,i){if(1&a&&e._UZ(0,"app-map-icon",48),2&a){const t=e.oxw(2);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("target","_blank")}}function Ta(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",5)(1,"form",6,7),e.NdJ("ngSubmit",function(){return e.CHM(t),e.oxw().onSubmit()}),e.TgZ(3,"div",8)(4,"div",9)(5,"div",10)(6,"div",11)(7,"span",12),e._uU(8),e.ALo(9,"translate"),e.qZA()(),e.TgZ(10,"div",13)(11,"mat-form-field",14),e._UZ(12,"input",15),e.qZA()()()()(),e.TgZ(13,"div",8)(14,"div",16)(15,"div",10)(16,"div",17)(17,"span",12),e._uU(18),e.ALo(19,"translate"),e.qZA()(),e.TgZ(20,"div",18)(21,"mat-form-field",14),e._UZ(22,"input",19),e.qZA()()()(),e.TgZ(23,"div",16)(24,"div",10)(25,"div",20)(26,"span",12),e._uU(27),e.ALo(28,"translate"),e.qZA()(),e.TgZ(29,"div",21)(30,"span"),e._uU(31),e.qZA()()()()(),e.TgZ(32,"div",8)(33,"div",16)(34,"div",10)(35,"div",17)(36,"span",12),e._uU(37),e.ALo(38,"translate"),e.qZA()(),e.TgZ(39,"div",18)(40,"span"),e._uU(41),e.qZA()()()(),e.TgZ(42,"div",22)(43,"div",10)(44,"div",20)(45,"span",23),e.ALo(46,"translate"),e._uU(47),e.ALo(48,"translate"),e.qZA()(),e.TgZ(49,"div",21),e.YNc(50,sa,2,2,"ng-container",24),e.qZA()()()(),e.YNc(51,la,10,4,"div",25),e.YNc(52,ma,2,1,"div",25),e.YNc(53,_a,2,1,"div",26),e.TgZ(54,"div",27)(55,"div",11)(56,"span",12),e._uU(57),e.ALo(58,"translate"),e.qZA()(),e.TgZ(59,"div",13)(60,"mat-form-field",14),e._UZ(61,"textarea",28,29),e.qZA()()(),e.TgZ(63,"div",8)(64,"div",30),e.YNc(65,ha,8,11,"div",31),e.qZA()()(),e.YNc(66,xa,12,9,"div",26),e.YNc(67,Ca,8,8,"ng-container",32),e.TgZ(68,"div",8)(69,"div",33)(70,"div",34),e.YNc(71,Za,1,3,"app-map-icon",35),e.qZA()()()()}if(2&a){const t=e.oxw();
1e.xp6(1),e.Q6J("formGroup",t.technicalGroup),e.xp6(7),e.Oqu(e.lcZ(9,18,"agrarianDemands.fichaTecnica.lblNombre")),e.xp6(10),e.Oqu(e.lcZ(19,20,"agrarianDemands.fichaTecnica.lblCodigoEuropeo")),e.xp6(9),e.Oqu(e.lcZ(28,22,"agrarianDemands.fichaTecnica.lblEscenarioRef")),e.xp6(4),e.hij(" ",t.udaDemandsDetail.escenarioRefDesc," "),e.xp6(6),e.Oqu(e.lcZ(38,24,"agrarianDemands.fichaTecnica.lblOrigenAgua")),e.xp6(4),e.hij(" ",t.udaDemandsDetail.origenAguaDesc," "),e.xp6(4),e.s9C("matTooltip",e.lcZ(46,26,"agrarianDemands.fichaTecnica.lblSistemaExplotacion")),e.xp6(2),e.hij(" ",e.lcZ(48,28,"agrarianDemands.fichaTecnica.lblSistemaExplotacion"),""),e.xp6(3),e.Q6J("ngForOf",t.udaDemandsDetail.sistExplotacion),e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.origenRecursoDesc),e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.listaTramosRegulados),e.xp6(1),e.Q6J("ngIf",t.udaDemandsDetail.listaEmbalsesRegulacion),e.xp6(4),e.Oqu(e.lcZ(58,30,"agrarianDemands.fichaTecnica.lblComentarios")),e.xp6(8),e.Q6J("ngIf",t.showEdit),e.xp6(1),e.Q6J("ngIf",t.existVersions),e.xp6(1),e.Q6J("ngIf",t.elementosTomasRetornosInfra&&t.elementosTomasRetornosInfra.length>0),e.xp6(4),e.Q6J("ngIf",t.showMap)}}function Aa(a,i){1&a&&e._UZ(0,"app-spinner")}let Da=(()=>{class a{constructor(t,n,o,s,d,p,m){this.udaDemandService=t,this.router=n,this.fb=o,this.activatedRoute=s,this.dialogModelService=d,this.translate=p,this.tableConfigurationService=m,this.numRed=r.C.numRed,this.showEdit=!0,this.existVersions=!1,this.selection=[],this.disableValidateBtn=!0,this.stop$=new A.x,this.hasTomasRetornos=!1,this.selectedCombosTextValues={origenAgua:"",escenarioRef:""},this.matcher=new ae.o,this.matcher2=new ae.o,this.udaDemandType=r.C.tipoEntidad.usosAgricolas,this.operacionGeneral=r.C.operacion.OPERACION_GENERAL,this.operacionToma=r.C.operacion.OPERACION_TOMA_AGUAS,this.operacionRetorna=r.C.operacion.OPERACION_RETORNO_AGUAS,this.operacionInfraestructura=r.C.operacion.OPERACION_INFRAESTRUCTURA,this.operacionSistemaExplotacion=r.C.operacion.OPERACION_SISTEMAEXPLOTACION,this.numberPipe=new x.JJ(this.translate.currentLang),this.elementCheckNameList=[],this.elementCheckNameNumEntList=[],this.visibleButtons={},this.tooltip="",this.actionsColumnWidth=10,this.tableConfiguration=this.tableConfigurationService.getVersionTableConfiguration(),this.tableConfigurationTomasRetornosInfraestructuras=this.tableConfigurationService.getUdaTomasRetornosInfraestructurasTablaConfiguration()}ngOnInit(){this.createForm(),null!=this.udaDemandsDetail.id&&(this.udaDemandService.getElementosTomasRetornosInfraestructuras(this.udaDemandsDetail.id).subscribe(t=>{this.elementosTomasRetornosInfra=t,this.elementosTomasRetornosInfra.forEach(n=>{("Toma"===n.relacion||"Retorna"===n.relacion)&&(this.hasTomasRetornos=!0)})}),-1==this.udaDemandsDetail.escenarioRef&&(this.showEdit=!1),this.callToControlVersiones())}createForm(){this.technicalGroup=this.fb.group({nombre:this.fb.control({value:this.udaDemandsDetail.nombre,disabled:!1}),codigoEuropeo:this.fb.control({value:this.udaDemandsDetail.codigoEuropeo,disabled:!1}),comentarios:this.fb.control({value:this.udaDemandsDetail.comentarios,disabled:!1})}),this.initialValues=this.technicalGroup.value,this.elementCheckNameList=[],this.elementCheckNameNumEntList=[]}onSubmit(){if(this.technicalGroup.invalid)return;let t=_.c.compareObjects(this.initialValues,this.technicalGroup.value);Object.keys(t).length>0?this.router.navigate([`../../fieldsVersion/${this.udaDemandsDetail.id}/${this.operacionGeneral}`],{relativeTo:this.activatedRoute,state:this.prepareData(t)}):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.guardarCambios.titulo"),this.translate.instant("dialogos.guardarCambios.sinCambios"))}validateVersions(t,n){let o=[];n?o.push(n):o=this.getValidateVersionList(t),this.udaDemandService.validarBloque(o).subscribe(s=>{200===s.status?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),`${this.translate.instant("dialogos.validarVersion.validacionCorrecta")} ${s.body} ${this.translate.instant(s.body>1?"dialogos.validarVersion.variosElementos":"dialogos.validarVersion.1elemento")}`),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),this.translate.instant("dialogos.validarVersion.validacionError"))})}getValidateVersionList(t){let n=[];return t===this.operacionGeneral&&(n=this.selection),n}deleteVersion(t){this.udaDemandService.descartarOperacion(t.version,t.operacionEntidad).subscribe(n=>{n?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartar
1Version.titulo"),this.translate.instant("dialogos.descartarVersion.descartarCorrecta")),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartarVersion.titulo"),this.translate.instant("dialogos.descartarVersion.descartarError"))})}addSelection(t,n){n===this.operacionGeneral&&(this.disableValidateBtn=0===t.length,this.selection=t)}ngOnDestroy(){this.stop$.next(!0)}reloadComponent(){this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.navigate(["./"],{relativeTo:this.activatedRoute,queryParamsHandling:"merge"})}selectedValue(t){this.selectedCombosTextValues[t.source.ngControl.name]=t.source.triggerValue}prepareData(t){const n=Object.keys(this.selectedCombosTextValues).map(s=>s);let o=[];for(const s in t){let d,p,m=t[s];n.includes(s)?p=this.selectedCombosTextValues[s]:(m&&(this.elementCheckNameList.includes(s)?m=_.c.convertFormattedNumber(m.toString()):this.elementCheckNameNumEntList.includes(s)&&(m=_.c.convertFormattedEntNumber(m.toString()))),p=t[s]),d=new de.i(s,this.translate.instant(`agrarianDemands.fichaTecnica.lblsGuardarCambios.${s}`),m,p),o.push(d)}return o}callToControlVersiones(){this.udaDemandService.getControlDeVersiones(Number(this.udaDemandsDetail.id),this.operacionGeneral).subscribe(t=>{t.length>0&&(this.existVersions=!0),this.udaControlVersiones=t})}goToFieldsHistory(t){this.router.navigate([`../../fieldsHistory/${this.udaDemandsDetail.id}/${t}/${this.udaDemandsDetail.nombre}`],{relativeTo:this.activatedRoute,state:this.udaDemandsDetail})}viewRelatedUDA(t){let n=_.c.getGeneralURL(r.C.tipoEntidad.usosAgricolas,t.toString());_.c.isDMADueroURL(n)?window.location.href=n:this.router.navigate([`${n}`])}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(f.F0),e.Y36(u.qu),e.Y36(f.gz),e.Y36(z.r),e.Y36(c.sK),e.Y36(V.A))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-technical-data-perfil"]],inputs:{udaDemandsDetail:"udaDemandsDetail",combos:"combos",entityName:"entityName",queryParams:"queryParams",entityNameUDA:"entityNameUDA",queryParamsUDA:"queryParamsUDA",showMap:"showMap"},decls:5,vars:4,consts:[["class","container-title mt-1",4,"ngIf","ngIfElse"],[1,"mb-2"],["class","container px-4",4,"ngIf","ngIfElse"],["loading",""],[1,"container-title","mt-1"],[1,"container","px-4"],[3,"formGroup","ngSubmit"],["technicalForm","ngForm"],[1,"row"],[1,"col","col-xl-12"],[1,"row","inputRow"],[1,"col","col-xl-2","labelForm"],["appBold",""],[1,"col","col-xl-10"],["appearance","standard",1,"width-100"],["matInput","","name","nombre","type","text","formControlName","nombre"],[1,"col","col-xl-6"],[1,"col","col-xl-4","labelForm"],[1,"col","col-xl-8"],["matInput","","name","codigoEuropeo","type","text","formControlName","codigoEuropeo"],[1,"col","col-xl-5","labelForm"],[1,"col","col-xl-7"],[1,"col","col-xl-6","mb-4"],["appBold","","matTooltipPosition","after","matTooltipClass","custom-tooltip",3,"matTooltip"],[4,"ngFor","ngForOf"],["class","row mb-2",4,"ngIf"],["class","row",4,"ngIf"],[1,"row","mt-4"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","5","name","comentarios","formControlName","comentarios"],["autosize","cdkTextareaAutosize"],[1,"col-md-12"],["class","float-end",4,"ngIf"],[4,"ngIf"],[1,"col-md-12","mt-4"],[1,"float-end"],[3,"entityName","queryParams","target",4,"ngIf"],[1,"row","mb-2"],["type","button","mat-flat-button","",1,"btn-first",3,"routerLink"],["type","submit","mat-flat-button","",1,"btn-second"],[1,"fa-regular","fa-floppy-disk"],[1,"col"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","itemName","entityType","newSelectEvent","newValidateVersionEvent","newDeleteVersionEvent"],["class","btn-first","type","button","mat-flat-button","",3,"disabled","click",4,"appHasrole"],["type","button","mat-flat-button","",1,"btn-first",3,"disabled","click"],[1,"container-subtitle","mt-1"],[3,"class",4,"ngIf"],[3,"searchResult","tableColumns","showPagination","visibleButtons"],[3,"entityName","queryParams","target"]],template:function(t,n){if(1&t&&(e.YNc(0,ra,3,2,"div",0),e._UZ(1,"mat-divider",1),e.YNc(2,Ta,72,32,"div",2),e.YNc(3,Aa,1,0,"ng-template",null,3,e.W1O)),2&t){const o=e.MAs(4);e.Q6J("ngIf",n.udaDemandsDetail)("ngIfElse",o),e.xp6(2),e.Q6J("ngIf",n.udaDemandsDetail)("ngIfElse",o)}},directives:[x.O5,I.d,u._Y,u.JL,u.sg,j.M,R.KE,ie.Nt,u.Fj,u.JJ,u.u,k.gM,x.sg,me.IC,Y.lW,f.rH,pe.L,H.I,W.D,Q.N,w.O],pipes:[c.X$],styles:[".btn-first[_ngcontent-%COMP%]{background-color:#1b576d;color:#fff;margin:0 8px 8px 0;padding:0 28px;border-radius:unset}.btn-first[_ngcontent-%COMP%]:hover, .btn-first[_ngcontent-%COMP%]:focus, .btn-first[_ngcontent-%COMP%]:active, .btn-first.active[_ngcontent-%COMP%]{background-color:#0b475d;color:#fff}.btn-first.disabled[_ngcontent-%COMP%]:hover, .btn-first.disabled[_ngcontent-%COMP%]:focus, .btn-first.disabled[_ngcontent-%COMP%]:active, .btn-first.disabled.active[_ngcontent-%COMP%], .btn-first[disabled][_ngcontent-%COMP%]:hover, .btn-first[disabled][_ngcontent-%COMP%]:focus, .btn-first[disabled][_ngcontent-%COMP%]:active, .btn-first[disabled].active[_ngcontent-%COMP%], fieldset[disabled][_ngcontent-%COMP%]   .btn-first[_ngcontent-%COMP%]:hover, fieldset[disabled][_ngcontent-%COMP%]   .btn-first[_ngcontent-%COMP%]:focus, fieldset[disabled][_ngcontent-%COMP%]   .btn-first[_ngcontent-%COMP%]:active, fieldset[disabled][_ngcontent-%COMP%]   .btn-first.active[_ngcontent-%COMP%]{background-color:#1b576d;color:#fff}.btn-second[_ngcontent-%COMP%]{background-color:#1c7696;color:#fff;margin:0 8px 8px 0;padding:0 28px;border-radius:unset}.btn-second[_ngcontent-%COMP%]:hover, .btn-second[_ngcontent-%COMP%]:focus, .btn-second[_ngcontent-%COMP%]:active, .btn-second.active[_ngcontent-%COMP%]{background-color:#0c6686;border-color:#002f45;color:#fff}.btn-second.disabled[_ngcontent-%COMP%]:hover, .btn-second.disabled[_ngcontent-%COMP%]:focus, .btn-second.disabled[_ngcontent-%COMP%]:active, .btn-second.disabled.active[_ngcontent-%COMP%], .btn-second[disabled][_ngcontent-%COMP%]:hover, .btn-second[disabled][_ngcontent-%COMP%]:focus, .btn-second[disabled][_ngcontent-%COMP%]:active, .btn-second[disabled].active[_ngcontent-%COMP%], fieldset[disabled][_ngcontent-%COMP%]   .btn-second[_ngcontent-%COMP%]:hover, fieldset[disabled][_ngcontent-%COMP%]   .btn-second[_ngcontent-%COMP%]:focus, fieldset[disabled][_ngcontent-%COMP%]   .btn-second[_ngcontent-%COMP%]:active, fieldset[disabled][_ngcontent-%COMP%]   .btn-second.active[_ngcontent-%COMP%]{background-color:#1c7696;color:#fff}"]}),a})();function ya(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",8)(2,"div",9)(3,"h3"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e._UZ(6,"app-manage-basic-table",10),e.qZA(),e.BQk()),2&a){const t=e.oxw();
1e.xp6(4),e.Oqu(e.lcZ(5,9,"agrarianDemands.fichaCaptaciones.lblTituloCaptaciones")),e.xp6(2),e.Q6J("searchResult",t.tablaCaptaciones)("tableColumns",t.tableCaptacionesConfiguration)("visibleButtons",t.visibleButtons)("urlSearch",t.urlSearchCaptaciones)("urlMapVisor",t.urlMapVisorCaptaciones)("nameId","id")("actionsColumnWidth",10)("showPagination",!0)}}let Sa=(()=>{class a{constructor(t,n,o){this.tableConfigurationService=t,this.route=n,this.entityMenuService=o,this.isProfile=!1,this.visibleButtons={search:{active:!0},map:{active:!0}},this.urlSearchCaptaciones="/public/pressures/grantingWaterExtraction/search/technical/",this.urlMapVisorCaptaciones="/viewer/"+r.C.grantingWaterExtractEntity,this.stop$=new A.x,this.tableCaptacionesConfiguration=this.tableConfigurationService.getUELTablaCaptacionesConfiguration()}ngOnInit(){let t=this.route.snapshot.paramMap.get("gid");null!=t&&(this.entityMenuService.submenuChange(!0),this.entityMenuService.gidEntitySubject$.next(t),this.tablaCaptaciones=this.demandDetail.listaCaptacionesAsociadas),this.visibleButtons=this.isProfile?{search:{active:!0},edit:{active:!1},delete:{active:!1},map:{active:!0}}:{search:{active:!0},edit:{active:!1},delete:{active:!1},map:{active:!1}}}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(V.A),e.Y36(f.gz),e.Y36(C.$))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-captations"]],inputs:{demandDetail:"demandDetail",entityName:"entityName",isProfile:"isProfile",queryParams:"queryParams"},decls:10,vars:7,consts:[[1,"container-title","mt-1"],[1,"mb-2"],[1,"container"],[4,"ngIf"],[1,"row"],[1,"col-md-12"],[1,"float-end"],[3,"entityName","queryParams","entityId","target"],[1,"col"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","visibleButtons","urlSearch","urlMapVisor","nameId","actionsColumnWidth","showPagination"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"h2"),e._uU(2),e.qZA()(),e._UZ(3,"mat-divider",1),e.TgZ(4,"div",2),e.YNc(5,ya,7,11,"ng-container",3),e.TgZ(6,"div",4)(7,"div",5)(8,"div",6),e._UZ(9,"app-map-icon",7),e.qZA()()()()),2&t&&(e.xp6(2),e.AsE("",n.demandDetail.id," - ",n.demandDetail.nombre,""),e.xp6(3),e.Q6J("ngIf",n.tablaCaptaciones&&n.tablaCaptaciones.length>0),e.xp6(4),e.Q6J("entityName",n.entityName)("queryParams",n.queryParams)("entityId",n.demandDetail.id)("target","_blank"))},directives:[I.d,x.O5,W.D,Q.N],pipes:[c.X$],styles:[""]}),a})();var Ua=l(9808),qa=l(1708),Ea=l(3718);function Na(a,i){if(1&a&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&a){const t=e.oxw(2);e.Tol(t.trends.mensajeValidacionSuperficie.tipoMensaje),e.xp6(1),e.hij(" ",t.trends.mensajeValidacionSuperficie.mensaje," ")}}function Ma(a,i){if(1&a&&(e.TgZ(0,"mat-option",39),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function Oa(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"form",30,31)(2,"div",32),e.ynx(3),e.TgZ(4,"div",33)(5,"div",34)(6,"h3"),e._uU(7),e.ALo(8,"translate"),e.qZA()()(),e.TgZ(9,"div",35)(10,"mat-form-field",36)(11,"mat-select",37),e.NdJ("selectionChange",function(o){return e.CHM(t),e.oxw(2).changeValueStagesCombo(o)}),e.YNc(12,Ma,2,2,"mat-option",38),e.qZA()()(),e.BQk(),e.qZA()()}if(2&a){const t=e.oxw(2);
1e.Q6J("formGroup",t.stageGroup),e.xp6(7),e.Oqu(e.lcZ(8,3,"agrarianDemands.fichaTendencias.lblEscenarioConsulta")),e.xp6(5),e.Q6J("ngForOf",t.stagesCombo)}}function Ia(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipSuperficieRegable")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblSuperficieRegable"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.superfRegableAsignada,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.ha")," ")}}function Ra(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21),e._uU(11),e.ALo(12,"translate"),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipVolDemandado")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblVolDemandado"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.volumenDemandado,t.numRed)," "),e.xp6(3),e.hij(" ",e.lcZ(12,11,"unidades.m3")," ")}}function La(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipVolDemandadoGanadero")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblVolDemandadoGanadero"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.volumenDemandadoGanadero,"transformVolumeSingle").value,t.numRed)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.volumenDemandadoGanadero,"transformVolumeSingle").units," ")}}function Pa(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21),e._uU(11),e.ALo(12,"translate"),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipVolDemandadoAgricola")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblVolDemandadoAgricola"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.volumenDemandado+t.trends.volumenDemandadoGanadero,t.numRed)," "),e.xp6(3),e.hij(" ",e.lcZ(12,11,"unidades.m3")," ")}}function wa(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipDemandIncreaseCC")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblDemandIncreaseCC"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.demandIncreaseCC,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.porcentaje")," ")}}function Qa(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipDemandVolumeCC")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblDemandVolumeCC"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.demandVolumeCC,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.m3")," ")}}function Va(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(2);
1e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipDotacionRiegoNeta")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblDotacionRiegoNeta"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.dotacionNeta,"transformVolumeM3Ha").value,t.numRed)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.dotacionNeta,"transformVolumeM3Ha").units," ")}}function Ja(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipDotacionRiegoBruta")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblDotacionRiegoBruta"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.dotacionBruta,"transformVolumeM3Ha").value,t.numRed)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.dotacionBruta,"transformVolumeM3Ha").units," ")}}function Ya(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipDotacionRiegoComarcal")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblDotacionRiegoComarcal"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.dotacionComarcal,"transformVolumeM3Ha").value,t.numRed2Dec)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.dotacionComarcal,"transformVolumeM3Ha").units," ")}}function Ga(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Ba(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Fa(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",5)(2,"div",18)(3,"span",40),e.ALo(4,"translate"),e._uU(5),e.ALo(6,"translate"),e.qZA()(),e.TgZ(7,"div",20)(8,"mat-form-field",41),e._UZ(9,"input",42),e.YNc(10,Ga,3,3,"mat-error",17),e.qZA()(),e.TgZ(11,"div",21),e._uU(12),e.ALo(13,"translate"),e.qZA()(),e.TgZ(14,"div",5)(15,"div",18)(16,"span",40),e.ALo(17,"translate"),e._uU(18),e.ALo(19,"translate"),e.qZA()(),e.TgZ(20,"div",20)(21,"mat-form-field",41),e._UZ(22,"input",43),e.YNc(23,Ba,3,3,"mat-error",17),e.qZA()(),e.TgZ(24,"div",21),e._uU(25),e.ALo(26,"translate"),e.qZA()(),e.BQk()),2&a){const t=e.oxw(2);let n,o;e.xp6(3),e.s9C("matTooltip",e.lcZ(4,10,"agrarianDemands.fichaTendencias.tltipVolumenServido")),e.xp6(2),e.hij(" ",e.lcZ(6,12,"agrarianDemands.fichaTendencias.lblVolumenServido")," "),e.xp6(4),e.Q6J("errorStateMatcher",t.matcher),e.xp6(1),e.Q6J("ngIf",null==(n=t.trendsGroup.get("volumenServido"))?null:n.hasError),e.xp6(2),e.hij(" ",e.lcZ(13,14,"unidades.m3")," "),e.xp6(4),e.s9C("matTooltip",e.lcZ(17,16,"agrarianDemands.fichaTendencias.tltipVolumenRetornado")),e.xp6(2),e.hij(" ",e.lcZ(19,18,"agrarianDemands.fichaTendencias.lblVolumenRetornado")," "),e.xp6(4),e.Q6J("errorStateMatcher",t.matcher),e.xp6(1),e.Q6J("ngIf",null==(o=t.trendsGroup.get("volumenRetornado"))?null:o.hasError),e.xp6(2),e.hij(" ",e.lcZ(26,20,"unidades.m3")," ")}}function ja(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21),e._UZ(11,"span"),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,3,"agrarianDemands.fichaTendencias.tltipCoefSuperficial")),e.xp6(2),e.hij(" ",e.lcZ(5,5,"agrarianDemands.fichaTendencias.lblCoefSuperficial"),""),e.xp6(4),e.hij(" ",e.xi3(9,7,t.trends.coeficienteSuperficial,t.numRed)," ")}}function ka(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21),e._UZ(11,"span"),e.qZA()()),2&a){const t=e.oxw(2);
1e.xp6(2),e.s9C("matTooltip",e.lcZ(3,3,"agrarianDemands.fichaTendencias.tltipCoefInfiltracion")),e.xp6(2),e.hij(" ",e.lcZ(5,5,"agrarianDemands.fichaTendencias.lblCoefInfiltracion"),""),e.xp6(4),e.hij(" ",e.xi3(9,7,t.trends.coeficienteInfiltracion,t.numRed)," ")}}function $a(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(3);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipVolDerecho")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblVolDerecho"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.volumenDerecho,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.m3")," ")}}function Ha(a,i){if(1&a&&(e.ynx(0),e.YNc(1,$a,14,13,"div",16),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.trends.volumenDerecho)}}function za(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(3);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipVolMedioSuministrado")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblVolMedioSuministrado"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.volumenMedioSuministrado,"transformVolumeSingle").value,t.numRed)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.volumenMedioSuministrado,"transformVolumeSingle").units," ")}}function Wa(a,i){if(1&a&&(e.ynx(0),e.YNc(1,za,15,17,"div",16),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.trends.volumenMedioSuministrado)}}function Ka(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipVolMedioPac")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblVolMedioPac"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.volumenMedioPac,"transformVolumeSingle").value,t.numRed)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.volumenMedioPac,"transformVolumeSingle").units," ")}}function Xa(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipVolMedioTele")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblVolMedioTele"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.volumenMedioTele,"transformVolumeSingle").value,t.numRed)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.volumenMedioTele,"transformVolumeSingle").units," ")}}function en(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipRiegoGravedad")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblRiegoGravedad"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.riegoGravedad,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.porcentaje")," ")}}function tn(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);
1e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipRiegoAspersion")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblRiegoAspersion"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.riegoAspersion,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.porcentaje")," ")}}function an(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipRiegoLocalizado")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblRiegoLocalizado"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.riegoLocalizado,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.porcentaje")," ")}}function nn(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipSuperficieDigitalizada")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblSuperficieDigitalizada"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.superficieDigitalizada,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.ha")," ")}}function on(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"transformValue"),e.qZA()(),e.TgZ(11,"div",21)(12,"span"),e._uU(13),e.ALo(14,"transformValue"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipSuperficieDerecho")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblSuperficieDerecho"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,e.xi3(10,11,t.trends.superficieDerecho,"transformAreaHa").value,t.numRed)," "),e.xp6(5),e.hij(" ",e.xi3(14,14,t.trends.superficieDerecho,"transformAreaHa").units," ")}}function rn(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipSuperficiePac")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblSuperficiePac"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.superficieMediaPac,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.ha")," ")}}function sn(a,i){if(1&a&&(e.TgZ(0,"div",5)(1,"div",18)(2,"span",19),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",20)(7,"span"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"div",21)(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(2);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,4,"agrarianDemands.fichaTendencias.tltipSuperficieTele")),e.xp6(2),e.hij(" ",e.lcZ(5,6,"agrarianDemands.fichaTendencias.lblSuperficieTele"),""),e.xp6(4),e.hij(" ",e.xi3(9,8,t.trends.superficieMediaTele,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(13,11,"unidades.ha")," ")}}function ln(a,i){1&a&&(e.TgZ(0,"div",44)(1,"div",45)(2,"span",46),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",47)(6,"mat-form-field",41),e._UZ(7,"textarea",48,49),e.qZA()()()),2&a&&(e.xp6(3),e.Oqu(e.lcZ(4,1,"agrarianDemands.fichaTendencias.lblComentarios")))}const cn=function(a,i,t,n){return["../../fieldsHistory",a,i,t,n,0]};function dn(a,i){if(1&a&&(e.TgZ(0,"button",54),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a){const t=e.oxw(3);e.Q6J("routerLink",e.l5B(4,cn,t.udaDetail.id,t.tabTrends,t.udaDetail.nombre,t.getSearchStage())),e.xp6(1),e.Oqu(e.lcZ(2,2,"botones.historico"))}}function mn(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"button",55),e.NdJ("click",function(){return e.CHM(t),e.oxw(3).onSubmit()}),e._uU(1),e.ALo(2,"translate"),e._UZ(3,"i",56),e.qZA()}2&a&&(e.xp6(1),e.hij("",e.lcZ(2,1,"botones.guardar")," "))}function pn(a,i){if(1&a&&e._UZ(0,"app-map-icon",57),2&a){const t=e.oxw(3);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.udaDetail.id)("target","_blank")}}const ue=function(){return["4","2","7"]};function un(a,i){if(1&a&&(e.TgZ(0,"div",50),e.YNc(1,dn,3,9,"button",51),e.YNc(2,mn,4,3,"button",52),e.YNc(3,pn,1,4,"app-map-icon",53),e.qZA()),2&a){const t=e.oxw(2);
1e.xp6(1),e.Q6J("appHasrole",e.DdM(3,ue)),e.xp6(1),e.Q6J("appHasrole",e.DdM(4,ue)),e.xp6(1),e.Q6J("ngIf",t.showMap)}}function _n(a,i){if(1&a&&e._UZ(0,"app-map-icon",57),2&a){const t=e.oxw(3);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.udaDetail.id)("target","_blank")}}function gn(a,i){if(1&a&&(e.TgZ(0,"div",50),e.YNc(1,_n,1,4,"app-map-icon",53),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.showMap)}}function hn(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"button",63),e.NdJ("click",function(){return e.CHM(t),e.oxw(4).validateVersions()}),e._uU(1),e.ALo(2,"translate"),e.qZA()}if(2&a){const t=e.oxw(4);e.Q6J("disabled",t.disableValidateBtn),e.xp6(1),e.Oqu(e.lcZ(2,2,"botones.valSeleccion"))}}const fn=function(){return["2"]};function vn(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",5)(1,"div",58)(2,"div",59)(3,"h2"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",5)(7,"app-version-table",60),e.NdJ("newSelectEvent",function(o){return e.CHM(t),e.oxw(3).addSelection(o)})("newValidateVersionEvent",function(o){return e.CHM(t),e.oxw(3).validateVersions(o)})("newDeleteVersionEvent",function(o){return e.CHM(t),e.oxw(3).deleteVersion(o)}),e.qZA()(),e.TgZ(8,"div",5)(9,"div",61)(10,"div",50),e.YNc(11,hn,3,4,"button",62),e.qZA()()()()()}if(2&a){const t=e.oxw(3);e.xp6(4),e.Oqu(e.lcZ(5,6,"versionado.controlVersiones")),e.xp6(3),e.Q6J("searchResult",t.udaControlVersiones)("tableColumns",t.tableConfiguration)("itemName",t.udaDetail.nombre)("entityType",t.udaDemandType),e.xp6(4),e.Q6J("appHasrole",e.Dd
1M(8,fn))}}function xn(a,i){if(1&a&&(e.ynx(0),e.YNc(1,vn,12,9,"div",16),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.existVersions)}}function bn(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"div",64)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div"),e._UZ(6,"app-bar-chart",65),e.qZA(),e.TgZ(7,"div")(8,"div",66),e._uU(9),e.ALo(10,"translate"),e.qZA(),e.TgZ(11,"div",67),e._uU(12),e.ALo(13,"translate"),e.qZA()()()),2&a){const t=e.oxw(3);e.xp6(3),e.hij("",e.lcZ(4,5,"agrarianDemands.fichaTendencias.lblGraficaDemandaMensual")," "),e.xp6(3),e.Q6J("chartData",t.barChartDemandMensualData)("chartOptions",t.barChartDemandaMensualOptions),e.xp6(3),e.hij(" ",e.lcZ(10,7,"agrarianDemands.fichaTendencias.graficas.repartoMensual.tltipDemandaTele")," "),e.xp6(3),e.hij(" ",e.lcZ(13,9,"agrarianDemands.fichaTendencias.graficas.repartoMensual.tltipDemandaPac")," ")}}function Cn(a,i){if(1&a&&(e.ynx(0),e.YNc(1,bn,14,11,"div",26),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.barChartDemandMensualData.datasets.length>0)}}function Zn(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"div",64)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div"),e._UZ(6,"app-bar-chart",65),e.qZA(),e.TgZ(7,"div",68),e._uU(8),e.ALo(9,"translate"),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(3),e.hij("",e.lcZ(4,4,"agrarianDemands.fichaTendencias.lblGraficaDemandaAnual")," "),e.xp6(3),e.Q6J("chartData",t.barChartDemandAnualData)("chartOptions",t.barChartDemandaAnualOptions),e.xp6(2),e.hij(" ",e.lcZ(9,6,"agrarianDemands.fichaTendencias.graficas.repartoMensual.tltipDemandaTele")," ")}}function Tn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",64)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e._UZ(5,"app-pie-chart",69),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.hij("",e.lcZ(4,4,"agrarianDemands.fichaTendencias.lblGraficaCultivosTipo")," "),e.xp6(2),e.Q6J("chartData",t.pieChartCultivosTipoData)("chartOptions",t.pieChartCultivosTipoOptions)("chartSize",t.chartSize2)}}function An(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",70)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e._UZ(5,"app-pie-chart",69),e.BQk()),2&a){const t=e.oxw(2);e.xp6(3),e.hij("",e.lcZ(4,4,"agrarianDemands.fichaTendencias.graficas.distribucionVolDemandaAgricola.title")," "),e.xp6(2),e.Q6J("chartData",t.pieChartDistribucionVolDemandadoAgricolaData)("chartOptions",t.pieChartDistribucionVolDemandadoAgricolaOptions)("chartSize",t.chartSize2)}}function Dn(a,i){if(1&a&&(e.TgZ(0,"div",27)(1,"div",64)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div"),e._UZ(6,"app-bar-chart",65),e.qZA(),e.TgZ(7,"div",71),e._uU(8),e.ALo(9,"translate"),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(3),e.hij("",e.lcZ(4,4,"agrarianDemands.fichaTendencias.lblGraficaSuperficieAnual")," "),e.xp6(3),e.Q6J("chartData",t.barChartSuperficieData)("chartOptions",t.barChartSuperficieOptions),e.xp6(2),e.hij(" ",e.lcZ(9,6,"agrarianDemands.fichaTendencias.graficas.repartoMensual.tltipDemandaTele")," ")}}function yn(a,i){if(1&a&&(e.TgZ(0,"div",72)(1,"div",64)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div"),e._UZ(6,"app-bar-chart",69),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(3),e.hij("",e.lcZ(4,4,"agrarianDemands.fichaTendencias.lblGraficaCultivosAnio")," "),e.xp6(3),e.Q6J("chartData",t.barChartData)("chartOptions",t.barChartOptions)("chartSize",t.chartSize)}}function Sn(a,i){if(1&a&&(e.TgZ(0,"div",72)(1,"div",64)(2,"h3"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e._UZ(5,"app-livestock-graph",73),e.qZA()),2&a){const t=e.oxw(2);e.xp6(3),e.hij("",e.lcZ(4,2,"agrarianDemands.fichaTendencias.graficas.ganaderaPorAnyo.title")," "),e.xp6(2),e.Q6J("dataGraph",t.graficaDistribucionGanadera)}}function Un(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",4)(1,"div",5),e.YNc(2,Na,2,3,"p",6),e.TgZ(3,"div",7),e.YNc(4,Oa,13,5,"form",8),e.qZA()(),e.TgZ(5,"div",9)(6,"form",10,11),e.NdJ("ngSubmit",function(){return e.CHM(t),e.oxw().onSubmit()}),e.TgZ(8,"div",7)(9,"div",5)(10,"div",12)(11,"mat-list",13),e._UZ(12,"app-mat-list-item-text",14),e.qZA()(),e.TgZ(13,"div",12)(14,"mat-list",13),e._UZ(15,"app-mat-list-item-text",14),e.qZA()()()(),e.TgZ(16,"div",15)(17,"h3"),e._uU(18),e.ALo(19,"translate"),e.qZA()(),e.TgZ(20,"div",5)(21,"div",12),e.YNc(22,Ia,14,13,"div",16),e.YNc(23,Ra,13,13,"div",16),e.YNc(24,La,15,17,"div",16),e.YNc(25,Pa,13,13,"div",16),e.YNc(26,wa,14,13,"div",16),e.YNc(27,Qa,14,13,"div",16),e.qZA(),e.TgZ(28,"div",12),e.YNc(29,Va,15,17,"div",16),e.YNc(30,Ja,15,17,"div",16),e.YNc(31,Ya,15,17,"div",16),e.qZA()(),e.TgZ(32,"div",5)(33,"div",7)(34,"div",15)(35,"h3"),e._uU(36),e.ALo(37,"translate"),e.qZA()()()(),e.TgZ(38,"div",5)(39,"div",12),e.YNc(40,Fa,27,22,"ng-container",17),e.qZA(),e.TgZ(41,"div",12),e.YNc(42,ja,12,10,"div",16),e.YNc(43,ka,12,10,"div",16),e.qZA()(),e.TgZ(44,"div",5)(45,"div",12)(46,"div",15)(47,"h3"),e._uU(48),e.ALo(49,"translate"),e.qZA()()(),e.TgZ(50,"div",12)(51,"div",15)(52,"h3"),e._uU(53),e.ALo(54,"translate"),e.qZA()()()(),e.TgZ(55,"div",5)(56,"div",12),e.YNc(57,Ha,2,1,"ng-container",17),e.YNc(58,Wa,2,1,"ng-container",17),e.YNc(59,Ka,15,17,"div",16),e.YNc(60,Xa,15,17,"div",16),e.qZA(),e.TgZ(61,"div",12),e.YNc(62,en,14,13,"div",16),e.YNc(63,tn,14,13,"div",16),e.YNc(64,an,14,13,"div",16),e.qZA()(),e.TgZ(65,"div",5)(66,"div",12)(67,"div",15)(68,"h3"),e._uU(69),e.ALo(70,"translate"),e.qZA()()(),e.TgZ(71,"div",12)(72,"div",15)(73,"h3"),e._uU(74),e.ALo(75,"translate"),e.qZA()()()(),e.TgZ(76,"div",5)(77,"div",12),e.YNc(78,nn,14,13,"div",16),e.YNc(79,on,15,17,"div",16),e.YNc(80,rn,14,13,"div",16),e.YNc(81,sn,14,13,"div",16),e.qZA(),e.TgZ(82,"div",12)(83,"div",5)(84,"div",18)(85,"span",19),e.ALo(86,"translate"),e._uU(87),e.ALo(88,"translate"),e.qZA()(),e.TgZ(89,"div",20)(90,"span"),e._uU(91),e.ALo(92,"number"),e.qZA()(),e.TgZ(93,"div",21)(94,"span"),e._uU(95),e.ALo(96,"translate"),e.qZA()()(),e.TgZ(97,"div",5)(98,"div",18)(99,"span",19),e.ALo(100,"translate"),e._uU(101),e.ALo(102,"translate"),e.qZA()(),e.TgZ(103,"div",20)(104,"span"),e._uU(105),e.ALo(106,"number"),e.qZA()(),e.TgZ(107,"div",21)(108,"span"),e._uU(109),e.ALo(110,"translate"),e.qZA()()(),e.TgZ(111,"div",5)(112,"div",18)(113,"span",19),e.ALo(114,"translate"),e._uU(115),e.ALo(116,"translate"),e.qZA()(),e.TgZ(117,"div",20)(118,"span"),e._uU(119),e.ALo(120,"number"),e.qZA()(),e.TgZ(121,"div",21)(122,"span"),e._uU(123),e.ALo(124,"translate"),e.qZA()()(),e.TgZ(125,"div",5)(126,"div",18)(127,"span",19),e.ALo(128,"translate"),e._uU(129),e.ALo(130,"translate"),e.qZA()(),e.TgZ(131,"div",20)(132,"span"),e._uU(133),e.ALo(134,"number"),e.qZA()(),e.TgZ(135,"div",21)(136,"span"),e._uU(137),e.ALo(138,"translate"),e.qZA()()()()(),e.YNc(139,ln,9,3,"div",22),e.TgZ(140,"div",5)(141,"div",23),e.YNc(142,un,4,5,"div",24),e.YNc(143,gn,2,1,"div",24),e.qZA()()()(),e.YNc(144,xn,2,1,"ng-container",25),e.TgZ(145,"div",5),e.YNc(146,Cn,2,1,"ng-container",17),e.YNc(147,Zn,10,8,"div",26),e.qZA(),e.TgZ(148,"div",5)(149,"div",27),e.YNc(150,Tn,6,6,"ng-container",17),e.YNc(151,An,6,6,"ng-container",17),e.qZA(),e.YNc(152,Dn,10,8,"div",26),e.qZA(),e.TgZ(153,"div",5),e.YNc(154,yn,7,6,"div",28),e.qZA(),e.YNc(155,Sn,6,4,"div",29),e.qZA()}if(2&a){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",t.trends&&t.trends.mensajeValidacionSuperficie&&null!=t.trends.mensajeValidacionSuperficie.mensaje),e.xp6(2),e.Q6J("ngIf",t.stagesCombo),e.xp6(2),e.Q6J("formGroup",t.trendsGroup),e.xp6(6),e.Q6J("elem",t.udaDetail.origenAguaDesc)("label","agrarianDemands.fic
1haTendencias.lblOrigenAgua")("tooltip","agrarianDemands.fichaTendencias.lblOrigenAgua"),e.xp6(3),e.Q6J("elem",t.udaDetail.origenRecursoDesc)("label","agrarianDemands.fichaTendencias.lblOrigenRecurso")("tooltip","agrarianDemands.fichaTendencias.tltipOrigenRecurso"),e.xp6(3),e.Oqu(e.lcZ(19,65,"agrarianDemands.fichaTendencias.datosPlanHidro")),e.xp6(4),e.Q6J("ngIf",t.trends.superfRegableAsignada),e.xp6(1),e.Q6J("ngIf",t.trends.volumenDemandado),e.xp6(1),e.Q6J("ngIf",t.trends.volumenDemandadoGanadero),e.xp6(1),e.Q6J("ngIf",t.trends.volumenDemandado||t.trends.volumenDemandadoGanadero),e.xp6(1),e.Q6J("ngIf",3==t.stageYear),e.xp6(1),e.Q6J("ngIf",3==t.stageYear),e.xp6(2),e.Q6J("ngIf",t.trends.dotacionNeta),e.xp6(1),e.Q6J("ngIf",t.trends.dotacionBruta),e.xp6(1),e.Q6J("ngIf",t.trends.dotacionComarcal),e.xp6(5),e.Oqu(e.lcZ(37,67,"agrarianDemands.fichaTendencias.datosVolumenes")),e.xp6(4),e.Q6J("ngIf",t.isProfile),e.xp6(2),e.Q6J("ngIf",t.trends.coeficienteSuperficial),e.xp6(1),e.Q6J("ngIf",t.trends.coeficienteInfiltracion),e.xp6(5),e.Oqu(e.l
1cZ(49,69,"agrarianDemands.fichaTendencias.datosApoyoVol")),e.xp6(5),e.Oqu(e.lcZ(54,71,"agrarianDemands.fichaTendencias.tipologiaRiego")),e.xp6(4),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",t.trends.volumenMedioPac),e.xp6(1),e.Q6J("ngIf",t.trends.volumenMedioTele),e.xp6(2),e.Q6J("ngIf",null!==t.trends.riegoGravedad),e.xp6(1),e.Q6J("ngIf",null!==t.trends.riegoAspersion),e.xp6(1),e.Q6J("ngIf",null!==t.trends.riegoLocalizado),e.xp6(5),e.Oqu(e.lcZ(70,73,"agrarianDemands.fichaTendencias.datosApoyoSup")),e.xp6(5),e.Oqu(e.lcZ(75,75,"agrarianDemands.fichaTendencias.eficiencia")),e.xp6(4),e.Q6J("ngIf",t.trends.superficieDigitalizada&&!t.udaDetail.smallIrrigation),e.xp6(1),e.Q6J("ngIf",t.trends.superficieDerecho&&t.isProfile),e.xp6(1),e.Q6J("ngIf",t.trends.superficieMediaPac),e.xp6(1),e.Q6J("ngIf",t.trends.superficieMediaTele),e.xp6(4),e.s9C("matTooltip",e.lcZ(86,77,"agrarianDemands.fichaTendencias.tltipEficienciaTrans")),e.xp6(2),e.hij(" ",e.lcZ(88,79,"agrarianDemands.fichaTendencias.lblEficienciaTrans"),""),e.xp6(4),e.hij(" ",e.xi3(92,81,t.trends.eficienciaTransporte,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(96,84,"unidades.porcentaje")," "),e.xp6(4),e.s9C("matTooltip",e.lcZ(100,86,"agrarianDemands.fichaTendencias.tltipEficienciaDistri")),e.xp6(2),e.hij(" ",e.lcZ(102,88,"agrarianDemands.fichaTendencias.lblEficienciaDistri"),""),e.xp6(4),e.hij(" ",e.xi3(106,90,t.trends.eficienciaDistribucion,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(110,93,"unidades.porcentaje")," "),e.xp6(4),e.s9C("matTooltip",e.lcZ(114,95,"agrarianDemands.fichaTendencias.tltipEficienciaApli")),e.xp6(2),e.hij(" ",e.lcZ(116,97,"agrarianDemands.fichaTendencias.lblEficienciaApli"),""),e.xp6(4),e.hij(" ",e.xi3(120,99,t.trends.eficienciaAplicacion,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(124,102,"unidades.porcentaje")," "),e.xp6(4),e.s9C("matTooltip",e.lcZ(128,104,"agrarianDemands.fichaTendencias.tltipEficienciaGlobal")),e.xp6(2),e.hij(" ",e.lcZ(130,106,"agrarianDemands.fichaTendencias.lblEficienciaGlobal"),""),e.xp6(4),e.hij(" ",e.xi3(134,108,t.trends.eficienciaGlobal,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(138,111,"unidades.porcentaje")," "),e.xp6(2),e.Q6J("appHasrole",e.Dd
1M(113,ue)),e.xp6(3),e.Q6J("ngIf",t.showEdit),e.xp6(1),e.Q6J("ngIf",!t.showEdit),e.xp6(1),e.Q6J("appHasrole",e.DdM(114,ue)),e.xp6(2),e.Q6J("ngIf",t.barChartDemandMensualData),e.xp6(1),e.Q6J("ngIf",t.barChartDemandAnualData.datasets.length>0),e.xp6(3),e.Q6J("ngIf",t.pieChartCultivosTipoData.datasets[0].data.length>0),e.xp6(1),e.Q6J("ngIf",t.trends.volumenDemandado||t.trends.volumenDemandadoGanadero),e.xp6(1),e.Q6J("ngIf",t.barChartSuperficieData.datasets.length>0),e.xp6(2),e.Q6J("ngIf",t.barChartData.datasets.length>0),e.xp6(1),e.Q6J("ngIf",t.graficaDistribucionGanadera&&t.graficaDistribucionGanadera.length>0)}}function qn(a,i){1&a&&e._UZ(0,"app-spinner")}let En=(()=>{class a{constructor(t,n,o,s,d,p,m,v,h,Z,q){this.udaService=t,this.fb=n,this.rolesService=o,this.translate=s,this.chartConfigurationService=d,this.tableConfigurationService=p,this.dialogModelService=m,this.router=v,this.configService=h,this.activatedRoute=Z,this.selectedValueComboService=q,this.isProfile=!1,this.actualAnyoTrendEvent=new e.vpe,this.showEdit=!0,this.chartSize={width:550,height:550},this.chartSize2={width:200,height:200},this.existVersions=!1,this.selection=[],this.udaDemandType=r.C.tipoEntidad.usosAgricolas,this.disableValidateBtn=!0,this.elementCheckNameNumDecList=[],this.tabTrends=r.C.operacion.OPERACION_UDA_TENDENCIAS,this.numRed=r.C.numRed,this.numRed2Dec=r.C.numRed2Dec,this.numRed4Dec=r.C.numRed4Dec,this.numberPipe=new x.JJ(this.translate.currentLang),this.matcher=new ae.o,this.perfilUsuario="",this.stop$=new A.x,this.rolesService.profile$.pipe((0,U.R)(this.stop$)).subscribe(E=>{this.perfilUsuario=E}),this.tableConfiguration=this.tableConfigurationService.getVersionTableConfiguration(),this.selectedValueComboService.valueComboDemandsTrendsYearSubject$.pipe((0,U.R)(this.stop$)).subscribe(E=>{this.stageSearch=E}),this.barChartDemandaMensualOptions=3!=this.stageYear?this.chartConfigurationService.getDataBarUelMensualChartOptions(!0):this.chartConfigurationService.getDataBarUelMensualStage3ChartOptions(!0);let S="unidades.hm3";this.barChartDemandaAnualOptions=this.chartConfigurationService.getDataBarUelAnualChartOptions(!0,"Volumen",S),this.pieChartCultivosTipoOptions=this.chartConfigurationService.getPieChartOptionsPorcentajeUEL(!1,""),S="unidades.ha",this.barChartSuperficieOptions=this.chartConfigurationService.getDataBarUelAnualChartOptions(!0,"Superficie",S)}ngOnInit(){var t=this;this.stageYear=-1!=this.stageSearch?this.stageSearch:this.udaDetail.escenarioRef,-1==this.udaDetail.escenarioRef&&(this.stageYear=-1,this.showEdit=!1),null!=this.udaDetail.id&&this.udaService.getComboEscenarios(this.udaDetail.id).subscribe(function(){var n=(0,$.Z)(function*(o){t.stagesCombo=o,t.stageGroup=t.fb.group({stage:t.fb.control({value:t.stageYear,disabled:!1})}),t.udaService.getDistribucionGanaderaAnyo(t.udaDetail.id).subscribe(s=>{t.graficaDistribucionGanadera=s}),t.udaService.getTendencias(t.udaDetail.id,t.stageYear).subscribe(s=>{t.trends=s,t.createForm(),t.cultivos=t.trends.cultivosTipo,t.buildChartsConfig(),(t.perfilUsuario===r.C.perfilValidador||t.perfilUsuario===r.C.perfilTecnico||t.perfilUsuario===r.C.perfilTecnicoInformes)&&t.getVersions(t.stageYear)})});return function(o){return n.apply(this,arguments)}}())}buildPieVolDemandadoAgricolaChartConfig(){this.pieChartDistribucionVolDemandadoAgricolaOptions=this.chartConfigurationService.getPieChartOptions(!1,this.translate.instant("unidades.m3"));let t=[],n=[],o=[];return this.trends.volumenDemandado&&(t.push(this.trends.volumenDemandado),n.push(this.translate.instant("agrarianDemands.fichaTendencias.graficas.distribucionVolDemandaAgricola.lblRegadio")),o.push("#ff6600")),this.trends.volumenDemandadoGanadero&&(t.push(this.trends.volumenDemandadoGanadero),n.push(this.translate.instant("agrarianDemands.fichaTendencias.graficas.distribucionVolDemandaAgricola.lblGanaderia")),o.push("#800000")),{labels:n,datasets:[{data:t,backgroundColor:o,hoverBackgroundColor:o}]}}buildChartsConfig(){3!=this.stageYear?(this.barChartDemandaMensualOptions=this.chartConfigurationService.getDataBarUelMensualChartOptions(!0),this.barChartDemandMensualData=M.K.prepareDataBarUelMensual(this.trends.demandaMensual,this.udaDetail.id,this.translate,this.perfilUsuario)):(this.barChartDemandaMensualOptions=this.chartConfigurationService.getDataBarUelMensualStage3ChartOptions(!0),this.barChartDemandMensualData=M.K.prepareDataBarUelMensualStage3(this.trends.demandaMensual,this.udaDetail.id,this.translate,this.perfilUsuario)),this.barChartDemandAnualData=M.K.prepareDataBarUelAnual(this.trends.demandaAnual,this.udaDetail.id,this.translate,this.perfilUsuario),this.barChartSuperficieData=M.K.prepareDataBarUelSuperficie(this.trends.superficieAnual,this.translate),_.c.getPieChartColors(13),this.pieChartCultivosTipoData=M.K.buildPieChartConfig(this.prepareLabel(this.trends.cultivosTipo),this.prepareTooltips(this.trends.cultivosTipo),this.prepareDataPiechart(this.trends.cultivosTipo),this.prepareColors(this.trends.cultivosTipo)),this.buildBarChartConfig(this.prepareBarChartData(this.trends.cultivosAnio)),this.pieChartDistribucionVolDemandadoAgricolaData=this.buildPieVolDemandadoAgricolaChartConfig()}getVersions(t){this.resetVersions(),this.udaService.getControlDeVersiones(Number(this.udaDetail.id),this.tabTrends,t).subscribe(n=>{n.length>0&&(this.existVersions=!0),this.udaControlVersiones=n})}resetVersions(){this.selection=[],this.existVersions=!1,this.udaControlVersiones=[]}createForm(){var t,n;this.trendsGroup=this.fb.group({volumenRetornado:this.fb.control({value:this.numberPipe.transform(null===(t=this.trends)||void 0===t?void 0:t.volumenRetornado,this.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),volumenServido:this.fb.control({value:this.numberPipe.transform(null===(n=this.trends)||void 0===n?void 0:n.volumenServido,this.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),comentarios:this.fb.control({value:this.trends.comentarios,disabled:!1})}),this.initialValues=this.trendsGroup.value,this.elementCheckNameNumDecList=["volumenRetornado","volumenServido"]}getTrendsData(t,n){var o=this;return(0,$.Z)(function*(){return yield(0,Ua.n)(o.udaService.getTendencias(t,n))})()}changeValueStagesCombo(t){this.selectedValueComboService.valueChangeDemansTrendsYear(t.value),this.udaService.getTendencias(this.udaDetail.id,t.value).subscribe(n=>{this.trends=n;
1let o=this.formatTrendData(n);this.stageYear=o.stage,(this.perfilUsuario===r.C.perfilValidador||this.perfilUsuario===r.C.perfilTecnico)&&(this.trendsGroup.patchValue(o),this.initialValues=this.trendsGroup.value,this.showEdit=!0,-1==this.trends.stage&&(this.showEdit=!1),this.getVersions(t.value));const s=M.K.getAgrarianDemandsViewerData(this.udaDetail,this.configService,t.value);this.entityName=s.entityName,this.queryParams=s.queryParams,this.buildChartsConfig()})}formatTrendData(t){let n=Object.assign({},t);for(const o in n)(this.elementCheckNameNumDecList.includes(o)||"stage"===o||"origenAgua"===o)&&_.c.updateProperty(n,o,this.numberPipe.transform(n[o],r.C.numRed));return n}onSubmit(){if(this.trendsGroup.invalid)return void alert("grupo invalido");let t=_.c.compareObjects(this.initialValues,this.trendsGroup.value);Object.keys(t).length>0?this.router.navigate([`../../fieldsVersion/${this.udaDetail.id}/${this.tabTrends}`],{relativeTo:this.activatedRoute,state:{comparedObject:this.prepareData(t),item:this.trends,year:this.stageYear}}):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.guardarCambios.titulo"),this.translate.instant("dialogos.guardarCambios.sinCambios"))}prepareData(t){let n=[];for(const o in t){let s,d=t[o],p=null!=t[o]?t[o]:"";d&&this.elementCheckNameNumDecList.includes(o)&&(d=_.c.convertFormattedNumber(d.toString()));let m=this.trendsGroup.controls[o].hasValidator(u.kI.required);s=new de.i(o,this.translate.instant(`agrarianDemands.fichaTendencias.lblsGuardarCambios.${o}`),d,p,m),n.push(s)}return n}validateVersions(t){let n=[];t?n.push(t):n=this.selection.map(o=>o),this.udaService.validarBloque(n).subscribe(o=>{200===o.status?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),`${this.translate.instant("dialogos.validarVersion.validacionCorrecta")} ${o.body} ${this.translate.instant(o.body>1?"dialogos.validarVersion.variosElementos":"dialogos.validarVersion.1elemento")}`),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),this.translate.instant("dialogos.validarVersion.validacionError"))})}deleteVersion(t){this.udaService.descartarOperacion(t.version,t.operacionEntidad).subscribe(n=>{n?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartarVersion.titulo"),this.translate.instant("dialogos.descartarVersion.descartarCorrecta")),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartarVersion.titulo"),this.translate.instant("dialogos.descartarVersion.descartarError"))})}addSelection(t){this.disableValidateBtn=0===t.length,this.selection=t}reloadComponent(){this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.navigate(["./"],{relativeTo:this.activatedRoute,queryParamsHandling:"merge"})}goToFieldsHistory(){this.router.navigate([`../../fieldsHistory/${this.udaDetail.id}/${this.tabTrends}/${this.udaDetail.nombre}/${this.getSearchStage()}/0`],{relativeTo:this.activatedRoute,state:void 0})}ngOnDestroy(){this.stop$.next(!0)}prepareLabel(t){return t.map(n=>n.groupDescrip)}prepareColors(t){return t.map(n=>n.color)}prepareDataPiechart(t){return t.map(n=>n.surface)}prepareTooltips(t){return t.map(n=>n.tooltip)}prepareBarChartData(t){const n=new Map;t.forEach(m=>{var v;let{groupDescrip:h,anio:Z,surface:q,color:S,porcen:E,descrip:K}=m;_.c.isNullorEmpty(h)&&(h=this.translate.instant("measures.data.graficas.presupuesto.sinClasificar")),n.has(h)||n.set(h,[]),null===(v=n.get(h))||void 0===v||v.push({anio:Z,surface:q,color:S,porcen:E,descrip:K})});const o=[];let s=0;n.forEach((m,v)=>{o.push(this.getBarChartDatasetObject(v,m.map(h=>({label:h.anio.toString(),value:h.surface,color:h.color,porcen:h.porcen,descrip:h.descrip})))),s++});const p=o.findIndex(m=>-1!=m.label.indexOf("Barbecho"));if(-1!==s){const[m]=o.splice(p,1);o.push(m)}return o}getBarChartDatasetObject(t,n,o=1){const s=(new Date).getFullYear();return{label:t,data:n,backgroundColor:n.map(d=>Number(d.label)<s?d.color:`${d.color}80`),borderColor:n.map(d=>Number(d.label)<s?d.color:`${d.color}80`),borderWidth:o}}buildBarChartConfig(t){this.barChartData={datasets:t},this.barChartOptions=this.chartConfigurationService.getUELStackedBarChartOptions(this.translate.instant("unidades.ha"),!0,!1,"",this.translate.instant("agrarianDemands.fic
1haTendencias.graficas.cultivosPorAnyo.titleEjeY"))}getSearchStage(){return this.stageGroup.controls.stage.value}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(u.qu),e.Y36(ne.f),e.Y36(c.sK),e.Y36(D.E),e.Y36(V.A),e.Y36(z.r),e.Y36(f.F0),e.Y36(O.E),e.Y36(f.gz),e.Y36(ce.x))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-trend"]],inputs:{udaDetail:"udaDetail",entityName:"entityName",queryParams:"queryParams",combos:"combos",isProfile:"isProfile",showMap:"showMap"},outputs:{actualAnyoTrendEvent:"actualAnyoTrendEvent"},decls:8,vars:4,consts:[[1,"container-title","mt-1"],[1,"mb-2"],["class","container",4,"ngIf","ngIfElse"],["loading",""],[1,"container"],[1,"row"],[3,"class",4,"ngIf"],[1,"col","col-xl-12"],[3,"formGroup",4,"ngIf"],[1,"container","px-4"],[3,"formGroup","ngSubmit"],["trendsForm","ngForm"],[1,"col","col-xl-6"],["dense",""],[3,"elem","label","tooltip"],[1,"container-subtitle","mt-2"],["class","row",4,"ngIf"],[4,"ngIf"],[1,"col","col-xl-6","labelForm"],["appBold","","matTooltipPosition","below","matTooltipClass","custom-tooltip",3,"matTooltip"],[1,"col","col-xl-3"],[1,"col","col-xl-2"],["class","row mt-3",4,"appHasrole"],[1,"col-md-12","mt-4"],["class","float-end",4,"ngIf"],[4,"appHasrole"],["class","col col-xl-6 mt-5",4,"ngIf"],[1,"col","col-xl-6","mt-5"],["class","col col-xl-12  mt-5",4,"ngIf"],["class","col col-xl-12 mt-5",4,"ngIf"],[3,"formGroup"],["stageForm","ngForm"],[1,"row","mt-2","justify-content-end"],[1,"col-auto","labelForm","lh-lg"],[1,"container-subtitle"],[1,"col-auto"],["appearance","standard"],["name","stage","formControlName","stage",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["matTooltipPosition","below","matTooltipClass","custom-tooltip","appBold","",3,"matTooltip"],["appearance","standard",1,"width-100"],["matInput","","name","volumenServido","type","text","formControlName","volumenServido",3,"errorStateMatcher"],["matInput","","name","volumenRetornado","type","text","formControlName","volumenRetornado",3,"errorStateMatcher"],[1,"row","mt-3"],[1,"col","col-xl-3","labelForm"],["appBold",""],[1,"col","col-xl-8"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","5","name","comentarios","formControlName","comentarios"],["autosize","cdkTextareaAutosize"],[1,"float-end"],["class","btn-first","type","button","mat-flat-button","",3,"routerLink",4,"appHasrole"],["class","btn-second","type","button","mat-flat-button","",3,"click",4,"appHasrole"],[3,"entityName","queryParams","entityId","target",4,"ngIf"],["type","button","mat-flat-button","",1,"btn-first",3,"routerLink"],["type","button","mat-flat-button","",1,"btn-second",3,"click"],[1,"fa-regular","fa-floppy-disk"],[3,"entityName","queryParams","entityId","target"],[1,"col"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","itemName","entityType","newSelectEvent","newValidateVersionEvent","newDeleteVersionEvent"],[1,"col-md-12"],["class","btn-first","type","button","mat-flat-button","",3,"disabled","click",4,"appHasrole"],["type","button","mat-flat-button","",1,"btn-first",3,"disabled","click"],[1,"container-subtitle","text-center"],[3,"chartData","chartOptions"],["id","hoverLegend",1,"alert","alert-light","d-none","text-center","w-160","small","black","float-start"],["id","hoverLegend2",1,"alert","alert-light","d-none","text-center","w-160","small","black","float-start"],["id","hoverLegend3",1,"alert","alert-light","d-none","text-center","w-160","small","black","float-start"],[3,"chartData","chartOptions","chartSize"],[1,"container-subtitle","text-center","mt-2"],["id","hoverLegend4",1,"alert","alert-light","d-none","text-center","w-160","small","black","float-start"],[1,"col","col-xl-12","mt-5"],[3,"dataGraph"]],template:function(t,n){if(1&t&&(e.ynx(0),e.TgZ(1,"div",0)(2,"h2"),e._uU(3),e.qZA()(),e._UZ(4,"mat-divider",1),e.YNc(5,Un,156,115,"div",2),e.BQk(),e.YNc(6,qn,1,0,"ng-template",null,3,e.W1O)),2&t){const o=e.MAs(7);e.xp6(3),e.AsE("",n.udaDetail.id," - ",n.udaDetail.nombre,""),e.xp6(2),e.Q6J("ngIf",n.trends)("ngIfElse",o)}},directives:[I.d,x.O5,u._Y,u.JL,u.sg,R.KE,te.gD,u.JJ,u.u,x.sg,F.ey,J.i$,fe.f,j.M,k.gM,ie.Nt,u.Fj,R.TO,H.I,me.IC,Y.lW,f.rH,Q.N,pe.L,le.u,Ae.J,qa.A,w.O],pipes:[c.X$,x.JJ,Ea.V],styles:[""]}),a})();var Nn=l(8288);function Mn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.l
1cZ(2,1,"validacionForm.numero")))}function On(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",21),e.qZA(),e.YNc(4,Mn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expectedShortage1"))?null:n.hasError("pattern"))}}function In(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expectedShortage1)("numberConstant",t.numRed)}}function Rn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Ln(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",24),e.qZA(),e.YNc(4,Rn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected1Shortage1"))?null:n.hasError("pattern"))}}function Pn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected1Shortage1)("numberConstant",t.numRed)}}function wn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Qn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",25),e.qZA(),e.YNc(4,wn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected2Shortage1"))?null:n.hasError("pattern"))}}function Vn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected2Shortage1)("numberConstant",t.numRed)}}function Jn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Yn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",26),e.qZA(),e.YNc(4,Jn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected3Shortage1"))?null:n.hasError("pattern"))}}function Gn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected3Shortage1)("numberConstant",t.numRed)}}function Bn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Fn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",27),e.qZA(),e.YNc(4,Bn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expectedShortage2"))?null:n.hasError("pattern"))}}function jn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expectedShortage2)("numberConstant",t.numRed)}}function kn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function $n(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",28),e.qZA(),e.YNc(4,kn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected1Shortage2"))?null:n.hasError("pattern"))}}function Hn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected1Shortage2)("numberConstant",t.numRed)}}function zn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Wn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",29),e.qZA(),e.YNc(4,zn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected2Shortage2"))?null:n.hasError("pattern"))}}function Kn(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected2Shortage2)("numberConstant",t.numRed)}}function Xn(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.l
1cZ(2,1,"validacionForm.numero")))}function ei(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",30),e.qZA(),e.YNc(4,Xn,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected3Shortage2"))?null:n.hasError("pattern"))}}function ti(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected3Shortage2)("numberConstant",t.numRed)}}function ai(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function ni(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",31),e.qZA(),e.YNc(4,ai,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expectedShortage10"))?null:n.hasError("pattern"))}}function ii(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expectedShortage10)("numberConstant",t.numRed)}}function oi(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function ri(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",32),e.qZA(),e.YNc(4,oi,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected1Shortage10"))?null:n.hasError("pattern"))}}function si(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected1Shortage10)("numberConstant",t.numRed)}}function li(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function ci(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",33),e.qZA(),e.YNc(4,li,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected2Shortage10"))?null:n.hasError("pattern"))}}function di(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected2Shortage10)("numberConstant",t.numRed)}}function mi(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function pi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",34),e.qZA(),e.YNc(4,mi,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected3Shortage10"))?null:n.hasError("pattern"))}}function ui(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected3Shortage10)("numberConstant",t.numRed)}}function _i(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function gi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",35),e.qZA(),e.YNc(4,_i,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expectedVolumeShortage"))?null:n.hasError("pattern"))}}function hi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expectedVolumeShortage)("numberConstant",t.numRed)}}function fi(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function vi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",36),e.qZA(),e.YNc(4,fi,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected1VolumeShortage"))?null:n.hasError("pattern"))}}function xi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected1VolumeShortage)("numberConstant",t.numRed)}}function bi(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.l
1cZ(2,1,"validacionForm.numero")))}function Ci(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",37),e.qZA(),e.YNc(4,bi,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected2VolumeShortage"))?null:n.hasError("pattern"))}}function Zi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected2VolumeShortage)("numberConstant",t.numRed)}}function Ti(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Ai(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",38),e.qZA(),e.YNc(4,Ti,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("expected3VolumeShortage"))?null:n.hasError("pattern"))}}function Di(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.expected3VolumeShortage)("numberConstant",t.numRed)}}function yi(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Si(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",39),e.qZA(),e.YNc(4,yi,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("averageExpectedShortage"))?null:n.hasError("pattern"))}}function Ui(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.averageExpectedShortage)("numberConstant",t.numRed)}}function qi(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Ei(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",40),e.qZA(),e.YNc(4,qi,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("averageExpected1Shortage"))?null:n.hasError("pattern"))}}function Ni(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.averageExpected1Shortage)("numberConstant",t.numRed)}}function Mi(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Oi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",41),e.qZA(),e.YNc(4,Mi,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("averageExpected2Shortage"))?null:n.hasError("pattern"))}}function Ii(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.averageExpected2Shortage)("numberConstant",t.numRed)}}function Ri(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function Li(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-form-field",20),e._UZ(3,"input",42),e.qZA(),e.YNc(4,Ri,3,3,"mat-error",15),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);let n;e.xp6(4),e.Q6J("ngIf",null==(n=t.qualityGroup.get("averageExpected3Shortage"))?null:n.hasError("pattern"))}}function Pi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",19)(2,"mat-list",22),e._UZ(3,"app-mat-list-item-number",23),e.qZA()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(3),e.Q6J("elem",t.udaDetail.calidadMod.averageExpected3Shortage)("numberConstant",t.numRed)}}function wi(a,i){1&a&&(e.ynx(0),e.TgZ(1,"div",43)(2,"div",9)(3,"div",44)(4,"span",12),e._uU(5),e.ALo(6,"translate"),e.qZA()(),e.TgZ(7,"div",45)(8,"mat-form-field",20),e._UZ(9,"textarea",46,47),e.qZA()()()(),e.BQk()),2&a&&(e.xp6(5),e.Oqu(e.l
1cZ(6,1,"agrarianDemands.fichaCalidad.lblComments")))}const Qi=function(a,i,t){return["../../fieldsHistory",a,i,t]};function Vi(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"button",52),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.BQk()),2&a){const t=e.oxw(5);e.xp6(1),e.Q6J("routerLink",e.kEZ(4,Qi,t.qualityGuarantee.id,t.operation,t.qualityGuarantee.nombre)),e.xp6(1),e.Oqu(e.lcZ(3,2,"botones.historico"))}}function Ji(a,i){1&a&&(e.ynx(0),e.TgZ(1,"button",53),e._uU(2),e.ALo(3,"translate"),e._UZ(4,"i",54),e.qZA(),e.BQk()),2&a&&(e.xp6(2),e.hij("",e.lcZ(3,1,"botones.guardar")," "))}function Yi(a,i){if(1&a&&e._UZ(0,"app-map-icon",55),2&a){const t=e.oxw(5);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.qualityGuarantee.id)("target","_blank")}}const xe=function(){return["4","2","7"]},Ee=function(){return["4","2"]};function Gi(a,i){if(1&a&&(e.TgZ(0,"div",49),e.YNc(1,Vi,4,8,"ng-container",16),e.YNc(2,Ji,5,3,"ng-container",16),e.YNc(3,Yi,1,4,"app-map-icon",51),e.qZA()),2&a){const t=e.oxw(4);e.xp6(1),e.Q6J("appHasrole",e.Dd
1M(3,xe)),e.xp6(1),e.Q6J("appHasrole",e.DdM(4,Ee)),e.xp6(1),e.Q6J("ngIf",t.showMap)}}function Bi(a,i){if(1&a&&e._UZ(0,"app-map-icon",55),2&a){const t=e.oxw(5);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.qualityGuarantee.id)("target","_blank")}}function Fi(a,i){if(1&a&&(e.TgZ(0,"div",49),e.YNc(1,Bi,1,4,"app-map-icon",51),e.qZA()),2&a){const t=e.oxw(4);e.xp6(1),e.Q6J("ngIf",t.showMap)}}function ji(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",8)(2,"div",48)(3,"div",49),e.YNc(4,Gi,4,5,"div",50),e.YNc(5,Fi,2,1,"div",50),e.qZA()()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(4),e.Q6J("ngIf",t.showEdit),e.xp6(1),e.Q6J("ngIf",!t.showEdit)}}function ki(a,i){if(1&a&&e._UZ(0,"app-map-icon",55),2&a){const t=e.oxw(4);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.qualityGuarantee.id)("target","_blank")}}function $i(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",8)(2,"div",56)(3,"div",49),e.YNc(4,ki,1,4,"app-map-icon",51),e.qZA()()(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(4),e.Q6J("ngIf",t.showMap)}}function Hi(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"button",62),e.NdJ("click",function(){return e.CHM(t),e.oxw(5).validateVersions()}),e._uU(1),e.ALo(2,"translate"),e.qZA()}if(2&a){const t=e.oxw(5);e.Q6J("disabled",t.disableValidateBtn),e.xp6(1),e.Oqu(e.lcZ(2,2,"botones.valSeleccion"))}}const zi=function(){return["2","7"]};function Wi(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",8)(1,"div",58)(2,"div",59)(3,"h2"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",8)(7,"app-version-table",60),e.NdJ("newSelectEvent",function(o){return e.CHM(t),e.oxw(4).addSelection(o)})("newValidateVersionEvent",function(o){return e.CHM(t),e.oxw(4).validateVersions(o)})("newDeleteVersionEvent",function(o){return e.CHM(t),e.oxw(4).deleteVersion(o)}),e.qZA()(),e.TgZ(8,"div",8)(9,"div",48)(10,"div",49),e.YNc(11,Hi,3,4,"button",61),e.qZA()()()()()}if(2&a){const t=e.oxw(4);e.xp6(4),e.Oqu(e.lcZ(5,6,"versionado.controlVersiones")),e.xp6(3),e.Q6J("searchResult",t.controlVersiones)("tableColumns",t.tableConfigurationCalidadVersion)("itemName",t.udaDetail.nombre)("entityType",t.udaDemandType),e.xp6(4),e.Q6J("appHasrole",e.Dd
1M(8,zi))}}function Ki(a,i){if(1&a&&(e.ynx(0),e.YNc(1,Wi,12,9,"div",57),e.BQk()),2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.existVersions)}}function Xi(a,i){if(1&a&&(e.TgZ(0,"div",63)(1,"div",64)(2,"h2"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e._UZ(5,"mat-divider",3),e.TgZ(6,"div",65),e._UZ(7,"app-bar-chart",66),e.qZA()()),2&a){const t=e.oxw(3);e.xp6(3),e.Oqu(e.lcZ(4,4,"agrarianDemands.fichaCalidad.grafica1.lblGrafica1")),e.xp6(4),e.Q6J("chartData",t.barChartData)("chartOptions",t.barChartOptions)("chartPlugins",t.barChartPluginsCalidad)}}function eo(a,i){if(1&a&&(e.TgZ(0,"div",8)(1,"div",65),e._UZ(2,"app-line-chart",67),e.qZA()()),2&a){const t=e.oxw(4);e.xp6(2),e.Q6J("charData",t.lineChartData)("charOptions",t.lineChartOptions)}}function to(a,i){if(1&a&&(e.TgZ(0,"div",63)(1,"div",64)(2,"h2"),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e._UZ(5,"mat-divider",3),e.YNc(6,eo,3,2,"div",57),e.qZA()),2&a){const t=e.oxw(3);e.xp6(3),e.Oqu(e.lcZ(4,2,"agrarianDemands.fichaCalidad.grafica2.lblGrafica2")),e.xp6(3),e.Q6J("ngIf",t.qualityGuarantee)}}function ao(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",5)(1,"form",6,7),e.NdJ("ngSubmit",function(){return e.CHM(t),e.oxw(2).onSubmit()}),e.TgZ(3,"div",8)(4,"div",9),e._UZ(5,"div",10),e.TgZ(6,"div",10)(7,"div",11)(8,"span",12),e._uU(9),e.ALo(10,"translate"),e.qZA()(),e._UZ(11,"div",13),e.TgZ(12,"div",11)(13,"span",12),e._uU(14),e.ALo(15,"translate"),e.qZA()(),e._UZ(16,"div",13),e.TgZ(17,"div",11)(18,"span",12),e._uU(19),e.ALo(20,"translate"),e.qZA()(),e._UZ(21,"div",13),e.TgZ(22,"div",11)(23,"span",12),e._uU(24),e.ALo(25,"translate"),e.qZA()()()()(),e.TgZ(26,"div",8)(27,"div",9)(28,"div",10)(29,"span",14),e.ALo(30,"translate"),e._uU(31),e.ALo(32,"translate"),e.qZA()(),e.TgZ(33,"div",10),e.YNc(34,On,5,1,"ng-container",15),e.YNc(35,In,4,2,"ng-container",15),e._UZ(36,"div",13),e.YNc(37,Ln,5,1,"ng-container",15),e.YNc(38,Pn,4,2,"ng-container",15),e._UZ(39,"div",13),e.YNc(40,Qn,5,1,"ng-container",15),e.YNc(41,Vn,4,2,"ng-container",15),e._UZ(42,"div",13),e.YNc(43,Yn,5,1,"ng-container",15),e.YNc(44,Gn,4,2,"ng-container",15),e.qZA()()(),e.TgZ(45,"div",8)(46,"div",9)(47,"div",10)(48,"span",14),e.ALo(49,"translate"),e._uU(50),e.ALo(51,"translate"),e.qZA()(),e.TgZ(52,"div",10),e.YNc(53,Fn,5,1,"ng-container",15),e.YNc(54,jn,4,2,"ng-container",15),e._UZ(55,"div",13),e.YNc(56,$n,5,1,"ng-container",15),e.YNc(57,Hn,4,2,"ng-container",15),e._UZ(58,"div",13),e.YNc(59,Wn,5,1,"ng-container",15),e.YNc(60,Kn,4,2,"ng-container",15),e._UZ(61,"div",13),e.YNc(62,ei,5,1,"ng-container",15),e.YNc(63,ti,4,2,"ng-container",15),e.qZA()()(),e.TgZ(64,"div",8)(65,"div",9)(66,"div",10)(67,"span",14),e.ALo(68,"translate"),e._uU(69),e.ALo(70,"translate"),e.qZA()(),e.TgZ(71,"div",10),e.YNc(72,ni,5,1,"ng-container",15),e.YNc(73,ii,4,2,"ng-container",15),e._UZ(74,"div",13),e.YNc(75,ri,5,1,"ng-container",15),e.YNc(76,si,4,2,"ng-container",15),e._UZ(77,"div",13),e.YNc(78,ci,5,1,"ng-container",15),e.YNc(79,di,4,2,"ng-container",15),e._UZ(80,"div",13),e.YNc(81,pi,5,1,"ng-container",15),e.YNc(82,ui,4,2,"ng-container",15),e.qZA()()(),e.TgZ(83,"div",8)(84,"div",9)(85,"div",10)(86,"span",14),e.ALo(87,"translate"),e._uU(88),e.ALo(89,"translate"),e.qZA()(),e.TgZ(90,"div",10),e.YNc(91,gi,5,1,"ng-container",15),e.YNc(92,hi,4,2,"ng-container",15),e._UZ(93,"div",13),e.YNc(94,vi,5,1,"ng-container",15),e.YNc(95,xi,4,2,"ng-container",15),e._UZ(96,"div",13),e.YNc(97,Ci,5,1,"ng-container",15),e.YNc(98,Zi,4,2,"ng-container",15),e._UZ(99,"div",13),e.YNc(100,Ai,5,1,"ng-container",15),e.YNc(101,Di,4,2,"ng-container",15),e.qZA()()(),e.TgZ(102,"div",8)(103,"div",9)(104,"div",10)(105,"span",14),e.ALo(106,"translate"),e._uU(107),e.ALo(108,"translate"),e.qZA()(),e.TgZ(109,"div",10),e.YNc(110,Si,5,1,"ng-container",15),e.YNc(111,Ui,4,2,"ng-container",15),e._UZ(112,"div",13),e.YNc(113,Ei,5,1,"ng-container",15),e.YNc(114,Ni,4,2,"ng-container",15),e._UZ(115,"div",13),e.YNc(116,Oi,5,1,"ng-container",15),e.YNc(117,Ii,4,2,"ng-container",15),e._UZ(118,"div",13),e.YNc(119,Li,5,1,"ng-container",15),e.YNc(120,Pi,4,2,"ng-container",15),e.qZA()()(),e.YNc(121,wi,11,3,"ng-container",15),e.YNc(122,ji,6,2,"ng-container",16),e.YNc(123,$i,5,1,"ng-container",17),e.YNc(124,Ki,2,1,"ng-container",16),e.qZA(),e.TgZ(125,"div",8),e.YNc(126,Xi,8,6,"div",18),e.qZA(),e.TgZ(127,"div",8),e.YNc(128,to,7,4,"div",18),e.qZA()()}if(2&a){const t=e.oxw(2);
1e.xp6(1),e.Q6J("formGroup",t.qualityGroup),e.xp6(8),e.Oqu(e.lcZ(10,61,t.stageActual)),e.xp6(5),e.Oqu(e.lcZ(15,63,t.stage1)),e.xp6(5),e.Oqu(e.lcZ(20,65,t.stage2)),e.xp6(5),e.Oqu(e.lcZ(25,67,t.stage3)),e.xp6(5),e.s9C("matTooltip",e.lcZ(30,69,"agrarianDemands.fichaCalidad.tltipDeficitAnualMaximo")),e.xp6(2),e.hij(" ",e.lcZ(32,71,"agrarianDemands.fichaCalidad.lblDeficitAnualMaximo"),""),e.xp6(3),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(4),e.s9C("matTooltip",e.lcZ(49,73,"agrarianDemands.fichaCalidad.tltipDeficitBiAnualMaximo")),e.xp6(2),e.hij(" ",e.lcZ(51,75,"agrarianDemands.fichaCalidad.lblDeficitBiAnualMaximo"),""),e.xp6(3),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(4),e.s9C("matTooltip",e.lcZ(68,77,"agrarianDemands.fichaCalidad.tltipDeficitDecaAnualMaximo")),e.xp6(2),e.hij(" ",e.lcZ(70,79,"agrarianDemands.fichaCalidad.lblDeficitDecaAnualMaximo"),""),e.xp6(3),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(4),e.s9C("matTooltip",e.lcZ(87,81,"agrarianDemands.fichaCalidad.tltipDeficitMedioAnual")),e.xp6(2),e.hij(" ",e.lcZ(89,83,"agrarianDemands.fichaCalidad.lblDeficitMedioAnual"),""),e.xp6(3),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(4),e.s9C("matTooltip",e.lcZ(106,85,"agrarianDemands.fichaCalidad.tltipPorcenRespectoDemanda")),e.xp6(2),e.hij(" ",e.lcZ(108,87,"agrarianDemands.fichaCalidad.lblPorcenRespectoDemanda"),""),e.xp6(3),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(2),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("ngIf",!t.isProfile),e.xp6(1),e.Q6J("ngIf",t.isProfile),e.xp6(1),e.Q6J("appHasrole",e.Dd
1M(89,xe)),e.xp6(1),e.Q6J("appNothasrole",e.DdM(90,xe)),e.xp6(1),e.Q6J("appHasrole",e.DdM(91,Ee)),e.xp6(2),e.Q6J("ngIf",t.graficaBarra),e.xp6(2),e.Q6J("ngIf",t.graficaLinea)}}function no(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",2)(2,"h2"),e._uU(3),e.qZA()(),e._UZ(4,"mat-divider",3),e.YNc(5,ao,129,92,"div",4),e.BQk()),2&a){const t=e.oxw();e.xp6(3),e.AsE("",t.udaDetail.id," - ",t.udaDetail.nombre,""),e.xp6(2),e.Q6J("ngIf",t.qualityGuarantee)}}function io(a,i){1&a&&e._UZ(0,"app-spinner")}let oo=(()=>{class a{constructor(t,n,o,s,d,p,m,v,h){this.udaService=t,this.fb=n,this.router=o,this.activatedRoute=s,this.dialogModelService=d,this.translate=p,this.selectedValueComboService=m,this.tableConfigurationService=v,this.chartConfigurationService=h,this.isProfile=!1,this.chartSize={width:50,height:50},this.stop$=new A.x,this.disableValidateBtn=!0,this.operation=r.C.operacion.OPERACION_UDA_CALIDAD,this.udaDemandType=r.C.tipoEntidad.usosAgricolas,this.existVersions=!1,this.selection=[],this.visibleButtons={search:{active:!1}},this.numberPipe=new x.JJ(this.translate.currentLang),this.elementCheckNameList=[],this.showEdit=!0,this.stageActual="",this.stage1="",this.stage2="",this.stage3="",this.barChartPluginsCalidad=[],this.graficaBarra=!0,this.graficaLinea=!0,this.numRed=r.C.numRed,this.readyGraph=!1,this.tableConfigurationCalidadVersion=this.tableConfigurationService.getVersionTableConfiguration()}ngOnInit(){var t=this;null!=this.udaDetail.id&&(this.udaService.getComboEscenarios(0).subscribe(function(){var n=(0,$.Z)(function*(o){t.stagesCombo=o,t.stageActual=t.stagesCombo[0].nombre,t.stage1=t.stagesCombo[1].nombre,t.stage2=t.stagesCombo[2].nombre,t.stage3=t.stagesCombo[3].nombre,t.escenarios=[t.stageActual,t.stage1,t.stage2,t.stage3],t.udaService.getCalidad(t.udaDetail.id).subscribe(s=>{t.qualityGuarantee=s,t.createForm();let d=t.obtenerValorMaximoLine(t.qualityGuarantee);t.buildLineChartConfig(t.escenarios,t.prepareLineData(t.qualityGuarantee,t.stagesCombo),d);let p=t.obtenerValorMaximo(t.qualityGuarantee);t.buildBarChartConfig(t.escenarios,t.prepareBarData1(t.qualityGuarantee,t.stagesCombo),t.prepareBarData2(t.qualityGuarantee,t.stagesCombo),t.prepareBarData3(t.qualityGuarantee,t.stagesCombo),t.prepareBarDataDemandaAnual(t.stagesCombo),t.prepareBarDataDemandaAnual50(t.stagesCombo),t.prepareBarDataDemandaAnual75(t.stagesCombo),p);let m=t.obtenerColoresFondo(t.qualityGuarantee,t.stagesCombo);t.barChartPluginsCalidad.push(t.chartConfigurationService.backgroundColorPlugin(m[0],m[1],m[2],m[3])),t.readyGraph=!0,t.isProfile&&t.udaService.getControlDeVersiones(Number(t.udaDetail.id),t.operation).subscribe(v=>{v.length>0&&(t.existVersions=!0),t.controlVersiones=v})})});return function(o){return n.apply(this,arguments)}}()),-1==this.udaDetail.escenarioRef&&(this.showEdit=!1))}createForm(){var t,n,o,s,d,p,m,v,h,Z,q,S,E,K,oe,re,se,be,Ce,Ze,Te;this.qualityGroup=this.fb.group({expectedShortage1:this.fb.control({value:this.numberPipe.transform(null===(t=this.qualityGuarantee)||void 0===t?void 0:t.expectedShortage1,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected1Shortage1:this.fb.control({value:this.numberPipe.transform(null===(n=this.qualityGuarantee)||void 0===n?void 0:n.expected1Shortage1,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected2Shortage1:this.fb.control({value:this.numberPipe.transform(null===(o=this.qualityGuarantee)||void 0===o?void 0:o.expected2Shortage1,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected3Shortage1:this.fb.control({value:this.numberPipe.transform(null===(s=this.qualityGuarantee)||void 0===s?void 0:s.expected3Shortage1,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expectedShortage2:this.fb.control({value:this.numberPipe.transform(null===(d=this.qualityGuarantee)||void 0===d?void 0:d.expectedShortage2,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected1Shortage2:this.fb.control({value:this.numberPipe.transform(null===(p=this.qualityGuarantee)||void 0===p?void 0:p.expected1Shortage2,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected2Shortage2:this.fb.control({value:this.numberPipe.transform(null===(m=this.qual
1ityGuarantee)||void 0===m?void 0:m.expected2Shortage2,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected3Shortage2:this.fb.control({value:this.numberPipe.transform(null===(v=this.qualityGuarantee)||void 0===v?void 0:v.expected3Shortage2,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expectedShortage10:this.fb.control({value:this.numberPipe.transform(null===(h=this.qualityGuarantee)||void 0===h?void 0:h.expectedShortage10,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected1Shortage10:this.fb.control({value:this.numberPipe.transform(null===(Z=this.qualityGuarantee)||void 0===Z?void 0:Z.expected1Shortage10,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected2Shortage10:this.fb.control({value:this.numberPipe.transform(null===(q=this.qualityGuarantee)||void 0===q?void 0:q.expected2Shortage10,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected3Shortage10:this.fb.control({value:this.numberPipe.transform(null===(S=this.qualityGuarantee)||void 0===S?void 0:S.expected3Shortage10,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expectedVolumeShortage:this.fb.control({value:this.numberPipe.transform(null===(E=this.qualityGuarantee)||void 0===E?void 0:E.expectedVolumeShortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected1VolumeShortage:this.fb.control({value:this.numberPipe.transform(null===(K=this.qualityGuarantee)||void 0===K?void 0:K.expected1VolumeShortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected2VolumeShortage:this.fb.control({value:this.numberPipe.transform(null===(oe=this.qual
1ityGuarantee)||void 0===oe?void 0:oe.expected2VolumeShortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),expected3VolumeShortage:this.fb.control({value:this.numberPipe.transform(null===(re=this.qualityGuarantee)||void 0===re?void 0:re.expected3VolumeShortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),averageExpectedShortage:this.fb.control({value:this.numberPipe.transform(null===(se=this.qualityGuarantee)||void 0===se?void 0:se.averageExpectedShortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),averageExpected1Shortage:this.fb.control({value:this.numberPipe.transform(null===(be=this.qualityGuarantee)||void 0===be?void 0:be.averageExpected1Shortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),averageExpected2Shortage:this.fb.control({value:this.numberPipe.transform(null===(Ce=this.qualityGuarantee)||void 0===Ce?void 0:Ce.averageExpected2Shortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),averageExpected3Shortage:this.fb.control({value:this.numberPipe.transform(null===(Ze=this.qual
1ityGuarantee)||void 0===Ze?void 0:Ze.averageExpected3Shortage,r.C.numRed),disabled:!1},u.kI.pattern(r.C.regExpNumFormatted)),comments:this.fb.control({value:null===(Te=this.qualityGuarantee)||void 0===Te?void 0:Te.comments,disabled:!this.isProfile})}),this.initialValues=this.qualityGroup.value,this.elementCheckNameList=["expectedShortage1","expected1Shortage1","expected2Shortage1","expected3Shortage1","expectedShortage2","expected1Shortage2","expected2Shortage2","expected3Shortage2","expectedShortage10","expected1Shortage10","expected2Shortage10","expected3Shortage10","expectedVolumeShortage","expected1VolumeShortage","expected2VolumeShortage","expected3VolumeShortage","averageExpectedShortage","averageExpected1Shortage","averageExpected2Shortage","averageExpected3Shortage"]}onSubmit(){if(this.qualityGroup.invalid)return;let t=_.c.compareObjects(this.initialValues,this.qualityGroup.value);Object.keys(t).length>0?this.router.navigate([`../../fieldsVersion/${this.udaDetail.id}/${this.operation}`],{relativeTo:this.activatedRoute,state:{comparedObject:this.prepareData(t),item:this.qualityGuarantee,operation:this.operation}}):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.guardarCambios.titulo"),this.translate.instant("dialogos.guardarCambios.sinCambios"))}validateVersions(t){let n=[];t?n.push(t):n=this.selection.map(o=>o),this.udaService.validarBloque(n).subscribe(o=>{200===o.status?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),`${this.translate.instant("dialogos.validarVersion.validacionCorrecta")} ${o.body} ${this.translate.instant(o.body>1?"dialogos.validarVersion.variosElementos":"dialogos.validarVersion.1elemento")}`),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),this.translate.instant("dialogos.validarVersion.validacionError"))})}deleteVersion(t){this.udaService.descartarOperacion(t.version,t.operacionEntidad).subscribe(n=>{n?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartarVersion.titulo"),this.translate.instant("dialogos.descartarVersion.descartarCorrecta")),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartarVersion.titulo"),this.translate.instant("dialogos.descartarVersion.descartarError"))})}addSelection(t){this.disableValidateBtn=0===t.length,this.selection=t}reloadComponent(){this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.navigate(["./"],{relativeTo:this.activatedRoute,queryParamsHandling:"merge"})}prepareData(t){let n=[];for(const o in t){let s,d,p=t[o];p&&this.elementCheckNameList.includes(o)&&(p=_.c.convertFormattedNumber(p.toString())),d=t[o];let m=this.translate.instant(`agrarianDemands.fichaCalidad.lblsGuardarCambios.${o}`);(-1!=o.indexOf("expected1")||-1!=o.indexOf("Expected1"))&&(m+="["+this.stage1+"]"),(-1!=o.indexOf("expected2")||-1!=o.indexOf("Expected2"))&&(m+="["+this.stage2+"]"),(-1!=o.indexOf("expected3")||-1!=o.indexOf("Expected3"))&&(m+="["+this.stage3+"]"),s=new de.i(o,m,p,d),n.push(s)}return n}prepareLineData(t,n){return[t.expectedVolumeShortage,t.expected1VolumeShortage,t.expected2VolumeShortage,t.expected3VolumeShortage]}prepareBarData1(t,n){return[t.expectedShortage1,t.expected1Shortage1,t.expected2Shortage1,t.expected3Shortage1]}prepareBarData2(t,n){return[t.expectedShortage2,t.expected1Shortage2,t.expected2Shortage2,t.expected3Shortage2]}prepareBarData3(t,n){return[t.expectedShortage10,t.expected1Shortage10,t.expected2Shortage10,t.expected3Shortage10]}prepareBarDataDemandaAnual(t){return[100,100,100,100]}prepareBarDataDemandaAnual50(t){return[50,50,50,50]}prepareBarDataDemandaAnual75(t){return[75,75,75,75]}obtenerValorMaximo(t){let n=110;return null==t.expectedShortage1&&null==t.expected1Shortage1&&null==t.expected2Shortage1&&null==t.expected3Shortage1&&null==t.expectedShortage2&&null==t.expected1Shortage2&&null==t.expected2Shortage2&&null==t.expected3Shortage2&&null==t.expectedShortage10&&null==t.expected1Shortage10&&null==t.expected2Shortage10&&null==t.expected3Shortage10&&(this.graficaBarra=!1),t.expectedShortage1>n&&(n=10*Math.ceil(t.expectedShortage1/10)+10),t.expected1Shortage1>n&&(n=10*Math.ceil(t.expected1Shortage1/10)+10),t.expected2Shortage1>n&&(n=10*Math.ceil(t.expected2Shortage1/10)+10),t.expected3Shortage1>n&&(n=10*Math.ceil(t.expected3Shortage1/10)+10),t.expectedShortage2>n&&(n=10*Math.ceil(t.expectedShortage2/10)+10),t.expected1Shortage2>n&&(n=10*Math.ceil(t.expected1Shortage2/10)+10),t.expected2Shortage2>n&&(n=10*Math.ceil(t.expected2Shortage2/10)+10),t.expected3Shortage2>n&&(n=10*Math.ceil(t.expected3Shortage2/10)+10),t.expectedShortage10>n&&(n=10*Math.ceil(t.expectedShortage10/10)+10),t.expected1Shortage10>n&&(n=10*Math.ceil(t.expected1Shortage10/10)+10),t.expected2Shortage10>n&&(n=10*Math.ceil(t.expected2Shortage10/10)+10),t.expected3Shortage10>n&&(n=10*Math.ceil(t.expected3Shortage10/10)+10),n}obtenerValorMaximoLine(t){let n=0;return null==t.expectedVolumeShortage&&null==t.expected1VolumeShortage&&null==t.expected2VolumeShortage&&null==t.expected3VolumeShortage&&(this.graficaLinea=!1),t.expectedVolumeShortage>n&&(n=t.expectedVolumeShortage<.1?.01*Math.ceil(t.expectedVolumeShortage/.01):t.expectedVolumeShortage<1?.1*M
1ath.ceil(t.expectedVolumeShortage/.1):t.expectedVolumeShortage<10?1*Math.ceil(t.expectedVolumeShortage/1):10*Math.ceil(t.expectedVolumeShortage/10)),t.expected1VolumeShortage>n&&(n=t.expected1VolumeShortage<.1?.01*Math.ceil(t.expected1VolumeShortage/.01):t.expected1VolumeShortage<1?.1*Math.ceil(t.expected1VolumeShortage/.1):t.expected1VolumeShortage<10?1*Math.ceil(t.expected1VolumeShortage/1):10*Math.ceil(t.expected1VolumeShortage/10)),t.expected2VolumeShortage>n&&(n=t.expected2VolumeShortage<.1?.01*Math.ceil(t.expected2VolumeShortage/.01):t.expected2VolumeShortage<1?.1*Math.ceil(t.expected2VolumeShortage/.1):t.expected2VolumeShortage<10?1*Math.ceil(t.expected2VolumeShortage/1):10*Math.ceil(t.expected2VolumeShortage/10)),t.expected3VolumeShortage>n&&(n=t.expected3VolumeShortage<.1?.01*Math.ceil(t.expected3VolumeShortage/.01):t.expected3VolumeShortage<1?.1*Math.ceil(t.expected3VolumeShortage/.1):t.expected3VolumeShortage<10?1*Math.ceil(t.expected3VolumeShortage/1):10*Math.ceil(t.expected3VolumeShortage/10)),0==n&&(n=.1),n.toFixed(2)}obtenerColoresFondo(t,n){let p,m,v,h,o="#e15b6430",s="#aac66f30",d="#ff800030";return p=d,m=d,v=d,h=d,0==t.expectedShortage1&&0==t.expectedShortage2&&0==t.expectedShortage10?p=s:(t.expectedShortage1>50||t.expectedShortage2>75||t.expectedShortage10>100)&&(p=o),0==t.expected1Shortage1&&0==t.expected1Shortage2&&0==t.expected1Shortage10?m=s:(t.expected1Shortage1>50||t.expected1Shortage2>75||t.expected1Shortage10>100)&&(m=o),0==t.expected2Shortage2&&0==t.expected2Shortage2&&0==t.expected2Shortage10?v=s:(t.expected2Shortage1>50||t.expected2Shortage2>75||t.expected2Shortage10>100)&&(v=o),0==t.expected3Shortage2&&0==t.expected3Shortage2&&0==t.expected3Shortage10?h=s:(t.expected3Shortage1>50||t.expected3Shortage2>75||t.expected3Shortage10>100)&&(h=o),[p,m,v,h]}buildLineChartConfig(t,n,o){this.lineChartData={labels:t,datasets:[{label:this.translate.instant("agrarianDemands.fichaCalidad.grafica2.lblDeficitMedio"),spanGaps:!0,data:n,fill:!1,borderColor:"#ff6600",tension:0}]},this.lineChartOptions={plugins:{legend:{labels:{color:"#000000"},position:"bottom",onClick:(s,d,p)=>{const m=d.datasetIndex,v=p.chart;v.isDatasetVisible(m)?(v.hide(m),d.hidden=!0,_.c.setHideStyle(p.legendItems)):(v.show(m),d.hidden=!1,_.c.setHideStyle(p.legendItems));const h=v.ctx.fillText;v.ctx.fillText=(Z,q,S)=>{h.bind(v.ctx,Z,q,S)(),v.ctx.fillStyle="#C8C8C800"}}},tooltip:{enabled:!0,callbacks:{label:s=>s.dataset.label+" : "+this.numberPipe.transform(s.dataset.data[s.dataIndex],r.C.numRed)+" "+this.translate.instant("unidades.porcentaje")}}},scales:{x:{beginAtZero:!0,offset:!0,ticks:{color:"#000000"},grid:{color:"#EBEBEB"}},y:{max:o,beginAtZero:!0,ticks:{color:"#000000",callback:(s,d,p)=>s},grid:{color:"#EBEBEB"},title:{display:!0,align:"center",text:this.translate.instant("unidades.hm3Anyo"),color:"#000000"}}}}}createDiagonalPattern(t="black"){let n=document.createElement("canvas");n.width=10,n.height=10;let o=n.getContext("2d");return o.fillStyle="#ff660090",o.fillStyle="#ff660090",o.fillRect(0,0,n.width,n.height),o.strokeStyle="rgba(0, 0, 0, 1)",o.beginPath(),o.moveTo(2,0),o.lineTo(10,8),o.stroke(),o.beginPath(),o.moveTo(0,8),o.lineTo(2,10),o.stroke(),o.createPattern(n,"repeat")}createDiagonalPattern2(t="black"){let n=document.createElement("canvas");n.width=10,n.height=10;let o=n.getContext("2d");return o.fillStyle="#ff660090",o.fillRect(0,0,n.width,n.height),o.strokeStyle="rgba(0, 0, 0, 1)",o.beginPath(),o.moveTo(1,0),o.lineTo(5,4),o.stroke(),o.beginPath(),o.moveTo(0,4),o.lineTo(1,5),o.stroke(),o.createPattern(n,"repeat")}createGridPattern(t){const n=document.createElement("canvas");n.width=10,n.height=10;const o=n.getContext("2d");return o.fillStyle="#ff660090",o.fillRect(0,0,n.width,n.height),o.strokeStyle="rgba(0, 0, 0, 1)",o.lineWidth=1,o.beginPath(),o.moveTo(0,5),o.lineTo(10,5),o.stroke(),o.beginPath(),o.moveTo(5,0),o.lineTo(5,10),o.stroke(),o.createPattern(n,"repeat")}createDottedPattern(t="black"){const n=document.createElement("canvas");n.width=10,n.height=10;const o=n.getContext("2d");return o.fillStyle="#ff660080",o.fillRect(0,0,n.width,n.height),o.strokeStyle="black",o.beginPath(),o.arc(5,5,3,0,2*Math.PI),o.fill(),o.createPattern(n,"repeat")}buildBarChartConfig(t,n,o,s,d,p,m,v){this.barChartData={labels:t,datasets:[{label:this.translate.instant("agrarianDemands.fic
1haCalidad.grafica1.lblDeficitAnual"),spanGaps:!0,data:n,fill:!0,tension:0,backgroundColor:this.createDiagonalPattern("#ff660080"),borderColor:"#ff6600",borderWidth:1},{label:this.translate.instant("agrarianDemands.fichaCalidad.grafica1.lblDeficitBiAnual"),spanGaps:!0,data:o,fill:!0,backgroundColor:this.createGridPattern("#ff660080"),tension:0,borderColor:"#ff6600",borderWidth:1},{label:this.translate.instant("agrarianDemands.fichaCalidad.grafica1.lblDeficitDecaAnual"),spanGaps:!0,data:s,fill:!0,backgroundColor:this.createDiagonalPattern2("#ff660080"),tension:0,borderColor:"#ff6600",borderWidth:1},{type:"line",spanGaps:!0,label:this.translate.instant("agrarianDemands.fichaCalidad.grafica1.lblDemandaAnual"),data:d,borderColor:"#c89ff0",borderWidth:4,pointStyle:"circle",pointRadius:0},{type:"line",spanGaps:!0,label:this.translate.instant("agrarianDemands.fichaCalidad.grafica1.lblDemandaAnual50"),borderColor:"#3c39aa",data:p,borderWidth:4,pointStyle:"circle",pointRadius:0},{type:"line",spanGaps:!0,label:this.translate.instant("agrarianDemands.fichaCalidad.grafica1.lblDemandaAnual75"),borderColor:"#117ae7",data:m,borderWidth:4,pointStyle:"circle",pointRadius:0}]},this.barChartOptions={responsive:!0,plugins:{tooltip:{enabled:!0,callbacks:{label:h=>h.dataset.label+" : "+this.numberPipe.transform(h.dataset.data[h.dataIndex],r.C.numRed)+" "+this.translate.instant("unidades.porcentaje")}},legend:{labels:{color:"#000000"},position:"bottom",align:"start",onClick:(h,Z,q)=>{const S=Z.datasetIndex,E=q.chart;E.isDatasetVisible(S)?(E.hide(S),Z.hidden=!0,_.c.setHideStyle(q.legendItems)):(E.show(S),Z.hidden=!1,_.c.setHideStyle(q.legendItems));const K=E.ctx.fillText;E.ctx.fillText=(oe,re,se)=>{K.bind(E.ctx,oe,re,se)(),E.ctx.fillStyle="#C8C8C800"}}}},scales:{x:{beginAtZero:!0,min:0,ticks:{color:"#000000"},grid:{color:"#000000"},border:{dash:[5,10],display:!0,color:"#000000"}},y:{beginAtZero:!0,ticks:{color:"#000000",callback:(h,Z,q)=>h},border:{display:!0,color:"#000000"},min:0,max:v,grid:{color:"#BBBBBB"},title:{display:!0,align:"center",text:this.translate.instant("unidades.porcentaje"),color:"#000000"}}}}}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(u.qu),e.Y36(f.F0),e.Y36(f.gz),e.Y36(z.r),e.Y36(c.sK),e.Y36(ce.x),e.Y36(V.A),e.Y36(D.E))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-uda-calidad-garantias"]],inputs:{udaDetail:"udaDetail",entityName:"entityName",queryParams:"queryParams",isProfile:"isProfile",entityType:"entityType",showMap:"showMap"},decls:3,vars:2,consts:[[4,"ngIf","ngIfElse"],["loading",""],[1,"container-title","mt-1"],[1,"mb-2"],["class","container",4,"ngIf"],[1,"container"],[3,"formGroup","ngSubmit"],["technicalForm","ngForm"],[1,"row"],[1,"row","inputRow"],[1,"col","col-xl-6","labelForm"],[1,"col","col-xl-2","labelForm"],["appBold",""],[1,"col","col-xl-1","labelForm"],["appBold","","matTooltipPosition","after","matTooltipClass","custom-tooltip",3,"matTooltip"],[4,"ngIf"],[4,"appHasrole"],[4,"appNothasrole"],["class","col col-xl-12",4,"ngIf"],[1,"col","col-xl-2"],["appearance","standard",1,"width-100"],["matInput","","name","expectedShortage1","type","text","formControlName","expectedShortage1"],["dense",""],[3,"elem","numberConstant"],["matInput","","name","expected1Shortage1","type","text","formControlName","expected1Shortage1"],["matInput","","name","expected2Shortage1","type","text","formControlName","expected2Shortage1"],["matInput","","name","expected3Shortage1","type","text","formControlName","expected3Shortage1"],["matInput","","name","expectedShortage2","type","text","formControlName","expectedShortage2"],["matInput","","name","expected1Shortage2","type","text","formControlName","expected1Shortage2"],["matInput","","name","expected2Shortage2","type","text","formControlName","expected2Shortage2"],["matInput","","name","expected3Shortage2","type","text","formControlName","expected3Shortage2"],["matInput","","name","expectedShortage10","type","text","formControlName","expectedShortage10"],["matInput","","name","expected1Shortage10","type","text","formControlName","expected1Shortage10"],["matInput","","name","expected2Shortage10","type","text","formControlName","expected2Shortage10"],["matInput","","name","expected3Shortage10","type","text","formControlName","expected3Shortage10"],["matInput","","name","expectedVolumeShortage","type","text","formControlName","expectedVolumeShortage"],["matInput","","name","expected1VolumeShortage","type","text","formControlName","expected1VolumeShortage"],["matInput","","name","expected2VolumeShortage","type","text","formControlName","expected2VolumeShortage"],["matInput","","name","expected3VolumeShortage","type","text","formControlName","expected3VolumeShortage"],["matInput","","name","averageExpectedShortage","type","text","formControlName","averageExpectedShortage"],["matInput","","name","averageExpected1Shortage","type","text","formControlName","averageExpected1Shortage"],["matInput","","name","averageExpected2Shortage","type","text","formControlName","averageExpected2Shortage"],["matInput","","name","averageExpected3Shortage","type","text","formControlName","averageExpected3Shortage"],[1,"row","mb-4","mt-4"],[1,"col","col-xl-2","mb-4","labelForm"],[1,"col","col-xl-10"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","5","name","comments","formControlName","comments"],["autosize","cdkTextareaAutosize"],[1,"col-md-12"],[1,"float-end"],["class","float-end",4,"ngIf"],[3,"entityName","queryParams","entityId","target",4,"ngIf"],["type","button","mat-flat-button","",1,"btn-first",3,"routerLink"],["type","submit","mat-flat-button","",1,"btn-second"],[1,"fa-regular","fa-floppy-disk"],[3,"entityName","queryParams","entityId","target"],[1,"col-md-12","mt-2"],["class","row",4,"ngIf"],[1,"col"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","itemName","entityType","newSelectEvent","newValidateVersionEvent","newDeleteVersionEvent"],["class","btn-first","type","button","mat-flat-button","",3,"disabled","click",4,"appHasrole"],["type","button","mat-flat-button","",1,"btn-first",3,"disabled","click"],[1,"col","col-xl-12"],[1,"container-title","mt-5"],[1,"col","col-xl-8","offset-md-2","mt-4"],["type","bar",3,"chartData","chartOptions","chartPlugins"],[3,"charData","charOptions"]],template:function(t,n){if(1&t&&(e.YNc(0,no,6,3,"ng-container",0),e.YNc(1,io,1,0,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",n.qualityGuarantee)("ngIfElse",o)}},directives:[x.O5,I.d,u._Y,u.JL,u.sg,j.M,k.gM,R.KE,ie.Nt,u.Fj,u.JJ,u.u,R.TO,J.i$,Se.B,me.IC,H.I,Y.lW,f.rH,Q.N,Ue.b,pe.L,le.u,Nn.D,w.O],pipes:[c.X$],styles:[""]}),a})();var ro=l(4540);function so(a,i){if(1&a&&(e.TgZ(0,"mat-option",19),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function lo(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"form",10,11)(2,"div",12),e.ynx(3),e.TgZ(4,"div",13)(5,"div",14)(6,"h3"),e._uU(7),e.ALo(8,"translate"),e.qZA()()(),e.TgZ(9,"div",15)(10,"mat-form-field",16)(11,"mat-select",17),e.NdJ("selectionChange",function(o){return e.CHM(t),e.oxw().changeValueStagesCombo(o)}),e.YNc(12,so,2,2,"mat-option",18),e.qZA()()(),e.BQk(),e.qZA()()}if(2&a){const t=e.oxw();
1e.Q6J("formGroup",t.stageGroup),e.xp6(7),e.Oqu(e.lcZ(8,3,"agrarianDemands.fichaTendencias.lblEscenarioConsulta")),e.xp6(5),e.Q6J("ngForOf",t.stagesCombo)}}function co(a,i){if(1&a&&(e.TgZ(0,"div",24)(1,"div",25)(2,"h3"),e._uU(3),e.qZA()(),e._UZ(4,"app-manage-basic-table",26),e.qZA()),2&a){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(3),e.Oqu(t.tipo),e.xp6(1),e.Q6J("searchResult",t.elementos)("tableColumns",n.tableConfigurationGanaderas)("visibleButtons",n.visibleButtonsGanaderas)("urlSearch",n.urlSearchTableGanadero)("urlMapVisor",n.urlMapVisorGanadero)("showPagination",!1)("actionsColumnWidth",8)("nameId","codigo")("target","_blank")}}function mo(a,i){if(1&a&&(e.TgZ(0,"div",22),e.YNc(1,co,5,10,"div",23),e.qZA()),2&a){const t=i.$implicit;e.xp6(1),e.Q6J("ngIf","Demandas elementales ganaderas"==t.tipo)}}function po(a,i){1&a&&(e.TgZ(0,"div")(1,"h3"),e._uU(2),e.ALo(3,"translate"),e.qZA()()),2&a&&(e.xp6(2),e.hij("",e.lcZ(3,1,"agrarianDemands.fichaUsos.nohayDemandasGanaderas")," "))}function uo(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",24)(1,"div",25)(2,"h3"),e._uU(3),e.qZA()(),e.TgZ(4,"app-manage-basic-table",28),e.NdJ("newSearchEvent",function(o){return e.CHM(t),e.oxw(3).searchUel(o)}),e.qZA()()}if(2&a){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(3),e.Oqu(t.tipo),e.xp6(1),e.Q6J("searchResult",t.elementos)("tableColumns",n.tableConfiguration)("visibleButtons",n.visibleButtons)("urlMapVisor",n.urlMapVisor)("showPagination",!1)("actionsColumnWidth",8)("nameId","codigo")}}function _o(a,i){if(1&a&&(e.TgZ(0,"div",27),e.YNc(1,uo,5,8,"div",23),e.qZA()),2&a){const t=i.$implicit;e.xp6(1),e.Q6J("ngIf","Demandas elementales agrarias"==t.tipo)}}function go(a,i){if(1&a&&(e.ynx(0),e.YNc(1,mo,2,1,"div",20),e.YNc(2,po,4,3,"div",6),e.YNc(3,_o,2,1,"div",21),e.BQk()),2&a){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.udaUses),e.xp6(1),e.Q6J("ngIf",!t.hayDemandasGanaderas),e.xp6(1),e.Q6J("ngForOf",t.udaUses)}}function ho(a,i){if(1&a&&e._UZ(0,"app-map-icon",29),2&a){const t=e.oxw();e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.udaDetail.id)("target","_blank")}}let fo=(()=>{class a{constructor(t,n,o,s,d,p,m,v,h){this.udaService=t,this.fb=n,this.translate=o,this.tableConfigurationService=s,this.selectedValueComboService=d,this.router=p,this.rolesService=m,this.configService=v,this.elementaryLivestockDemandsService=h,this.visibleButtons={search:{active:!0},map:{active:!0}},this.visibleButtonsGanaderas={search:{active:!1},map:{active:!1}},this.urlMapVisor="/viewer/"+r.C.elementaryAgrarianDemandEntity,this.hayDemandasGanaderas=!1,this.stop$=new A.x,this.tableConfiguration=this.tableConfigurationService.getUDAUsesTablaConfiguration(),this.tableConfigurationGanaderas=this.tableConfigurationService.getUDAUsesTablaConfigurationGanaderas(),this.selectedValueComboService.valueComboDemandsTrendsYearSubject$.pipe((0,U.R)(this.stop$)).subscribe(Z=>{this.stageSearch=Z}),this.rolesService.profile$.pipe((0,U.R)(this.stop$)).subscribe(Z=>{Z!==r.C.perfilCiudadano&&(this.visibleButtonsGanaderas={search:{active:!0},map:{active:!0}})}),this.urlSearchTableGanadero=_.c.getTechnicalURL(r.C.tipoEntidad.demandaGanaderaUnidadElemental),this.urlMapVisorGanadero=_.c.getViewerURL(r.C.tipoEntidad.demandaGanaderaUnidadElemental)}ngOnInit(){var t=this;this.stageYear=-1!=this.stageSearch?this.stageSearch:this.udaDetail.escenarioRef,null!=this.udaDetail.id&&this.udaService.getComboEscenarios(this.udaDetail.id).subscribe(function(){var n=(0,$.Z)(function*(o){t.stagesCombo=o,t.stageGroup=t.fb.group({stage:t.fb.control({value:t.stageYear,disabled:!1})}),t.udaService.getUses(Number(t.udaDetail.id),t.stageYear).subscribe(s=>{t.udaUses=s;for(const d of t.udaUses){"Demandas elementales ganaderas"===d.tipo&&(t.hayDemandasGanaderas=!0,t.getAssociatedUsesViewerQueryParams(d.elementos));for(const p of d.elementos)p.hasGeometry||t.hideOptionsMapAndView(p)}})});return function(o){return n.apply(this,arguments)}}())}getAssociatedUsesViewerQueryParams(t){for(const n of t)this.elementaryLivestockDemandsService.getCapasVisor(n.codigo).subscribe(o=>{o.length>0&&(n.entityName=r.C.elementaryLivestockDemandEntity,n.queryParams=_.c.getEntityViewerQueryParams(n.codigo.toString(),o,r.C.elementaryLivestockDemandEntity,this.configService))})}hideOptionsMapAndView(t){t.activeMap=!1}setObservacionesYTipo(t){for(const n of t){let o=this.translate.instant("tablas.tablaMedidas.medidasDe"),s=this.translate.instant("tablas.tablaMedidas.vinculadasUso");n.tipo="Otros"==n.tipo?this.translate.instant("tablas.tablaMedidas.medidas")+this.translate.instant("tablas.tablaMedidas.otras")+s:o+n.tipo+s}return t}searchUel(t){_.c.viewEntity(_.c.getTechnicalURL(r.C.tipoEntidad.unidadesElementales,`${t.codigo}`),this.router)}changeValueStagesCombo(t){this.selectedValueComboService.valueChangeDemansTrendsYear(t.value),this.udaService.getUses(Number(this.udaDetail.id),t.value).subscribe(n=>{this.udaUses=n;for(const o of this.udaUses){"Demandas elementales ganaderas"===o.tipo&&(this.hayDemandasGanaderas=!0,this.getAssociatedUsesViewerQueryParams(o.elementos));for(const s of o.elementos)s.hasGeometry||this.hideOptionsMapAndView(s)}})}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(u.qu),e.Y36(c.sK),e.Y36(V.A),e.Y36(ce.x),e.Y36(f.F0),e.Y36(ne.f),e.Y36(O.E),e.Y36(ro.I))}
1,a.\u0275cmp=e.Xpm({type:a,selectors:[["app-uses"]],inputs:{udaDetail:"udaDetail",entityName:"entityName",queryParams:"queryParams",showMap:"showMap"},decls:13,vars:5,consts:[[1,"container-title","mt-1"],[1,"mb-2"],[1,"container"],[1,"row"],[1,"col","col-xl-12"],[3,"formGroup",4,"ngIf"],[4,"ngIf"],[1,"col-md-12"],[1,"float-end"],[3,"entityName","queryParams","entityId","target",4,"ngIf"],[3,"formGroup"],["stageForm","ngForm"],[1,"row","mt-2","justify-content-end"],[1,"col-auto","labelForm","lh-lg"],[1,"container-subtitle"],[1,"col-auto"],["appearance","standard"],["name","stage","formControlName","stage",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["class","row mt-2",4,"ngFor","ngForOf"],["class","row mt-4",4,"ngFor","ngForOf"],[1,"row","mt-2"],["class","col",4,"ngIf"],[1,"col"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","visibleButtons","urlSearch","urlMapVisor","showPagination","actionsColumnWidth","nameId","target"],[1,"row","mt-4"],[3,"searchResult","tableColumns","visibleButtons","urlMapVisor","showPagination","actionsColumnWidth","nameId","newSearchEvent"],[3,"entityName","queryParams","entityId","target"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"h2"),e._uU(2),e.qZA()(),e._UZ(3,"mat-divider",1),e.TgZ(4,"div",2)(5,"div",3)(6,"div",4),e.YNc(7,lo,13,5,"form",5),e.qZA()(),e.YNc(8,go,4,3,"ng-container",6),e.TgZ(9,"div",3)(10,"div",7)(11,"div",8),e.YNc(12,ho,1,4,"app-map-icon",9),e.qZA()()()()),2&t&&(e.xp6(2),e.AsE("",n.udaDetail.id," - ",n.udaDetail.nombre,""),e.xp6(5),e.Q6J("ngIf",n.stagesCombo),e.xp6(1),e.Q6J("ngIf",n.udaUses&&n.udaUses.length>0),e.xp6(4),e.Q6J("ngIf",n.showMap))},directives:[I.d,x.O5,u._Y,u.JL,u.sg,R.KE,te.gD,u.JJ,u.u,x.sg,F.ey,W.D,Q.N],pipes:[c.X$],styles:[""]}),a})();function vo(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function xo(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}function bo(a,i){1&a&&(e.ynx(0),e.TgZ(1,"div",27)(2,"div",14)(3,"div",28)(4,"span",29),e.ALo(5,"translate"),e._uU(6),e.ALo(7,"translate"),e.qZA()()()(),e.BQk()),2&a&&(e.xp6(4),e.s9C("matTooltip",e.lcZ(5,2,"agrarianDemands.fichaReservas.tltipSituacion")),e.xp6(2),e.hij(" ",e.lcZ(7,4,"agrarianDemands.fichaReservas.lblSituacionSinReserva"),""))}function Co(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"div",30)(2,"div",14)(3,"div",31)(4,"span",18),e.ALo(5,"translate"),e._uU(6),e.ALo(7,"translate"),e.qZA()(),e.TgZ(8,"div",27)(9,"span",16),e._uU(10),e.ALo(11,"number"),e.qZA()(),e.TgZ(12,"div",10)(13,"span",16),e._uU(14),e.ALo(15,"translate"),e.qZA()()()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(4),e.s9C("matTooltip",e.lcZ(5,4,"agrarianDemands.fichaReservas.tltipSituacion")),e.xp6(2),e.hij(" ",e.lcZ(7,6,"agrarianDemands.fichaReservas.lblSituacion"),""),e.xp6(4),e.hij(" ",e.xi3(11,8,t.reserves.situation,t.numRed3Dec)," "),e.xp6(4),e.hij(" ",e.lcZ(15,11,"unidades.hm3Anyo")," ")}}function Zo(a,i){1&a&&(e.TgZ(0,"mat-error"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&a&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"validacionForm.numero")))}const To=function(a,i,t){return["../../fieldsHistory",a,i,t]};function Ao(a,i){if(1&a&&(e.ynx(0),e.TgZ(1,"button",35),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.BQk()),2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("routerLink",e.kEZ(4,To,t.reserves.id,t.operation,t.reserves.nombre)),e.xp6(1),e.Oqu(e.lcZ(3,2,"botones.historico"))}}function Do(a,i){1&a&&(e.ynx(0),e.TgZ(1,"button",36),e._uU(2),e.ALo(3,"translate"),e._UZ(4,"i",37),e.qZA(),e.BQk()),2&a&&(e.xp6(2),e.hij("",e.lcZ(3,1,"botones.guardar")," "))}function yo(a,i){if(1&a&&e._UZ(0,"app-map-icon",38),2&a){const t=e.oxw(3);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.reserves.id)("target","_blank")}}const Ne=function(){return["4","2","7"]},So=function(){return["4","2"]};function Uo(a,i){if(1&a&&(e.TgZ(0,"div",32),e.YNc(1,Ao,4,8,"ng-container",33),e.YNc(2,Do,5,3,"ng-container",33),e.YNc(3,yo,1,4,"app-map-icon",34),e.qZA()),2&a){const t=e.oxw(2);
1e.xp6(1),e.Q6J("appHasrole",e.DdM(3,Ne)),e.xp6(1),e.Q6J("appHasrole",e.DdM(4,So)),e.xp6(1),e.Q6J("ngIf",t.showMap)}}function qo(a,i){if(1&a&&e._UZ(0,"app-map-icon",38),2&a){const t=e.oxw(3);e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.reserves.id)("target","_blank")}}function Eo(a,i){if(1&a&&(e.TgZ(0,"div",32),e.YNc(1,qo,1,4,"app-map-icon",34),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.showMap)}}function No(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){return e.CHM(t),e.oxw(3).validateVersions()}),e._uU(1),e.ALo(2,"translate"),e.qZA()}if(2&a){const t=e.oxw(3);e.Q6J("disabled",t.disableValidateBtn),e.xp6(1),e.Oqu(e.lcZ(2,2,"botones.valSeleccion"))}}const Mo=function(){return["2","7"]};function Oo(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",14)(1,"div",39)(2,"div",40)(3,"h2"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",14)(7,"app-version-table",41),e.NdJ("newSelectEvent",function(o){return e.CHM(t),e.oxw(2).addSelection(o)})("newValidateVersionEvent",function(o){return e.CHM(t),e.oxw(2).validateVersions(o)})("newDeleteVersionEvent",function(o){return e.CHM(t),e.oxw(2).deleteVersion(o)}),e.qZA()(),e.TgZ(8,"div",14)(9,"div",24)(10,"div",32),e.YNc(11,No,3,4,"button",42),e.qZA()()()()()}if(2&a){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,6,"versionado.controlVersiones")),e.xp6(3),e.Q6J("searchResult",t.controlVersiones)("tableColumns",t.tableConfigurationReservasVersion)("itemName",t.udaDetail.nombre)("entityType",t.udaDemandType),e.xp6(4),e.Q6J("appHasrole",e.Dd
1M(8,Mo))}}function Io(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",45)(2,"h3",46),e.ALo(3,"translate"),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",14)(7,"div",39)(8,"app-manage-basic-table",47),e.NdJ("newSearchEvent",function(o){return e.CHM(t),e.oxw(3).viewRelatedUse(o)}),e.qZA()()(),e.BQk()}if(2&a){const t=e.oxw(3);e.xp6(2),e.s9C("matTooltip",e.lcZ(3,7,"agrarianDemands.fichaReservas.tltipUsosExpedientes")),e.xp6(2),e.hij(" ",e.lcZ(5,9,"agrarianDemands.fichaReservas.titleUsosExpedientes"),""),e.xp6(4),e.Q6J("searchResult",t.reserves.usosAsociados)("tableColumns",t.tableConfigurationUses)("visibleButtons",t.visibleButtonsUses)("showPagination",!1)("showFooter",!0)}}function Ro(a,i){if(1&a&&(e.ynx(0),e.YNc(1,Io,9,11,"ng-container",33),e.TgZ(2,"div",8)(3,"div",14),e._UZ(4,"div",44),e.TgZ(5,"div",20)(6,"span",18),e.ALo(7,"translate"),e._uU(8),e.ALo(9,"translate"),e.qZA()(),e.TgZ(10,"div",10)(11,"span",16),e._uU(12),e.ALo(13,"number"),e.qZA()()()(),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("appHasrole",e.Dd
1M(11,Ne)),e.xp6(5),e.s9C("matTooltip",e.lcZ(7,4,"agrarianDemands.fichaReservas.tltipTotal")),e.xp6(2),e.hij(" ",e.lcZ(9,6,"agrarianDemands.fichaReservas.lblTotal"),""),e.xp6(4),e.hij(" ",e.xi3(13,8,t.reserves.totalVariation,t.numRed)," ")}}function Lo(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",2)(2,"h2"),e._uU(3),e.qZA()(),e._UZ(4,"mat-divider",3),e.TgZ(5,"div",4)(6,"form",5,6),e.NdJ("ngSubmit",function(){return e.CHM(t),e.oxw().onSubmit()}),e.TgZ(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"mat-form-field",11),e._UZ(13,"input",12),e.qZA(),e.YNc(14,vo,3,3,"mat-error",13),e.qZA()()()(),e.TgZ(15,"div",14)(16,"div",8)(17,"div",9)(18,"div",15)(19,"span",16),e._uU(20),e.ALo(21,"translate"),e.qZA()(),e.TgZ(22,"div",10)(23,"mat-form-field",11),e._UZ(24,"input",17),e.qZA(),e.YNc(25,xo,3,3,"mat-error",13),e.qZA(),e.TgZ(26,"div",10),e._uU(27),e.ALo(28,"translate"),e.qZA(),e.YNc(29,bo,8,6,"ng-container",13),e.YNc(30,Co,16,13,"ng-container",13),e.qZA()()(),e.TgZ(31,"div",14)(32,"div",8)(33,"div",9)(34,"div",15)(35,"span",16),e._uU(36),e.ALo(37,"translate"),e.qZA()(),e.TgZ(38,"div",10)(39,"mat-form-field",11),e._UZ(40,"input",12),e.qZA(),e.YNc(41,Zo,3,3,"mat-error",13),e.qZA(),e.TgZ(42,"div",10),e._uU(43),e.ALo(44,"translate"),e.qZA()()()(),e.TgZ(45,"div",14)(46,"div",8)(47,"div",14)(48,"div",15)(49,"span",18),e.ALo(50,"translate"),e._uU(51),e.ALo(52,"translate"),e.qZA()(),e.TgZ(53,"div",10)(54,"span"),e._uU(55),e.ALo(56,"number"),e.qZA()(),e.TgZ(57,"div",10)(58,"span"),e._uU(59),e.ALo(60,"translate"),e.qZA()()()()(),e.TgZ(61,"div",14)(62,"div",19)(63,"div",9)(64,"div",20)(65,"span",16),e._uU(66),e.ALo(67,"translate"),e.qZA()(),e.TgZ(68,"div",21)(69,"mat-form-field",11),e._UZ(70,"textarea",22,23),e.qZA()()()()(),e.TgZ(72,"div",14)(73,"div",24),e.YNc(74,Uo,4,5,"div",25),e.YNc(75,Eo,2,1,"div",25),e.qZA()()(),e.YNc(76,Oo,12,9,"div",26),e._UZ(77,"mat-divider",3),e.YNc(78,Ro,14,12,"ng-container",13),e.qZA(),e.BQk()}if(2&a){const t=e.oxw();let n,o,s;e.xp6(3),e.AsE("",t.udaDetail.id," - ",t.udaDetail.nombre,""),e.xp6(3),e.Q6J("formGroup",t.reservesGroup),e.xp6(8),e.Q6J("ngIf",null==(n=t.reservesGroup.get("adjust_volume"))?null:n.hasError("pattern")),e.xp6(6),e.Oqu(e.lcZ(21,21,"agrarianDemands.fichaReservas.lblReserva")),e.xp6(5),e.Q6J("ngIf",null==(o=t.reservesGroup.get("reservaPlan"))?null:o.hasError("pattern")),e.xp6(2),e.hij(" ",e.lcZ(28,23,"unidades.hm3Anyo")," "),e.xp6(2),e.Q6J("ngIf",t.reserves.situation<0||0==t.reserves.situation),e.xp6(1),e.Q6J("ngIf",t.reserves.situation>0),e.xp6(6),e.Oqu(e.lcZ(37,25,"agrarianDemands.fichaReservas.lblAjuste")),e.xp6(5),e.Q6J("ngIf",null==(s=t.reservesGroup.get("adjust_volume"))?null:s.hasError("pattern")),e.xp6(2),e.hij(" ",e.lcZ(44,27,"unidades.hm3Anyo")," "),e.xp6(6),e.s9C("matTooltip",e.lcZ(50,29,"agrarianDemands.fichaReservas.tltipVariacion")),e.xp6(2),e.hij(" ",e.lcZ(52,31,"agrarianDemands.fichaReservas.lblVariacion"),""),e.xp6(4),e.hij(" ",e.xi3(56,33,t.reserves.totalVariation,t.numRed)," "),e.xp6(4),e.hij(" ",e.lcZ(60,36,"unidades.m3Anyo")," "),e.xp6(7),e.Oqu(e.l
1cZ(67,38,"agrarianDemands.fichaReservas.lblComentarios")),e.xp6(8),e.Q6J("ngIf",t.showEdit),e.xp6(1),e.Q6J("ngIf",!t.showEdit),e.xp6(1),e.Q6J("ngIf",t.existVersions),e.xp6(2),e.Q6J("ngIf",t.reserves.usosAsociados&&t.reserves.usosAsociados.length>0)}}function Po(a,i){1&a&&e._UZ(0,"app-spinner")}let wo=(()=>{class a{constructor(t,n,o,s,d,p,m){this.udaService=t,this.fb=n,this.router=o,this.activatedRoute=s,this.dialogModelService=d,this.translate=p,this.tableConfigurationService=m,this.isProfile=!1,this.stop$=new A.x,this.disableValidateBtn=!0,this.operation=r.C.operacion.OPERACION_UDA_RESERVAS,this.udaDemandType=r.C.tipoEntidad.usosAgricolas,this.showEdit=!0,this.existVersions=!1,this.selection=[],this.visibleButtons={search:{active:!1}},this.numberPipe=new x.JJ(this.translate.currentLang),this.elementCheckNameList=[],this.numRed=r.C.numRed,this.numRed3Dec=r.C.numRed3Dec,this.visibleButtonsUses={search:{active:!0}},this.tableConfigurationReservasVersion=this.tableConfigurationService.getVersionTableConfiguration(),this.tableConfigurationUses=this.tableConfigurationService.getUDARelatedUsesTableConfiguration()}ngOnInit(){this.reserves=this.udaDetail.reservasMod,this.udaService.getUsosExpedientes(this.udaDetail.id).subscribe(t=>{this.reserves.usosAsociados=t,this.createForm()}),-1==this.udaDetail.escenarioRef&&(this.showEdit=!1),this.isProfile&&this.udaService.getControlDeVersiones(Number(this.udaDetail.id),this.operation).subscribe(t=>{t.length>0&&(this.existVersions=!0),this.controlVersiones=t})}createForm(){var t,n,o;this.reservesGroup=this.fb.group({reservaPlan:this.fb.control({value:this.numberPipe.transform(null===(t=this.reserves)||void 0===t?void 0:t.reservaPlan,r.C.numRed),disabled:!this.isProfile},u.kI.pattern(r.C.regExpNumFormatted)),adjust_volume:this.fb.control({value:this.numberPipe.transform(null===(n=this.reserves)||void 0===n?void 0:n.adjust_volume,r.C.numRed),disabled:!this.isProfile},u.kI.pattern(r.C.regExpNumFormatted)),comments:this.fb.control({value:null===(o=this.reserves)||void 0===o?void 0:o.comments,disabled:!this.isProfile})}),this.initialValues=this.reservesGroup.value,this.elementCheckNameList=["reservaPlan","adjust_volume","variation"]}onSubmit(){if(this.reservesGroup.invalid)return;let t=_.c.compareObjects(this.initialValues,this.reservesGroup.value);Object.keys(t).length>0?this.router.navigate([`../../fieldsVersion/${this.udaDetail.id}/${this.operation}`],{relativeTo:this.activatedRoute,state:{comparedObject:this.prepareData(t),item:this.reserves,operation:this.operation}}):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.guardarCambios.titulo"),this.translate.instant("dialogos.guardarCambios.sinCambios"))}validateVersions(t){let n=[];t?n.push(t):n=this.selection.map(o=>o),this.udaService.validarBloque(n).subscribe(o=>{200===o.status?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),`${this.translate.instant("dialogos.validarVersion.validacionCorrecta")} ${o.body} ${this.translate.instant(o.body>1?"dialogos.validarVersion.variosElementos":"dialogos.validarVersion.1elemento")}`),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.validarVersion.tituloVersion"),this.translate.instant("dialogos.validarVersion.validacionError"))})}deleteVersion(t){this.udaService.descartarOperacion(t.version,t.operacionEntidad).subscribe(n=>{n?(this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartarVersion.titulo"),this.translate.instant("dialogos.descartarVersion.descartarCorrecta")),this.reloadComponent()):this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.descartarVersion.titulo"),this.translate.instant("dialogos.descartarVersion.descartarError"))})}addSelection(t){this.disableValidateBtn=0===t.length,this.selection=t}reloadComponent(){this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.navigate(["./"],{relativeTo:this.activatedRoute,queryParamsHandling:"merge"})}prepareData(t){let n=[];for(const o in t){let s,d,p=t[o];p&&this.elementCheckNameList.includes(o)&&(p=_.c.convertFormattedNumber(p.toString())),d=t[o],s=new de.i(o,this.translate.instant(`agrarianDemands.fic
1haReservas.lblsGuardarCambios.${o}`),p,d),n.push(s)}return n}viewRelatedUse(t){"Regad\xedo"===t.tipo&&(t.tipoEntidad=r.C.tipoEntidad.regadios),"Ganadero"===t.tipo&&(t.tipoEntidad=r.C.tipoEntidad.explotacionesGanaderas),"Privado"===t.tipo&&(t.tipoEntidad=r.C.tipoEntidad.privateUses);let n=_.c.getGeneralURL(t.tipoEntidad,`${t.codigo}`);_.c.isDMADueroURL(n)?window.location.href=n:this.router.navigate([`${n}`])}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(u.qu),e.Y36(f.F0),e.Y36(f.gz),e.Y36(z.r),e.Y36(c.sK),e.Y36(V.A))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-uda-reservas"]],inputs:{udaDetail:"udaDetail",entityName:"entityName",queryParams:"queryParams",isProfile:"isProfile",entityType:"entityType",showMap:"showMap"},decls:3,vars:2,consts:[[4,"ngIf","ngIfElse"],["loading",""],[1,"container-title","mt-1"],[1,"mb-2"],[1,"container","px-4"],[3,"formGroup","ngSubmit"],["technicalForm","ngForm"],["hidden","",1,"row"],[1,"col","col-xl-12"],[1,"row","inputRow"],[1,"col","col-xl-2"],["appearance","standard",1,"width-100"],["matInput","","name","adjust_volume","type","text","formControlName","adjust_volume"],[4,"ngIf"],[1,"row"],[1,"col","col-xl-5","labelForm"],["appBold",""],["matInput","","name","reservaPlan","type","text","formControlName","reservaPlan"],["appBold","","matTooltipPosition","below","matTooltipClass","custom-tooltip",3,"matTooltip"],[1,"col","col-xl-12","mt-4"],[1,"col","col-xl-2","labelForm"],[1,"col","col-xl-10"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","5","name","comments","formControlName","comments"],["autosize","cdkTextareaAutosize"],[1,"col-md-12"],["class","float-end",4,"ngIf"],["class","row",4,"ngIf"],[1,"col","col-xl-3"],[1,"col","col-xl-12","labelForm"],["appBold","","matTooltipPosition","below","matTooltipClass","custom-tooltip",1,"textRed",3,"matTooltip"],[1,"col","col-xl-3","textBlue"],[1,"col","col-xl-4","labelForm","textBlue"],[1,"float-end"],[4,"appHasrole"],[3,"entityName","queryParams","entityId","target",4,"ngIf"],["type","button","mat-flat-button","",1,"btn-first",3,"routerLink"],["type","submit","mat-flat-button","",1,"btn-second"],[1,"fa-regular","fa-floppy-disk"],[3,"entityName","queryParams","entityId","target"],[1,"col"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","itemName","entityType","newSelectEvent","newValidateVersionEvent","newDeleteVersionEvent"],["class","btn-first","type","button","mat-flat-button","",3,"disabled","click",4,"appHasrole"],["type","button","mat-flat-button","",1,"btn-first",3,"disabled","click"],[1,"col","col-xl-7"],[1,"container-subtitle"],["matTooltipPosition","after","matTooltipClass","custom-tooltip",3,"matTooltip"],[3,"searchResult","tableColumns","visibleButtons","showPagination","showFooter","newSearchEvent"]],template:function(t,n){if(1&t&&(e.YNc(0,Lo,79,40,"ng-container",0),e.YNc(1,Po,1,0,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",n.reserves.usosAsociados)("ngIfElse",o)}},directives:[x.O5,I.d,u._Y,u.JL,u.sg,R.KE,ie.Nt,u.Fj,u.JJ,u.u,R.TO,j.M,k.gM,me.IC,H.I,Y.lW,f.rH,Q.N,pe.L,W.D,w.O],pipes:[c.X$,x.JJ],styles:[""]}),a})();function Qo(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",9)(1,"div",10)(2,"div",11)(3,"h3"),e._uU(4),e.qZA()(),e.TgZ(5,"app-manage-basic-table",12),e.NdJ("newSearchEvent",function(o){return e.CHM(t),e.oxw(2).searchMeasure(o)}),e.qZA()()()}if(2&a){const t=i.$implicit,n=e.oxw(2);e.xp6(4),e.Oqu(t.tipo),e.xp6(1),e.Q6J("searchResult",t.elementos)("tableColumns",n.tableConfiguration)("visibleButtons",n.visibleButtons)("urlMapVisor",n.urlMapVisor)("actionsColumnWidth",8)("nameId","codigo")}}function Vo(a,i){if(1&a&&(e.ynx(0),e.YNc(1,Qo,6,7,"div",8),e.BQk()),2&a){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.measures)}}function Jo(a,i){if(1&a&&e._UZ(0,"app-map-icon",13),2&a){const t=e.oxw();e.Q6J("entityName",t.entityName)("queryParams",t.queryParams)("entityId",t.udaDetail.id)("target","_blank")}}let Yo=(()=>{class a{constructor(t,n,o,s){this.udaService=t,this.translate=n,this.tableConfigurationService=o,this.router=s,this.visibleButtons={search:{active:!0},edit:{active:!1},delete:{active:!1},map:{active:!0}},this.urlMapVisor="/viewer/"+r.C.measuresProgramEntity,this.stop$=new A.x,this.tableConfiguration=this.tableConfigurationService.getMeasuresGenericTechnicalTableConfiguration()}ngOnInit(){this.udaService.getMeasures(Number(this.udaDetail.id)).subscribe(t=>{this.measures=this.setObservacionesYTipo(t)})}setObservacionesYTipo(t){for(const n of t){let o=this.translate.instant("tablas.tablaMedidas.medidasDe"),s=this.translate.instant("tablas.tablaMedidas.vinculadasUso");n.tipo="Otros"==n.tipo?this.translate.instant("tablas.tablaMedidas.medidas")+this.translate.instant("tablas.tablaMedidas.otras")+s:o+n.tipo+s;for(const d of n.elementos)d.observaciones=null!==d.observaciones?this.translate.instant("tablas.tablaMedidas.vinculadoA")+d.observaciones:""}return t}searchMeasure(t){_.c.viewEntity(_.c.getTechnicalURL(r.C.tipoEntidad.medidas,`${t.codigo}`),this.router)}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(b.M),e.Y36(c.sK),e.Y36(V.A),e.Y36(f.F0))}
1,a.\u0275cmp=e.Xpm({type:a,selectors:[["app-measures"]],inputs:{udaDetail:"udaDetail",entityName:"entityName",queryParams:"queryParams",showMap:"showMap"},decls:10,vars:4,consts:[[1,"container-title","mt-1"],[1,"mb-2"],[1,"container"],[4,"ngIf"],[1,"row"],[1,"col-md-12"],[1,"float-end"],[3,"entityName","queryParams","entityId","target",4,"ngIf"],["class","row mt-2",4,"ngFor","ngForOf"],[1,"row","mt-2"],[1,"col"],[1,"container-subtitle","mb-2"],[3,"searchResult","tableColumns","visibleButtons","urlMapVisor","actionsColumnWidth","nameId","newSearchEvent"],[3,"entityName","queryParams","entityId","target"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"h2"),e._uU(2),e.qZA()(),e._UZ(3,"mat-divider",1),e.TgZ(4,"div",2),e.YNc(5,Vo,2,1,"ng-container",3),e.TgZ(6,"div",4)(7,"div",5)(8,"div",6),e.YNc(9,Jo,1,4,"app-map-icon",7),e.qZA()()()()),2&t&&(e.xp6(2),e.AsE("",n.udaDetail.id," - ",n.udaDetail.nombre,""),e.xp6(3),e.Q6J("ngIf",n.measures&&n.measures.length>0),e.xp6(4),e.Q6J("ngIf",n.showMap))},directives:[I.d,x.O5,x.sg,W.D,Q.N],styles:[""]}),a})();function Go(a,i){if(1&a&&(e.TgZ(0,"div"),e._UZ(1,"app-technical-data-no-perfil",8),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("udaDemandsDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("entityNameUDA",t.entityNameUDA)("queryParamsUDA",t.queryParamsUDA)("showMap",t.showMap)}}function Bo(a,i){if(1&a&&(e.TgZ(0,"div"),e._UZ(1,"app-technical-data-perfil",8),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("udaDemandsDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("entityNameUDA",t.entityNameUDA)("queryParamsUDA",t.queryParamsUDA)("showMap",t.showMap)}}function Fo(a,i){if(1&a&&(e.TgZ(0,"div")(1,"mat-tab",3),e.ALo(2,"translate"),e._UZ(3,"app-captations",9),e.qZA()()),2&a){const t=e.oxw(2);e.xp6(1),e.s9C("label",e.lcZ(2,5,"pestanas.captaciones")),e.xp6(2),e.Q6J("demandDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("isProfile",!0)}}function jo(a,i){if(1&a&&(e.TgZ(0,"div"),e._UZ(1,"app-trend",10),e.qZA()),2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("udaDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("isProfile",!0)("showMap",t.showMap)}}function ko(a,i){if(1&a&&(e.TgZ(0,"div"),e._UZ(1,"app-trend",10),e.qZA()),2&a){const t=e.oxw(3);e.xp6(1),e.Q6J("udaDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("isProfile",!1)("showMap",t.showMap)}}const _e=function(){return["4","2","7"]};function $o(a,i){1&a&&(e.YNc(0,jo,2,5,"div",5),e.YNc(1,ko,2,5,"div",4)),2&a&&(e.Q6J("appHasrole",e.Dd
1M(2,_e)),e.xp6(1),e.Q6J("appNothasrole",e.DdM(3,_e)))}function Ho(a,i){if(1&a&&(e.TgZ(0,"div"),e._UZ(1,"app-uda-calidad-garantias",10),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("udaDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("isProfile",!0)("showMap",t.showMap)}}function zo(a,i){if(1&a&&(e.TgZ(0,"div"),e._UZ(1,"app-uda-calidad-garantias",10),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("udaDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("isProfile",!1)("showMap",t.showMap)}}function Wo(a,i){if(1&a&&e._UZ(0,"app-uda-reservas",10),2&a){const t=e.oxw(3);e.Q6J("udaDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("isProfile",!0)("showMap",t.showMap)}}function Ko(a,i){1&a&&(e.TgZ(0,"div")(1,"mat-tab",3),e.ALo(2,"translate"),e.YNc(3,Wo,1,5,"ng-template",6),e.qZA()()),2&a&&(e.xp6(1),e.s9C("label",e.lcZ(2,1,"pestanas.reservasUDA")))}const ge=function(){return["4","2"]};function Xo(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"mat-tab-group",2),e.NdJ("selectedTabChange",function(o){return e.CHM(t),e.oxw().tabChanged(o)}),e.TgZ(2,"mat-tab",3),e.ALo(3,"translate"),e.YNc(4,Go,2,6,"div",4),e.YNc(5,Bo,2,6,"div",5),e.qZA(),e.YNc(6,Fo,4,7,"div",5),e.TgZ(7,"mat-tab",3),e.ALo(8,"translate"),e.YNc(9,$o,2,4,"ng-template",6),e.qZA(),e.TgZ(10,"mat-tab",3),e.ALo(11,"translate"),e.YNc(12,Ho,2,5,"div",5),e.YNc(13,zo,2,5,"div",4),e.qZA(),e.TgZ(14,"mat-tab",3),e.ALo(15,"translate"),e.TgZ(16,"div"),e._UZ(17,"app-uses",7),e.qZA()(),e.YNc(18,Ko,4,3,"div",5),e.TgZ(19,"mat-tab",3),e.ALo(20,"translate"),e.TgZ(21,"div"),e._UZ(22,"app-measures",7),e.qZA()()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(1),e.Q6J("selectedIndex",t.selectedTab),e.xp6(1),e.s9C("label",e.lcZ(3,20,"pestanas.datosGenerales")),e.xp6(2),e.Q6J("appNothasrole",e.Dd
1M(30,ge)),e.xp6(1),e.Q6J("appHasrole",e.DdM(31,ge)),e.xp6(1),e.Q6J("appHasrole",e.DdM(32,_e)),e.xp6(1),e.s9C("label",e.lcZ(8,22,"pestanas.tendencias")),e.xp6(3),e.s9C("label",e.lcZ(11,24,"pestanas.garantiaCalidad")),e.xp6(2),e.Q6J("appHasrole",e.DdM(33,ge)),e.xp6(1),e.Q6J("appNothasrole",e.DdM(34,ge)),e.xp6(1),e.s9C("label",e.lcZ(15,26,"pestanas.usosAsociados")),e.xp6(3),e.Q6J("udaDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("showMap",t.showMap),e.xp6(1),e.Q6J("appHasrole",e.DdM(35,_e)),e.xp6(1),e.s9C("label",e.lcZ(20,28,"pestanas.medidas")),e.xp6(3),e.Q6J("udaDetail",t.udaDemands)("entityName",t.entityName)("queryParams",t.queryParams)("showMap",t.showMap)}}function er(a,i){1&a&&e._UZ(0,"app-spinner")}let tr=(()=>{class a{constructor(t,n,o,s,d,p){this.route=t,this.entityMenuService=n,this.router=o,this.selectedTabService=s,this.configService=d,this.agrarianDemandsService=p,this.prueba="",this.selectedTab=0,this.numRed=r.C.numRed,this.coordinates=[],this.entityName=r.C.agrarianDemandEntity,this.stop$=new A.x,this.showMap=!0;let m=this.route.snapshot.paramMap.get("gid");null!=m&&(this.entityMenuService.submenuChange(!0),this.entityMenuService.gidEntitySubject$.next(m),this.agrarianDemandsService.getAgrarianDemand(Number(m)).subscribe(v=>{this.udaDemands=v,3!=this.udaDemands.hasGeometry&&(this.showMap=!1);const h=M.K.getAgrarianDemandsViewerData(v,this.configService);this.entityNameUDA=h.entityName,this.queryParamsUDA=h.queryParams,this.entityName=h.entityName,this.queryParams=h.queryParams}))}ngOnInit(){this.selectedTabService.tabIndexSubject$.pipe((0,U.R)(this.stop$)).subscribe(t=>{this.selectedTab=t})}tabChanged(t){this.resetTab(!0),this.selectedTabService.changeTab(t.index)}addCoordinates(t){this.coordinates=t}ngOnDestroy(){this.stop$.next(!0)}resetTab(t){t&&(this.coordinates=[])}resetTabEdit(t){}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(f.gz),e.Y36(C.$),e.Y36(f.F0),e.Y36(L.O),e.Y36(O.E),e.Y36(b.M))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-technical-data"]],decls:3,vars:2,consts:[[4,"ngIf","ngIfElse"],["loading",""],[3,"selectedIndex","selectedTabChange"],[3,"label"],[4,"appNothasrole"],[4,"appHasrole"],["matTabContent",""],[3,"udaDetail","entityName","queryParams","showMap"],[3,"udaDemandsDetail","entityName","queryParams","entityNameUDA","queryParamsUDA","showMap"],[3,"demandDetail","entityName","queryParams","isProfile"],[3,"udaDetail","entityName","queryParams","isProfile","showMap"]],template:function(t,n){if(1&t&&(e.YNc(0,Xo,23,36,"ng-container",0),e.YNc(1,er,1,0,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",n.udaDemands)("ngIfElse",o)}},directives:[x.O5,ve.SP,ve.uX,Ue.b,oa,H.I,Da,Sa,ve.Vc,En,oo,fo,wo,Yo,w.O],pipes:[c.X$],styles:[""]}),a})();var ar=l(8070),nr=l(6159),ir=l(291);function or(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",2)(2,"h2"),e._uU(3),e.qZA()(),e._UZ(4,"mat-divider",3),e.TgZ(5,"app-version-fields-form",4),e.NdJ("newSelectionEvent",function(o){return e.CHM(t),e.oxw().setSelectedItems(o)}),e.qZA(),e.TgZ(6,"app-aditional-data-form",5),e.NdJ("newAditionalDataEvent",function(o){return e.CHM(t),e.oxw().saveData(o)}),e.qZA(),e.BQk()}if(2&a){const t=i.ngIf,n=e.oxw();e.xp6(3),e.AsE("",t.id," - ",t.nombre,""),e.xp6(2),e.Q6J("modifiedData",n.navigationData),e.xp6(1),e.Q6J("entityId",t.id)("guardando",n.guardando)("newRouterLink",n.routerLinkVolver)}}function rr(a,i){1&a&&e._UZ(0,"app-spinner")}let Me=(()=>{class a{constructor(t,n,o,s,d,p){var m;this.router=t,this.udaDemandService=n,this.rolesService=o,this.activatedRoute=s,this.dialogModelService=d,this.translate=p,this.selectedItems=[],this.stop$=new A.x,this.routerLinkVolver="../../../technical",this.tab="",this.guardando=!1;let v=this.activatedRoute.snapshot.paramMap.get("gid");null!=v&&(this.udaDemand$=this.udaDemandService.getAgrarianDemand(Number(v))),this.tab=this.activatedRoute.snapshot.paramMap.get("tab")||"",this.navigationData=null===(m=this.router.getCurrentNavigation())||void 0===m?void 0:m.extras.state,_.c.isUndefined(this.navigationData.item)||(this.itemDetail=this.navigationData.item,this.year=this.navigationData.year),this.modifiedData=_.c.isUndefined(this.navigationData.comparedObject)?this.navigationData:this.navigationData.comparedObject,this.navigationData=this.modifiedData}
1ngOnInit(){}setSelectedItems(t){this.selectedItems=t}saveData(t){let n=Number(this.tab),o=0,s=n===r.C.operacion.OPERACION_GENERAL,d=n===r.C.operacion.OPERACION_UDA_TENDENCIAS,p=n===r.C.operacion.OPERACION_UDA_CALIDAD,m=n===r.C.operacion.OPERACION_UDA_RESERVAS;this.selectedItems.length>0?this.udaDemand$.pipe((0,U.R)(this.stop$)).subscribe(v=>{let Z,h=v;Z=_.c.isUndefined(this.itemDetail)?this.prepareData(h):this.prepareData(this.itemDetail),s?(o=r.C.operacion.OPERACION_GENERAL,h=Z):d?(h.trendMod=Z,h.trendMod.stage=this.year,o=r.C.operacion.OPERACION_UDA_TENDENCIAS):p?(h.calidadMod=Z,o=r.C.operacion.OPERACION_UDA_CALIDAD):m&&(h.reservasMod=Z,o=r.C.operacion.OPERACION_UDA_RESERVAS),this.save(h,t,o)}):(this.guardando=!this.guardando,this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.guardarCambios.titulo"),this.translate.instant("dialogos.guardarCambios.seleccionCampos")))}prepareData(t){let n=t;for(const o of this.selectedItems){let s=o.name,d=this.modifiedData.find(p=>p.name===s).value;n[s]=d}return n}save(t,n,o){if(null!=t){let s=new ar.Z(t,n,o);this.udaDemandService.guardarVersionado(s).subscribe(d=>{this.manageResponse(d)})}}manageResponse(t){if(200===t.status){this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.guardarCambios.titulo"),this.translate.instant("dialogos.guardarCambios.operacionCorrecta"));let n=this.activatedRoute.snapshot.paramMap.get("gid");n=t.body.id,this.router.navigate([`${this.routerLinkVolver}/${n}`],{relativeTo:this.activatedRoute})}else this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.guardarCambios.titulo"),this.translate.instant("dialogos.guardarCambios.operacionError"))}ngOnDestroy(){this.stop$.next(!0)}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(f.F0),e.Y36(b.M),e.Y36(ne.f),e.Y36(f.gz),e.Y36(z.r),e.Y36(c.sK))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-fields-version"]],decls:4,vars:4,consts:[[4,"ngIf","ngIfElse"],["loading",""],[1,"container-title"],[1,"mb-2"],[3,"modifiedData","newSelectionEvent"],[3,"entityId","guardando","newRouterLink","newAditionalDataEvent"]],template:function(t,n){if(1&t&&(e.YNc(0,or,7,6,"ng-container",0),e.ALo(1,"async"),e.YNc(2,rr,1,0,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(3);e.Q6J("ngIf",e.lcZ(1,2,n.udaDemand$))("ngIfElse",o)}},directives:[x.O5,I.d,nr.L,ir.T,w.O],pipes:[x.Ov],styles:[""]}),a})();var sr=l(2941),lr=l(2367);function cr(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"app-historical-fields",3),e.NdJ("newSearchEvent",function(o){return e.CHM(t),e.oxw().searchChanges(o)}),e.qZA(),e.BQk()}if(2&a){const t=i.ngIf,n=e.oxw();e.xp6(1),e.Q6J("fields",t)("gid",n.gid)("itemData",n.itemDetail)("newRouterLink",n.routerLinkVolver)}}function dr(a,i){if(1&a&&(e.ynx(0),e._UZ(1,"app-historical-table",4),e.BQk()),2&a){const t=i.ngIf,n=e.oxw();e.xp6(1),e.Q6J("searchResult",t)("gid",n.gid)("searchField",n.selectedValueName)("tableColumns",n.tableConfiguration)}}let Oe=(()=>{class a{constructor(t,n,o,s){var d;this.route=t,this.udaDemandService=n,this.tableConfigurationService=o,this.router=s,this.gid="",this.tab="",this.name="",this.id1EditedElement="",this.id2EditedElement="",this.selectedValueName="",this.routerLinkVolver="../../../../technical",this.gid=this.route.snapshot.paramMap.get("gid")||"",this.tab=this.route.snapshot.paramMap.get("tab")||"",this.name=this.route.snapshot.paramMap.get("name")||"",this.id1EditedElement=this.route.snapshot.paramMap.get("id1EditedElement")||"0",this.id2EditedElement=this.route.snapshot.paramMap.get("id2EditedElement")||"0",this.tableConfiguration=this.tableConfigurationService.getHistoricalTableConfiguration(r.C.numRed4Dec),this.historicalFields$=this.udaDemandService.getListadoCamposHistorico(Number(this.tab)),this.itemDetail=null===(d=this.router.getCurrentNavigation())||void 0===d?void 0:d.extras.state,"110"==this.tab&&(this.routerLinkVolver="../../../../../../technical")}ngOnInit(){}searchChanges(t){this.selectedValueName=t.nombreOriginal,""!==this.gid&&""!==this.tab&&(this.historical$=this.udaDemandService.getHistoricoCampo(Number(this.gid),Number(this.tab),t.nombre,Number(this.id1EditedElement),Number(this.id2EditedElement)))}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(f.gz),e.Y36(b.M),e.Y36(V.A),e.Y36(f.F0))}
1,a.\u0275cmp=e.Xpm({type:a,selectors:[["app-historical"]],decls:8,vars:8,consts:[[1,"container-title"],[1,"mb-2"],[4,"ngIf"],[3,"fields","gid","itemData","newRouterLink","newSearchEvent"],[3,"searchResult","gid","searchField","tableColumns"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"h2"),e._uU(2),e.qZA()(),e._UZ(3,"mat-divider",1),e.YNc(4,cr,2,4,"ng-container",2),e.ALo(5,"async"),e.YNc(6,dr,2,4,"ng-container",2),e.ALo(7,"async")),2&t&&(e.xp6(2),e.AsE("",n.gid," - ",n.name,""),e.xp6(2),e.Q6J("ngIf",e.lcZ(5,4,n.historicalFields$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(7,6,n.historical$)))},directives:[I.d,x.O5,sr.f,lr.q],pipes:[x.Ov],styles:[""]}),a})();var mr=l(4327);class pr{constructor(i,t,n,o,s,d){this.camposInforme=i,this.parametrosBusqueda=t,this.codigoInforme=n,this.anyoSeleccionado=o,this.tipoExcelReferencia=s,this.idMasa=d}}var ur=l(2915);function _r(a,i){if(1&a&&(e.TgZ(0,"mat-option",9),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function gr(a,i){if(1&a&&(e.TgZ(0,"mat-option",9),e._uU(1),e.qZA()),2&a){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.nombre," ")}}function hr(a,i){if(1&a){const t=e.EpF();e.TgZ(0,"div",6)(1,"mat-form-field",7)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"mat-select",12),e.NdJ("selectionChange",function(o){return e.CHM(t),e.oxw(2).getChangeComboAnyo(o)}),e._UZ(6,"mat-option",9),e.YNc(7,gr,2,2,"mat-option",10),e.qZA()()()}if(2&a){const t=e.oxw(2);e.xp6(3),e.Oqu(e.lcZ(4,3,"informes.seleccionEscenarioConsulta")),e.xp6(2),e.Q6J("errorStateMatcher",t.matcher),e.xp6(2),e.Q6J("ngForOf",t.comboAnyo)}}function fr(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"form",1,2)(3,"div",3)(4,"h2"),e._uU(5),e.ALo(6,"translate"),e.qZA()(),e.TgZ(7,"div",4)(8,"div",5)(9,"div",6)(10,"mat-form-field",7)(11,"mat-label"),e._uU(12),e.ALo(13,"translate"),e.qZA(),e.TgZ(14,"mat-select",8),e.NdJ("selectionChange",function(o){return e.CHM(t),e.oxw().getChangeCombo(o)}),e._UZ(15,"mat-option",9),e.YNc(16,_r,2,2,"mat-option",10),e.qZA()()(),e.YNc(17,hr,8,5,"div",11),e.qZA()()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.reportGroup),e.xp6(4),e.Oqu(e.lcZ(6,6,"informes.informesParametrizables")),e.xp6(7),e.Oqu(e.l
1cZ(13,8,"informes.seleccionTipoInforme")),e.xp6(2),e.Q6J("errorStateMatcher",t.matcher),e.xp6(2),e.Q6J("ngForOf",t.reportCombo),e.xp6(1),e.Q6J("ngIf",t.annosView)}}function vr(a,i){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"app-report-common",13),e.NdJ("newGenerateReportEvent",function(o){return e.CHM(t),e.oxw().generateReport(o)}),e.qZA(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(1),e.Q6J("entity",t.entity)("showReportOptions",t.showReportOptions)("generatingReport",t.generatingReport)}}const xr=function(){return["../"]};function br(a,i){1&a&&(e.ynx(0),e.TgZ(1,"div",14)(2,"div",15)(3,"button",16),e._uU(4),e.ALo(5,"translate"),e.qZA()()(),e.BQk()),2&a&&(e.xp6(3),e.Q6J("routerLink",e.DdM(4,xr)),e.xp6(1),e.Oqu(e.lcZ(5,2,"botones.volver")))}const Cr=[{path:"",data:{breadcrumb:"bCAgrarianDemands"},component:ee,children:[{path:"",data:{breadcrumb:"null"},redirectTo:"data",pathMatch:"full"},{path:"data",data:{breadcrumb:"bCData"},component:Ye},{path:"search",data:{breadcrumb:"bCBusInf"},component:ft,children:[{path:"",data:{breadcrumb:"null"},component:ht},{path:"general/:gid",data:{breadcrumb:"bCFichaGral"},component:Gt},{path:"technical/:gid",data:{breadcrumb:"bCFichaTec"},component:tr},{path:"fieldsHistory/:gid/:tab/:name",data:{breadcrumb:"bCHist",profiles:["3","2","4","7","11","12"],authRequired:!1},component:Oe},{path:"fieldsHistory/:gid/:tab/:name/:id1EditedElement/:id2EditedElement",data:{breadcrumb:"bCHist",profiles:["3","2","4","7","11","12"],authRequired:!1},component:Oe},{path:"fieldsVersion/:gid",data:{breadcrumb:"bCVers"},component:Me},{path:"fieldsVersion/:gid/:tab",data:{breadcrumb:"bCVers"},component:Me},{path:"report",data:{breadcrumb:"bCInf"},component:(()=>{class a{constructor(t,n,o,s,d,p){var m;this.globalService=t,this.router=n,this.dialogModelService=o,this.translate=s,this.UDAService=d,this.fb=p,this.showReportOptions=!1,this.generatingReport=!1,this.valueComboSelectedAnyo=-1,this.matcher=new ae.o,this.stop$=new A.x,this.perfilUsuario="",this.annosView=!1,this.navigationData=null===(m=this.router.getCurrentNavigation())||void 0===m?void 0:m.extras.state,_.c.isUndefined(this.navigationData.searchGroup)||(this.formData=this.navigationData.searchGroup),_.c.isUndefined(this.navigationData.profile)||(this.perfilUsuario=this.navigationData.profile)}ngOnInit(){this.globalService.getComboInformesReport(r.C.tipoEntidad.usosAgricolas).subscribe(t=>{this.reportCombo=t,this.createForm()}),this.UDAService.combosBusquedaSubject$.pipe((0,U.R)(this.stop$)).subscribe(t=>{this.comboAnyo=t.find(n=>n.listado===r.C.COMBO_ESCENARIOS).data})}generateReport(t){this.callToGenerarInforme(t,this.valueComboSelected,this.valueComboSelectedAnyo)}callToGenerarInforme(t,n,o){this.generatingReport=!0;let s=new pr(t,this.formData,n,o);this.UDAService.generarInformeGeneral(s).subscribe(d=>{this.processResponse(d)})}processResponse(t){if(200===t.status){let n=_.c.toArrayBuffer(t.body.contenido);const o=new Blob([n],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),s=new File([o],t.body.nombre,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});mr(s)}else this.dialogModelService.openMessageDialog(this.translate.instant("dialogos.informes.titulo"),this.translate.instant("dialogos.informes.informeError"));this.generatingReport=!1}getChangeCombo(t){let n=t.value;this.valueComboSelected=n,this.reportGroup.get("comboAnyo").enable(),this.reportGroup.controls.comboAnyo.setValue(""),_.c.isUndefined(t.value)||_.c.isNullorEmpty(t.value)?(this.generatingReport=!1,this.showReportOptions=!1,this.valueComboSelectedAnyo=-1,this.entity=0):(n===r.C.informeEnum.DATOS_UDA?(this.annosView=!1,this.valueComboSelectedAnyo=-1,this.entity=r.C.tipoEntidad.usosAgricolasGenerales):n===r.C.informeEnum.DATOS_UDA_COMUNIDADES?(this.entity=r.C.tipoEntidad.usosAgricolasComunidades,this.annosView=!0,this.valueComboSelectedAnyo=-1):n===r.C.informeEnum.DATOS_UDA_INFORMES?(this.annosView=!1,this.valueComboSelectedAnyo=-1,this.entity=r.C.tipoEntidad.usosAgricolasInformes):n===r.C.informeEnum.DATOS_UDA_CALIDAD?(this.entity=r.C.tipoEntidad.UDACalidad,this.annosView=!0,this.valueComboSelectedAnyo=-1):n===r.C.informeEnum.DATOS_UDA_TENDENCIAS&&(this.entity=r.C.tipoEntidad.UDATendencias,this.annosView=!0,this.valueComboSelectedAnyo=-1),this.showReportOptions=!0)}getChangeComboAnyo(t){this.valueComboSelectedAnyo=t.value,_.c.isUndefined(t.value)||_.c.isNullorEmpty(t.value)?(this.showReportOptions=!1,this.valueComboSelectedAnyo=-1):this.showReportOptions=!0}createForm(){this.reportGroup=this.fb.group({codReportOptionsCombo:this.fb.control({value:"",disabled:!1},u.kI.required),comboAnyo:this.fb.control({value:"",disabled:!0},u.kI.required)})}disableComboAnyo(){this.reportGroup.get("comboAnyo").disable(),this.reportGroup.controls.comboAnyo.setValue(""),this.valueComboSelectedAnyo=-1}}return a.\u0275fac=function(t){return new(t||a)(e.Y36(he.U),e.Y36(f.F0),e.Y36(z.r),e.Y36(c.sK),e.Y36(b.M),e.Y36(u.qu))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-report"]],decls:3,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],["newReportForm","ngForm"],[1,"container-subtitle","mb-1"],[1,"container"],[1,"row"],[1,"col","col-xl-6"],["appearance","fill",1,"width-100"],["id","codReportOptionsCombo","formControlName","codReportOptionsCombo",3,"errorStateMatcher","selectionChange"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],["class","col col-xl-6",4,"ngIf"],["id","comboAnyo","formControlName","comboAnyo",3,"errorStateMatcher","selectionChange"],[3,"entity","showReportOptions","generatingReport","newGenerateReportEvent"],[1,"col-md-12"],[1,"float-end"],["type","button","mat-flat-button","",1,"btn-second",3,"routerLink"]],template:function(t,n){1&t&&(e.YNc(0,fr,18,10,"ng-container",0),e.YNc(1,vr,2,3,"ng-container",0),e.YNc(2,br,6,5,"ng-container",0)),2&t&&(e.Q6J("ngIf",n.reportCombo&&n.reportCombo.length>0),e.xp6(1),e.Q6J("ngIf",188===n.entity||190===n.entity||(191===n.entity||189===n.entity||192===n.entity)&&-1!=n.valueComboSelectedAnyo),e.xp6(1),e.Q6J("ngIf",!n.entity))},directives:[x.O5,u._Y,u.JL,u.sg,R.KE,R.hX,te.gD,u.JJ,u.u,F.ey,x.sg,ur.t,Y.lW,f.rH],pipes:[c.X$],styles:[""]}),a})()}]}]}];let Zr=(()=>{class a{}return a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[[f.Bz.forChild(Cr)],f.Bz]}),a})();var Tr=l(8066);function Ie(a){return new y.w(a,"./assets/i18n/agrarianDemands/",".json")}let Ar=(()=>{class a{constructor(){}}return a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({providers:[],imports:[[g.m,Zr,Tr.j,c.aw.forChild({defaultLanguage:r.C.defaultLanguage,loader:{provide:c.Zw,useFactory:Ie,deps:[T.eN]},isolate:!1,extend:!0})]]}),a})()},8066:(G,N,l)=>{l.d(N,{j:()=>y});var g=l(4486),c=l(5e3);let y=(()=>{class T{}return T.\u0275fac=function(r){return new(r||T)},T.\u0275mod=c.oAB({type:T}),T.\u0275inj=c.cJS({imports:[[g.m],g.m]}),T})()}}]);

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.