1var module_219829945647=function(){var FREE_EMAIL_DOMAINS="undefined"!=typeof window&&window.FREE_EMAIL_DOMAINS||null;FREE_EMAIL_DOMAINS||(console.warn("[hero-chat] free-email-domains.js not loaded..."),FREE_EMAIL_DOMAINS=new Set);var EMAIL_FORMAT_RE=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;function stripToDigits(raw){var d=String(raw||"").replace(/\D/g,"");return 11===d.length&&"1"===d.charAt(0)&&(d=d.slice(1)),d.slice(0,10)}!function(){"use strict";function buildChatBriefText(state){var lines=[];return state.seed&&lines.push("Idea: "+state.seed),FLOW.forEach(function(step){var answer=state.answers[step.key];answer&&lines.push(step.text+": "+answer)}),lines.join("\n")}var GHOST_EXAMPLES=["Automate our customer onboarding...","Build an AI agent for our operations team...","Turn our internal data into an AI-powered product...","Get our AI prototype into production...","Automate the manual work in our sales process...","Help us figure out where AI could have the biggest impact...","Build an AI workflow around our existing systems...","We have an AI idea, but we're not sure how to build it...","Identify shadow AI in our company and secure our IP..."],FLOW=[{key:"problem",text:"What slows this down the most today?",chips:["Manual, repetitive work","Information scattered across systems","Too many handoffs and approvals","Inconsistent quality","Not enough people to keep up"]},{key:"who",text:"Who would be using this day to day?",chips:["Sales","Operations","Customer support","Engineering","Finance","Leadership"]},{key:"systems",text:"What systems or data would it need to work with?",chips:["CRM â Salesforce, HubSpot","ERP or finance systems","Internal databases","Documents and file storage","Custom applications","Not sure yet"]},{key:"stage",text:"Where does this stand right now?",chips:["Just an idea","Scoped, not started","Prototype built","Pilot running","Project stalled"]},{key:"outcome",text:"What outcome would make this worth doing?",chips:["Cut cycle time","Reduce cost","Increase revenue","Improve accuracy","Free up the team"]},{key:"timeline",text:"And how soon do you want this moving?",chips:["Just exploring","This quarter","Within 90 days","Urgent â already committed"]}],CONTACT_FLOW=[{key:"name",text:"What should I call you?",placeholder:"Enter your full name"},{key:"email",text:"And your work email?",placeholder:"[email protected]"},{key:"company",text:"Your company name?",placeholder:"Company name"},{key:"phone",text:"Finally, your phone number?",placeholder:"(555) 555-5555"}],DEPTH=Math.max(3,Math.min(6,5));var INTENT_NOTES={automation:"That reads like a workflow automation problem â usually one of the fastest places to see real return.",agent:"So an AI agent working inside your systems, not a standalone tool. That shape can work well when the guardrails are designed in.",data:"So the value is locked in information your team already has. That is a retrieval and reasoning problem more than a model problem.",production:"Getting from working demo to dependable production is a different discipline â that is a lot of what we do.",stalled:"Stalled AI projects usually stall on integration, data, or ownership rather than the model itself.",governance:"Visibility and control first, then enablement. That order matters for protecting IP.",discovery:"You do not need to know the solution yet. Finding where AI would actually pay off is the first piece of work."},INTENT_APPROACH={automation:"An AI-assisted workflow that handles the repetitive steps end to end, with people reviewing exceptions",agent:"A task-scoped AI agent with retrieval, tool access, and human approval on consequential actions",data:"A retrieval layer over your existing content, with an AI interface for the people who need answers",production:"Harden the existing build â evaluation, integration, monitoring, and a production deployment path",stalled:"Diagnose where the project stalled, then re-plan around integration, data readiness, and ownership",governance:"Discover AI already in use, then establish approved tooling, access boundaries, and IP controls",discovery:"An opportunity assessment across your workflows, scored on value, effort, and path to production"}
1,INTENT_CAPS={automation:["Workflow automation","Document and data extraction","System integration"],agent:["AI agent design","Tool and API orchestration","Human-in-the-loop controls"],data:["Retrieval-augmented generation","Knowledge structuring","Search and summarization"],production:["Evaluation and testing","Deployment engineering","Monitoring and optimization"],stalled:["Technical assessment","Architecture and re-planning","Delivery ownership"],governance:["AI usage discovery","Access and data governance","Secure deployment"],discovery:["Opportunity assessment","Value and effort modeling","Implementation roadmap"]};function capsFor(intent,systemsAnswer){var base=(INTENT_CAPS[intent]||[]).slice();return/not sure/i.test(systemsAnswer||"")||base.push("Integration engineering"),base.slice(0,4).join(" · ")}var ACK_BY_KEY={problem:"Understood â that is usually where the hidden cost sits.",who:"Good. Designing around the people who actually do the work is what makes it stick.",systems:"Noted. Working inside your existing systems is almost always cheaper than replacing them.",stage:"That tells us a lot about where to start.",outcome:"Clear. That gives us something measurable to design against."},IMPACT_BY_OUTCOME={"Cut cycle time":"Meaningful reduction in turnaround time on the work described","Reduce cost":"Lower cost per transaction as manual effort comes out of the process","Increase revenue":"More capacity aimed at revenue-generating work","Improve accuracy":"Fewer errors and more consistent output across the team","Free up the team":"Hours returned to the people doing higher-value work"},BRIEF_TITLES={automation:"AI-assisted workflow automation â initial scope",agent:"AI agent for internal operations â initial scope",data:"AI access to internal knowledge â initial scope",production:"Production readiness for an existing AI build",stalled:"Recovery plan for a stalled AI initiative",governance:"AI visibility, governance, and IP protection",discovery:"AI opportunity assessment â initial scope"};function initHero(root){var introEl=root.querySelector("[data-ai-hero-intro]"),chatEl=root.querySelector("[data-ai-hero-chat]"),startForm=root.querySelector("[data-ai-hero-start-form]"),textarea=root.querySelector("[data-ai-hero-textarea]"),startSend=root.querySelector("[data-ai-hero-start-send]"),ghost=root.querySelector("[data-ai-hero-ghost]"),streamEl=root.querySelector("[data-ai-hero-stream]"),chipsEl=root.querySelector("[data-ai-hero-chips]"),replyForm=root.querySelector("[data-ai-hero-reply-form]"),replyInput=root.querySelector("[data-ai-hero-reply-input]"),replySend=root.querySelector("[data-ai-hero-reply-send]"),resetBtn=root.querySelector("[data-ai-hero-reset]"),progressBar=root.querySelector("[data-ai-hero-progress]");if(introEl&&chatEl&&startForm&&textarea&&streamEl){var ghostTyper=ghost?function(ghost){var reduced=window.matchMedia("(prefers-reduced-motion: reduce)").matches,timer=null,exIdx=0,chIdx=0,deleting=!1,running=!1;function step(){var example=GHOST_EXAMPLES[exIdx%GHOST_EXAMPLES.length];if(!deleting)return chIdx+=1,ghost.textContent=example.slice(0,chIdx),void(chIdx>=example.length?(deleting=!0,timer=setTimeout(step,1700)):timer=setTimeout(step,34*(.72+.7*Math.random())));chIdx=Math.max(0,chIdx-3),ghost.textContent=example.slice(0,chIdx),chIdx<=0?(exIdx+=1,deleting=!1,timer=setTimeout(step,320)):timer=setTimeout(step,16)}return{start:function(){reduced?ghost.textContent=GHOST_EXAMPLES[0]:running||(running=!0,step())},stop:function(){running=!1,timer&&clearTimeout(timer),timer=null},reset:function(){this.stop(),exIdx=0,chIdx=0,deleting=!1,ghost.textContent=""}}}(ghost):null;ghostTyper&&ghostTyper.start();var timers=[],state=null;replyInput&&replyInput.addEventListener("input",function(){if(isPhoneStep()){var raw,d,formatted=(raw=replyInput.value,0===(d=stripToDigits(raw)).length?"":d.length<4?"("+d:d.length<7?"("+d.slice(0,3)+") "+d.slice(3):"("+d.slice(0,3)+") "+d.slice(3,6)+"-"+d.slice(6));formatted!==replyInput.value&&(replyInput.value=formatted)}}),textarea.addEventListener("focus",function(){ghost&&ghostTyper&&(ghost.classList.add("is-hidden"),ghostTyper.stop())}),textarea.addEventListener("blur",syncGhost),textarea.addEventListener("input",function(){syncGhost(),syncSend(textarea,startSend),autoGrow(textarea)}),textarea.addEventListener("keydown",function(event){if("Enter"===event.key&&!event.shiftKey){if(event.preventDefault(),!textarea.value.trim())return;startForm.requestSubmit?startForm.requestSubmit():startForm.dispatchEvent(new Event("submit",{cancelable:!0}))}}),startForm.addEventListener("submit",function(event){event.preventDefault();var message=textarea.value.trim();message&&startChat(message)}),replyForm&&replyForm.addEventListener("submit",function(event){if(event.preventDefault(),state){var text=replyInput.value.trim();text&&submitAnswer(text)}}),replyInput&&(replyInput.addEventListener("input",function(){syncSend(replyInput,replySend),autoGrow(replyInput)}),replyInput.addEventListener("keydown",function(event){if("Enter"===event.key&&!event.shiftKey){if(event.preventDefault(),!replyInput.value.trim())return;replyForm.requestSubmit?replyForm.requestSubmit():replyForm.dispatchEvent(new Event("submit",{cancelable:!0}))}})),resetBtn&&resetBtn.addEventListener("click",function(){clearTimers(),state=null,streamEl.innerHTML="",clearChips(),chatEl.hidden=!0,introEl.hidden=!1,setProgress(),setComposer(!1),textarea.value="",textarea.style.height="auto",syncSend(textarea,startSend),ghost&&ghostTyper&&(ghost.classList.remove("is-hidden"),ghostTyper.reset(),ghostTyper.start()),textarea.focus({preventScroll:!0})}),setComposer(!1),syncGhost(),syncSend(textarea,startSend)}function isPhoneStep(){return!(!state||"contact"!==state.phase||!CONTACT_FLOW[state.contactStep]||"phone"!==CONTACT_FLOW[state.contactStep].key)}function later(fn,ms){var t=setTimeout(fn,ms);return timers.push(t),t}
1function clearTimers(){timers.forEach(clearTimeout),timers=[]}function autoGrow(el){el.style.height="auto",el.style.height=el.scrollHeight+"px"}function syncSend(input,button){if(input&&button){var hasText=input.value.trim().length>0;button.classList.toggle("is-visible",hasText),button.disabled=!hasText,button.tabIndex=hasText?0:-1,button.setAttribute("aria-hidden",hasText?"false":"true")}}function syncGhost(){if(ghost&&ghostTyper){var typed=textarea.value.length>0;ghost.classList.toggle("is-hidden",typed),typed?ghostTyper.stop():ghostTyper.start()}}function reveal(el){requestAnimationFrame(function(){requestAnimationFrame(function(){el.classList.add("is-in")})})}function addMsg(role,text){var p=document.createElement("p");return p.className="ai-hero__msg ai-hero__msg--"+role,p.textContent=text,streamEl.appendChild(p),reveal(p),p}function clearChips(){chipsEl&&(chipsEl.innerHTML="")}function setProgress(){if(progressBar){var done,total=DEPTH+CONTACT_FLOW.length;done=state?state.done?total:"contact"===state.phase?DEPTH+state.contactStep:state.step:0,progressBar.style.width=Math.round(done/total*100)+"%"}}function setComposer(enabled,placeholder){replyForm&&(replyForm.hidden=!enabled,replyInput&&(replyInput.disabled=!enabled,placeholder&&(replyInput.placeholder=placeholder),isPhoneStep()?(replyInput.setAttribute("inputmode","tel"),replyInput.setAttribute("maxlength","14")):(replyInput.removeAttribute("inputmode"),replyInput.removeAttribute("maxlength")),enabled&&(replyInput.value="",replyInput.style.height="auto",replyInput.focus({preventScroll:!0}))),syncSend(replyInput,replySend))}function askFlowQuestion(step){addMsg("ai",FLOW[step].text),function(step){if(clearChips(),chipsEl&&state&&"q"===state.phase){var flowStep=FLOW[step];flowStep&&flowStep.chips.forEach(function(label){var btn=document.createElement("button");btn.type="button",btn.className="ai-hero__chip",btn.textContent=label,btn.addEventListener("click",function(){submitAnswer(label)}),chipsEl.appendChild(btn)})}}(step),setComposer(!0,"Or answer in your own wordsâ¦"),setProgress()}function toBrief(){var brief=function(seed,intent,answers){var opportunity=seed.length>150?seed.slice(0,148).trim()+"â¦":seed,impact=null;answers.outcome&&(impact=IMPACT_BY_OUTCOME[answers.outcome]||answers.outcome);var stage,s,rows=[{label:"The opportunity",value:opportunity},{label:"The problem today",value:answers.problem},{label:"Proposed approach",value:INTENT_APPROACH[intent]},{label:"Capabilities involved",value:capsFor(intent,answers.systems)},{label:"Systems and integrations",value:answers.systems},{label:"Who it serves",value:answers.who},{label:"Potential business impact",value:impact},{label:"Current stage",value:answers.stage},{label:"Timeline",value:answers.timeline}];return{title:BRIEF_TITLES[intent]||BRIEF_TITLES.automation,rows:rows.filter(function(r){return!!r.value}),nextStep:(stage=answers.stage,s=String(stage||""),/stalled/i.test(s)?"A technical assessment to find what is actually blocking it, then a re-plan.":/prototype|pilot/i.test(s)?"A production readiness review â evaluation, integration, and deployment path.":/just an idea|scoped/i.test(s)?"A short discovery session to pressure-test the use case and size the first phase.":"A working session to confirm scope, data access, and the first measurable milestone.")}}(state.seed,state.intent,state.answers);clearChips(),later(function(){addMsg("ai","Here's what we're hearing."),addMsg("note","A first read on the opportunity, based on what you described â a starting point we can sharpen together."),function(brief){var card=document.createElement("div");card.className="ai-hero__brief";var title=document.createElement("p");title.className="ai-hero__brief-title",title.textContent=brief.title,card.appendChild(title);var grid=document.createElement("div");grid.className="ai-hero__brief-grid",brief.rows.forEach(function(field){var cell=document.createElement("div");cell.className="ai-hero__brief-cell";var label=document.createElement("p");label.className="ai-hero__brief-label",label.textContent=field.label;
1var value=document.createElement("p");value.className="ai-hero__brief-value",value.textContent=field.value,cell.appendChild(label),cell.appendChild(value),grid.appendChild(cell)}),card.appendChild(grid),streamEl.appendChild(card),reveal(card)}(brief),later(function(){addMsg("ai","Recommended next step"),addMsg("note",brief.nextStep),later(function(){addMsg("label","Continue"),addMsg("note","This looks worth exploring. We've turned your idea into the beginnings of a project brief. Add a few details and our AI team can review it with you."),addMsg("ai",CONTACT_FLOW[0].text),state.phase="contact",state.contactStep=0,state.contact={},setComposer(!0,CONTACT_FLOW[0].placeholder),setProgress()},220)},220)},500)}function submitAnswer(value){var v=String(value||"").trim();if(v&&state)if("contact"!==state.phase){addMsg("user",v),clearChips(),setComposer(!1);var step=state.step,cur=FLOW[step];state.answers[cur.key]=v,step+1>=DEPTH?toBrief():later(function(){var ack=ACK_BY_KEY[cur.key];ack&&addMsg("note",ack),state.step=step+1,askFlowQuestion(state.step)},500)}else!function(value){var v=String(value||"").trim();if(!v||!state)return;var i=state.contactStep,cur=CONTACT_FLOW[i];if(addMsg("user",v),setComposer(!1),"email"===cur.key){var emailCheck=function(raw){var v=String(raw||"").trim();if(!EMAIL_FORMAT_RE.test(v))return{ok:!1,reason:"format"};var domain=v.split("@").pop().toLowerCase().trim();return FREE_EMAIL_DOMAINS.has(domain)?{ok:!1,reason:"free-domain"}:{ok:!0,reason:null}}(v);if(!emailCheck.ok){var emailMsg="free-domain"===emailCheck.reason?"That looks like a personal email address â mind sharing your work email instead?":"That email doesn't look quite right â mind checking it?";return void later(function(){addMsg("note",emailMsg),setComposer(!0,cur.placeholder)},500)}}if("phone"===cur.key){var phoneCheck=10!==(digits=stripToDigits(v)).length?{ok:!1,digits:digits}:{ok:!0,digits:digits};if(!phoneCheck.ok)return void later(function(){addMsg("note","That phone number doesn't look quite right â mind entering a full 10-digit number?"),setComposer(!0,cur.placeholder)},500);v=phoneCheck.digits}var digits;state.contact[cur.key]=v;var first=(state.contact.name||"").trim().split(/\s+/)[0];if(i+1>=CONTACT_FLOW.length)return void later(function(){addMsg("ai",first?"Thanks, "+first+". Your brief is with our AI team.":"Your brief is with our AI team."),addMsg("note","We'll review what you described and come back with an initial point of view. If you'd rather talk it through now, grab a time below."),function(state){if(state&&state.contact&&state.contact.email){var m,nameParts=String(state.contact.name||"").trim().split(/\s+/),firstname=nameParts.shift()||"",lastname=nameParts.join(" ");fetch("https://api.hsforms.com/submissions/v3/integration/submit/20925353/b2e37996-f4e0-4022-838b-a786f97cee23",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fields:[{name:"firstname",value:firstname},{name:"lastname",value:lastname},{name:"email",value:state.contact.email},{name:"company",value:state.contact.company||""},{name:"phone",value:state.contact.phone||""},{name:"message",value:buildChatBriefText(state)}],context:{hutk:(m=document.cookie.match(/hubspotutk=([^;]+)/),(m?m[1]:null)||void 0),pageUri:window.location.href}})}).catch(function(){})}}(state),function(){var card=document.createElement("div");card.className="ai-hero__link-card";var head=document.createElement("div");head.className="ai-hero__link-head";var title=document.createElement("p");title.className="ai-hero__link-title",title.textContent="Pick a time with our team";var sub=document.createElement("p");sub.className="ai-hero__link-sub",sub.textContent="A short discovery call to walk through your brief together.",head.appendChild(title),head.appendChild(sub),card.appendChild(head);var frame=document.createElement("iframe");frame.className="ai-hero__calendar",frame.title="Book a discovery call",frame.loading="lazy",frame.src="https://meetings.hubspot.com/tommalone/discovery-call-tom-megan?embed=true",card.appendChild(frame),streamEl.appendChild(card),reveal(card)}(),state.done=!0,setProgress()},500);later(function(){"name"===cur.key&&first&&addMsg("note","Good to meet you, "+first+"."),state.contactStep=i+1,addMsg("ai",CONTACT_FLOW[i+1].text),setComposer(!0,CONTACT_FLOW[i+1].placeholder),setProgress()},500)}(v)}function startChat(seedText){clearTimers(),ghostTyper&&ghostTyper.stop();var s,intent=(s=String(seedText||"").toLowerCase(),/stall|stuck|blocked|slow(ed)? down|paused/.test(s)?"stalled":/production|pilot|prototype|poc|proof of concept|scale/.test(s)?"production":/agent|copilot|assistant|chatbot|bot/.test(s)?"agent":/shadow|secur|ip\b|govern|complian|risk|privacy/.test(s)?"governance":/data|insight|report|analytic|knowledge|document/.test(s)?"data":/automat|manual|repetit|workflow|process|onboard/.test(s)?"automation":/where|which|opportunit|impact|roadmap|not sure|don't know|dont know/.test(s)?"discovery":"automation");state={seed:seedText,intent:intent,step:0,answers:{},phase:"q",contactStep:0,contact:{},done:!1},streamEl.innerHTML="",clearChips(),introEl.hidden=!0,chatEl.hidden=!1,addMsg("ai","Let's turn that into something real."),addMsg("user",seedText),setProgress(),later(function(){addMsg("note",INTENT_NOTES[intent]),askFlowQuestion(0)},500)}}
1function init(){var roots=document.querySelectorAll(".ai-hero:not([data-ai-hero-initialized])");Array.prototype.forEach.call(roots,function(root){root.setAttribute("data-ai-hero-initialized","true"),initHero(root)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",init):init()}()}(); 2//# sourceURL=https://20925353.fs1.hubspotusercontent-na1.net/hubfs/20925353/hub_generated/module_assets/1/219829945647/1787549836149/module_hero-chat-integrations.js
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.