(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[48],{"/71m":function(e,t,r){"use strict";var n=r("Y+p1"),a=r.n(n),s=r("mwIZ"),i=r.n(s),o=r("q1tI"),c=r.n(o),l=(r("6BD3"),r("/MKj")),p=r("CuyV"),m=r("v9qu"),h=r("Gr13"),u=r("zDJl"),d=r("Sa/u"),g=r("q17X"),f=r("17x9"),b=r.n(f);class y extends c.a.Component{componentDidMount(){this.props.subscriptions.length>1&&this.props.dispatch(Object(h.b)())}UNSAFE_componentWillReceiveProps(e,t){const{dispatch:r}=e;!a()(this.props.subscriptions,e.subscriptions)&&e.subscriptions.length>0&&r(Object(h.b)())}checkIfLoading(){const{status:e,mqttConnecting:t}=this.props;return!!t||!![...e.values()].filter(e=>e.send).length}getType(){const{mqttConnected:e,devices:t=[],status:r}=this.props;if(Object(g.isUsingFakeData)())return"success";let n=t.filter(e=>{let t=i()(r.get(e.DevID),"delay");return e.DevType===u.d.GATEWAY&&!t&&null!==t});return this.checkIfLoading()?"warning":e&&0===n.length?"success":"warning"}render(){let e=!Object(g.isUsingFakeData)()&&this.checkIfLoading();const{className:t}=this.props,r=["no-connection",this.getType(),t].filter(e=>!!e).join(" ");return c.a.createElement(p.a,{tooltipContent:c.a.createElement(d.a,null),placement:Object(m.a)()?"top":"bottom",type:this.getType()},c.a.createElement("div",{className:r},!e&&c.a.createElement("i",{className:"fas fa-cloud"}),e&&c.a.createElement("i",{className:"fas fa-circle-notch fa-spin"})))}}y.propTypes={className:b.a.string},y=Object(l.connect)(e=>({mqttConnecting:e.mqtt.connecting,mqttConnected:e.mqtt.connected,subscriptions:e.mqtt.subscriptions,status:e.mqtt.status,devices:e.farmDevices.devices,user:e.user.user}))(y),t.a=y},"/bWB":function(e,t,r){},"3Xe5":function(e,t,r){"use strict";r.d(t,"b",(function(){return l}));var n=r("q1tI"),a=r.n(n),s=r("17x9"),i=r.n(s),o=r("sZ7W"),c=r("LCzB");const l={CLOSED:0,MIDDLE:1,OPENED:2},p=1.1,m=1.2,h=2.1,u=2.2,d=3,g=4;class f extends a.a.Component{constructor(...e){super(...e),this.onClickDoor=e=>{if(0===this.props.workType){let t=1===this.props.valves[e-1].value?0:1;Object(o.v)(this.props.cage,e,t)}},this.getClassName=(e,t,r)=>{let n="cage-door";switch(r&&(n+=" error"),0===this.props.workType&&(n+=" manual"),e){case p:n+=" entrance-left";break;case m:n+=" entrance-right";break;case h:n+=" middle-left";break;case u:n+=" middle-right";break;case d:n+=" upper-left";break;case g:n+=" upper-right";break;default:n+=""}switch(t){case l.OPENED:n+=" open";break;case l.MIDDLE:n+=" middle";break;default:n+=""}return n},this.getGroupClassName=()=>{let e="group";return 0===this.props.workType&&(e+=" manual"),e}}render(){const{t:e}=this.props;return a.a.createElement("div",{className:"cage-view"},a.a.createElement("svg",{viewBox:"-30 0 220 420"},a.a.createElement("g",null,a.a.createElement("rect",{className:"cage-wall",ry:"4.0815053",y:"144.36679",x:"17.11323",height:"254.72357",width:"16.531525"}),a.a.createElement("rect",{className:"cage-wall",transform:"matrix(0.84535183,-0.53420997,0.63943038,0.768849,0,0)",ry:"3.7120354",y:"109.71523",x:"-84.410942",height:"35.440826",width:"16.114782"})),a.a.createElement("g",null,a.a.createElement("rect",{className:"cage-wall",width:"16.114782",height:"35.440826",x:"-208.48756",y:"23.5044",ry:"3.7120354",transform:"matrix(-0.84535183,-0.53420997,-0.63943038,0.768849,0,0)"}),a.a.createElement("rect",{className:"cage-wall",width:"16.531525",height:"254.72357",x:"126.22935",y:"144.36679",ry:"4.0815053"})),a.a.createElement("g",{onClick:()=>this.onClickDoor(1),className:this.getGroupClassName()},a.a.createElement("g",null,a.a.createElement("rect",{width:"8.4255161",height:"16.216231",x:"32.895828",y:"367.17856",ry:"2.7494175",rx:"0.15276258",className:"cage-door"}),a.a.createElement("rect",{style:{transformOrigin:"39.009052px 373.53601px"},width:"40",height:"9",x:"39.009052",y:"370.53601",ry:"2.8388526",className:this.getClassName(p,this.props.entrance,this.props.errors[0]||this.props.errors[1])})),a.a.createElement("g",null,a.a.createElement("rect",{rx:"0.15276258",ry:"2.7494175",y:"367.17856",x:"118.9913",height:"16.216231",width:"8.4255161",className:"cage-door"}),a.a.createElement("rect",{ry:"2.8388526",y:"370.53601",x:"80.87807",height:"9",width:"40",style:{transformOrigin:"120.87807px 373.53601px"},className:this.getClassName(m,this.props.entrance,this.props.errors[0]||this.props.errors[1])}))),a.a.createElement("g",{onClick:()=>this.onClickDoor(2),className:this.getGroupClassName()},a.a.createElement("g",null,a.a.createElement("rect",{rx:"0.15276258",ry:"2.7494175",y:"169.17856",x:"32.895828",height:"16.216231",width:"8.4255161",id:"rect1040",className:"cage-door"}),a.a.createElement("rect",{ry:"2.8388526",y:"172.53601",x:"39.009052",height:"9",width:"40",style:{transformOrigin:"39.009052px 172.53601px"},className:this.getClassName(h,this.props.middle,this.props.errors[2]||this.props.errors[3])})),a.a.createElement("g",null,a.a.createElement("rect",{className:"cage-door",width:"8.4255161",height:"16.216231",x:"118.9913",y:"169.17856",ry:"2.7494175",rx:"0.15276258"}),a.a.createElement("rect",{style:{transformOrigin:"120.87807px 172.53601px"},className:this.getClassName(u,this.props.middle,this.props.errors[2]||this.props.errors[3]),width:"40",height:"9",x:"80.87807",y:"172.53601",ry:"2.8388526"}))),a.a.createElement("g",null,a.a.createElement("rect",{ry:"3.2688611",rx:"0",y:"-0.33135179",x:"16.820547",height:"30.639278",width:"16.701103",className:"cage-wall"}),a.a.createElement("rect",{transform:"matrix(0.70103824,-0.71312368,0.69308774,0.72085323,0,0)",ry:"3.465991",y:"10.876099",x:"-9.4128189",height:"36.091709",width:"12.891397",className:"cage-wall"})),a.a.createElement("g",null,a.a.createElement("rect",{width:"12.891397",height:"36.091709",x:"-124.93063",y:"-102.65984",ry:"3.465991",transform:"matrix(-0.70103824,-0.71312368,-0.69308774,0.72085323,0,0)",className:"cage-wall"}),a.a.createElement("rect",{width:"16.701103",height:"30.639278",x:"126.10627",y:"0.20436205",rx:"0",ry:"3.2688611",className:"cage-wall"})),a.a.createElement("rect",{style:{transformOrigin:"29.798717px 41.172981px"},className:this.getClassName(d,this.props.left,this.props.errors[4]||this.props.errors[5]),width:"9",height:"91.864532",x:"26.798717",y:"41.172981",ry:"2.8388526",onClick:()=>this.onClickDoor(3)}),a.a.createElement("rect",{ry:"2.8388526",y:"41.172981",x:"126.79872",height:"91.864532",width:"9",style:{transformOrigin:"129.79872px 41.172981px"},className:this.getClassName(g,this.props.right,this.props.errors[6]||this.props.errors[7]),onClick:()=>this.onClickDoor(4)}),a.a.createElement("foreignObject",{x:54,y:385,width:50,height:30},a.a.createElement("div",{className:"cage-view-passes"},this.props.passes)),a.a.createElement("foreignObject",{x:-30,y:65,width:50,height:30},a.a.createElement("div",{className:"cage-view-passes"},this.props.passesLeft)),a.a.createElement("foreignObject",{x:54,y:0,width:50,height:30},a.a.createElement("div",{className:"cage-view-passes"},this.props.passesMiddle)),a.a.createElement("foreignObject",{x:140,y:65,width:50,height:30},a.a.createElement("div",{className:"cage-view-passes"},this.props.passesRight))),a.a.createElement("div",{className:"cage-view-weight"},a.a.createElement("span",null,a.a.createElement("div",null,e("chamber.separationCageInfo.current")),this.props.weight),a.a.createElement("span",null,a.a.createElement("div",null,e("chamber.separationCageInfo.last")),this.props.weightClosed)))}}f.propTypes={entrance:i.a.oneOf([l.CLOSED,l.MIDDLE,l.OPENED]).isRequired,middle:i.a.oneOf([l.CLOSED,l.MIDDLE,l.OPENED]).isRequired,left:i.a.oneOf([l.CLOSED,l.MIDDLE,l.OPENED]).isRequired,right:i.a.oneOf([l.CLOSED,l.MIDDLE,l.OPENED]).isRequired,weight:i.a.node.isRequired,weightClosed:i.a.node.isRequired,passes:i.a.node.isRequired,passesLeft:i.a.node.isRequired,passesMiddle:i.a.node.isRequired,passesRight:i.a.node.isRequired,workType:i.a.number.isRequired,errors:i.a.array.isRequired,cage:i.a.object,valves:i.a.array},t.a=Object(c.a)()(f)},"4o57":function(e,t,r){"use strict";var n=r("q1tI"),a=r.n(n),s=r("1mk5"),i=r("3Z9Z"),o=r("JI6e"),c=r("wd/R"),l=r.n(c),p=r("uVg0"),m=r("/MKj"),h=r("LCzB"),u=r("9jj8"),d=r("9L8V"),g=r("3xDe");class f extends a.a.Component{getColor(){switch(this.props.notification.NData.Status){case p.a.INFO:return"info";case p.a.ALERT:return"error";case p.a.WARN:return"warning";default:return""}}render(){const{t:e,style:t,notification:r,index:n,readTime:c}=this.props,p=Object(s.b)(r,e)||"",m=Object(s.c)(r,e)||"",h=Object(s.a)(r),f=l()(r.DtaCrtTime),b=l()(r.DtaCrtTime).startOf("day").isSame(l()().startOf("day")),y=this.getColor();return a.a.createElement(u.a,{style:t,color:y?Object(g.c)(y):void 0,className:"log-item pt-2 pb-2 col opacity-".concat(c>r.DtaCrtTime?"50":"100"),index:n},a.a.createElement(i.a,null,a.a.createElement(o.a,{title:m,xs:12,sm:12,md:8,lg:10,xl:10,className:"font-weight-bold order-2 order-md-1"},a.a.createElement(d.a,{src:h,className:"pr-1 fa-fw"}),m),a.a.createElement(o.a,{title:f.format("DD.MM.YY HH:mm"),xs:12,sm:12,md:4,lg:2,xl:2,className:"text-right opacity-75 order-1 order-md-2"},f.format(b?"HH:mm":"DD.MM.YY HH:mm"))),a.a.createElement(i.a,null,a.a.createElement(o.a,{xs:12,className:"text-break pt-1 pb-1"},p)))}}f=Object(m.connect)(e=>({user:e.user.user,lang:e.language.lang.lang,readTime:e.notificationCenter.readTime}))(f),t.a=Object(h.a)()(f)},"6BD3":function(e,t,r){},"6qyL":function(e,t,r){"use strict";var n,a=r("q1tI"),s=r.n(a),i=(r("/bWB"),r("17x9")),o=r.n(i),c=r("i8i4"),l=r.n(c),p=r("i8MS"),m=r("I8zd"),h=r("LCzB"),u=r("/MKj");function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let f=Object(u.connect)(e=>({animalsTime:e.animals.time}))(n=class extends s.a.Component{constructor(e){super(e),this.clickListener=e=>{const{container:{current:t},props:{element:r,onOutsideClick:n}}=this;t&&!t.contains(e.target)&&r&&!r.contains(e.target)&&n()},this.state={left:0,top:0,arrowLeft:0},this.container=s.a.createRef(),this.arrow=s.a.createRef()}componentDidMount(){this.container.current&&this.setState(function(e){for(var t=1;tr){let e=t-(n-r)/2,s=0;if(window.innerWidth{const r=p()(e,"configuration.minWeights[".concat(t,"]"),0),n=p()(e,"weights[".concat(t,"].value"));return!!r&&n<=r},this.getValues=()=>{const e={color:Object(f.c)("warning")},{index:t,shadow:{shadow:r,fetching:n,fetched:a}}=this.props;if(r){const n=Object(b.o)(p()(r,"metadata"))||0,a=+new Date-n>y.a.DEVICE_OUTDATED_DATA,s=p()(r,"weights[".concat(t,"].value"));if(isFinite(s)){const t=Object(g.getScaleUnit)();e.text=Object(d.j)(s,{showUnit:!0,fixed:t,unit:t}),a||(e.color=s<=1e3||this.hasAlarm(r)?Object(f.c)("error"):Object(f.c)("primary"))}}return c()(e.text)&&(e.text=n?"...":a?"-":"!"),e}}render(){const{requiredProps:e,device:t}=this.props;if(!t)return a.a.createElement(s.a,e);const r=this.getValues();return a.a.createElement(s.a,v({},e,{label:r.text,style:{fill:r.color},labelProps:{style:{fill:Object(f.g)(r.color)}}}))}}var O=Object(m.connect)((function(){const e=Object(h.b)(),t=Object(u.a)();return function(r,n){return{device:e(r,n),shadow:t(r,n)}}}))(E),w=r("eASP");function x(){return(x=Object.assign||function(e){for(var t=1;t{const t=p()(e,"ambientConditions.averageCurrentAirTemperature",0),r=p()(e,"configuration.requestedAirTemperature",0),n=r-p()(e,"configuration.alarms.minimumTemperatureAlarmDeviation",0),a=r+p()(e,"configuration.alarms.maximumTemperatureAlarmDeviation",0);return t>p()(e,"configuration.alarms.absoluteAlarm",0)||(t<=n||t>=a)},this.getValues=()=>{const e={color:Object(f.c)("warning")},{shadow:{shadow:t,fetching:r,fetched:n}}=this.props;if(t){const r=Object(b.o)(p()(t,"metadata"))||0,n=+new Date-r>y.a.DEVICE_OUTDATED_DATA,a=p()(t,"ambientConditions.averageCurrentAirTemperature",0);isFinite(a)&&(e.text=Object(d.f)(a,{unit:w.a.SMALL,fixed:1,showUnit:!0}),n||(e.color=this.hasAlarm(t)?Object(f.c)("error"):Object(f.c)("primary")))}return c()(e.text)&&(e.text=r?"...":n?"-":"!"),e}}render(){const{requiredProps:e,device:t}=this.props;if(!t)return null;const r=this.getValues();return a.a.createElement(s.a,x({},e,{label:r.text,style:{fill:r.color},labelProps:{style:{fill:Object(f.g)(r.color)}}}))}}var D=Object(m.connect)((function(){const e=Object(h.d)(),t=Object(u.a)(),r={};return function(n,a){const s=e(n,a)[0]||null;return s?r.DevID=s.DevID:delete r.DevID,{device:s,shadow:t(n,r)}}}))(j);class C extends a.a.Component{render(){const{requiredProps:e,requiredProps:{id:t,type:r}}=this.props,n={};if(console.log("deviceDataProvider->",this.props),"devices"===r){const r=t.split("_");return console.log("splitted"),2===r.length&&(n.DevID=r[0],n.index=+r[1]),a.a.createElement(O,{requiredProps:e,DevID:n.DevID,index:n.index})}return"chambers"===r?(n.PlcmntID=t,n.DevType=[i.d.CLIMATE],a.a.createElement(D,{requiredProps:e,PlcmntID:n.PlcmntID,DevType:n.DevType})):a.a.createElement(s.a,e)}}},MMk1:function(e,t,r){"use strict";var n,a=r("q1tI"),s=r.n(a),i=r("/MKj"),o=r("+Tvs"),c=r("Ty5D"),l=(r("hx7W"),r("qx5e")),p=r("uSQv"),m=r("cpGi");let h=Object(i.connect)(e=>({navMenuElementShow:e.location.navMenuElementShow}))(n=class extends a.Component{constructor(e){super(e),this.onHover=()=>{const{showToolTip:e}=this.state;!e&&this.isOverflown(this.textRef.current)&&this.setState({showToolTip:!0})},this.onHoverLeave=()=>{this.setState({showToolTip:!1})},this.isOverflown=({clientWidth:e,scrollWidth:t})=>t>e,this.handleRedirect=e=>{this.props.history.push(e)},this.textRef=s.a.createRef(),this.state={showToolTip:!1,shouldShow:!(!this.props.history||!this.props.history.location||this.props.href!==this.props.history.location.pathname)}}componentDidMount(){const{history:e,locations:t}=this.props;e.listen(e=>{let r=[];try{r=e.pathname.split("/")}catch(e){r=[]}let n=!(!t||!t.filter(e=>r.includes(e))[0]);this.state.shouldShow!==n&&this.setState({shouldShow:n}),n||this.props.onDeselect&&this.props.onDeselect()})}render(){const{expanded:e,href:t,name:r,icon:n,counter:a}=this.props,{shouldShow:i,showToolTip:c}=this.state;return s.a.createElement(o.LinkContainer,{to:t},s.a.createElement("div",{className:"main-nav-button-container"},s.a.createElement(p.a,{className:"main-nav-button ".concat(e?"expanded":""," ").concat(a?"show-badge":""),selected:!!i,buttonColor:"white",buttonStyle:"text",icon:s.a.createElement("i",{"data-counter":a||void 0,className:"fa-fw ".concat(n)}),type:"button"},e&&s.a.createElement(s.a.Fragment,null,s.a.createElement("span",{style:{width:"80%"},"data-tip":r,"data-counter":a,onMouseOut:this.onHoverLeave,onMouseOver:this.onHover,ref:this.textRef},r)),c&&s.a.createElement(m.a,null))))}})||n;h=Object(c.o)(h),h=Object(l.a)(e=>({roles:e.roles,clientPackage:e.packages}))(h);var u=h;function d(){return(d=Object.assign||function(e){for(var t=1;te.hide?null:s.a.createElement(u,d({expanded:t},e,{key:r}))))}}t.a=g},O4hi:function(e,t,r){"use strict";r.d(t,"a",(function(){return E}));var n=r("lSCD"),a=r.n(n),s=r("Puqe"),i=r.n(s),o=r("q1tI"),c=r.n(o),l=r("17x9"),p=r.n(l),m=r("Y+p1"),h=r.n(m);function u(){return(u=Object.assign||function(e){for(var t=1;t{const{elementRef:{current:t}}=e;if(t){let e=t.getBBox(),r=15*this.getScale();return r=r>15?15:r,function(e){for(var t=1;t{const{props:{elementRef:{current:e}},textRef:{current:t}}=this;return e&&t?.95*Math.min(e.getBBox().width/t.getBBox().width,e.getBBox().height/t.getBBox().height):0},this.textRef=c.a.createRef(),this.state={attributes:this.getAttributes(this.props)}}componentDidMount(){this.setState({attributes:this.getAttributes(this.props)})}componentDidUpdate(e,t,r){h()(t.attributes,this.getAttributes(this.props))||this.setState({attributes:this.getAttributes(this.props)})}render(){const{txt:e,style:t,onClick:r}=this.props;return c.a.createElement(c.a.Fragment,null,c.a.createElement("text",{ref:this.textRef,fontSize:15,opacity:0},e),c.a.createElement("text",u({onClick:r,style:t},this.state.attributes),e))}}function b(){return(b=Object.assign||function(e){for(var t=1;t{e.stopPropagation();const{extraArguments:t={},onClick:r}=this.props;return a()(r)&&r(t),!1},this.ref=c.a.createRef()}render(){const{svgElementType:e,label:t,labelProps:r}=this.props;let n=i()(this.props,["svgElementRef","labelProps","svgElementType","onClick"]);return c.a.createElement("g",{className:"clickable",onClick:this.onClick},c.a.createElement(e,function(e){for(var t=1;t{let t=a()(r.get(e.DevID),"delay");return e.DevType===p.d.GATEWAY&&!t&&null!==t}),l=i()(n||[]).filter(e=>{let t=a()(r.get(e.DevID),"delay");return e.DevType===p.d.GATEWAY&&void 0!==t}).map(e=>({Name:e.Name,Delay:a()(r.get(e.DevID),"delay")}));return Object(m.isUsingFakeData)()?c.a.createElement("div",{className:"no-connection-content"},c.a.createElement("b",null,t("mqttActive")),o.map(e=>c.a.createElement("div",{className:"no-break-word"},e.Name," ",c.a.createElement("b",null,Math.round(200+50*Math.random()),"ms"))),l.map(e=>c.a.createElement("div",{className:"no-break-word"},e.Name," ",c.a.createElement("b",null,Math.round(200+50*Math.random()),"ms")))):c.a.createElement("div",{className:"no-connection-content"},!e&&c.a.createElement("b",null,t("noMQTT")),e&&c.a.createElement("b",null,t("mqttActive")),s&&c.a.createElement("div",null,c.a.createElement("b",null,t("mqttReconnecting"))),o.map(e=>c.a.createElement("div",{className:"no-break-word"},e.Name," ",c.a.createElement("i",{className:"fas ".concat(r.get(e.DevID)?"fa-spin fa-circle-notch":"fa-times"," fa-fw")}))),l.map(e=>c.a.createElement("div",{className:"no-break-word"},e.Name," ",c.a.createElement("b",null,e.Delay||"?","ms"))))}}u=Object(l.connect)(e=>({mqttConnected:e.mqtt.connected,status:e.mqtt.status,devices:e.farmDevices.devices,mqttReconnecting:e.mqtt.reconnecting}))(u),t.a=Object(h.a)()(u)},ZM30:function(e,t,r){"use strict";r.r(t),r.d(t,"CustomNotificationsSystem",(function(){return l}));var n=r("q1tI"),a=r.n(n),s=r("j1RV"),i=r.n(s),o=r("1yud"),c=r.n(o);class l extends n.Component{render(){return a.a.createElement(i.a,{theme:c.a})}}t.default=l},dpQJ:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r("q1tI"),a=r.n(n),s=r("O4hi"),i=r("tDQA"),o=r("/MKj");function c(){return(c=Object.assign||function(e){for(var t=1;t({selectedID:p(e,"selectedID")}))(l)},g8yI:function(e,t,r){},hx7W:function(e,t,r){},lijG:function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r("mwIZ"),a=r.n(n),s=r("Y+p1"),i=r.n(s),o=r("q1tI"),c=r.n(o),l=r("17x9"),p=r.n(l),m=(r("g8yI"),r("O4hi")),h=r("/MKj"),u=r("e/I0");function d(){return(d=Object.assign||function(e){for(var t=1;t{const{requiredProps:{type:e},placement:t,showOnly:r}=this.props;return e===(r||"chambers")?t?t.name.slice(0).pop():"?":""},this.getClassName=()=>{const{requiredProps:{className:e},placement:t}=this.props;return"".concat(e," sector-type-").concat(a()(t,"SType",""))}}render(){const{requiredProps:e,placement:t}=this.props,r=this.getName();return c.a.createElement(m.a,d({},e,{extraArguments:{placement:t},svgElementRef:e=>this.itemRef=e,className:this.getClassName(),label:r}))}}g=Object(h.connect)((function(e,t){const r=Object(u.c)(),{requiredProps:{id:n,type:a}}=t,s={PlcmntID:n};return function(e,t){return{placement:["chambers","sectors","buildings"].includes(a)?r(e,s):null}}}))(g);var f=r("yLV6"),b=r.n(f),y=r("+PmE"),v=r.n(y);class E extends c.a.Component{constructor(e){super(e),this.initializeSvgPan=()=>{const{svgId:e,api:t}=this.props;try{this.state.zoomPan&&this.state.zoomPan.destroy()}catch(n){console.error(n)}const r={haltEventListeners:["touchstart","touchend","touchmove","touchleave","touchcancel"],init:e=>{let t=e.instance,r=1,n=0,a=0;this.hammer=new b.a(e.svgElement,{inputClass:b.a.SUPPORT_POINTER_EVENTS?b.a.PointerEventInput:b.a.TouchInput}),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("doubletap",e=>{t.zoomIn()}),this.hammer.on("panstart panmove",e=>{"panstart"===e.type&&(n=0,a=0),t.panBy({x:e.deltaX-n,y:e.deltaY-a}),n=e.deltaX,a=e.deltaY}),this.hammer.on("pinchstart pinchmove",e=>{"pinchstart"===e.type&&(r=t.getZoom(),t.zoomAtPoint(r*e.scale,{x:e.center.x,y:e.center.y})),t.zoomAtPoint(r*e.scale,{x:e.center.x,y:e.center.y})}),e.svgElement.addEventListener("touchmove",e=>{e.preventDefault()})},destroy:()=>{this.hammer.destroy()}};this.setState({zoomPan:v()("#".concat(e),{customEventsHandler:r})},()=>{t({zoomPan:this.state.zoomPan})})},this.state={zoomPan:null}}componentDidMount(){this.initializeSvgPan()}render(){const{children:e}=this.props;return e||c.a.createElement("rect",null)}}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t{}};class j extends c.a.Component{constructor(e){super(e),this.attrToObject=e=>e?{[e.name]:e.value}:null,this.onResize=()=>{clearTimeout(this.timer),this.timer=setTimeout(()=>{this.setState({height:this.getHeight()})},100)},this.onClick=e=>{const{onElementClick:t}=this.props;t(e)},this.getHeight=()=>{try{return window.innerHeight-(this.svg.current.getClientRects()[0].y+15)}catch(e){return console.log(e),500}},this.buildSVG=e=>{const{dataProvider:t,showOnly:r}=this.props;try{let n=[],s=e.attributes.viewBox.value,i=["buildings","sectors","chambers","devices"];for(let o of i){let s=a()(e,"children.".concat(o,".children"),[]);for(let e=0;e{this.onClick(w({type:o,id:l.id,element:p},e))}})});n.push(p)}}return{levels:n,viewBox:s}}catch(n){return console.error(n),{levels:[],viewBox:"0 0 512 512"}}};const{farmMap:t}=this.props;this.svg=c.a.createRef(),this.timer=void 0,this.state=w({},this.buildSVG(t),{height:500})}componentDidMount(){window.addEventListener("resize",this.onResize),this.onResize()}componentWillUnmount(){window.removeEventListener("resize",this.onResize)}UNSAFE_componentWillReceiveProps(e,t){const{farmMap:r}=this.props;i()(r,e.farmMap)||this.setState(w({},this.buildSVG(e.farmMap)))}render(){const{levels:e,viewBox:t,height:r}=this.state,{showOnly:n,children:a,calculateHeight:s}=this.props;let i="fetura-farm-map-svg";return i+=n?" show-only ".concat(n):"",c.a.createElement("div",{className:"farm-map"},c.a.createElement("svg",{ref:this.svg,className:i,style:s?{height:r}:null,viewBox:t,id:"svg-map"},c.a.createElement(E,{svgId:"svg-map",api:({zoomPan:e})=>this.setState(e)},e)),c.a.createElement("div",{className:"farm-map-extensions"},a))}}j.propTypes={farmMap:p.a.object.isRequired,onElementClick:p.a.func.isRequired,dataProvider:p.a.object,showOnly:p.a.oneOf(["buildings","sectors","chambers","devices"]),calculateHeight:p.a.bool},j.defaultProps={onElementClick:()=>{},dataProvider:g,calculateHeight:!0}},t9uZ:function(e,t,r){"use strict";var n=r("Z0cm"),a=r.n(n),s=r("q1tI"),i=r.n(s),o=r("+Tvs"),c=r("17x9"),l=r.n(c),p=r("Ty5D"),m=r("JI6e"),h=r("qx5e");class u extends i.a.Component{constructor(e){super(e),this.state={shouldShow:u.checkIfIsActive(this.props.history,this.props.locations)}}static getDerivedStateFromProps(e,t){const r=u.checkIfIsActive(e.history,e.locations);return r!==t.shouldShow?{shouldShow:r}:null}render(){const{name:e,href:t,counter:r,icon:n,handleHide:a}=this.props,{shouldShow:s}=this.state;let c=[];return r&&c.push("show-badge"),s&&c.push("active"),c=c.join(" "),i.a.createElement(o.LinkContainer,{to:t,onClick:a},i.a.createElement(m.a,{xl:2,lg:3,md:4,sm:6,xs:12,className:c},i.a.createElement("i",{className:"fa-fw ".concat(n)}),i.a.createElement("a",{"data-counter":r||void 0},e)))}}u.checkIfIsActive=(e,t)=>{const{location:{pathname:r}}=e;let n;try{n=r.split("/")}catch(s){n=[]}return!(!n.length||!a()(t))&&!!t.filter(e=>n.includes(e)).length},u.propTypes={text:l.a.string.isRequired,href:l.a.string.isRequired,onClick:l.a.func.isRequired},u=Object(h.a)(e=>({roles:e.roles,clientPackage:e.packages}))(u),t.a=Object(p.o)(u)},yuWL:function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r("q1tI"),a=r.n(n),s=r("VyNe"),i=r("udB/"),o=r("vzZS"),c=r("17x9"),l=r.n(c);class p extends n.Component{render(){const{isLoading:e,dataLength:t=0,noDataText:r=""}=this.props;return e&&!t?a.a.createElement(s.a,{className:"mh-15rem"},a.a.createElement(i.a,{isLoading:e})):a.a.createElement(o.a,{boxColor:"warning"},r)}}p.propTypes={dataLength:l.a.number.isRequired,noDataText:l.a.string,isLoading:l.a.bool.isRequired}}}]); //# sourceMappingURL=main~7be1c732.da4a1c50.chunk.js.map