(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[61],{"+bBF":function(e,t,a){"use strict";var r=a("2UNB");class s extends r.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");super(e)}getLength(){const{SetData:{Stages:e}}=this;return e.reduce((e,t)=>e+t.Days,0)}getBackendStages(){return this.SetData.Stages.map(e=>({days:e.Days,requestedTemperature:e.ExpectedTemperature,minimumVentilation:e.Ventilation[0],maximumVentilation:e.Ventilation[1]}))}getMinAndMax(){let e=0,t=0;for(let a=1;a>=0;a--){let t=this.SetData.Stages[a];0===a?e-=t.Days:e=-t.Days}for(let a=3;at.Percentage*t.Cost/100+e,0)}catch(e){return 0}}getCost(){try{return c()(this.SetData.Cost)?this.SetData.Cost:this.getRecipeCosts()||0}catch(e){return 0}}addIngredient(e,t,a=0){if(e instanceof S.a){const r=s()(this.getRecipe()),n={Cost:a,Percentage:t,IngredientID:e.WordID,Name:e.WData.Name};r.push(n),r.sort((e,t)=>e.Percentage-t.Percentage),this.SetData.Recipe=r}}removeIngredient({SetID:e}={}){this.SetData.Recipe=s()(this.getRecipe()).filter(t=>t.SetData.IngredientID!==e)}getOriginalForageID(){return this.SetData.PrimeForageID||this.SetID}setOriginalForageID(e=null){this.SetData.PrimeForageID=e}}t.a=D},PejV:function(e,t,a){"use strict";var r=a("2UNB");class s extends r.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");if(!e.SetData.Levels)throw new Error("FarmMap Buildings must include an KeyLevel-ValSVGString");super(e)}}t.a=s},Wlyo:function(e,t,a){"use strict";var r=a("2UNB");class s extends r.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");super(e)}}t.a=s},Zx0i:function(e,t,a){"use strict";var r=a("BkRI"),s=a.n(r),n=a("lFKM"),i=a.n(n),o=a("2UNB");class c extends o.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");if(!i()(e.SetData.Index))throw new Error("Schedule Index must be a number");if(!e.SetData.Name)throw new Error("Schedule Name must be specified");if(!e.SetData.Doses||!e.SetData.Doses.length)throw new Error("Schedule Doses must include at least single dose");e.SetData.Doses.forEach(e=>{if(!i()(e.Percent))throw new Error("Schedule Doses[x].Percent must be a number");if(!i()(e.Start))throw new Error("Schedule Doses[x].Start must be a number");if(!i()(e.Stop))throw new Error("Schedule Doses[x].Stop must be a number")}),super(e)}convertToBackend(e=!0){return{doses:s()(this.SetData.Doses).map(e=>({percent:e.Percent,start:e.Start,stop:e.Stop})),number:this.SetData.Index+1,id:this.SetID,API:e?this.prepareBeanToSave():void 0}}}t.a=c},ehys:function(e,t,a){"use strict";var r=a("2UNB"),s=a("B6RA"),n=a("OwcS"),i=a("P0Qa");class o extends r.a{static createSystemSchedule(e,t,a){let r=s.default.getState();const{user:{user:{ClientID:c}},location:{farm:u}}=r;return new o({SetID:Object(n.a)(),DtaModTime:(new Date).getTime(),ClientID:c,FarmID:u,SetType:i.a.SYSTEM_SCHEDULE,SetData:{Name:e,Index:a,Intervals:t}})}getBackendObject(){const e=s.default.getState(),{settings:{scheduleWorktypes:t}}=e;return{nr:this.SetData.Index+1,intervals:this.SetData.Intervals.map(e=>{let a=t.find(t=>t.SetID===e.WorkType);if(!a)throw new Error("Nie odnaleziono trybu pracy harmonogramu");return{st:e.StartTime,sp:e.StopTime,t:a.SetData.Index}})}}}t.a=o},faQZ:function(e,t,a){"use strict";var r=a("2UNB");class s extends r.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");super(e)}}t.a=s},kB5K:function(e,t,a){"use strict";var r=a("BkRI"),s=a.n(r),n=a("lFKM"),i=a.n(n),o=a("2UNB"),c=a("6/k7");class u extends o.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");if(!i()(e.SetData.Index))throw new Error("Curve Index is not a number");if(!e.SetData.Type)throw new Error("Curve Type is not specified");if(!Object.values(c.b).includes(e.SetData.Type))throw new Error("Curve Type is not one of [".concat(Object.values(c.b).join(", "),"]"));if(!e.SetData.Name)throw new Error("Curve Name is not specified");if(!e.SetData.Days||!e.SetData.Days.length)throw new Error("Curve Days must include at least single day");e.SetData.Days.forEach(e=>{if(!i()(e.DailyPlan))throw new Error("Curve Days[x].DailyPlan must be a number");if(!i()(e.ForageAmount))throw new Error("Curve Days[x].ForageAmount must be a number");if(!i()(e.ForageType))throw new Error("Curve Days[x].ForageType must be a number")}),e.SetData.Stages&&e.SetData.Stages.forEach(e=>{if(!i()(e.StartDay))throw new Error("Curve Stages[x].StartDay must be a number");if(!e.Name)throw new Error("Curve Stages[x].Name must be present")}),super(e)}convertToBackend(e=!0){return{days:s()(this.SetData.Days).map(e=>({amount:e.ForageAmount,schedule:e.DailyPlan+1,forage:e.ForageType+1})),number:this.SetData.Index+1,insemination:this.SetData.InseminationJumpTo||0,parturition:0,id:this.SetID,API:e?this.prepareBeanToSave():void 0}}getIndex(){return this.SetData.Index}}t.a=u},rBIo:function(e,t,a){"use strict";var r=a("Y+p1"),s=a.n(r),n=a("2UNB");class i extends n.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");super(e)}getLength(){const{SetData:{Stages:e}}=this;return e.reduce((e,t)=>e+t.Days,0)}getBackendStages(){return this.SetData.Stages.map(e=>({days:e.Days,requestedTemperature:e.RequestedTemperature,minimumVentilation:e.MinimumVentilation,floor:e.Floor}))}equalCheck(e=[]){const t=this.getBackendStages();return s()(t,e)}setBackendStages(e=[]){this.SetData.Stages=e.map(e=>({Days:e.days,RequestedTemperature:e.requestedTemperature,MinimumVentilation:e.minimumVentilation,Floor:e.floor}))}}t.a=i},wyc1:function(e,t,a){"use strict";var r=a("2UNB");class s extends r.a{constructor(e){if(!e.SetData)throw new Error("SetData missing");super(e)}setPlan(e,t){let a=this.SetData.Plans.find(t=>t.Year===e);a?a.Data=t:this.SetData.Plans.push({Year:e,Data:t}),this.setDtaModTime()}}t.a=s},"zH/4":function(e,t,a){"use strict";var r=a("2UNB"),s=a("OwcS"),n=a("B6RA"),i=a("P0Qa"),o=a("Zayz");class c extends r.a{static createSystemScheduleWorktype(e,t,a,r){let o=n.default.getState();const{user:{user:{ClientID:u}},location:{farm:S}}=o;return new c({SetID:Object(s.a)(),DtaModTime:(new Date).getTime(),ClientID:u,FarmID:S,SetType:i.a.SYSTEM_SCHEDULE_WORKTYPE,SetData:{Name:e,WorkTime:t,StopTime:a,Index:r}})}getSelectName(){return"".concat(this.SetData.Index," - ").concat(this.SetData.Name," - ").concat(Object(o.e)(this.SetData.WorkTime)," / ").concat(Object(o.e)(this.SetData.StopTime))}getBackendObject(){return{nr:this.SetData.Index+1,mode:{tOn:this.SetData.WorkTime,tOff:this.SetData.StopTime}}}}t.a=c}}]); //# sourceMappingURL=main~944ad4c6.104fa593.chunk.js.map