PageSourceSearch

https://zeusmotorsolutions.com/assets/QuickBuy-B__ULIb1.js

js zeusmotorsolutions.com collected 2026-10-09 22:05:07 UTC 15,300 bytes, 6 lines download raw bytes

1import{q as Q,r as n,s as w,j as e,ak as Y,n as G,aj as K,W as A}from"./index-SQp96gdX.js";import{e as U,H as V,f as W,g as Z,c as X,h as ee}from"./Helmet-CM9up7_x.js";import{u as R}from"./sheet-BHrTOle8.js";import{Header as k}from"./Header-B_OS5eFY.js";import{Footer as S}from"./Footer-COsa5sDY.js";import{B as M}from"./BottomNav-Cyf8NYpP.js";import{S as se}from"./SEO-D1eI9kMy.js";import{B as l}from"./button-De9EF_oZ.js";import{C as te,a as ae}from"./card-CPIFjzul.js";import{S as T}from"./skeleton-B3WIpG-I.js";import{S as re}from"./separator-CxaYuLft.js";import{B as C}from"./badge-D_L_fgSL.js";import{f as u}from"./priceUtils-CpeYqTAh.js";import{c as ie,F as ne}from"./partsOrders-CJnxbdJ9.js";import{t as oe,S as le}from"./SharePartButton-My_1oRUv.js";import{D as ce,a as me,b as de,c as pe,d as ue}from"./dialog-Zc4Y1Pto.js";import{I as $}from"./input-soQZrY2x.js";import{L as q}from"./label-CojLASnb.js";import{T as xe}from"./textarea-oslc3cQc.js";import{toast as B}from"./index-ej7nYrQF.js";import{C as he}from"./circle-check-D_GYv5z7.js";import{B as fe}from"./bell-ring-DPMtAQSs.js";import{L as ge}from"./loader-circle-DVEq_g_o.js";import{P}from"./ProductImage-DI_t7Rjm.js";import{C as je}from"./CtaBand-BdZAiUBC.js";import{P as ye}from"./package-C2RPv9Af.js";import{A as Ne}from"./arrow-left-Ak0zyDkH.js";import{M as be,P as ve}from"./trash-2-DmeN4kTt.js";import{S as H}from"./shopping-cart-DIvGtize.js";import{B as _e}from"./banknote-oULiuzvI.js";import{T as we}from"./truck-6SvW26g2.js";import{c as ke}from"./createLucideIcon-C1HyVzIE.js";import{S as Se}from"./shield-DxV_jQSM.js";import"./index-Gl_aRnoi.js";import"./index-Bq_rvwR7.js";import"./index-D9ZMubZj.js";import"./x-C9mmgiRV.js";import"./NotificationCenter-eUSjDODO.js";import"./useMutation-CyeDgP2r.js";import"./scroll-area-C2WgemlW.js";import"./index-BS3aEd8u.js";import"./index-BdQq_4o_.js";import"./bell-dHpQJw9z.js";import"./SelectedVehicleBadge-BfMPO97a.js";import"./use-mobile-C_PAdZzb.js";import"./search-gu6f73Ro.js";import"./bike-nerh98lU.js";import"./dropdown-menu-DciB-wk9.js";import"./index-9tayHXGO.js";import"./index-CBMDqtKE.js";import"./check-BnAG9xs6.js";import"./phone-DRSmrj_Q.js";import"./circle-user-B8YHH0UK.js";import"./log-out-C4dkDb5U.js";import"./wrench-CiRZFvXG.js";import"./star-DKPbfQgW.js";import"./zeus-logo.png.asset-4yFwNq7V.js";import"./message-circle-CtkpBes8.js";import"./progress-DOQSq-zo.js";import"./arrow-right-Bx0VkmHo.js";import"./house-DIcHoZy2.js";import"./popover-dgxOn6dK.js";import"./index-CGBMzk55.js";import"./share-2-DK5lWBgg.js";import"./copy-D2YRjZcJ.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ce=ke("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),z="zeus_notify_contact",qe=({open:m,onOpenChange:x,partId:b,partName:v})=>{const{user:c}=Q(),[d,f]=n.useState(""),[g,s]=n.useState(""),[_,p]=n.useState(""),[j,y]=n.useState(!1),[N,o]=n.useState(!1);n.useEffect(()=>{if(m){o(!1),p("");try{const t=JSON.parse(localStorage.getItem(z)||"{}");t.name&&f(t.name),t.phone&&s(t.phone)}catch{}c&&w.from("profiles").select("full_name, phone").eq("id",c.id).maybeSingle().then(({data:t})=>{t!=null&&t.full_name&&f(r=>r||t.full_name),t!=null&&t.phone&&s(r=>r||t.phone)})}},[m,c]);const h=async()=>{const t=g.replace(/\D/g,"");if(d.trim().length<2){B.error("Please enter your name");return}if(t.length<10){B.error("Please enter a valid 10-digit mobile number");return}y(!0);try{const{error:r}=await w.rpc("submit_stock_notify_request",{p_part_id:b,p_customer_name:d.trim(),p_customer_phone:t,p_quantity:1,p_notes:_.trim()||null});if(r)throw r;localStorage.setItem(z,JSON.stringify({name:d.trim(),phone:t})),o(!0)}catch(r){console.error("Notify me error",r),B.error((r==null?void 0:r.message)||"Could not save your request. Please try again.")}finally{y(!1)}};return e.jsx(ce,{open:m,onOpenChange:x,children:e.jsx(me,{className:"sm:max-w-md",children:N?e.jsxs("div",{className:"text-center py-4",children:[e.jsx(he,{className:"h-12 w-12 text-green-600 mx-auto mb-3"}),e.jsx("h2",{className:"text-lg font-bold",children:"You're on the list"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-2",children:["We'll call or WhatsApp you on ",e.jsx("span",{className:"font-semibold",children:g})," as soon as"," ",e.jsx("span",{className:"font-semibold",children:v})," is back in stock."]}),e.jsx(l,{className:"mt-5 w-full h-11",onClick:()=>x(!1),children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsxs(de,{children:[e.jsxs(pe,{className:"flex items-center gap-2",children:[e.jsx(fe,{className:"h-5 w-5 text-primary"}),"Notify me when available"]}),e.jsxs(ue,{children:["Leave your details and we'll reach out the moment"," ",e.jsx("span",{className:"font-medium text-foreground",children:v})," is back in stock."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(q,{htmlFor:"notify-name",children:"Your name"}),e.jsx($,{id:"notify-name",value:d,maxLength:100,onChange:t=>f(t.target.value),placeholder:"e.g. Rahul Sharma",className:"h-11"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(q,{htmlFor:"notify-phone",children:"Mobile number"}),e.jsx($,{id:"notify-phone",type:"tel",inputMode:"numeric",value:g,maxLength:15,onChange:t=>s(t.target.value),placeholder:"10-digit mobile number",className:"h-11"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(q,{htmlFor:"notify-notes",children:"Note (optional)"}),e.jsx(xe,{id:"notify-notes",value:_,maxLength:300,onChange:t=>p(t.target.value),placeholder:"Bike model, quantity needed, etc.",rows:2})]})]}),e.jsx(l,{className:"w-full h-11 font-bold",onClick:h,disabled:j,children:j?e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"h-4 w-4 mr-2 animate-spin"})," Saving..."]}):"Notify me"})]})})})},$s=()=>{var O;const{partId:m}=Y(),x=G(),{addPart:b,items:v}=K(),[c,d]=n.useState(1),[f,g]=n.useState(!1),{data:s,isLoading:_}=R({queryKey:["quick-buy-part",m],queryFn:async()=>{const{data:a,error:i}=await w.from("public_spare_parts_catalog").select("id, name, short_description, description, customer_price, selling_price, image_url, image_urls, current_stock, is_sellable, active, part_number, 
6category, brand").eq("id",m).maybeSingle();if(i)throw i;return a},enabled:!!m}),p=(()=>{const i=[...Array.isArray(s==null?void 0:s.image_urls)?s.image_urls:[]];return s!=null&&s.image_url&&!i.includes(s.image_url)&&i.unshift(s.image_url),i.filter(Boolean)})(),[j,y]=n.useState(void 0);n.useEffect(()=>{y(p[0])},[p[0],s==null?void 0:s.id]),n.useEffect(()=>{s!=null&&s.id&&oe(s.id)},[s==null?void 0:s.id]);const{data:N}=R({queryKey:["quick-buy-related",s==null?void 0:s.category,s==null?void 0:s.id],enabled:!!(s!=null&&s.category),queryFn:async()=>{const{data:a,error:i}=await w.from("public_spare_parts_catalog").select("id, name, image_url, customer_price, selling_price").eq("is_sellable",!0).eq("active",!0).eq("category",s.category).neq("id",s.id).limit(6);if(i)throw i;return a??[]}});if(_)return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(k,{}),e.jsxs("main",{className:"flex-1 container max-w-3xl px-4 py-8 space-y-4",children:[e.jsx(T,{className:"h-64 w-full rounded-2xl"}),e.jsx(T,{className:"h-40 w-full rounded-2xl"})]}),e.jsx(je,{}),e.jsx(S,{})]});if(!s||!s.is_sellable||!s.active)return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(k,{}),e.jsxs("main",{className:"flex-1 container max-w-3xl px-4 py-16 text-center",children:[e.jsx(ye,{className:"h-10 w-10 mx-auto text-muted-foreground/40 mb-3"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Part not available"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"This spare part is not available for online purchase right now."}),e.jsx(l,{onClick:()=>x("/parts"),children:"Browse spare parts"})]}),e.jsx(S,{}),e.jsx(M,{})]});const o=Number(s.customer_price??s.selling_price??0),h=o*c,t=typeof s.current_stock=="number"?s.current_stock:null,r=!1,D=v.reduce((a,i)=>a+i.price*i.quantity,0)+h,F=ie(D),J=Math.max(0,ne-D),E={id:s.id,name:s.name,price:o,image_url:s.image_url||void 0,part_number:s.part_number||void 0,short_description:s.short_description||void 0},I=()=>b(E,c),L=()=>{b(E,c),x("/parts/checkout")};return e.jsxs(e.Fragment,{children:[e.jsx(se,{title:`${s.name} | Buy Online COD | Zeus Motor Solutions`,description:s.short_description||((O=s.description)==null?void 0:O.slice(0,155))||`Buy ${s.name} online with cash on delivery across Pune. Genuine spare parts from Zeus Motor Solutions.`,keywords:[s.name,s.brand,s.category,s.part_number,"spare parts Pune","buy online COD"].filter(Boolean).join(", "),ogType:"product",ogImage:s.image_url||"/icon-512x512.png",canonicalUrl:U(`/quick-buy/${s.id}`),productPrice:o,productCurrency:"INR",productAvailability:"in stock"}),e.jsxs(V,{children:[e.jsx("script",{type:"application/ld+json",children:JSON.stringify(W({id:s.id,name:s.name,image_url:s.image_url,description:s.description,short_description:s.short_description,part_number:s.part_number,brand:s.brand,category:s.category,price:o,stock:t,inStock:!r}))}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(Z([{name:"Home",url:"/"},{name:"Spare Parts",url:"/parts"},...s.category?[{name:s.category,url:`/parts?category=${encodeURIComponent(s.category)}`}]:[],{name:s.name,url:`/quick-buy/${s.id}`}]))}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(X(ee({name:s.name,inStock:!r,price:o})))})]}),e.jsxs("div",{className:"min-h-screen flex flex-col pb-32 md:pb-0",children:[e.jsx(k,{}),e.jsxs("main",{className:"flex-1 container max-w-4xl px-4 py-4 md:py-8",children:[e.jsxs("button",{onClick:()=>x(-1),className:"text-sm text-muted-foreground flex items-center gap-1 mb-4 hover:text-foreground",children:[e.jsx(Ne,{className:"h-4 w-4"})," Back"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"rounded-2xl border overflow-hidden",children:e.jsx(P,{src:j,alt:`${s.name} spare part`,iconClassName:"h-16 w-16",eager:!0})}),p.length>1&&e.jsx("div",{className:"flex gap-2 overflow-x-auto scrollbar-hide",children:p.map(a=>e.jsx("button",{type:"button",onClick:()=>y(a),className:`h-16 w-16 shrink-0 overflow-hidden rounded-lg border ${a===j?"border-primary ring-2 ring-accent/40":"border-border"}`,"aria-label":"View photo",children:e.jsx(P,{src:a,alt:s.name,iconClassName:"h-5 w-5"})},a))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[s.brand&&e.jsx(C,{variant:"secondary",children:s.brand}),s.category&&e.jsx(C,{variant:"outline",children:s.category}),t!==null&&t>0&&e.jsxs(C,{variant:"outline",className:"text-muted-foreground",children:[t," in stock"]})]}),e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold",children:s.name}),e.jsx(le,{partId:s.id,partName:s.name,price:o,className:"mt-1"})]}),s.part_number&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono",children:s.part_number}),s.short_description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:s.short_description}),e.jsxs("div",{className:"mt-4 flex items-end gap-2",children:[e.jsx("span",{className:"text-3xl font-bold text-primary",children:u(o)}),e.jsx("span",{className:"text-xs text-muted-foreground pb-1.5",children:"incl. of all charges"})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:"Quantity"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(l,{size:"icon",variant:"outline",className:"h-9 w-9",onClick:()=>d(a=>Math.max(1,a-1)),"aria-label":"Decrease quantity",children:e.jsx(be,{className:"h-4 w-4"})}),e.jsx("span",{className:"w-10 text-center font-semibold",children:c}),e.jsx(l,{size:"icon",variant:"outline",className:"h-9 w-9",onClick:()=>d(a=>a+1),"aria-label":"Increase quantity",children:e.jsx(ve,{className:"h-4 w-4"})})]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["= ",e.jsx("span",{className:"font-semibold text-foreground",children:u(h)})]})]}),e.jsxs("div",{className:"mt-5 hidden md:grid grid-cols-2 gap-3",children:[e.jsxs(l,{variant:"outline",className:"h-12",onClick:I,children:[e.jsx(H,{className:"h-4 w-4 mr-2"})," Add to cart"]}),e.jsxs(l,{className:"h-12 font-bold",onClick:L,children:["Buy now · ",u(h)]})]}),e.jsx(te,{className:"mt-5",children:e.jsxs(ae,{className:"p-4 text-sm space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_e,{className:"h-4 w-4 text-primary"}),"Cash on Delivery — pay when it arrives"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4 text-primary"}),F===0?e.jsx("span",{className:"text-green-600 font-medium",children:"FREE delivery across Pune"}):e.jsxs("span",{children:["Delivery ",u(F)," · add ",u(J)," more for FREE"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ce,{className:"h-4 w-4 text-primary"}),"Genuine parts, fitment help available"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4 text-primary"}),"No account needed to order"]})]})})]})]}),s.description&&e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"font-bold text-lg mb-2",children:"Details"}),e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:s.description})]}),N&&N.length>0&&e.jsxs("div",{className:"mt-10",children:[e.jsx(re,{className:"mb-5"}),e.jsx("h2",{className:"font-bold text-lg mb-3",children:"Frequently bought with this"}),e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-2 -mx-4 px-4",children:N.map(a=>e.jsxs(A,{to:`/quick-buy/${a.id}`,className:"w-36 shrink-0 rounded-xl border p-2 hover:border-primary transition-colors",children:[e.jsx("div",{className:"rounded-lg border overflow-hidden mb-2",children:e.jsx(P,{src:a.image_url,alt:a.name,iconClassName:"h-6 w-6"})}),e.jsx("p",{className:"text-xs font-medium line-clamp-2",children:a.name}),e.jsx("p",{className:"text-sm font-bold text-primary mt-1",children:u(Number(a.customer_price??a.selling_price??0))})]},a.id))})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground text-center mt-8",children:["Need fitment help? ",e.jsx(A,{to:"/contact",className:"underline",children:"Contact us"}),"."]})]}),e.jsx("div",{className:"md:hidden fixed bottom-0 left-0 right-0 z-[10000] border-t bg-background/95 backdrop-blur px-4 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] flex gap-2",children:e.jsxs(e.Fragment,{children:[e.jsxs(l,{variant:"outline",className:"h-12 flex-1",onClick:I,children:[e.jsx(H,{className:"h-4 w-4 mr-2"})," Add"]}),e.jsxs(l,{className:"h-12 flex-[1.4] font-bold",onClick:L,children:["Buy now · ",u(h)]})]})}),e.jsx(qe,{open:f,onOpenChange:g,partId:s.id,partName:s.name}),e.jsx(S,{}),e.jsx("div",{className:"hidden md:block",children:e.jsx(M,{})})]})]})};export{$s 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.