text: (this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{121:function(e,t,o){},140:function(e,t,o){},158:function(e,t,o){},295:function(e,t,o){},342:function(e,t,o){},354:function(e,t,o){"use strict";o.r(t);var n=o(0),a=o(1),i=o.n(a),r=o(21),c=o.n(r),s=(o(158),o(11)),l=o(12),d=o(14),h=o(13),u=o(34),j=o(20),b=o(31),p=o(23),m=o(371),f=o(372),O=o(373),x=o(374),g=o(375),v=o(376),C=o(377),y=o(382),P=o(383),S=o(384),I=o(378),F=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){var n;return Object(s.a)(this,o),(n=t.call(this,e)).toggle=n.toggle.bind(Object(p.a)(n)),n.state={isOpen:!1},n}return Object(l.a)(o,[{key:"toggle",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return Object(n.jsx)("div",{children:Object(n.jsxs)(m.a,{color:"light",light:!0,expand:"md",children:[Object(n.jsx)(f.a,{children:Object(n.jsx)("strong",{children:this.props.title1})}),Object(n.jsx)(O.a,{onClick:this.toggle}),Object(n.jsx)(x.a,{isOpen:this.state.isOpen,navbar:!0,children:Object(n.jsxs)(g.a,{className:"ml-auto",navbar:!0,children:[Object(n.jsx)(v.a,{children:Object(n.jsx)(C.a,{href:this.props.ruta,children:Object(n.jsx)("strong",{children:this.props.title2})})}),Object(n.jsx)(v.a,{}),Object(n.jsxs)(y.a,{nav:!0,inNavbar:!0,children:[Object(n.jsx)(P.a,{nav:!0,caret:!0,children:"Options"}),Object(n.jsxs)(S.a,{right:!0,children:[Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:this.props.rutaOpcion1,children:Object(n.jsx)("strong",{children:this.props.opcion1})})}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:this.props.rutaOpcion2,children:Object(n.jsx)("strong",{children:this.props.opcion2})})}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:this.props.rutaOpcion3,children:Object(n.jsx)("strong",{children:this.props.opcion3})})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:"Reset"})]})]})]})})]})})}}]),o}(i.a.Component),w=o(144),T=o(10),U=o.n(T),k=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;Object(s.a)(this,o);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return(e=t.call.apply(t,[this].concat(a))).logOut=function(){var e={salir:true};U.a.post("/logout",e).then((function(e){})).catch((function(e){})),alert("Deseas Salir de Session")},e}return Object(l.a)(o,[{key:"render",value:function(){return Object(n.jsx)("div",{style:{Width:50,height:"100px"},children:Object(n.jsxs)(g.a,{vertical:!0,children:[Object(n.jsx)(v.a,{children:Object(n.jsxs)(y.a,{nav:!0,inNavbar:!0,children:[Object(n.jsx)(P.a,{caret:!0,size:"lg",children:"Dashboard Menu"}),Object(n.jsxs)(S.a,{left:!0,children:[Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/registerStore",children:"Registrar Comercio"})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/storeInfo",children:"Comercio Info"})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/userProfile",children:"Usuario Info"})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/tableProd",children:"Producto Info"})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/productShop",children:"Compra Producto"})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/tableOfert",children:"Oferta Producto"})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/deliveryInCurse",children:"Pedidos en Linea"})}),Object(n.jsx)(I.a,{divider:!0}),Object(n.jsx)(I.a,{children:Object(n.jsx)(C.a,{href:"/clientInfoInvoice",children:"Factura/Client Info"})}),Object(n.jsx)(I.a,{divider:!0})]})]})}),Object(n.jsx)(v.a,{}),Object(n.jsx)(v.a,{children:Object(n.jsxs)(w.a,{caret:!0,size:"lg",onClick:this.logOut,href:"/",color:"secondary",children:["Salir"," "]})})]})})}}]),o}(i.a.Component),N=o(147),D=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){var n;return Object(s.a)(this,o),(n=t.call(this,e)).state={chartData:e.chartData},n}return Object(l.a)(o,[{key:"render",value:function(){return Object(n.jsxs)("div",{className:"chart",children:[Object(n.jsx)("h2",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"20px"},children:"Charts de la Aplicaci\xf3n"}),Object(n.jsx)(N.Bar,{data:this.state.chartData,width:100,height:250,options:{maintainAspectRatio:!1,title:{display:this.props.displayTitle,text:this.props.tituloChart+""+this.props.periodoFecha,fontSize:35,legend:{display:this.props.displayLegend,position:this.props.displayPosition}}}})]})}}]),o}(a.Component);D.defaultProps={displayTitle:!0,displayLegend:!0,displayPosition:"right",periodoFecha:"",tituloChart:""};var R=D,H=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).state={usuarioInfo:[],chartData:{},comercioInfo:[]},e}return Object(l.a)(o,[{key:"componentDidMount",value:function(){var e=this;fetch("/usuarioInfo").then((function(e){return e.json()})).then((function(t){return e.setState({usuarioInfo:t},(function(){return console.log("usuarioInfo fetched...",t)}))})),fetch("/commerceInfo").then((function(e){return e.json()})).then((function(t){return e.setState({comercioInfo:t},(function(){return console.log("comercioInfo fetched...",t)}))}))}},{key:"componentWillMount",value:function(){this.getChartData()}},{key:"getChartData",value:function(){this.setState({chartData:{labels:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],datasets:[{label:"Usuarios",data:[95,126,90,180,230,268,325,300,156,200,300,350],backgroundColor:["rgba(255,99,132,0.6)","rgba(54,162,235,0.6)","rgba(255,206,86,0.6)","rgba(75,192,192,0.6)","rgba(255,99,132,0.6)","rgba(54,162,235,0.6)","rgba(255,206,86,0.6)","rgba(75,192,192,0.6)","rgba(255,99,132,0.6)","rgba(54,162,235,0.6)","rgba(255,206,86,0.6)","rgba(75,192,192,0.6)","rgba(255,99,132,0.6)","rgba(54,162,235,0.6)","rgba(255,206,86,0.6)","rgba(75,192,192,0.6)","rgba(75,192,192,0.6)"],borderWidth:1,borderColor:"#777",hoverBorderWidth:3,hoverBorderColor:"#000"}]}})}},{key:"render",value:function(){var e;return Object(n.jsxs)("div",{children:[Object(n.jsx)(F,{title1:" Pagina Administrativa",title2:"componente",ruta:" ",opcion1:"opcion1",opcion2:"opcion2",opcion3:"opcion3"}),Object(n.jsxs)("div",{children:[Object(n.jsxs)("div",{style:{marginLeft:"30px",marginTop:"20px",height:"15vh"},children:[Object(n.jsx)("h2",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"20px"},children:"Bienvenido"}),this.state.usuarioInfo.map((function(e){return Object(n.jsxs)("h2",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"20px"},children:[e.nombreUsuario," ",e.apellidoUsuario]})}))]}),Object(n.jsx)("div",{style:{display:"flex",marginRight:50,marginTop:80,justifyContent:"center",alignItems:"center",height:"6vh"},children:this.state.comercioInfo.map((function(e){return Object(n.jsxs)("h2",{style:{fontSize:70,fontFamily:"fantasy",marginTop:"20px"},children:["Comercio ",e.nombreTienda]})}))})]}),Object(n.jsx)("div",{style:{marginLeft:"30px",marginTop:"30px",height:"25px"},children:Object(n.jsx)(k,{})}),Object(n.jsx)("div",{style:{marginTop:"100px",marginLeft:"250px",marginRight:"250px",justifyContent:"center",alignItems:"center",height:"50vh"},children:Object(n.jsx)(R,(e={chartData:this.state.chartData,tituloChart:"Numero de usuarios que se inscribieron en la plataforma periodo ",periodoFecha:"2019"},Object(b.a)(e,"tituloChart","Numero de usuarios que se inscribieron en la plataforma periodo "),Object(b.a)(e,"periodoFecha","2019"),e))})]})}}]),o}(a.Component),z=o.p+"static/media/logoPLataform.cf43d01b.png",E=(o(295),function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).redirectPage=function(){var t={name:e.state.name,contra:e.state.contra,email:e.state.email};U.a.post("/loginAuth",t).then((function(t){var o=t.data;console.log(t.data.usrAut),console.log(t.data),!0===o.inicio?e.props.history.push("/homeAdmin"):(alert("Incorrecto Correo Nombre o Contrase\xf1a-Usuario"),e.resetForm())}))},e.resetForm=function(){e.setState({name:"",email:"",contra:""})},e.state={email:"",name:"",contra:""},e.handleChange=e.handleChange.bind(Object(p.a)(e)),e.handleSubmit=e.handleSubmit.bind(Object(p.a)(e)),e}return Object(l.a)(o,[{key:"handleChange",value:function(e){var t=e.target,o=t.name,n=t.value;this.setState(Object(b.a)({},o,n))}},{key:"handleSubmit",value:function(e){e.preventDefault()}},{key:"render",value:function(){return Object(n.jsxs)("form",{name:"loginAuth",action:"/loginAuth",method:"POST",onSubmit:this.handleSubmit,children:[Object(n.jsx)("h3",{style:{fontSize:"60px",marginTop:"25px",marginLeft:"15px",fontFamily:"fantasy"},children:"Login - ValenciaCorpEcommerce"}),Object(n.jsx)("div",{className:"imgcontainer",children:Object(n.jsx)("img",{src:z,alt:"Avatar",className:"avatar"})}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsx)("label",{children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Correo Cliente"})}),Object(n.jsx)("input",{type:"text",placeholder:"Ingrese Correo",name:"email",value:this.state.email,onChange:this.handleChange}),Object(n.jsx)("label",{children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Nombre Cliente"})}),Object(n.jsx)("input",{type:"text",placeholder:"Ingrese Primer - Nombre",name:"name",value:this.state.name,onChange:this.handleChange}),Object(n.jsx)("label",{children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Contrase\xf1a Cliente"})}),Object(n.jsx)("input",{type:"password",placeholder:"Ingrese Contrase\xf1a",name:"contra",value:this.state.contra,onChange:this.handleChange}),Object(n.jsx)("button",{style:{fontSize:"25px",fontFamily:"fantasy"},onClick:this.redirectPage,type:"submit",className:"login-btn",value:"submit",children:"Login"})]}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsx)("button",{style:{fontSize:"25px",fontFamily:"fantasy"},type:"button",className:"cancelbtn",onClick:this.resetForm,children:"Cancel"}),Object(n.jsx)("span",{className:"psw",children:Object(n.jsx)(u.c,{style:{fontSize:"25px",fontFamily:"fantasy"},to:"register",children:"Registrar Cliente-Comercio"})})]})]})}}]),o}(a.Component)),A=(o(121),function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).resetForm=function(){e.setState({nombre:"",apellido:"",correo:"",direccion:"",telephone:"",password:""})},e.state={nombre:"",apellido:"",correo:"",password:"",direccion:"",telephone:""},e.handleChange=e.handleChange.bind(Object(p.a)(e)),e.handleSubmit=e.handleSubmit.bind(Object(p.a)(e)),e}return Object(l.a)(o,[{key:"handleChange",value:function(e){var t=e.target,o=t.name,n=t.value;this.setState(Object(b.a)({},o,n))}},{key:"handleSubmit",value:function(e){var t=this;if(e.preventDefault(),""===this.state.nombre||""===this.state.apellido||""===this.state.correo||""===this.state.direccion||""===this.state.telephone||""===this.state.password)alert("Porfavor No Dejar Vacios \nNingun Campo Del Formato"),this.resetForm();else{var o={nombre:this.state.nombre,apellido:this.state.apellido,correo:this.state.correo,direccion:this.state.direccion,telephone:this.state.telephone,password:this.state.password};U.a.post("/registerUser",o).then((function(e){var o=e.data.inicio;console.log(o),!1===o?(alert("Datos Ya en DataBase\nIntenta De Nuevo"),t.resetForm()):(t.resetForm(),alert("Usuario Registrado\nIngresar en Login"),t.props.history.push("/"))})).catch((function(e){}))}}},{key:"resAutRegister",value:function(){var e=this;U.a.get("/registerUser").then((function(t){var o=t.data.authRegiser;console.log(t.data.authRegiser),console.log("RespuestaServerRegister"+t.data),!0===o?(e.props.history.push("/"),alert("Usuario Registrado Satisfactoriamente"),e.resetForm()):(e.resetForm(),alert("Usuario No Registrado\nInformacion ya Existente en DataBase"))}))}},{key:"render",value:function(){return Object(n.jsxs)("form",{name:"regform",action:"/registerUser",method:"POST",onSubmit:this.handleSubmit,children:[Object(n.jsxs)("div",{class:"container",children:[Object(n.jsx)("h1",{style:{fontSize:"50px",marginTop:"25px",fontFamily:"fantasy"},children:"Registro Cliente Administrador"}),Object(n.jsx)("p",{children:"Porfavor llenar todos los campos para su registro"}),Object(n.jsx)("hr",{}),Object(n.jsx)("label",{for:"nombre",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Nombre"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterNombre",name:"nombre",value:this.state.nombre,onChange:this.handleChange}),Object(n.jsx)("label",{for:"apellido",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Apellidos"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterApellido",name:"apellido",value:this.state.apellido,onChange:this.handleChange}),Object(n.jsx)("label",{for:"Direccion",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Direccion"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterDireccion",name:"direccion",value:this.state.direccion,onChange:this.handleChange}),Object(n.jsx)("label",{for:"Telephone",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Telefono"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterTelephone",name:"telephone",value:this.state.telephone,onChange:this.handleChange}),Object(n.jsx)("label",{for:"email",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Email"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterEmail",name:"correo",value:this.state.correo,onChange:this.handleChange}),Object(n.jsx)("label",{for:"psw",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Password"})}),Object(n.jsx)("input",{type:"password",placeholder:"EnterPassword",name:"password",value:this.state.password,onChange:this.handleChange}),Object(n.jsx)("hr",{}),Object(n.jsxs)("p",{children:["Creando esta cuenta tu aceptas nuestros",Object(n.jsx)("a",{children:" Terminos y privacidad"})]}),Object(n.jsx)("button",{style:{fontSize:"25px",fontFamily:"fantasy"},onClick:this.redirectPage,type:"submit",class:"registerbtn",value:"submit",children:"Registrar"}),Object(n.jsx)("button",{style:{fontSize:"25px",fontFamily:"fantasy"},type:"button",class:"cancelbtn",onClick:this.resetForm,children:"Cancelar"})]}),Object(n.jsx)("div",{class:"container signin",children:Object(n.jsxs)("p",{children:["Ya te encuentras inscrito?"," ",Object(n.jsx)(u.b,{style:{fontSize:"25px",fontFamily:"fantasy"},to:"/",children:"Login"})]})})]})}}]),o}(a.Component)),B=o(8),L=(o(341),function(e){var t=e.percentage;return Object(n.jsx)("div",{className:"progress",children:Object(n.jsxs)("div",{className:"progress-bar progress-bar-striped bg-success",role:"progressbar",style:{width:"".concat(t,"%")},children:[t,"%"]})})}),M={mode:"dbclick",blurToSave:!0,afterSaveCell:function(e,t,o){alert("Save column ".concat(t," with value ").concat(o)),console.log(t),console.log(o),console.log(e.idUsuario);for(var n in e)n+": "+e[n]+"\n";alert("Updated Column with id : "+e.idUsuario);var a=t,i=o,r=e.idUsuario,c={column:a,value:i,id:r};U.a.post("/updateUserInfo",c).then((function(e){})).catch((function(e){}))}};var V=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).fileSelectedHandler=function(t){console.log("fileSelectedHandler"+t.target.files[0]),console.log("fileSelectedHandler"+t.target.files[0].name);var o=t.target.files[0].name;e.setState({selectedFile:t.target.files[0],selectedFileImagen:"http://andresteccorp.club/ecom_val/imagenesProyecto/imagenUsuario/"+o})},e.fileUploadHandler=function(){var t=new FormData,o=(e.state.setUploadPorcentage,e.state.usuarioP.map((function(e){return e.idUsuario})));t.append("fileImageUsuario",e.state.selectedFile),t.set("idUsuario",o),U.a.post("http://andresteccorp.club/ecom_val/imagenUploadsUsuario.php",t,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(t){e.setState({setUploadPorcentage:parseInt(Math.round(100*t.loaded/t.total))})}}).then((function(t){var o=t.data;console.log("auth----"+o),console.log("auth----"+o.length),o?(alert("Imagen subida Satisfactoriamente"),100==e.state.setUploadPorcentage&&e.componentDidMount()):alert("Problemas en Subir Imagen\nTratar de Nuevo")})).catch((function(e){}))},e.state={usuarioP:[],selectedFile:null,selectedFileImagen:"",setUploadPorcentage:0,setUploadFile:""},e}return Object(l.a)(o,[{key:"componentDidMount",value:function(){var e=this;fetch("/usuarioInfo").then((function(e){return e.json()})).then((function(t){return e.setState({usuarioP:t},(function(){return console.log("Usuario fetched...",t)}))}))}},{key:"render",value:function(){var e=this,t={afterTableComplete:this.handleTableComplete};return Object(n.jsxs)("div",{children:[Object(n.jsx)(F,{title1:" Administrator Informacion",title2:"Home",ruta:"/homeAdmin",opcion1:"Exit",rutaOpcion1:"",opcion2:"opcion2",opcion3:"opcion3"}),Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{children:Object(n.jsx)("h3",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"30px",marginLeft:"350px"},children:"Usuario Informacion"})}),Object(n.jsxs)("div",{children:[Object(n.jsx)("ul",{children:this.state.usuarioP.map((function(e){return Object(n.jsx)("img",{style:{marginTop:"30px",marginBottom:"30px",marginLeft:"120px",marginRight:"50px",justifyContent:"center",alignItems:"center"},width:400,height:400,src:e.imagenUsuario,alt:"Nombre de la imagen"})}))}),Object(n.jsx)("h3",{style:{width:250,height:25,borderWidth:1,margin:10},children:this.state.setUploadFile.fileName})]}),Object(n.jsx)("div",{style:{width:200,height:25,borderWidth:5,margin:10},children:Object(n.jsx)(L,{percentage:this.state.setUploadPorcentage})}),Object(n.jsxs)("div",{style:{width:150,height:150,borderWidth:1,margin:10,flexDirection:"row"},children:[Object(n.jsx)("input",{style:{display:"none"},type:"file",onChange:this.fileSelectedHandler,ref:function(t){return e.fileInput=t}}),Object(n.jsx)("button",{style:{width:200,height:55,fontSize:20,borderRadius:25,paddingHorizontal:30,paddingVertical:5,fontWeight:"500",background:"#BDC3C7"},onClick:function(){return e.fileInput.click()},children:"Pick file"}),Object(n.jsx)("button",{style:{width:200,height:55,fontSize:20,borderRadius:25,paddingHorizontal:30,paddingVertical:5,fontWeight:"500",background:"#BDC3C7"},onClick:this.fileUploadHandler,children:"Subir imagen"})]}),Object(n.jsx)("div",{style:{marginTop:"50px",marginLeft:"150px",marginRight:"150px"},children:Object(n.jsxs)(B.BootstrapTable,{data:this.state.usuarioP,striped:!0,cellEdit:M,options:t,children:[Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"idUsuario",isKey:!0,children:"Id Usuario"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"nombreUsuario",children:"Nombre Usuario"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"apellidoUsuario",children:"Apellido Usuario"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"correoUsuario",children:"Correo Usuario"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"direccionUsuario",children:"Direcci\xf3n Usuario"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"telefonoUsuario",children:"Telefono Usuario"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"passW",children:"PassWord Usuario"})]})})]})]})}}]),o}(a.Component),W={mode:"dbclick",blurToSave:!0,beforeSaveCell:function(e,t,o){},afterSaveCell:function(e,t,o){alert("Save column ".concat(t," with value ").concat(o)),console.log(t),console.log(o),console.log(e.idProducto);var n="";for(var a in e)n+=a+": "+e[a]+"\n";alert("The updated row :\n"+n);e.nombreTienda,e.nombreProducto,e.descripcionProducto,e.precioUnidadProducto,e.cantidadProducto,e.idProducto,e.idCategoriaProducto,e.nombreCategoria;var i=t,r=o,c=e.idProducto,s={column:i,value:r,id:c};U.a.post("/updateProductA",s).then((function(e){})).catch((function(e){}));var l={column:i,value:r,id:c};U.a.post("/updateProductB",l).then((function(e){})).catch((function(e){}))}},J={mode:"checkbox",clickToSelect:!0};function $(e,t){var o={isValid:!0,notification:{type:"success",msg:"",title:""}};return e?e.length<8&&(o.isValid=!1,o.notification.type="error",o.notification.msg="Value must have 8+ characters",o.notification.title="Invalid Value"):(o.isValid=!1,o.notification.type="error",o.notification.msg="Value must be inserted",o.notification.title="Requested Value"),o}var K=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).fileSelectedHandler=function(t){console.log("el fileSelectedHandler"+t.target.files[0]),e.setState({selectedFile:t.target.files[0]})},e.fileUploadHandler=function(){var t=new FormData,o=e.state.clickedRowID;console.log("desde fileUploadHandler"+o),t.append("fileImageProducto",e.state.selectedFile),t.set("idProducto",o),U.a.post("http://andresteccorp.club/ecom_val/imagenUploadsProductos.php",t,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(t){e.setState({setUploadPorcentage:parseInt(Math.round(100*t.loaded/t.total))})}}).then((function(t){var o=t.data;console.log("auth----"+o),console.log("auth----"+o.length),o&&alert("Imagen subida Satisfactoriamente"),100==e.state.setUploadPorcentage?e.componentDidMount():alert("Problemas en Subir Imagen\nTratar de Nuevo")})).catch((function(e){}))},e.state={products:[],lastId:[],selectedFile:null,setUploadPorcentage:0,setUploadFile:"",productUpload:"",idProducto:"",clickedRowID:null},e}return Object(l.a)(o,[{key:"componentDidMount",value:function(){var e=this;fetch("/productoInfo").then((function(e){return e.json()})).then((function(t){return e.setState({products:t},(function(){return console.log("products fetched...",t)}))})),fetch("/maxIdProduct").then((function(e){return e.json()})).then((function(t){return e.setState({lastId:t},(function(){return console.log("lastId -- from table product fetched...",t)}))}))}},{key:"handleTableComplete",value:function(e){}},{key:"handleInsertedRow",value:function(e){var t=" ";for(var o in e)t+=o+": "+e[o]+" \n";alert("The new row is:\n "+t);var n="Comida"===e.nombreCategoria?1:6,a={namePrIns:e.nombreProducto,idCatePrIns:n},i={cantProducto:e.cantidadProducto,precioProducto:e.precioUnidadProducto,descrProd:e.descripcionProducto};U.a.post("/insertProductA",a).then((function(e){})).catch((function(e){})),U.a.post("insertProductB",i).then((function(e){})).catch((function(e){}))}},{key:"handleDeletedRow",value:function(e){alert("El producto a eliminar es: "+e);var t={delProduct:e};console.log(t);U.a.post("/deleteProduct",t).then((function(e){var t=e.data;console.log("desde tablepro--"+e.data.err),!0===t.err?(alert("Producto No Se Puede Eliminar \nProducto Se Encuentra En Proceso De Venta"),e.end()):!1===t.err&&(alert("Producto Eliminado"),e.end())})).catch((function(e){}))}},{key:"priceFormatter",value:function(e){return Object(n.jsxs)("p",{children:["$",e]})}},{key:"buttonImageUpload",value:function(e){var t=this;return Object(n.jsxs)("div",{children:[Object(n.jsx)("img",{style:{width:80,height:100,marginBottom:20},src:e}),Object(n.jsx)("input",{type:"file",name:"file",onChange:this.fileSelectedHandler}),Object(n.jsx)("button",{style:{width:100,height:50},onClick:function(){return t.fileUploadHandler()},children:"UploadFile"}),Object(n.jsx)("div",{style:{width:100,height:20},children:Object(n.jsx)(L,{percentage:this.state.setUploadPorcentage})})]})}},{key:"onRowClick",value:function(e){this.setState({clickedRowID:e.idProducto})}},{key:"render",value:function(){this.onRowClick=this.onRowClick.bind(this),console.log("clickedRowEstado"+this.state.clickedRowID);var e={afterTableComplete:this.handleTableComplete,afterDeleteRow:this.handleDeletedRow,afterInsertRow:this.handleInsertedRow,insertBtn:this.createCustomInsertButton,onRowClick:this.onRowClick};return Object(n.jsxs)("div",{children:[Object(n.jsx)(F,{title1:"Informacion Productos Comercio",title2:"Home",ruta:"/homeAdmin",opcion1:"Log-Out",rutaOpcion1:"",opcion2:"CompraProducto",rutaOpcion2:"/productShop",opcion3:"OfertaProducto",rutaOpcion3:"/tableOfert"}),Object(n.jsx)("h1",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"50px",marginLeft:"100px"},children:"Productos del Comercio"}),Object(n.jsxs)("h3",{style:{fontSize:25,fontFamily:"fantasy",marginTop:"25px",marginLeft:"100px"},children:[" ","No se puede eliminar mas de un producto diferente simult\xe1neamente"," ",Object(n.jsx)("br",{})," Si el producto se encuentra en proceso de Venta no se puede",Object(n.jsx)("br",{})," Si el producto se encuentra en proceso de Pedido no se puede eliminar"]}),Object(n.jsx)("div",{style:{marginTop:"70px"},children:Object(n.jsxs)(B.BootstrapTable,{data:this.state.products,striped:!0,selectRow:J,exportCSV:!0,deleteRow:!0,cellEdit:W,options:e,children:[Object(n.jsx)(B.TableHeaderColumn,{width:"150",editable:!1,dataField:"idProducto",isKey:!0,children:"Catalogo ProductoId"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",editable:!1,dataField:"nombreProducto",filter:{type:"TextFilter",delay:1e3},children:"Producto Nombre"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",filter:{type:"NumberFilter",delay:1e3},dataField:"idComercioProducto",editable:!1,children:"Codigo ProductoComercio"}),Object(n.jsx)(B.TableHeaderColumn,{editable:!1,width:"150",dataField:"nombreCategoria",children:"Producto Categoria"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"descripcionProducto",editable:{validator:$},children:"Producto Descripci\xf3n"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"cantidadProducto",children:"Producto Stock"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataFormat:this.priceFormatter,dataField:"precioUnidadProducto",children:"Producto Precio"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"imagenProducto",dataFormat:this.buttonImageUpload.bind(this),editable:!1,children:"Imagen Producto"})]})})]})}}]),o}(a.Component),_=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(s.a)(this,o),t.apply(this,arguments)}return Object(l.a)(o,[{key:"render",value:function(){return Object(n.jsx)("div",{children:Object(n.jsx)("p",{children:Object(n.jsx)("h2",{children:'Error this path does not exit "TRY AGAING"'})})})}}]),o}(a.Component),q={mode:"dbclick",blurToSave:!0,afterSaveCell:function(e,t,o){alert("Save column ".concat(t," with value ").concat(o)),console.log(t),console.log(o),console.log(e.idComercio);for(var n in e)n+": "+e[n]+"\n";alert("Updated Column with id : "+e.idComercio);var a=t,i=o,r=e.idComercio,c={column:a,value:i,id:r};U.a.post("/updateCommerceInfo",c).then((function(e){})).catch((function(e){}))}};var G=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).fileSelectedHandler=function(t){console.log("Desde FSH"+t.target.files[0]),e.setState({selectedFile:t.target.files[0]})},e.fileUploadHandler=function(){var t=new FormData,o=(e.state.setUploadPorcentage,e.state.comercio.map((function(e){return e.idComercio})));t.append("fileImageComercio",e.state.selectedFile),t.set("idComercio",o),console.log("Desde FUH"+o,t),U.a.post("http://andresteccorp.club/ecom_val/imagenUploadsComercio.php",t,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(t){e.setState({setUploadPorcentage:parseInt(Math.round(100*t.loaded/t.total))})}}).then((function(t){var o=t.data;console.log("auth----"+o),o&&alert("Imagen subida Satisfactoriamente"),100==e.state.setUploadPorcentage?e.componentDidMount():alert("Problemas en Subir Imagen\nTratar de Nuevo")})).catch((function(e){}))},e.state={comercio:[],selectedFile:null,setUploadPorcentage:0,setUploadFile:""},e}return Object(l.a)(o,[{key:"componentDidMount",value:function(){var e=this;fetch("/commerceInfo").then((function(e){return e.json()})).then((function(t){return e.setState({comercio:t},(function(){return console.log("Comercio fetched...",t)}))}))}},{key:"render",value:function(){var e=this,t={afterTableComplete:this.handleTableComplete};return Object(n.jsxs)("div",{children:[Object(n.jsx)(F,{title1:" Administrator Informacion",title2:"Home",ruta:"/homeAdmin",opcion1:"Exit",rutaOpcion1:"",opcion2:"opcion2",opcion3:"opcion3"}),Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{children:Object(n.jsx)("h3",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"30px",marginLeft:"350px"},children:"Comercio Informacion"})}),Object(n.jsxs)("div",{children:[Object(n.jsx)("ul",{children:this.state.comercio.map((function(e){return Object(n.jsx)("img",{style:{marginTop:"30px",marginBottom:"30px",marginLeft:"120px",marginRight:"50px",justifyContent:"center",alignItems:"center"},width:400,height:400,src:e.imagenComercio,alt:"Card image cap"})}))}),Object(n.jsx)("h3",{style:{width:250,height:25,borderWidth:1,margin:10},children:this.state.setUploadFile.fileName})]}),Object(n.jsx)("div",{style:{width:200,height:25,borderWidth:5,margin:10},children:Object(n.jsx)(L,{percentage:this.state.setUploadPorcentage})}),Object(n.jsxs)("div",{style:{width:150,height:150,borderWidth:1,margin:10,flexDirection:"row"},children:[Object(n.jsx)("input",{style:{display:"none"},type:"file",onChange:this.fileSelectedHandler,ref:function(t){return e.fileInput=t}}),Object(n.jsx)("button",{style:{width:200,height:55,fontSize:20,borderRadius:25,paddingHorizontal:30,paddingVertical:5,fontWeight:"500",background:"#BDC3C7"},onClick:function(){return e.fileInput.click()},children:"Pick file"}),Object(n.jsx)("button",{style:{width:200,height:55,fontSize:20,borderRadius:25,paddingHorizontal:30,paddingVertical:5,fontWeight:"500",background:"#BDC3C7"},onClick:this.fileUploadHandler,children:"Subir imagen"})]}),Object(n.jsx)("div",{style:{marginTop:"50px",marginLeft:"150px",marginRight:"150px"},children:Object(n.jsxs)(B.BootstrapTable,{data:this.state.comercio,striped:!0,cellEdit:q,options:t,children:[Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"idComercio",isKey:!0,children:"Id Comercio"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"correoComercio",children:"Correo Comercio"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"direccionComercio",children:"Direccion Comercio"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"nombreTienda",children:"Nombre Comercio"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"detalleComercio",children:"Detalle Comercio"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"telefonoComercio",children:"Telefono Comercio"})]})})]})]})}}]),o}(a.Component),Y=(o(140),o(380)),Q=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){var n;return Object(s.a)(this,o),(n=t.call(this,e)).toggle=n.toggle.bind(Object(p.a)(n)),n.state={isOpen:!1},n}return Object(l.a)(o,[{key:"toggle",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return Object(n.jsx)("div",{children:Object(n.jsxs)(m.a,{color:"light",light:!0,expand:"md",children:[Object(n.jsx)(f.a,{children:this.props.title}),Object(n.jsx)(O.a,{onClick:this.toggle}),Object(n.jsx)(x.a,{isOpen:this.state.isOpen,navbar:!0,children:Object(n.jsxs)(g.a,{className:"ml-auto",navbar:!0,children:[Object(n.jsx)(v.a,{children:Object(n.jsx)(C.a,{href:"/homeAdmin/",children:"Home"})}),Object(n.jsx)(v.a,{})]})})]})})}}]),o}(a.Component),X=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).state={facturaStore:[],clienteComercioInfo:[]},e}return Object(l.a)(o,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){return Object(n.jsxs)("div",{class:"container",children:[Object(n.jsx)("div",{class:"row",children:Object(n.jsxs)("div",{class:"col-xs-12",children:[Object(n.jsx)("div",{class:"text-center",children:Object(n.jsx)(Q,{title:"Client-Commerce Info Invoice"})}),Object(n.jsx)("hr",{}),Object(n.jsxs)("div",{children:[Object(n.jsx)("h3",{children:Object(n.jsx)("strong",{style:{fontSize:40,fontFamily:"fantasy"},children:"Informacion de los clientes :"})}),this.state.clienteComercioInfo.map((function(e){return Object(n.jsx)(Y.a,{children:Object(n.jsxs)(Y.a.Item,{children:[e.idUsuario," -- ",e.nombreUsuario,e.apellidoUsuario," -- ",e.telefonoUsuario," --",e.correoUsuario," -- ",e.direccionUsuario]})})}))]})]})}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)("div",{className:"row",children:Object(n.jsx)("div",{className:"col-md-12",children:Object(n.jsxs)("div",{className:"panel panel-default",children:[Object(n.jsx)("div",{className:"panel-heading",children:Object(n.jsx)("h2",{className:"text-center",children:Object(n.jsx)("strong",{style:{fontSize:40,fontFamily:"fantasy"},children:"Invoice Commercio Summario"})})}),Object(n.jsx)("div",{className:"panel-body",children:Object(n.jsx)("div",{className:"table-responsive",children:Object(n.jsxs)("table",{class:"table table-condensed",children:[Object(n.jsx)("thead",{children:Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Id Invoice"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Invoice Fecha"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Nombre Cliente"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Nombre Item"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Precio Item"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Cantidad Item"})}),Object(n.jsx)("td",{className:"text-right",children:Object(n.jsx)("strong",{children:"Total"})})]})}),this.state.facturaStore.map((function(e){return Object(n.jsx)("tbody",{children:Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:"text-left",children:e.idPedidoFactura}),Object(n.jsx)("td",{className:"text-center",children:e.fecha}),Object(n.jsxs)("td",{className:"text-center",children:[e.nombreUsuario," ",e.apellidoUsuario," "]}),Object(n.jsx)("td",{className:"text-center",children:e.nombreProducto}),Object(n.jsxs)("td",{className:"text-center",children:["$ ",e.precioUnidadProducto]}),Object(n.jsx)("td",{className:"text-center",children:e.cantidadProducto}),Object(n.jsxs)("td",{className:"text-right",children:[" ","$"," ",e.precioUnidadProducto*e.cantidadProducto]})]})})}))]})})})]})})})]})}}]),o}(a.Component),Z=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).resetForm=function(){e.setState({nombre:"",correo:"",direccion:"",telephone:"",detalle:""})},e.state={nombre:"",direccion:"",telephone:"",detalle:"",correo:"",idCom:null},e.handleChange=e.handleChange.bind(Object(p.a)(e)),e.handleSubmit=e.handleSubmit.bind(Object(p.a)(e)),e}return Object(l.a)(o,[{key:"handleChange",value:function(e){var t=e.target,o=t.name,n=t.value;this.setState(Object(b.a)({},o,n))}},{key:"handleSubmit",value:function(e){var t=this;if(e.preventDefault(),""===this.state.nombre||""===this.state.correo||""===this.state.correo||""===this.state.direccion||""===this.state.telephone||""===this.state.detalle)alert("Porfavor No Dejar Vacios \nNingun Campo Del Formato"),this.resetForm();else{var o={nombre:this.state.nombre,correo:this.state.correo,direccion:this.state.direccion,telephone:this.state.telephone,detalle:this.state.detalle};U.a.post("/registerStoreA",o).then((function(e){t.state.nombre;console.log("Desdes axios Registar Tienda -- ",e)})).catch((function(e){})),alert("Comercio Registrado"),this.resetForm()}}},{key:"render",value:function(){return console.log("El Primer estado del idCom--",this.state.idCom),Object(n.jsxs)("form",{method:"POST",onSubmit:this.handleSubmit,children:[Object(n.jsx)(F,{title1:" Registro Informacion Comercio",title2:"Home",ruta:"/homeAdmin",opcion1:"Exit",rutaOpcion1:"",opcion2:"opcion2",opcion3:"opcion3"}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsx)("h1",{style:{fontSize:"50px",marginTop:"25px",fontFamily:"fantasy"},children:"Registro Comercio"}),Object(n.jsx)("p",{children:"Porfavor llenar todos los campos para el registro de su comercio"}),Object(n.jsx)("hr",{}),Object(n.jsx)("label",{for:"nombre",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Nombre Comercio"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterNombre",name:"nombre",value:this.state.nombre,onChange:this.handleChange}),Object(n.jsx)("label",{for:"Direccion",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Direcci\xf3n Comercio"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterDireccion",name:"direccion",value:this.state.direccion,onChange:this.handleChange}),Object(n.jsx)("label",{for:"Telephone Comercio",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Telefono"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterTelefono",name:"telephone",value:this.state.telephone,onChange:this.handleChange}),Object(n.jsx)("label",{for:"email",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Correo Comercio"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterCorreo",name:"correo",value:this.state.correo,onChange:this.handleChange}),Object(n.jsx)("label",{for:"Detalle Comercio",children:Object(n.jsx)("b",{style:{fontSize:"35px",fontFamily:"fantasy"},children:"Detalle Comercio"})}),Object(n.jsx)("input",{type:"text",placeholder:"EnterDetalleComercio",name:"detalle",value:this.state.detalle,onChange:this.handleChange}),Object(n.jsx)("hr",{}),Object(n.jsx)("p",{children:"Gracias por crear registar tu comercio en nuestra aplicacion"}),Object(n.jsx)("button",{style:{fontSize:"25px",fontFamily:"fantasy"},type:"submit",className:"registerbtn",value:"submit",children:"Registrar Comercio"}),Object(n.jsx)("button",{style:{fontSize:"25px",fontFamily:"fantasy"},type:"button",className:"cancelbtn",onClick:this.resetForm,children:"Cancelar"})]}),Object(n.jsx)("div",{className:"container signin",children:Object(n.jsxs)("p",{children:["Si cuentas con un comercio ya registrado, por favor ir a :",Object(n.jsx)(u.b,{style:{fontSize:"25px",fontFamily:"fantasy"},to:"/homeAdmin",children:"Home"})]})})]})}}]),o}(a.Component),ee=o(148),te=o(381),oe=o(379),ne=(o(342),[{label:"Comida",value:"1"},{label:"UtenciliosEscolares",value:"2"},{label:"UtenciliosElectronicos",value:"3"},{label:"Vestuario",value:"4"},{label:"Calzado",value:"5"},{label:"Bebida",value:"6"},{label:"Productos para el hogar",value:"7"},{label:"Juguetes",value:"8"}]),ae={mode:"radio",clickToSelect:!0},ie={mode:"dbclick",blurToSave:!0},re=["Comida","UtenciliosEscolares","UtenciliosElectronicos","Vestuario","Calzado","Bebida","Productos para el hogar","Juguetes"],ce=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){var n;return Object(s.a)(this,o),(n=t.call(this,e)).handleChange=function(e){n.setState({selectedOption:e}),console.log("Option selected:",e);var t=e.label,o=e.value;console.log("Option a label:",t," // ","Option b value or id:",o);var a={label:t,id:o};U.a.post("/categoriaProducto",a).then((function(e){console.log("desde handle",e),n.setState({listaProductosCategoria:e.data})})).catch((function(e){}))},n.handleBuy=function(e){alert("Deseas realizar la compra de estos Productos ? "),e.preventDefault();var t=n.state.optionsChecked;if(n.state.optionsChecked.length>0){console.log("desde If handle buy",t);var o={productsB:t};U.a.post("/buyProduct",o).then((function(e){var t=e.data;console.log("Respuesta de axios"+t.lenght)})).catch((function(e){})),alert("Compra  Realizada\nPorfavor Ingrese en la pesta\xf1a Options a InfoProducto para continuar el proceso.."),n.setState({optionsChecked:[],listaProductosCategoria:[]})}else alert("Compra  No Realizada\nPorfavor inicie de nuevo el proceso.."),n.setState({optionsChecked:[],listaProductosCategoria:[]})},n.fileSelectedHandler=function(e){console.log("el fileSelectedHandler"+e.target.files[0]),n.setState({selectedFile:e.target.files[0]})},n.fileUploadHandler=function(){var e=new FormData,t=n.state.idProducto.map((function(e){return e.idUltimo+1}));console.log("desde fileUploadHandler"+t),e.append("fileImageProducto",n.state.selectedFile),e.set("idProducto",t),U.a.post("http://andresteccorp.club/TesisAndres/imagenUploadsProductos.php",e,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){n.setState({setUploadPorcentage:parseInt(Math.round(100*e.loaded/e.total))})}}).then((function(e){console.log("Respuesta del Servidor Form"+e.data)})).catch((function(e){}))},n.state={selectedOption:" ",listaProductosCategoria:[],optionsChecked:[],evento:[],selectedFile:null,setUploadPorcentage:0,setUploadFile:"",productUpload:"",idProducto:""},n.handleBuy=n.handleBuy.bind(Object(p.a)(n)),n}return Object(l.a)(o,[{key:"componentDidMount",value:function(){var e=this;fetch("/maxIdProduct").then((function(e){return e.json()})).then((function(t){return e.setState({idProducto:t},(function(){return console.log("maxIdProduct fetched...",t)}))}))}},{key:"handleInsertedRow",value:function(e,t,o){var n=" ";for(var a in e)n+=a+": "+e[a]+" \n";alert("El Nuevo Producto En Catalogo de la Plataforma :\n"+n);var i={idCategoriaProducto:"Comida"===e.idCategoriaProducto?1:"UtenciliosEscolares"===e.idCategoriaProducto?2:"UtenciliosElectronicos"===e.idCategoriaProducto?3:"Vestuario"===e.idCategoriaProducto?4:"Calzado"===e.idCategoriaProducto?5:"Bebida"===e.idCategoriaProducto?6:"Productos para el hogar"===e.idCategoriaProducto?7:8,nombreProducto:e.nombreProducto};console.log("Productos enviados al server"+i),U.a.post("/storeProductUpload",i).then((function(e){e&&console.log("Respuesta del Servidor Form"+e.data),console.log("No Respuesta del Servidor Form"+e.data)})).catch((function(e){}))}},{key:"changeEvent",value:function(e){var t=this.state.optionsChecked,o=e.target.value;e.target.name;if(!0===e.target.checked)t.push(o),this.setState({optionsChecked:t});else{var n=t.indexOf(o);t.splice(n,1),this.setState({optionsChecked:t})}}},{key:"buttonImageUpload",value:function(){var e=this;return Object(n.jsxs)("div",{className:"d-flex flex-column",children:[Object(n.jsx)("input",{type:"file",name:"file",onChange:this.fileSelectedHandler}),Object(n.jsx)("button",{onClick:function(){return e.fileUploadHandler()},children:"UploadFile"}),Object(n.jsx)("div",{style:{width:150,height:25,borderWidth:1,margin:10},children:Object(n.jsx)(L,{percentage:this.state.setUploadPorcentage})})]})}},{key:"render",value:function(){var e=this,t=this.state.selectedOption,o={afterTableComplete:this.handleTableComplete,afterDeleteRow:this.handleDeletedRow,afterInsertRow:this.handleInsertedRow};return Object(n.jsxs)("div",{className:"app",children:[Object(n.jsx)(F,{title1:"Informacion / Compra de Productos ",title2:"Home",ruta:"/homeAdmin",opcion1:"InfoProducto",rutaOpcion1:"/tableProd",opcion2:"opcion2",opcion3:"opcion3"}),Object(n.jsx)("div",{style:{fontSize:35,fontFamily:"fantasy",alignContent:"center",marginTop:"20px"},className:"container",children:Object(n.jsx)(ee.a,{value:t,options:ne,onChange:this.handleChange})}),Object(n.jsxs)("div",{children:[Object(n.jsx)("label",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"50px",marginLeft:"100px"},children:"Articulos Disponibles"}),Object(n.jsx)("br",{}),Object(n.jsxs)("label",{style:{fontSize:20,fontFamily:"fantasy",marginBottom:"20",marginLeft:"100px"},children:["Porfavor Escoger los Articulos del Catalogo para la Compra. ",Object(n.jsx)("br",{}),"Cerciorarse No comprar Producto ya Existente en tu Comercio"]}),Object(n.jsx)("br",{}),Object(n.jsx)("div",{class:"grid-container",children:this.state.listaProductosCategoria.map((function(t){return Object(n.jsxs)("div",{class:"styleProduct",children:[Object(n.jsx)(te.a,{name:t.nombreProducto,value:t.idProducto,checked:t.checked,onChange:e.changeEvent.bind(e)}),t.nombreProducto]})}))})]}),Object(n.jsxs)("label",{style:{fontFamily:"fantasy",fontSize:35,marginLeft:"100px"},children:["ID Productos en proceso de compra",JSON.stringify(this.state.optionsChecked)]}),Object(n.jsx)("div",{style:{fontFamily:"fantasy",fontSize:45,height:50,width:500,marginLeft:"100px"},children:Object(n.jsx)(oe.a,{onClick:this.handleBuy.bind(this),size:"large",variant:"contained",children:"COMPRA PRODUCTO"})}),Object(n.jsx)("label",{style:{fontSize:45,fontFamily:"fantasy",marginTop:"60px",marginLeft:"100px"},children:"Subir al Catalogo Producto de tu Comercio"}),Object(n.jsx)("div",{style:{marginTop:"20px",marginLeft:"100px",marginRight:"150px"},children:Object(n.jsxs)(B.BootstrapTable,{striped:!0,hover:!0,insertRow:!0,selectRow:ae,cellEdit:ie,options:o,children:[Object(n.jsx)(B.TableHeaderColumn,{width:"140",isKey:!0,hidden:!0,dataField:"id",autoValue:!0,children:"IdProducto"}),Object(n.jsx)(B.TableHeaderColumn,{width:"140",dataField:"idCategoriaProducto",editable:{type:"select",options:{values:re}},children:"Id Categoria Producto"}),Object(n.jsx)(B.TableHeaderColumn,{width:"140",dataField:"nombreProducto",children:"Nombre Producto"}),Object(n.jsx)(B.TableHeaderColumn,{hiddenOnInsert:!0,width:"150",dataField:"imagenProducto",dataFormat:this.buttonImageUpload.bind(this),children:"Imagen Producto"})]})}),Object(n.jsx)("div",{})]})}}]),o}(a.Component),se={mode:"radio",clickToSelect:!0},le={mode:"dbclick",blurToSave:!0,afterSaveCell:function(e,t,o){alert("Save column ".concat(t," with value ").concat(o));var n="";for(var a in e)n+=a+": "+e[a]+"\n";alert("The updated row :\n"+n);var i="Bono"===e.tipoOferta?1:"Descuento"===e.tipoOferta?2:"Promo2*1"===e.tipoOferta?3:4,r={Column:"tipoOferta"===t?"codigoOferta":"descuento",Value:"descuento"===t?o:"tipoOferta"===t?i:"",TipoOfertaId:i,Codigo:e.idComercioProducto};console.log(r);U.a.post("/updateOferta",r).then((function(e){})).catch((function(e){}))}};var de=["","Bono","Descuento","Promo2*1","Promo3*1"];var he=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){var e;return Object(s.a)(this,o),(e=t.call(this)).handleInsertedRow=function(t){var o=" ";for(var n in t)o+=n+": "+t[n]+" \n";alert("La nueva Oferta Es:\n "+o);var a="Bono"===t.tipoOferta?1:"Descuento"===t.tipoOferta?2:"Promo2*1"===t.tipoOferta?3:4,i={CodigoProductoComercio:t.idComercioProducto,TipoOfertaId:a,DescuentoOferta:t.descuento};console.log(i),U.a.post("/insertOfert",i).then((function(t){var o=t.data;console.log(t.data.oferta),console.log(o),!0===o.oferta?(alert("Oferta Establecida Satisfactoriamente"),e.componentDidMount()):alert("Oferta No Establecida\nPorfavor revisar el codigo Comercio-Producto")}))},e.state={ofertInfo:[]},e}return Object(l.a)(o,[{key:"componentDidMount",value:function(){var e=this;fetch("/ofertInfo").then((function(e){return e.json()})).then((function(t){return e.setState({ofertInfo:t},(function(){return console.log("ofertInfo fetched...",t)}))}))}},{key:"handleDeletedRow",value:function(e){alert("La Oferta a eliminar es del Commercio/ProductoId : "+e);var t={idComercioProducto:e};console.log(t);U.a.post("/deleteOfert",t).then((function(e){})).catch((function(e){}))}},{key:"render",value:function(){var e;console.log("el estado"+this.state.ofertInfo);var t={afterTableComplete:this.handleTableComplete,afterDeleteRow:this.handleDeletedRow,afterInsertRow:this.handleInsertedRow};return Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{children:Object(n.jsx)(F,{title1:"Informacion Ofertas Comercio",title2:"Home",ruta:"/homeAdmin",opcion1:"Log-Out",rutaOpcion1:"",opcion2:"InfoProducto",rutaOpcion2:"/tableProd",opcion3:"opcion3"})}),Object(n.jsx)("div",{children:Object(n.jsx)("h1",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"30px",marginLeft:"100px"},children:"Ofertas Producto"})}),Object(n.jsx)("div",{style:{marginTop:"50px",marginLeft:"150px",marginRight:"150px"},children:Object(n.jsxs)(B.BootstrapTable,{data:this.state.ofertInfo,striped:!0,hover:!0,condensed:!0,insertRow:!0,selectRow:se,exportCSV:!0,deleteRow:!0,cellEdit:le,options:t,children:[Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"idComercioProducto",isKey:!0,filter:{type:"NumberFilter",delay:1e3},children:"Codigo ProductoComercio"}),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"nombreProducto",hiddenOnInsert:!0,editable:!1,children:"Nombre Producto"}),Object(n.jsx)(B.TableHeaderColumn,(e={width:"150",editable:!1,dataField:"tipoOferta"},Object(b.a)(e,"editable",{type:"select",options:{values:de}}),Object(b.a)(e,"children","Tipo Oferta Producto"),e)),Object(n.jsx)(B.TableHeaderColumn,{width:"150",dataField:"descuento",editable:{},children:"Compensacion %"})]})})]})}}]),o}(a.Component),ue=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){var n;return Object(s.a)(this,o),(n=t.call(this,e)).state={title:"Please select your title",ordersInProgres:[],idp:[]},n}return Object(l.a)(o,[{key:"componentDidMount",value:function(){var e=this;fetch("/pedidosStore").then((function(e){return e.json()})).then((function(t){return e.setState({ordersInProgres:t},(function(){return console.log("ordersInProgres fetched...",t)}))}))}},{key:"renderTableHeader",value:function(){return["id-Pedido","fecha","Hora","Estado-Pedido","Info-Pedido"].map((function(e,t){return Object(n.jsx)("th",{children:e.toUpperCase()},t)}))}},{key:"renderTableData",value:function(){var e=this;return this.state.ordersInProgres.map((function(t,o){var a=t.idPedido,i=t.fechaPedido,r=t.horaPedido,c=t.pedidoEstado;return Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{children:a}),Object(n.jsx)("td",{children:i}),Object(n.jsx)("td",{children:r}),Object(n.jsx)("td",{children:1===c?"EnProceso":"Cancelado"}),Object(n.jsxs)("td",{children:[Object(n.jsx)(u.b,{to:{pathname:"/deliveryInCurseInfo",idP:t.idPedido},children:Object(n.jsx)("h5",{children:" Informacion del Pedido"})}),Object(n.jsx)(u.b,{children:Object(n.jsx)("h5",{children:"Pagos"})}),Object(n.jsx)("button",{style:je.button,onClick:e.eliminarP.bind(e,t.idPedido),children:"Eliminar Pedido"})]})]},a)}))}},{key:"eliminarP",value:function(e){var t=this,o={idPedido:e};U.a.post("/eliminarPedido",o).then((function(e){e&&(alert("Pedido Eliminado"),t.componentDidMount())})).catch((function(e){}))}},{key:"render",value:function(){return console.log(this.state.ordersInProgres),Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{class:"text-center",children:Object(n.jsx)(Q,{title:"Pedidos En Proceso"})}),Object(n.jsxs)("div",{children:[Object(n.jsx)("div",{children:Object(n.jsx)("h2",{style:{fontSize:60,fontFamily:"fantasy",marginTop:"30px",marginLeft:"100px"},children:"Pedido En Linea Informacion"})}),Object(n.jsx)("div",{style:{marginTop:"50px",marginLeft:"150px",marginRight:"150px"},children:Object(n.jsx)("div",{style:je.table,children:Object(n.jsx)("table",{class:"table table-striped",id:"pedidos",children:Object(n.jsxs)("tbody",{children:[Object(n.jsx)("tr",{children:this.renderTableHeader()}),this.renderTableData()]})})})})]})]})}}]),o}(a.Component),je={button:{borderWidth:20,padding:10,borderColor:"black",backgroundColor:"#BFBFBF"},table:{padding:5}},be=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(e){var n;return Object(s.a)(this,o),(n=t.call(this,e)).totalQuantity=function(){return n.state.prueba.reduce((function(e,t){return e+t.CantidadCompra}),0)},n.totalPrice=function(){return n.state.productoInfo.reduce((function(e,t){return e+t.cantidadCompra*t.precioUnidad}),0)},n.toggle=n.toggle.bind(Object(p.a)(n)),n.state={idPedido:n.props.location.idP,userInfo:[],productoInfo:[],idProducto:[],dropdownOpen:!1},n}return Object(l.a)(o,[{key:"toggle",value:function(){this.setState((function(e){return{dropdownOpen:!e.dropdownOpen}}))}},{key:"componentDidMount",value:function(){var e=this,t={idPed:this.state.idPedido};U.a.post("/itemInfoPedidoProducto",t).then((function(e){})).catch((function(e){}));U.a.post("/itemInfoPedidoProducto",t).then((function(t){var o=t.data;console.log("Desde Axios PedidoInfo",o),e.setState({productoInfo:o})})).catch((function(e){}));U.a.post("/userInfoPedidoProducto",t).then((function(t){var o=t.data;console.log("Desde Axios userInfo",o),e.setState({userInfo:o})})).catch((function(e){}))}},{key:"render",value:function(){return console.log("pedidoInfo",this.state.idPedido),Object(n.jsxs)("div",{class:"container",children:[Object(n.jsx)("div",{class:"row",children:Object(n.jsxs)("div",{class:"col-xs-12",children:[Object(n.jsx)("div",{class:"text-center",children:Object(n.jsx)(F,{title1:"Pedidos En Proceso Informaci\xf3n",opcion1:"Home",rutaOpcion1:"/homeAdmin",opcion2:"Pedidos",rutaOpcion2:"/deliveryInCurse"})}),Object(n.jsx)("hr",{}),Object(n.jsxs)("div",{children:[Object(n.jsx)("h3",{children:Object(n.jsx)("strong",{style:{fontSize:40,fontFamily:"fantasy"},children:"Pedido En Proceso Cliente :"})}),this.state.userInfo.map((function(e){return Object(n.jsx)(Y.a,{children:Object(n.jsxs)(Y.a.Item,{children:[e.idUsuario," -- ",e.nombreUsuario,e.apellidoUsuario," -- ",e.telefonoUsuario," --",e.correoUsuario," -- ",e.direccionUsuario]})})}))]})]})}),Object(n.jsx)("br",{}),Object(n.jsx)("br",{}),Object(n.jsx)("div",{className:"row",children:Object(n.jsx)("div",{className:"col-md-12",children:Object(n.jsxs)("div",{className:"panel panel-default",children:[Object(n.jsx)("div",{className:"panel-heading",children:Object(n.jsx)("h2",{className:"text-center",children:Object(n.jsx)("strong",{style:{fontSize:40,fontFamily:"fantasy"},children:"Productos En Proceso del Pedido"})})}),Object(n.jsx)("div",{className:"panel-body",children:Object(n.jsx)("div",{className:"table-responsive",children:Object(n.jsxs)("table",{class:"table table-condensed",children:[Object(n.jsx)("thead",{children:Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Id Pedido"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Id Producto App"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Producto"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"CantidadStock"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"CantidadCompra"})}),Object(n.jsx)("td",{className:"text-center",children:Object(n.jsx)("strong",{children:"Precio"})}),Object(n.jsx)("td",{className:"text-right",children:Object(n.jsx)("strong",{children:"Total * Unidad"})})]})}),this.state.productoInfo.map((function(e){return Object(n.jsx)("tbody",{children:Object(n.jsxs)("tr",{children:[Object(n.jsx)("td",{className:"text-left",children:e.idPedido}),Object(n.jsx)("td",{className:"text-left",children:e.idComercioProducto}),Object(n.jsx)("td",{className:"text-center",children:e.nombreProducto}),Object(n.jsx)("td",{className:"text-center",children:e.cantidadProducto}),Object(n.jsx)("td",{className:"text-center",children:e.cantidadCompra}),Object(n.jsxs)("td",{className:"text-center",children:["$ ",e.precioUnidad]}),Object(n.jsx)("td",{className:"text-right",children:e.precioUnidad*e.cantidadCompra})]})})}))]})})})]})})}),Object(n.jsx)("h2",{children:Object(n.jsxs)("strong",{style:{fontSize:30,fontFamily:"fantasy"},children:["Total Pedido $ ",this.totalPrice()]})})]})}}]),o}(a.Component),pe=function(e){Object(d.a)(o,e);var t=Object(h.a)(o);function o(){return Object(s.a)(this,o),t.apply(this,arguments)}return Object(l.a)(o,[{key:"render",value:function(){return Object(n.jsx)(u.a,{children:Object(n.jsxs)(j.c,{children:[Object(n.jsx)(j.a,{path:"/",component:E,exact:!0}),Object(n.jsx)(j.a,{path:"/register",component:A}),Object(n.jsx)(j.a,{path:"/homeAdmin",component:H}),Object(n.jsx)(j.a,{path:"/registerStore",component:Z}),Object(n.jsx)(j.a,{path:"/storeInfo",component:G}),Object(n.jsx)(j.a,{path:"/userProfile",component:V}),Object(n.jsx)(j.a,{path:"/tableProd",component:K}),Object(n.jsx)(j.a,{path:"/tableOfert",component:he}),Object(n.jsx)(j.a,{path:"/productShop",component:ce}),Object(n.jsx)(j.a,{path:"/clientInfoInvoice",component:X}),Object(n.jsx)(j.a,{path:"/deliveryInCurse",exact:!0,component:ue}),Object(n.jsx)(j.a,{path:"/deliveryInCurse/:idP",component:be}),Object(n.jsx)(j.a,{path:"/deliveryInCurseInfo",component:be}),Object(n.jsx)(j.a,{path:"/charts",component:R}),Object(n.jsx)(j.a,{component:_})]})})}}]),o}(a.Component),me=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function fe(e){navigator.serviceWorker.register(e).then((function(e){e.onupdatefound=function(){var t=e.installing;t.onstatechange=function(){"installed"===t.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}})).catch((function(e){console.error("Error during service worker registration:",e)}))}c.a.render(Object(n.jsx)(pe,{}),document.getElementById("root")),function(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",(function(){var e="".concat("","/service-worker.js");me?function(e){fetch(e).then((function(t){404===t.status||-1===t.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then((function(e){e.unregister().then((function(){window.location.reload()}))})):fe(e)})).catch((function(){console.log("No internet connection found. App is running in offline mode.")}))}(e):fe(e)}))}}()}},[[354,1,2]]]);
  //# sourceMappingURL=main.5d5235b5.chunk.js.map