(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[8],{"0u5A":function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return l}));var a=n("G4qV"),r=n("F07D"),c=n("e/I0"),s=n("tbNj"),i=n("0MVo"),o=n("TQJ8");const u=Object(a.a)([r.b,c.a,s.a],(e,t,n)=>{const a=[];return n.forEach(n=>{n instanceof o.a&&n.Siloses.forEach((r,c)=>{if(r.Active){const r={device:n,placements:n.getPlacementArray(c).map(e=>t.get(e)).filter(e=>!!e)};r.id="".concat(n.DevID,"_").concat(c),r.index=c,r.name=n.getAddressString(),e&&n.Alias&&(r.name=n.Alias),r.placements.length&&(r.name=r.placements.map(e=>e.name.slice(0).pop()).join(", ")),a.push(r)}})}),a.sort((e,t)=>Object(i.b)(e.name,t.name))}),l=Object(a.a)([u,r.a],(e,t)=>e.filter(e=>e.device instanceof o.a&&!!t[e.id]))},"3e2P":function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i}));var a=n("G4qV"),r=n("uUZO");const c=e=>e.animalDocuments.selectedItem,s=(e,t)=>(e=>e.animalDocuments.events)(e).filter(e=>e.EvCode===t),i=Object(a.a)([e=>e.animalDocuments.cycleTable],e=>Object(r.a)(e))},"84Ez":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var a=n("mwIZ"),r=n.n(a),c=n("G4qV"),s=n("s506");const i=Object(c.a)([e=>e.user,e=>e.location.farm],(e,t)=>{const n=e=>"".concat(e,"Basic"),a=e=>"".concat(e,"Ext"),c=[[s.a.ADMINISTRATION,"adm"],[s.a.ALARM,"al"],[s.a.CAGE,"cg"],[s.a.CHAIN,"ch"],[s.a.CLIMATE,"cl"],[s.a.COUNTER,"cnt"],[s.a.DISPENSER_5G,"di5G"],[s.a.DISPENSER,"di"],[s.a.PORKER,"pork"],[s.a.SMALL_CAGE,"sc"],[s.a.SILO,"sl"],[s.a.SOW,"sow"]],i={};let o=r()(e,"user.Roles",[]).find(e=>e.Role===s.c._SERVICE);for(let[u,l]of c)i[u]=s.b.NO_ACCESS,o?i[u]=s.b.EXTENDED:r()(e,"user.Packages[".concat(t,"].").concat(n(l)))&&(i[u]=s.b.BASIC,r()(e,"user.Packages[".concat(t,"].").concat(a(l)))&&(i[u]=s.b.EXTENDED));return i}),o=Object(c.a)([i,(e,t)=>t.licenseName],(e,t)=>e[t]||s.b.NO_ACCESS)},"9GTB":function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return D}));var a=n("E+oP"),r=n.n(a),c=n("mwIZ"),s=n.n(c),i=n("G4qV"),o=n("Ke8t"),u=n("BvFm");const l=e=>e.farms.farms,d=(e,t)=>e.farms.farms.find(e=>e.FarmID===t),m=e=>d(e,e.location.farm),f=Object(i.a)([e=>e.user.user,l],(e,t)=>{if(Object(u.i)())return t.filter(t=>t.ClientID===e.ClientID);{const n=s()(e,"Roles",[]).find(e=>e.Role===o.USER_MANAGE).LocalRights;return r()(n)?[]:t.filter(t=>n.find(n=>n.FarmID===t.FarmID&&n.ClientID===e.ClientID))}}),D=Object(i.a)([l,(e,{selectedUser:t})=>t],(e,t={})=>{const n=s()(t,"roles",[]).find(e=>e.Role===o.GENERAL_READ);return r()(n)?[]:e.filter(e=>s()(n,"LocalRights",[]).find(t=>t.FarmID===e.FarmID))})},ANfW:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return i}));var a=n("mwIZ"),r=n.n(a),c=n("G4qV");const s=Object(c.a)([e=>e.braintree.subscriptionList,e=>e.user.user.FarmData,(e,{farmID:t})=>t],(e,t,n="")=>{const a=t.find(e=>e.FarmID===n);return{subscription:e.find(e=>e.id===a.SubID),addOns:{AdministrationModule:r()(a,"AdministrationModule",{}),BreedingModule:r()(a,"BreedingModule",{}),DevicesModule:r()(a,"DevicesModule",{})}}}),i=Object(c.a)([(e,{selectedFarm:t})=>t],(e={})=>{const{BreedingModule:t,DevicesModule:n,AdministrationModule:a}=e;if(t&&t.sows&&t.porkers&&n&&a)return{addOns:{BreedingModule:t,DevicesModule:n,AdministrationModule:a}}})},F07D:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return m}));var a=n("mwIZ"),r=n.n(a),c=n("G4qV");const s={},i=(e,{id:t})=>t,o=(e,{type:t})=>e.mainTab.selected[t]||s,u=(e,{type:t})=>e.mainTab.expanded[t]||s,l=()=>Object(c.a)([i,o],(e,t)=>!!t[e]),d=()=>Object(c.a)([i,u],(e,t)=>!!t[e]),m=e=>!!r()(e,"general.SetData.Settings.Devices.ShowAliases",!1)},F7k6:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));const a=(e,t)=>e.dictionary.graftingPrograms.find(e=>e.WData.AnimalKind===t)||null},FZxm:function(e,t,n){"use strict";n.d(t,"a",(function(){return I})),n.d(t,"c",(function(){return S})),n.d(t,"b",(function(){return b}));var a=n("lFKM"),r=n.n(a),c=n("J2iB"),s=n.n(c),i=n("Z0cm"),o=n.n(i),u=n("G4qV"),l=n("wd/R"),d=n.n(l);const m=Object(u.a)([(e,t)=>e.farms.buildings],e=>{const t=new Map;return e.forEach(e=>{t.set(e.BgID,[e.BName]),(e.Sectors||[]).forEach(n=>{t.set(n.SID,[e.BName,n.SName]),(n.Chambers||[]).forEach(a=>{t.set(a.CID,[e.BName,n.SName,a.CName]),(a.Boxes||[]).forEach(r=>{t.set(r.BID,[e.BName,n.SName,a.CName,r.BoxesName])})})})}),t}),f=Object(u.a)([(e,t)=>e.farmDevices.devices],e=>{const t=new Map;return e.forEach(e=>{t.set(e.DevID,e)}),t}),D=(e,t)=>e.iotAlarms.alarms,I=Object(u.a)([D,f,m],(e,t,n)=>{const a=e.slice(0);a.sort((e,t)=>t.newest.time-e.newest.time);const c=e=>n.get(e)||[],i=(e,t=null)=>{if(!e)return[];return(o()(e.PlcmntID)?e.PlcmntID:[{PlcmntID:e.PlcmntID}]).filter(e=>s()(t)||r()(e.Adr)&&(o()(t)?t.includes(e.Adr):t===e.Adr)).map(e=>c(e.PlcmntID))},u=(e={})=>{const t=e.alarm.alert,n=e.alarm.info||{},a="notificationsCenter.errorCodes.".concat(t);let r={};switch(t){case 5108:case 5001:r.number=n.RFID||"-",r.location=c(n.Plcmnt).join(" - ")||"?",r.time=(s=n.LastSeenTime)?d()(s).format("DD.MM.YY HH:mm"):"-";break;case 5002:r.number=n.RFID||"-",r.expectedLoc=c(n.expectedLocation).join(" - ")||"?",r.currentLoc=c(n.currentLocation).join(" - ")||"?";break;case 5101:case 5102:case 5103:case 5104:case 5202:case 5204:r.number=n.number||"-";break;case 5107:r.animal=n.RFID||"-",r.loc=c(n.PlcmntID).join(" - ")||"?";break;case 1430:r.time=(e=>e?d()(e).format("HH:mm"):"-")(n.Time);break;case 5109:r.location=c(n.PlcmntID).join(" - ")||"?"}var s;return{key:a,params:r}};return a.map(e=>{const n=t.get(e.DevID),a=i(n,e.Index);return{title:n?n.Name:"?",timestamp:e.newest.time,text:u(e.newest),subtitle:a,_passThrough:{other:e.alarms.map(t=>((e,t,n)=>{const a=i(t,n);return{title:t?t.Name:"?",timestamp:e.time,text:u(e),subtitle:a}})(t,n,e.Index)),raw:e},_id:e._id}})}),S=Object(u.a)([(e,t)=>e.iotAlarms.fetching||{}],e=>0!==Object.values(e).reduce((e,t)=>+e+ +t,0)),b=Object(u.a)([(e,t)=>e.iotAlarms.fetched||{}],e=>!!Object.values(e).length&&Object.values(e).length===Object.values(e).reduce((e,t)=>+e+ +t,0))},Imit:function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return i}));const a=e=>e.task.tasks,r=e=>e.task.filters,c=e=>e.task.loading,s=e=>e.task.date,i=e=>e.task.selectedTask},Qoyn:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return l}));var a=n("J2iB"),r=n.n(a),c=n("mwIZ"),s=n.n(c),i=n("G4qV"),o=n("dmgJ");const u=Object(i.a)([(e,t)=>e.settings.farmMap,(e,t)=>e.location.farm],(e,t)=>{const n=e.get(t),a=[];return Object.entries(s()(n,"SetData.Levels")||{}).forEach(([e,t])=>{const n=Object(o.a)(t);r()(n)||a.push({name:e,value:n})}),a.sort((e,t)=>e.name-t.name)}),l=Object(i.a)([u,(e,{selectedLevel:t})=>t],(e,t)=>(console.log("_selectedLevel",t,e),e.find(e=>"".concat(e.name)==="".concat(t))||null))},UZWR:function(e,t,n){"use strict";n.d(t,"a",(function(){return D})),n.d(t,"e",(function(){return S})),n.d(t,"c",(function(){return b})),n.d(t,"d",(function(){return E})),n.d(t,"b",(function(){return g}));var a=n("qPyV"),r=n.n(a),c=n("FyPc"),s=n.n(c),i=n("mwIZ"),o=n.n(i),u=n("lFKM"),l=n.n(u),d=n("G4qV"),m=n("q17X"),f=n("NnE9");const D={NO_SHOW:0,SHOW_SEPARATION:1,SHOW_SETTLEMENT:2},I=(e,{CID:t})=>t?(Object(m.isUsingFakeData)()?Object(f.a)(e):e.settlement.settlement).slice(0).filter(e=>e.PlcmntID===t):[],S=(e,t=!0)=>t?!l()(o()(e,"DtaStartTime"))||l()(o()(e,"DtaEndTime"))&&o()(e,"DtaEndTime")<(new Date).getTime()?D.SHOW_SETTLEMENT:D.SHOW_SEPARATION:D.NO_SHOW,b=Object(d.a)([I,e=>!!Object(m.isUsingFakeData)()||e.settlement.fetchedSettlement,e=>!Object(m.isUsingFakeData)()&&e.settlement.fetchingSettlement],(e,t,n)=>{const a=s()(e.slice(0),e=>e.DtaStartTime);return{fetched:t,fetching:n,data:a,state:S(a,t)}}),E=Object(d.a)([I],e=>{const t=e.slice(0);return t.sort((e,t)=>e.DtaStartTime-t.DtaStartTime),t}),g=Object(d.a)([e=>Object(m.isUsingFakeData)()?Object(f.a)(e):e.settlement.settlement],e=>{const t=e.slice(0);return t.sort((e,t)=>t.DtaStartTime-e.DtaStartTime),r()(t,e=>e.PlcmntID)})},WV92:function(e,t,n){"use strict";n.d(t,"a",(function(){return g})),n.d(t,"c",(function(){return v}));var a=n("JZM8"),r=n.n(a),c=n("J2iB"),s=n.n(c),i=n("Z0cm"),o=n.n(i),u=n("mwIZ"),l=n.n(u),d=n("G4qV"),m=n("tkTQ"),f=n("wd/R"),D=n.n(f),I=n("0MVo");function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;te.inventory.inventorySort,A=e=>e.inventory.locationFilter,N=(e,t)=>e.inventory.inventoryFilter,C=(e,t)=>e.inventory.animals,p=(e,t)=>e.inventory.animalTypeMap,_=(e,t)=>e.inventory.showDead,T=Object(d.a)([(e,t)=>e.farms.buildings,e=>e.farms.farms],(e=[],t=[])=>{const n=new Map;return t.forEach(e=>{n.set(e.FarmID,{name:e.FarmName,ids:[e.FarmID]})}),e.forEach(e=>{const a={name:e.BName,ids:[e.BgID]};l()(e,"Sectors",[]).forEach(t=>{a.ids=[...new Set([...a.ids,t.SID])];const r={name:"".concat(e.BName," - ").concat(t.SName),ids:[t.SID]};l()(t,"Chambers",[]).forEach(c=>{a.ids=[...new Set([...a.ids,c.CID])],r.ids=[...new Set([...r.ids,c.CID])];const s={name:"".concat(e.BName," - ").concat(t.SName," - ").concat(c.CName),ids:[c.CID]};l()(c,"Boxes",[]).forEach(i=>{a.ids=[...new Set([...a.ids,i.BID])],r.ids=[...new Set([...r.ids,i.BID])],s.ids=[...new Set([...s.ids,i.BID])],n.set(i.BID,{name:"".concat(e.BName," - ").concat(t.SName," - ").concat(c.CName," - ").concat(i.BoxesName),ids:[i.BID]})}),n.set(c.CID,s)}),n.set(t.SID,r)}),n.set(e.BgID,a);const r=n.get(e.FarmID)||{name:l()(t.find(t=>t.FarmID===e.FarmID),"FarmName","?"),ids:[e.FarmID]};r.ids=[...new Set([...r.ids,...a.ids])],n.set(e.FarmID,r)}),n}),h=Object(d.a)([e=>e.inventory.technoGroups,(e,t)=>e.inventory.groups,C,O,N,A,_,p,T],(e,t,n,a,c,s,i,u=new Map,d=new Map)=>{console.log(e,t,n,a,c,s,i,u,d);let m=[];for(let f of n){const e={animal:f,name:f.AnmNo1||"-",id:f.AnmID,animalCount:Math.max(isFinite(+l()(f,"AnmCnt",0))?+l()(f,"AnmCnt",0):1,1),typeName:u.get(f.AnimalKind)||"-",location:o()(f.PlcmntID)?f.PlcmntID.map(e=>e.PlcmntID):[f.PlcmntID]};e.search=JSON.stringify(r()(e,["name","animal.RFID","typeName"])),e.locationName=e.location.map(e=>l()(d.get(e),"name","?")).join(", ")||"-",m.push(e)}return[...e,...t].forEach(e=>{const t=[],n=!!e.TGID;e[n?"AnmList":"AnmIDs"].forEach(n=>{let a=m.findIndex(e=>!e.isGroup&&e.id===n);~a&&!l()(e,"Rmvd",[]).includes(n)&&(t.push(m[a]),m.splice(a,1))});const a={group:e,isGroup:!0,isTechnoGroup:n,name:(n?D()(e.StartTime).format("DD.MM.YY"):e.GrNo1)||"-",id:n?e.TGID:e.AnmGrp,typeName:u.get(n?"techno":"group"),animals:t,__StartTime:e.StartTime};m.push(a)}),m}),j=Object(d.a)([h,e=>e.inventory.showCollapsed,O,N,A,_,p,T],(e,t,n,a,c,i,o=new Map,u=new Map)=>{const d=[];console.log(t,i,"KDKDKDKD");let m=()=>0;const f=e=>e.isTechnoGroup?3:e.isGroup?1:0,D=(e,t,n=!0)=>{const a=n?e:t,r=n?t:e,c=f(a)-f(r);return c||(a.isTechnoGroup&&r.isTechnoGroup?a.__StartTime-r.__StartTime:0)};switch(n){case g.BY_ANIMAL_NUMBER_DESC:case g.BY_ANIMAL_NUMBER_ASC:m=(e,t)=>D(e,t,n.endsWith("_ASC"))||Object(I.b)(l()(e,"name"),l()(t,"name"),{numeric:!0,ascending:n.endsWith("_ASC")});break;case g.BY_ANIMAL_TYPE_DESC:case g.BY_ANIMAL_TYPE_ASC:m=(e,t)=>D(e,t)||Object(I.b)(l()(e,"typeName"),l()(t,"typeName"),{numeric:!0,ascending:n.endsWith("_ASC")});break;case g.BY_LOCATION_DESC:case g.BY_LOCATION_ASC:m=(e,t)=>D(e,t)||Object(I.b)(l()(e,"locationName"),l()(t,"locationName"),{numeric:!0,ascending:n.endsWith("_ASC")})}let S=!1,E=!1;const O=(a||[]).filter(e=>{let t=!0;return e.length>3&&(o.get("group").includes(e)&&(S=!0,t=!1),o.get("techno").includes(e)&&(E=!0,S=o.get("group").includes(e),t=!1)),t});let A=S||E;const N=e=>{let t=!0;if(O&&e.isGroup||!A)for(let n of O)if(!e.search.toLowerCase().includes(n.toLowerCase())){t=!1;break}return c&&!e.location.filter(e=>l()(u.get(c),"ids",[c]).includes(e)).length&&(t=!1),t?e:null};for(let I of e){let e=b({},I);if(I.isGroup){let n=[];const a=[],c=[];t||I.animals.forEach(e=>{(i||s()(e.animal.DtaDthTime))&&N(e)&&(c.push(e),a.push(e.search),n=[...new Set([...n,...e.location])])}),e.search=JSON.stringify(a),e.search=JSON.stringify(r()(e,A?["name","typeName"]:["name","search","typeName"])),e.animals=c.sort(m),e.location=n,e.locationName=e.location.map(e=>l()(u.get(e),"name","?")).join(", ")||"-",e=N(e),(!A||I.isGroup&&S||I.isTechnoGroup&&E)&&e&&d.push(e)}else A||!i&&!s()(e.animal.DtaDthTime)||(e=N(e),e&&d.push(e))}return d.sort(m).slice(0)}),v=Object(d.a)([C,j],(e,t)=>{const n={};Object.values(m.a).forEach(e=>{n[e]={selected:0,total:0}});const a=(e,t)=>{if("selected"===t||!e.DtaDthTime){const a=Math.max(isFinite(+l()(e,"AnmCnt",0))?+l()(e,"AnmCnt",0):1,1);n[e.AnimalKind]&&(n[e.AnimalKind][t]+=a)}};return e.forEach(e=>{e.DtaDthTime||a(e,"total")}),t.forEach(e=>{e.isGroup?e.animals.forEach(e=>{a(e,"selected")}):a(e.animal,"selected")}),n});t.b=j},"Z7e/":function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var a=n("G4qV"),r=n("uVg0");const c=e=>e.notificationCenter.notifications,s=e=>e.notificationCenter.readTime,i=Object(a.a)([c,s],(e,t)=>{const n=[r.a.ALERT,r.a.WARN,r.a.INFO],a=["alarm","warn","info"];let c=4;for(let r of e)if(r.DtaCrtTime>=t){const e=n.findIndex(e=>e===r.NData.Status);if(-1!==e&&ee.filter(e=>e.DtaCrtTime>=t).length)},"e/I0":function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return d}));var a=n("mwIZ"),r=n.n(a),c=n("I8zd"),s=n("G4qV");const i=(e,{id:t,level:n}={})=>({id:t,level:n}),o=(e,{PlcmntID:t})=>t,u=Object(s.a)([e=>e.farms.buildings,e=>e.farms.farms],(e,t)=>{const n=new Map;return console.log("getBuildingsMap selector called"),t.forEach(e=>{n.set(e.FarmID,{level:c.a.FARM,parentId:e.FarmID,name:[e.FarmName],id:e.FarmID})}),e.forEach(e=>{n.set(e.BgID,{level:c.a.BUILDING,parentId:e.FarmID,name:[e.BName],id:e.BgID}),r()(e,"Sectors",[]).forEach(t=>{n.set(t.SID,{level:c.a.SECTOR,parentId:e.BgID,name:[e.BName,t.SName],id:t.SID,SType:t.SType}),r()(t,"Chambers",[]).forEach(a=>{n.set(a.CID,{level:c.a.CHAMBER,parentId:t.SID,name:[e.BName,t.SName,a.CName],id:a.CID,SType:t.SType}),r()(a,"Boxes",[]).forEach(r=>{n.set(r.BID,{level:c.a.BOX,parentId:a.CID,name:[e.BName,t.SName,a.CName,r.BoxesName],id:r.BID,SType:t.SType})})})})}),n}),l=()=>Object(s.a)([u,i],(e,t)=>{if(!t.id||!t.level)return null;const{id:n,level:a}=t,r=t=>{const n=e.get(t);return n?n.level===a?n:t===n.parentId?null:r(n.parentId):null};return r(n)}),d=()=>Object(s.a)([u,o],(e,t)=>e.get(t)||null)},e8oE:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n("VfnB"),r=n("G4qV");const c=[],s=(e,{DevID:t,index:n=null})=>e.aggregatedData.data.get(Object(a.b)({DevID:t,index:n}))||c,i=(e,{DevID:t,index:n=null})=>e.aggregatedData.fetchingMap.get(Object(a.b)({DevID:t,index:n})),o=()=>Object(r.a)([s,i],(e,t)=>({data:e,fetching:!!t}))},"eWv+":function(e,t,n){"use strict";n.d(t,"a",(function(){return U})),n.d(t,"d",(function(){return V})),n.d(t,"b",(function(){return k})),n.d(t,"c",(function(){return W}));var a=n("GoyQ"),r=n.n(a),c=n("Z0cm"),s=n.n(c),i=n("mwIZ"),o=n.n(i),u=n("G4qV"),l=n("i8MS"),d=n("WmuQ"),m=n("wd/R"),f=n.n(m),D=n("1j/Y"),I=n("ba6h"),S=n("zDJl"),b=n("nqY3"),E=n("XzT5"),g=n("JFfd"),O=n("3Srn"),A=n("PRyg");function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function C(e){for(var t=1;te.farms.buildings,T=e=>e.logs.search,h=e=>e.logs.startFrom,j=e=>e.logs.objectId,v=Object(u.a)([e=>e.animals.time,e=>e.location.farm],(e,t)=>{const n={};return l.a.getAllAnimals(t,void 0,!0,!1).forEach(e=>{n[e.AnmID]=e.AnmNo1}),n}),B=Object(u.a)([e=>e.settings.settings],e=>{const t={};return e.forEach(e=>{t[e.SetID]=o()(e,"SetData.Name",e.SetID)}),t.General=E.a.t("newSettings.users.changeRolesView.general"),t}),M=Object(u.a)([_,e=>e.farms.farms],(e,t)=>{const n={};return t.forEach(e=>{n[e.FarmID]=e.FarmName}),e.forEach(e=>{n[e.BgID]=e.BName,o()(e,"Sectors",[]).forEach(e=>{n[e.SID]=e.SName,o()(e,"Chambers",[]).forEach(e=>{n[e.CID]=e.CName,o()(e,"Boxes",[]).forEach(t=>{n[t.BID]="".concat(e.CName," - ").concat(t.BoxesName)})})})}),n}),R=Object(u.a)([_],e=>{const t={};return e.forEach(e=>{t[e.BgID]=e.BName}),t}),y=Object(u.a)([e=>e.farmDevices.devices],e=>{const t={};return e.forEach(e=>{if(t[e.DevID]=e.Name,[S.d.SCALE,S.d.DISPENSER].includes(e.DevType))for(let n=0;n<20;n++)t["".concat(e.DevID,"_").concat(n)]="".concat(e.Name," {").concat(n,"}")}),t}),w=Object(u.a)([e=>e.groups.groups],e=>{const t={AnmID:{},GrID:{}};return e.sort((e,t)=>e.DtaModTime-t.DtaModTime),e.forEach(e=>{t.GrID[e.GrID]=e.GrNo1,e.AnmIDs.forEach(n=>{t.AnmID[n]||(t.AnmID[n]=e.GrNo1)})}),t}),G=Object(u.a)([e=>e.user.allUsers],e=>{const t={};return e.forEach(e=>{t[e.LocalUserID]=e.Name}),t}),L=e=>e.logs.userId,P=Object(u.a)([T,e=>e.logs.searchCode||[]],(e,t)=>{const n={codes:[],selectedCodes:[]},a=e.trim().toLowerCase(),r=E.a.t(["logsView.shortNames","{}"],{returnObjects:!0});if(console.log(r,"codes"),t.forEach(e=>{n.selectedCodes.push({type:"codes",value:+"".concat(e).split("_")[0],name:"".concat(r[e])})}),a){for(let[e,t]of Object.entries(r))"".concat(t).toLowerCase().includes(a)&&n.codes.push({type:"codes",value:+"".concat(e).split("_")[0],name:"".concat(t)});console.log(Object.entries(r),"cdParams")}return n}),F=Object(u.a)([T,L,G],(e,t,n)=>{const a={users:[],selectedUser:null},r=e.trim().toLowerCase();if(t&&n[t]&&(a.selectedUser={type:"user",value:t,name:n[t]}),r)for(let[c,s]of Object.entries(n))"".concat(s).toLowerCase().includes(r)&&a.users.push({type:"user",value:c,name:s});return console.log("KDKDKDxD",n,a),a.users.sort((e,t)=>Object(D.compareTwoStrings)(t.name,r)-Object(D.compareTwoStrings)(e.name,r)),a}),Y=Object(u.a)([T,h],(e,t)=>{const n=e.trim().toLowerCase(),a={selectedDate:null,dates:[]};if(n){const e=["DD.MM.YY","DD.MM","DD"];for(let t of e){const e=f.a.utc(n,t).endOf("day");if(e.isValid()){a.dates.push({type:"date",name:e.format("DD.MM.YY"),value:+e});break}}}if(t){const e=f.a.utc(t).endOf("day");a.selectedDate={type:"date",name:e.format("DD.MM.YY"),value:+e}}return a}),U=Object(u.a)([e=>e.dictionary,e=>e.language.lang.lang],(e,t)=>{const n={};return n.NAMES={MEDICINE:{},CONTROLLIST:{},DICTIONARY:{},INGREDIENT:{},GRAFTINGPROGRAM:{}},Object.values(I.a).forEach(a=>{n[a]={};const c=["medicine","controlLists","forageIngredients","graftingPrograms"][[I.a.medicine,I.a.controlLists,I.a.forageIngredient,I.a.graftingProgram].findIndex(e=>e===a)]||"someNonExistingKey";switch(c){case"graftingPrograms":o()(e,c,[]).forEach(e=>{n[a][e.WordID]=e.WData.Name,n.NAMES.GRAFTINGPROGRAM[e.WordID]=e.WData.Name});break;case"forageIngredients":o()(e,c,[]).forEach(e=>{n[a][e.WordID]=e.WData.Name,n.NAMES.INGREDIENT[e.WordID]=e.WData.Name});break;case"medicine":o()(e,c,[]).forEach(e=>{n[a][e.WordID]=e.WData.Name,n.NAMES.MEDICINE[e.WordID]=e.WData.Name});break;case"controlLists":Object.values(g.a).forEach(e=>{const t=Object(O.q)(e);n[a][e]=t,n.NAMES.CONTROLLIST[e]=t});break;default:for(let c of Object.values(e))if(r()(c)&&!s()(a)&&c.Type===a){o()(c,"WData[".concat(t,"]"),o()(c,"WData[".concat("en","]"),[])).forEach(e=>{n[a][e.ID]=e.Value});const e=Object(A.getTranslationPath)(c.Type);e&&(n.NAMES.DICTIONARY[c.WordID]=E.a.t(e))}}}),n}),x=Object(u.a)([T,j,y,v,U,B,R],(e,t,n,a,r,c,s)=>{const i={selectedObject:null,objects:[]},o=[d.a.DEVICES,d.a.ANIMALS,d.a.DICTIONARY,"Medicine","ControlList","Ingredient","GraftingProgram",d.a.SETTINGS,d.a.BUILDINGS],u=e.trim().toLowerCase();return console.log(r.NAMES,"NAMESSS"),[n,a,r.NAMES.DICTIONARY,r.NAMES.MEDICINE,r.NAMES.CONTROLLIST,r.NAMES.INGREDIENT,r.NAMES.GRAFTINGPROGRAM,c,s].forEach((e,n)=>{console.log("debug bob",e),Object.entries(e).forEach(([e,a=""])=>{e===t&&(i.selectedObject={type:o[n],name:a,value:e}),u&&"".concat(a).toLowerCase().includes(u)&&i.objects.push({type:o[n],name:a,value:e})})}),i.objects.sort((e,t)=>Object(D.compareTwoStrings)(t.name,u)-Object(D.compareTwoStrings)(e.name,u)),i}),V=Object(u.a)([x,F,Y,P],(e,t,n,a)=>C({},e,{},t,{},n,{},a)),k=Object(u.a)([U,y,M,v,G,w,B,R],(e,t,n,a,r,c,s,i)=>({devices:t,placements:n,buildings:i,animals:a,employees:r,dictionaries:e,groups:c,settings:s})),W=Object(u.a)([e=>e.logs.logs,L,j,h,T,k],(e,t,n,a,r,c)=>e.filter(e=>(e=>!n||e.ObjID===n)(e)&&(e=>!a||e.DtaCrtTime<=a)(e)&&(e=>!t||e.UserID===t)(e)).map(e=>C({log:e},b.a.createLogParser(e,c).getData())))},"mr+a":function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"j",(function(){return b})),n.d(t,"i",(function(){return E})),n.d(t,"k",(function(){return O})),n.d(t,"b",(function(){return A})),n.d(t,"h",(function(){return N})),n.d(t,"g",(function(){return C})),n.d(t,"e",(function(){return p})),n.d(t,"c",(function(){return T})),n.d(t,"f",(function(){return h})),n.d(t,"d",(function(){return j})),n.d(t,"m",(function(){return v})),n.d(t,"l",(function(){return B}));var a=n("JZM8"),r=n.n(a),c=n("J2iB"),s=n.n(c),i=n("mwIZ"),o=n.n(i),u=n("G4qV"),l=n("0MVo"),d=n("6/k7"),m=n("15cA"),f=n("84Ez"),D=n("s506"),I=n("0gjr");const S={BY_ANIMAL_NUMBER_ASC:"SORT_BY_ANIMAL_NUMBER_ASC",BY_ANIMAL_NUMBER_DESC:"SORT_BY_ANIMAL_NUMBER_DESC",BY_USAGE_ASC:"SORT_BY_USAGE_ASC",BY_USAGE_DESC:"SORT_BY_USAGE_DESC",BY_ACTIVITY_ASC:"SORT_BY_ACTIVITY_ASC",BY_ACTIVITY_DESC:"SORT_BY_ACTIVITY_DESC",BY_DEFAULT_ASC:"SORT_BY_DEFAULT_ASC",BY_DEFAULT_DESC:"SORT_BY_DEFAULT_DESC",BY_PERCENTAGE_ASC:"SORT_BY_PERCENTAGE_ASC",BY_PERCENTAGE_DESC:"SORT_BY_PERCENTAGE_DESC"},b=(e,{CID:t})=>t&&e.feeding.feeding[t]?e.feeding.feeding[t].feedingSort:S.BY_NAME_ASC,E=(e,{CID:t})=>t&&e.feeding.feeding[t]?e.feeding.feeding[t].feedingFilter:"",g=(e,{CID:t})=>t&&e.feeding.feeding[t]?Object.values(e.feeding.feeding[t].data):[],O=(e={})=>!!e.feed&&!!e.selected,A=Object(u.a)([g,(e,{chamber:t})=>t],(e,t={})=>{const{IndividualFeeding:n,StandsInRow:a,StandsOrder:r}=t;if(console.log(e,t,"DKDSOAKSODAS"),n){const t=(e,t,n=!0)=>Object(l.b)(o()(n?e:t,"name"),o()(n?t:e,"name"),{numeric:!0});let n=e;const c=!(r>>1&1),s=!!(r>>2&1),i=!!(1&r);console.log(c,s,i,"sorting options"),n.sort((e,n)=>t(e,n,c));let u=0;const d=[];for(;ut(e,n,s&&d.length%2===1?!i:i)),d.push(c)}return d}return[]}),N=Object(u.a)([b,g,E],(e,t,n)=>{let a;switch(e){case S.BY_ANIMAL_NUMBER_DESC:case S.BY_ANIMAL_NUMBER_ASC:a=(t,n)=>Object(l.b)(o()(t,"animal.AnmNo1"),o()(n,"animal.AnmNo1"),{numeric:!0,ascending:e.endsWith("_ASC")});break;case S.BY_USAGE_DESC:case S.BY_USAGE_ASC:a=(t,n)=>Object(l.b)(o()(t,"feed.usage"),o()(n,"feed.usage"),{numeric:!0,ascending:e.endsWith("_ASC")});break;case S.BY_ACTIVITY_DESC:case S.BY_ACTIVITY_ASC:a=(t,n)=>Object(l.b)(o()(t,"lastSeen.time"),o()(n,"lastSeen.time"),{numeric:!0,ascending:!e.endsWith("_ASC")});break;case S.BY_DEFAULT_DESC:case S.BY_DEFAULT_ASC:a=(t,n)=>Object(l.b)(o()(t,"name"),o()(n,"name"),{numeric:!0,ascending:e.endsWith("_ASC")});break;case S.BY_PERCENTAGE_DESC:case S.BY_PERCENTAGE_ASC:a=(t,n)=>Object(l.b)(s()(o()(t,"feed.usage"))?null:o()(t,"feed.usage",0)/(o()(t,"feed.plannedUsage",0)||3e3),s()(o()(n,"feed.usage"))?null:o()(n,"feed.usage",0)/(o()(n,"feed.plannedUsage",0)||3e3),{numeric:!0,ascending:e.endsWith("_ASC")});break;default:a=(e,t)=>0}return(n?t.slice(0).filter(e=>{return JSON.stringify((t=e,r()(t,["animal.AnmNo1","box.BoxesName","animal.RFID"]))).toLowerCase().includes(n.toLowerCase());var t}):t.slice(0)).sort(a)}),C=Object(u.a)([g],e=>e.slice(0).filter(e=>O(e))),p=Object(u.a)([(e,{CID:t})=>t&&e.feeding.feeding[t]?Object.values(e.feeding.feeding[t].devices):[]],e=>e.sort((e,t)=>e.device.Address-t.device.Address)),_=e=>e.settings&&e.settings.general?e.settings.general:{},T=Object(u.a)([e=>e.settings.feedingCurves,f.b],(e,t)=>{switch(t[D.a.DISPENSER]){case D.b.EXTENDED:return e.filter(e=>e.SetData.Index=0);case D.b.BASIC:return e.filter(e=>e.SetData.Index=0);case D.b.NO_ACCESS:default:return[]}}),h=Object(u.a)([e=>e.settings.feedingSchedules,f.b],(e,t)=>{switch(t[D.a.DISPENSER]){case D.b.EXTENDED:return e.filter(e=>e.SetData.Index=0);case D.b.BASIC:return e.filter(e=>e.SetData.Index=0);case D.b.NO_ACCESS:default:return[]}}),j=Object(u.a)([e=>e.settings.forage,f.b],(e,t)=>{switch(t[D.a.DISPENSER]){case D.b.EXTENDED:return e.filter(e=>e.SetData.Index=0);case D.b.BASIC:return e.filter(e=>e.SetData.Index=0);case D.b.NO_ACCESS:default:return[]}}),v=Object(u.a)([T,_],(e,t)=>{const{DefaultParturitionCurveDay:n=1,DefaultParturitionCurveNumber:a=0}=o()(t,"SetData.Settings.Feeding.WST",{}),{DefaultParturitionCurveDay:r=1,DefaultParturitionCurveNumber:c=0}=o()(t,"SetData.Settings.Feeding.NRF",{}),s=e.find(e=>[d.b.PARTURITION,d.b.INDIVIDUAL].includes(e.SetData.Type)&&e.SetData.Index===a-1&&Object(m.f)(e)!==d.a.BOTH),i=Math.min(o()(s,"SetData.Days.lenth",1),n),u=e.find(e=>[d.b.PARTURITION,d.b.INDIVIDUAL].includes(e.SetData.Type)&&e.SetData.Index===c-1);return{WST:{curve:s,day:i},NRF:{curve:u,day:u?Math.min(Object(m.f)(u)===d.a.BOTH?o()(u,"SetData.InseminationJumpTo",1):r,o()(u,"SetData.Days.length",1)):1}}}),B=Object(u.a)([T,_],(e,t)=>{const{DefaultInseminationCurveDay:n=1,DefaultInseminationCurveNumber:a=0}=o()(t,"SetData.Settings.Feeding.WST",{}),{DefaultInseminationCurveDay:r=1,DefaultInseminationCurveNumber:c=0}=o()(t,"SetData.Settings.Feeding.NRF",{}),s=e.find(e=>[d.b.MATING,d.b.INDIVIDUAL].includes(e.SetData.Type)&&e.SetData.Index===a-1&&Object(m.f)(e)!==d.a.BOTH),i=Math.min(o()(s,"SetData.Days.lenth",1),n),u=e.find(e=>[d.b.MATING,d.b.INDIVIDUAL].includes(e.SetData.Type)&&e.SetData.Index===c-1);return{WST:{curve:s,day:i},NRF:{curve:u,day:u?Math.min(Object(m.f)(u)===d.a.BOTH?o()(u,"SetData.InseminationJumpTo",1):r,o()(u,"SetData.Days.length",1)):1}}})},re1K:function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return m})),n.d(t,"a",(function(){return f}));var a=n("G4qV"),r=n("e/I0"),c=n("tbNj"),s=n("n2uv"),i=n("R7+t"),o=n("0MVo"),u=n("F07D"),l=n("KRta");const d=Object(a.a)([u.b,r.a,c.a],(e,t,n)=>{const a=[];return n.forEach(n=>{if(n instanceof s.a||n instanceof l.a||n instanceof i.a&&n.hasTemperatureSensor()&&!n.isIndividualTemperature()){const r={device:n,placements:n.getPlacementArray().map(e=>t.get(e)).filter(e=>!!e)};r.id=n.DevID,r.name=n.getAddressString(),e&&n.Alias&&(r.name=n.Alias),r.placements.length&&(r.name=r.placements.map(e=>e.name.slice(0).pop()).join(", ")),a.push(r)}}),a.sort((e,t)=>Object(o.b)(e.name,t.name))}),m=Object(a.a)([d,u.a],(e,t)=>e.filter(e=>(e.device instanceof s.a||e.device instanceof l.a)&&!!t[e.id])),f=Object(a.a)([e=>e.settings.climateCurvesSK3],e=>e)},ta7J:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return s}));var a=n("G4qV");const r=(e,t)=>e.language.translations.content[t];function c(e,t=""){let n=[];for(let a in e){let r=t?t+"."+a:a,s=e[a];if("string"===typeof s)n.push({value:s.toLowerCase(),path:r});else if(Array.isArray(s))for(let e=0;ec(e))},tbNj:function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"c",(function(){return O})),n.d(t,"b",(function(){return A})),n.d(t,"d",(function(){return N}));var a=n("44Ds"),r=n.n(a),c=n("4qC0"),s=n.n(c),i=n("J2iB"),o=n.n(i),u=n("E+oP"),l=n.n(u),d=n("Z0cm"),m=n.n(d),f=n("G4qV");const D=r()(e=>m()(e)?e:s()(e)?[{PlcmntID:e}]:[],(...e)=>JSON.stringify(e)),I=r()(e=>m()(e)?e:s()(e)?[e]:[],(...e)=>JSON.stringify(e)),S=(e,t)=>e.farmDevices.devices,b=(e,{DevType:t})=>I(t),E=(e,{DevID:t})=>t,g=(e,{PlcmntID:t})=>D(t),O=()=>Object(f.a)([S,b],(e,t)=>e.filter(e=>t.includes(e.DevType))),A=()=>Object(f.a)([S,E],(e,t)=>o()(t)?null:e.find(e=>e.DevID===t)||null),N=()=>Object(f.a)([S,g,b],(e,t,n)=>{const a=r()((e=[],t=[])=>{for(let n of e)for(let e of t)if(n.PlcmntID===e.PlcmntID)return!0;return!1},(...e)=>JSON.stringify(e));return e.filter(e=>{const r=D(e.PlcmntID);return(!!l()(n)||n.includes(e.DevType))&&a(r,t)})})},thTS:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n("G4qV");const r=(e,{DevID:t})=>e.shadows.shadows.get(t),c=(e,{DevID:t})=>(e.shadows.loading||{})[t],s=()=>Object(a.a)([r,c],(e,t)=>({fetched:!!e,fetching:!!t,shadow:e}))}}]); //# sourceMappingURL=main~12d3a508.2358b31e.chunk.js.map