@soma-vertical-web/multi-lib 0.0.65 → 0.0.66
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/contexts/contexts/plp/PLPConstants.d.ts +6 -0
- package/contexts/contexts/plp/PLPInfiniteContext.tsx.d.ts +1 -1
- package/contexts/contexts/search/Constants.d.ts +6 -0
- package/contexts/contexts/search/Facets.d.ts +1 -1
- package/contexts/contexts/search/Products.d.ts +1 -1
- package/contexts/contexts/search/Search.d.ts +1 -1
- package/contexts/hooks/useScrollRestoration.d.ts +1 -1
- package/contexts/index.d.ts +4 -4
- package/data/helpers/search/search.d.ts +2 -0
- package/index-BBxYNFkz.mjs +416 -0
- package/index-CiMxj6Pg.mjs +412 -0
- package/index-CwBIv223.js +1 -0
- package/index-DKnolQoT.mjs +412 -0
- package/index.js +21 -21
- package/index.mjs +8264 -7197
- package/index2.js +1 -1
- package/index2.mjs +97 -94
- package/layout/index.d.ts +54 -8
- package/layout/team-component/PLPNavigation/Composite/BreadCrumb.d.ts +1 -3
- package/layout/team-component/PLPNavigation/Composite/Content.d.ts +1 -1
- package/layout/team-component/PLPNavigation/Composite/Filters.d.ts +1 -3
- package/layout/team-component/PLPNavigation/Composite/Root.d.ts +2 -2
- package/layout/team-component/PLPNavigation/Composite/Selected/Item.d.ts +1 -1
- package/layout/team-component/PLPNavigation/Composite/Selected/Selected.d.ts +1 -1
- package/layout/team-component/PLPNavigation/Composite/Selected/interfaces.d.ts +1 -7
- package/layout/team-component/PLPNavigation/PLPNavigation.d.ts +6 -6
- package/layout/team-component/Sort/Sort.d.ts +1 -1
- package/layout/template/PDC/Composite/Empty/Empty.d.ts +1 -1
- package/layout/template/PDC/Composite/Filters/Filters.d.ts +3 -5
- package/layout/template/PDC/Composite/Grid/Banners.d.ts +1 -1
- package/layout/template/PDC/Composite/Grid/Grid.d.ts +1 -1
- package/layout/template/PDC/Composite/Grid/NavigationTotal.d.ts +2 -3
- package/layout/template/PDC/Composite/InfiniteScroller/Banners/Banners.d.ts +1 -1
- package/layout/template/PDC/Composite/InfiniteScroller/InfiniteScroller.d.ts +1 -3
- package/layout/template/PDC/Composite/InfiniteScroller/Page/Composite/Card.d.ts +1 -1
- package/layout/template/PDC/Composite/InfiniteScroller/Page/Page.d.ts +1 -1
- package/layout/template/PDC/Composite/InfiniteScroller/Page/index.d.ts +1 -1
- package/layout/template/PDC/Composite/Navigation/Navigation.d.ts +1 -3
- package/layout/template/PDC/Composite/Notification/Notification.d.ts +1 -1
- package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
- package/layout/template/PDC/Composite/Pagination/helpers.d.ts +1 -2
- package/layout/template/PDC/Composite/Products/Products.d.ts +1 -1
- package/layout/template/PDC/PDC.d.ts +1 -1
- package/layout/template/PDC/index.d.ts +8 -8
- package/layout/template/SearchResult/Composite/Empty.d.ts +7 -0
- package/layout/template/SearchResult/Composite/Grid.d.ts +7 -0
- package/layout/template/SearchResult/Composite/GridHeader.d.ts +3 -0
- package/layout/template/SearchResult/Composite/Loading.d.ts +7 -0
- package/layout/template/SearchResult/Composite/Sort.d.ts +4 -0
- package/layout/template/SearchResult/SearchContent.d.ts +4 -0
- package/layout/template/SearchResult/SearchResult.d.ts +7 -0
- package/layout/template/SearchResult/index.d.ts +1 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/cms/ContentTypes/Search/index.d.ts +2 -2
- package/types/constants.d.ts +41 -1
- package/types/contexts/contexts/plp.d.ts +38 -7
- package/types/contexts/contexts/search.d.ts +18 -16
- package/types/contexts/hooks/index.d.ts +12 -0
- package/types/layout/team-components/PLPNavigation/index.d.ts +3 -14
- package/types/layout/team-components/Sort/index.d.ts +2 -5
- package/types/layout/templates/PLP/index.d.ts +122 -3
- package/types/layout/templates/SearchResult/index.d.ts +44 -0
package/index2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),I=require("./index-DJeLEsRl.js"),N=require("@soma-vertical-web/core-components"),ne=require("yup"),se=require("sanitize-html");function oe(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const s=oe(ne),ae=({slug:t,data:e,SectionZone:n,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:a})=>{const o=e==null?void 0:e.find(p=>{var y,g,m,R;return((g=(y=p.config)==null?void 0:y.responsive)==null?void 0:g.deviceType)==="desktop"&&((R=(m=p.config)==null?void 0:m.seo)==null?void 0:R.slug)===t}),i=o==null?void 0:o.config.responsive.gapCustom,l=o==null?void 0:o.config.responsive.gapSections,c=e==null?void 0:e.find(p=>{var y,g,m,R;return((g=(y=p.config)==null?void 0:y.responsive)==null?void 0:g.deviceType)==="mobile"&&((R=(m=p.config)==null?void 0:m.seo)==null?void 0:R.slug)===t}),d=c==null?void 0:c.config.responsive.gapCustom,u=c==null?void 0:c.config.responsive.gapSections;return f.jsxs(f.Fragment,{children:[f.jsx(N.Utils.Column,{gap:i&&l?l:r,className:N.helpers.classNameConcat(I.responsive["responsive-desktop-flex"],"utils-column-modifier"),children:f.jsx(n,{data:(o==null?void 0:o.sections)??[],identifyWhoIsFirst:a})}),f.jsx(N.Utils.Column,{gap:d&&u?u:r,className:N.helpers.classNameConcat(I.responsive["responsive-mobile-flex"],"utils-column-modifier"),children:f.jsx(n,{data:(c==null?void 0:c.sections)??[],identifyWhoIsFirst:a})})]})},ie=async({slug:t,SectionZone:e,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:r=!1,...a})=>{const{data:o}=await I.getContentType({contentType:"common_page",...a});return f.jsx(ae,{data:o,slug:t,SectionZone:e,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:r})},ce=async({PAYMENT_FLAGS_DICTIONARY:t,PAYMENT_FLAGS:e,LEGAL_INFORMATION_TEXT:n,SectionZone:r,ICONS:a,Footer:o,FooterSupport:i,...l})=>{var p,y,g,m,R,E,S,T,O,h,C;const{data:c}=await I.getContentType({contentType:"footer",...l}),d=Array.isArray(c)&&((p=c[0])==null?void 0:p.type)==="footer"?c[0]:null,u={...(y=d==null?void 0:d.paymentInfo)==null?void 0:y.paymentInfo,acceptedFlags:Array.isArray((g=d==null?void 0:d.paymentInfo)==null?void 0:g.paymentInfo.acceptedFlags)?(m=d==null?void 0:d.paymentInfo)==null?void 0:m.paymentInfo.acceptedFlags.filter(v=>!!t[v]).map(v=>t[v]):[]};return d?f.jsx(o,{data:{...d},socialInfo:(R=d.socialMedia)==null?void 0:R.socialMedia,socialMedias:(S=(E=d.socialMedia)==null?void 0:E.socialMedia)==null?void 0:S.medias,payments:u,adornment:{...(O=(T=d.supportInfo)==null?void 0:T.supportInfo)!=null&&O.content?{bottom:f.jsx(i,{content:(C=(h=d.supportInfo)==null?void 0:h.supportInfo)==null?void 0:C.content,CONSTANTS:{ICONS:a,PAYMENT_FLAGS:e,PAYMENT_FLAGS_DICTIONARY:t}})}:{},...d.sections.length?{top:f.jsx(r,{data:d.sections})}:{}},LEGAL_INFORMATION_TEXT:n,ICONS:a}):f.jsx(f.Fragment,{})},le=async({children:t,ClientHeaderProvider:e,...n})=>{var o,i,l,c;const{data:r}=await I.getContentType({contentType:"header",...n}),a=(o=r[0])==null?void 0:o.sections.map(d=>d.data);return f.jsx(e,{headerData:{...(i=r[0])==null?void 0:i.layerConfig.config,subMenus:a??[],categories:((l=r[0])==null?void 0:l.categories.categories.items)??[],navigationLinks:((c=r[0])==null?void 0:c.navigationLinks.navigationLinks.items)??[]},children:t})},ue=t=>{var i,l;const e=(l=(i=t[0])==null?void 0:i.items)==null?void 0:l.items;if((e==null?void 0:e.items.length)===0||t.length===0)return{iconLabel:"",label:"",content:[]};const n=e==null?void 0:e.iconLabel,r=e==null?void 0:e.label,a=e==null?void 0:e.helpButtonSize,o=e.items.map((c,d)=>({type:c.type,id:`${d.toString()}-${c.title.toLowerCase()}`,title:c.title,subtitle:c.subtitle,description:c.description,buttonLabel:c.buttonLabel,buttonHref:c.buttonHref,buttonMode:c.buttonMode,buttonSize:c.buttonSize,buttonIcon:c.buttonIcon}));return{iconLabel:n,label:r,helpButtonSize:a,content:o}},de=async({HelpButton:t,ICONS:e,className:n,...r})=>{const{data:a}=await I.getContentType({contentType:"helpbutton",...r});if(!a)return f.jsx(f.Fragment,{});const o=ue(a);return f.jsx(t,{data:o,...r,ICONS:e,className:n})},pe=async({children:t,productId:e,COMMON_PAGE_COLUMN_GAP:n,SectionZone:r,PDPContentProvider:a,...o})=>{const{data:i}=await I.getContentType({contentType:"product_page",...o});return f.jsx(a,{data:i[0],productId:e,COMMON_PAGE_COLUMN_GAP:n,SectionZone:r,children:t})},me={"column-modifier":"_column-modifier_1tqap_1"},ge=async({children:t,slug:e,SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:r,PLPContentProvider:a,...o})=>{const{data:i}=await I.getContentType({contentType:"categories_page",...o}),l=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)===e&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="desktop"}),c=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)===e&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="mobile"}),d=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)==="default"&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="desktop"}),u=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)==="default"&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="mobile"});return f.jsxs(f.Fragment,{children:[f.jsx(N.Utils.Column,{className:N.helpers.classNameConcat(I.responsive["responsive-desktop-flex"],me["column-modifier"]),style:{minHeight:"100vh"},children:f.jsx(a,{data:l??d,device:"desktop",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:r,children:t})}),f.jsx(N.Utils.Column,{className:I.responsive["responsive-mobile-flex"],children:f.jsx(a,{data:c??u,device:"mobile",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:r,children:t})})]})},fe=async({slug:t,...e})=>{var i,l,c;const{data:n}=await I.getContentType({contentType:"redirect_to_search",...e}),r=((c=(l=(i=n[0])==null?void 0:i.redirectToSearch)==null?void 0:l.redirectToSearch)==null?void 0:c.paths)??[];if(!!!r.length)return{slug:t,query:null,redirect:!1};const o=r.find(d=>{var u,p;return((u=d.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===t.replace(/\//g,"-").toLowerCase()||((p=d.path)==null?void 0:p.replace(/\//g,"-").toLowerCase())===`/${t}`.replace(/\//g,"-").toLowerCase()});return o?{slug:t,query:o==null?void 0:o.searchQuery,redirect:!0,collectionId:o==null?void 0:o.collectionId,filters:o==null?void 0:o.filters,sort:o==null?void 0:o.sort}:{slug:t,query:null,redirect:!1,collectionId:null,filters:null,sort:null}},he=async({slug:t,...e})=>{var i,l,c;const{data:n}=await I.getContentType({contentType:"redirect_to_search",...e}),r=((c=(l=(i=n[0])==null?void 0:i.redirectToSearch)==null?void 0:l.redirectToSearch)==null?void 0:c.paths)??[];if(!!!r.length)return null;const o=r.find(d=>{var u,p;return((u=d.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===t.replace(/\//g,"-").toLowerCase()||((p=d.path)==null?void 0:p.replace(/\//g,"-").toLowerCase())===`/${t}`.replace(/\//g,"-").toLowerCase()});return o?{slug:t,title:o.pageTitle,description:o.pageDescription}:null},ye=async({children:t,SectionZone:e,className:n,...r})=>{const{data:a}=await I.getContentType({contentType:"search_page",...r});return Array.isArray(a)&&a.length>0?f.jsx(I.SearchPageScreening,{data:a,SectionZone:e,className:n,children:t}):f.jsx(f.Fragment,{children:t})},be=async({ClientTipbarContent:t,...e})=>{const{data:n}=await I.getContentType({contentType:"tipbar",...e});return f.jsx(t,{data:n})},Ie={CommonPageContent:ie,HeaderContent:le,TipbarContent:be,FooterContent:ce,PLPContent:ge,PDPContent:pe,getRedirectData:fe,getPLPSynteticMetaData:he,SearchPageContent:ye,HelpButtonContent:de},Ce={Components:Ie},b=async(t,e={})=>{const{method:n="GET",body:r,headers:a={},priority:o="auto",cache:i="default"}=e;return fetch(t,{method:n,headers:{...a,Accept:"application/json","Content-Type":"application/json"},priority:o,cache:i,...r?{body:JSON.stringify(r)}:{}}).then(l=>l.json()).catch(l=>{console.error("[ERROR FETCH VTEX]",l)})},w=new Map;async function Re(t,e={}){var n;try{const{abort:r=!1}=e,a=new AbortController;r&&(w.has(t)&&((n=w.get(t))==null||n.abort(),w.delete(t)),w.set(t,a));const o=b(t,{...e,...r?{signal:a.signal}:{}});return r&&w.delete(t),o}catch(r){if(r.name==="AbortError"){console.log(`[REQUEST CANCELLED]: ${t}`);return}throw console.error(`[ERROR API]: ${r.message}`),r}}const ve=s.object({country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:s.string().nullable()});async function Se({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ve.validate(e);const{country:r,postalCode:a}=e;return await b(`${t}/api/checkout/pub/postal-code/${r}/${a}`,{method:"POST",body:e,...n})}const Te=s.object({orderFormId:s.string().nullable(),sellerCode:s.string().nullable(),sellerName:s.string().nullable()});async function x({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Te.validate(e);const{orderFormId:r,sellerCode:a,sellerName:o}=e,i=a?`${a.trim()} - ${o}`:null;return b(`${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,{method:"POST",body:{value:i},...n})}const Ee=s.object({orderFormId:s.string().nullable(),sellerCode:s.string().nullable(),marketingData:s.object()});async function U({apiUrl:t,body:e,extraData:n={},fetchOptions:r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ee.validate(e);const{orderFormId:a,sellerCode:o,marketingData:i}=e,l=o?{utmCampaign:o?o.toUpperCase():"",utmiCampaign:o?`${n.VENDOR_CODE}`:"semcodigo"}:{};return b(`${t}/api/checkout/pub/orderForm/${a}/attachments/marketingData`,{method:"POST",body:{...i,...l},...r})}const Oe=s.object({orderFormId:s.string().nullable(),sellerCode:s.string().nullable(),sellerName:s.string().nullable()});async function Fe({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Oe.validate(e);const r=await x({apiUrl:t,body:e,fetchOptions:n});return U({apiUrl:t,body:{...e,marketingData:r==null?void 0:r.marketingData},fetchOptions:n})}const qe=s.object({orderFormId:s.string().nullable(),coupon:s.string().nullable()});async function $e({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await qe.validate(e);const{coupon:r="",orderFormId:a}=e;return b(`${t}/api/checkout/pub/orderForm/${a}/coupons`,{method:"POST",body:{text:r},...n})}const Pe=s.object({appId:s.string().required("App ID is required"),orderFormId:s.string().nullable(),key:s.array().of(s.string())});async function je({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Pe.validate(e);const{appId:r="faststore",orderFormId:a,key:o}=e;return b(`${t}/api/checkout/pub/orderForm/${a}/customData/${r}/${o}`,{method:"PUT",...n})}const Ne=s.object().shape({name:s.string().required("Attachment name is required"),content:s.object().nullable()});var G;const we=s.object().shape({attachments:(G=s.array().of(Ne))==null?void 0:G.nullable(),id:s.string().required("ID of SKU is required"),index:s.number().integer().nullable(),quantity:s.number().integer().nullable(),seller:s.string().required("Seller is required"),price:s.number().integer()}),Ae=s.object({orderFormId:s.string().required("OrderFormId is required"),orderItems:s.array().of(we)});async function ke({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ae.validate(e);const{orderFormId:r,orderItems:a}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/items`,{method:"POST",body:{orderItems:a},...n})}const De=s.object({orderFormId:s.string().nullable()});async function _e({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await De.validate(e);const{orderFormId:r}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,{method:"POST",...n})}const He=s.object().shape({name:s.string().required("Attachment name is required"),content:s.object().nullable()});var M;const Be=s.object().shape({attachments:(M=s.array().of(He))==null?void 0:M.nullable(),id:s.string().required("ID of SKU is required"),index:s.number().integer().nullable(),quantity:s.number().integer().nullable(),seller:s.string().required("Seller is required"),price:s.number().integer()}),Le=s.object({orderFormId:s.string().nullable(),orderItems:s.array().of(Be)});async function Ge({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Le.validate(e);const{orderFormId:r,orderItems:a}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/items/update`,{method:"POST",body:{orderItems:a},...n})}const Me=s.object({orderFormId:s.string().nullable()});async function xe({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Me.validate(e);const{orderFormId:r}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/messages/clear`,{method:"POST",...n})}const Ue=s.object({id:s.string().nullable(),itemIndex:s.number().nullable(),orderFormId:s.string().nullable(),remove:s.boolean().nullable()});async function Ve({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ue.validate(e);const{itemIndex:r,orderFormId:a,id:o,remove:i}=e,l=i?`/${o}/remove`:"",c=`${t}/api/checkout/pub/orderForm/${a}/items/${r}/offerings${l}`;return b(c,{method:"POST",body:{id:o},...n})}const ze=s.object({orderFormId:s.string().nullable()});async function Qe({apiUrl:t,body:e,fetchOptions:n,extraData:r}){var i;if(!e){console.error("[ERROR FETCHING] Body is required");return}await ze.validate(e);const a=new URLSearchParams({refreshOutdatedData:"true"}),o=e.orderFormId&&((i=r.orderFormPurchaseId)==null?void 0:i.value)!==e.orderFormId?`${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(a)}`:`${t}/api/checkout/pub/orderForm`;return b(o,{method:"GET",...n})}const Ke=s.object({orderFormId:s.string().nullable(),email:s.string().email().required(),firstName:s.string().required(),lastName:s.string().required(),documentType:s.string().required(),document:s.string().required(),phone:s.string().matches(/^\+\d{1,3}\d{10,11}$/)});async function Je({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ke.validate(e);const{orderFormId:r,...a}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,{method:"POST",body:{...a},...n})}const Ye=s.object({sellerCode:s.string().nullable()});async function We({apiUrl:t,body:e,extraData:n,fetchOptions:r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ye.validate(e);const{sellerCode:a=""}=e;return b(`${t}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${a}`,{method:"GET",headers:{Accept:"application/vnd.vtex.ds.v10+json"},...r})}const Xe=s.object().shape({country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),orderFormId:s.string().nullable(),postalCode:s.string().nullable()});async function Ze({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Xe.validate(e);const{country:r,orderFormId:a,postalCode:o}=e,i=o?{address:{addressType:"residential",postalCode:o,country:r}}:{logisticsInfo:[],clearAddressIfPostalCodeNotFound:!0};return b(`${t}/api/checkout/pub/orderForm/${a}/attachments/shippingData`,{method:"POST",body:i,...n})}const et=s.object().shape({orderFormId:s.string().nullable(),options:s.array().of(s.object().shape({itemIndex:s.number(),selectedDeliveryChannel:s.string(),selectedSla:s.string()})),selectedAddresses:s.array().of(s.object().shape({addressId:s.string().required(),addressType:s.string().required(),city:s.string().nullable(),complement:s.string().nullable(),country:s.string().required().length(3),geoCoordinates:s.array().of(s.number()).required().min(0),isDisposable:s.boolean().required(),neighborhood:s.string().nullable(),number:s.string().nullable(),postalCode:s.string().required(),receiverName:s.string().nullable(),reference:s.string().nullable(),state:s.string().nullable(),street:s.string().nullable()}))});async function tt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await et.validate(e);const{orderFormId:r,options:a,selectedAddresses:o}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,{method:"POST",body:{selectedAddresses:o,clearAddressIfPostalCodeNotFound:!1,logisticsInfo:a},...n})}const rt=s.object({country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:s.string().nullable(),geoCoordinates:s.object().shape({longitude:s.number().required(),latitude:s.number().required()})});async function nt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await rt.validate(e);const{country:r="",geoCoordinates:a,postalCode:o=""}=e,i=new URLSearchParams({country:String(r)});return o?i.append("postalCode",o):i.append("geoCoordinates",`${a==null?void 0:a.longitude};${a==null?void 0:a.latitude}`),await b(`${t}/api/checkout/pub/regions/?${i.toString()}`,{method:"GET",...n})}const st=s.object({id:s.string().required("ID of SKU is required"),quantity:s.number().integer().required("Quantity of item is required"),seller:s.string()}),ot=s.object({items:s.array().of(st),country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:s.string().nullable(),geoCoordinates:s.array().nullable().of(s.number()).length(2)});async function at({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}return await ot.validate(e),b(`${t}/api/checkout/pub/orderForms/simulation`,{method:"POST",body:e,...n})}const it=Object.freeze(Object.defineProperty({__proto__:null,getMasterDataSellerCode:We,getOrderForm:Qe,postOrderFormAddCoupon:$e,postOrderFormAttachClientProfileData:Je,postOrderFormAttachOrderFormData:Fe,postOrderFormAttachShippingData:Ze,postOrderFormAttachmentsMarketingData:U,postOrderFormAttachmentsOpenTextField:x,postOrderFormClearMessages:xe,postOrderFormFreightSimulation:at,postOrderFormItems:ke,postOrderFormRegion:nt,postOrderFormRemoveAllItems:_e,postOrderFormUpdateItems:Ge,postOrderFormUpdateShippingData:tt,postOrderformAddress:Se,putOrderFormCustomData:je,updateOrderFormOffering:Ve},Symbol.toStringTag,{value:"Module"})),ct=s.object({skuId:s.string()});async function lt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ct.validate(e);const{skuId:r}=e;return b(`${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,{...n})}const ut=s.object({ids:s.array().of(s.string().required("ID are required")).required("IDs are required")});async function dt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ut.validate(e);const{ids:r}=e;return b(`${t}/api/catalog_system/pub/products/search?fq=${r.map(a=>`productId:${a}`).join("&fq=")}`,{...n})}const pt=s.object({productId:s.number().required("Product ID is required")});async function mt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await pt.validate(e);const{productId:r}=e;return b(`${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,{...n})}const gt=Object.freeze(Object.defineProperty({__proto__:null,getCatalogKitProducts:lt,getCatalogProducts:dt,getCatalogSimilars:mt},Symbol.toStringTag,{value:"Module"})),ft=s.object({query:s.string()});async function ht({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ft.validate(e);const{query:r=""}=e,a=new URLSearchParams({query:r});return b(`${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${a.toString()}`,{...n})}const yt=(t,e)=>se(t,e),bt=t=>({...t,description:t.description?yt(t.description):t.description}),It=({offer:t,seller:e,product:n})=>({...t,product:n,seller:e}),V=(t,e)=>({...t,isVariantOf:bt(e)}),Ct=t=>t?"https://schema.org/InStock":"https://schema.org/OutOfStock",A=t=>t.AvailableQuantity>0,H=t=>t.spotPrice??0,Rt=t=>t.Price??0,z=(t,e)=>A(t)&&!A(e)?-1:!A(t)&&A(e)?1:H(t)-H(e),vt=(t,e)=>{let n=0;for(let r=1;r<t.length;r++)e(t[n],t[r])>0&&(n=r);return t[n]},Q=t=>{const e=t.flatMap(r=>r.sellers.map(a=>({offer:a.commertialOffer,sku:r}))),n=vt(e,({offer:r},{offer:a})=>z(r,a));return n?n.sku:t[0]},K=t=>t.map(({imageUrl:e,imageText:n,imageLabel:r})=>({alternateName:n??"",url:e.replace("vteximg.com.br","vtexassets.com"),keywords:r})),k={attachment:"ATTACHMENT",specification:"SPECIFICATION",attribute:"ATTRIBUTE"},St=t=>({name:t.name,value:t.content,valueReference:k.attachment}),Tt=t=>({propertyID:t.id,name:t.name,value:t.value,valueReference:{valueReference:k.attribute,visible:t.visible}}),D=(t,e,n)=>{const r=t.flatMap(({name:i,values:l})=>l?l.map(c=>({name:i,value:c,valueReference:k.specification})):{name:i,value:"",valueReference:k.specification}),a=Array.isArray(n)?n.map(St):[],o=e?e.map(Tt):[];return[...r,...a,...o]},B="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",Et="AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa",Ot=t=>{let e=t.slice(0);for(let n=0;n<B.length;n++)e=e.replace(new RegExp(B.charAt(n),"g"),Et.charAt(n));return e},Ft=t=>t.replace(/[·/_,:]/,"-"),J=t=>{const n=t.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-");return Ft(Ot(n)).toLowerCase()},Y=t=>`/${t}/p`,W=t=>{const e=Math.max(...t.map(r=>r.NumberOfInstallments)),n=t.find(r=>r.NumberOfInstallments===e);return{count:(n==null?void 0:n.NumberOfInstallments)??0,value:(n==null?void 0:n.Value)??0}},X=(t,e)=>{const n={price:0,listPrice:0,sellerDefault:!1},a=t.map(o=>It({offer:o.commertialOffer,seller:o,product:e})).sort(z).map(o=>(o.seller.sellerId==="1"&&o.AvailableQuantity>0&&(n.price=o.Price,n.listPrice=o.ListPrice,n.sellerDefault=!0),{availability:o.AvailableQuantity>0,listPrice:o.ListPrice,price:Rt(o),priceValidUntil:o.PriceValidUntil,priceCurrency:"BRL",installments:o.Installments,lowPrice:o.spotPrice,quantity:o.AvailableQuantity,seller:{identifier:o.seller.sellerId}}));return{lowPrice:n.sellerDefault?n.price:a[0].price,highPrice:n.sellerDefault?n.listPrice:a[0].listPrice,offers:a}},Z=t=>{const{attributes:e,itemId:n,name:r,sellers:a,variations:o}=t;return{additionalProperty:D(o,e,[]),name:r,offers:{offers:a.map(({sellerId:i,commertialOffer:l})=>({availability:Ct(l.AvailableQuantity>0),listPrice:l.ListPrice,price:l.Price,quantity:l.AvailableQuantity,seller:{identifier:i}}))},sku:n}},qt=t=>{var F;const{attributes:e,referenceId:n,isVariantOf:r,images:a,itemId:o,name:i,sellers:l,videos:c,variations:d}=t,{brand:u,categories:p,categoriesIds:y,description:g,linkText:m,productClusters:R,clusterHighlights:E,productName:S,properties:T,productId:O,productReference:h}=r,C=p.slice().reverse(),v=X(l,t.isVariantOf),$=W(v.offers[0].installments);return{sku:o,gtin:((F=n==null?void 0:n[0])==null?void 0:F.Value)??h??"",name:S??i,description:g,releaseDate:r.releaseDate??"",slug:m,video:c[0],categories:p,categoriesIds:y,id:O,brand:{name:u,brandName:u},seo:{description:g,title:S,canonical:Y(m)},cluster:{generals:R,highlights:E},properties:T,availability:{status:v.offers[0].availability},breadcrumbList:{itemListElement:[...C.map((P,j)=>{const q=P.split("/"),_=q[q.length-2],re=q.map(J).join("/");return{name:_,item:re,position:j+1}}),{name:r.productName,item:m,position:p.length+1}],numberOfItems:p.length},image:K(a),offers:v,additionalProperty:D(d,e,[]),isVariantOf:{productGroupID:r.productId,hasVariant:r.items.map(P=>Z(P))},installments:$}},$t=t=>{var $;const{attributes:e,referenceId:n,isVariantOf:r,images:a,itemId:o,name:i,sellers:l,Videos:c,variations:d}=t,{brand:u,categories:p,categoriesIds:y,description:g,linkText:m,productClusters:R,productName:E,Coleção:S,"ID Coleção":T,productId:O}=r,h=p.slice().reverse(),C=X(l,t.isVariantOf),v=W(C.offers[0].installments);return{sku:o,gtin:(($=n[0])==null?void 0:$.Value)??"",name:E??i,description:g,releaseDate:r.releaseDate??"",slug:m,video:c[0],categories:p,categoriesIds:y,collection:S,collectionId:T,id:O,brand:{name:u,brandName:u},seo:{description:g,title:E,canonical:Y(m)},cluster:{generals:R,highlights:[]},availability:{status:C.offers[0].availability},breadcrumbList:{itemListElement:[...h.map((F,P)=>{const j=F.split("/"),q=j[j.length-2],_=j.map(J).join("/");return{name:q,item:_,position:P+1}}),{name:r.productName,item:m,position:p.length+1}],numberOfItems:p.length},image:K(a),offers:C,additionalProperty:D(d,e,[]),isVariantOf:{productGroupID:r.productId,hasVariant:r.items.map(F=>{const{variations:P}=F,j=P.map(q=>({name:q,values:F[q]}));return{...Z(F),additionalProperty:D(j,e,[])}})},installments:v}},Pt=s.array().of(s.object({key:s.string().required(),value:s.string().required()})).required("Facets are required");async function jt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Pt.validate(e);const r=new URLSearchParams({}),a=e.map(({key:i,value:l})=>`${i}/${l}`).join("/");I.addSearchParamsFacets(e,r);const o=`${t}/api/catalog_system/pub/products/crossselling/${a}`;return b(o,{cache:"no-store",...n}).then(i=>i.map(c=>{const d=Q(c.items);return d&&V(d,c)}).filter(c=>!!c).map(c=>({node:$t(c)})))}const ee=({apiUrl:t,body:e,fetchOptions:n,extraData:r})=>{if(!e){console.error("[ERROR FETCHING] Body is required");return}const{query:a="",page:o=1,count:i,sort:l="",facets:c=[],type:d,hideUnavailableItems:u=!0,locale:p=""}=e,y=new URLSearchParams({page:o.toString(),count:(i==null?void 0:i.toString())??(r==null?void 0:r.ITEMS_PER_PAGE)??24,query:a,sort:l,locale:p});u!==void 0&&y.append("hideUnavailableItems",u.toString());const g=c.map(m=>`${m.key}/${m.value}`).join("/")??"";return Re(`${t}/api/io/_v/api/intelligent-search/${d}/${g}?${y.toString()}`,{headers:{Accept:"application/json","content-type":"application/json"},...n})};async function Nt({body:t,extraData:e,...n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const r=await ee({body:{...t,type:"product_search"},extraData:e,...n}),a=(r==null?void 0:r.products.map(l=>{const c=Q(l.items);return c&&V(c,l)}).filter(l=>!!l))??[],{pagination:o,recordsFiltered:i}=r;return{data:{pagination:{nextPage:o.after.length>0,previousPage:o.before.length>0,startCursor:"0",endCursor:i.toString(),count:i,total:o.count},products:a.map((l,c)=>({node:qt(l),cursor:c.toString()}))}}}async function wt({body:t,extraData:e,...n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const r=await ee({body:{...t,type:"facets"},extraData:e,...n});return!r||!r.facets?(console.error("[ERROR FETCHING] No facets found"),{data:{facets:[]}}):{data:{...r,facets:I.formattedFacets(r,t==null?void 0:t.selectedFacets,(t==null?void 0:t.query)??"")}}}const At=s.object({query:s.string().optional(),locale:s.string().optional()});async function kt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await At.validate(e);const{query:r="",locale:a="default_locale"}=e,o=new URLSearchParams({query:r,locale:a});return b(`${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,{...n})}async function Dt({apiUrl:t}){return b(`${t}/api/io/_v/api/intelligent-search/top_searches`)}const _t=Object.freeze(Object.defineProperty({__proto__:null,getSearchAutoCompleteSuggestions:ht,getSearchCrossellingProducts:jt,getSearchFacets:wt,getSearchProducts:Nt,getSearchSuggestedTerms:kt,getSearchTopSearchs:Dt},Symbol.toStringTag,{value:"Module"})),Ht=s.object({masterDataEntity:s.string().nonNullable(),payload:s.object().shape({}).nullable()});async function Bt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ht.validate(e);const{masterDataEntity:r,payload:a}=e,o=`${t}/api/dataentities/${r}/documents`;return b(o,{method:"POST",body:{payload:a},...n})}const Lt=s.object().shape({_where:s.string().optional(),_fields:s.string().optional(),_sort:s.string().optional(),_from:s.number().integer().min(0).optional(),_to:s.number().integer().min(0).optional(),_keyword:s.string().optional()}),Gt=s.object({masterDataEntity:s.string().required(),searchFields:Lt,headers:s.object().shape({"REST-Range":s.string().notRequired()})});async function Mt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}const r=new URLSearchParams;await Gt.validate(e);const{masterDataEntity:a,searchFields:o,headers:i}=e;o&&Object.entries(o).forEach(([c,d])=>{r.append(c,String(d))}),"_fields"in o||r==null||r.append("_fields","_all");const l=`${t}/api/dataentities/${a}/search?${r.toString()}`;return b(l,{headers:{"REST-Range":i["REST-Range"]??"resources=0-20"},method:"GET",...n})}const xt=s.object({dataEntityName:s.string().required(),id:s.string().required(),fieldsToBeUpdated:s.object().shape({})});async function Ut({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await xt.validate(e);const{dataEntityName:r,id:a,fieldsToBeUpdated:o}=e,i=`${t}/api/dataentities/${r}/documents/${a}`;return b(i,{body:{fieldsToBeUpdated:o},method:"PATCH",...n})}const Vt=Object.freeze(Object.defineProperty({__proto__:null,getSearchMasterdata:Mt,patchUpdateMasterdata:Ut,postMasterdata:Bt},Symbol.toStringTag,{value:"Module"}));async function zt({body:t,apiUrl:e,extraData:n,fetchOptions:r}){const{productIds:a}=t;if(!a)return console.error("[ERROR FETCHING] productIds is required"),[];const{NAME_SPLIT_SYMBOL:o}=n;if(!o)return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"),[];const i=a.map(u=>typeof u=="string"||typeof u=="number"?`productId:${u}`:"").join("&fq="),l=await b(`${e}/api/catalog_system/pub/products/search?fq=${i}`,{...r}),c=u=>Object.keys(u).map(p=>({id:p,name:u[p]}));return l.map((u,p)=>{var O;const{installments:y,price:g,listPrice:m,sizes:R,allSizesAvailable:E}=I.getSkuInfos({items:u.items,NAME_SPLIT_SYMBOL:o}),S=E?!0:R.some(h=>h.available),T=u.items[0].sellers[0].commertialOffer;return{node:{sku:u.items[0].itemId,gtin:u.productReference,name:u.productName,description:u.description,releaseDate:u.releaseDate,slug:u.linkText,categories:u.categories,categoriesIds:u.categoriesIds,id:u.items[0].itemId,brand:{name:u.brand,brandName:u.brand},seo:{description:u.description,title:u.productName,canonical:`/${u.linkText}/p`},cluster:{generals:c(u.productClusters),highlights:c(u.clusterHighlights)},availability:{status:S},image:u.items[0].images.map(({imageLabel:h,imageUrl:C})=>({alternateName:h,url:C,keywords:h})),offers:{lowPrice:g,highPrice:m,offers:[{availability:S,listPrice:m,price:g,priceValidUntil:T.PriceValidUntil,priceCurrency:"BRL",installments:T.Installments,lowPrice:g,quantity:T.AvailableQuantity,seller:{identifier:u.items[0].sellers[0].sellerId}}]},additionalProperty:(O=u==null?void 0:u.skuSpecifications)==null?void 0:O.map(h=>({name:u==null?void 0:u.skuSpecifications[0].field.name,value:h,valueReference:"SPECIFICATION"})),isVariantOf:{productGroupID:u.productId,hasVariant:u.items.map(h=>({additionalProperty:h==null?void 0:h.variations.map(()=>{var C,v,$;return{name:(C=h==null?void 0:h.variations)==null?void 0:C[0],value:($=h==null?void 0:h[(v=h==null?void 0:h.variations)==null?void 0:v[0]])==null?void 0:$[0],valueReference:"SPECIFICATION"}}),name:h.name,offers:{offers:h.sellers.map(({commertialOffer:C,sellerId:v})=>({availability:"https://schema.org/InStock",listPrice:C.ListPrice,price:C.Price,quantity:C.AvailableQuantity,seller:{identifier:v}}))},sku:h.itemId,slug:`-${h.itemId}`}))},installments:y},cursor:p.toString()}})}const Qt=Object.freeze(Object.defineProperty({__proto__:null,getWishlistProducts:zt},Symbol.toStringTag,{value:"Module"})),Kt=(t="")=>t.charAt(0).toUpperCase()+t.slice(1),L=(t,e=" ")=>!t||typeof t=="string"&&t.length===0?t:(Array.isArray(t)?t:t.split("-")).map(Kt).join(e),Jt=({canonical:t,seo:e,slug:n})=>{const r=Array.isArray(n)?n.join(", "):n;return{id:0,Title:`${Array.isArray(n)?n.map(o=>L(o)).join(","):L(n)} - ${e.title}`,MetaTagDescription:e.description,name:r,hasChildren:!1,url:t,children:[]}},Yt=({canonical:t,category:e,previousImages:n,seo:r})=>({category:String(e==null?void 0:e.id),title:(e==null?void 0:e.Title)??r.title,description:(e==null?void 0:e.MetaTagDescription)??r.description,alternates:{canonical:t},openGraph:{type:"website",title:(e==null?void 0:e.Title)??r.title,description:(e==null?void 0:e.MetaTagDescription)??r.description,images:Array.isArray(n)?[...n]:[]}}),Wt=({items:t,parent:e,apiUrl:n,find:r})=>{const a=t.find(i=>i.url.replace(n,"")===decodeURIComponent(e.toLowerCase()));return(a==null?void 0:a.children.find(i=>i.name.toLowerCase()===decodeURIComponent(String(r))))??a},Xt=t=>{t instanceof Error?(console.error(`[ERROR CATEGORY INFO]: ${t.message}`),console.error(t.stack)):console.error("[ERROR CATEGORY INFO]: Unknown error",t)},Zt=new Set(["brand","category","department","subcategory","collection","cluster"]),er=t=>typeof(t==null?void 0:t.pageType)=="string"&&Zt.has(t==null?void 0:t.pageType.toLowerCase()),tr=t=>({collection:t.Coleção,categoryId:t.categoryId,current_collection:t["Coleção Atual"],items:t.items}),te=(t,e)=>t.reduce((n,r)=>{if(r.items.filter(i=>i.sellers.find(l=>l.commertialOffer.IsAvailable)).length===0||(n==null?void 0:n.find(i=>(i==null?void 0:i.productId)===(r==null?void 0:r.productId)))!==void 0)return n;const o=r.items[0].images.find(i=>e.includes(i.imageLabel));return n.push({slug:`/${r.linkText}/p`,productId:r==null?void 0:r.productId,textureImage:(o==null?void 0:o.imageUrl)??"",textureAlt:(o==null?void 0:o.imageText)??""}),n},[]),rr=Object.freeze(Object.defineProperty({__proto__:null,createEmptySeoCategory:Jt,createSeoCategory:Yt,findCategory:Wt,formattedSimilars:te,isCollectionPageType:er,notFindCategoryError:Xt,responseAdapter:tr},Symbol.toStringTag,{value:"Module"})),nr={parseSearchState:I.parseSearchState,convertSearchParams:I.convertSearchParams,filterNonRootFacets:I.filterNonRootFacets,filterNonCategorySelected:I.filterNonCategorySelected},sr=async({children:t,apiUrl:e,productId:n,ClientItems:r,PDP_INFO:a,TEXTURE_IMAGE:o,TOGGLE_STYLE_MODIFIER:i})=>{const l=await fetch(`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`).then(d=>d.json()),c=te(l,o);return f.jsxs("div",{className:I.styles.similars,children:[f.jsxs("div",{className:I.styles["similars-info"],children:[f.jsx("span",{className:I.styles["sections-title"],children:a.product.color_title}),t]}),f.jsx(r,{productId:n,similars:c,TOGGLE_STYLE_MODIFIER:i})]})},or={checkout:it,catalog:gt,cms:I.cms,search:_t,masterdata:Vt,wishlist:{...Qt}},ar={catalog:rr,search:nr,product:I.productHelpers},ir={template:{pdp:{PDPSimilars:sr}}};exports.serverAPIs=or;exports.serverCMS=Ce;exports.serverComponents=ir;exports.serverHelpers=ar;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),I=require("./index-CwBIv223.js"),N=require("@soma-vertical-web/core-components"),ne=require("yup"),se=require("sanitize-html");function oe(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const s=oe(ne),ae=({slug:t,data:e,SectionZone:n,COMMON_PAGE_COLUMN_GAP:r,identifyWhoIsFirst:a})=>{const o=e==null?void 0:e.find(p=>{var y,g,m,R;return((g=(y=p.config)==null?void 0:y.responsive)==null?void 0:g.deviceType)==="desktop"&&((R=(m=p.config)==null?void 0:m.seo)==null?void 0:R.slug)===t}),i=o==null?void 0:o.config.responsive.gapCustom,l=o==null?void 0:o.config.responsive.gapSections,c=e==null?void 0:e.find(p=>{var y,g,m,R;return((g=(y=p.config)==null?void 0:y.responsive)==null?void 0:g.deviceType)==="mobile"&&((R=(m=p.config)==null?void 0:m.seo)==null?void 0:R.slug)===t}),d=c==null?void 0:c.config.responsive.gapCustom,u=c==null?void 0:c.config.responsive.gapSections;return f.jsxs(f.Fragment,{children:[f.jsx(N.Utils.Column,{gap:i&&l?l:r,className:N.helpers.classNameConcat(I.responsive["responsive-desktop-flex"],"utils-column-modifier"),children:f.jsx(n,{data:(o==null?void 0:o.sections)??[],identifyWhoIsFirst:a})}),f.jsx(N.Utils.Column,{gap:d&&u?u:r,className:N.helpers.classNameConcat(I.responsive["responsive-mobile-flex"],"utils-column-modifier"),children:f.jsx(n,{data:(c==null?void 0:c.sections)??[],identifyWhoIsFirst:a})})]})},ie=async({slug:t,SectionZone:e,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:r=!1,...a})=>{const{data:o}=await I.getContentType({contentType:"common_page",...a});return f.jsx(ae,{data:o,slug:t,SectionZone:e,COMMON_PAGE_COLUMN_GAP:n,identifyWhoIsFirst:r})},ce=async({PAYMENT_FLAGS_DICTIONARY:t,PAYMENT_FLAGS:e,LEGAL_INFORMATION_TEXT:n,SectionZone:r,ICONS:a,Footer:o,FooterSupport:i,...l})=>{var p,y,g,m,R,O,T,E,F,h,v;const{data:c}=await I.getContentType({contentType:"footer",...l}),d=Array.isArray(c)&&((p=c[0])==null?void 0:p.type)==="footer"?c[0]:null,u={...(y=d==null?void 0:d.paymentInfo)==null?void 0:y.paymentInfo,acceptedFlags:Array.isArray((g=d==null?void 0:d.paymentInfo)==null?void 0:g.paymentInfo.acceptedFlags)?(m=d==null?void 0:d.paymentInfo)==null?void 0:m.paymentInfo.acceptedFlags.filter(C=>!!t[C]).map(C=>t[C]):[]};return d?f.jsx(o,{data:{...d},socialInfo:(R=d.socialMedia)==null?void 0:R.socialMedia,socialMedias:(T=(O=d.socialMedia)==null?void 0:O.socialMedia)==null?void 0:T.medias,payments:u,adornment:{...(F=(E=d.supportInfo)==null?void 0:E.supportInfo)!=null&&F.content?{bottom:f.jsx(i,{content:(v=(h=d.supportInfo)==null?void 0:h.supportInfo)==null?void 0:v.content,CONSTANTS:{ICONS:a,PAYMENT_FLAGS:e,PAYMENT_FLAGS_DICTIONARY:t}})}:{},...d.sections.length?{top:f.jsx(r,{data:d.sections})}:{}},LEGAL_INFORMATION_TEXT:n,ICONS:a}):f.jsx(f.Fragment,{})},le=async({children:t,ClientHeaderProvider:e,...n})=>{var o,i,l,c;const{data:r}=await I.getContentType({contentType:"header",...n}),a=(o=r[0])==null?void 0:o.sections.map(d=>d.data);return f.jsx(e,{headerData:{...(i=r[0])==null?void 0:i.layerConfig.config,subMenus:a??[],categories:((l=r[0])==null?void 0:l.categories.categories.items)??[],navigationLinks:((c=r[0])==null?void 0:c.navigationLinks.navigationLinks.items)??[]},children:t})},ue=t=>{var i,l;const e=(l=(i=t[0])==null?void 0:i.items)==null?void 0:l.items;if((e==null?void 0:e.items.length)===0||t.length===0)return{iconLabel:"",label:"",content:[]};const n=e==null?void 0:e.iconLabel,r=e==null?void 0:e.label,a=e==null?void 0:e.helpButtonSize,o=e.items.map((c,d)=>({type:c.type,id:`${d.toString()}-${c.title.toLowerCase()}`,title:c.title,subtitle:c.subtitle,description:c.description,buttonLabel:c.buttonLabel,buttonHref:c.buttonHref,buttonMode:c.buttonMode,buttonSize:c.buttonSize,buttonIcon:c.buttonIcon}));return{iconLabel:n,label:r,helpButtonSize:a,content:o}},de=async({HelpButton:t,ICONS:e,className:n,...r})=>{const{data:a}=await I.getContentType({contentType:"helpbutton",...r});if(!a)return f.jsx(f.Fragment,{});const o=ue(a);return f.jsx(t,{data:o,...r,ICONS:e,className:n})},pe=async({children:t,productId:e,COMMON_PAGE_COLUMN_GAP:n,SectionZone:r,PDPContentProvider:a,...o})=>{const{data:i}=await I.getContentType({contentType:"product_page",...o});return f.jsx(a,{data:i[0],productId:e,COMMON_PAGE_COLUMN_GAP:n,SectionZone:r,children:t})},me={"column-modifier":"_column-modifier_1tqap_1"},ge=async({children:t,slug:e,SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:r,PLPContentProvider:a,...o})=>{const{data:i}=await I.getContentType({contentType:"categories_page",...o}),l=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)===e&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="desktop"}),c=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)===e&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="mobile"}),d=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)==="default"&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="desktop"}),u=i.find(p=>{var y,g,m;return((y=p.config)==null?void 0:y.seo.slug)==="default"&&((m=(g=p.config)==null?void 0:g.responsive)==null?void 0:m.deviceType)==="mobile"});return f.jsxs(f.Fragment,{children:[f.jsx(N.Utils.Column,{className:N.helpers.classNameConcat(I.responsive["responsive-desktop-flex"],me["column-modifier"]),style:{minHeight:"100vh"},children:f.jsx(a,{data:l??d,device:"desktop",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:r,children:t})}),f.jsx(N.Utils.Column,{className:I.responsive["responsive-mobile-flex"],children:f.jsx(a,{data:c??u,device:"mobile",SectionZone:n,COMMON_PAGE_COLUMN_GAP_PDC:r,children:t})})]})},fe=async({slug:t,...e})=>{var i,l,c;const{data:n}=await I.getContentType({contentType:"redirect_to_search",...e}),r=((c=(l=(i=n[0])==null?void 0:i.redirectToSearch)==null?void 0:l.redirectToSearch)==null?void 0:c.paths)??[];if(!!!r.length)return{slug:t,query:null,redirect:!1};const o=r.find(d=>{var u,p;return((u=d.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===t.replace(/\//g,"-").toLowerCase()||((p=d.path)==null?void 0:p.replace(/\//g,"-").toLowerCase())===`/${t}`.replace(/\//g,"-").toLowerCase()});return o?{slug:t,query:o==null?void 0:o.searchQuery,redirect:!0,collectionId:o==null?void 0:o.collectionId,filters:o==null?void 0:o.filters,sort:o==null?void 0:o.sort}:{slug:t,query:null,redirect:!1,collectionId:null,filters:null,sort:null}},he=async({slug:t,...e})=>{var i,l,c;const{data:n}=await I.getContentType({contentType:"redirect_to_search",...e}),r=((c=(l=(i=n[0])==null?void 0:i.redirectToSearch)==null?void 0:l.redirectToSearch)==null?void 0:c.paths)??[];if(!!!r.length)return null;const o=r.find(d=>{var u,p;return((u=d.path)==null?void 0:u.replace(/\//g,"-").toLowerCase())===t.replace(/\//g,"-").toLowerCase()||((p=d.path)==null?void 0:p.replace(/\//g,"-").toLowerCase())===`/${t}`.replace(/\//g,"-").toLowerCase()});return o?{slug:t,title:o.pageTitle,description:o.pageDescription}:null},ye=async({children:t,SectionZone:e,className:n,...r})=>{const{data:a}=await I.getContentType({contentType:"search_page",...r});return Array.isArray(a)&&a.length>0?f.jsx(I.SearchPageScreening,{data:a,SectionZone:e,className:n,children:t}):f.jsx(f.Fragment,{children:t})},be=async({ClientTipbarContent:t,...e})=>{const{data:n}=await I.getContentType({contentType:"tipbar",...e});return f.jsx(t,{data:n})},Ie={CommonPageContent:ie,HeaderContent:le,TipbarContent:be,FooterContent:ce,PLPContent:ge,PDPContent:pe,getRedirectData:fe,getPLPSynteticMetaData:he,SearchPageContent:ye,HelpButtonContent:de},Ce={Components:Ie},b=async(t,e={})=>{const{method:n="GET",body:r,headers:a={},priority:o="auto",cache:i="default"}=e;return fetch(t,{method:n,headers:{...a,Accept:"application/json","Content-Type":"application/json"},priority:o,cache:i,...r?{body:JSON.stringify(r)}:{}}).then(l=>l.json()).catch(l=>{console.error("[ERROR FETCH VTEX]",l)})},w=new Map;async function Re(t,e={}){var n;try{const{abort:r=!1}=e,a=new AbortController;r&&(w.has(t)&&((n=w.get(t))==null||n.abort(),w.delete(t)),w.set(t,a));const o=b(t,{...e,...r?{signal:a.signal}:{}});return r&&w.delete(t),o}catch(r){if(r.name==="AbortError"){console.log(`[REQUEST CANCELLED]: ${t}`);return}throw console.error(`[ERROR API]: ${r.message}`),r}}const ve=s.object({country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:s.string().nullable()});async function Se({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ve.validate(e);const{country:r,postalCode:a}=e;return await b(`${t}/api/checkout/pub/postal-code/${r}/${a}`,{method:"POST",body:e,...n})}const Te=s.object({orderFormId:s.string().nullable(),sellerCode:s.string().nullable(),sellerName:s.string().nullable()});async function x({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Te.validate(e);const{orderFormId:r,sellerCode:a,sellerName:o}=e,i=a?`${a.trim()} - ${o}`:null;return b(`${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,{method:"POST",body:{value:i},...n})}const Ee=s.object({orderFormId:s.string().nullable(),sellerCode:s.string().nullable(),marketingData:s.object()});async function U({apiUrl:t,body:e,extraData:n={},fetchOptions:r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ee.validate(e);const{orderFormId:a,sellerCode:o,marketingData:i}=e,l=o?{utmCampaign:o?o.toUpperCase():"",utmiCampaign:o?`${n.VENDOR_CODE}`:"semcodigo"}:{};return b(`${t}/api/checkout/pub/orderForm/${a}/attachments/marketingData`,{method:"POST",body:{...i,...l},...r})}const Oe=s.object({orderFormId:s.string().nullable(),sellerCode:s.string().nullable(),sellerName:s.string().nullable()});async function Fe({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Oe.validate(e);const r=await x({apiUrl:t,body:e,fetchOptions:n});return U({apiUrl:t,body:{...e,marketingData:r==null?void 0:r.marketingData},fetchOptions:n})}const qe=s.object({orderFormId:s.string().nullable(),coupon:s.string().nullable()});async function $e({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await qe.validate(e);const{coupon:r="",orderFormId:a}=e;return b(`${t}/api/checkout/pub/orderForm/${a}/coupons`,{method:"POST",body:{text:r},...n})}const Pe=s.object({appId:s.string().required("App ID is required"),orderFormId:s.string().nullable(),key:s.array().of(s.string())});async function je({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Pe.validate(e);const{appId:r="faststore",orderFormId:a,key:o}=e;return b(`${t}/api/checkout/pub/orderForm/${a}/customData/${r}/${o}`,{method:"PUT",...n})}const Ne=s.object().shape({name:s.string().required("Attachment name is required"),content:s.object().nullable()});var G;const we=s.object().shape({attachments:(G=s.array().of(Ne))==null?void 0:G.nullable(),id:s.string().required("ID of SKU is required"),index:s.number().integer().nullable(),quantity:s.number().integer().nullable(),seller:s.string().required("Seller is required"),price:s.number().integer()}),Ae=s.object({orderFormId:s.string().required("OrderFormId is required"),orderItems:s.array().of(we)});async function ke({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ae.validate(e);const{orderFormId:r,orderItems:a}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/items`,{method:"POST",body:{orderItems:a},...n})}const De=s.object({orderFormId:s.string().nullable()});async function _e({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await De.validate(e);const{orderFormId:r}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,{method:"POST",...n})}const He=s.object().shape({name:s.string().required("Attachment name is required"),content:s.object().nullable()});var M;const Be=s.object().shape({attachments:(M=s.array().of(He))==null?void 0:M.nullable(),id:s.string().required("ID of SKU is required"),index:s.number().integer().nullable(),quantity:s.number().integer().nullable(),seller:s.string().required("Seller is required"),price:s.number().integer()}),Le=s.object({orderFormId:s.string().nullable(),orderItems:s.array().of(Be)});async function Ge({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Le.validate(e);const{orderFormId:r,orderItems:a}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/items/update`,{method:"POST",body:{orderItems:a},...n})}const Me=s.object({orderFormId:s.string().nullable()});async function xe({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Me.validate(e);const{orderFormId:r}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/messages/clear`,{method:"POST",...n})}const Ue=s.object({id:s.string().nullable(),itemIndex:s.number().nullable(),orderFormId:s.string().nullable(),remove:s.boolean().nullable()});async function Ve({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ue.validate(e);const{itemIndex:r,orderFormId:a,id:o,remove:i}=e,l=i?`/${o}/remove`:"",c=`${t}/api/checkout/pub/orderForm/${a}/items/${r}/offerings${l}`;return b(c,{method:"POST",body:{id:o},...n})}const ze=s.object({orderFormId:s.string().nullable()});async function Qe({apiUrl:t,body:e,fetchOptions:n,extraData:r}){var i;if(!e){console.error("[ERROR FETCHING] Body is required");return}await ze.validate(e);const a=new URLSearchParams({refreshOutdatedData:"true"}),o=e.orderFormId&&((i=r.orderFormPurchaseId)==null?void 0:i.value)!==e.orderFormId?`${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(a)}`:`${t}/api/checkout/pub/orderForm`;return b(o,{method:"GET",...n})}const Ke=s.object({orderFormId:s.string().nullable(),email:s.string().email().required(),firstName:s.string().required(),lastName:s.string().required(),documentType:s.string().required(),document:s.string().required(),phone:s.string().matches(/^\+\d{1,3}\d{10,11}$/)});async function Je({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ke.validate(e);const{orderFormId:r,...a}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,{method:"POST",body:{...a},...n})}const Ye=s.object({sellerCode:s.string().nullable()});async function We({apiUrl:t,body:e,extraData:n,fetchOptions:r}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ye.validate(e);const{sellerCode:a=""}=e;return b(`${t}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${a}`,{method:"GET",headers:{Accept:"application/vnd.vtex.ds.v10+json"},...r})}const Xe=s.object().shape({country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),orderFormId:s.string().nullable(),postalCode:s.string().nullable()});async function Ze({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Xe.validate(e);const{country:r,orderFormId:a,postalCode:o}=e,i=o?{address:{addressType:"residential",postalCode:o,country:r}}:{logisticsInfo:[],clearAddressIfPostalCodeNotFound:!0};return b(`${t}/api/checkout/pub/orderForm/${a}/attachments/shippingData`,{method:"POST",body:i,...n})}const et=s.object().shape({orderFormId:s.string().nullable(),options:s.array().of(s.object().shape({itemIndex:s.number(),selectedDeliveryChannel:s.string(),selectedSla:s.string()})),selectedAddresses:s.array().of(s.object().shape({addressId:s.string().required(),addressType:s.string().required(),city:s.string().nullable(),complement:s.string().nullable(),country:s.string().required().length(3),geoCoordinates:s.array().of(s.number()).required().min(0),isDisposable:s.boolean().required(),neighborhood:s.string().nullable(),number:s.string().nullable(),postalCode:s.string().required(),receiverName:s.string().nullable(),reference:s.string().nullable(),state:s.string().nullable(),street:s.string().nullable()}))});async function tt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await et.validate(e);const{orderFormId:r,options:a,selectedAddresses:o}=e;return b(`${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,{method:"POST",body:{selectedAddresses:o,clearAddressIfPostalCodeNotFound:!1,logisticsInfo:a},...n})}const rt=s.object({country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:s.string().nullable(),geoCoordinates:s.object().shape({longitude:s.number().required(),latitude:s.number().required()})});async function nt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await rt.validate(e);const{country:r="",geoCoordinates:a,postalCode:o=""}=e,i=new URLSearchParams({country:String(r)});return o?i.append("postalCode",o):i.append("geoCoordinates",`${a==null?void 0:a.longitude};${a==null?void 0:a.latitude}`),await b(`${t}/api/checkout/pub/regions/?${i.toString()}`,{method:"GET",...n})}const st=s.object({id:s.string().required("ID of SKU is required"),quantity:s.number().integer().required("Quantity of item is required"),seller:s.string()}),ot=s.object({items:s.array().of(st),country:s.string().length(3,"Country code must be 3 characters long").required("Country is required"),postalCode:s.string().nullable(),geoCoordinates:s.array().nullable().of(s.number()).length(2)});async function at({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}return await ot.validate(e),b(`${t}/api/checkout/pub/orderForms/simulation`,{method:"POST",body:e,...n})}const it=Object.freeze(Object.defineProperty({__proto__:null,getMasterDataSellerCode:We,getOrderForm:Qe,postOrderFormAddCoupon:$e,postOrderFormAttachClientProfileData:Je,postOrderFormAttachOrderFormData:Fe,postOrderFormAttachShippingData:Ze,postOrderFormAttachmentsMarketingData:U,postOrderFormAttachmentsOpenTextField:x,postOrderFormClearMessages:xe,postOrderFormFreightSimulation:at,postOrderFormItems:ke,postOrderFormRegion:nt,postOrderFormRemoveAllItems:_e,postOrderFormUpdateItems:Ge,postOrderFormUpdateShippingData:tt,postOrderformAddress:Se,putOrderFormCustomData:je,updateOrderFormOffering:Ve},Symbol.toStringTag,{value:"Module"})),ct=s.object({skuId:s.string()});async function lt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ct.validate(e);const{skuId:r}=e;return b(`${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,{...n})}const ut=s.object({ids:s.array().of(s.string().required("ID are required")).required("IDs are required")});async function dt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ut.validate(e);const{ids:r}=e;return b(`${t}/api/catalog_system/pub/products/search?fq=${r.map(a=>`productId:${a}`).join("&fq=")}`,{...n})}const pt=s.object({productId:s.number().required("Product ID is required")});async function mt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await pt.validate(e);const{productId:r}=e;return b(`${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,{...n})}const gt=Object.freeze(Object.defineProperty({__proto__:null,getCatalogKitProducts:lt,getCatalogProducts:dt,getCatalogSimilars:mt},Symbol.toStringTag,{value:"Module"})),ft=s.object({query:s.string()});async function ht({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await ft.validate(e);const{query:r=""}=e,a=new URLSearchParams({query:r});return b(`${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${a.toString()}`,{...n})}const yt=(t,e)=>se(t,e),bt=t=>({...t,description:t.description?yt(t.description):t.description}),It=({offer:t,seller:e,product:n})=>({...t,product:n,seller:e}),V=(t,e)=>({...t,isVariantOf:bt(e)}),Ct=t=>t?"https://schema.org/InStock":"https://schema.org/OutOfStock",A=t=>t.AvailableQuantity>0,H=t=>t.spotPrice??0,Rt=t=>t.Price??0,z=(t,e)=>A(t)&&!A(e)?-1:!A(t)&&A(e)?1:H(t)-H(e),vt=(t,e)=>{let n=0;for(let r=1;r<t.length;r++)e(t[n],t[r])>0&&(n=r);return t[n]},Q=t=>{const e=t.flatMap(r=>r.sellers.map(a=>({offer:a.commertialOffer,sku:r}))),n=vt(e,({offer:r},{offer:a})=>z(r,a));return n?n.sku:t[0]},K=t=>t.map(({imageUrl:e,imageText:n,imageLabel:r})=>({alternateName:n??"",url:e.replace("vteximg.com.br","vtexassets.com"),keywords:r})),k={attachment:"ATTACHMENT",specification:"SPECIFICATION",attribute:"ATTRIBUTE"},St=t=>({name:t.name,value:t.content,valueReference:k.attachment}),Tt=t=>({propertyID:t.id,name:t.name,value:t.value,valueReference:{valueReference:k.attribute,visible:t.visible}}),D=(t,e,n)=>{const r=t.flatMap(({name:i,values:l})=>l?l.map(c=>({name:i,value:c,valueReference:k.specification})):{name:i,value:"",valueReference:k.specification}),a=Array.isArray(n)?n.map(St):[],o=e?e.map(Tt):[];return[...r,...a,...o]},B="ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",Et="AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa",Ot=t=>{let e=t.slice(0);for(let n=0;n<B.length;n++)e=e.replace(new RegExp(B.charAt(n),"g"),Et.charAt(n));return e},Ft=t=>t.replace(/[·/_,:]/,"-"),J=t=>{const n=t.replace(/,/g,"").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g,"-");return Ft(Ot(n)).toLowerCase()},Y=t=>`/${t}/p`,W=t=>{const e=Math.max(...t.map(r=>r.NumberOfInstallments)),n=t.find(r=>r.NumberOfInstallments===e);return{count:(n==null?void 0:n.NumberOfInstallments)??0,value:(n==null?void 0:n.Value)??0}},X=(t,e)=>{const n={price:0,listPrice:0,sellerDefault:!1},a=t.map(o=>It({offer:o.commertialOffer,seller:o,product:e})).sort(z).map(o=>(o.seller.sellerId==="1"&&o.AvailableQuantity>0&&(n.price=o.Price,n.listPrice=o.ListPrice,n.sellerDefault=!0),{availability:o.AvailableQuantity>0,listPrice:o.ListPrice,price:Rt(o),priceValidUntil:o.PriceValidUntil,priceCurrency:"BRL",installments:o.Installments,lowPrice:o.spotPrice,quantity:o.AvailableQuantity,seller:{identifier:o.seller.sellerId}}));return{lowPrice:n.sellerDefault?n.price:a[0].price,highPrice:n.sellerDefault?n.listPrice:a[0].listPrice,offers:a}},Z=t=>{const{attributes:e,itemId:n,name:r,sellers:a,variations:o}=t;return{additionalProperty:D(o,e,[]),name:r,offers:{offers:a==null?void 0:a.map(({sellerId:i,commertialOffer:l})=>({availability:Ct(l.AvailableQuantity>0),listPrice:l.ListPrice,price:l.Price,quantity:l.AvailableQuantity,seller:{identifier:i}}))},sku:n}},qt=t=>{var S;const{attributes:e,referenceId:n,isVariantOf:r,images:a,itemId:o,name:i,sellers:l,videos:c,variations:d}=t,{brand:u,categories:p,categoriesIds:y,description:g,linkText:m,productClusters:R,clusterHighlights:O,productName:T,properties:E,productId:F,productReference:h}=r,v=p.slice().reverse(),C=X(l,t.isVariantOf),q=W(C.offers[0].installments);return{sku:o,gtin:((S=n==null?void 0:n[0])==null?void 0:S.Value)??h??"",name:T??i,description:g,releaseDate:r.releaseDate??"",slug:m,video:c[0],categories:p,categoriesIds:y,id:F,brand:{name:u,brandName:u},seo:{description:g,title:T,canonical:Y(m)},cluster:{generals:R,highlights:O},properties:E,availability:{status:C.offers[0].availability},breadcrumbList:{itemListElement:[...v.map((P,j)=>{const $=P.split("/"),_=$[$.length-2],re=$.map(J).join("/");return{name:_,item:re,position:j+1}}),{name:r.productName,item:m,position:p.length+1}],numberOfItems:p.length},image:K(a),offers:C,additionalProperty:D(d,e,[]),isVariantOf:{productGroupID:r.productId,hasVariant:r.items.map(P=>Z(P))},installments:q}},$t=t=>{var q;const{attributes:e,referenceId:n,isVariantOf:r,images:a,itemId:o,name:i,sellers:l,Videos:c,variations:d}=t,{brand:u,categories:p,categoriesIds:y,description:g,linkText:m,productClusters:R,productName:O,Coleção:T,"ID Coleção":E,productId:F}=r,h=p.slice().reverse(),v=X(l,t.isVariantOf),C=W(v.offers[0].installments);return{sku:o,gtin:((q=n[0])==null?void 0:q.Value)??"",name:O??i,description:g,releaseDate:r.releaseDate??"",slug:m,video:c[0],categories:p,categoriesIds:y,collection:T,collectionId:E,id:F,brand:{name:u,brandName:u},seo:{description:g,title:O,canonical:Y(m)},cluster:{generals:R,highlights:[]},availability:{status:v.offers[0].availability},breadcrumbList:{itemListElement:[...h.map((S,P)=>{const j=S.split("/"),$=j[j.length-2],_=j.map(J).join("/");return{name:$,item:_,position:P+1}}),{name:r.productName,item:m,position:p.length+1}],numberOfItems:p.length},image:K(a),offers:v,additionalProperty:D(d,e,[]),isVariantOf:{productGroupID:r.productId,hasVariant:r.items.map(S=>{const{variations:P}=S,j=P.map($=>({name:$,values:S[$]}));return{...Z(S),additionalProperty:D(j,e,[])}})},installments:C}},Pt=s.array().of(s.object({key:s.string().required(),value:s.string().required()})).required("Facets are required");async function jt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Pt.validate(e);const r=new URLSearchParams({}),a=e.map(({key:i,value:l})=>`${i}/${l}`).join("/");I.addSearchParamsFacets(e,r);const o=`${t}/api/catalog_system/pub/products/crossselling/${a}`;return b(o,{cache:"no-store",...n}).then(i=>i.map(c=>{const d=Q(c.items);return d&&V(d,c)}).filter(c=>!!c).map(c=>({node:$t(c)})))}const ee=({apiUrl:t,body:e,fetchOptions:n,extraData:r})=>{if(!e){console.error("[ERROR FETCHING] Body is required");return}const{query:a="",page:o=1,count:i,sort:l="",facets:c=[],type:d,hideUnavailableItems:u=!0,locale:p=""}=e,y=new URLSearchParams({page:o.toString(),count:(i==null?void 0:i.toString())??(r==null?void 0:r.ITEMS_PER_PAGE)??24,query:a,sort:l,locale:p});u!==void 0&&y.append("hideUnavailableItems",u.toString());const g=c.map(m=>`${m.key}/${m.value}`).join("/")??"";return Re(`${t}/api/io/_v/api/intelligent-search/${d}/${g}?${y.toString()}`,{headers:{Accept:"application/json","content-type":"application/json"},...n})};async function Nt({body:t,extraData:e,...n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const r=await ee({body:{...t,type:"product_search"},extraData:e,...n}),a=(r==null?void 0:r.products.map(l=>{const c=Q(l.items);return c&&V(c,l)}).filter(l=>!!l))??[],{pagination:o,recordsFiltered:i}=r;return{data:{pagination:{nextPage:o.after.length>0,previousPage:o.before.length>0,startCursor:"0",endCursor:i.toString(),count:i,total:o.count},products:a.map((l,c)=>({node:qt(l),cursor:c.toString()}))}}}async function wt({body:t,extraData:e,...n}){if(!t){console.error("[ERROR FETCHING] Body is required");return}const r=await ee({body:{...t,type:"facets"},extraData:e,...n});return!r||!r.facets?(console.error("[ERROR FETCHING] No facets found"),{data:{facets:[]}}):{data:{...r,facets:I.formattedFacets(r,t==null?void 0:t.selectedFacets,(t==null?void 0:t.query)??"")}}}const At=s.object({query:s.string().optional(),locale:s.string().optional()});async function kt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await At.validate(e);const{query:r="",locale:a="default_locale"}=e,o=new URLSearchParams({query:r,locale:a});return b(`${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,{...n})}async function Dt({apiUrl:t}){return b(`${t}/api/io/_v/api/intelligent-search/top_searches`)}const _t=Object.freeze(Object.defineProperty({__proto__:null,getSearchAutoCompleteSuggestions:ht,getSearchCrossellingProducts:jt,getSearchFacets:wt,getSearchProducts:Nt,getSearchSuggestedTerms:kt,getSearchTopSearchs:Dt},Symbol.toStringTag,{value:"Module"})),Ht=s.object({masterDataEntity:s.string().nonNullable(),payload:s.object().shape({}).nullable()});async function Bt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await Ht.validate(e);const{masterDataEntity:r,payload:a}=e,o=`${t}/api/dataentities/${r}/documents`;return b(o,{method:"POST",body:{payload:a},...n})}const Lt=s.object().shape({_where:s.string().optional(),_fields:s.string().optional(),_sort:s.string().optional(),_from:s.number().integer().min(0).optional(),_to:s.number().integer().min(0).optional(),_keyword:s.string().optional()}),Gt=s.object({masterDataEntity:s.string().required(),searchFields:Lt,headers:s.object().shape({"REST-Range":s.string().notRequired()})});async function Mt({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}const r=new URLSearchParams;await Gt.validate(e);const{masterDataEntity:a,searchFields:o,headers:i}=e;o&&Object.entries(o).forEach(([c,d])=>{r.append(c,String(d))}),"_fields"in o||r==null||r.append("_fields","_all");const l=`${t}/api/dataentities/${a}/search?${r.toString()}`;return b(l,{headers:{"REST-Range":i["REST-Range"]??"resources=0-20"},method:"GET",...n})}const xt=s.object({dataEntityName:s.string().required(),id:s.string().required(),fieldsToBeUpdated:s.object().shape({})});async function Ut({apiUrl:t,body:e,fetchOptions:n}){if(!e){console.error("[ERROR FETCHING] Body is required");return}await xt.validate(e);const{dataEntityName:r,id:a,fieldsToBeUpdated:o}=e,i=`${t}/api/dataentities/${r}/documents/${a}`;return b(i,{body:{fieldsToBeUpdated:o},method:"PATCH",...n})}const Vt=Object.freeze(Object.defineProperty({__proto__:null,getSearchMasterdata:Mt,patchUpdateMasterdata:Ut,postMasterdata:Bt},Symbol.toStringTag,{value:"Module"}));async function zt({body:t,apiUrl:e,extraData:n,fetchOptions:r}){const{productIds:a}=t;if(!a)return console.error("[ERROR FETCHING] productIds is required"),[];const{NAME_SPLIT_SYMBOL:o}=n;if(!o)return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"),[];const i=a.map(u=>typeof u=="string"||typeof u=="number"?`productId:${u}`:"").join("&fq="),l=await b(`${e}/api/catalog_system/pub/products/search?fq=${i}`,{...r}),c=u=>Object.keys(u).map(p=>({id:p,name:u[p]}));return l.map((u,p)=>{var F;const{installments:y,price:g,listPrice:m,sizes:R,allSizesAvailable:O}=I.getSkuInfos({items:u.items,NAME_SPLIT_SYMBOL:o}),T=O?!0:R.some(h=>h.available),E=u.items[0].sellers[0].commertialOffer;return{node:{sku:u.items[0].itemId,gtin:u.productReference,name:u.productName,description:u.description,releaseDate:u.releaseDate,slug:u.linkText,categories:u.categories,categoriesIds:u.categoriesIds,id:u.items[0].itemId,brand:{name:u.brand,brandName:u.brand},seo:{description:u.description,title:u.productName,canonical:`/${u.linkText}/p`},cluster:{generals:c(u.productClusters),highlights:c(u.clusterHighlights)},availability:{status:T},image:u.items[0].images.map(({imageLabel:h,imageUrl:v})=>({alternateName:h,url:v,keywords:h})),offers:{lowPrice:g,highPrice:m,offers:[{availability:T,listPrice:m,price:g,priceValidUntil:E.PriceValidUntil,priceCurrency:"BRL",installments:E.Installments,lowPrice:g,quantity:E.AvailableQuantity,seller:{identifier:u.items[0].sellers[0].sellerId}}]},additionalProperty:(F=u==null?void 0:u.skuSpecifications)==null?void 0:F.map(h=>({name:u==null?void 0:u.skuSpecifications[0].field.name,value:h,valueReference:"SPECIFICATION"})),isVariantOf:{productGroupID:u.productId,hasVariant:u.items.map(h=>{var v;return{additionalProperty:h==null?void 0:h.variations.map(()=>{var C,q,S;return{name:(C=h==null?void 0:h.variations)==null?void 0:C[0],value:(S=h==null?void 0:h[(q=h==null?void 0:h.variations)==null?void 0:q[0]])==null?void 0:S[0],valueReference:"SPECIFICATION"}}),name:h.name,offers:{offers:(v=h.sellers)==null?void 0:v.map(({commertialOffer:C,sellerId:q})=>({availability:"https://schema.org/InStock",listPrice:C.ListPrice,price:C.Price,quantity:C.AvailableQuantity,seller:{identifier:q}}))},sku:h.itemId,slug:`-${h.itemId}`}})},installments:y},cursor:p.toString()}})}const Qt=Object.freeze(Object.defineProperty({__proto__:null,getWishlistProducts:zt},Symbol.toStringTag,{value:"Module"})),Kt=(t="")=>t.charAt(0).toUpperCase()+t.slice(1),L=(t,e=" ")=>!t||typeof t=="string"&&t.length===0?t:(Array.isArray(t)?t:t.split("-")).map(Kt).join(e),Jt=({canonical:t,seo:e,slug:n})=>{const r=Array.isArray(n)?n.join(", "):n;return{id:0,Title:`${Array.isArray(n)?n.map(o=>L(o)).join(","):L(n)} - ${e.title}`,MetaTagDescription:e.description,name:r,hasChildren:!1,url:t,children:[]}},Yt=({canonical:t,category:e,previousImages:n,seo:r})=>({category:String(e==null?void 0:e.id),title:(e==null?void 0:e.Title)??r.title,description:(e==null?void 0:e.MetaTagDescription)??r.description,alternates:{canonical:t},openGraph:{type:"website",title:(e==null?void 0:e.Title)??r.title,description:(e==null?void 0:e.MetaTagDescription)??r.description,images:Array.isArray(n)?[...n]:[]}}),Wt=({items:t,parent:e,apiUrl:n,find:r})=>{const a=t.find(i=>i.url.replace(n,"")===decodeURIComponent(e.toLowerCase()));return(a==null?void 0:a.children.find(i=>i.name.toLowerCase()===decodeURIComponent(String(r))))??a},Xt=t=>{t instanceof Error?(console.error(`[ERROR CATEGORY INFO]: ${t.message}`),console.error(t.stack)):console.error("[ERROR CATEGORY INFO]: Unknown error",t)},Zt=new Set(["brand","category","department","subcategory","collection","cluster"]),er=t=>typeof(t==null?void 0:t.pageType)=="string"&&Zt.has(t==null?void 0:t.pageType.toLowerCase()),tr=t=>({collection:t.Coleção,categoryId:t.categoryId,current_collection:t["Coleção Atual"],items:t.items}),te=(t,e)=>t.reduce((n,r)=>{if(r.items.filter(i=>i.sellers.find(l=>l.commertialOffer.IsAvailable)).length===0||(n==null?void 0:n.find(i=>(i==null?void 0:i.productId)===(r==null?void 0:r.productId)))!==void 0)return n;const o=r.items[0].images.find(i=>e.includes(i.imageLabel));return n.push({slug:`/${r.linkText}/p`,productId:r==null?void 0:r.productId,textureImage:(o==null?void 0:o.imageUrl)??"",textureAlt:(o==null?void 0:o.imageText)??""}),n},[]),rr=Object.freeze(Object.defineProperty({__proto__:null,createEmptySeoCategory:Jt,createSeoCategory:Yt,findCategory:Wt,formattedSimilars:te,isCollectionPageType:er,notFindCategoryError:Xt,responseAdapter:tr},Symbol.toStringTag,{value:"Module"})),nr={parseSearchState:I.parseSearchState,convertSearchParams:I.convertSearchParams,filterNonRootFacets:I.filterNonRootFacets,filterNonCategorySelected:I.filterNonCategorySelected},sr=async({children:t,apiUrl:e,productId:n,ClientItems:r,PDP_INFO:a,TEXTURE_IMAGE:o,TOGGLE_STYLE_MODIFIER:i})=>{const l=await fetch(`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`).then(d=>d.json()),c=te(l,o);return f.jsxs("div",{className:I.styles.similars,children:[f.jsxs("div",{className:I.styles["similars-info"],children:[f.jsx("span",{className:I.styles["sections-title"],children:a.product.color_title}),t]}),f.jsx(r,{productId:n,similars:c,TOGGLE_STYLE_MODIFIER:i})]})},or={checkout:it,catalog:gt,cms:I.cms,search:_t,masterdata:Vt,wishlist:{...Qt}},ar={catalog:rr,search:nr,product:I.productHelpers},ir={template:{pdp:{PDPSimilars:sr}}};exports.serverAPIs=or;exports.serverCMS=Ce;exports.serverComponents=ir;exports.serverHelpers=ar;
|
package/index2.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as j, Fragment as A, jsx as y } from "react/jsx-runtime";
|
|
2
|
-
import { r as D,
|
|
2
|
+
import { r as D, v as E, S as ce, w as le, x as ue, a as de, q as pe, o as me, y as fe, p as ge, m as G, z as he, e as be } from "./index-BBxYNFkz.mjs";
|
|
3
3
|
import { Utils as _, helpers as M } from "@soma-vertical-web/core-components";
|
|
4
4
|
import * as a from "yup";
|
|
5
5
|
import ye from "sanitize-html";
|
|
@@ -52,7 +52,7 @@ const Ie = ({
|
|
|
52
52
|
identifyWhoIsFirst: r = !1,
|
|
53
53
|
...s
|
|
54
54
|
}) => {
|
|
55
|
-
const { data: o } = await
|
|
55
|
+
const { data: o } = await E({
|
|
56
56
|
contentType: "common_page",
|
|
57
57
|
...s
|
|
58
58
|
});
|
|
@@ -76,16 +76,16 @@ const Ie = ({
|
|
|
76
76
|
FooterSupport: i,
|
|
77
77
|
...l
|
|
78
78
|
}) => {
|
|
79
|
-
var p, h, f, m, R,
|
|
80
|
-
const { data: c } = await
|
|
79
|
+
var p, h, f, m, R, F, S, T, O, g, C;
|
|
80
|
+
const { data: c } = await E({
|
|
81
81
|
contentType: "footer",
|
|
82
82
|
...l
|
|
83
83
|
}), d = Array.isArray(c) && ((p = c[0]) == null ? void 0 : p.type) === "footer" ? c[0] : null, u = {
|
|
84
84
|
...(h = d == null ? void 0 : d.paymentInfo) == null ? void 0 : h.paymentInfo,
|
|
85
85
|
acceptedFlags: Array.isArray(
|
|
86
86
|
(f = d == null ? void 0 : d.paymentInfo) == null ? void 0 : f.paymentInfo.acceptedFlags
|
|
87
|
-
) ? (m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo.acceptedFlags.filter((
|
|
88
|
-
(
|
|
87
|
+
) ? (m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo.acceptedFlags.filter((I) => !!t[I]).map(
|
|
88
|
+
(I) => t[I]
|
|
89
89
|
) : []
|
|
90
90
|
};
|
|
91
91
|
return d ? /* @__PURE__ */ y(
|
|
@@ -93,14 +93,14 @@ const Ie = ({
|
|
|
93
93
|
{
|
|
94
94
|
data: { ...d },
|
|
95
95
|
socialInfo: (R = d.socialMedia) == null ? void 0 : R.socialMedia,
|
|
96
|
-
socialMedias: (
|
|
96
|
+
socialMedias: (S = (F = d.socialMedia) == null ? void 0 : F.socialMedia) == null ? void 0 : S.medias,
|
|
97
97
|
payments: u,
|
|
98
98
|
adornment: {
|
|
99
|
-
...(
|
|
99
|
+
...(O = (T = d.supportInfo) == null ? void 0 : T.supportInfo) != null && O.content ? {
|
|
100
100
|
bottom: /* @__PURE__ */ y(
|
|
101
101
|
i,
|
|
102
102
|
{
|
|
103
|
-
content: (
|
|
103
|
+
content: (C = (g = d.supportInfo) == null ? void 0 : g.supportInfo) == null ? void 0 : C.content,
|
|
104
104
|
CONSTANTS: {
|
|
105
105
|
ICONS: s,
|
|
106
106
|
PAYMENT_FLAGS: e,
|
|
@@ -121,7 +121,7 @@ const Ie = ({
|
|
|
121
121
|
...n
|
|
122
122
|
}) => {
|
|
123
123
|
var o, i, l, c;
|
|
124
|
-
const { data: r } = await
|
|
124
|
+
const { data: r } = await E({
|
|
125
125
|
contentType: "header",
|
|
126
126
|
...n
|
|
127
127
|
}), s = (o = r[0]) == null ? void 0 : o.sections.map((d) => d.data);
|
|
@@ -172,7 +172,7 @@ const Ie = ({
|
|
|
172
172
|
className: n,
|
|
173
173
|
...r
|
|
174
174
|
}) => {
|
|
175
|
-
const { data: s } = await
|
|
175
|
+
const { data: s } = await E({
|
|
176
176
|
contentType: "helpbutton",
|
|
177
177
|
...r
|
|
178
178
|
});
|
|
@@ -195,7 +195,7 @@ const Ie = ({
|
|
|
195
195
|
PDPContentProvider: s,
|
|
196
196
|
...o
|
|
197
197
|
}) => {
|
|
198
|
-
const { data: i } = await
|
|
198
|
+
const { data: i } = await E({
|
|
199
199
|
contentType: "product_page",
|
|
200
200
|
...o
|
|
201
201
|
});
|
|
@@ -219,7 +219,7 @@ const Ie = ({
|
|
|
219
219
|
PLPContentProvider: s,
|
|
220
220
|
...o
|
|
221
221
|
}) => {
|
|
222
|
-
const { data: i } = await
|
|
222
|
+
const { data: i } = await E({
|
|
223
223
|
contentType: "categories_page",
|
|
224
224
|
...o
|
|
225
225
|
}), l = i.find(
|
|
@@ -279,7 +279,7 @@ const Ie = ({
|
|
|
279
279
|
] });
|
|
280
280
|
}, $e = async ({ slug: t, ...e }) => {
|
|
281
281
|
var i, l, c;
|
|
282
|
-
const { data: n } = await
|
|
282
|
+
const { data: n } = await E({
|
|
283
283
|
contentType: "redirect_to_search",
|
|
284
284
|
...e
|
|
285
285
|
}), r = ((c = (l = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : l.redirectToSearch) == null ? void 0 : c.paths) ?? [];
|
|
@@ -312,7 +312,7 @@ const Ie = ({
|
|
|
312
312
|
};
|
|
313
313
|
}, qe = async ({ slug: t, ...e }) => {
|
|
314
314
|
var i, l, c;
|
|
315
|
-
const { data: n } = await
|
|
315
|
+
const { data: n } = await E({
|
|
316
316
|
contentType: "redirect_to_search",
|
|
317
317
|
...e
|
|
318
318
|
}), r = ((c = (l = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : l.redirectToSearch) == null ? void 0 : c.paths) ?? [];
|
|
@@ -335,7 +335,7 @@ const Ie = ({
|
|
|
335
335
|
className: n,
|
|
336
336
|
...r
|
|
337
337
|
}) => {
|
|
338
|
-
const { data: s } = await
|
|
338
|
+
const { data: s } = await E({
|
|
339
339
|
contentType: "search_page",
|
|
340
340
|
...r
|
|
341
341
|
});
|
|
@@ -352,7 +352,7 @@ const Ie = ({
|
|
|
352
352
|
ClientTipbarContent: t,
|
|
353
353
|
...e
|
|
354
354
|
}) => {
|
|
355
|
-
const { data: n } = await
|
|
355
|
+
const { data: n } = await E({
|
|
356
356
|
contentType: "tipbar",
|
|
357
357
|
...e
|
|
358
358
|
});
|
|
@@ -1110,7 +1110,7 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1110
1110
|
additionalProperty: B(o, e, []),
|
|
1111
1111
|
name: r,
|
|
1112
1112
|
offers: {
|
|
1113
|
-
offers: s.map(({ sellerId: i, commertialOffer: l }) => ({
|
|
1113
|
+
offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: l }) => ({
|
|
1114
1114
|
availability: Nt(l.AvailableQuantity > 0),
|
|
1115
1115
|
listPrice: l.ListPrice,
|
|
1116
1116
|
price: l.Price,
|
|
@@ -1124,7 +1124,7 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1124
1124
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1125
1125
|
};
|
|
1126
1126
|
}, Lt = (t) => {
|
|
1127
|
-
var
|
|
1127
|
+
var v;
|
|
1128
1128
|
const {
|
|
1129
1129
|
attributes: e,
|
|
1130
1130
|
referenceId: n,
|
|
@@ -1142,39 +1142,39 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1142
1142
|
description: f,
|
|
1143
1143
|
linkText: m,
|
|
1144
1144
|
productClusters: R,
|
|
1145
|
-
clusterHighlights:
|
|
1146
|
-
productName:
|
|
1147
|
-
properties:
|
|
1148
|
-
productId:
|
|
1145
|
+
clusterHighlights: F,
|
|
1146
|
+
productName: S,
|
|
1147
|
+
properties: T,
|
|
1148
|
+
productId: O,
|
|
1149
1149
|
productReference: g
|
|
1150
|
-
} = r,
|
|
1150
|
+
} = r, C = p.slice().reverse(), I = ne(l, t.isVariantOf), $ = re(I.offers[0].installments);
|
|
1151
1151
|
return {
|
|
1152
1152
|
sku: o,
|
|
1153
|
-
gtin: ((
|
|
1154
|
-
name:
|
|
1153
|
+
gtin: ((v = n == null ? void 0 : n[0]) == null ? void 0 : v.Value) ?? g ?? "",
|
|
1154
|
+
name: S ?? i,
|
|
1155
1155
|
description: f,
|
|
1156
1156
|
releaseDate: r.releaseDate ?? "",
|
|
1157
1157
|
slug: m,
|
|
1158
1158
|
video: c[0],
|
|
1159
1159
|
categories: p,
|
|
1160
1160
|
categoriesIds: h,
|
|
1161
|
-
id:
|
|
1161
|
+
id: O,
|
|
1162
1162
|
brand: { name: u, brandName: u },
|
|
1163
1163
|
seo: {
|
|
1164
1164
|
description: f,
|
|
1165
|
-
title:
|
|
1165
|
+
title: S,
|
|
1166
1166
|
canonical: te(m)
|
|
1167
1167
|
},
|
|
1168
1168
|
cluster: {
|
|
1169
1169
|
generals: R,
|
|
1170
|
-
highlights:
|
|
1170
|
+
highlights: F
|
|
1171
1171
|
},
|
|
1172
|
-
properties:
|
|
1173
|
-
availability: { status:
|
|
1172
|
+
properties: T,
|
|
1173
|
+
availability: { status: I.offers[0].availability },
|
|
1174
1174
|
breadcrumbList: {
|
|
1175
1175
|
itemListElement: [
|
|
1176
|
-
...
|
|
1177
|
-
const
|
|
1176
|
+
...C.map((P, w) => {
|
|
1177
|
+
const q = P.split("/"), L = q[q.length - 2], ie = q.map(ee).join("/");
|
|
1178
1178
|
return {
|
|
1179
1179
|
name: L,
|
|
1180
1180
|
item: ie,
|
|
@@ -1190,16 +1190,16 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1190
1190
|
numberOfItems: p.length
|
|
1191
1191
|
},
|
|
1192
1192
|
image: Z(s),
|
|
1193
|
-
offers:
|
|
1193
|
+
offers: I,
|
|
1194
1194
|
additionalProperty: B(d, e, []),
|
|
1195
1195
|
isVariantOf: {
|
|
1196
1196
|
productGroupID: r.productId,
|
|
1197
1197
|
hasVariant: r.items.map((P) => ae(P))
|
|
1198
1198
|
},
|
|
1199
|
-
installments:
|
|
1199
|
+
installments: $
|
|
1200
1200
|
};
|
|
1201
1201
|
}, Gt = (t) => {
|
|
1202
|
-
var
|
|
1202
|
+
var $;
|
|
1203
1203
|
const {
|
|
1204
1204
|
attributes: e,
|
|
1205
1205
|
referenceId: n,
|
|
@@ -1217,28 +1217,28 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1217
1217
|
description: f,
|
|
1218
1218
|
linkText: m,
|
|
1219
1219
|
productClusters: R,
|
|
1220
|
-
productName:
|
|
1221
|
-
Coleção:
|
|
1222
|
-
"ID Coleção":
|
|
1223
|
-
productId:
|
|
1224
|
-
} = r, g = p.slice().reverse(),
|
|
1220
|
+
productName: F,
|
|
1221
|
+
Coleção: S,
|
|
1222
|
+
"ID Coleção": T,
|
|
1223
|
+
productId: O
|
|
1224
|
+
} = r, g = p.slice().reverse(), C = ne(l, t.isVariantOf), I = re(C.offers[0].installments);
|
|
1225
1225
|
return {
|
|
1226
1226
|
sku: o,
|
|
1227
|
-
gtin: ((
|
|
1228
|
-
name:
|
|
1227
|
+
gtin: (($ = n[0]) == null ? void 0 : $.Value) ?? "",
|
|
1228
|
+
name: F ?? i,
|
|
1229
1229
|
description: f,
|
|
1230
1230
|
releaseDate: r.releaseDate ?? "",
|
|
1231
1231
|
slug: m,
|
|
1232
1232
|
video: c[0],
|
|
1233
1233
|
categories: p,
|
|
1234
1234
|
categoriesIds: h,
|
|
1235
|
-
collection:
|
|
1236
|
-
collectionId:
|
|
1237
|
-
id:
|
|
1235
|
+
collection: S,
|
|
1236
|
+
collectionId: T,
|
|
1237
|
+
id: O,
|
|
1238
1238
|
brand: { name: u, brandName: u },
|
|
1239
1239
|
seo: {
|
|
1240
1240
|
description: f,
|
|
1241
|
-
title:
|
|
1241
|
+
title: F,
|
|
1242
1242
|
canonical: te(m)
|
|
1243
1243
|
},
|
|
1244
1244
|
cluster: {
|
|
@@ -1246,13 +1246,13 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1246
1246
|
highlights: []
|
|
1247
1247
|
// TODO: add highlights
|
|
1248
1248
|
},
|
|
1249
|
-
availability: { status:
|
|
1249
|
+
availability: { status: C.offers[0].availability },
|
|
1250
1250
|
breadcrumbList: {
|
|
1251
1251
|
itemListElement: [
|
|
1252
|
-
...g.map((
|
|
1253
|
-
const w =
|
|
1252
|
+
...g.map((v, P) => {
|
|
1253
|
+
const w = v.split("/"), q = w[w.length - 2], L = w.map(ee).join("/");
|
|
1254
1254
|
return {
|
|
1255
|
-
name:
|
|
1255
|
+
name: q,
|
|
1256
1256
|
item: L,
|
|
1257
1257
|
position: P + 1
|
|
1258
1258
|
};
|
|
@@ -1266,17 +1266,17 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1266
1266
|
numberOfItems: p.length
|
|
1267
1267
|
},
|
|
1268
1268
|
image: Z(s),
|
|
1269
|
-
offers:
|
|
1269
|
+
offers: C,
|
|
1270
1270
|
additionalProperty: B(d, e, []),
|
|
1271
1271
|
isVariantOf: {
|
|
1272
1272
|
productGroupID: r.productId,
|
|
1273
|
-
hasVariant: r.items.map((
|
|
1274
|
-
const { variations: P } =
|
|
1275
|
-
name:
|
|
1276
|
-
values:
|
|
1273
|
+
hasVariant: r.items.map((v) => {
|
|
1274
|
+
const { variations: P } = v, w = P.map((q) => ({
|
|
1275
|
+
name: q,
|
|
1276
|
+
values: v[q]
|
|
1277
1277
|
}));
|
|
1278
1278
|
return {
|
|
1279
|
-
...ae(
|
|
1279
|
+
...ae(v),
|
|
1280
1280
|
additionalProperty: B(
|
|
1281
1281
|
w,
|
|
1282
1282
|
e,
|
|
@@ -1285,7 +1285,7 @@ const qt = (t, e) => ye(t, e), Pt = (t) => ({
|
|
|
1285
1285
|
};
|
|
1286
1286
|
})
|
|
1287
1287
|
},
|
|
1288
|
-
installments:
|
|
1288
|
+
installments: I
|
|
1289
1289
|
};
|
|
1290
1290
|
}, Mt = a.array().of(a.object({
|
|
1291
1291
|
key: a.string().required(),
|
|
@@ -1539,8 +1539,8 @@ async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1539
1539
|
}
|
|
1540
1540
|
), c = (u) => Object.keys(u).map((p) => ({ id: p, name: u[p] }));
|
|
1541
1541
|
return l.map((u, p) => {
|
|
1542
|
-
var
|
|
1543
|
-
const { installments: h, price: f, listPrice: m, sizes: R, allSizesAvailable:
|
|
1542
|
+
var O;
|
|
1543
|
+
const { installments: h, price: f, listPrice: m, sizes: R, allSizesAvailable: F } = de({ items: u.items, NAME_SPLIT_SYMBOL: o }), S = F ? !0 : R.some((g) => g.available), T = u.items[0].sellers[0].commertialOffer;
|
|
1544
1544
|
return {
|
|
1545
1545
|
node: {
|
|
1546
1546
|
sku: u.items[0].itemId,
|
|
@@ -1566,15 +1566,15 @@ async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1566
1566
|
highlights: c(u.clusterHighlights)
|
|
1567
1567
|
},
|
|
1568
1568
|
availability: {
|
|
1569
|
-
status:
|
|
1569
|
+
status: S
|
|
1570
1570
|
},
|
|
1571
1571
|
image: u.items[0].images.map(
|
|
1572
1572
|
({
|
|
1573
1573
|
imageLabel: g,
|
|
1574
|
-
imageUrl:
|
|
1574
|
+
imageUrl: C
|
|
1575
1575
|
}) => ({
|
|
1576
1576
|
alternateName: g,
|
|
1577
|
-
url:
|
|
1577
|
+
url: C,
|
|
1578
1578
|
keywords: g
|
|
1579
1579
|
})
|
|
1580
1580
|
),
|
|
@@ -1583,53 +1583,56 @@ async function ar({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1583
1583
|
highPrice: m,
|
|
1584
1584
|
offers: [
|
|
1585
1585
|
{
|
|
1586
|
-
availability:
|
|
1586
|
+
availability: S,
|
|
1587
1587
|
listPrice: m,
|
|
1588
1588
|
price: f,
|
|
1589
|
-
priceValidUntil:
|
|
1589
|
+
priceValidUntil: T.PriceValidUntil,
|
|
1590
1590
|
priceCurrency: "BRL",
|
|
1591
|
-
installments:
|
|
1591
|
+
installments: T.Installments,
|
|
1592
1592
|
lowPrice: f,
|
|
1593
|
-
quantity:
|
|
1593
|
+
quantity: T.AvailableQuantity,
|
|
1594
1594
|
seller: {
|
|
1595
1595
|
identifier: u.items[0].sellers[0].sellerId
|
|
1596
1596
|
}
|
|
1597
1597
|
}
|
|
1598
1598
|
]
|
|
1599
1599
|
},
|
|
1600
|
-
additionalProperty: (
|
|
1600
|
+
additionalProperty: (O = u == null ? void 0 : u.skuSpecifications) == null ? void 0 : O.map((g) => ({
|
|
1601
1601
|
name: u == null ? void 0 : u.skuSpecifications[0].field.name,
|
|
1602
1602
|
value: g,
|
|
1603
1603
|
valueReference: "SPECIFICATION"
|
|
1604
1604
|
})),
|
|
1605
1605
|
isVariantOf: {
|
|
1606
1606
|
productGroupID: u.productId,
|
|
1607
|
-
hasVariant: u.items.map((g) =>
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1607
|
+
hasVariant: u.items.map((g) => {
|
|
1608
|
+
var C;
|
|
1609
|
+
return {
|
|
1610
|
+
additionalProperty: g == null ? void 0 : g.variations.map(() => {
|
|
1611
|
+
var I, $, v;
|
|
1612
|
+
return {
|
|
1613
|
+
name: (I = g == null ? void 0 : g.variations) == null ? void 0 : I[0],
|
|
1614
|
+
value: (v = g == null ? void 0 : g[($ = g == null ? void 0 : g.variations) == null ? void 0 : $[0]]) == null ? void 0 : v[0],
|
|
1615
|
+
valueReference: "SPECIFICATION"
|
|
1616
|
+
};
|
|
1617
|
+
}),
|
|
1618
|
+
name: g.name,
|
|
1619
|
+
offers: {
|
|
1620
|
+
offers: (C = g.sellers) == null ? void 0 : C.map(
|
|
1621
|
+
({ commertialOffer: I, sellerId: $ }) => ({
|
|
1622
|
+
availability: "https://schema.org/InStock",
|
|
1623
|
+
listPrice: I.ListPrice,
|
|
1624
|
+
price: I.Price,
|
|
1625
|
+
quantity: I.AvailableQuantity,
|
|
1626
|
+
seller: {
|
|
1627
|
+
identifier: $
|
|
1628
|
+
}
|
|
1629
|
+
})
|
|
1630
|
+
)
|
|
1631
|
+
},
|
|
1632
|
+
sku: g.itemId,
|
|
1633
|
+
slug: `-${g.itemId}`
|
|
1634
|
+
};
|
|
1635
|
+
})
|
|
1633
1636
|
},
|
|
1634
1637
|
installments: h
|
|
1635
1638
|
},
|