PageSourceSearch

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

js repuestos-d6c3d.firebaseapp.com collected 2026-10-03 08:14:55 UTC 9,741 bytes, 1 lines download raw bytes

1import{_ as p}from"./BsqTxom4.js";import{k as L,j as N,l as M,c as m,o as d,b as e,e as j,p as c,t as i,F as E,x as B,N as A,h as O,i as V,_ as I,m as l,n as S,u as T,r as C,q as P,a as R,a8 as U}from"#entry";const F={class:"flex items-center justify-between h-16 px-6 border-b"},H={class:"flex items-center space-x-3"},q={class:"text-white font-bold text-sm"},W={class:"text-xl font-bold text-gray-800"},G={class:"mt-6 px-3"},J={class:"space-y-1"},K={class:"w-5 h-5 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Q=["d"],X={class:"absolute bottom-0 left-0 right-0 p-4 border-t"},Y={class:"flex items-center space-x-3"},Z={class:"text-sm font-medium text-white"},ee={class:"flex-1 min-w-0"},te={class:"text-sm font-medium text-gray-900 truncate"},oe={class:"text-xs text-gray-500 truncate"},se={class:"flex items-center justify-between px-4 py-3 border-b bg-gray-50"},ne={class:"flex items-center space-x-2"},re={class:"text-white font-bold text-xs"},ae={class:"text-lg font-semibold text-gray-800"},ie={class:"max-h-80 overflow-y-auto"},le={class:"p-3"},ce={class:"space-y-2"},de={class:"w-5 h-5 mr-3 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ue=["d"],ge={class:"truncate"},he={class:"p-4 border-t bg-gray-50"},me={class:"flex items-center space-x-3 mb-3"},fe={class:"text-sm font-medium text-white"},xe={class:"flex-1 min-w-0"},be={class:"text-sm font-medium text-gray-900 truncate"},pe={class:"text-xs text-gray-500 truncate"},ve={__name:"Sidebar",props:{isOpen:{type:Boolean,default:!1},config:{type:Object,required:!0},user:{type:Object,default:()=>({})}},emits:["toggle"],setup(n,{emit:z}){const v=n,_=L(),{$firebaseAuth:x}=N(),f=(()=>{{const o=navigator.userAgent;return{isChrome:/Chrome/.test(o)&&!/Edge/.test(o),isFirefox:/Firefox/.test(o),version:o.match(/Chrome\/(\d+)/)?.[1]||"0"}}})(),u=M(()=>v.user.displayName||"Usuario"),w=M(()=>v.user.email||""),b=M(()=>u.value.charAt(0).toUpperCase()),y=o=>_.path===o,g=(o,t,h="")=>{const s={blue:{bg:"bg-blue-600",text:"text-blue-600",hover:"hover:bg-blue-50"},red:{bg:"bg-red-600",text:"text-red-600",hover:"hover:bg-red-50"},green:{bg:"bg-green-600",text:"text-green-600",hover:"hover:bg-green-50"}};return s[o]?.[t]||s.blue[t]},r=o=>{const t={blue:"bg-blue-100 text-blue-700",red:"bg-red-100 text-red-700",green:"bg-green-100 text-green-700"};return t[o]||t.blue},a=async()=>{try{const{signOut:o}=await p(async()=>{const{signOut:t}=await import("#entry").then(h=>h.aD);return{signOut:t}},[],import.meta.url);if(f.isChrome){console.log("🧹 Limpiando datos específicos de Chrome...");try{localStorage.clear(),sessionStorage.clear(),localStorage.removeItem("firebase:authUser"),localStorage.removeItem("firebase:host:"),console.log("✅ Limpieza de Chrome completada")}catch(t){console.warn("⚠️ Error en limpieza de Chrome:",t)}}await o(x),await S("/")}catch(o){if(console.error("Error al cerrar sesión:",o),f.isChrome){console.log("🔄 Aplicando logout alternativo para Chrome...");try{localStorage.clear(),sessionStorage.clear(),await S("/")}catch(t){console.error("Error en logout alternativo:",t),window.location.href="/"}}}};return(o,t)=>{const h=I;return d(),m(E,null,[e("div",{class:c(["hidden lg:block fixed inset-y-0 left-0 z-50 w-64 bg-white shadow-lg transform transition-transform duration-300 ease-in-out",{"-translate-x-full":!n.isOpen,"translate-x-0":n.isOpen}])},[e("div",F,[e("div",H,[e("div",{class:c(["w-8 h-8 rounded-lg flex items-center justify-center",g(n.config.color,"bg")])},[e("span",q,i(n.config.icon),1)],2),e("span",W,i(n.config.title),1)]),e("button",{onClick:t[0]||(t[0]=s=>o.$emit("toggle")),class:"lg:hidden"},[...t[4]||(t[4]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e("nav",G,[e("div",J,[(d(!0),m(E,null,B(n.config.items,s=>(d(),A(h,{key:s.path,to:s.path,class:c(["flex items-center px-3 py-2 text-sm font-medium rounded-lg transition-colors",y(s.path)?r(n.config.color):"text-gray-600 hover:bg-gray-100"])},{default:O(()=>
1[(d(),m("svg",K,[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:s.icon},null,8,Q)])),V(" "+i(s.label),1)]),_:2},1032,["to","class"]))),128))])]),e("div",X,[e("div",Y,[e("div",{class:c(["w-8 h-8 rounded-full flex items-center justify-center",g(n.config.color,"bg")])},[e("span",Z,i(l(b)),1)],2),e("div",ee,[e("p",te,i(l(u)),1),e("p",oe,i(l(w)),1)])]),e("button",{onClick:a,class:c(["w-full mt-3 px-3 py-2 text-sm rounded-lg transition-colors",g(n.config.color,"text","hover")])}," Cerrar Sesión ",2)])],2),e("div",{class:c(["lg:hidden fixed bottom-0 left-0 right-0 z-50 bg-white border-t shadow-lg",{"translate-y-full":!n.isOpen,"translate-y-0":n.isOpen}])},[e("div",se,[e("div",ne,[e("div",{class:c(["w-6 h-6 rounded flex items-center justify-center",g(n.config.color,"bg")])},[e("span",re,i(n.config.icon),1)],2),e("span",ae,i(n.config.title),1)]),e("button",{onClick:t[1]||(t[1]=s=>o.$emit("toggle")),class:"p-1"},[...t[5]||(t[5]=[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:"M6 18L18 6M6 6l12 12"})],-1)])])]),e("div",ie,[e("nav",le,[e("div",ce,[(d(!0),m(E,null,B(n.config.items,s=>(d(),A(h,{key:s.path,to:s.path,onClick:t[2]||(t[2]=k=>o.$emit("toggle")),class:c(["flex items-center px-3 py-3 text-sm font-medium rounded-lg transition-colors",y(s.path)?r(n.config.color):"text-gray-600 hover:bg-gray-100"])},{default:O(()=>[(d(),m("svg",de,[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:s.icon},null,8,ue)])),e("span",ge,i(s.label),1)]),_:2},1032,["to","class"]))),128))])]),e("div",he,[e("div",me,[e("div",{class:c(["w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",g(n.config.color,"bg")])},[e("span",fe,i(l(b)),1)],2),e("div",xe,[e("p",be,i(l(u)),1),e("p",pe,i(l(w)),1)])]),e("button",{onClick:a,class:c(["w-full px-3 py-2 text-sm rounded-lg transition-colors",g(n.config.color,"text","hover")])}," Cerrar Sesión ",2)])])],2),n.isOpen?(d(),m("div",{key:0,class:"lg:hidden fixed inset-0 bg-black bg-opacity-50 z-40",onClick:t[3]||(t[3]=s=>o.$emit("toggle"))})):j("",!0)],64)}}},_e=Object.assign(ve,{__name:"Sidebar"}),we={class:"min-h-screen bg-gray-50"},ye={class:"lg:pl-64"},ke={class:"bg-white shadow-sm border-b"},Ce={class:"px-4 sm:px-6 lg:px-8"},Me={class:"flex justify-between items-center h-16"},$e={class:"flex items-center"},De={class:"text-xl font-semibold text-gray-900"},Ee={class:"flex items-center space-x-4"},je={class:"p-2 text-gray-400 hover:text-gray-500 relative"},Ae={class:"p-6"},ze={__name:"dashboard",setup(n){T({meta:[{name:"robots",content:"noindex, nofollow"}]});const z=L(),{$firebaseAuth:v,$firestore:_}=N(),x=C(!1),$=C({}),f=C("cliente"),u=C({}),w=M(()=>u.value.items?.find(a=>a.path===z.path)?.label||"Dashboard"),b=()=>{x.value=!x.value},y=r=>({blue:"bg-blue-500",red:"bg-red-500",green:"bg-green-500"})[r]||"bg-blue-500",g=async()=>{try{const r=await p(()=>import("./Dp3JlKPk.js"),[],import.meta.url);u.value=r.default.cliente}catch(r){console.error("Error cargando configuración del menú:",r),u.value={color:"blue",icon:"A",title:"Autopiezas360",items:[{label:"Dashboard",path:"/cliente",icon:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z"},{label:"Mi Perfil",path:"/cliente/perfil",icon:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"},{label:"Mis Pedidos",path:"/cliente/pedidos",icon:"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"}]}}};return P(async()=>{const r=v?.currentUser;if(r){$.value=r,await g();try{const{doc:a,getDoc:o}=await p(async()=>{const{doc:s,getDoc:k}=await import("#entry").then(D=>D.aC);return{doc:s,getDoc:k}},[],import.meta.url),t=await o(a(_,"users",r.uid));if(t.exists()){const s=t.data();f.value=s.role||"cliente"}else{const{setDoc:s}=await p(async()=>{const{setDoc:k}=await import("#entry").then(D=>D.aC);return{setDoc:k}},[],import.meta.url);await s(a(_,"users",r.uid),{email:r.email,displayName:r.displayName,role:"cliente",createdAt:new Date,lastLogin:new Date}),f.value="cliente"}const h=await p(()=>import("./Dp3JlKPk.js"),[],import.meta.url);u.value=h.default[f.value]||h.default.cliente}catch(a){console.error("Error cargando datos del usuario:",a)}}else await S("/login")}),(r,a)=>{const o=_e,t=I;return d(),m("div",we,[R(o,{"is-open":l(x),config:l(u),user:l($),onToggle:b},null,8,["is-open","config","user"]),l(x)?(d(),m("div",{key:0,onClick:b,class:"fixed inset-0 z-40 bg-black bg-opacity-50 lg:hidden"})):j("",!0),e("div",ye,[e("header",ke,[e("div",Ce,[e("div",Me,[e("div",$e,[e("button",{onClick:b,class:"lg:hidden mr-3"},[...a[0]||(a[0]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])]),e("h1",De,i(l(w)),1)]),e("div",Ee,[l(f)==="admin"?(d(),A(t,{key:0,to:"/",class:"px-3 py-2 text-sm text-gray-600 hover:text-gray-900 border rounded-lg hover:bg-gray-50 transition-colors"},{default:O(()=>[...a[1]||(a[1]=[V(" Ver Sitio Web ",-1)])]),_:1})):j("",!0),e("button",je,[a[2]||(a[2]=e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 17h5l-5 5v-5zM9 17H4l5 5v-5z"})],-1)),e("span",{class:c(["absolute top-0 right-0 w-2 h-2 rounded-full",y(l(u).color)])},null,2)])])])])]),e("main",Ae,[U(r.$slots,"default")])])])}}};export{ze 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.