{"version":3,"sources":["webpack:///./Scripts/Containers/BuyButton.Container.js"],"names":["BuyButtonContainer","_Component","props","_this","_callSuper","buttonRef","React","createRef","_inherits","key","value","_this2","createElement","ref","this","BuyButton","_extends","onClick","articleNumber","quantityFieldId","unitPrice","productName","addToCart","current","Component","connect","state","dispatch","buttonDomNode","nodeIdToShowNotification","id","Date","now","quantity","document","getElementById","notificationMessage","translate","hash"],"mappings":"+uDAMMA,GAAkBC,IACpB,SAAAD,EAAYE,G,GAAO,gBAAAF,EAEoB,OADnCG,EAAAC,EAAA,KAAAJ,EAAA,CAAME,EAAK,GACNG,UAAYC,IAAMC,UAAU,EAAEJ,E,wDACvC,CAACK,I,IAAAR,E,4GAAA,O,6JAAAA,G,EAAA,EAAAS,IAAA,SAAAC,MAED,WAAS,IAAAC,EAAA,KACL,OACIL,IAAAM,cAAA,QAAMC,IAAKC,KAAKT,SAAU,EACtBC,IAAAM,cAACG,IAASC,EAAA,GAAKF,KAAKZ,MAAK,CACrBe,QAAS,SAACC,EAAeC,EAAiBC,EAAWC,GAAW,OAAKV,EAAKT,MAAMoB,UAAUX,EAAKN,UAAUkB,QAASL,EAAeC,EAAiBC,EAAUC,CAAW,CAAC,CAAC,EAAE,CAC7K,CAEd,CAAC,K,+EAAA,GAb4BG,WAAS,EAqC3BC,sBArBS,SAAAC,GACpB,MAAO,EACX,EAE2B,SAAAC,GACvB,MAAO,CACHL,UAAW,SAACM,EAAeV,EAAeC,EAAiBC,EAAUC,GAC3DQ,EAA2BD,EAAcE,GAAKC,KAAKC,IAAI,EAC7D,OAAOL,EAASL,YAAU,CACtBD,cACAD,YACAF,gBACAe,SAAUd,EAAkBe,SAASC,eAAehB,CAAe,EAAET,MAAQ,EAC7EmB,2BACAO,oBAAqBC,YAAU,qBAAqB,EACpDC,KAAMP,KAAKC,IAAI,CACnB,CAAC,CAAC,CACN,CACJ,CACJ,CAE0D,EAAEhC,CAAmB,C","file":"15.js","sourcesContent":["import React, { Component } from 'react';\r\nimport { connect } from 'react-redux';\r\nimport BuyButton from '../Components/BuyButton';\r\nimport { add as addToCart } from '../Actions/Cart.action';\r\nimport { translate } from '../Services/translation';\r\n\r\nclass BuyButtonContainer extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.buttonRef = React.createRef();\r\n }\r\n\r\n render() {\r\n return (\r\n <span ref={this.buttonRef}>\r\n <BuyButton {...this.props} \r\n onClick={(articleNumber, quantityFieldId, unitPrice, productName) => this.props.addToCart(this.buttonRef.current, articleNumber, quantityFieldId, unitPrice,productName)} />\r\n </span>\r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = state => {\r\n return {};\r\n};\r\n\r\nconst mapDispatchToProps = dispatch => {\r\n return {\r\n addToCart: (buttonDomNode, articleNumber, quantityFieldId, unitPrice,productName) => {\r\n const nodeIdToShowNotification = buttonDomNode.id = Date.now();\r\n return dispatch(addToCart({ \r\n productName,\r\n unitPrice,\r\n articleNumber, \r\n quantity: quantityFieldId ? document.getElementById(quantityFieldId).value : 1,\r\n nodeIdToShowNotification,\r\n notificationMessage: translate('tooltip.addedtocart'),\r\n hash: Date.now(),\r\n }));\r\n }\r\n }\r\n}\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(BuyButtonContainer);"],"sourceRoot":""}