1import{_ as ae}from"./BsqTxom4.js";import{s as ne,Y as E,r as z,q as A,c as d,b as t,e as y,f as r,v as i,m as a,z as U,F as V,x as _,i as re,g as se,t as m,j as ie,L as de,o as u,p as ue}from"#entry";import{u as ce}from"./YdqVaeeB.js";const me={class:"mb-8 flex justify-between items-center"},pe={class:"bg-white rounded-xl shadow-lg p-6 mb-8 border border-gray-100"},ge={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},ve=["value"],ye={class:"bg-white rounded-xl shadow-lg border border-gray-100 overflow-hidden"},be={class:"w-full"},xe={class:"py-4 px-6 font-medium text-gray-900"},fe={class:"py-4 px-6"},he={class:"text-gray-900 font-medium"},we={class:"text-sm text-gray-500"},Ce={class:"py-4 px-6 text-gray-700"},ze={class:"py-4 px-6"},ke={class:"py-4 px-6 text-sm text-gray-500"},Fe={class:"py-4 px-6 text-right font-semibold text-gray-900"},Pe={class:"py-4 px-6 text-right space-x-2"},Ee=["onClick"],Ue=["onClick"],Ve=["onClick"],_e=["onClick"],Ne={key:0},Te={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"},Ie={class:"bg-white rounded-2xl w-full max-w-3xl overflow-hidden"},De={class:"px-6 py-4 border-b flex items-center justify-between"},$e={class:"p-6 space-y-6 max-h-[70vh] overflow-y-auto"},Le={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Me=["value"],Ae={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},je={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},Be={class:"space-y-3"},Qe={class:"flex items-center gap-3"},Se={class:"flex items-center gap-2 text-sm text-gray-700"},He={key:0,class:"grid grid-cols-1"},Oe={class:"flex items-center gap-2"},Re={class:"px-3 py-2 border rounded-lg bg-gray-50 text-gray-700"},We={class:"space-y-3"},Ye=["onUpdate:modelValue"],Ge=["onUpdate:modelValue"],Je=["onUpdate:modelValue"],Ke=["onUpdate:modelValue"],Xe=["onUpdate:modelValue"],Ze={key:1,class:"col-span-2"},qe={class:"col-span-2 flex gap-1"},eo=["onChange"],oo=["onClick"],to=["onClick"],lo={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},ao={class:"px-6 py-4 bg-gray-50 border-t flex justify-end space-x-3"},no=["disabled"],ro={key:1,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"},so={class:"bg-white rounded-2xl w-full max-w-4xl overflow-hidden"},io={class:"px-6 py-4 border-b flex items-center justify-between"},uo={class:"flex items-center gap-2"},co={class:"p-0 max-h-[80vh] overflow-auto bg-gray-50"},mo={class:"p-6"},po={class:"bg-white shadow border rounded-xl p-6"},go=["innerHTML"],ho={__name:"cotizaciones",setup(vo){const{listQuotes:j,createQuote:B,getQuoteWithItems:N,generateQuotePdfClient:L,buildQuoteHtml:M,deleteQuote:Q,updateQuote:S}=ce(),T=ne(),H=["borrador","enviada","aceptada","rechazada","vencida"],g=E({text:"",status:"",order:"createdAt"}),I=z([]),O=n=>n?new Intl.DateTimeFormat("es-CL",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(n)):"-",R=(n,e="CLP")=>new Intl.NumberFormat("es-CL",{style:"currency",currency:e}).format(n||0),W=n=>({borrador:"bg-gray-100 text-gray-700",enviada:"bg-blue-100 text-blue-700",aceptada:"bg-green-100 text-green-700",rechazada:"bg-red-100 text-red-700",vencida:"bg-yellow-100 text-yellow-700"})[n]||"bg-gray-100 text-gray-700",k=async()=>{const n=await j({status:g.status||void 0,order:g.order});I.value=g.text?n.filter(e=>(e.searchableText||"").includes(g.text.toLowerCase())):n};A(k);const b=z(!1),F=z(!1),x=z([]),o=E({userId:"",userPhone:"",manualName:"",manualEmail:"",currency:"CLP",validez:"Válida por 5 dÃas",vehicle:{marca:"",modelo:"",ano:null,vin:""},condicionesPago:"",plazoEntrega:"",modoTotalFinal:!1,totalFinal:null,items:[{itemCode:"",descripcion:"",marca:"",cantidad:1,precioUnitario:0,fotoPreview:null}]}),w=z([]),D=()=>{console.log("ð [resetForm] Reseteando formulario..."),o.userId="",o.userPhone="",o.manualName="",o.manualEmail="",o.currency="CLP",o.validez="Válida por 5 dÃas",o.vehicle={marca:"",modelo:"",ano:null,vin:""},o.condicionesPago="",o.plazoEntrega="",o.modoTotalFinal=!1,o.totalFinal=null,o.items=[{itemCode:"",descripcion:"",marca:"",cantidad:1,precioUnitario:0,fotoPreview:null}],w.value=[],v.id="",console.log("â
[resetForm] Formulario reseteado")},Y=()=>{console.log("ðµ [addItem] Agregando nuevo Ãtem...",{itemsCount:o.items.length});try{const n={itemCode:"",descripcion:"",marca:"",cantidad:1,precioUnitario:0,fotoPreview:null};o.items.push(n),console.log("â
[addItem] Ãtem agregado exitosamente",{newItem:n,totalItems:o.items.length}),de(()=>{console.log("ð [addItem] Referencias actualizadas después de nextTick")})}catch(n){console.error("â [addItem] Error al agregar Ãtem:",n),alert("Error al agregar el Ãtem. Por favor intenta nuevamente.")}},G=(n,e)=>{const l=n.target.files[0];if(l&&l.type.startsWith("image/")){const c=new FileReader;c.onload=s=>{o.items[e].fotoPreview=s.target.result},c.readAsDataURL(l)}},J=n=>{o.items[n].fotoPreview=null,w.value[n]&&(w.value[n].value="")};A(async()=>{const{$firestore:n}=ie(),{collection:e,getDocs:l,query:c,where:s,orderBy:te}=await ae(async()=>{const{collection:P,getDocs:C,query:f,where:h,orderBy:$}=await import("#entry").then(le=>le.aC);return{collection:P,getDocs:C,query:f,where:h,orderBy:$}},[],import.meta.url);try{const P=c(e(n,"users"),s("role","in",["cliente","vendedor"]),te("email","asc")),C=await l(P);
1x.value=[],C.forEach(f=>x.value.push({id:f.id,...f.data()||{}}))}catch{const C=c(e(n,"users"),s("role","in",["cliente","vendedor"])),f=await l(C);x.value=[],f.forEach(h=>x.value.push({id:h.id,...h.data()||{}})),x.value.sort((h,$)=>(h.displayName||"").localeCompare($.displayName||""))}});const K=async()=>{if(console.log("ð¢ [crear] Iniciando creación de cotización...",{userId:o.userId,manualName:o.manualName,itemsCount:o.items.length,modoTotalFinal:o.modoTotalFinal,totalFinal:o.totalFinal}),!o.userId&&!o.manualName||o.items.length===0){console.warn("â ï¸ [crear] Validación fallida - no se puede crear");return}F.value=!0;try{const n={userId:o.userId||`manual_${Date.now()}`,userEmail:o.manualEmail||null,userName:o.manualName||null,userPhone:o.userPhone||null,vehicle:{marca:o.vehicle.marca||null,modelo:o.vehicle.modelo||null,ano:o.vehicle.ano||null,vin:o.vehicle.vin||null},currency:o.currency,condicionesPago:o.condicionesPago,plazoEntrega:o.plazoEntrega,validez:o.validez,validaHasta:null,items:o.items,modoTotalFinal:o.modoTotalFinal,totalFinal:o.modoTotalFinal?Number(o.totalFinal)||0:null,creadaPor:{userId:T.user?.uid||null,nombre:T.user?.displayName||T.user?.email||null,role:"admin"}};if(console.log("ð¤ [crear] Enviando payload:",n),v.id)console.log("ð [crear] Actualizando cotización existente:",v.id),await S(v.id,n),console.log("â
[crear] Cotización actualizada exitosamente");else{console.log("ð [crear] Creando nueva cotización...");const{id:e}=await B(n);console.log("â
[crear] Cotización creada exitosamente:",e),v.id=e}b.value=!1,D(),await k()}catch(n){throw console.error("â [crear] Error al crear/actualizar cotización:",n),n}
1finally{F.value=!1,console.log("ð [crear] Proceso finalizado")}},p=E({open:!1,html:"",quote:null}),X=async n=>{const e=await N(n);await L(e)},Z=async n=>{const e=await N(n);p.quote=e,p.html=M(e),p.open=!0},q=async()=>{if(console.log("ðï¸ [previsualizarCotizacion] Iniciando previsualización...",{userId:o.userId,manualName:o.manualName,itemsCount:o.items.length,modoTotalFinal:o.modoTotalFinal,totalFinal:o.totalFinal}),!o.userId&&!o.manualName||o.items.length===0){console.warn("â ï¸ [previsualizarCotizacion] Validación fallida - no se puede previsualizar"),alert("Por favor completa los datos del cliente y agrega al menos un Ãtem");return}try{const n={id:v.id||"temp",numero:v.id?`COT-${v.id}`:"COT-TEMP",userId:o.userId||`manual_${Date.now()}`,userEmail:o.manualEmail||null,userName:o.manualName||null,userPhone:o.userPhone||null,vehicle:{marca:o.vehicle.marca||null,modelo:o.vehicle.modelo||null,ano:o.vehicle.ano||null,vin:o.vehicle.vin||null},currency:o.currency,condicionesPago:o.condicionesPago||"",plazoEntrega:o.plazoEntrega||"",validez:o.validez||"Válida por 5 dÃas",items:o.items.map(e=>({itemCode:e.itemCode||"",descripcion:e.descripcion||"",marca:e.marca||"",cantidad:e.cantidad||1,precioUnitario:e.precioUnitario||0,fotoPreview:e.fotoPreview||null})),modoTotalFinal:o.modoTotalFinal,totalFinal:o.modoTotalFinal?Number(o.totalFinal)||0:null,total:o.modoTotalFinal?Number(o.totalFinal)||0:o.items.reduce((e,l)=>e+(l.cantidad||0)*(l.precioUnitario||0),0),subTotal:o.modoTotalFinal?Number(o.totalFinal)||0:o.items.reduce((e,l)=>e+(l.cantidad||0)*(l.precioUnitario||0),0),createdAt:new Date};console.log("ð [previsualizarCotizacion] Objeto temporal creado:",n),p.quote=n,p.html=M(n),p.open=!0,console.log("â
[previsualizarCotizacion] Preview abierto exitosamente")}catch(n){console.error("â [previsualizarCotizacion] Error al generar preview:",n),alert("Error al generar la previsualización. Por favor intenta nuevamente.")}},v=E({id:""}),ee=async n=>{const e=await N(n);o.userId=e.userId||"",o.manualName=e.userName||"",o.manualEmail=e.userEmail||"",o.userPhone=e.userPhone||"",o.currency=e.currency||"CLP",o.validez=e.validez||"Válida por 5 dÃas",o.vehicle.marca=e.vehicle?.marca||"",o.vehicle.modelo=e.vehicle?.modelo||"",o.vehicle.ano=e.vehicle?.ano||null,o.vehicle.vin=e.vehicle?.vin||"",o.condicionesPago=e.condicionesPago||"",o.plazoEntrega=e.plazoEntrega||"",o.modoTotalFinal=!!e.modoTotalFinal,o.totalFinal=e.totalFinal||null,o.items=(e.items||[]).map(l=>({itemCode:l.itemCode||"",descripcion:l.descripcion||"",marca:l.marca||"",cantidad:l.cantidad||1,precioUnitario:l.precioUnitario||0,fotoPreview:l.fotoPreview||null})),v.id=n,b.value=!0},oe=async n=>{if(confirm(`¿Eliminar la cotización ${n.numero}? Esta acción no se puede deshacer.`))try{await Q(n.id),await k()}catch(l){alert("No se pudo eliminar la cotización. Intenta nuevamente."),console.error(l)}};return(n,e)=>(u(),d("div",null,[t("div",me,[e[23]||(e[23]=t("div",null,[t("h1",{class:"text-3xl font-bold text-gray-900"},"Cotizaciones"),t("p",{class:"text-gray-600 mt-2"},"Administra y envÃa cotizaciones a clientes")],-1)),t("button",{onClick:e[0]||(e[0]=l=>b.value=!0),class:"px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors font-medium flex items-center space-x-2"},[...e[22]||(e[22]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v12m6-6H6"})],-1),t("span",null,"Nueva Cotización",-1)])])]),t("div",pe,[t("div",ge,[t("div",null,[e[24]||(e[24]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Buscar",-1)),r(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>a(g).text=l),type:"text",class:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"número, email, cliente, vehÃculo"},null,512),[[i,a(g).text]])]),t("div",null,[e[26]||(e[26]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Estado",-1)),r(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>a(g).status=l),class:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"},[e[25]||(e[25]=t("option",{value:""},"Todos",-1)),(u(),d(V,null,_(H,l=>t("option",{key:l,value:l},m(l),9,ve)),64))],512),[[U,a(g).status]])]),t("div",null,[e[28]||(e[28]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Orden",-1)),r(t("select",{"onUpdate:modelValue":e[3]||(e[3]=l=>a(g).order=l),class:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"},[...e[27]||(e[27]=[t("option",{value:"createdAt"},"Fecha de creación",-1),t("option",{value:"lastEventAt"},"Ãltima actividad",-1)])],512),[[U,a(g).order]])]),t("div",{class:"flex items-end"},[t("button",{onClick:k,class:"w-full px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"},"Aplicar")])])]),t("div",ye,[t("table",be,[e[30]||(e[30]=t("thead",null,[t("tr",{class:"bg-gray-50 border-b border-gray-200"},[t("th",{class:"text-left py-4 px-6 text-gray-700 font-medium"},"N°"),t("th",{class:"text-left py-4 px-6 text-gray-700 font-medium"},"Cliente"),t("th",{class:"text-left py-4 px-6 text-gray-700 font-medium"},"VehÃculo"),t("th",{class:"text-left py-4 px-6 text-gray-700 font-medium"},"Estado"),t("th",{class:"text-left py-4 px-6 text-gray-700 font-medium"},"Fecha"),t("th",{class:"text-right py-4 px-6 text-gray-700 font-medium"},"Total"),t("th",{class:"py-4 px-6"})])],-1)),t("tbody",null,[(u(!0),d(V,null,_(a(I),l=>(u(),d("tr",{key:l.id,class:"border-b border-gray-100 hover:bg-gray-50"},[t("td",xe,m(l.numero),1),t("td",fe,[t("div",he,m(l.userName),1),t("div",we,m(l.userEmail),1)]),t("td",Ce,m(l.vehicle?.marca)+" "+m(l.vehicle?.modelo)+" "+m(l.vehicle?.ano),1),t("td",ze,[t("span",{class:ue(["px-2 py-1 text-xs rounded-full",W(l.status)])},m(l.status),3)]),t("td",ke,m(O(l.createdAt?.toDate?.()||l.createdAt)),1),t("td",Fe,m(R(l.total,l.currency)),1),t("td",Pe,[t("button",{onClick:c=>Z(l.id),class:"px-3 py-2 text-sm border rounded-lg hover:bg-gray-50"},"Preview",8,Ee),t("button",{onClick:c=>X(l.id),class:"px-3 py-2 text-sm border rounded-lg hover:bg-gray-50"},"PDF",8,Ue),t("button",{onClick:c=>ee(l.id),class:"px-3 py-2 text-sm border rounded-lg hover:bg-gray-50"},"Editar",8,Ve),t("button",{onClick:c=>oe(l),class:"px-3 py-2 text-sm border rounded-lg hover:bg-red-50 text-red-600"},"Eliminar",8,_e)])]))),128)),a(I).length===0?(u(),d("tr",Ne,[...e[29]||(e[29]=[t("td",{colspan:"7",class:"py-8 text-center text-gray-500"},"No hay cotizaciones",-1)])])):y("",!0)])])]),a(b)?(u(),d("div",Te,[t("div",Ie,[t("div",De,[e[32]||(e[32]=t("h3",{class:"text-lg font-semibold"},"Nueva Cotización",-1)),t("button",{onClick:e[4]||(e[4]=l=>{b.value=!1,D()}),class:"w-9 h-9 rounded-lg hover:bg-gray-100 flex items-center justify-center"},[...e[31]||(e[31]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),t("div",$e,[t("div",Le,[t("div",null,[e[34]||(e[34]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Cliente registrado",-1)),r(t("select",{"onUpdate:modelValue":e[5]||(e[5]=l=>a(o).userId=l),class:"w-full px-3 py-2 border rounded-lg"},[e[33]||(e[33]=t("option",{value:""},"Sin seleccionar",-1)),(u(!0),d(V,null,_(a(x),l=>(u(),d("option",{key:l.id,value:l.id}
1,m(l.displayName)+" ("+m(l.email)+")",9,Me))),128))],512),[[U,a(o).userId]])]),t("div",null,[e[35]||(e[35]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Nombre cliente (manual)",-1)),r(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>a(o).manualName=l),type:"text",class:"w-full px-3 py-2 border rounded-lg",placeholder:"Nombre del cliente"},null,512),[[i,a(o).manualName]])]),t("div",null,[e[36]||(e[36]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Email cliente (manual)",-1)),r(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>a(o).manualEmail=l),type:"email",class:"w-full px-3 py-2 border rounded-lg",placeholder:"[email protected]"},null,512),[[i,a(o).manualEmail]])])]),t("div",Ae,[t("div",null,[e[38]||(e[38]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Moneda",-1)),r(t("select",{"onUpdate:modelValue":e[8]||(e[8]=l=>a(o).currency=l),class:"w-full px-3 py-2 border rounded-lg"},[...e[37]||(e[37]=[t("option",{value:"CLP"},"CLP",-1),t("option",{value:"USD"},"USD",-1)])],512),[[U,a(o).currency]])]),t("div",null,[e[39]||(e[39]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Validez",-1)),r(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>a(o).validez=l),type:"text",class:"w-full px-3 py-2 border rounded-lg",placeholder:"Válida por 5 dÃas"},null,512),[[i,a(o).validez]])])]),t("div",je,[r(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>a(o).vehicle.marca=l),type:"text",class:"w-full px-3 py-2 border rounded-lg",placeholder:"Marca"},null,512),[[i,a(o).vehicle.marca]]),r(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>a(o).vehicle.modelo=l),type:"text",class:"w-full px-3 py-2 border rounded-lg",placeholder:"Modelo"},null,512),[[i,a(o).vehicle.modelo]]),r(t("input",{"onUpdate:modelValue":e[12]||(e[12]=l=>a(o).vehicle.ano=l),type:"number",class:"w-full px-3 py-2 border rounded-lg",placeholder:"Año"},null,512),[[i,a(o).vehicle.ano,void 0,{number:!0}]]),r(t("input",{"onUpdate:modelValue":e[13]||(e[13]=l=>a(o).vehicle.vin=l),type:"text",class:"w-full px-3 py-2 border rounded-lg",placeholder:"VIN (opcional)",maxlength:"17"},null,512),[[i,a(o).vehicle.vin]])]),t("div",Be,[t("div",Qe,[t("label",Se,[r(t("input",{type:"checkbox","onUpdate:modelValue":e[14]||(e[14]=l=>a(o).modoTotalFinal=l)},null,512),[[se,a(o).modoTotalFinal]]),e[40]||(e[40]=re(" Modo precio total (ocultar unitarios) ",-1))])]),a(o).modoTotalFinal?(u(),d("div",He,[e[41]||(e[41]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Total de la cotización",-1)),t("div",Oe,[t("span",Re,m(a(o).currency),1),r(t("input",{"onUpdate:modelValue":e[15]||(e[15]=l=>a(o).totalFinal=l),type:"number",step:"any",min:"0",class:"w-full px-3 py-2 border rounded-lg",placeholder:"Ingresa el total"},null,512),[[i,a(o).totalFinal,void 0,{number:!0}]])])])):y("",!0),t("div",{class:"flex items-center justify-between"},[e[42]||(e[42]=t("h4",{class:"font-medium"},"Ãtems",-1)),t("button",{onClick:Y,class:"text-blue-600 text-sm"},"Agregar Ãtem")]),t("div",We,[(u(!0),d(V,null,_(a(o).items,(l,c)=>(u(),d("div",{key:`item-${c}-${a(o).items.length}`,class:"grid grid-cols-12 gap-2 items-end"},[r(t("input",{"onUpdate:modelValue":s=>l.itemCode=s,class:"col-span-2 px-3 py-2 border rounded-lg",placeholder:"Código"},null,8,Ye),[[i,l.itemCode]]),r(t("input",{"onUpdate:modelValue":s=>l.descripcion=s,class:"col-span-3 px-3 py-2 border rounded-lg",placeholder:"Descripción"},null,8,Ge),[[i,l.descripcion]]),r(t("input",{"onUpdate:modelValue":s=>l.marca=s,class:"col-span-2 px-3 py-2 border rounded-lg",placeholder:"Marca"},null,8,Je),[[i,l.marca]]),r(t("input",{"onUpdate:modelValue":s=>l.cantidad=s,type:"number",class:"col-span-1 px-3 py-2 border rounded-lg",placeholder:"Cant"},null,8,Ke),[[i,l.cantidad,void 0,{number:!0}]]),a(o).modoTotalFinal?y("",!0):r((u(),d("input",{key:0,"onUpdate:modelValue":s=>l.precioUnitario=s,type:"number",class:"col-span-2 px-3 py-2 border rounded-lg",placeholder:"Precio"},null,8,Xe)),[[i,l.precioUnitario,void 0,{number:!0}]]),a(o).modoTotalFinal?(u(),d("div",Ze)):y("",!0),t("div",qe,[t("input",{ref_for:!0,ref:s=>a(w)[c]=s,type:"file",accept:"image/*",onChange:s=>G(s,c),class:"hidden"},null,40,eo),t("button",{type:"button",onClick:s=>a(w)[c]?.click(),class:"px-2 py-2 text-xs border rounded-lg hover:bg-gray-50"}
1," ð· Foto ",8,oo),l.fotoPreview?(u(),d("button",{key:0,type:"button",onClick:s=>J(c),class:"px-2 py-2 text-xs border rounded-lg hover:bg-red-50 text-red-600"}," â ",8,to)):y("",!0)])]))),128))])]),t("div",lo,[r(t("input",{"onUpdate:modelValue":e[16]||(e[16]=l=>a(o).condicionesPago=l),class:"px-3 py-2 border rounded-lg",placeholder:"Condiciones de pago"},null,512),[[i,a(o).condicionesPago]]),r(t("input",{"onUpdate:modelValue":e[17]||(e[17]=l=>a(o).plazoEntrega=l),class:"px-3 py-2 border rounded-lg",placeholder:"Plazo de entrega"},null,512),[[i,a(o).plazoEntrega]]),r(t("input",{"onUpdate:modelValue":e[18]||(e[18]=l=>a(o).userPhone=l),class:"px-3 py-2 border rounded-lg",placeholder:"Teléfono cliente (opcional)"},null,512),[[i,a(o).userPhone]])])]),t("div",ao,[t("button",{onClick:e[19]||(e[19]=l=>{b.value=!1,D()}),class:"px-4 py-2 border rounded-lg"},"Cancelar"),t("button",{onClick:q,class:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700"},"Vista"),t("button",{disabled:a(F)||a(o).modoTotalFinal&&!(Number(a(o).totalFinal)>0),onClick:K,class:"px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700"},m(a(F)?"Creando...":"Crear"),9,no)])])])):y("",!0),a(p).open?(u(),d("div",ro,[t("div",so,[t("div",io,[e[44]||(e[44]=t("h3",{class:"text-lg font-semibold"},"Preview Cotización",-1)),t("div",uo,[a(p).quote?(u(),d("button",{key:0,onClick:e[20]||(e[20]=l=>a(L)(a(p).quote)),class:"px-4 py-2 border rounded-lg hover:bg-gray-50"},"Descargar PDF")):y("",!0),t("button",{onClick:e[21]||(e[21]=l=>a(p).open=!1),class:"w-9 h-9 rounded-lg hover:bg-gray-100 flex items-center justify-center"},[...e[43]||(e[43]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])]),t("div",co,[t("div",mo,[t("div",po,[t("div",{innerHTML:a(p).html},null,8,go)])])])])])):y("",!0)]))}};export{ho 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.