text: (this.webpackJsonpcotizador=this.webpackJsonpcotizador||[]).push([[0],{11:function(e,n,a){e.exports=a(19)},16:function(e,n,a){},17:function(e,n,a){},18:function(e,n,a){},19:function(e,n,a){"use strict";a.r(n);var t=a(0),r=a.n(t),o=a(8),c=a.n(o),l=(a(16),a(3)),i=a(1),u=a(2),m=(a(17),a(4)),s=a(5);function d(){var e=Object(i.a)(["\n\tpadding: 10px;\n\tcolor: white;\n\tbackground-color: red;\n\ttext-align: center;\n\tmargin-bottom: 10px;\n"]);return d=function(){return e},e}function f(){var e=Object(i.a)(["\n\tdisplay: block;\n  margin: auto;\n  background-color: #00838f;\n\tfont-size: 16px;\n\twidth: 150px;\n\tpadding: 1rem;\n\tcolor: #fff;\n\ttext-transform: uppercase;\n\tfont-weight: bold;\n\tborder: none;\n\ttransition: background-color 0.5s ease-out;\n\t&:hover {\n\t\tcursor: pointer;\n\t\tbackground-color: #26c6da;\n\t}\n"]);return f=function(){return e},e}function p(){var e=Object(i.a)(["\n\tmargin: 0 1rem;\n"]);return p=function(){return e},e}function v(){var e=Object(i.a)(["\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 1rem;\n\tborder: 1px solid #e1e1e1;\n\t-webkit-appearance: none;\n"]);return v=function(){return e},e}function E(){var e=Object(i.a)(["\n\tflex: 0 0 100px;\n"]);return E=function(){return e},e}function b(){var e=Object(i.a)(["\n\tdisplay: flex;\n\tmargin-bottom: 1rem;\n\talign-items: center;\n"]);return b=function(){return e},e}var g=u.a.div(b()),h=u.a.label(E()),k=u.a.select(v()),j=u.a.input(p()),O=u.a.button(f()),x=u.a.div(d()),w=function(e){var n=e.setResumen,a=e.setCargando,o=Object(t.useState)({marca:"",year:"",plan:""}),c=Object(l.a)(o,2),i=c[0],u=c[1],d=Object(t.useState)(!1),f=Object(l.a)(d,2),p=f[0],v=f[1],E=i.marca,b=i.year,w=i.plan,y=function(e){u(Object(s.a)(Object(s.a)({},i),{},Object(m.a)({},e.target.name,e.target.value)))};return r.a.createElement("form",{onSubmit:function(e){if(e.preventDefault(),""!==E.trim()&&""!==b.trim()&&""!==w.trim()){v(!1);var t=2e3,r=function(e){return(new Date).getFullYear()-e}(b);t-=3*r*t/100,t=function(e){var n;switch(e){case"asiatico":n=1.05;break;case"americano":n=1.15;break;case"europeo":n=1.3}return n}(E)*t,t=parseFloat(function(e){return"basico"===e?1.2:1.5}(w)*t).toFixed(2),a(!0),setTimeout((function(){a(!1),n({cotizacion:Number(t),datos:i})}),2e3)}else v(!0)}},p?r.a.createElement(x,null,"Los campos son obligatorios"):null,r.a.createElement(g,null,r.a.createElement(h,null,"Marca:"),r.a.createElement(k,{name:"marca",value:E,onChange:y},r.a.createElement("option",{value:""},"-- Seleccione --"),r.a.createElement("option",{value:"asiatico"},"Asiatico"),r.a.createElement("option",{value:"americano"},"Americano"),r.a.createElement("option",{value:"europeo"},"Europeo"))),r.a.createElement(g,null,r.a.createElement(h,null,"A\xf1o:"),r.a.createElement(k,{name:"year",value:b,onChange:y},r.a.createElement("option",{value:""},"-- Seleccione --"),r.a.createElement("option",{value:"2021"},"2021"),r.a.createElement("option",{value:"2020"},"2020"),r.a.createElement("option",{value:"2019"},"2019"),r.a.createElement("option",{value:"2018"},"2018"),r.a.createElement("option",{value:"2017"},"2017"),r.a.createElement("option",{value:"2016"},"2016"),r.a.createElement("option",{value:"2015"},"2015"),r.a.createElement("option",{value:"2014"},"2014"),r.a.createElement("option",{value:"2013"},"2013"),r.a.createElement("option",{value:"2012"},"2012"))),r.a.createElement(g,null,r.a.createElement(h,null,"Plan"),r.a.createElement("div",{className:"inputGroup"},r.a.createElement(j,{type:"radio",name:"plan",value:"basico",checked:"basico"===w,onChange:y})," ","B\xe1sico",r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(j,{type:"radio",name:"plan",value:"completo",checked:"completo"===w,onChange:y})," ","Completo")),r.a.createElement(O,{type:"submit"},"Cotizar"))};function y(){var e=Object(i.a)(["\n  font-size: 2rem;\n  margin: 0;\n  font-family: 'Slabo 27px', serif;\n  text-align: center;\n"]);return y=function(){return e},e}function z(){var e=Object(i.a)(["\n  background-color: #26c6da;\n  padding: 10px;\n  font-weight: bold;\n  color: #fff;\n"]);return z=function(){return e},e}var N=u.a.header(z()),_=u.a.h1(y()),C=function(e){var n=e.titulo;return r.a.createElement(N,null,r.a.createElement(_,null," ",n," "))};a(7);function S(){var e=Object(i.a)(["\n  padding: 1rem;\n  text-align: center;\n  background-color: #6be3f2;\n  border: 1px solid #00838f;\n  color: #00838f;\n  margin-top: 1rem;\n"]);return S=function(){return e},e}var A=u.a.div(S()),F=function(e){var n=e.datos,a=n.marca,t=n.year,o=n.plan;return""===a||""===t||""===o?null:r.a.createElement(A,{className:"animate__animated animate__fadeInUp"},r.a.createElement("h3",null,"Resumen de cotizaci\xf3n"),r.a.createElement("ul",null,r.a.createElement("li",null,"Marca:  ",a),r.a.createElement("li",null,"A\xf1o:  ",t),r.a.createElement("li",null,"Plan:  ",o)))};function I(){var e=Object(i.a)(["\n  text-align: center;\n  background-color: #00838f;\n  padding: 2rem;\n  color: #fff;\n  text-transform: uppercase;\n"]);return I=function(){return e},e}function B(){var e=Object(i.a)(["\n  text-align: center;\n  background-color: #f2f2f2;\n  padding: 2rem;\n  color: #a2a2a2;\n"]);return B=function(){return e},e}var M=u.a.h4(B()),R=u.a.h4(I()),U=function(e){var n=e.cotizacion;return 0===n?r.a.createElement(M,{className:"animate__animated animate__fadeInUp"},"Elige una marca, a\xf1o y plan para comenzar."):r.a.createElement(R,{className:"animate__animated animate__fadeInUp"},"El total es: ",n)},D=(a(18),function(){return r.a.createElement("div",{className:"sk-chase"},r.a.createElement("div",{className:"sk-chase-dot"}),r.a.createElement("div",{className:"sk-chase-dot"}),r.a.createElement("div",{className:"sk-chase-dot"}),r.a.createElement("div",{className:"sk-chase-dot"}),r.a.createElement("div",{className:"sk-chase-dot"}),r.a.createElement("div",{className:"sk-chase-dot"}))});function J(){var e=Object(i.a)(["\n  background-color: #fff;\n  padding: 3rem;\n"]);return J=function(){return e},e}function P(){var e=Object(i.a)(["\n  max-width: 90%;\n  min-width: 60%;\n  margin: 30px auto;\n"]);return P=function(){return e},e}var W=u.a.div(P()),G=u.a.div(J());var L=function(){var e=Object(t.useState)({cotizacion:0,datos:{marca:"",year:"",plan:""}}),n=Object(l.a)(e,2),a=n[0],o=n[1],c=Object(t.useState)(!1),i=Object(l.a)(c,2),u=i[0],m=i[1],s=a.cotizacion,d=a.datos;return r.a.createElement(W,null,r.a.createElement(C,{titulo:"Cotizador de seguros"}),r.a.createElement(G,null,r.a.createElement(w,{setResumen:o,setCargando:m}),u?r.a.createElement(D,null):null,u?null:r.a.createElement(t.Fragment,null,r.a.createElement(F,{datos:d}),r.a.createElement(U,{cotizacion:s}))))};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}$/));c.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(L,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[11,1,2]]]);
  //# sourceMappingURL=main.b43c5f94.chunk.js.map