// ============================================ // Instagram, Contact, WhatsApp floating widget // ============================================ const { useState: useSE, useEffect: useEE } = React; const Ie = window.MS_I; const IG_POSTS = [ { img: "https://images.unsplash.com/photo-1489493512598-d08130f49bea?w=600&q=80&auto=format&fit=crop", caption: "Dawn at Erg Chebbi" }, { img: "https://images.unsplash.com/photo-1517089596392-fb9a9033e05b?w=600&q=80&auto=format&fit=crop", caption: "Jardin Majorelle in cobalt" }, { img: "https://images.unsplash.com/photo-1545569341-9eb8b30979d9?w=600&q=80&auto=format&fit=crop", caption: "The Koutoubia at golden hour" }, { img: "https://images.unsplash.com/photo-1469854523086-cc02fe5d8800?w=600&q=80&auto=format&fit=crop", caption: "High Atlas, late October" }, { img: "https://images.unsplash.com/photo-1601612628452-9e99ced43524?w=600&q=80&auto=format&fit=crop", caption: "Camp lanterns in Agafay" }, { img: "https://images.unsplash.com/photo-1414235077428-338989a2e8c0?w=600&q=80&auto=format&fit=crop", caption: "Tagine night, Café Clock" }, { img: "https://images.unsplash.com/photo-1493780474015-ba834fd0ce2f?w=600&q=80&auto=format&fit=crop", caption: "Inside the medina, blue door" }, { img: "https://images.unsplash.com/photo-1559339352-11d035aa65de?w=600&q=80&auto=format&fit=crop", caption: "A wedding in a riad" }, ]; function InstagramStrip() { const { useT, COMPANY } = window.MS_CTX; const t = useT(); return (
{t('ig_eyebrow')}

{t('ig_title_a')} {t('ig_title_b')}

{t('ig_sub')}

{t('ig_follow')} @{COMPANY.instagram}
); } function ContactSection() { const { useT, COMPANY } = window.MS_CTX; const t = useT(); return (
{t('contact_eyebrow')}

{t('contact_title_a')}
{t('contact_title_b')}

{t('contact_sub')}

Email {COMPANY.email}
Phone {COMPANY.phone}
WhatsApp {COMPANY.phone}
Studio {COMPANY.address}
{t('contact_email_btn')} {t('contact_wa_btn')}
{/* embedded map */}
Marrakech Story
La Kasbah, 40000
); } function WhatsAppWidget() { const { useT, COMPANY } = window.MS_CTX; const t = useT(); const [open, setOpen] = useSE(false); const [hint, setHint] = useSE(false); useEE(() => { const t1 = setTimeout(() => setHint(true), 4000); const t2 = setTimeout(() => setHint(false), 9000); return () => { clearTimeout(t1); clearTimeout(t2); }; }, []); return (
{open && (
Marrakech Story Typically replies in minutes
Hi 👋 We're here to help with your trip to Marrakech. Send us a message — we usually reply within minutes.
Start chat on WhatsApp
)} {hint && !open && (
{t('wa_label')} {t('wa_sub')}
)}
); } function InstagramScrollWidget() { const { COMPANY } = window.MS_CTX; const [visible, setVisible] = useSE(false); const [expanded, setExpanded] = useSE(false); useEE(() => { const onScroll = () => setVisible(window.scrollY > 300); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); const igUrl = `https://instagram.com/${COMPANY.instagram}`; return (
{expanded && (
Marrakech Story
@{COMPANY.instagram}
12.4k followers

Daily stories from the medina, the Atlas and the desert. Follow along.

Follow on Instagram
)}
); } window.MS_Instagram = InstagramStrip; window.MS_Contact = ContactSection; window.MS_WhatsApp = WhatsAppWidget; window.MS_InstagramWidget = InstagramScrollWidget;