(window.webpackJsonpvtex_product_summary_2_90_2=window.webpackJsonpvtex_product_summary_2_90_2||[]).push([["ProductSummaryImage"],{0:function(e,t){e.exports=React},108:function(e,t,r){"use strict";r.r(t);var a=r(10),i=r(0),n=r.n(i),o=r(40),u=r.n(o),c=r(41),l=r.n(c),m=r(7),d=r.n(m),s=r(53),p=r.n(s),v=r(63),g=r.n(v),h=r(5),f=r.n(h),x=r(38),y=r.n(x),b=r(6),C=r.n(b),E=r(42),I=r(3),_=r.n(I),w=r(22),S=function(e,t,r,i){var n,o=t,u="auto";return i&&"auto"!==i?(u=t*(null!==(n=function(e){if(!e)return null;if("string"==typeof e){if("auto"===e)return null;var t=e.split(":");if(2!==t.length)return null;var r=Object(a.a)(t,2),i=r[0],n=r[1],o=parseFloat(n)/parseFloat(i);return"number"!=typeof o||Number.isNaN(o)?null:o}return"number"==typeof e?e:null}(i))&&void 0!==n?n:1),o>r&&(u/=o/r,o=r),u>r&&(o/=u/r,u=r),o=Math.round(o),u=Math.round(u)):o=Math.min(r,o),Object(w.a)(e,o,u)},P=C.a.useProductSummary,N=["image","imageWrapper","imageContainer","product","imagePlaceholder","mainImageHovered"];function O(e){var t=e.src,r=e.width,a=e.height,i=e.dpi,n=e.aspectRatio;return r||a?Object(w.a)(t,r*i,a*i):n?S(t,300,500,n):t}function R(e){var t=e.images,r=e.hoverImage,a=e.hoverImageLabel,i=null!=r?r:{},n=i.criteria,o=void 0===n?"label":n,u=i.label,c=void 0===u?a:u,l=i.labelMatchCriteria,m=void 0===l?"exact":l,d=i.index;return"label"===o?H(t,c,m):"index"===o?function(e,t){return null==t||Number.isNaN(t)?null:e[t]}(t,d):null}function L(e){var t=e.width,r=e.height,a=e.aspectRatio,i=e.maxHeight;return t||r?{width:"100%",height:r,objectFit:"contain",maxHeight:"unset",maxWidth:t}:a||i?{width:"100%",height:"100%",objectFit:"contain",maxHeight:null!=i?i:"unset"}:void 0}function B(e){var t=e.showCollections,r=e.productClusters,a=e.children;if(!t||!r||0===r.length)return n.a.createElement(n.a.Fragment,null,a);var i=r.map((function(e){return e.name}));return n.a.createElement(u.a,{collectionBadgesText:i},a)}function M(e){var t=e.showBadge,r=e.commertialOffer,a=e.badgeText,i=e.children;return t?n.a.createElement(l.a,{listPrice:r.ListPrice,sellingPrice:r.Price,label:a},i):n.a.createElement(n.a.Fragment,null,i)}function H(e,t,r){return t?"contains"===r?e.find((function(e){var r=e.imageLabel;return null==r?void 0:r.includes(t)})):e.find((function(e){return e.imageLabel===t})):null}function j(e){var t=e.src,r=e.width,a=e.height,i=e.onError,o=e.alt,u=e.className,c=e.aspectRatio,l=e.maxHeight,m=e.fetchpriority,d=void 0===m?"auto":m,s=p()().isMobile?2:1;return n.a.createElement("img",{src:O({src:t,width:r,height:a,dpi:s,aspectRatio:c}),style:L({width:r,height:a,aspectRatio:c,maxHeight:l}),loading:"low"===d?"lazy":"eager",alt:o,className:u,onError:i,fetchpriority:d})}function k(e){var t,r,o,u,c,l,m,s,v,h=e.showBadge,x=void 0===h||h,b=e.badgeText,C=e.displayMode,I=void 0===C?"normal":C,w=e.mainImageLabel,S=void 0===w?"":w,O=e.hoverImageLabel,L=void 0===O?"":O,k=e.hoverImage,T=e.showCollections,A=void 0!==T&&T,F=e.placeholder,U=e.width,D=e.height,W=e.aspectRatio,V=e.maxHeight,K=e.classes,q=e.fetchpriority,z=void 0===q?"byPosition":q,J=P(),Z=J.product,Q=J.position,G=f()(N,{classes:K}),X=G.handles,Y=G.withModifiers,$=Object(i.useState)(!1),ee=Object(a.a)($,2),te=ee[0],re=ee[1],ae=function(){return re(!0)},ie=p()().isMobile,ne=(null!==(t=y()())&&void 0!==t?t:{}).skuSelector,oe=(ne=void 0===ne?{}:ne).selectedImageVariationSKU,ue=null!=Z?Z:{},ce=ue.productClusters,le=ue.productName,me=null==Z?void 0:Z.sku,de=g()({widthProp:U,heightProp:D,aspectRatioProp:W,maxHeightProp:V}),se=de.widthProp,pe=de.heightProp,ve=de.aspectRatioProp,ge=de.maxHeightProp,he=d()(_.a.imageContainer,X.imageWrapper,"inline"!==I&&"db w-100 center"),fe=[parseFloat(null!==(r=null!=se?se:pe)&&void 0!==r?r:0),parseFloat(null!==(o=null!=pe?pe:se)&&void 0!==o?o:0)],xe=fe[0],ye=fe[1],be=d()(_.a.imageStackContainer,!ie&&_.a.hoverEffect),Ce=d()("dib relative",X.imageContainer,be),Ee=null!==(c=null===(u=null==me?void 0:me.image)||void 0===u?void 0:u.imageUrl)&&void 0!==c?c:"",Ie=!Ee||te;if(!F&&Ie)return n.a.createElement("div",{className:he},n.a.createElement("div",{className:Ce},n.a.createElement(E.a,{cssHandle:X.imagePlaceholder})));var _e=null!==(l=null==me?void 0:me.images)&&void 0!==l?l:[],we=R({images:_e,hoverImage:k,hoverImageLabel:L});if(null==oe&&S){var Se="string"==typeof S?H(_e,S):H(_e,S.label,S.labelMatchCriteria);Se&&(Ee=Se.imageUrl)}var Pe,Ne,Oe=d()("inline"===I?_.a.imageInline:_.a.imageNormal),Re=null!==(v=null===(s=null===(m=Z.sku)||void 0===m?void 0:m.seller)||void 0===s?void 0:s.commertialOffer)&&void 0!==v?v:{},Le=d()(Oe,X.image,Boolean(we)&&X.mainImageHovered),Be=d()("w-100 h-100 dn absolute top-0 left-0 z-999",Y("image","hover"),Oe,!ie&&_.a.hoverImage);return n.a.createElement("div",{className:he},n.a.createElement(B,{showCollections:A,productClusters:ce},n.a.createElement(M,{showBadge:x,commertialOffer:Re,badgeText:b},n.a.createElement("div",{className:Ce},n.a.createElement(j,{src:Ie?F:Ee,width:xe,height:ye,aspectRatio:ve,maxHeight:ge,alt:le,className:Le,onError:ae,fetchpriority:"byPosition"===z?(Pe=ie,Ne=Q,Ne?Pe?1===Ne?"high":"low":Ne<4?"high":"low":"low"):z}),we&&!ie&&n.a.createElement(j,{src:we.imageUrl,width:xe,height:ye,aspectRatio:ve,maxHeight:ge,alt:le,className:Be,onError:ae})))))}k.schema={title:"admin/editor.productSummaryImage.title",description:"admin/editor.productSummaryImage.description",type:"object",properties:{showBadge:{type:"boolean",title:"admin/editor.productSummary.showBadge.title",default:!0,isLayout:!0},showCollections:{type:"boolean",title:"admin/editor.productSummary.showCollections.title",default:!1,isLayout:!0},displayMode:{title:"admin/editor.productSummary.displayMode.title",type:"string",enum:["normal","inline"],default:"normal",isLayout:!0},hoverImageLabel:{title:"admin/editor.productSummaryImage.hoverImageLabel.title",description:"admin/editor.productSummaryImage.hoverImageLabel.description",type:"string",default:"",isLayout:!1},hoverImage:{type:"object",properties:{criteria:{title:"admin/editor.productSummaryImage.hoverImage.criteria.title",enum:["index","label"]}},dependencies:{criteria:{oneOf:[{properties:{criteria:{enum:["index"]},index:{title:"admin/editor.productSummaryImage.hoverImage.criteria.index",type:"number"}}},{properties:{criteria:{enum:["label"]},label:{title:"admin/editor.productSummaryImage.hoverImage.criteria.label",type:"string"},labelMatchCriteria:{title:"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria",widget:{"ui:widget":"radio"},type:"string",enum:["exact","contains"],default:"exact"}}}]}}},fetchpriority:{title:"admin/editor.productSummaryImage.fetchpriority.title",enum:["high","low","auto","byPosition"],enumNames:["admin/editor.productSummaryImage.fetchpriority.high","admin/editor.productSummaryImage.fetchpriority.low","admin/editor.productSummaryImage.fetchpriority.auto","admin/editor.productSummaryImage.fetchpriority.byPosition"],widget:{"ui:widget":"radio"},default:"byPosition"}}};t.default=k},19:function(e,t,r){"use strict";function a(e){if(e&&0!==e.length){var t=e.find((function(e){return e.sellerDefault}));return t||e[0]}}r.d(t,"a",(function(){return a}))},22:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return C}));var a=r(10),i=r(37),n=r(19),o=new RegExp(/.+ids\/(\d+)/),u=new RegExp(/http:\/\//);function c(e,t,r){if(!e.includes("/arquivos/ids/"))return e;var a=function(e){var t,r,a,i,n=o.exec(e),u=(r="v",null===(i=null!==(a=null==(t=e)?void 0:t.split("".concat(r,"="))[1])&&void 0!==a?a:"")||void 0===i?void 0:i.split("&")[0]);return n&&n.length>0?{cleanUrl:n[0],vParam:u}:{cleanUrl:e}}(e),i=a.vParam,n=a.cleanUrl;return i?"".concat(n,"-").concat(t,"-").concat(r,"?v=").concat(i):"".concat(n,"-").concat(t,"-").concat(r)}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"auto";if(e){"number"==typeof t&&(t=Math.min(t,3e3)),"number"==typeof r&&(r=Math.min(r,4e3));var a=c(e,t,r),i=a.includes("?")?"&":"?";return"".concat(a).concat(i,"width=").concat(t,"&height=").concat(r,"&aspect=true")}}function m(e){return e.commertialOffer.Price}function d(e){var t=e.commertialOffer.AvailableQuantity;return null!=t&&t>0}function s(e,t){var r=e.filter(v);if(0===r.length)return e[0];if(1===r.length)return r[0];var a=r.map((function(e){return function(e,t){var r=e.sellers;if(1===r.length)return r[0].commertialOffer.Price;var a=r.filter(d).map(m);return"highest"===t?a.reduce((function(e,t){return t>e?t:e})):a.reduce((function(e,t){return ta[e]?r:e}),0):a.reduce((function(e,t,r){return t1&&void 0!==arguments[1]?arguments[1]:"FIRST_AVAILABLE",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500;if(!e)return null;var l,m=Object.assign({},e),d=m.items||[],s=m.properties||[],p=null!==(t=s.find((function(e){return"DefaultSKUSelected"===e.name})))&&void 0!==t?t:null;if(l=1===d.length?d[0]:p?g(d,p.values,u):h(d,u)){var v=null!==(r=Object(n.a)(null==l?void 0:l.sellers))&&void 0!==r?r:y,C=null!==(i=null==l?void 0:l.referenceId)&&void 0!==i?i:[],E=Object(a.a)(C,1),I=E[0],_=void 0===I?x:I,w=null!==(o=null==l?void 0:l.images)&&void 0!==o?o:[],S=w.map((function(e){return Object.assign(Object.assign({},e),{imageUrl:b(e.imageUrl,c)})})),P=Object(a.a)(S,1),N=P[0],O=void 0===N?f:N;m.sku=Object.assign(Object.assign({},l),{seller:v,referenceId:_,image:O,images:S})}return m}},3:function(e,t,r){e.exports={containerInline:"vtex-product-summary-2-x-containerInline",imageContainer:"vtex-product-summary-2-x-imageContainer",container:"vtex-product-summary-2-x-container",containerSmall:"vtex-product-summary-2-x-containerSmall",containerInlinePrice:"vtex-product-summary-2-x-containerInlinePrice",information:"vtex-product-summary-2-x-information",element:"vtex-product-summary-2-x-element",image:"vtex-product-summary-2-x-image",buyButtonContainer:"vtex-product-summary-2-x-buyButtonContainer",buyButton:"vtex-product-summary-2-x-buyButton",description:"vtex-product-summary-2-x-description",quantityStepperContainer:"vtex-product-summary-2-x-quantityStepperContainer",imageInline:"vtex-product-summary-2-x-imageInline",isHidden:"vtex-product-summary-2-x-isHidden",containerNormal:"vtex-product-summary-2-x-containerNormal",nameContainer:"vtex-product-summary-2-x-nameContainer",clearLink:"vtex-product-summary-2-x-clearLink",aspectRatio:"vtex-product-summary-2-x-aspectRatio",priceContainer:"vtex-product-summary-2-x-priceContainer",SKUSelectorContainer:"vtex-product-summary-2-x-SKUSelectorContainer",attachmentListContainer:"vtex-product-summary-2-x-attachmentListContainer",attachmentItemContainer:"vtex-product-summary-2-x-attachmentItemContainer",imageNormal:"vtex-product-summary-2-x-imageNormal",addToListBtn:"vtex-product-summary-2-x-addToListBtn",imagePlaceholder:"vtex-product-summary-2-x-imagePlaceholder",attachmentChildrenContainer:"vtex-product-summary-2-x-attachmentChildrenContainer",imageStackContainer:"vtex-product-summary-2-x-imageStackContainer",hoverEffect:"vtex-product-summary-2-x-hoverEffect",hoverImage:"vtex-product-summary-2-x-hoverImage",mainImageHovered:"vtex-product-summary-2-x-mainImageHovered",priceSpinner:"vtex-product-summary-2-x-priceSpinner",spin:"vtex-product-summary-2-x-spin",sponsoredBadgeContainer:"vtex-product-summary-2-x-sponsoredBadgeContainer",sponsoredBadgeText:"vtex-product-summary-2-x-sponsoredBadgeText"}},38:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},40:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/CollectionBadges"]},41:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-components@3.x/DiscountBadge"]},42:function(e,t,r){"use strict";var a=r(0),i=r.n(a);t.a=function(e){var t=e.cssHandle;return i.a.createElement("div",{className:"relative"},i.a.createElement("div",{className:"".concat(t," absolute w-100 h-100 contain bg-center")}),i.a.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-testid":"image-placeholder"},i.a.createElement("rect",{width:"512",height:"512",fill:"#F2F2F2"}),i.a.createElement("rect",{x:"183.857",y:"180.2",width:"144.286",height:"150.474",stroke:"#CACBCC",strokeWidth:"2"}),i.a.createElement("path",{d:"M183.78 303.688H328.214",stroke:"#CACBCC",strokeWidth:"2"}),i.a.createElement("path",{d:"M205.082 279.563L223.599 240.507L242.116 260.035L269.892 220.979L306.926 279.563H205.082Z",stroke:"#CACBCC",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i.a.createElement("path",{d:"M252.225 213.939C252.225 219.822 247.66 224.52 242.114 224.52C236.569 224.52 232.004 219.822 232.004 213.939C232.004 208.057 236.569 203.359 242.114 203.359C247.66 203.359 252.225 208.057 252.225 213.939Z",stroke:"#CACBCC",strokeWidth:"2"})))}},5:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},53:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/useDevice"]},6:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-summary-context@0.x/ProductSummaryContext"]},63:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.responsive-values@0.x/useResponsiveValues"]},7:function(e,t){e.exports=Classnames},88:function(e,t,r){"use strict";r.r(t),function(e){var t=r(4);r.p=Object(t.getPublicPath)("vtex.product-summary@2.90.2");var a=Object(t.register)((function(){return r(108)}),e,"vtex.product-summary@2.90.2","vtex.product-summary@2.x","ProductSummaryImage");a.renderHotReload,a.setupHMR}.call(this,r(12)(e))}},[[88,"common"]]]);