1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[42919],{42919:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return ConvSearch_ConvSearch}});var t=n(14710),a=n(42081),o=n(69106),l=n.n(o),c=n(99656),i=n.n(c),s=n(76829),v=n(6329),h=n(73884),u=n(21028),_=n(53060),d=n(61171),C=n(90101),S=n(41680),m=n(40852),f=n(39231),g=n(98904),p=n(92824),x=n(42589),b=n(95394),N=n.n(b),T=n(77883),j=n(88223),R=n(49255),k=n(83473),A=n(48075),E=n(87010),P=n(40665);let I={bpan:()=>"ais/_next/static/bpan-conv-search.796af3ea.svg",buscape:()=>"ais/_next/static/buscape-conv-search.5dc03e18.svg",zoom:()=>"ais/_next/static/zoom-conv-search.909a8829.svg"},w=Object.prototype.hasOwnProperty.call(I,"".concat(_.Z.BRAND_NAME_LOWERED))?"/".concat(I["".concat(_.Z.BRAND_NAME_LOWERED)]()):void 0;var ConvSearchIcon_ConvSearchIcon=e=>{let{className:r}=e,n=(0,v.v9)(P.Hu);if(!w)return null;let a=n?48:62;return(0,t.jsx)("img",{src:w,alt:"Busca conversacional",loading:"lazy",width:a,height:a,decoding:"async",className:r})},Z=n(58602),L=n.n(Z),y=n(83259),D=n.n(y),F=n(33512),M=n.n(F);let O=(0,a.forwardRef)((e,r)=>{let{children:n,gap:o=8,beforeChange:l,afterChange:c,testId:i,onInit:s,scrollDesktop:v=!1,onStartScroll:h,onEndScroll:u,onScrolled:_,page:d,setPage:C,totalPages:S,contentRef:m}=e,f=(0,a.useRef)(null),g=(0,a.useRef)(null),p=D()({[M().Content]:!0,[M().ScrollDesktop]:v});return(0,a.useImperativeHandle)(r,()=>({triggerNextPage(){let e=d+1;if(e>S)return null;let r=m.current;return r?(l&&l(d,e),r.scroll&&r.scroll({left:r.offsetWidth*e,behavior:"smooth"}),C(e),c&&c(d,e),e):null},triggerPrevPage(){let e=d-1;if(e<0)return null;let r=m.current;return r&&r.scroll?(l&&l(d,e),r.scroll&&r.scroll({left:r.offsetWidth*e,behavior:"smooth"}),C(e),c&&c(d,e),e):null},isOverflowing(){let e=m.current;return!!e&&e.scrollWidth>e.offsetWidth},getNumberOfPages:()=>S,railScrollLeft(){let e=m.current;return e?e.scrollLeft:0},railScrollToStart(){let e=null==m?void 0:m.current;e&&(e.scrollLeft=0)},goToPage(e){if(e<0||e>S)return;let r=m.current;r&&r.scroll&&(l&&l(d,e),r.scroll&&r.scroll({left:r.offsetWidth*e,behavior:"smooth"}),C(e),c&&c(d,e))}})),(0,a.useEffect)(()=>{s&&s()},[]),(0,t.jsx)("div",{className:M().Rail,"data-testid":i,children:(0,t.jsx)("div",{ref:m,className:p,style:{gap:"".concat(o,"px")},onTouchStart:e=>{h&&h(),g.current=null,f.current=e.targetTouches[0].clientX},onTouchEnd:()=>{var e,r;if(u&&u(),!f||!g)return;let n=(null!==(e=f.current)&&void 0!==e?e:0)-(null!==(r=g.current)&&void 0!==r?r:0),t=n>0,a=n<0;(t||a)&&_&&_(t?"left":"right",n)},onTouchMove:e=>{g.current=e.targetTouches[0].clientX},children:n})})}),getNumberOfPages=e=>{let r=e.current;return r?Math.ceil(r.scrollWidth/r.offsetWidth):0};var ConvSearch_ConvSearchContent=e=>{var r;let[n,o]=(0,a.useState)(0),[l,c]=(0,a.useState)(0),i=(0,a.useRef)(null),[s,h]=(0,a.useState)(!1),_=(0,a.useRef)(null),d=(0,v.v9)(P.Hu);(0,a.useEffect)(()=>{if(_.current&&_.current.railScrollToStart(),s){c(0);let e=getNumberOfPages(i);o(e)}},[null==e?void 0:e.filters]);let C=E.hb||E.zm;return(0,t.jsxs)("div",{"data-testid":"conv-search-new",className:L().ConvSearch,children:[!d&&(0,t.jsx)("div",{className:L().ConvSearch_ImageContainer,children:(0,t.jsx)(ConvSearchIcon_ConvSearchIcon,{className:L().ConvSearch_Image})}),(0,t.jsxs)("div",{className:L().ConvSearch_ActionContainer,children:[(0,t.jsxs)("div",{className:L().ConvSearch_QuestionContainer,children:[d&&(0,t.jsx)("div",{className:L().ConvSearch_ImageContainer,children:(0,t.jsx)(ConvSearchIcon_ConvSearchIcon,{className:L().ConvSearch_Image})}),(0,t.jsx)(u.Z,{modifier:"MobileParagraphS",lg:"DesktopParagraphS",className:L().ConvSearch_Title,children:e.convSearchIsOver?e.closureTitle:e.question})]}),(0,t.jsx)("div",{className:L().ConvSearch_FiltersContainer,children:e.convSearchIsOver?C&&(0,t.jsxs)(u.Z,{modifier:"MobileParagraphS",lg:"DesktopParagraphS",className:L().ConvSearch_Subtitle,children:[e.closureSubtitle,"\xa0",(0,t.jsx)(T.Z,{title:"fale com os especialistas",href:"#",onClick:e.onAnchorClick,children:e.closureAnchor})]}):(0,t.jsxs)("div",{className:L().ConvSearch_Itens,children:[n>1&&(0,t.jsx)(R.Z,{className:L().ConvSearch_ScrollPrevious,onClick:()=>{_.current&&_.current.triggerPrevPage()},icon:"RoundedArrowLeft",bordered:!0,shape:k.jw.CIRCLE,disabled:0===l}),(0,t.jsx)("div",{className:L().ConvSearch_FiltersRail,children:(0,t.jsx)(O,{ref:_,page:l,setPage:c,onInit:()=>{if(s)return;let e=getNumberOfPages(i);o(e),h(!0)},contentRef:i,totalPages:n,setTotalPages:o,children:null==e?void 0:null===(r=e.filters)||void 0===r?void 0:r.map((r,n)=>(0,t.jsxs)(j.Z,{"data-testid":"conv-search_filter",as:"button",type:"button",onClick:()=>{var t;null==e||null===(t=e.onChipClick)||void 0===t||t.call(e,r.title,n)},className:L().ConvSearch_Filter,children:[r.icon&&(0,t.jsx)("img",{width:"large"===e.fieldSize?56:22,height:"large"===e.fieldSize?56:22,src:r.icon.url,alt:"Icone"}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Z,{className:L().ConvSearch_FilterText,tag:A.rb.P,modifier:A.cj.SMALL,children:r.title}),r.subtitle&&(0,t.jsx)(u.Z,{tag:A.rb.SPAN,modifier:A.cj.X_SMALL,children:r.subtitle})]})]},r.id))})}),n>1&&(0,t.jsx)(R.Z,{className:L().ConvSearch_ScrollNext,onClick:()=>{_.current&&_.current.triggerNextPage()},icon:"RoundedArrowRight",bordered:!0,shape:k.jw.CIRCLE,disabled:l+1>=n})]})})]})]})},W=n(46034);let onFilterClickTracker=e=>
1{let{gaEventParams:r,filterTitle:n,convSearchIsOver:t,stepData:a,currentStep:o,index:l}=e,{search_term:c,pagetype:i,category:s}=r;(0,h.dispatch)((0,h.getGA4EventTemplate)({eventName:"search_refinement",pagetype:i,category:s,search_term:c,area:"busca-conv-answer",option:(0,d.lV)(n),step:t?"sold-out-of-questions":(0,d.lV)(a.question),index:Number(o)})),(0,h.dispatch)({category:"".concat(_.Z.BRAND_NAME_LOWERED,"_search"),action:"busca-conv-answer_click_button",label:t?"sold-out-of-questions":"".concat((0,d.lV)(a.question),"_").concat((0,d.lV)(n))}),W.ZP.pushDataLayer({event_name:"select_filter_category",filter_category:"conversational_filters",filter_title:n||"",position:null!=l?l:0})};var trackers_onTalkToExpertClick=e=>{let{search_term:r,pagetype:n,category:t,categoryId:a}=e,o="search"===n?r:"".concat(a,"_").concat(t);(0,h.dispatch)((0,h.getGA4EventTemplate)({eventName:"search_refinement",area:"busca-conv-answer",option:"talk_to_expert",category:(0,d.lV)(t),pagetype:n,search_term:(0,d.lV)(o)})),(0,h.dispatch)({category:"".concat(_.Z.BRAND_NAME_LOWERED,"_search"),action:"busca-conv-answer_talk-to-expert_click",label:(0,d.lV)(o)})},ConvSearch_ConvSearch=()=>{let e=(0,s.useRouter)(),r=(0,v.I0)(),{stepData:n,nextStep:o,convSearchEnded:c}=(0,v.v9)(m.iA),b=(0,v.v9)(m.jB),T=(0,v.v9)(g.MU),j=(0,v.v9)(f.oz),R=(0,p.ps)(),k=function(){let e=(0,v.v9)(g.zq),r=(0,v.v9)(g.sh),n=(0,v.v9)(g.cc),t=(0,v.v9)(f.oz),a=e?n||(null==t?void 0:t.label):r;return a}(),{pagetype:A,search_term:E}=R,P=(0,v.v9)(f.Y$),I=!c&&(i()(b)||i()(n)),w=c&&i()(n);(0,a.useEffect)(()=>{(0,h.dispatch)({category:"".concat(_.Z.BRAND_NAME_LOWERED,"_search"),action:"busca-conv_view",label:w?"sold-out-of-questions":(0,d.lV)((null==n?void 0:n.question)||"")}),(0,h.dispatch)((0,h.getGA4EventTemplate)({eventName:"search_refinement",pagetype:A,category:(0,d.lV)((null==j?void 0:j.label)||""),search_term:E,area:"busca-conv-answer",option:"busca-conv_view",step:w?"sold-out-of-questions":(0,d.lV)((null==n?void 0:n.question)||""),index:Number(b)}))},[A,E,j,n,b,w]);let Z=(0,a.useCallback)((r,t)=>{var a,c,i,s,v,h,u,_,d,C,S,m;let f=(null==n?void 0:null===(a=n.filters)||void 0===a?void 0:a.filter(e=>e.title===r))||[],g=null===(c=f[0].searchParametersZsearch)||void 0===c?void 0:c.refinements.filter(e=>"price"===e.id),p={id:"price",ranges:{min:(null===(s=g[0])||void 0===s?void 0:null===(i=s.ranges)||void 0===i?void 0:i.min)||P.min,max:(null===(h=g[0])||void 0===h?void 0:null===(v=h.ranges)||void 0===v?void 0:v.max)||P.max}},N=null===(u=f[0].searchParametersZsearch)||void 0===u?void 0:u.refinements,j=!l()(g)&&(!(null===(d=g[0])||void 0===d?void 0:null===(_=d.ranges)||void 0===_?void 0:_.min)||!(null===(S=g[0])||void 0===S?void 0:null===(C=S.ranges)||void 0===C?void 0:C.max));j&&(N=[...null===(m=f[0].searchParametersZsearch)||void 0===m?void 0:m.refinements.filter(e=>"price"!==e.id),p]),onFilterClickTracker({gaEventParams:R,filterTitle:r,convSearchIsOver:w,stepData:n,currentStep:b,index:t});let k=(0,x.R)({...T,refinements:N,convSearchStep:null!=o?o:0,enableRefinementsSuggestions:!1});e.push(k)},[n,P.min,P.max,R,w,b,T,o,e]);return I?null:(0,t.jsxs)("div",{className:N().ConvSearchWrapper,children:[k&&(0,t.jsxs)("div",{className:N().SearchTerm,children:[(0,t.jsx)(u.Z,{modifier:"MobileLabelS",className:N().SearchTerm_Title,children:"Voc\xea buscou"}),(0,t.jsx)(u.Z,{modifier:"MobileTitleM",className:N().SearchTerm_Term,"data-testid":"content::title",tag:"h1",children:(0,C.Z)(k)})]}),(0,t.jsx)(ConvSearch_ConvSearchContent,{convSearchIsOver:w,question:null==n?void 0:n.question,fieldSize:null==n?void 0:n.fieldSize,filters:null==n?void 0:n.filters,onChipClick:Z,closureTitle:"Veja se esses produtos te atendem!",closureSubtitle:"Ainda precisa de ajuda?",closureAnchor:"Fale com nosso time de Especialistas",onAnchorClick:()=>{trackers_onTalkToExpertClick(R),r((0,S.B)(!0))}})]})}},95394:function(e){e.exports={highlightLayout:"ConvSearch_highlightLayout__j4Q3g",ConvSearch:"ConvSearch_ConvSearch__GtgaO",SearchTerm:"ConvSearch_SearchTerm__483rv",SearchTerm_Title:"ConvSearch_SearchTerm_Title__ekFX9",SearchTerm_Term:"ConvSearch_SearchTerm_Term__Kr5Ps",ConvSearchWra
1pper:"ConvSearch_ConvSearchWrapper__6GE1S"}},58602:function(e){e.exports={ConvSearch:"ConvSearchContent_ConvSearch__ubccM",ConvSearch_ImageContainer:"ConvSearchContent_ConvSearch_ImageContainer__bwJD_",ConvSearch_QuestionContainer:"ConvSearchContent_ConvSearch_QuestionContainer__P1yGN",ConvSearch_FiltersContainer:"ConvSearchContent_ConvSearch_FiltersContainer__AF03y",ConvSearch_ActionContainer:"ConvSearchContent_ConvSearch_ActionContainer__XNRsq",ConvSearch_Filter:"ConvSearchContent_ConvSearch_Filter__a2gAK",ConvSearch_FiltersRail:"ConvSearchContent_ConvSearch_FiltersRail__mze_N",ConvSearch_FilterText:"ConvSearchContent_ConvSearch_FilterText__dmnrr",ConvSearch_ScrollPrevious:"ConvSearchContent_ConvSearch_ScrollPrevious__SfVtT",ConvSearch_ScrollNext:"ConvSearchContent_ConvSearch_ScrollNext__Ct_9k",ConvSearch_Itens:"ConvSearchContent_ConvSearch_Itens__KQAA5"}},33512:function(e){e.exports={Rail:"ConvSearchRail_Rail__DiRdc",Content:"ConvSearchRail_Content__sB1Ex",ScrollDesktop:"ConvSearchRail_ScrollDesktop__ib1sW"}}}]);
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.