@soma-vertical-web/multi-lib 0.0.68 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/types/cms/Sections/SectionZone/intex.d.ts +1 -1
package/index.js
CHANGED
|
@@ -79,4 +79,4 @@ See more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-comp
|
|
|
79
79
|
${r}
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
|
-
`},hx=Object.freeze(Object.defineProperty({__proto__:null,generateMiddleware:mx},Symbol.toStringTag,{value:"Module"})),gx={helpers:hx},ts={"custom-carousel":"_custom-carousel_t5fgp_1","carrousel-arrows-display-controller":"_carrousel-arrows-display-controller_t5fgp_10","carousel-controllers-modifier":"_carousel-controllers-modifier_t5fgp_19"};function yx(e,t){const{mediatorRef:r}=le();x.useEffect(()=>r.current.subscribe(e,t),[e,t])}const oc=({prevOnClick:e,nextOnClick:t,onBulletClick:r,currentPage:o,totalPages:s,position:i,hideControllers:a,left:c,isFirst:l,ICONS:u})=>{const[f,h]=x.useState("default");return yx("herobanner:change_controllers_variant",d=>{l&&h(d.includes("white")?"inverse":"default")}),n.jsxs(m.Carousel.Controller,{className:ts["carousel-controllers-modifier"],position:i??"absolute","data-hide-controllers":a,bottom:"16px",top:"unset",left:c,children:[n.jsxs(m.Carousel.Arrows,{className:ts["carrousel-arrows-display-controller"],children:[n.jsx(m.Button,{variant:"tertiary",onClick:e,adornment:{start:n.jsx(m.Icon,{name:u.arrow_left})},mode:f}),n.jsx(m.Button,{variant:"tertiary",onClick:t,adornment:{start:n.jsx(m.Icon,{name:u.arrow_right})},mode:f})]}),n.jsx(m.Carousel.Bullets,{page:o,total:s,onBulletClick:r,mode:f})]})},_x=({children:e,data:t,banner:r,...o})=>{const{mediatorRef:s}=le();return t.data.first?n.jsx(Dr,{observerOptions:{threshold:.51},stopOnIntersection:!1,callBackWhenVisible:()=>{s.current.publish("header:change_variant",r.headerVariant)},...o,children:e}):n.jsx(n.Fragment,{children:e})},Sp=e=>{const{initialize:t,pagination:r,controller:o,itemsStyles:s}=m.Carousel.useCarousel({gap:e.data.config.gap,itemsPerPage:e.data.config.slidesPerView,direction:"row"}),i=x.useRef(void 0),a=x.useMemo(()=>Yf(e.data.config.controllerPosition??"dentro-inferior-centro"),[e]),c=x.useCallback(()=>{e.data.config.slideDuration&&r.totalPages>1&&(i.current=setInterval(()=>{o==null||o.nextPage()},e.data.config.slideDuration*1e3))},[o,e.data.config.slideDuration,r.totalPages]),l=x.useCallback(f=>{clearInterval(i.current),c(),f()},[c]),u=x.useMemo(()=>{var f;return{nextOnClick:()=>l(()=>o==null?void 0:o.nextPage()),prevOnClick:()=>l(()=>o==null?void 0:o.prevPage()),onBulletClick:h=>l(()=>o==null?void 0:o.navigateTo(h)),currentPage:r.currentPage,totalPages:r.totalPages,position:a.position,hideControllers:((f=e.data.config)==null?void 0:f.hideControllers)??!1,left:a.left}},[r.currentPage,r.totalPages,a.position,e.data.config.hideControllers,l,o]);return x.useEffect(()=>(c(),()=>clearInterval(i.current)),[c]),n.jsxs(m.Carousel.Root,{innerRef:f=>{t(f)},className:m.helpers.classNameConcat(ts["custom-carousel"],e.data.config.fullWidth?"":"common-section"),"data-infinity-border":!0,style:{...e.data.config.marginTop!=="0px"&&{marginTop:`-${e.data.config.marginTop}`},...e.data.config.marginBottom!=="0px"&&{marginBottom:`-${e.data.config.marginBottom}`}},children:[a.shouldRender==="top"&&r.totalPages>1?n.jsx(oc,{ICONS:e.ICONS,...u,isFirst:e.data.first}):n.jsx(n.Fragment,{}),n.jsx(m.Carousel.Body,{children:e==null?void 0:e.data.banners.map((f,h)=>n.jsx(m.Carousel.Item,{style:s,children:n.jsx(_x,{data:e,banner:f,children:n.jsx(Jt,{ICONS:e.ICONS,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,data:{banner:f,index:h,componentIndex:e.data.componentIndex},creative:"banner-carousel",...e.data.first&&h===0&&{priority:!0}})})},`hero-banner-item-${h}`))}),a.shouldRender==="bottom"&&r.totalPages>1?n.jsx(oc,{ICONS:e.ICONS,...u}):n.jsx(n.Fragment,{})]})},vx={Banner:Hs},Lt={"row-controller-modifier":"_row-controller-modifier_co4wb_1","carousel-title-modifier":"_carousel-title-modifier_co4wb_18","carousel-modifier":"_carousel-modifier_co4wb_22","card-modifier":"_card-modifier_co4wb_26"},Pp=({data:e,CONSTANTS:t})=>{var u;const{isMobile:r}=le(),o=e.config.size??"medium",s=e.config.disableCarouselMobile??!1,{initialize:i,pagination:a,controller:c,itemsStyles:l}=m.Carousel.useCarousel({itemsPerPage:r?e==null?void 0:e.config.slidesPerViewMobile:(u=e==null?void 0:e.config)==null?void 0:u.slidesPerView,gap:r?e.config.gapMobile:e.config.gap,direction:r&&s?"column":"row"});return n.jsx(m.Utils.Column,{style:{width:o==="small"?"70%":"100%"},alignContent:"center",justifyContent:"center",alignItems:"center",children:n.jsxs(m.Carousel.Root,{innerRef:f=>{i(f)},className:m.helpers.classNameConcat(Lt["carousel-modifier"],"common-section"),children:[o==="medium"?n.jsxs(m.TextStructure.Root,{children:[n.jsx(m.TextStructure.DivWrapper,{className:Lt["carousel-title-modifier"],children:n.jsx("h2",{className:"typography-style-body-lg",children:t.BENNEFITS_BAR_TITLE})}),r&&a.totalPages>1?n.jsx(m.Carousel.Controller,{className:Lt["row-controller-modifier"],children:n.jsxs(m.Carousel.Arrows,{children:[n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.prevPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_left})}}),n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.nextPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_right})}})]})}):n.jsx(n.Fragment,{})]}):n.jsx(n.Fragment,{}),n.jsx(m.Carousel.Body,{children:e.bennefit.map((f,h)=>n.jsx(m.Carousel.Item,{className:Lt["card-modifier"],style:l,children:n.jsx(m.Card,{stroke:!0,padding:"small",children:n.jsx(m.TextStructure.Root,{layoutProps:{columnWrapper:{alignContent:"start",alignItems:"start",justifyContent:"start"},textRow:{alignContent:"center",alignItems:"center",justifyContent:"center"}},adornment:{[o==="medium"?"top":"start"]:n.jsx(m.Icon,{name:f.icon,size:o==="medium"?"medium":"small"})},children:n.jsxs(m.TextStructure.DivWrapper,{alignItems:"start",children:[n.jsx("h3",{className:"typography-style-body-md",children:f.title}),f.subtitle&&f.subtitle.length?n.jsx("p",{className:"typography-style-body-xs",children:f.subtitle}):n.jsx(n.Fragment,{})]})})})},`bennefit=${h}`))}),!r&&a.totalPages>1?n.jsxs(m.Carousel.Controller,{className:Lt["row-controller-modifier"],children:[n.jsxs(m.Carousel.Arrows,{children:[n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.prevPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_left})}}),n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.nextPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_right})}})]}),n.jsx(m.Carousel.Bullets,{page:a.currentPage,total:a.totalPages,onBulletClick:f=>c==null?void 0:c.navigateTo(f)})]}):n.jsx(n.Fragment,{})]})})},wp=({data:e,ICONS:t})=>n.jsx("div",{className:m.helpers.classNameConcat(Xo.textContentSection),style:e.borderTop?{borderTop:"none"}:void 0,children:n.jsx(Qf,{data:e,ICONS:t})}),sc={"accordion-modifier":"_accordion-modifier_1we16_1","accordion-body-modifier":"_accordion-body-modifier_1we16_7"},Ep=({data:e,id:t,ICONS:r})=>{var i;const[o,s]=x.useState([]);return n.jsxs(m.Utils.Column,{gap:"var(--gap-vertical-sm)",children:[e.titleAccordion?n.jsx(m.TextStructure.Root,{children:n.jsx(m.TextStructure.DivWrapper,{children:n.jsx("h2",{className:m.helpers.classNameConcat("typography-style-heading-sm","common-section"),style:{fontWeight:500},children:e.titleAccordion})})}):n.jsx(n.Fragment,{}),(i=e.accordions)==null?void 0:i.map((a,c)=>n.jsxs(m.Accordion.Wrapper,{className:sc["accordion-modifier"],children:[n.jsx(m.Accordion.Header,{id:`${t}-text-accordion-${c}`,openIndicator:n.jsx(m.Icon,{name:r.arrow_down}),closeIndicator:n.jsx(m.Icon,{name:r.arrow_up}),startOpen:o.includes(c),onClick:()=>s(l=>l.includes(c)?l.filter(u=>u!==c):[...l,c]),children:n.jsx(m.TextStructure.Root,{children:n.jsxs(m.TextStructure.DivWrapper,{className:Ko["draftjs-text-modifier"],children:[n.jsx("h3",{className:"typography-style-body-md-strong",children:a.title}),a.subtitle&&a.subtitle.length?n.jsx("h2",{children:a.subtitle}):n.jsx(n.Fragment,{})]})})}),n.jsx(m.Accordion.Body,{children:n.jsx(m.TextStructure.Root,{children:n.jsx(m.TextStructure.DivWrapper,{className:m.helpers.classNameConcat(sc["accordion-body-modifier"],Ko["draftjs-text-modifier"]),children:n.jsx(Ke.Editor,{editorKey:`${t}-editor-${c}`,blockRenderMap:wr,editorState:a.text?Pr(JSON.parse(a.text)):Ke.EditorState.createEmpty(),onChange:()=>null})})})})]},`${t}-accordion-${c}-${o.includes(c)}`))]})},Rp=x.createContext({}),xx=({data:e,children:t,...r})=>{var g,y,_,b,C,v,j,P,E,S,R,T,w;const[o,s]=x.useState(!0),{initialize:i,controller:a,itemsStyles:c}=m.Carousel.useCarousel({gap:0,itemsPerPage:1}),l={slideTranstionTimer:(y=(g=e==null?void 0:e.staticConfig)==null?void 0:g.staticConfig)==null?void 0:y.slideTranstionTimer,showCarouselArrows:(b=(_=e==null?void 0:e.staticConfig)==null?void 0:_.staticConfig)==null?void 0:b.showCarouselArrows,hasCloseBtn:(v=(C=e==null?void 0:e.staticConfig)==null?void 0:C.staticConfig)==null?void 0:v.hasCloseBtn,backgroundColor:(P=(j=e==null?void 0:e.staticConfig)==null?void 0:j.staticConfig)==null?void 0:P.backgroundColor,textColorVariant:(S=(E=e==null?void 0:e.staticConfig)==null?void 0:E.staticConfig)==null?void 0:S.textColorVariant,content:((T=(R=e==null?void 0:e.content)==null?void 0:R.content)==null?void 0:T.items)??[]},u=(w=l.content)==null?void 0:w.filter(I=>!I.countDownEndDate||new Date(I.countDownEndDate)>new Date),f=u.length>1,h={...l.backgroundColor?{backgroundColor:l.backgroundColor}:{}},d=()=>{s(!1)},p=m.helpers.ValidateProp({fieldTypes:St.Mode,property:l.textColorVariant,fallback:"default"});return n.jsx(Rp.Provider,{value:{isOpen:o,setIsOpen:s,hasCarousel:f,backgroundStyle:h,handleCloseTipbar:d,mode:p,slideTranstionTimer:l.slideTranstionTimer,showCarouselArrows:l.showCarouselArrows,hasCloseBtn:l.hasCloseBtn,slices:u,carouselProps:{initialize:i,controller:a,itemsStyles:c},...r},children:t})},ot=()=>x.useContext(Rp),bx=({dateEnd:e,...t})=>{const{CONSTANTS:{TIME_ZONE:r}}=ot();return n.jsx(Yo,{dateEnd:new Date(e),TIME_ZONE:r,...t})},jx="_tipbar_bt3p0_1",Cx="_tipbar__carousel_bt3p0_15",er={tipbar:jx,tipbar__carousel:Cx,"tipbar__close-btn":"_tipbar__close-btn_bt3p0_29","tipbar-item":"_tipbar-item_bt3p0_37","tipbar-item__coupon":"_tipbar-item__coupon_bt3p0_45"},Sx=({coupon:e,feedbackTitle:t,feedbackDescription:r,...o})=>{const{CONSTANTS:s}=ot(),{addCouponSeller:i,cartStore:a}=Ee(),[c,l]=x.useState({status:!1,showSnackBar:!1}),[u,f]=x.useState(!1),[h,d]=x.useState(!1),p=async()=>{if(!a.items.length){d(!0);return}(await i(e,"coupon")).code===200?l({status:!0,showSnackBar:!0}):f(!0)};return x.useEffect(()=>{c.showSnackBar&&setTimeout(()=>{l(g=>({...g,showSnackBar:!1}))},s.TIPBAR_CONFIGS.snackbar_timeout)},[c.showSnackBar]),x.useEffect(()=>{u&&setTimeout(()=>{f(!1)},s.TIPBAR_CONFIGS.snackbar_timeout)},[u]),x.useEffect(()=>{h&&setTimeout(()=>{d(!1)},s.TIPBAR_CONFIGS.snackbar_timeout)},[h]),n.jsxs(n.Fragment,{children:[n.jsx(m.Button,{...o,onClick:p,disabled:c.status,className:er["tipbar-item__coupon"],children:c.status?`${s.TIPBAR_CONFIGS.coupon_applied_message}`:`${s.TIPBAR_CONFIGS.coupon_default_message}`}),c.showSnackBar&&(t||r)&&n.jsx(Pt,{title:t,subtitle:r,Z_INDEX_WAR:s.Z_INDEX_WAR},`feedback-coupon-${e}`),u&&n.jsx(Pt,{title:s.TIPBAR_CONFIGS.coupon_error_title,subtitle:s.TIPBAR_CONFIGS.coupon_error_message,Z_INDEX_WAR:s.Z_INDEX_WAR},`error-coupon-${e}`),h&&n.jsx(Pt,{title:s.TIPBAR_CONFIGS.coupon_cart_empty_title,subtitle:s.TIPBAR_CONFIGS.coupon_cart_empty_message,Z_INDEX_WAR:s.Z_INDEX_WAR},`error-cart-empty-${e}`)]})},Px=({title:e,description:t,style:r,mode:o,className:s})=>n.jsx(m.TextStructure.Root,{children:n.jsxs(m.TextStructure.DivWrapper,{mode:o,className:s,children:[e&&n.jsx("h3",{className:"typography-style-body-sm",style:r,children:e}),t&&n.jsx("p",{className:"typography-style-caption",style:r,children:t})]})}),wx=({coupon:e,...t})=>{const{CONSTANTS:r}=ot();return n.jsx(m.Copy,{...t,iconCopy:r.ICONS.copy,iconSuccess:r.ICONS.check,children:e})},Ex=({staticZone:e,type:t,className:r,description:o,title:s})=>{const{mode:i}=ot();if(t==="countdown")return n.jsx(bx,{dateEnd:e.countDownEndDate,size:"x-small",mode:i});if(t==="coupon"){const a=m.helpers.ValidateProp({fieldTypes:St.Mode,property:e.couponButtonMode,fallback:"default"}),c=m.helpers.ValidateProp({fieldTypes:St.VariantsExtended,property:e.couponButtonVariant,fallback:"primary"});return e.coupon?n.jsx(Sx,{coupon:e.coupon,mode:a,variant:c,feedbackTitle:e.couponFeedbackTitle,feedbackDescription:e.couponFeedbackDescription}):null}if(t==="copy"){const a=m.helpers.ValidateProp({fieldTypes:St.Mode,property:e.couponButtonMode,fallback:"default"});return e.coupon?n.jsx(wx,{coupon:e.coupon,mode:a}):null}return n.jsx(Px,{title:s,description:o,mode:i,className:r})},ic=({handleCloseTipbar:e,mode:t})=>{const{CONSTANTS:r}=ot();return n.jsx(m.Button,{title:"fechar tipbar",className:er["tipbar__close-btn"],onClick:e,variant:"tertiary",mode:t,adornment:{start:n.jsx(m.Icon,{name:r.ICONS.close})}})},Rx=({children:e,mode:t="default",showCarouselArrows:r=!0,slideTranstionTimer:o})=>{const{carouselProps:s,CONSTANTS:i}=ot(),a=x.useRef(null),c=(u,f)=>{var h,d;u.stopPropagation(),u.preventDefault(),f==="prev"?(h=s.controller)==null||h.prevPage():(d=s.controller)==null||d.nextPage(),a.current&&(clearInterval(a.current),l())},l=x.useCallback(()=>{if(o&&s.controller){const u=setInterval(()=>{var f;(f=s.controller)==null||f.nextPage()},o);a.current=u}},[o,s]);return x.useEffect(()=>(l(),()=>{a.current&&clearInterval(a.current)}),[o,l]),n.jsxs(m.Carousel.Root,{innerRef:u=>{s.initialize(u)},className:er.tipbar__carousel,style:{flexDirection:"row",alignItems:"center"},children:[r&&n.jsx(m.Button,{variant:"tertiary",mode:t,onClick:u=>c(u,"prev"),adornment:{start:n.jsx(m.Icon,{name:i.ICONS.arrow_left})}}),n.jsx(m.Carousel.Body,{children:e}),r&&n.jsx(m.Button,{variant:"tertiary",mode:t,onClick:u=>c(u,"next"),adornment:{start:n.jsx(m.Icon,{name:i.ICONS.arrow_right})}})]})},Ax=({children:e,className:t})=>{const{hasCarousel:r,mode:o,hasCloseBtn:s,backgroundStyle:i,showCarouselArrows:a,slideTranstionTimer:c,handleCloseTipbar:l}=ot(),u=r&&a;return n.jsx("div",{style:i,"data-hasclosebtn":s,className:m.helpers.classNameConcat(er.tipbar,t),children:r?n.jsxs(n.Fragment,{children:[n.jsx(Rx,{mode:o,showCarouselArrows:u,slideTranstionTimer:c,children:e}),s&&n.jsx(ic,{handleCloseTipbar:l,showCarouselArrows:u,mode:o})]}):n.jsxs(n.Fragment,{children:[e,s&&n.jsx(ic,{handleCloseTipbar:l,mode:o})]})})},Ix=({children:e,highlightFirstSection:t,...r})=>{const{hasCarousel:o,carouselProps:s}=ot(),i=n.jsx("div",{...r,className:er["tipbar-item"],children:e});return o?n.jsx(m.Carousel.Item,{style:s.itemsStyles,children:i}):i},Ap=({className:e})=>{const{isOpen:t,slices:r}=ot();return r.length&&t?n.jsx(Ax,{children:r.map((o,s)=>{var i;return n.jsx(n.Fragment,{children:n.jsx(Kt,{href:o.link,children:n.jsx(Ix,{highlightFirstSection:o.highlightFirstSection,"data-justifyhighlightedsection":o.horizontalAlignHighlightedSection?o.horizontalAlignHighlightedSection:"center",children:o&&((i=o==null?void 0:o.items)!=null&&i.length)?o.items.map((a,c)=>n.jsx(Ex,{staticZone:o,type:a.type,title:a.title,description:a.description,className:e},`tipbar-slice-field-${c}`)):null})})},`tipbar-slice-${s}`)})}):null};Ap.displayName="TipBar.Root";const rs=({className:e,...t})=>n.jsx(xx,{...t,children:n.jsx(Ap,{className:e})});rs.displayName="TipBar";const Nx=({CONSTANTS:e,data:t})=>{const{pathname:r}=xe(),{tipbarRef:o}=je(),s=c=>{const l=t==null?void 0:t.find(u=>{var f,h,d,p,g;return((h=(f=u.staticConfig)==null?void 0:f.staticConfig)==null?void 0:h.deviceType)===c&&((g=(p=(d=u.staticConfig)==null?void 0:d.staticConfig)==null?void 0:p.paths)==null?void 0:g.includes(r))});return l||(t==null?void 0:t.find(u=>{var f,h,d,p,g,y;return((h=(f=u.staticConfig)==null?void 0:f.staticConfig)==null?void 0:h.deviceType)===c&&(!((p=(d=u.staticConfig)==null?void 0:d.staticConfig)!=null&&p.paths)||((y=(g=u.staticConfig)==null?void 0:g.staticConfig)==null?void 0:y.paths.length)===0)}))},i=s("desktop"),a=s("mobile");return n.jsxs("div",{ref:o,className:W.responsive["responsive-flex"],children:[a&&n.jsx("div",{className:W.responsive["responsive-mobile-flex"],children:n.jsx(rs,{data:a,CONSTANTS:e})}),i&&n.jsx("div",{className:W.responsive["responsive-desktop-flex"],children:n.jsx(rs,{data:i,CONSTANTS:e})})]})},ac={"card-image-wrapper":"_card-image-wrapper_10mul_1","card-image-container":"_card-image-container_10mul_9"},Ip=e=>{const{nextimage:t}=xe();return n.jsx(n.Fragment,{children:e.data.banners.map((r,o)=>n.jsx("div",{className:ac["card-image-wrapper"],children:n.jsx("div",{className:ac["card-image-container"],children:n.jsx(t,{src:r.image,alt:r.altImage?r.altImage:"Banner Coleção",width:500,height:600})})},o))})},Tx=({SectionZone:e,CMS_PROJECT_NAME:t,storeId:r,previewId:o})=>{const[s,i]=x.useState();return x.useEffect(()=>{s||W.getContentType({contentType:"search",CMS_PROJECT_NAME:t,storeId:r,previewId:o}).then(a=>{i(a.data[0])})},[]),n.jsx(e,{data:s??[]})},Np=({data:{componentIndex:e,...t},CONSTANTS:r})=>n.jsx(Vs,{...t,CONSTANTS:r}),Tp=async e=>{const{type:t}=e,r=t==="collectionSearch"?"/api/search/product":"/api/search/crosseling",o=JSON.stringify(t==="collectionSearch"?{...e.params,facets:e.facets,term:e.term,forceUpdate:!1}:e.facets);return(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:o}).then(i=>i.json()).then(i=>t==="collectionSearch"?i.data.products:i.products)).filter(i=>!!i.node.availability.status)},Ox="_shelf__container_bi04n_10",Op={shelf__container:Ox},kx=({collectionSearch:e,title:t,CONSTANTS:r})=>{const[o,s]=x.useState([]),{isMobile:i}=le(),{ref:a,inView:c}=lc.useInView({threshold:.7,delay:100,triggerOnce:!0}),{sendDataLayerEvent:l}=ce();return x.useEffect(()=>{if(!e)return;function u(){var f,h;Tp({type:"collectionSearch",term:e==null?void 0:e.term,facets:e==null?void 0:e.facets,params:{count:((f=e==null?void 0:e.params)==null?void 0:f.count)??12,sort:((h=e==null?void 0:e.params)==null?void 0:h.sort)??r.ITEMS_DEFAULT_SORT}}).then(d=>{s(d)})}u()},[e]),x.useEffect(()=>{!c||o.length===0||l({functionKey:"productListEvent",data:{event:"view_item_list",commonData:{products:o},customData:{item_list_name:t??"Você também pode gostar"}}})},[c,o]),o.length===0?null:n.jsx("div",{ref:a,className:Op.shelf__container,children:n.jsx(Ft.Shelf,{title:t??"Você também pode gostar",itemsPerPage:{desktop:4.4,mobile:2.2},ICONS:r.ICONS,children:Array.isArray(o)&&o.map(({node:u},f)=>{const{availability:{status:h}}=u;return h?n.jsx(Ft.Card,{item:u,isMobile:i,size:"medium",index:f,shelfTitle:t??"Você também pode gostar",CONSTANTS:r},u.id):null})})})},Lx=({recommendationSearch:e,title:t,CONSTANTS:r})=>{const[o,s]=x.useState([]),{isMobile:i}=le(),{ref:a,inView:c}=lc.useInView({threshold:.7,delay:100,triggerOnce:!0}),{sendDataLayerEvent:l}=ce(),u=x.useMemo(()=>e?[{key:e.type,value:e.productId}]:[],[e]);return x.useEffect(()=>{if(!e)return;function f(){var h;Tp({type:"recommendationSearch",facets:u,params:{count:((h=e==null?void 0:e.params)==null?void 0:h.count)??12,sort:r.ITEMS_DEFAULT_SORT}}).then(d=>s(d))}f()},[u,e]),x.useEffect(()=>{if(!c||o.length===0||(e==null?void 0:e.type)==="suggestions")return;const f=t??"Você também pode gostar";l({functionKey:"productListEvent",data:{event:"view_item_list",commonData:{products:o},customData:{item_list_name:f},outsideEcommerceData:{item_list_name:f}}})},[c,o]),(o==null?void 0:o.length)===0?null:(e==null?void 0:e.type)==="suggestions"?n.jsx(Uu,{products:o,innerRef:a,inView:c,CONSTANTS:r}):n.jsx("div",{ref:a,className:Op.shelf__container,children:n.jsx(Ft.Shelf,{title:t??"Você também pode gostar",itemsPerPage:{desktop:4.4,mobile:2.2},ICONS:r.ICONS,children:Array.isArray(o)&&o.map(({node:f},h)=>{const{availability:{status:d}}=f;return d?n.jsx(Ft.Card,{item:f,isMobile:i,size:"medium",index:h,shelfTitle:t??"Você também pode gostar",CONSTANTS:r},f.id):null})})})},kp=({data:e,CONSTANTS:t})=>{const{productId:r}=Wl();return e.productLists.map((o,s)=>n.jsx(Lx,{title:o.title,recommendationSearch:{type:o.product_group_option,productId:r,params:{count:o.number_of_items,sort:"score:desc"}},CONSTANTS:t},`shelf=${s}`))},Lp=({data:e,CONSTANTS:t})=>e.productLists.map((r,o)=>{const s=r.collectionId?{term:"",facets:[{key:"productclusterids",value:`${r.collectionId}`}]}:{term:r.search_base_name,facets:[]};return n.jsx(kx,{title:r.title,collectionSearch:{params:{count:r.number_of_items,sort:r.sort},...s},CONSTANTS:t},`shelf=${o}`)}),Mx="_embedLiveContainer_1ss0l_2",Dx="_embedLivePlayer_1ss0l_7",cc={embedLiveContainer:Mx,embedLivePlayer:Dx},Mp=({data:e})=>n.jsx("div",{className:cc.embedLiveContainer,children:n.jsx("div",{className:cc.embedLivePlayer,children:e.banner.videosrc?n.jsx(Be.Video,{src:e.banner.videosrc??"",playsInline:!0,autoPlay:!0,loop:!0,muted:!0,title:"Live",controls:!0}):n.jsxs("div",{children:[n.jsx("iframe",{src:e.banner.embed_source??"",allow:"autoplay; fullscreen; picture-in-picture; loop;",title:"Live"}),n.jsx(gp,{src:"https://player.vimeo.com/api/player.js",defer:!0,strategy:"lazyOnload"})]})})}),$x={"Image Grid":Ip,"Embed Live":Mp,"Banner Carousel":Sp,Banner:Hs,"Bennefits Bar":Pp,newsletter:Np,TextContent:wp,TextAccordion:Ep,"Product Carousel":Lp,"PDP Product Carousel":kp},zx=({data:e,identifyWhoIsFirst:t=!1,componentConfigs:r})=>e==null?void 0:e.map((o,s)=>{const i=$x[o.name],a=r[o.name];return t&&s===0&&(o.data.first=!0),o.data.componentIndex=s,o.name==="TextAccordion"&&(a.id=`text-accordion-${s}`),i?n.jsx(i,{data:o.data,...a},`section-zone-component-${s}`):null}),Bx={Banner:vx,BannerSection:Jt,BennefitsBarSection:Pp,SingleBannerSection:Hs,TextContentSection:wp,BannerCarousel:Sp,TextAccordionSection:Ep,TipbarScreening:Nx,ImageGrid:Ip,SearchPageScreening:W.SearchPageScreening,SearchContent:Tx,NewsletterSection:Np,PDPProductCarousel:kp,ProductCarousel:Lp,EmbedLive:Mp,SectionZone:zx},Fx={Components:Bx,helpers:wv};exports.cms=Fx;exports.contexts=Yl;exports.data=Ss;exports.layout=jr;exports.scripts=gx;
|
|
82
|
+
`},hx=Object.freeze(Object.defineProperty({__proto__:null,generateMiddleware:mx},Symbol.toStringTag,{value:"Module"})),gx={helpers:hx},ts={"custom-carousel":"_custom-carousel_t5fgp_1","carrousel-arrows-display-controller":"_carrousel-arrows-display-controller_t5fgp_10","carousel-controllers-modifier":"_carousel-controllers-modifier_t5fgp_19"};function yx(e,t){const{mediatorRef:r}=le();x.useEffect(()=>r.current.subscribe(e,t),[e,t])}const oc=({prevOnClick:e,nextOnClick:t,onBulletClick:r,currentPage:o,totalPages:s,position:i,hideControllers:a,left:c,isFirst:l,ICONS:u})=>{const[f,h]=x.useState("default");return yx("herobanner:change_controllers_variant",d=>{l&&h(d.includes("white")?"inverse":"default")}),n.jsxs(m.Carousel.Controller,{className:ts["carousel-controllers-modifier"],position:i??"absolute","data-hide-controllers":a,bottom:"16px",top:"unset",left:c,children:[n.jsxs(m.Carousel.Arrows,{className:ts["carrousel-arrows-display-controller"],children:[n.jsx(m.Button,{variant:"tertiary",onClick:e,adornment:{start:n.jsx(m.Icon,{name:u.arrow_left})},mode:f}),n.jsx(m.Button,{variant:"tertiary",onClick:t,adornment:{start:n.jsx(m.Icon,{name:u.arrow_right})},mode:f})]}),n.jsx(m.Carousel.Bullets,{page:o,total:s,onBulletClick:r,mode:f})]})},_x=({children:e,data:t,banner:r,...o})=>{const{mediatorRef:s}=le();return t.data.first?n.jsx(Dr,{observerOptions:{threshold:.51},stopOnIntersection:!1,callBackWhenVisible:()=>{s.current.publish("header:change_variant",r.headerVariant)},...o,children:e}):n.jsx(n.Fragment,{children:e})},Sp=e=>{const{initialize:t,pagination:r,controller:o,itemsStyles:s}=m.Carousel.useCarousel({gap:e.data.config.gap,itemsPerPage:e.data.config.slidesPerView,direction:"row"}),i=x.useRef(void 0),a=x.useMemo(()=>Yf(e.data.config.controllerPosition??"dentro-inferior-centro"),[e]),c=x.useCallback(()=>{e.data.config.slideDuration&&r.totalPages>1&&(i.current=setInterval(()=>{o==null||o.nextPage()},e.data.config.slideDuration*1e3))},[o,e.data.config.slideDuration,r.totalPages]),l=x.useCallback(f=>{clearInterval(i.current),c(),f()},[c]),u=x.useMemo(()=>{var f;return{nextOnClick:()=>l(()=>o==null?void 0:o.nextPage()),prevOnClick:()=>l(()=>o==null?void 0:o.prevPage()),onBulletClick:h=>l(()=>o==null?void 0:o.navigateTo(h)),currentPage:r.currentPage,totalPages:r.totalPages,position:a.position,hideControllers:((f=e.data.config)==null?void 0:f.hideControllers)??!1,left:a.left}},[r.currentPage,r.totalPages,a.position,e.data.config.hideControllers,l,o]);return x.useEffect(()=>(c(),()=>clearInterval(i.current)),[c]),n.jsxs(m.Carousel.Root,{innerRef:f=>{t(f)},className:m.helpers.classNameConcat(ts["custom-carousel"],e.data.config.fullWidth?"":"common-section"),"data-infinity-border":!0,style:{...e.data.config.marginTop!=="0px"&&{marginTop:`-${e.data.config.marginTop}`},...e.data.config.marginBottom!=="0px"&&{marginBottom:`-${e.data.config.marginBottom}`}},children:[a.shouldRender==="top"&&r.totalPages>1?n.jsx(oc,{ICONS:e.ICONS,...u,isFirst:e.data.first}):n.jsx(n.Fragment,{}),n.jsx(m.Carousel.Body,{children:e==null?void 0:e.data.banners.map((f,h)=>n.jsx(m.Carousel.Item,{style:s,children:n.jsx(_x,{data:e,banner:f,children:n.jsx(Jt,{ICONS:e.ICONS,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,data:{banner:f,index:h,componentIndex:e.data.componentIndex},creative:"banner-carousel",...e.data.first&&h===0&&{priority:!0}})})},`hero-banner-item-${h}`))}),a.shouldRender==="bottom"&&r.totalPages>1?n.jsx(oc,{ICONS:e.ICONS,...u}):n.jsx(n.Fragment,{})]})},vx={Banner:Hs},Lt={"row-controller-modifier":"_row-controller-modifier_co4wb_1","carousel-title-modifier":"_carousel-title-modifier_co4wb_18","carousel-modifier":"_carousel-modifier_co4wb_22","card-modifier":"_card-modifier_co4wb_26"},Pp=({data:e,CONSTANTS:t})=>{var u;const{isMobile:r}=le(),o=e.config.size??"medium",s=e.config.disableCarouselMobile??!1,{initialize:i,pagination:a,controller:c,itemsStyles:l}=m.Carousel.useCarousel({itemsPerPage:r?e==null?void 0:e.config.slidesPerViewMobile:(u=e==null?void 0:e.config)==null?void 0:u.slidesPerView,gap:r?e.config.gapMobile:e.config.gap,direction:r&&s?"column":"row"});return n.jsx(m.Utils.Column,{style:{width:o==="small"?"70%":"100%"},alignContent:"center",justifyContent:"center",alignItems:"center",children:n.jsxs(m.Carousel.Root,{innerRef:f=>{i(f)},className:m.helpers.classNameConcat(Lt["carousel-modifier"],"common-section"),children:[o==="medium"?n.jsxs(m.TextStructure.Root,{children:[n.jsx(m.TextStructure.DivWrapper,{className:Lt["carousel-title-modifier"],children:n.jsx("h2",{className:"typography-style-body-lg",children:t.BENNEFITS_BAR_TITLE})}),r&&a.totalPages>1?n.jsx(m.Carousel.Controller,{className:Lt["row-controller-modifier"],children:n.jsxs(m.Carousel.Arrows,{children:[n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.prevPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_left})}}),n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.nextPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_right})}})]})}):n.jsx(n.Fragment,{})]}):n.jsx(n.Fragment,{}),n.jsx(m.Carousel.Body,{children:e.bennefit.map((f,h)=>n.jsx(m.Carousel.Item,{className:Lt["card-modifier"],style:l,children:n.jsx(m.Card,{stroke:!0,padding:"small",children:n.jsx(m.TextStructure.Root,{layoutProps:{columnWrapper:{alignContent:"start",alignItems:"start",justifyContent:"start"},textRow:{alignContent:"center",alignItems:"center",justifyContent:"center"}},adornment:{[o==="medium"?"top":"start"]:n.jsx(m.Icon,{name:f.icon,size:o==="medium"?"medium":"small"})},children:n.jsxs(m.TextStructure.DivWrapper,{alignItems:"start",children:[n.jsx("h3",{className:"typography-style-body-md",children:f.title}),f.subtitle&&f.subtitle.length?n.jsx("p",{className:"typography-style-body-xs",children:f.subtitle}):n.jsx(n.Fragment,{})]})})})},`bennefit=${h}`))}),!r&&a.totalPages>1?n.jsxs(m.Carousel.Controller,{className:Lt["row-controller-modifier"],children:[n.jsxs(m.Carousel.Arrows,{children:[n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.prevPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_left})}}),n.jsx(m.Button,{variant:"tertiary",onClick:()=>c==null?void 0:c.nextPage(),adornment:{start:n.jsx(m.Icon,{name:t.ICONS.arrow_right})}})]}),n.jsx(m.Carousel.Bullets,{page:a.currentPage,total:a.totalPages,onBulletClick:f=>c==null?void 0:c.navigateTo(f)})]}):n.jsx(n.Fragment,{})]})})},wp=({data:e,ICONS:t})=>n.jsx("div",{className:m.helpers.classNameConcat(Xo.textContentSection),style:e.borderTop?{borderTop:"none"}:void 0,children:n.jsx(Qf,{data:e,ICONS:t})}),sc={"accordion-modifier":"_accordion-modifier_1we16_1","accordion-body-modifier":"_accordion-body-modifier_1we16_7"},Ep=({data:e,id:t,ICONS:r})=>{var i;const[o,s]=x.useState([]);return n.jsxs(m.Utils.Column,{gap:"var(--gap-vertical-sm)",children:[e.titleAccordion?n.jsx(m.TextStructure.Root,{children:n.jsx(m.TextStructure.DivWrapper,{children:n.jsx("h2",{className:m.helpers.classNameConcat("typography-style-heading-sm","common-section"),style:{fontWeight:500},children:e.titleAccordion})})}):n.jsx(n.Fragment,{}),(i=e.accordions)==null?void 0:i.map((a,c)=>n.jsxs(m.Accordion.Wrapper,{className:sc["accordion-modifier"],children:[n.jsx(m.Accordion.Header,{id:`${t}-text-accordion-${c}`,openIndicator:n.jsx(m.Icon,{name:r.arrow_down}),closeIndicator:n.jsx(m.Icon,{name:r.arrow_up}),startOpen:o.includes(c),onClick:()=>s(l=>l.includes(c)?l.filter(u=>u!==c):[...l,c]),children:n.jsx(m.TextStructure.Root,{children:n.jsxs(m.TextStructure.DivWrapper,{className:Ko["draftjs-text-modifier"],children:[n.jsx("h3",{className:"typography-style-body-md-strong",children:a.title}),a.subtitle&&a.subtitle.length?n.jsx("h2",{children:a.subtitle}):n.jsx(n.Fragment,{})]})})}),n.jsx(m.Accordion.Body,{children:n.jsx(m.TextStructure.Root,{children:n.jsx(m.TextStructure.DivWrapper,{className:m.helpers.classNameConcat(sc["accordion-body-modifier"],Ko["draftjs-text-modifier"]),children:n.jsx(Ke.Editor,{editorKey:`${t}-editor-${c}`,blockRenderMap:wr,editorState:a.text?Pr(JSON.parse(a.text)):Ke.EditorState.createEmpty(),onChange:()=>null})})})})]},`${t}-accordion-${c}-${o.includes(c)}`))]})},Rp=x.createContext({}),xx=({data:e,children:t,...r})=>{var g,y,_,b,C,v,j,P,E,S,R,T,w;const[o,s]=x.useState(!0),{initialize:i,controller:a,itemsStyles:c}=m.Carousel.useCarousel({gap:0,itemsPerPage:1}),l={slideTranstionTimer:(y=(g=e==null?void 0:e.staticConfig)==null?void 0:g.staticConfig)==null?void 0:y.slideTranstionTimer,showCarouselArrows:(b=(_=e==null?void 0:e.staticConfig)==null?void 0:_.staticConfig)==null?void 0:b.showCarouselArrows,hasCloseBtn:(v=(C=e==null?void 0:e.staticConfig)==null?void 0:C.staticConfig)==null?void 0:v.hasCloseBtn,backgroundColor:(P=(j=e==null?void 0:e.staticConfig)==null?void 0:j.staticConfig)==null?void 0:P.backgroundColor,textColorVariant:(S=(E=e==null?void 0:e.staticConfig)==null?void 0:E.staticConfig)==null?void 0:S.textColorVariant,content:((T=(R=e==null?void 0:e.content)==null?void 0:R.content)==null?void 0:T.items)??[]},u=(w=l.content)==null?void 0:w.filter(I=>!I.countDownEndDate||new Date(I.countDownEndDate)>new Date),f=u.length>1,h={...l.backgroundColor?{backgroundColor:l.backgroundColor}:{}},d=()=>{s(!1)},p=m.helpers.ValidateProp({fieldTypes:St.Mode,property:l.textColorVariant,fallback:"default"});return n.jsx(Rp.Provider,{value:{isOpen:o,setIsOpen:s,hasCarousel:f,backgroundStyle:h,handleCloseTipbar:d,mode:p,slideTranstionTimer:l.slideTranstionTimer,showCarouselArrows:l.showCarouselArrows,hasCloseBtn:l.hasCloseBtn,slices:u,carouselProps:{initialize:i,controller:a,itemsStyles:c},...r},children:t})},ot=()=>x.useContext(Rp),bx=({dateEnd:e,...t})=>{const{CONSTANTS:{TIME_ZONE:r}}=ot();return n.jsx(Yo,{dateEnd:new Date(e),TIME_ZONE:r,...t})},jx="_tipbar_bt3p0_1",Cx="_tipbar__carousel_bt3p0_15",er={tipbar:jx,tipbar__carousel:Cx,"tipbar__close-btn":"_tipbar__close-btn_bt3p0_29","tipbar-item":"_tipbar-item_bt3p0_37","tipbar-item__coupon":"_tipbar-item__coupon_bt3p0_45"},Sx=({coupon:e,feedbackTitle:t,feedbackDescription:r,...o})=>{const{CONSTANTS:s}=ot(),{addCouponSeller:i,cartStore:a}=Ee(),[c,l]=x.useState({status:!1,showSnackBar:!1}),[u,f]=x.useState(!1),[h,d]=x.useState(!1),p=async()=>{if(!a.items.length){d(!0);return}(await i(e,"coupon")).code===200?l({status:!0,showSnackBar:!0}):f(!0)};return x.useEffect(()=>{c.showSnackBar&&setTimeout(()=>{l(g=>({...g,showSnackBar:!1}))},s.TIPBAR_CONFIGS.snackbar_timeout)},[c.showSnackBar]),x.useEffect(()=>{u&&setTimeout(()=>{f(!1)},s.TIPBAR_CONFIGS.snackbar_timeout)},[u]),x.useEffect(()=>{h&&setTimeout(()=>{d(!1)},s.TIPBAR_CONFIGS.snackbar_timeout)},[h]),n.jsxs(n.Fragment,{children:[n.jsx(m.Button,{...o,onClick:p,disabled:c.status,className:er["tipbar-item__coupon"],children:c.status?`${s.TIPBAR_CONFIGS.coupon_applied_message}`:`${s.TIPBAR_CONFIGS.coupon_default_message}`}),c.showSnackBar&&(t||r)&&n.jsx(Pt,{title:t,subtitle:r,Z_INDEX_WAR:s.Z_INDEX_WAR},`feedback-coupon-${e}`),u&&n.jsx(Pt,{title:s.TIPBAR_CONFIGS.coupon_error_title,subtitle:s.TIPBAR_CONFIGS.coupon_error_message,Z_INDEX_WAR:s.Z_INDEX_WAR},`error-coupon-${e}`),h&&n.jsx(Pt,{title:s.TIPBAR_CONFIGS.coupon_cart_empty_title,subtitle:s.TIPBAR_CONFIGS.coupon_cart_empty_message,Z_INDEX_WAR:s.Z_INDEX_WAR},`error-cart-empty-${e}`)]})},Px=({title:e,description:t,style:r,mode:o,className:s})=>n.jsx(m.TextStructure.Root,{children:n.jsxs(m.TextStructure.DivWrapper,{mode:o,className:s,children:[e&&n.jsx("h3",{className:"typography-style-body-sm",style:r,children:e}),t&&n.jsx("p",{className:"typography-style-caption",style:r,children:t})]})}),wx=({coupon:e,...t})=>{const{CONSTANTS:r}=ot();return n.jsx(m.Copy,{...t,iconCopy:r.ICONS.copy,iconSuccess:r.ICONS.check,children:e})},Ex=({staticZone:e,type:t,className:r,description:o,title:s})=>{const{mode:i}=ot();if(t==="countdown")return n.jsx(bx,{dateEnd:e.countDownEndDate,size:"x-small",mode:i});if(t==="coupon"){const a=m.helpers.ValidateProp({fieldTypes:St.Mode,property:e.couponButtonMode,fallback:"default"}),c=m.helpers.ValidateProp({fieldTypes:St.VariantsExtended,property:e.couponButtonVariant,fallback:"primary"});return e.coupon?n.jsx(Sx,{coupon:e.coupon,mode:a,variant:c,feedbackTitle:e.couponFeedbackTitle,feedbackDescription:e.couponFeedbackDescription}):null}if(t==="copy"){const a=m.helpers.ValidateProp({fieldTypes:St.Mode,property:e.couponButtonMode,fallback:"default"});return e.coupon?n.jsx(wx,{coupon:e.coupon,mode:a}):null}return n.jsx(Px,{title:s,description:o,mode:i,className:r})},ic=({handleCloseTipbar:e,mode:t})=>{const{CONSTANTS:r}=ot();return n.jsx(m.Button,{title:"fechar tipbar",className:er["tipbar__close-btn"],onClick:e,variant:"tertiary",mode:t,adornment:{start:n.jsx(m.Icon,{name:r.ICONS.close})}})},Rx=({children:e,mode:t="default",showCarouselArrows:r=!0,slideTranstionTimer:o})=>{const{carouselProps:s,CONSTANTS:i}=ot(),a=x.useRef(null),c=(u,f)=>{var h,d;u.stopPropagation(),u.preventDefault(),f==="prev"?(h=s.controller)==null||h.prevPage():(d=s.controller)==null||d.nextPage(),a.current&&(clearInterval(a.current),l())},l=x.useCallback(()=>{if(o&&s.controller){const u=setInterval(()=>{var f;(f=s.controller)==null||f.nextPage()},o);a.current=u}},[o,s]);return x.useEffect(()=>(l(),()=>{a.current&&clearInterval(a.current)}),[o,l]),n.jsxs(m.Carousel.Root,{innerRef:u=>{s.initialize(u)},className:er.tipbar__carousel,style:{flexDirection:"row",alignItems:"center"},children:[r&&n.jsx(m.Button,{variant:"tertiary",mode:t,onClick:u=>c(u,"prev"),adornment:{start:n.jsx(m.Icon,{name:i.ICONS.arrow_left})}}),n.jsx(m.Carousel.Body,{children:e}),r&&n.jsx(m.Button,{variant:"tertiary",mode:t,onClick:u=>c(u,"next"),adornment:{start:n.jsx(m.Icon,{name:i.ICONS.arrow_right})}})]})},Ax=({children:e,className:t})=>{const{hasCarousel:r,mode:o,hasCloseBtn:s,backgroundStyle:i,showCarouselArrows:a,slideTranstionTimer:c,handleCloseTipbar:l}=ot(),u=r&&a;return n.jsx("div",{style:i,"data-hasclosebtn":s,className:m.helpers.classNameConcat(er.tipbar,t),children:r?n.jsxs(n.Fragment,{children:[n.jsx(Rx,{mode:o,showCarouselArrows:u,slideTranstionTimer:c,children:e}),s&&n.jsx(ic,{handleCloseTipbar:l,showCarouselArrows:u,mode:o})]}):n.jsxs(n.Fragment,{children:[e,s&&n.jsx(ic,{handleCloseTipbar:l,mode:o})]})})},Ix=({children:e,highlightFirstSection:t,...r})=>{const{hasCarousel:o,carouselProps:s}=ot(),i=n.jsx("div",{...r,className:er["tipbar-item"],children:e});return o?n.jsx(m.Carousel.Item,{style:s.itemsStyles,children:i}):i},Ap=({className:e})=>{const{isOpen:t,slices:r}=ot();return r.length&&t?n.jsx(Ax,{children:r.map((o,s)=>{var i;return n.jsx(n.Fragment,{children:n.jsx(Kt,{href:o.link,children:n.jsx(Ix,{highlightFirstSection:o.highlightFirstSection,"data-justifyhighlightedsection":o.horizontalAlignHighlightedSection?o.horizontalAlignHighlightedSection:"center",children:o&&((i=o==null?void 0:o.items)!=null&&i.length)?o.items.map((a,c)=>n.jsx(Ex,{staticZone:o,type:a.type,title:a.title,description:a.description,className:e},`tipbar-slice-field-${c}`)):null})})},`tipbar-slice-${s}`)})}):null};Ap.displayName="TipBar.Root";const rs=({className:e,...t})=>n.jsx(xx,{...t,children:n.jsx(Ap,{className:e})});rs.displayName="TipBar";const Nx=({CONSTANTS:e,data:t})=>{const{pathname:r}=xe(),{tipbarRef:o}=je(),s=c=>{const l=t==null?void 0:t.find(u=>{var f,h,d,p,g;return((h=(f=u.staticConfig)==null?void 0:f.staticConfig)==null?void 0:h.deviceType)===c&&((g=(p=(d=u.staticConfig)==null?void 0:d.staticConfig)==null?void 0:p.paths)==null?void 0:g.includes(r))});return l||(t==null?void 0:t.find(u=>{var f,h,d,p,g,y;return((h=(f=u.staticConfig)==null?void 0:f.staticConfig)==null?void 0:h.deviceType)===c&&(!((p=(d=u.staticConfig)==null?void 0:d.staticConfig)!=null&&p.paths)||((y=(g=u.staticConfig)==null?void 0:g.staticConfig)==null?void 0:y.paths.length)===0)}))},i=s("desktop"),a=s("mobile");return n.jsxs("div",{ref:o,className:W.responsive["responsive-flex"],children:[a&&n.jsx("div",{className:W.responsive["responsive-mobile-flex"],children:n.jsx(rs,{data:a,CONSTANTS:e})}),i&&n.jsx("div",{className:W.responsive["responsive-desktop-flex"],children:n.jsx(rs,{data:i,CONSTANTS:e})})]})},ac={"card-image-wrapper":"_card-image-wrapper_10mul_1","card-image-container":"_card-image-container_10mul_9"},Ip=e=>{const{nextimage:t}=xe();return n.jsx(n.Fragment,{children:e.data.banners.map((r,o)=>n.jsx("div",{className:ac["card-image-wrapper"],children:n.jsx("div",{className:ac["card-image-container"],children:n.jsx(t,{src:r.image,alt:r.altImage?r.altImage:"Banner Coleção",width:500,height:600})})},o))})},Tx=({SectionZone:e,CMS_PROJECT_NAME:t,storeId:r,previewId:o})=>{const[s,i]=x.useState();return x.useEffect(()=>{s||W.getContentType({contentType:"search",CMS_PROJECT_NAME:t,storeId:r,previewId:o}).then(a=>{i(a.data[0])})},[]),n.jsx(e,{data:s??[]})},Np=({data:{componentIndex:e,...t},CONSTANTS:r})=>n.jsx(Vs,{...t,CONSTANTS:r}),Tp=async e=>{const{type:t}=e,r=t==="collectionSearch"?"/api/search/product":"/api/search/crosseling",o=JSON.stringify(t==="collectionSearch"?{...e.params,facets:e.facets,term:e.term,forceUpdate:!1}:e.facets);return(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:o}).then(i=>i.json()).then(i=>t==="collectionSearch"?i.data.products:i.products)).filter(i=>!!i.node.availability.status)},Ox="_shelf__container_bi04n_10",Op={shelf__container:Ox},kx=({collectionSearch:e,title:t,CONSTANTS:r})=>{const[o,s]=x.useState([]),{isMobile:i}=le(),{ref:a,inView:c}=lc.useInView({threshold:.7,delay:100,triggerOnce:!0}),{sendDataLayerEvent:l}=ce();return x.useEffect(()=>{if(!e)return;function u(){var f,h;Tp({type:"collectionSearch",term:e==null?void 0:e.term,facets:e==null?void 0:e.facets,params:{count:((f=e==null?void 0:e.params)==null?void 0:f.count)??12,sort:((h=e==null?void 0:e.params)==null?void 0:h.sort)??r.ITEMS_DEFAULT_SORT}}).then(d=>{s(d)})}u()},[e]),x.useEffect(()=>{!c||o.length===0||l({functionKey:"productListEvent",data:{event:"view_item_list",commonData:{products:o},customData:{item_list_name:t??"Você também pode gostar"}}})},[c,o]),o.length===0?null:n.jsx("div",{ref:a,className:Op.shelf__container,children:n.jsx(Ft.Shelf,{title:t??"Você também pode gostar",itemsPerPage:{desktop:4.4,mobile:2.2},ICONS:r.ICONS,children:Array.isArray(o)&&o.map(({node:u},f)=>{const{availability:{status:h}}=u;return h?n.jsx(Ft.Card,{item:u,isMobile:i,size:"medium",index:f,shelfTitle:t??"Você também pode gostar",CONSTANTS:r},u.id):null})})})},Lx=({recommendationSearch:e,title:t,CONSTANTS:r})=>{const[o,s]=x.useState([]),{isMobile:i}=le(),{ref:a,inView:c}=lc.useInView({threshold:.7,delay:100,triggerOnce:!0}),{sendDataLayerEvent:l}=ce(),u=x.useMemo(()=>e?[{key:e.type,value:e.productId}]:[],[e]);return x.useEffect(()=>{if(!e)return;function f(){var h;Tp({type:"recommendationSearch",facets:u,params:{count:((h=e==null?void 0:e.params)==null?void 0:h.count)??12,sort:r.ITEMS_DEFAULT_SORT}}).then(d=>s(d))}f()},[u,e]),x.useEffect(()=>{if(!c||o.length===0||(e==null?void 0:e.type)==="suggestions")return;const f=t??"Você também pode gostar";l({functionKey:"productListEvent",data:{event:"view_item_list",commonData:{products:o},customData:{item_list_name:f},outsideEcommerceData:{item_list_name:f}}})},[c,o]),(o==null?void 0:o.length)===0?null:(e==null?void 0:e.type)==="suggestions"?n.jsx(Uu,{products:o,innerRef:a,inView:c,CONSTANTS:r}):n.jsx("div",{ref:a,className:Op.shelf__container,children:n.jsx(Ft.Shelf,{title:t??"Você também pode gostar",itemsPerPage:{desktop:4.4,mobile:2.2},ICONS:r.ICONS,children:Array.isArray(o)&&o.map(({node:f},h)=>{const{availability:{status:d}}=f;return d?n.jsx(Ft.Card,{item:f,isMobile:i,size:"medium",index:h,shelfTitle:t??"Você também pode gostar",CONSTANTS:r},f.id):null})})})},kp=({data:e,CONSTANTS:t})=>{const{productId:r}=Wl();return e.productLists.map((o,s)=>n.jsx(Lx,{title:o.title,recommendationSearch:{type:o.product_group_option,productId:r,params:{count:o.number_of_items,sort:"score:desc"}},CONSTANTS:t},`shelf=${s}`))},Lp=({data:e,CONSTANTS:t})=>e.productLists.map((r,o)=>{const s=r.collectionId?{term:"",facets:[{key:"productclusterids",value:`${r.collectionId}`}]}:{term:r.search_base_name,facets:[]};return n.jsx(kx,{title:r.title,collectionSearch:{params:{count:r.number_of_items,sort:r.sort},...s},CONSTANTS:t},`shelf=${o}`)}),Mx="_embedLiveContainer_1ss0l_2",Dx="_embedLivePlayer_1ss0l_7",cc={embedLiveContainer:Mx,embedLivePlayer:Dx},Mp=({data:e})=>n.jsx("div",{className:cc.embedLiveContainer,children:n.jsx("div",{className:cc.embedLivePlayer,children:e.banner.videosrc?n.jsx(Be.Video,{src:e.banner.videosrc??"",playsInline:!0,autoPlay:!0,loop:!0,muted:!0,title:"Live",controls:!0}):n.jsxs("div",{children:[n.jsx("iframe",{src:e.banner.embed_source??"",allow:"autoplay; fullscreen; picture-in-picture; loop;",title:"Live"}),n.jsx(gp,{src:"https://player.vimeo.com/api/player.js",defer:!0,strategy:"lazyOnload"})]})})}),$x={"Image Grid":Ip,"Embed Live":Mp,"Banner Carousel":Sp,Banner:Hs,"Bennefits Bar":Pp,newsletter:Np,TextContent:wp,TextAccordion:Ep,"Product Carousel":Lp,"PDP Product Carousel":kp},zx=({data:e,identifyWhoIsFirst:t=!1,componentConfigs:r})=>e==null?void 0:e.map((o,s)=>{const i=$x[o.name],a=(r==null?void 0:r[o.name])??{};return t&&s===0&&(o.data.first=!0),o.data.componentIndex=s,o.name==="TextAccordion"&&(a.id=`text-accordion-${s}`),i?n.jsx(i,{data:o.data,...a},`section-zone-component-${s}`):null}),Bx={Banner:vx,BannerSection:Jt,BennefitsBarSection:Pp,SingleBannerSection:Hs,TextContentSection:wp,BannerCarousel:Sp,TextAccordionSection:Ep,TipbarScreening:Nx,ImageGrid:Ip,SearchPageScreening:W.SearchPageScreening,SearchContent:Tx,NewsletterSection:Np,PDPProductCarousel:kp,ProductCarousel:Lp,EmbedLive:Mp,SectionZone:zx},Fx={Components:Bx,helpers:wv};exports.cms=Fx;exports.contexts=Yl;exports.data=Ss;exports.layout=jr;exports.scripts=gx;
|
package/index.mjs
CHANGED
|
@@ -20026,7 +20026,7 @@ const KC = ({ CONSTANTS: e, data: t }) => {
|
|
|
20026
20026
|
identifyWhoIsFirst: t = !1,
|
|
20027
20027
|
componentConfigs: r
|
|
20028
20028
|
}) => e == null ? void 0 : e.map((n, o) => {
|
|
20029
|
-
const a = tP[n.name], s = r[n.name];
|
|
20029
|
+
const a = tP[n.name], s = (r == null ? void 0 : r[n.name]) ?? {};
|
|
20030
20030
|
return t && o === 0 && (n.data.first = !0), n.data.componentIndex = o, n.name === "TextAccordion" && (s.id = `text-accordion-${o}`), a ? /* @__PURE__ */ i(
|
|
20031
20031
|
a,
|
|
20032
20032
|
{
|
package/package.json
CHANGED