1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePromotionSystem-C1v_wkyE.js","assets/main-xaUap2mU.js","assets/react-vendor-DgCwdNFP.js","assets/main-De4gvul0.css","assets/promotionDetection-DvvWONFN.js"])))=>i.map(i=>d[i]); 2import{as as u,aq as m,_ as c,l as O}from"./main-xaUap2mU.js";import{trackPromotionClick as y}from"./promotionTracking-FmHj2SRA.js";import"./react-vendor-DgCwdNFP.js";const f=/^\[PROMOTION_HANDOFF:([^\]]+)\]\s*/,E={en:"Iâm interested in the â{title}â offer.",fr:"Je suis intéressé(e) par lâoffre « {title} ».",es:"Me interesa la oferta «{title}».",pt:"Tenho interesse na oferta â{title}â.",it:"Sono interessato/a allâofferta â{title}â.",de:"Ich interessiere mich für das Angebot â{title}â."},_={en:"Iâd like to know more about this offer.",fr:"Je souhaite en savoir plus sur cette offre.",es:"Me gustarÃa saber más sobre esta oferta.",pt:"Gostaria de saber mais sobre esta oferta.",it:"Vorrei saperne di più su questa offerta.",de:"Ich möchte mehr über dieses Angebot erfahren."};function p(){var e;try{return((e=O.getState().settings)==null?void 0:e.currentLanguage)||"en"}catch{return"en"}}function g(e){const t=u()||"anon";return`promo_engaged:${e}:${t}`}function v(e){try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):[]}catch{return[]}}function w(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function h(e){return e?v(g(e)):[]}function T(e,t){if(!e||!t)return;const o=h(t);o.includes(e)||w(g(t),[...o,e])}function N(e,t){return h(t).includes(e)}function P(e){const t=e.match(f);if(!t)return{promotionId:null,visibleText:e};const o=e.slice(t[0].length).trim(),i=m(_,p());return{promotionId:t[1],visibleText:o||i}}function A(e){return f.test(e)}function I(e){const o=m(E,p()).replace("{title}",e.title);return`[PROMOTION_HANDOFF:${e.id}] ${o}`}async function M(e,t){var l,d;const{usePromotionSystem:o}=await c(async()=>{const{usePromotionSystem:a}=await import("./usePromotionSystem-C1v_wkyE.js");return{usePromotionSystem:a}},__vite__mapDeps([0,1,2,3]));await o.getState().initialize(t);const i=o.getState().creatives.find(a=>a.id===e);if(!i)return"";const r=((l=i.ai_handoff_prompt)==null?void 0:l.trim())||"Understand the visitorâs need, answer their questions about this offer, collect useful contact details (name, email, phone) when relevant, and propose a meeting if it feels appropriate.";let n=` 3 4`;n+="=".repeat(55)+` 5`,n+=`ð£ PROMOTION HANDOFF â THE VISITOR CLICKED THE CTA 6`,n+="=".repeat(55)+` 7 8`,n+=`â FORBIDDEN: NEVER emit [SHOW_PROMOTION:${e}] or any promo card â the visitor already saw it and clicked. Re-showing it would create a loop. 9 10`,n+=`Offer: â${i.title}â 11`,i.description&&(n+=`Description: ${i.description.slice(0,400)} 12`),i.display_context&&(n+=`Context: ${i.display_context.slice(0,200)} 13`);const s=((d=i.metadata)==null?void 0:d.knowledge_base)||[];return s.length>0&&(n+=` 14ð OFFER KNOWLEDGE BASE (authoritative â use it to answer the visitorâs questions): 15`,s.forEach(a=>{n+=`--- ${a.name} (${a.type}) --- 16${a.content.replace(/\s+/g," ").slice(0,3e3)} 17`})),n+=` 18ð¯ MISSION (configured by the client): 19${r} 20 21`,n+=`HOW TO EXECUTE â adapt to the mission: 22`,n+=`- Mission mentions a meeting / appointment / demo / call / consultation â use the Calendly flow (availability, name, email, confirmation). 23`,n+=`- Mission mentions collecting info / contact / quote / qualification â ask ONE question at a time, then collect name, email or phone. 24`,n+=`- Mission mentions sending a promo code / coupon / discount / document BY EMAIL â first ask for the visitorâs email address. Once they share it, confirm and emit on its own line: [SEND_EMAIL:{"subject":"...","body":"..."}] â write subject and body in the VISITORâS language, include the exact promo code from the mission in the body. The email is sent automatically to the address the visitor shared. Never invent a promo code: only use one explicitly given in the mission. 25`,n+=`- Mission mentions purchase / order / subscription â guide toward conversion, handle objections, summarize the benefits. 26`,n+=`- Reply in the visitorâs language: warm, proactive, concise. No promo card, no CTA button â you lead the conversation now. 27`,n+=`- The creative is already displayed LARGE in the chat above your reply â do not describe it again, move the conversation forward. 28`,n+="=".repeat(55)+` 29 30`,n}async function R(e,t,o="en"){const{usePromotionSystem:i}=await c(async()=>{const{usePromotionSystem:s}=await import("./usePromotionSystem-C1v_wkyE.js");return{usePromotionSystem:s}},__vite__mapDeps([0,1,2,3])),{createPromotionHandoffHeroHtml:r}=await c(async()=>{const{createPromotionHandoffHeroHtml:s}=await import("./promotionDetection-DvvWONFN.js");return{createPromotionHandoffHeroHtml:s}},__vite__mapDeps([4,1,2,3]));await i.getState().initialize(t);const n=i.getState().creatives.find(s=>s.id===e);return n?r(n,o):null}function F(e,t,o="inline"){T(e.id,t),y(e.id,t,u(),o),window.dispatchEvent(new CustomEvent("bot-send-user-message",{detail:{message:I(e)}}))}export{f as PROMOTION_HANDOFF_RE,I as buildPromotionHandoffMessage,F as dispatchPromotionHandoff,h as getEngagedPromotionIds,M as getPromotionHandoffContextForAI,R as getPromotionHandoffHeroHtml,N as isPromotionEngaged,A as isPromotionHandoffMessage,T as markPromotionEngaged,P as parsePromotionHandoffMessage};
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.