PageSourceSearch

https://repuestos-d6c3d.firebaseapp.com/_nuxt/Cf2FRSNB.js

js repuestos-d6c3d.firebaseapp.com collected 2026-10-03 08:14:05 UTC 10,925 bytes, 8 lines download raw bytes

1import{c as r,o as a,b as e,a9 as R,u as T,s as D,r as b,m as s,a as u,h as z,i as g,_ as I,F as U,x as W,e as f,t as l,f as w,v as k}from"#entry";import{_ as H}from"./WWy_r-EY.js";import{_ as F}from"./DtVRw9o8.js";import{u as O}from"./D-GNixRz.js";import{r as q}from"./C0aY1EV-.js";import"./BsqTxom4.js";function G(C,i){return a(),r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14"})])}function J(C,i){return a(),r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})])}const K={class:"min-h-screen bg-gray-50"},Q={class:"max-w-6xl mx-auto px-4 py-8"},X={key:0,class:"bg-white rounded-lg shadow-md p-12 text-center"},Y={key:1,class:"grid grid-cols-1 lg:grid-cols-3 gap-8"},Z={class:"lg:col-span-2 space-y-4"},ee={class:"flex gap-4"},te={class:"w-24 h-24 bg-gray-100 rounded-lg flex items-center justify-center flex-shrink-0"},oe=["src","alt"],se={key:1,class:"w-16 h-16 flex items-center justify-center bg-gray-100 rounded"},re={class:"flex-1"},ae={class:"text-lg font-semibold text-gray-800 mb-1"},le={class:"text-sm text-gray-600 mb-2"},ne={key:0,class:"text-xs text-gray-500 mb-2"},ie={class:"flex items-center justify-between mt-4"},de={class:"text-xl font-bold text-blue-600"},ce={class:"text-sm text-gray-500"},ue={class:"flex items-center space-x-3"},pe=["onClick"],me={class:"text-lg font-medium w-8 text-center"},ge=["onClick"],xe=["onClick"],be={class:"lg:col-span-1"},fe={class:"bg-white rounded-lg shadow-md p-6 sticky top-4"},ve={class:"space-y-3 mb-6"},ye={class:"flex justify-between text-gray-600"},he={class:"border-t pt-3 flex justify-between text-lg font-bold text-gray-800"},_e={class:"text-blue-600"},we={key:0,class:"mb-4 space-y-3 bg-gray-50 p-4 rounded-lg"},ke={key:0,class:"text-red-500 text-xs mt-1"},Ce={class:"grid grid-cols-2 gap-2"},$e={class:"text-xs text-gray-500"},je=["disabled"],Ae={key:0,class:"animate-spin h-5 w-5 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Ee={key:1},Pe={key:2},ze={class:"mt-6 pt-6 border-t"},Le={class:"text-sm text-gray-600 mb-2 flex items-center gap-2"},Te=R({__name:"carrito",setup(C){T({title:"Carrito de Compras - AutoPiezas360",meta:[{name:"description",content:"Revisa y gestiona los productos en tu carrito de compras. Finaliza tu pedido con envío gratis sobre $500.000."}]});const i=D(),{carrito:$,eliminarDelCarrito:L,actualizarCantidad:j,limpiarCarrito:A,total:v,cantidadItems:E,estaVacio:M,iniciarCheckout:V}=O(),y=b(""),h=b(""),_=b(""),x=b(""),d=b(!1),N=n=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n),S=async()=>{try{d.value=!0,x.value="";let n="",t="",p="";if(i.isAuthenticated&&i.user?.email){n=i.user.email;const o=(i.user?.displayName||"").split(" ");t=o[0]||"",p=o.slice(1).join(" ")||""}else{if(n=y.value.trim(),t=h.value.trim(),p=_.value.trim(),!n){x.value="Por favor ingresa tu email",d.value=!1;return}if(!N(n)){x.value="Por favor ingresa un email válido",d.value=!1;return}}const m=await V(n,t,p);window.location.href=m}catch(n){console.error("❌ Error en checkout:",n),alert("Error al procesar el pago: "+(n.message||"Intenta nuevamente")),d.value=!1}},B=()=>{const t=`Hola! Me interesa comprar los siguientes productos:
2
3${$.value.map(c=>`- ${c.nombre} (${c.cantidad}x) - $${(c.precio*c.cantidad).toLocaleString()}`).join(`
4`)}
5
6Total: $${v.value.toLocaleString()}
7
8¿Podrían ayudarme con el proceso de compra?`,m=`https://wa.me/${"+56944622816".replace("+","")}?text=${encodeURIComponent(t)}`;window.open(m,"_blank")};return(n,t)=>{const p=I,m=H,c=F;return a(),r("div",K,[t[19]||(t[19]=e("div",{class:"bg-white shadow-sm border-b"},[e("div",{class:"max-w-6xl mx-auto px-4 py-6"},[e("h1",{class:"text-3xl font-bold text-gray-800"},"Carrito de Compras"),e("p",{class:"text-gray-600 mt-2"},"Revisa tus productos antes de finalizar la compra")])],-1)),e("div",Q,[s(M)?(a(),r("div",X,[u(s(q),{class:"w-24 h-24 mx-auto mb-4 text-gray-300"}),t[5]||(t[5]=e("h2",{class:"text-2xl font-bold text-gray-800 mb
8-2"},"Tu carrito está vacío",-1)),t[6]||(t[6]=e("p",{class:"text-gray-600 mb-6"},"Agrega productos a tu carrito para comenzar a comprar",-1)),u(p,{to:"/repuestos",class:"inline-block bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg font-medium transition-colors"},{default:z(()=>[...t[4]||(t[4]=[g(" Ver Repuestos ",-1)])]),_:1})])):(a(),r("div",Y,[e("div",Z,[(a(!0),r(U,null,W(s($),o=>(a(),r("div",{key:o.id,class:"bg-white rounded-lg shadow-md p-6"},[e("div",ee,[e("div",te,[o.imagen?(a(),r("img",{key:0,src:o.imagen,alt:o.nombre,class:"w-full h-full object-cover rounded-lg"},null,8,oe)):(a(),r("div",se,[u(m,{name:"wrench-screwdriver",size:"lg",class:"text-gray-400"})]))]),e("div",re,[e("h3",ae,l(o.nombre),1),e("p",le,l(o.marca.toUpperCase())+" "+l(o.modelo)+" "+l(o.anio),1),o.codigoOEM?(a(),r("p",ne," Código OEM: "+l(o.codigoOEM),1)):f("",!0),e("div",ie,[e("div",null,[e("p",de," $"+l((o.precio*o.cantidad).toLocaleString()),1),e("p",ce," $"+l(o.precio.toLocaleString())+" c/u ",1)]),e("div",ue,[e("button",{onClick:P=>s(j)(o.id,o.cantidad-1),class:"w-8 h-8 rounded-full border border-gray-300 hover:bg-gray-100 flex items-center justify-center transition-colors",title:"Disminuir cantidad"},[u(s(G),{class:"w-4 h-4"})],8,pe),e("span",me,l(o.cantidad),1),e("button",{onClick:P=>s(j)(o.id,o.cantidad+1),class:"w-8 h-8 rounded-full border border-gray-300 hover:bg-gray-100 flex items-center justify-center transition-colors",title:"Aumentar cantidad"},[u(s(J),{class:"w-4 h-4"})],8,ge)])])]),e("button",{onClick:P=>s(L)(o.id),class:"text-red-500 hover:text-red-700 transition-colors",title:"Eliminar del carrito"},[...t[7]||(t[7]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])],8,xe)])]))),128))]),e("div",be,[e("div",fe,[t[18]||(t[18]=e("h2",{class:"text-xl font-bold text-gray-800 mb-4"},"Resumen del Pedido",-1)),e("div",ve,[e("div",ye,[e("span",null,"Subtotal ("+l(s(E))+" "+l(s(E)===1?"producto":"productos")+")",1),e("span",null,"$"+l(s(v).toLocaleString()),1)]),t[9]||(t[9]=e("div",{class:"flex justify-between text-gray-600"},[e("span",null,"Envío"),e("span",{class:"text-green-600"},"Gratis")],-1)),e("div",he,[t[8]||(t[8]=e("span",null,"Total",-1)),e("span",_e,"$"+l(s(v).toLocaleString()),1)])]),s(i).isAuthenticated?f("",!0):(a(),r("div",we,[t[14]||(t[14]=e("p",{class:"text-sm font-medium text-gray-700"},"Datos del comprador",-1)),e("div",null,[t[10]||(t[10]=e("label",{class:"block text-xs font-medium text-gray-600 mb-1"},[g(" Email "),e("span",{class:"text-red-500"},"*")],-1)),w(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>y.value=o),type:"email",placeholder:"[email protected]",required:"",class:"w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[k,y.value]]),x.value?(a(),r("p",ke,l(x.value),1)):f("",!0)]),e("div",Ce,[e("div",null,[t[11]||(t[11]=e("label",{class:"block text-xs font-medium text-gray-600 mb-1"},[g(" Nombre "),e("span",{class:"text-gray-400 text-xs"},"(opcional)")],-1)),w(e("input",{"onUpdate:modelValue":t[1]||(t[1]=o=>h.value=o),type:"text",placeholder:"Juan",class:"w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[k,h.value]])]),e("div",null,[t[12]||(t[12]=e("label",{class:"block text-xs font-medium text-gray-600 mb-1"},[g(" Apellido "),e("span",{class:"text-gray-400 text-xs"},"(opcional)")],-1)),w(e("input",{"onUpdate:modelValue":t[2]||(t[2]=o=>_.value=o),type:"text",placeholder:"Pérez",class:"w-full px-3 py-2 text-sm border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"},null,512),[[k,_.value]])])]),e("p",$e,[u(c,{icon:"information-circle","icon-size":"sm","wrapper-class":"inline-flex items-start gap-2 text-sm text-gray-600"},{default:z(()=>[...t[13]||(t[13]=[g(" El email es obligatorio. El nombre y apellido son opcionales pero mejoran tu experiencia de compra. ",-1)])]),_:1})])])),e("button",{onClick:S,disabled:d.value,class:"w-full bg-blue-600 hover:bg-blue-700 text-white py-3 px-4 roun
8ded-lg font-medium transition-colors mb-3 disabled:bg-gray-400 disabled:cursor-not-allowed flex items-center justify-center"},[d.value?(a(),r("svg",Ae,[...t[15]||(t[15]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):f("",!0),d.value?(a(),r("span",Pe,"Procesando...")):(a(),r("span",Ee,"Proceder al Pago"))],8,je),e("button",{onClick:t[3]||(t[3]=(...o)=>s(A)&&s(A)(...o)),class:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 px-4 rounded-lg font-medium transition-colors"}," Limpiar Carrito "),e("div",ze,[e("p",Le,[u(m,{name:"chat-bubble",size:"sm"}),t[16]||(t[16]=g(" ¿Necesitas ayuda? ",-1))]),e("button",{onClick:B,class:"w-full bg-green-500 hover:bg-green-600 text-white py-2 px-4 rounded-lg font-medium transition-colors flex items-center justify-center space-x-2"},[...t[17]||(t[17]=[e("svg",{class:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24"},[e("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893A11.821 11.821 0 0020.885 3.488"})],-1),e("span",null,"Consultar por WhatsApp",-1)])])])])])]))])])}}});export{Te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.