1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2898],{51817:function(e,r,t){t.d(r,{Z:function(){return a}});let a=(0,t(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},44743:function(e,r,t){t.d(r,{Z:function(){return a}});let a=(0,t(79205).Z)("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]])},33145:function(e,r,t){t.d(r,{default:function(){return o.a}});var a=t(48461),o=t.n(a)},48461:function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(r,{default:function(){return i},getImageProps:function(){return l}});let a=t(47043),o=t(55346),n=t(65878),s=a._(t(5084));function l(e){let{props:r}=(0,o.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,t]of Object.entries(r))void 0===t&&delete r[e];return{props:r}}let i=n.Image},92898:function(e,r,t){t.r(r),t.d(r,{TrevorConcierge:function(){return v}});var a=t(57437),o=t(2265),n=t(57586),s=t(55299),l=t(51817);let i=(0,t(79205).Z)("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var d=t(32489),c=t(30401),u=t(44743),m=t(33145),x=t(27648),p=t(32292),h=t(80908),f=t(33923);let g=[.22,1,.36,1],b=["How much for a roofing company?","Do I have to sign a contract?","Can you get me showing up in ChatGPT?"];function y(e){let{messages:r,onDone:t}=e,[n,s]=(0,o.useState)(""),[i,d]=(0,o.useState)(""),[c,u]=(0,o.useState)("idle"),m=async()=>{let e=i.trim();if(!e||"sending"===c)return;u("sending");let a=/^\S+@\S+\.\S{2,}$/.test(e),o=!a&&/^[\d\s()+.-]{7,40}$/.test(e),s=function(e){let r=e.filter(e=>"user"===e.role).slice(0,8).map(e=>"- ".concat(e.content.slice(0,160)));return"Asked in chat:\n".concat(r.join("\n")).slice(0,3900)}(r),l=a||o?s:"Reach me at: ".concat(e.slice(0,200),"\n").concat(s).slice(0,3900);try{if(!(await fetch("/api/lead",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:"concierge-chat",name:n.trim()||void 0,email:a?e:void 0,phone:o?e:void 0,message:l})})).ok)throw Error();(0,f.B1)("concierge_chat"),t()}catch(e){u("error")}};return(0,a.jsxs)("div",{className:"bg-primary/[0.07] border border-primary/25 rounded-2xl rounded-tl-md px-4 py-3.5 max-w-[92%] space-y-2.5",children:[(0,a.jsx)("p",{className:"text-sm text-foreground font-medium leading-relaxed",children:"Want Trevor to look at this himself? Drop your name and the best way to reach you. He follows up personally."}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),m()},className:"space-y-2",children:[(0,a.jsx)("input",{value:n,onChange:e=>s(e.target.value),placeholder:"Your name","aria-label":"Your name",autoComplete:"name",className:"w-full bg-card/40 border border-border/25 rounded-xl px-3.5 py-2.5 text-base md:text-sm font-medium text-foreground placeholder:text-muted-foreground outline-none focus:border-primary/40 transition-colors"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:i,onChange:e=>d(e.target.value),placeholder:"Phone or email","aria-label":"Phone number or email address",autoComplete:"tel",maxLength:80,className:"flex-1 min-w-0 bg-card/40 border border-border/25 rounded-xl px-3.5 py-2.5 text-base md:text-sm font-medium text-foreground placeholder:text-muted-foreground outline-none focus:border-primary/40 transition-colors"}),(0,a.jsx)("button",{type:"submit",disabled:"sending"===c||!i.trim(),className:"shrink-0 inline-flex items-center gap-1.5 bg-primary text-primary-foreground font-black uppercase italic tracking-tighter px-4 py-2.5 rounded-xl text-[13px] disabled:opacity-40 hover:shadow-lg hover:shadow-primary/25 transition-shadow",children:"sending"===c?(0,a.jsx)(l.Z,{className:"w-3.5 h-3.5 animate-spin"}):"Send"})]})]}),"error"===c&&(0,a.jsxs)("p",{role:"alert",className:"text-[13px] font-bold text-red-400",children:["Could not send. Call ",(0,a.jsx)(h.SafePhoneText,{})," instead."]}),(0,a.jsxs)("p",{className:"text-[13px] text-faint font-medium",children:["Rather talk now?"," ",(0,a.jsx)(x.default,{href:"/contact",onClick:()=>(0,f.x8)("concierge_book_call"),className:"text-primary font-bold hover:underline",children:"Text us."})]})]})}function v(){var e;let[r,t]=(0,o.useState)(!1),[x,h]=(0,o.useState)([]),[v,j]=(0,o.useState)(""),[w,N]=(0,o.useState)(!1),[k,S]=(0,o.useState)("pending"),[C,T]=(0,o.useState)(!1),_=(0,o.useRef)(null),Z=(0,o.useRef)(null);(0,o.useEffect)(()=>{var e;r&&window.matchMedia("(hover: hover)").matches&&(null===(e=Z.current)||void 0===e||e.focus())},[r]);let P=x.filter(e=>"user"===e.role).length;(0,o.useEffect)(()=>{P>=3&&T(!0)},[P]);let E="pending"===k&&C;(0,o.useEffect)(()=>{var e;null===(e=_.current)||void 0===e||e.scrollTo({top:_.current.scrollHeight,behavior:"smooth"})}
1,[x,w,E,k]);let z=async e=>{let r=(null!=e?e:v).trim();if(!r||w)return;j("");let t=[...x,{role:"user",content:r}];h(t),N(!0);try{let e=await fetch("/api/concierge",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({messages:t})});if(!e.ok||!e.body)throw Error("bad response");h(e=>[...e,{role:"assistant",content:""}]);let r=e.body.getReader(),a=new TextDecoder,o="";for(;;){let{done:e,value:t}=await r.read();if(e)break;o+=a.decode(t,{stream:!0}),h(e=>{let r=[...e];return r[r.length-1]={role:"assistant",content:o},r})}o.trim()||h(e=>{let r=[...e];return r[r.length-1]={role:"assistant",content:"Good one. That's better answered on a quick call â Trevor's at ".concat(p.gc,".")},r})}catch(e){h(e=>[...e,{role:"assistant",content:"Having trouble connecting right now. The fastest answer is always Trevor himself: ".concat(p.gc,".")}])}finally{N(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.M,{children:!r&&(0,a.jsx)("div",{className:"concierge-fab dock-kb-hide fixed right-5 z-40 bottom-[calc(1.25rem_+_var(--vv-bottom,0px))]",children:(0,a.jsxs)(s.E.button,{initial:{opacity:0,y:20,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.9},transition:{duration:.4,ease:g,delay:1.2},onClick:()=>{t(!0),(0,f.x8)("concierge_open")},"aria-label":"Ask Trevor a question",className:"inline-flex items-center gap-2.5 bg-primary text-primary-foreground font-black uppercase italic tracking-tighter pl-4 pr-5 py-3.5 rounded-full shadow-2xl shadow-primary/30 hover:scale-105 transition-transform",children:[(0,a.jsx)(i,{className:"w-5 h-5"}),(0,a.jsx)("span",{className:"text-sm hidden sm:block",children:"Ask Trevor"})]})},"launcher")}),(0,a.jsx)(n.M,{children:r&&(0,a.jsx)("div",{className:"fixed right-4 left-4 sm:left-auto z-40 sm:w-[400px] bottom-[calc(1rem_+_var(--vv-bottom,0px))]",children:(0,a.jsxs)(s.E.div,{initial:{opacity:0,y:28,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:28,scale:.97},transition:{duration:.35,ease:g},role:"dialog","aria-label":"Ask Trevor",className:"flex flex-col max-h-[min(78vh,calc(var(--vv-height,100vh)_-_2rem))] bg-background/95 backdrop-blur-2xl border border-border/30 rounded-3xl shadow-2xl shadow-black/60 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border/20 bg-gradient-to-r from-primary/[0.08] to-transparent",children:[(0,a.jsx)("div",{className:"relative w-10 h-10 rounded-full overflow-hidden border border-primary/30 shrink-0",children:(0,a.jsx)(m.default,{src:"/trevorruby-v2.jpg",alt:"Trevor Ruby",fill:!0,className:"object-cover",sizes:"40px"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-black uppercase italic tracking-tighter text-foreground leading-none",children:"Ask Trevor"}),(0,a.jsx)("p",{className:"text-[13px] text-muted-foreground font-medium mt-1",children:"Instant answers. Real human on the phone."})]}),(0,a.jsx)("button",{onClick:()=>t(!1),"aria-label":"Close",className:"w-9 h-9 rounded-xl bg-white/5 hover:bg-white/10 flex items-center justify-center transition-colors",children:(0,a.jsx)(d.Z,{className:"w-4 h-4 text-muted-foreground"})})]}),(0,a.jsxs)("div",{ref:_,className:"flex-1 overflow-y-auto px-4 py-4 space-y-3 min-h-[220px]",children:[0===x.length&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"bg-card/40 border border-border/20 rounded-2xl rounded-tl-md px-4 py-3 max-w-[85%]",children:(0,a.jsx)("p",{className:"text-sm text-foreground font-medium leading-relaxed",children:"Hey, what can we figure out for your business? Pricing, timelines, what Trevor would build for your shop. Straight answers."})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(e=>(0,a.jsx)("button",{onClick:()=>z(e),className:"text-[13px] font-bold text-primary border border-primary/25 bg-primary/5 hover:bg-primary/15 rounded-full px-3.5 py-2 transition-colors text-left",children:e},e))})]}),x.map((e,r)=>(0,a.jsx)("div",{className:"user"===e.role?"flex justify-end":"flex justify-start",children:(0,a.jsx)("div",{className:"user"===e.role?"bg-primary text-primary-foreground rounded-2xl rounded-tr-md px-4 py-3 max-w-[85%]":"bg-card/40 border border-border/20 rounded-2xl rounded-tl-md px-4 py-3 max-w-[85%]",children:(0,a.jsx)("p",{className:"text-sm font-medium leading-relaxed whitespace-pre-wrap ".concat("user"===e.role?"":"text-foreground"),children:e.content||"â¦"})})},r)),w&&(null===(e=x[x.length-1])||void 0===e?void 0:e.role)==="user"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-faint text-[13px] font-bold pl-1",children:[(0,a.jsx)(l.Z,{className:"w-3.5 h-3.5 animate-spin"})," thinkingâ¦"]}),E&&(0,a.jsx)("div",{className:"flex justify-start",children:(0,a.jsx)(y,{messages:x,onDone:()=>S("captured")})}),"captured"===k&&(0,a.jsx)("div",{className:"flex justify-start",role:"status",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 bg-green-500/10 border border-green-500/20 rounded-2xl rounded-tl-md px-4 py-3 max-w-[85%]",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 text-green-500 shrink-0","aria-hidden":"true"}),(0,a.jsx)("p",{className:"text-sm font-bold text-green-400",children:"Got it. Trevor will reach out personally."})]})})]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),z()},className:"flex items-center gap-2 p-3 border-t border-border/20",children:[(0,a.jsx)("input",{ref:Z,value:v,onCh
1ange:e=>j(e.target.value),placeholder:"Ask anythingâ¦","aria-label":"Your question",className:"flex-1 min-w-0 bg-card/30 border border-border/20 rounded-xl px-4 py-3 text-base md:text-sm font-medium text-foreground placeholder:text-muted-foreground outline-none focus:border-primary/40 transition-colors"}),(0,a.jsx)("button",{type:"submit",disabled:w||!v.trim(),"aria-label":"Send",className:"w-11 h-11 shrink-0 rounded-xl bg-primary text-primary-foreground flex items-center justify-center disabled:opacity-40 hover:shadow-lg hover:shadow-primary/25 transition-shadow",children:(0,a.jsx)(u.Z,{className:"w-4 h-4"})})]})]})},"panel")})]})}}}]);
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.