(self.webpackChunkwebpackWcBlocksFrontendJsonp=self.webpackChunkwebpackWcBlocksFrontendJsonp||[]).push([[462],{8757:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Block:()=>g,default:()=>v});var o=n(1609),r=n(7723),s=n(851),l=n(2796),a=n(3249),c=n(1616),i=n(3993);n(7067);const u=e=>({width:e/5*100+"%"}),d=({parentClassName:e})=>{const t=u(0);return(0,o.createElement)("div",{className:(0,s.A)("wc-block-components-product-rating__norating-container",`${e}-product-rating__norating-container`)},(0,o.createElement)("div",{className:"wc-block-components-product-rating__norating",role:"img"},(0,o.createElement)("span",{style:t})),(0,o.createElement)("span",null,(0,r.__)("No Reviews","woocommerce")))},m=e=>{const{rating:t,reviews:n,parentClassName:l}=e,a=u(t),c=(0,r.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */
(0,r.__)("Rated %f out of 5","woocommerce"),t),i={__html:(0,r.sprintf)(/* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */ /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
(0,r._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",n,"woocommerce"),(0,r.sprintf)('<strong class="rating">%f</strong>',t),(0,r.sprintf)('<span class="rating">%d</span>',n))};return(0,o.createElement)("div",{className:(0,s.A)("wc-block-components-product-rating__stars",`${l}__product-rating__stars`),role:"img","aria-label":c},(0,o.createElement)("span",{style:a,dangerouslySetInnerHTML:i}))},p=e=>{const{reviews:t}=e,n=(0,r.sprintf)(/* translators: %s is referring to the total of reviews for a product */ /* translators: %s is referring to the total of reviews for a product */
(0,r._n)("(%s customer review)","(%s customer reviews)",t,"woocommerce"),t);return(0,o.createElement)("span",{className:"wc-block-components-product-rating__reviews_count"},n)},g=e=>{const{textAlign:t,isDescendentOfSingleProductBlock:n,shouldDisplayMockedReviewsWhenProductHasNoReviews:r}=e,c=(0,a.p)(e),{parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:g}=(0,l.useProductDataContext)(),v=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(g),f=(e=>{const t=(0,i.isNumber)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(g),y=(0,s.A)(c.className,"wc-block-components-product-rating",{[`${u}__product-rating`]:u,[`has-text-align-${t}`]:t}),b=r?(0,o.createElement)(d,{parentClassName:u}):null,_=f?(0,o.createElement)(m,{rating:v,reviews:f,parentClassName:u}):b;if(f||r)return(0,o.createElement)("div",{className:y,style:c.style},(0,o.createElement)("div",{className:"wc-block-components-product-rating__container"},_,f&&n?(0,o.createElement)(p,{reviews:f}):null))},v=(0,c.withProductDataContext)(g)},3249:(e,t,n)=>{"use strict";n.d(t,{p:()=>i});var o=n(851),r=n(3993),s=n(1194),l=n(9786);function a(e={}){const t={};return(0,l.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function c(e,t){return e&&t?`has-${(0,s.c)(t)}-${e}`:""}const i=e=>{const t=(e=>{const t=(0,r.isObject)(e)?e:{style:{}};let n=t.style;return(0,r.isString)(n)&&(n=JSON.parse(n)||{}),(0,r.isObject)(n)||(n={}),{...t,style:n}})(e),n=function(e){var t,n,s,l,i,u,d;const{backgroundColor:m,textColor:p,gradient:g,style:v}=e,f=c("background-color",m),y=c("color",p),b=function(e){if(e)return`has-${e}-gradient-background`}(g),_=b||(null==v||null===(t=v.color)||void 0===t?void 0:t.gradient);return{className:(0,o.A)(y,b,{[f]:!_&&!!f,"has-text-color":p||(null==v||null===(n=v.color)||void 0===n?void 0:n.text),"has-background":m||(null==v||null===(s=v.color)||void 0===s?void 0:s.background)||g||(null==v||null===(l=v.color)||void 0===l?void 0:l.gradient),"has-link-color":(0,r.isObject)(null==v||null===(i=v.elements)||void 0===i?void 0:i.link)?null==v||null===(u=v.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:a({color:(null==v?void 0:v.color)||{}})}}(t),s=function(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:function(e){var t;const{borderColor:n,style:r}=e,s=n?c("border-color",n):"";return(0,o.A)({"has-border-color":!!n||!(null==r||null===(t=r.border)||void 0===t||!t.color),[s]:!!s})}(e),style:a({border:n})}}(t),l=function(e){var t;return{className:void 0,style:a({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}(t),i=(e=>{const t=(0,r.isObject)(e.style.typography)?e.style.typography:{},n=(0,r.isString)(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:n,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:(0,o.A)(i.className,n.className,s.className,l.className),style:{...i.style,...n.style,...s.style,...l.style}}}},7067:()=>{}}]);