PageSourceSearch

https://www.gruposol.com.br/_next/static/chunks/4671.68a57fef076f69d0.js

js gruposol.com.br collected 2026-10-06 04:42:03 UTC 7,219 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e1b2a183-0171-43b1-862d-7babe1f86fb9",e._sentryDebugIdIdentifier="sentry-dbid-e1b2a183-0171-43b1-862d-7babe1f86fb9")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4671],{14671:(e,t,r)=>{r.r(t),r.d(t,{WhatsAppLeadForm:()=>m});var n=r(73365),s=r(93149),o=r(61836),a=r(1521),i=r(58491);let l=i.Ik({name:i.Yj().min(2,"Nome deve ter pelo menos 2 caracteres").max(100,"Nome deve ter no m\xe1ximo 100 caracteres").transform(e=>e.trim()),phone:i.Yj().regex(/^(\+55\s?)?(\(?\d{2}\)?\s?)?(\d{4,5}[-.\s]?\d{4})$/,"Telefone inv\xe1lido. Use o formato (11) 98765-4321").transform(e=>e.replace(/\D/g,"")),email:i.Yj().email("Email inv\xe1lido").toLowerCase().transform(e=>e.trim()),utm_source:i.Yj().optional(),utm_medium:i.Yj().optional(),utm_campaign:i.Yj().optional(),utm_term:i.Yj().optional(),utm_content:i.Yj().optional(),referrer:i.Yj().optional()});var d=r(24717),c=r(94053);function m(e){let{whatsappLink:t,onClose:r}=e,[i,m]=(0,a.useState)(!1),[u,f]=(0,a.useState)(null),p=(0,a.useRef)(null),h=(0,a.useRef)(Date.now()),x=(0,d.i)(),{register:g,handleSubmit:w,setValue:b,formState:{errors:y}}=(0,s.mN)({resolver:(0,o.u)(l)});(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&r()}function t(e){Date.now()-h.current<100||p.current&&!p.current.contains(e.target)&&r()}return document.addEventListener("keydown",e),document.addEventListener("mousedown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t)}},[r]);let j=async e=>{m(!0),f(null);try{let n=await fetch("/api/whatsapp-lead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,...x.current})});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error||"Erro ao enviar")}"function"==typeof window.gtag&&window.gtag("event","wpp_floating_form_submit",{event_category:"whatsapp",event_label:"lead_form"}),(0,c._N)("whatsapp",{name:e.name,email:e.email,phone:e.phone});let s=encodeURIComponent(`Ol\xe1! Meu nome \xe9 ${e.name}. Gostaria de mais informa\xe7\xf5es sobre os servi\xe7os da Sol Diesel.`),o=t.includes("?")?`${t}&text=${s}`:`${t}?text=${s}`;window.open(o,"_blank"),r()}catch(e){f(e instanceof Error?e.message:"Erro ao enviar")}finally{m(!1)}},v=g("phone");return(0,n.jsxs)("div",{ref:p,className:"fixed bottom-24 right-6 z-[9998] w-[350px] max-w-[calc(100vw-2rem)] origin-bottom-right animate-wpp-chat-in overflow-hidden rounded-[3px] shadow-2xl",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 bg-[#075E54] px-4 py-3",children:[(0,n.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-white/20 text-sm font-bold text-white",children:"SD"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-semibold text-white",children:"Chame no WhatsApp"}),(0,n.jsx)("p",{className:"text-xs text-white/70",children:"Sol Diesel"})]}),(0,n.jsx)("button",{type:"button",onClick:r,className:"text-white/80 transition-colors hover:text-white","aria-label":"Fechar",children:(0,n.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"bg-[#E5DDD5] px-4 py-4",children:[(0,n.jsxs)("div",{className:"relative mb-4 max-w-[85%] rounded-lg rounded-tl-none bg-white px-3 py-2 shadow-sm",children:[(0,n.jsx)("div",{className:"absolute -left-2 top-0 h-0 w-0 border-r-8 border-t-8 border-r-transparent border-t-white"}),(0,n.jsx)("p",{className:"text-[13px] leading-relaxed text-gray-800",children:"Ol\xe1! Precisa de mais informa\xe7\xf5es? Me informe seus dados e prontamente ser\xe1 direcionado ao nosso WhatsApp."}),(0,n.jsx)("span",{className:"mt-1 block text-right text-[10px] text-gray-400",children:"agora"})]}),(0,n.jsxs)("form",{onSubmit:w(j),className:"space-y-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{...g("name"),id:"wpp-name",placeholder:"Nome *",className:"w-full rounded-md border border-gray-200 bg-[#e7ffe7] px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:border-[#075E54] focus:outline-none focus:ring-1 focus:ring-[#075E
154]"}),y.name&&(0,n.jsx)("p",{className:"mt-0.5 text-xs text-red-600",children:y.name.message})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{...v,id:"wpp-phone",placeholder:"Telefone *",type:"tel",onChange:e=>{let t=function(e){let t=e.replace(/\D/g,"").slice(0,11);return t.length<=2?t.length?`(${t}`:"":t.length<=7?`(${t.slice(0,2)}) ${t.slice(2)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`}(e.target.value);e.target.value=t,b("phone",t,{shouldValidate:!1})},className:"w-full rounded-md border border-gray-200 bg-[#e7ffe7] px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:border-[#075E54] focus:outline-none focus:ring-1 focus:ring-[#075E54]"}),y.phone&&(0,n.jsx)("p",{className:"mt-0.5 text-xs text-red-600",children:y.phone.message})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{...g("email"),id:"wpp-email",placeholder:"Email *",type:"email",className:"w-full rounded-md border border-gray-200 bg-[#e7ffe7] px-3 py-2 text-sm text-gray-800 placeholder:text-gray-500 focus:border-[#075E54] focus:outline-none focus:ring-1 focus:ring-[#075E54]"}),y.email&&(0,n.jsx)("p",{className:"mt-0.5 text-xs text-red-600",children:y.email.message})]}),u&&(0,n.jsx)("p",{className:"text-xs text-red-600",children:u}),(0,n.jsx)("button",{type:"submit",disabled:i,className:"flex w-full items-center justify-center gap-2 rounded-md bg-[#075E54] py-2.5 text-sm font-semibold text-white transition-colors hover:bg-[#064d45] disabled:opacity-60",children:i?"Enviando...":(0,n.jsxs)(n.Fragment,{children:["Iniciar conversa",(0,n.jsx)("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})})]})})]})]})]})}},24717:(e,t,r)=>{r.d(t,{i:()=>a});var n=r(1521);let s="sol_utm",o=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function a(){let e=(0,n.useRef)({});return(0,n.useEffect)(()=>{let t=new URLSearchParams(window.location.search),r={};for(let e of o){let n=t.get(e);n&&(r[e]=n)}let n=Object.keys(r).length>0,a=function(){try{return JSON.parse(sessionStorage.getItem(s)||"{}")}catch{return{}}}(),i=document.referrer&&!document.referrer.includes(window.location.host)?document.referrer:void 0;if(n){let t={...r,referrer:a.referrer||i};e.current=t;try{sessionStorage.setItem(s,JSON.stringify(t))}catch{}}else Object.keys(a).length>0?e.current=a:e.current=i?{referrer:i}:{}},[]),e}},94053:(e,t,r)=>{function n(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[,t]=e;return null!=t&&""!==t}))}function s(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)}function o(e,t,r){s({event:"lead",form_type:e,lead_value:n(t),...r?n(r):{}})}function a(e,t){s({event:e,...t?{lead_value:n(t)}:{}})}r.d(t,{_N:()=>o,oE:()=>n,sh:()=>a})}}]);

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.