1import{r as c,j as e}from"./index-BzPuTbLk.js";import{E as q}from"./jspdf.es.min-Cmv1E2Cg.js";import{B as z}from"./building-2-BNNJIR_0.js";import{U as B}from"./user-Dc2R9D8c.js";import{C as R}from"./car-Cq4LV64m.js";import{W as M}from"./wrench-D4C6uzVb.js";import{P as V}from"./plus-QecSF6bM.js";import{T as H}from"./trash-2-DJiNXjxe.js";import{E as O}from"./eye-CZMQmEpS.js";import{F as U}from"./file-down-CjGjOnv1.js";import{C as W}from"./calculator-D4I4NkRV.js";import{C as Q}from"./credit-card-Df6UZ-x7.js";import{F as Y}from"./file-text-BnSX2-DV.js";import"./FooterTailwind-enAT_Y5V.js";import"./button-C52vHxr1.js";import"./anime.es-DjbxoOUh.js";const G=({message:x,type:m="success",onClose:u})=>e.jsx("div",{className:"fixed top-4 right-4 z-[9999] animate-in slide-in-from-top-5",children:e.jsx("div",{className:`rounded-lg shadow-lg p-4 ${m==="success"?"bg-green-50 text-green-900 border border-green-200":m==="error"?"bg-red-50 text-red-900 border border-red-200":"bg-muted/50 text-foreground border border-border"}`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-medium",children:x}),e.jsx("button",{onClick:u,className:"text-current hover:opacity-70",children:"Ã"})]})})}),me=()=>{const[x,m]=c.useState(null),[u,F]=c.useState(!1),[h]=c.useState(()=>`INV-${Date.now().toString().slice(-8)}`),[v]=c.useState(()=>new Date().toLocaleDateString()),[o,f]=c.useState([{id:"1",description:"",quantity:1,rate:0}]),[t,S]=c.useState({businessName:"",businessAddress:"",businessPhone:"",businessEmail:"",clientName:"",clientAddress:"",clientPhone:"",clientEmail:"",vehicleType:"",licensePlate:"",vin:"",pickupLocation:"",dropoffLocation:"",distance:"",ratePerUnit:"",taxRate:"0",discount:"0",paymentTerms:"Due upon receipt",paymentMethods:"Cash, Check, Credit Card",dueDate:"",notes:""}),[n,y]=c.useState({}),p=(s,a="success")=>{m({message:s,type:a}),setTimeout(()=>m(null),3e3)},l=(s,a)=>{S(r=>({...r,[s]:a})),n[s]&&y(r=>({...r,[s]:void 0}))},D=()=>{f([...o,{id:Date.now().toString(),description:"",quantity:1,rate:0}])},k=s=>{f(o.filter(a=>a.id!==s))},g=(s,a,r)=>{f(o.map(d=>d.id===s?{...d,[a]:r}:d))},b=()=>o.reduce((s,a)=>s+a.quantity*a.rate,0),j=()=>{const s=b(),a=parseFloat(t.taxRate)||0;return s*a/100},C=()=>{const s=b(),a=j(),r=parseFloat(t.discount)||0;return s+a-r},$=()=>{const s={};return t.businessName||(s.businessName="Business name is required"),t.businessAddress||(s.businessAddress="Business address is required"),t.businessPhone||(s.businessPhone="Business phone is required"),t.businessEmail||(s.businessEmail="Business email is required"),t.businessEmail&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.businessEmail)&&(s.businessEmail="Valid email is required"),t.clientName||(s.clientName="Client name is required"),t.clientAddress||(s.clientAddress="Client address is required"),t.clientPhone||(s.clientPhone="Client phone is required"),y(s),Object.keys(s).length===0},E=async()=>{if(!$()){p("Please fill in all required fields","error");return}if(o.length===0||o.every(s=>!s.description)){p("Please add at least one service item","error");return}try{const s=new q,a=s.internal.pageSize.getWidth();let r=20;if(s.setFontSize(24),s.setTextColor(116,86,218),s.text("INVOICE",20,r),s.setFontSize(10),s.setTextColor(100,100,100),s.text(`#${h}`,20,r+7),s.text(v,20,r+12),s.setFontSize(12),s.setTextColor(0,0,0),s.text(t.businessName,a-20,r,{align:"right"}),s.setFontSize(9),s.setTextColor(100,100,100),s.text(t.businessAddress,a-20,r+6,{align:"right"}),s.text(t.businessPhone,a-20,r+11,{align:"right"}),s.text(t.businessEmail,a-20,r+16,{align:"right"}),r=50,s.setFontSize(10),s.setTextColor(116,86,218),s.text("BILL TO:",20,r),s.setTextColor(0,0,0),s.setFontSize(9),s.text(t.clientName,20,r+5),s.setTextColor(100,100,100),s.text(t.clientAddress,20,r+10),s.text(t.clientPhone,20,r+15),t.clientEmail&&s.text(t.clientEmail,20,r+20),t.vehicleType||t.licensePlate){s.setTextColor(116,86,218),s.setFontSize(10),s.text("VEHICLE DETAILS:",110,r),s.setTextColor(0,0,0),s.setFontSize(9);let i=r+5;t.vehicleType&&(s.text(t.vehicleType,110,i),i+=5),t.licensePlate&&(s.text(`Plate: ${t.licensePlate}`,110,i),i+=5),t.pickupLocation&&(s.text(`From: ${t.pickupLocation}`,110,i),i+=5),t.dropoffLocation&&s.text(`To: ${t.dropoffLocation}`,110,i)}r=90,s.setFillColor(243,240,254),s.rect(20,r,a-40,8,"F"),s.setTextColor(12,0,50),s.setFontSize(9),s.text("Description",25,r+5),s.text("Qty",120,r+5),s.text("Rate",145,r+5),s.text("Amount",a-25,r+5,{align:"right"}),r+=12,o.forEach(i=>
1{s.setTextColor(0,0,0),s.text(i.description||"Service",25,r),s.text(i.quantity.toString(),120,r),s.text(`$${i.rate.toFixed(2)}`,145,r),s.text(`$${(i.quantity*i.rate).toFixed(2)}`,a-25,r,{align:"right"}),r+=6}),r+=5;const d=a-70,A=b(),I=j(),L=C();s.setDrawColor(200,200,200),s.line(d,r,a-20,r),r+=7,s.setFontSize(9),s.setTextColor(100,100,100),s.text("Subtotal:",d,r),s.setTextColor(0,0,0),s.text(`$${A.toFixed(2)}`,a-25,r,{align:"right"}),r+=6,s.setTextColor(100,100,100),s.text(`Tax (${t.taxRate}%):`,d,r),s.setTextColor(0,0,0),s.text(`$${I.toFixed(2)}`,a-25,r,{align:"right"}),r+=6;const P=parseFloat(t.discount)||0;if(P>0&&(s.setTextColor(100,100,100),s.text("Discount:",d,r),s.setTextColor(0,0,0),s.text(`-$${P.toFixed(2)}`,a-25,r,{align:"right"}),r+=6),s.setDrawColor(200,200,200),s.line(d,r,a-20,r),r+=7,s.setFontSize(12),s.setTextColor(0,0,0),s.text("Total:",d,r),s.setTextColor(173,242,27),s.text(`$${L.toFixed(2)}`,a-25,r,{align:"right"}),r+=15,s.setFontSize(9),s.setTextColor(0,0,0),s.text(`Payment Terms: ${t.paymentTerms}`,20,r),r+=5,s.text(`Payment Methods: ${t.paymentMethods}`,20,r),t.dueDate&&(r+=5,s.text(`Due Date: ${new Date(t.dueDate).toLocaleDateString()}`,20,r)),t.notes){r+=10,s.setTextColor(100,100,100);const i=s.splitTextToSize(t.notes,a-40);s.text(i,20,r)}s.save(`Invoice-${h}.pdf`),p("Invoice generated successfully!")}catch{p("Failed to generate invoice. Please try again.","error")}},N=b(),w=j(),T=C();return e.jsxs("div",{className:"bg-[hsl(var(--secondary))]",children:[x&&e.jsx(G,{message:x.message,type:x.type,onClose:()=>m(null)}),e.jsxs("div",{className:"container mx-auto py-8 px-4",children:[e.jsxs("header",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-4xl font-bold text-[hsl(var(--primary))] mb-2",children:"Transportation Invoice Generator"}),e.jsx("p",{className:"text-[hsl(var(--muted-foreground))]",children:"Create professional invoices for your roadside assistance and vehicle transport business"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 bg-card rounded-2xl border border-border shadow-sm p-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:"Invoice Number"}),e.jsx("p",{className:"text-lg font-semibold text-[hsl(var(--primary))]",children:h})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:"Date"}),e.jsx("p",{className:"text-lg font-semibold",children:v})]})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(z,{className:"h-5 w-5 text-[hsl(var(--primary))]"}),e.jsx("h2",{className:"text-xl font-semibold text-[hsl(var(--primary))]",children:"Business Details"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Business Name *"}),e.jsx("input",{type:"text",value:t.businessName,onChange:s=>l("businessName",s.target.value),placeholder:"Your Company Name",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.businessName&&e.jsx("p",{className:"text-sm text-[hsl(var(--destructive))] mt-1",children:n.businessName})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Business Address *"}),e.jsx("input",{type:"text",value:t.businessAddress,onChange:s=>l("businessAddress",s.target.value),placeholder:"123 Main St, City, State ZIP",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.businessAddress&&e.jsx("p",{className:"text-sm text-[hsl(var(--destructive))] mt-1",children:n.businessAddress})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Phone *"}),e.jsx("input",{type:"tel",value:t.businessPhone,onChange:s=>l("businessPhone",s.target.value),placeholder:"(555) 123-4567",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.businessPhone&&e.jsx("p",{className:"text-sm text-[hsl(var(--destructive))] mt-1",children:n.businessPhone})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Email *"}),e.jsx("input",{type:"email",value:t.businessEmail,onChange:s=>l("businessEmail",s.target.value),placeholder:"[email protected]",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.businessEmail&&e.jsx("p",{className:"text-sm text-[hsl(var(--destructive))] mt-1",children:n.businessEmail})]})]})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(B,{className:"h-5 w-5 text-[hsl(var(--primary))]"}),e.jsx("h2",{className:"text-xl font-semibold text-[hsl(var(--primary))]",children:"Client Details"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Client Name *"}),e.jsx("input",{type:"text",value:t.clientName,onChange:s=>l("clientName",s.target.value),placeholder:"John Doe",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.clientName&&e.jsx("p",{className:"text-sm text-[hsl(var(--destructive))] mt-1",children:n.clientName})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Client Address *"}),e.jsx("input",{type:"text",value:t.clientAddress,onChange:s=>l("clientAddress",s.target.value),placeholder:"456 Oak Ave, City, State ZIP",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.clientAddress&&e.jsx("p",{className:"text-sm text-[hsl(var(--destructive))] mt-1",children:n.clientAddress})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Phone *"}),e.jsx("input",{type:"tel",value:t.clientPhone,onChange:s=>l("clientPhone",s.target.value),placeholder:"(555) 987-6543",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.clientPhone&&e.jsx("p",{className:"text-sm text-[hsl(var(--destructive))] mt-1",children:n.clientPhone})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Email"}),e.jsx("input",{type:"email",value:t.clientEmail,onChange:s=>l("clientEmail",s.target.value),placeholder:"[email protected]",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})]})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(R,{className:"h-5 w-5 text-[hsl(var(--primary))]"}),e.jsx("h2",{className:"text-xl font-semibold text-[hsl(var(--primary))]",children:"Vehicle Information"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Vehicle Type"}
1),e.jsx("input",{type:"text",value:t.vehicleType,onChange:s=>l("vehicleType",s.target.value),placeholder:"2020 Honda Civic",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"License Plate"}),e.jsx("input",{type:"text",value:t.licensePlate,onChange:s=>l("licensePlate",s.target.value),placeholder:"ABC-1234",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"VIN"}),e.jsx("input",{type:"text",value:t.vin,onChange:s=>l("vin",s.target.value),placeholder:"1HGBH41JXMN109186",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Pickup Location"}),e.jsx("input",{type:"text",value:t.pickupLocation,onChange:s=>l("pickupLocation",s.target.value),placeholder:"123 Start St",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Drop-off Location"}),e.jsx("input",{type:"text",value:t.dropoffLocation,onChange:s=>l("dropoffLocation",s.target.value),placeholder:"456 End Ave",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Distance (miles)"}),e.jsx("input",{type:"number",step:"0.1",value:t.distance,onChange:s=>l("distance",s.target.value),placeholder:"25.5",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Rate per Mile ($)"}),e.jsx("input",{type:"number",step:"0.01",value:t.ratePerUnit,onChange:s=>l("ratePerUnit",s.target.value),placeholder:"2.50",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})]})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"h-5 w-5 text-[hsl(var(--primary))]"}),e.jsx("h2",{className:"text-xl font-semibold text-[hsl(var(--primary))]",children:"Services"})]}),e.jsxs("button",{type:"button",onClick:D,className:"inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-md bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] hover:bg-[hsl(var(--accent))]/90 transition-colors",children:[e.jsx(V,{className:"h-4 w-4 mr-1"}),"Add Service"]})]}),e.jsx("div",{className:"space-y-3",children:o.map(s=>e.jsxs("div",{className:"grid grid-cols-12 gap-3 items-end p-3 bg-[hsl(var(--secondary))]/50 rounded-lg",children:[e.jsxs("div",{className:"col-span-5",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:a=>g(s.id,"description",a.target.value),placeholder:"Towing service, Roadside assistance...",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] text-sm"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",children:"Qty/Hours"}),e.jsx("input",{type:"number",min:"0",step:"0.1",value:s.quantity,onChange:a=>g(s.id,"quantity",parseFloat(a.target.value)||0),className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] text-sm"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",children:"Rate ($)"}),e.jsx("input",{type:"number",min:"0",step:"0.01",value:s.rate,onChange:a=>g(s.id,"rate",parseFloat(a.target.value)||0),className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] text-sm"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",children:"Amount"}),e.jsxs("div",{className:"h-10 flex items-center font-semibold",children:["$",(s.quantity*s.rate).toFixed(2)]})]}),e.jsx("div",{className:"col-span-1 flex justify-end",children:e.jsx("button",{type:"button",onClick:()=>k(s.id),disabled:o.length===1,className:"p-2 hover:bg-[hsl(var(--accent))]/10 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(H,{className:"h-4 w-4 text-[hsl(var(--destructive))]"})})})]},s.id))}),e.jsx("div",{className:"flex justify-end pt-2 border-t border-[hsl(var(--border))]",children:e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:"Subtotal"}),e.jsxs("p",{className:"text-2xl font-bold text-[hsl(var(--primary))]",children:["$",N.toFixed(2)]})]})})]}),e.jsxs("div",{className:"flex gap-4 pt-6 border-t border-[hsl(var(--border))]",children:[e.jsxs("button",{type:"button",onClick:()=>F(!u),className:"flex-1 inline-flex items-center justify-center px-4 py-2 border border-[hsl(var(--input))] rounded-md font-medium hover:bg-[hsl(var(--accent))]/10 transition-colors",children:[e.jsx(O,{className:"mr-2 h-4 w-4"}),u?"Hide Preview":"Preview"]}),e.jsxs("button",{type:"button",onClick:E,className:"flex-1 inline-flex items-center justify-center px-4 py-2 rounded-md font-medium bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] hover:bg-[hsl(var(--accent))]/90 transition-colors",children:[e.jsx(U,{className:"mr-2 h-4 w-4"}),"Download PDF"]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-card rounded-2xl border border-border shadow-sm p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(W,{className:"h-5 w-5 text-[hsl(var(--primary))]"}),e.jsx("h2",{className:"text-xl font-semibold text-[hsl(var(--primary))]",children:"Summary"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Tax Rate (%)"}),e.jsx("input",{type:"number",min:"0",max:"100",step:"0.01",value:t.taxRate,onChange:s=>l("taxRate",s.target.value),placeholder:"8.25",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Discount ($)"}),e.jsx("input",{type:"number",min:"0",step:"0.01",value:t.discount,onChange:s=>l("discount",s.target.value),placeholder:"0.00",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})]}),e.jsxs("div",{className:"space-y-2 p-4 bg-[hsl(var(--primary))]/5 rounded-lg",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Subtotal:"}),e.jsxs("span",{className:"font-medium",children:["$",N.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Tax:"}),e.jsxs("span",{className:"font-medium",children:["$",w.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Discount:"}),e.jsxs("span",{className:"font-medium",children:["-$",(parseFloat(t.discount)||0).toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-lg font-bold pt-2 border-t border-[hsl(var(--primary))]/20",children:[e.jsx("span",{children:"Total:"}),e.jsxs("span",{className:"text-[hsl(var(--accent))]",children:["$",T.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"bg-card rounded-2xl border border-border shadow-sm p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(Q,{className:"h-5 w-5 text-[hsl(var(--primary))]"}),e.jsx("h2",{className:"text-xl font-semibold text-[hsl(var(--primary))]",children:"Payment Information"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Payment Terms"}),e.jsx("input",{type:"text",value:t.paymentTerms,onChange:s=>l("paymentTerms",s.target.value),placeholder:"Due upon receipt",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Accepted Payment Methods"}),e.jsx("input",{type:"text",value:t.paymentMethods,onChange:s=>l("paymentMethods",s.target.value),placeholder:"Cash, Check, Credit Card",className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Due Date (optional)"}),e.jsx("input",{type:"date",value:t.dueDate,onChange:s=>l("dueDate",s.target.value),className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Y,{className:"h-4 w-4 text-[hsl(var(--primary))]"}),e.jsx("label",{className:"block text-sm font-medium",children:"Additional Notes"})]}),e.jsx("textarea",{value:t.notes,onChange:s=>
1l("notes",s.target.value),placeholder:"Thank you for your business...",rows:3,className:"w-full px-3 py-2 border border-[hsl(var(--border))] rounded-md focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"})]})]})]})]})]}),u&&e.jsx("div",{className:"mt-6 bg-card rounded-2xl border border-border shadow-sm p-8",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-start border-b pb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-[hsl(var(--primary))] mb-2",children:"INVOICE"}),e.jsxs("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:["#",h]}),e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:v})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("h2",{className:"text-xl font-bold mb-1",children:t.businessName||"Your Business"}),e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:t.businessAddress}),e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:t.businessPhone}),e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:t.businessEmail})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-[hsl(var(--primary))] mb-2",children:"Bill To:"}),e.jsx("p",{className:"text-sm font-medium",children:t.clientName||"Client Name"}),e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:t.clientAddress}),e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:t.clientPhone}),t.clientEmail&&e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:t.clientEmail})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-[hsl(var(--primary))] mb-2",children:"Vehicle Details:"}),t.vehicleType&&e.jsx("p",{className:"text-sm",children:t.vehicleType}),t.licensePlate&&e.jsxs("p",{className:"text-sm",children:["Plate: ",t.licensePlate]}),t.vin&&e.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["VIN: ",t.vin]}),t.pickupLocation&&e.jsxs("p",{className:"text-sm mt-2",children:["From: ",t.pickupLocation]}),t.dropoffLocation&&e.jsxs("p",{className:"text-sm",children:["To: ",t.dropoffLocation]})]})]}),e.jsx("div",{children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-[hsl(var(--secondary))]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left p-2 text-sm font-semibold",children:"Description"}),e.jsx("th",{className:"text-right p-2 text-sm font-semibold",children:"Qty"}),e.jsx("th",{className:"text-right p-2 text-sm font-semibold",children:"Rate"}),e.jsx("th",{className:"text-right p-2 text-sm font-semibold",children:"Amount"})]})}),e.jsx("tbody",{children:o.map(s=>e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"p-2 text-sm",children:s.description||"Service"}),e.jsx("td",{className:"text-right p-2 text-sm",children:s.quantity}),e.jsxs("td",{className:"text-right p-2 text-sm",children:["$",s.rate.toFixed(2)]}),e.jsxs("td",{className:"text-right p-2 text-sm font-medium",children:["$",(s.quantity*s.rate).toFixed(2)]})]},s.id))})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("div",{className:"w-64 space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Subtotal:"}),e.jsxs("span",{children:["$",N.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["Tax (",t.taxRate,"%):"]}),e.jsxs("span",{children:["$",w.toFixed(2)]})]}),parseFloat(t.discount)>0&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Discount:"}),e.jsxs("span",{children:["-$",parseFloat(t.discount).toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between text-lg font-bold pt-2 border-t",children:[e.jsx("span",{children:"Total:"}),e.jsxs("span",{className:"text-[hsl(var(--accent))]",children:["$",T.toFixed(2)]})]})]})}),e.jsxs("div",{className:"border-t pt-4 space-y-2",children:[e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Payment Terms:"})," ",t.paymentTerms]}),e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Payment Methods:"})," ",t.paymentMethods]}),t.dueDate&&e.jsxs("p",{className:"text-sm",children:[e.jsx("strong",{children:"Due Date:"})," ",new Date(t.dueDate).toLocaleDateString()]})]}),t.notes&&e.jsx("div",{className:"border-t pt-4",children:e.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:t.notes})})]})})]})]})};export{me 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.