/* listgetbuy — Seller scroll story (satıcı gözünden, scroll-position driven) */ const sClamp = (v, a = 0, b = 1) => Math.max(a, Math.min(b, v)); const sLerp = (a, b, t) => a + (b - a) * t; const sEaseIO = (t) => (t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2); const sTL = (n) => '€' + Math.round(n).toLocaleString('de-DE'); const S_BUDGET = 550; const S_TH = [0.04, 0.30, 0.58, 0.86]; const SB = { introEnd: 0.12, offEnd: 0.50, dealEnd: 0.66, payEnd: 0.84 }; const S_STEPS_LANG = { tr: [ { k: '01', t: 'Talep zaten kapında', s: 'Alıcı ne istediğini bütçesiyle yazar. Sen aramazsın — iş ayağına gelir.' }, { k: '02', t: 'Reklam yok, doping yok', s: 'Görünmek için kuruş harcamazsın. Vitrin yarışı, algoritma oyunu yok.' }, { k: '03', t: 'Tek yapman gereken: teklif ver', s: 'Seni öne çıkaran tek şey fiyatın. Birkaç saniyede teklifini bırak.' }, { k: '04', t: 'Rekabette öne geç', s: 'En iyi teklif en üstte. Çaba değil, doğru fiyat kazandırır.' }, { k: '05', t: 'Süre dolunca anında sat', s: 'Satış senin. Ödeme güvende, beklemek ve pazarlık yok.' }, ], en: [ { k: '01', t: 'Demands are at your doorstep', s: 'The buyer writes what they want and their budget. No searching — work comes to you.' }, { k: '02', t: 'No ads, no listing fees', s: 'You don\'t spend a penny to be seen. No bidding wars for visibility, no algorithm games.' }, { k: '03', t: 'All you do is make offers', s: 'The only thing that highlights you is your price. Leave your offer in seconds.' }, { k: '04', t: 'Lead the competition', s: 'The best offer is at the top. True price wins, not marketing effort.' }, { k: '05', t: 'Sell instantly when time is up', s: 'The sale is yours. Payment is secured, no waiting, no negotiation.' }, ], de: [ { k: '01', t: 'Nachfragen vor deiner Tür', s: 'Der Käufer schreibt, was er will und sein Budget. Kein Suchen — die Arbeit kommt zu dir.' }, { k: '02', t: 'Keine Werbung, keine Gebühren', s: 'Du gibst keinen Cent aus, um gesehen zu werden. Keine Schaufenster-Rennen, keine Algorithmen.' }, { k: '03', t: 'Gib einfach Angebote ab', s: 'Das Einzige, was dich hervorhebt, ist dein Preis. Hinterlasse dein Angebot in Sekunden.' }, { k: '04', t: 'Führe den Wettbewerb an', s: 'Das beste Angebot steht ganz oben. Der richtige Preis gewinnt, nicht der Aufwand.' }, { k: '05', t: 'Sofort verkaufen bei Zeitablauf', s: 'Der Verkauf gehört dir. Die Zahlung ist gesichert, kein Warten, kein Verhandeln.' }, ], }; const S_LABELS = { tr: { title: 'PlayStation 5 Slim aranıyor', buyer: 'Alıcı: Seda Y. · Bütçe', timeUp: 'Süre doldu', salePrice: 'SATIŞ TUTARI', yourOffer: 'SENİN TEKLİFİN · EN DÜŞÜK', lowestOffer: 'EN DÜŞÜK TEKLİF', buyerBudget: 'ALICININ BÜTÇESİ', adExpense: 'Reklam gideri €0', livePending: 'Talep yayında. Teklif vermek için hazırsın…', you: 'SEN', lowest: 'EN DÜŞÜK', outbid: 'GEÇİLDİ', offerWon: 'Teklifin kazandı', saleToYou: 'Satış sana kaldı', lowestYours: 'En düşük teklif senin', paymentSecured: 'Ödemen güvende', paidDesc: 'Alıcı ödedi. Ürünü gönder, para hesabına geçsin.', earnings: 'Kazancın', shipped: 'Kargoya verildi…', shipProduct: 'Ürünü gönder', sold: 'Sattın', details: 'PlayStation 5 Slim · Alıcı: Seda Y.', adStats: 'Reklam €0 · Doping €0 🎉', badge: 'SATICIYSAN', closeTitle: 'Satmak için ödemezsin. Sadece teklif verirsin.', closeStrips: ['Sıfır reklam, sıfır doping', 'Talep hazır, alıcı arıyor', 'Teklif ver, süre dolunca sat'], notes: { mert: 'Sıfır, faturalı', deniz: 'Kapalı kutu', burak: '2. kol dahil', you: 'Sıfır · kapalı kutu · 2 kol' } }, en: { title: 'Looking for PlayStation 5 Slim', buyer: 'Buyer: Seda Y. · Budget', timeUp: 'Time expired', salePrice: 'SALE PRICE', yourOffer: 'YOUR OFFER · LOWEST', lowestOffer: 'LOWEST OFFER', buyerBudget: 'BUYER\'S BUDGET', adExpense: 'Ad expense €0', livePending: 'Request is live. Ready to make an offer…', you: 'YOU', lowest: 'LOWEST', outbid: 'OUTBID', offerWon: 'Your offer won', saleToYou: 'Sale awarded to you', lowestYours: 'You gave the lowest offer', paymentSecured: 'Payment secured', paidDesc: 'Buyer paid. Ship the product to receive funds.', earnings: 'Your earnings', shipped: 'Shipped…', shipProduct: 'Ship product', sold: 'Sold', details: 'PlayStation 5 Slim · Buyer: Seda Y.', adStats: 'Ad €0 · Boosting ₺0 🎉', badge: 'FOR SELLERS', closeTitle: 'You don\'t pay to sell. You just make offers.', closeStrips: ['Zero ads, zero boosting fees', 'Ready demand, active buyers', 'Make offers, sell when time is up'], notes: { mert: 'New, with invoice', deniz: 'Sealed box', burak: '2nd controller included', you: 'New · Sealed box · 2 controllers' } }, de: { title: 'PlayStation 5 Slim gesucht', buyer: 'Käufer: Seda Y. · Budget', timeUp: 'Abgelaufen', salePrice: 'VERKAUFSPREIS', yourOffer: 'DEIN ANGEBOT · BESTES', lowestOffer: 'NIEDRIGSTES ANGEBOT', buyerBudget: 'KÄUFERBUDGET', adExpense: 'Werbekosten €0', livePending: 'Nachfrage live. Bereit für ein Angebot…', you: 'DU', lowest: 'BESTES', outbid: 'ÜBERBOTEN', offerWon: 'Dein Angebot hat gewonnen', saleToYou: 'Verkauf an dich vergeben', lowestYours: 'Dein Angebot ist das beste', paymentSecured: 'Zahlung gesichert', paidDesc: 'Käufer hat bezahlt. Versende das Produkt für die Auszahlung.', earnings: 'Dein Gewinn', shipped: 'Versendet…', shipProduct: 'Produkt versenden', sold: 'Verkauft', details: 'PlayStation 5 Slim · Käufer: Seda Y.', adStats: 'Werbung €0 · Doping €0 🎉', badge: 'FÜR VERKÄUFER', closeTitle: 'Du zahlst nichts fürs Verkaufen. Du machst nur Angebote.', closeStrips: ['Keine Werbung, keine Doping-Gebühren', 'Bereite Nachfrage, aktive Käufer', 'Angebote machen, verkaufen bei Zeitablauf'], notes: { mert: 'Neu, mit Rechnung', deniz: 'Originalverpackt', burak: 'Inkl. 2. Controller', you: 'Neu · OVP · 2 Controller' } } }; function SAvatar({ o, size = 38 }) { const url = o.avatar || o.avatar_url; return (
{url ? : o.initials}
); } function SOfferRow({ o, leader, beaten, reveal = 1, labels }) { const you = o.you; return (
{o.name} {you && {labels.you}}
{o.note}
{sTL(o.price)}
{leader ? (
{labels.lowest}
) : beaten ? (
{labels.outbid}
) : null}
); } function SStage({ p, lang = 'tr' }) { const labels = S_LABELS[lang] || S_LABELS.tr; const S_OFFERS = [ { initials: 'MK', hue: 158, name: 'Mert K.', note: labels.notes.mert, price: 510, avatar: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=120&h=120&q=80' }, { initials: 'DA', hue: 340, name: 'Deniz A.', note: labels.notes.deniz, price: 490, avatar: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?auto=format&fit=crop&w=120&h=120&q=80' }, { initials: 'BT', hue: 25, name: 'Burak T.', note: labels.notes.burak, price: 470, avatar: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=120&h=120&q=80' }, { initials: 'SN', hue: 200, name: labels.you, note: labels.notes.you, price: 449, you: true, shop: true, avatar: 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=120&h=120&q=80' }, ]; const S_LOW = S_OFFERS[S_OFFERS.length - 1].price; // your winning offer const tBand = sClamp((p - SB.introEnd) / (SB.offEnd - SB.introEnd)); const dealLocked = p >= SB.offEnd; const paying = p >= SB.dealEnd; const paid = p >= SB.payEnd; const revealed = S_OFFERS.map((o, i) => ({ o, i, rev: p < SB.introEnd ? 0 : sClamp((tBand - S_TH[i]) / 0.07) })) .filter((x) => x.rev > 0.02); const ordered = [...revealed].sort((a, b) => a.o.price - b.o.price); // cheapest first const shown = revealed.length; const leaderIsYou = ordered.length > 0 && ordered[0].o.you; const ovOp = sClamp((p - (SB.offEnd - 0.02)) / 0.04); const bigPrice = p < SB.introEnd ? S_BUDGET : sLerp(S_BUDGET, S_LOW, sEaseIO(tBand)); const showLow = p >= SB.introEnd; const remain = sClamp(1 - tBand); const totalMin = Math.round(remain * 188); const hh = String(Math.floor(totalMin / 60)).padStart(2, '0'); const mm = String(totalMin % 60).padStart(2, '0'); const payProg = sClamp((p - SB.dealEnd) / (SB.payEnd - SB.dealEnd)); return (
{/* request header */}
{labels.title}
{labels.buyer} {sTL(S_BUDGET)}
{dealLocked ? labels.timeUp : `${hh}:${mm}`}
{/* big price + reklam ₺0 */}
{paid ? labels.salePrice : leaderIsYou ? labels.yourOffer : showLow ? labels.lowestOffer : labels.buyerBudget}
{sTL(Math.round((paid ? S_LOW : bigPrice) / 50) * 50)}
{labels.adExpense}
{/* offers (sen + rakipler) */}
{shown === 0 && (
{labels.livePending}
)} {ordered.map(({ o, rev }, idx) => ( ))}
{/* sell / payout overlay */} {p >= SB.offEnd - 0.02 && (
{!paid && (
{!paying ? (
{labels.offerWon}
{labels.saleToYou}
{labels.lowestYours}
{sTL(S_LOW)}
) : (
{labels.paymentSecured}
{labels.paidDesc}
{labels.earnings} {sTL(S_LOW)}
{payProg > 0.92 ? labels.shipped : labels.shipProduct}
)}
)} {paid && (
{labels.sold} · {sTL(S_LOW)}
{labels.details}
{labels.adStats}
)}
)}
); } function SellerStory({ lang = 'tr' }) { const ref = React.useRef(null); const [p, setP] = React.useState(0); React.useEffect(() => { let raf = 0; const update = () => { raf = 0; const el = ref.current; if (!el) return; const rect = el.getBoundingClientRect(); const total = rect.height - window.innerHeight; setP(sClamp(-rect.top / total)); }; const onScroll = () => { if (!raf) raf = requestAnimationFrame(update); }; update(); window.addEventListener('scroll', onScroll, { passive: true }); window.addEventListener('resize', onScroll); return () => { window.removeEventListener('scroll', onScroll); window.removeEventListener('resize', onScroll); cancelAnimationFrame(raf); }; }, []); const S_STEPS = S_STEPS_LANG[lang] || S_STEPS_LANG.tr; const labels = S_LABELS[lang] || S_LABELS.tr; const o0 = SB.introEnd, span = (SB.offEnd - SB.introEnd) / 3; const stepIdx = p < o0 ? 0 : p < o0 + span ? 1 : p < o0 + 2 * span ? 2 : p < SB.dealEnd ? 3 : 4; const step = S_STEPS[stepIdx]; return (
{labels.badge}
{S_STEPS.map((s, i) => (
{s.k} {s.t}
))}

{step.t}

{step.s}

); } /* closing compare strip */ function SellerClose({ lang = 'tr' }) { const labels = S_LABELS[lang] || S_LABELS.tr; return (

{labels.closeTitle}

{labels.closeStrips.map((text, i) => (
LISTGETBUY
{text}
))}
); } function SellerSection({ lang = 'tr' }) { return (
); } window.SellerSection = SellerSection;