PageSourceSearch

https://grubz.co.za/assets/PromoterOnboarding-DDYkZ0XD.js

js grubz.co.za collected 2026-10-07 15:15:28 UTC 32,214 bytes, 1 lines download raw bytes

1import{ao as le,h as de,r as l,s as S,j as e,k as ce,N as me,Q as f,ad as ue,B as c,H as B,a6 as pe,ae as he,af as ge,ag as C,a0 as K,b6 as R,I as T,J as F,C as b,aj as E,ak as _,al as G,a as v,ax as ye,aN as xe,S as fe,b0 as Y,e as h,aa as be,a$ as ve}from"./index-Btl-MrG-.js";import{u as je}from"./useReferralCode-4dXGrapw.js";import Ne from"./Footer-Dppga8e9.js";import{P as we}from"./progress-AoDvvFej.js";import{T as ke}from"./textarea-B7VGLzuY.js";import{S as Ce,a as Re,b as Ee,c as _e,d as Se}from"./select-CrH2Rvqq.js";import{P as Te}from"./PrintableFlyer-CknYiFI6.js";import{m as p}from"./proxy-Bxr-b5bk.js";import{P as $}from"./printer-BPYrk-yK.js";import{M}from"./megaphone-Sd60WEUG.js";import{T as Ae}from"./trophy-Br79LcdD.js";import{C as L}from"./circle-check-DvOAEI7P.js";import{C as ze}from"./chart-column-UnJzytsg.js";import{Q as V}from"./qr-code-C4WcDEwx.js";import{C as X}from"./clipboard-list-Co8977E8.js";import{E as Pe}from"./external-link-DXKeNw2-.js";import{C as D}from"./copy-CTesxbcM.js";import{D as Ge}from"./download-BDiKlR2d.js";import{T as Me}from"./target-CjGXb-ov.js";import{F as We}from"./file-text-CpNI1q7N.js";import{f as J,s as Z}from"./format-CxwiUPb9.js";import"./separator-DvxCfcIQ.js";import"./collapsible-BjoJ52T1.js";import"./mail-CWbEyMxb.js";import"./phone-djQLVdm1.js";import"./chevron-down-Bv-G-uR_.js";import"./index-BdQq_4o_.js";import"./index-BfSTLg7g.js";import"./differenceInCalendarDays-CmU0Rc8N.js";const x={hidden:{opacity:0,y:24},visible:a=>({opacity:1,y:0,transition:{delay:a*.08,duration:.45,ease:[0,0,.2,1]}})},z=[{key:"intro",title:"Welcome to Grubz",description:"Learn about our mission and how you fit in",duration:"5 min",icon:e.jsx(be,{className:"h-5 w-5"}),content:["Grubz is a student-first food delivery platform operating at NWU (Potchefstroom & Mahikeng) and VUT (Vanderbijlpark).","Our mission is to make healthy, affordable meals accessible to every student — replacing expensive takeaways and unhealthy fast food.","As a promoter, you are the face of Grubz on campus. You help students discover better food options while earning EQB credits and cash.","We offer meals from R45, grocery delivery, wellness drinks, West African cuisine, and group ordering to split delivery costs.","Every referral you bring earns you 10 EQB Credits. Hit your monthly target of 20 referrals and earn a R100 cash bonus on top."],quiz:[{question:"Which campuses does Grubz currently serve?",options:["UJ & Wits","NWU & VUT","UCT & Stellenbosch","UNISA & TUT"],answer:1},{question:"How many EQB credits do you earn per referral?",options:["5","10","15","20"],answer:1}]},{key:"products",title:"Our Products & Services",description:"Understand every category we offer so you can pitch confidently",duration:"10 min",icon:e.jsx(K,{className:"h-5 w-5"}),content:["🍽️ MEAL PLANS — Weekly chef-prepared meals from R450/week. Options include balanced, high-protein, and vegetarian plans. Each meal is calorie-counted and delivered fresh.","🛒 GROCERIES — Pantry staples, fresh produce, snacks, and household items delivered to res. Group grocery orders qualify for free delivery over R500.","🥤 WELLNESS DRINKS — Detox juices, immunity boosters, protein smoothies, and herbal health shots. Subscription plans available for regular customers.","🌍 WEST AFRICAN CUISINE — Authentic Jollof Rice, Egusi Soup, Ewa Agoyin, Pap & Chakalaka. Popular for students missing home-cooked African meals.","🍔 TAKEAWAY MEALS — Burgers, loaded bowls, wraps, and combo deals for quick grab-and-go meals. Individual meals from R45.","👥 GROUP ORDERS — Students pool orders together, share one delivery fee (R15/person), and everyone picks their own meal. Perfect for res flatmates.","💰 EQB CREDITS — Our loyalty currency. Earn from purchases (1 credit per R50), referrals, challenges, and reviews. Use credits to pay for orders or convert to cash."],quiz:[{question:"What is the minimum meal price on Grubz?",options:["R25","R35","R45","R55"],answer:2},{question:"How much is the group order delivery fee per person?",options:["R10","R15","R20","R25"],answer:1}]},{key:"referrals",title:"How Referrals Work",description:"Master the referral system and maximise your earnings",duration:"8 min",icon:e.jsx(ve,{className:"h-5 w-5"}),content:["Every Grubz user gets a unique referral code. As a promoter, your co
1de is your most important tool.","When someone signs up using your code AND places their first order that gets delivered, both of you earn 10 EQB Credits.","Your referral link format: grubz.co.za/auth?ref=YOUR_CODE — share this via WhatsApp, on flyers, or verbally.","QR codes on your flyers automatically embed your referral code. When students scan, they land on the sign-up page with your code pre-filled.","Track your referrals in real-time on this dashboard. You can see total referrals, pending ones (signed up but not yet ordered), and completed ones.","Monthly target: 20 completed referrals = R100 cash bonus + 200 EQB Credits. Top referrers each month get featured on the Grubz leaderboard.","Pro tip: Focus on getting your referrals to PLACE THEIR FIRST ORDER. A sign-up alone doesn't count — the referral completes when their first order is delivered."],quiz:[{question:'When does a referral count as "completed"?',options:["When they sign up","When they add items to cart","When their first order is delivered","After 7 days"],answer:2}]},{key:"pitch",title:"The Perfect Pitch",description:"Learn conversation frameworks that convert students into users",duration:"7 min",icon:e.jsx(M,{className:"h-5 w-5"}),content:['THE 30-SECOND ELEVATOR PITCH: "Hey! You know how we spend like R800+ a week on food between takeaways and groceries? I found this app called Grubz — they deliver meals from R45 straight to res, and if you use my code you get free credits to spend."','OBJECTION: "I can cook for cheaper" → "True, but factor in your time, electricity, and groceries — most students actually spend more cooking when you add it all up. Plus Grubz meals are chef-prepared and calorie-counted."',`OBJECTION: "I don't trust food delivery" → "Grubz is student-run and student-focused. We operate right here on campus. Check the reviews from other students in your res."`,'OBJECTION: "Delivery fees are expensive" → "Do a group order with your flatmates! The delivery fee is only R15 per person when you order together. Free delivery on orders over R500."',`CLOSING TECHNIQUE: Always end with action — "Let me scan this QR for you real quick" or "What's your number? I'll WhatsApp you the link." Don't just say "check it out."`,"TIMING: Best times to approach students are lunch hour (12-2pm), dinner prep time (5-7pm), and during communal kitchen congestion."]},{key:"events",title:"Running Campus Events",description:"How to plan and execute successful campus activations",duration:"12 min",icon:e.jsx(Me,{className:"h-5 w-5"}),content:["EVENT TYPES: Tasting events (bring sample meals), study session sponsorship (provide snacks), res common room pop-ups, orientation week stalls.","PLANNING: Book a spot at the res common room or campus hub 1 week in advance. Coordinate with your campus rep lead for materials and budget.","MATERIALS NEEDED: Printed flyers (use the Flyer tab), your phone for QR scanning, WhatsApp broadcast list ready, and sample menus.","DURING THE EVENT: Set up a visible station with flyers. Approach students proactively. Demonstrate the ordering process on your phone. Help them sign up on the spot.","FOLLOW-UP: Within 24 hours, send a WhatsApp message to everyone who signed up reminding them to place their first order. Use the pre-written messages in the Pitch Cards tab.","LOG YOUR EVENT: After each event, log it in your Weekly Report with attendance numbers. Events earn you 5 EQB Credits automatically.","SUCCESS METRIC: A good event converts at least 30% of attendees into sign-ups, and 50% of sign-ups into first orders within the week."],quiz:[{question:"How many EQB credits do you earn per campus event logged?",options:["2","5","10","15"],answer:1}]},{key:"materials",title:"Using Marketing Materials",description:"Master flyers, QR codes, WhatsApp scripts, and social media",duration:"6 min",icon:e.jsx(We,{className:"h-5 w-5"}),content:["FLYERS: Use the Flyer Generator tab to create personalised A5 flyers. Choose from 5 categories (General, Wellness, African Meals, Takeaway, Groceries). Always include your hostel name for tracking.","QR CODES: Every flyer includes a QR code linked to your referral code. Students scan → land on sign-up → your code is pre-filled. You can also get a standalone QR in the Marketing Hub.","WHATSAPP: Use the pre-written messages in the Pitch Cards tab. Send to res group chats, study groups, and individual contacts. Personalise the message with the student's name.","SOCIAL MEDIA: Post food photos from Grubz with your referral link. Use hashtags: #GrubzOnCampus #StudentMeals #EatBetterSpendLess. Tag @grubz_sa.","PLACEMENT: Put flyers at res notice boards, laundry rooms, common kitchens, library entrance, and student centre. Replace worn flyers weekly.","TRACKING: Every flyer download and QR scan is tracked in the system. You can see which hostel/category performs best in your Weekly Report."]}],Ie=[{value:"general",label:"General — Student Savings"},{value:"wellness",label:"Wellness Drinks"},{value:"african-meals",label:"African Meals"},{value:"takeaway",label:"Takeaway Meals"},{value:"groceries",label:"Groceries"}],Oe=[{emoji:"💰",title:"The Money Pitch",points:["Average student spends R800+/week on groceries & takeaways.","Grubz meal plans start at R450/week — R350 back in your pocket.","Use code HOSTEL30 for 30% off first order."]},{emoji:"⚡",title:"The Convenience Pitch",points:["No cooking, no cleaning, no shopping trips.","Meals delivered straight to your hostel.","Order in under 2 minutes from your phone."]},{emoji:"👥",title:"Group Orders",points:["Pool orders with flatmates — one delivery, split the fee (R15/person).","Free delivery on orders over R500 (easy with 3-4 people).","Everyone picks their own meals, one person checks out."]},{emoji:"🍽️",title:"Meal Plans",points:["Chef-prepared, calorie-counted meals delivered weekly.","Balanced, high-protein, and vegetarian options available.","Cheaper than cooking yourself when you factor in time and electricity."]},{emoji:"🛒",title:"Groceries",points:["No more lugging bags from Shoprite — get it delivered to res.","Group grocery runs: pool with flatmates for free delivery over R500.","Fresh produce, pantry staples, snacks — all in one order."]},{emoji:"🥤",title:"Wellness Drinks",points:["Detox juices, immunity boosters, and protein smoothies.","Subscribe weekly and never miss your morning health shot.","Great for gym-goers and health-conscious students."]},{emoji:"🌍",title:"West African Cuisine",points:["Authentic Jollof Rice, Egusi Soup, Ewa Agoyin — just like home.","Perfect for international students missing home-cooked food.","Weekly specials and combo deals for African cuisine lovers."]},{emoji:"🍔",title:"Takeaway Meals",points:["Burgers, loaded bowl
1s, wraps — from R45 per meal.","Combo deals: meal + drink from R65. Way cheaper than Uber Eats.","Quick grab-and-go, no cooking, no waiting in long queues."]},{emoji:"💎",title:"EQB Credits & Loyalty",points:["Earn 1 credit per R50 spent — they add up fast.","Get 10 credits just for referring a friend who orders.","Complete weekly challenges for bonus credits. Use credits to pay or convert to cash."]}],gs=()=>{const{user:a,loading:d}=le(),m=de(),{referralCode:o,referralLink:n,shareReferralLink:j}=je(),[g,N]=l.useState({}),[w,W]=l.useState(null),[A,I]=l.useState({total:0}),[r,u]=l.useState(!0),[y,ee]=l.useState("general"),[H,se]=l.useState("");l.useEffect(()=>{!d&&!a&&m("/auth")},[a,d,m]),l.useEffect(()=>{a&&(re(),ae())},[a]);const re=async()=>{try{const{data:s}=await S.from("promoter_training_progress").select("module_key, completed_at").eq("user_id",a==null?void 0:a.id),t={};s==null||s.forEach(i=>{i.completed_at&&(t[i.module_key]=!0)}),N(t)}catch(s){console.error("Error loading progress:",s)}finally{u(!1)}},ae=async()=>{try{const{data:s}=await S.from("referral_codes").select("total_referrals").eq("user_id",a==null?void 0:a.id).single();s&&I({total:s.total_referrals})}catch(s){console.error("Error loading referral stats:",s)}},te=async s=>{try{const{error:t}=await S.from("promoter_training_progress").upsert({user_id:a==null?void 0:a.id,module_key:s,completed_at:new Date().toISOString()},{onConflict:"user_id,module_key"});if(t)throw t;N(i=>({...i,[s]:!0})),h.success("Module completed!")}catch{h.error("Failed to save progress")}},O=async(s,t="Copied!")=>{try{await navigator.clipboard.writeText(s),h.success(t)}catch{h.error("Failed to copy")}},oe=()=>{if(!n)return;const s=`https://api.qrserver.com/v1/create-qr-code/?size=600x600&data=${encodeURIComponent(n)}`,t=document.createElement("a");t.href=s,t.download=`grubz-referral-qr-${o}.png`,t.click(),h.success("QR code downloading!")},U=Object.values(g).filter(Boolean).length,q=U/z.length*100;if(d||r)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})});const ie=o||"";return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(ce,{title:"Promoter Hub — Grubz",description:"Your one-stop resource for promoting Grubz on campus.",noIndex:!0,canonical:"/promoter"}),e.jsx(me,{}),e.jsxs("section",{className:"relative overflow-hidden bg-gradient-to-br from-primary via-primary/90 to-accent/80 text-primary-foreground",children:[e.jsx("div",{className:"absolute inset-0 opacity-10 bg-[radial-gradient(circle_at_30%_40%,hsl(var(--secondary)),transparent_60%)]"}),e.jsx("div",{className:"container max-w-6xl mx-auto px-4 py-12 md:py-16 relative z-10",children:e.jsxs(p.div,{initial:"hidden",animate:"visible",className:"flex flex-col md:flex-row items-center gap-8",children:[e.jsxs(p.div,{custom:0,variants:x,className:"flex-1 space-y-4",children:[e.jsxs(f,{className:"bg-secondary text-secondary-foreground font-bold text-xs uppercase tracking-wider",children:[e.jsx(ue,{className:"h-3 w-3 mr-1"})," Campus Promoter"]}),e.jsxs("h1",{className:"text-3xl md:text-5xl font-black leading-tight",children:["Your Promoter",e.jsx("br",{}),"Command Centre"]}),e.jsx("p",{className:"text-primary-foreground/80 text-lg max-w-md",children:"Flyers, referral tools, talking points, and training — everything to grow Grubz on campus."}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx(c,{asChild:!0,variant:"secondary",size:"lg",className:"font-bold",children:e.jsxs("a",{href:"#flyers",children:[e.jsx($,{className:"h-4 w-4 mr-2"})," Build a Flyer"]})}),e.jsx(c,{asChild:!0,variant:"outline",size:"lg",className:"bg-transparent border-primary-foreground/30 text-primary-foreground hover:bg-primary-foreground/10 font-bold",children:e.jsxs(B,{to:"/marketing",children:[e.jsx(M,{className:"h-4 w-4 mr-2"})," Marketing Hub"]})})]})]}),e.jsxs(p.div,{custom:1,variants:x,className:"grid grid-cols-2 gap-3 w-full md:w-auto",children:[e.jsx(P,{icon:e.jsx(Ae,{className:"h-5 w-5 text-secondary"}),label:"Referrals",value:A.total}),e.jsx(P,{icon:e.jsx(L,{className:"h-5 w-5 text-primary"}),label:"Training",value:`${U}/${z.length}`}),e.jsx(P,{icon:e.jsx(pe,{className:"h-5 w-5 text-accent"}),label:"Your Code",value:o||"---",mono:!0}),e.jsx(P,{icon:e.jsx(ze,{className:"h-5 w-5 text-secondary"}),label:"Progress",value:`${Math.round(q)}%`})]})]})})]}),e.jsxs("main",{className:"container max-w-6xl mx-auto px-4 py-10",children:[e.jsxs(he,{defaultValue:"flyers",className:"space-y-8",children:[e.jsxs(ge,{className:"grid w-full grid-cols-2 md:grid-cols-5 ga
1p-1 h-auto p-1 bg-muted rounded-xl",children:[e.jsxs(C,{value:"flyers",className:"gap-1.5 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-lg py-2.5 text-xs md:text-sm font-semibold",children:[e.jsx($,{className:"h-4 w-4"})," Flyers"]}),e.jsxs(C,{value:"referral",className:"gap-1.5 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-lg py-2.5 text-xs md:text-sm font-semibold",children:[e.jsx(V,{className:"h-4 w-4"})," Referral Tools"]}),e.jsxs(C,{value:"pitches",className:"gap-1.5 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-lg py-2.5 text-xs md:text-sm font-semibold",children:[e.jsx(M,{className:"h-4 w-4"})," Pitch Cards"]}),e.jsxs(C,{value:"training",className:"gap-1.5 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-lg py-2.5 text-xs md:text-sm font-semibold",children:[e.jsx(K,{className:"h-4 w-4"})," Training"]}),e.jsxs(C,{value:"report",className:"gap-1.5 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-lg py-2.5 text-xs md:text-sm font-semibold",children:[e.jsx(X,{className:"h-4 w-4"})," Weekly Report"]})]}),e.jsxs(R,{value:"flyers",id:"flyers",className:"space-y-6",children:[e.jsxs(p.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},children:[e.jsxs(p.div,{custom:0,variants:x,className:"flex flex-col sm:flex-row items-start sm:items-end justify-between gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Build Your Flyer"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Personalised with your name & referral QR. Download or print."})]}),e.jsx(c,{asChild:!0,variant:"outline",size:"sm",className:"gap-1.5 text-xs",children:e.jsxs(B,{to:"/marketing",children:[e.jsx(Pe,{className:"h-3.5 w-3.5"})," Full Marketing Hub"]})})]}),e.jsxs(p.div,{custom:1,variants:x,className:"grid sm:grid-cols-2 gap-4 mb-6",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{className:"text-sm font-medium",children:"Hostel / Residence"}),e.jsx(F,{placeholder:"e.g. NWU Potch Res",value:H,onChange:s=>se(s.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Embedded in QR for campaign tracking."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(T,{className:"text-sm font-medium",children:"Flyer Category"}),e.jsxs(Ce,{value:y,onValueChange:s=>ee(s),children:[e.jsx(Re,{children:e.jsx(Ee,{})}),e.jsx(_e,{children:Ie.map(s=>e.jsx(Se,{value:s.value,children:s.label},s.value))})]})]})]})]}),e.jsx(Te,{hostelName:H,repName:ie,category:y})]}),e.jsx(R,{value:"referral",className:"space-y-6",children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs(b,{className:"border-2 border-primary/20",children:[e.jsxs(E,{children:[e.jsxs(_,{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-primary"})," Your Referral Code"]}),e.jsx(G,{children:"Share this code with students to earn EQB credits"})]}),e.jsxs(v,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 bg-primary/5 border border-primary/20 rounded-xl",children:[e.jsx("span",{className:"text-3xl font-mono font-black text-primary tracking-widest",children:o||"Loading..."}),e.jsx(c,{variant:"outline",size:"icon",onClick:()=>O(o||"","Referral code copied!"),disabled:!o,children:e.jsx(D,{className:"h-4 w-4"})})]}),n&&e.jsxs("div",{className:"p-3 bg-muted rounded-lg",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Your referral link:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs break-all font-mono text-foreground flex-1",children:n}),e.jsx(c,{variant:"ghost",size:"icon",className:"shrink-0 h-7 w-7",onClick:()=>O(n,"Referral link copied!"),children:e.jsx(D,{className:"h-3.5 w-3.5"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(c,{className:"font-semibold",onClick:j,disabled:!n,children:[e.jsx(ye,{className:"h-4 w-4 mr-2"})," Share Link"]}),e.jsxs(c,{variant:"outline",onClick:oe,disabled:!n,children:[e.jsx(Ge,{className:"h-4 w-4 mr-2"})," Download QR"]})]}),n&&e.jsx("div",{className:"flex justify-center pt-2",children:e.jsx("img",{src:`https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=${encodeURIComponent(n)}`,alt:"Your referral QR code",className:"w-40 h-40 rounded-xl border border-border p-2 bg-card"})})]})]}),e.jsxs(b,{className:"bg-gradient-to-br from-secondary/10 to-accent/5 border-secondary/20",children:[e.jsxs(E,{children:[e.jsxs(_,{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"h-5 w-5 text-secondary"})," Earning Potential"]}),e.jsx(G,{children:"What you can earn as a Grubz promoter"})]}),e.jsx(v,{className:"space-y-3",children:[{label:"Per successful referral",value:"10 EQB Credits",variant:"default"},{label:"Monthly target (20 referrals)",value:"200 EQB Credits",variant:"secondary"},{label:"Bonus for hitting target",value:"R100 Cash",variant:"outline"},{label:"Per campus event logged",value:"5 EQB Credits",variant:"default"},{label:"Per approved review",value:"5 EQB Credits",variant:"outline"}].map(s=>e.jsxs("div",{className:"flex justify-between items-center p-3 bg-background rounded-lg border",children:[e.jsx("span",{className:"text-sm text-foreground",children:s.label}),e.jsx(f,{variant:s.variant,className:"font-bold",children:s.value})]},s.label))})]})]})}),e.jsxs(R,{value:"pitches",className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-1",children:"Talking Points by Category"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Qu
1ick-reference pitch cards for every product category. Use these in hostel visits, WhatsApp chats, and campus events."})]}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Oe.map((s,t)=>e.jsx(p.div,{custom:t,initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:x,children:e.jsxs(b,{className:"h-full border-2 hover:border-primary/30 transition-colors",children:[e.jsx(E,{className:"pb-2",children:e.jsxs(_,{className:"text-base flex items-center gap-2",children:[e.jsx("span",{className:"text-xl",children:s.emoji})," ",s.title]})}),e.jsx(v,{children:e.jsx("ul",{className:"space-y-2",children:s.points.map((i,k)=>e.jsxs("li",{className:"text-sm text-muted-foreground flex gap-2",children:[e.jsx("span",{className:"text-primary font-bold shrink-0",children:"•"}),e.jsx("span",{children:i})]},k))})})]})},s.title))}),e.jsxs(b,{className:"border-dashed bg-muted/50",children:[e.jsxs(E,{className:"pb-2",children:[e.jsx(_,{className:"text-base",children:"📱 Ready-to-Send WhatsApp Messages"}),e.jsx(G,{children:"Tap to copy any message — personalised with your referral code"})]}),e.jsx(v,{className:"space-y-3",children:[`Hey! 👋 I've been using Grubz for campus meals and it's amazing. Meals from R45, delivered to res. Use my code ${o||"GRUBZ"} for free credits → grubz.co.za/welcome`,"Yo, tired of cooking? 🍳 Grubz delivers meals & groceries straight to your hostel. Free delivery on orders over R500 if you order with friends. Check it: grubz.co.za/welcome",`Group order tonight? 🔥 Everyone picks their own meal, one person checks out, R15 delivery per person. Use code ${o||"GRUBZ"} → grubz.co.za/group-order`,`Missing home food? 🌍 Grubz has authentic Jollof Rice, Egusi Soup, Pap & Chakalaka delivered to res. Use code ${o||"GRUBZ"} for credits → grubz.co.za/west-african`,`Need a health reset? 🥤 Grubz has detox juices, immunity boosters & protein smoothies delivered to campus. Subscribe weekly! Code: ${o||"GRUBZ"} → grubz.co.za/wellness-drinks`,`Grocery run without leaving res 🛒 Fresh produce, snacks, pantry staples — all delivered. Group order with flatmates for free delivery! ${o||"GRUBZ"} → grubz.co.za`].map((s,t)=>e.jsxs("div",{className:"flex items-start gap-2 p-3 bg-background rounded-lg border text-sm cursor-pointer hover:border-primary/30 transition-colors",onClick:()=>O(s,"Message copied!"),children:[e.jsx("p",{className:"flex-1 text-muted-foreground",children:s}),e.jsx(D,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-1"})]},t))})]})]}),e.jsxs(R,{value:"training",className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Training Modules"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete these to become a certified Grubz promoter"})]}),e.jsxs(f,{variant:"outline",className:"text-sm font-semibold gap-1.5 px-3 py-1.5",children:[e.jsx(fe,{className:"h-3.5 w-3.5 text-secondary"})," ",U,"/",z.length," done"]})]}),e.jsx(we,{value:q,className:"h-2.5 mb-4"}),e.jsx("div",{className:"space-y-3",children:z.map((s,t)=>e.jsx(p.div,{custom:t,initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:x,children:e.jsxs("div",{className:`border-2 rounded-xl transition-all ${g[s.key]?"bg-primary/5 border-primary/20":"hover:border-muted-foreground/20 border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer",onClick:()=>W(w===s.key?null:s.key),children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`p-2.5 rounded-xl ${g[s.key]?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:s.icon}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.description}),e.jsx(f,{variant:"outline",className:"mt-1 text-xs",children:s.duration})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[g[s.key]&&e.jsxs(f,{className:"bg-primary text-primary-foreground font-semibold gap-1",children:[e.jsx(L,{className:"h-3.5 w-3.5"})," Done"]}),e.jsx(Y,{className:`h-4 w-4 text-muted-foreground transition-transform ${w===s.key?"rotate-90":""}`})]})]}),w===s.key&&e.jsxs("div",{className:"px-4 pb-4 border-t border-border/50",children:[e.jsx("div",{className:"pt-4 space-y-3",children:s.content.map((i,k)=>e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:i},k))}),s.quiz&&s.quiz.length>0&&e.jsxs("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground mb-3",children:"📝 Quick Quiz"}),s.quiz.map((i,k)=>e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"text-sm text-foreground font-medium mb-2",children:i.question}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:i.options.map((ne,Q)=>e.jsx(c,{variant:"outline",size:"sm",className:`text-xs justify-start ${Q===i.answer?"border-primary/50 hover:bg-primary/10":""}`,onClick:()=>{Q===i.answer?h.success("Correct! ✅"):h.error("Not quite — try again!")},children:ne},Q))})]},k))]}),!g[s.key]&&e.jsxs(c,{className:"w-full mt-4 font-semibold",onClick:()=>te(s.key),children:[e.jsx(L,{className:"h-4 w-4 mr-2"})," Mark as Complete"]})]})]})},s.key))})]}),e.jsx(R,{value:"report",children:e.jsx(Ue,{userId:(a==null?void 0:a.id)||""})})]}
1),e.jsx(p.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},custom:0,variants:x,className:"mt-12",children:e.jsx(b,{className:"bg-gradient-to-r from-primary to-primary/80 text-primary-foreground border-none",children:e.jsxs(v,{className:"py-8 flex flex-col sm:flex-row items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-bold",children:"Need more marketing tools?"}),e.jsx("p",{className:"text-primary-foreground/80 text-sm",children:"Custom QR codes, key links, campaign tips in the full Marketing Hub."})]}),e.jsx(c,{asChild:!0,variant:"secondary",size:"lg",className:"font-bold shrink-0",children:e.jsxs(B,{to:"/marketing",children:[e.jsx(M,{className:"h-4 w-4 mr-2"})," Open Marketing Hub ",e.jsx(Y,{className:"h-4 w-4 ml-2"})]})})]})})})]}),e.jsx(Ne,{})]})},P=({icon:a,label:d,value:m,mono:o})=>e.jsxs("div",{className:"bg-primary-foreground/10 backdrop-blur-sm rounded-xl p-4 border border-primary-foreground/10 min-w-[140px]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a,e.jsx("span",{className:"text-xs uppercase tracking-wider opacity-70",children:d})]}),e.jsx("p",{className:`text-xl font-bold ${o?"font-mono":""}`,children:m})]}),Ue=({userId:a})=>{const[d,m]=l.useState({monday_signups:0,tuesday_signups:0,wednesday_signups:0,thursday_signups:0,friday_signups:0,saturday_signups:0,sunday_signups:0,flyers_distributed:0,events_attended:0,social_media_posts:0,challenges_faced:"",wins_highlights:"",notes:""}),[o,n]=l.useState(!1),[j,g]=l.useState(!1),N=J(Z(new Date,{weekStartsOn:1}),"yyyy-MM-dd");l.useEffect(()=>{w()},[a]);const w=async()=>{const{data:r}=await S.from("promoter_weekly_reports").select("*").eq("user_id",a).eq("week_start_date",N).single();r&&(m({monday_signups:r.monday_signups||0,tuesday_signups:r.tuesday_signups||0,wednesday_signups:r.wednesday_signups||0,thursday_signups:r.thursday_signups||0,friday_signups:r.friday_signups||0,saturday_signups:r.saturday_signups||0,sunday_signups:r.sunday_signups||0,flyers_distributed:r.flyers_distributed||0,events_attended:r.events_attended||0,social_media_posts:r.social_media_posts||0,challenges_faced:r.challenges_faced||"",wins_highlights:r.wins_highlights||"",notes:r.notes||""}),g(!0))},W=async()=>{n(!0);try{const{error:r}=await S.from("promoter_weekly_reports").upsert({user_id:a,week_start_date:N,...d,submitted_at:new Date().toISOString()},{onConflict:"user_id,week_start_date"});if(r)throw r;h.success(j?"Report updated!":"Report submitted!"),g(!0)}catch{h.error("Failed to submit report")}finally{n(!1)}},A=[{key:"monday_signups",label:"Mon"},{key:"tuesday_signups",label:"Tue"},{key:"wednesday_signups",label:"Wed"},{key:"thursday_signups",label:"Thu"},{key:"friday_signups",label:"Fri"},{key:"saturday_signups",label:"Sat"},{key:"sunday_signups",label:"Sun"}],I=A.reduce((r,u)=>r+d[u.key],0);return e.jsxs(b,{className:"border-2",children:[e.jsx(E,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(_,{className:"flex items-center gap-2",children:[e.jsx(X,{className:"h-5 w-5 text-primary"})," Weekly Activity Report"]}),e.jsxs(G,{children:["Week of ",J(Z(new Date,{weekStartsOn:1}),"MMMM d, yyyy"),j&&e.jsx(f,{variant:"outline",className:"ml-2",children:"Draft saved"})]})]}),e.jsxs(f,{variant:"secondary",className:"text-lg font-bold px-3",children:[I," sign-ups"]})]})}),e.jsxs(v,{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx(T,{className:"text-sm font-semibold mb-3 block",children:"Daily Sign-ups"}),e.jsx("div",{className:"grid grid-cols-7 gap-2",children:A.map(r=>e.jsxs("div",{className:"text-center",children:[e.jsx("label",{className:"text-xs text-muted-foreground block mb-1 font-medium",children:r.label}),e.jsx(F,{type:"number",min:"0",className:"text-center",value:d[r.key],onChange:u=>m(y=>({...y,[r.key]:parseInt(u.target.value)||0}))})]},r.key))})]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:[{key:"flyers_distributed",label:"Flyers Distributed"},{key:"events_attended",label:"Events Attended"},{key:"social_media_posts",label:"Social Media Posts"}].map(r=>e.jsxs("div",{children:[e.jsx(T,{className:"text-sm font-medium mb-1.5 block",children:r.label}),e.jsx(F,{type:"number",min:"0",value:d[r.key],onChange:u=>m(y=>({...y,[r.key]:parseInt(u.target.value)||0}))})]},r.key))}),e.jsx("div",{className:"space-y-4",children:[{key:"challenges_faced",label:"Challenges Faced",placeholder:"Any difficulties or obstacles this week?"},{key:"wins_highlights",label:"Wins & Highlights",placeholder:"What went well? Any success stories?"},{key:"notes",label:"Additional Notes",placeholder:"Anything else to share?"}].map(r=>e.jsxs("div",{children:[e.jsx(T,{className:"text-sm font-medium mb-1.5 block",children:r.label}),e.jsx(ke,{placeholder:r.placeholder,value:d[r.key],onChange:u=>m(y=>({...y,[r.key]:u.target.value})),className:"min-h-[80px]"})]},r.key))}),e.jsx(c,{className:"w-full font-bold",size:"lg",onClick:W,disabled:o,children:o?"Submitting...":j?"Update Report":"Submit Report"})]})]})};export{gs 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.