File "product-rating.js"
Full Path: /home/jlklyejr/public_html/wp-content/test/wp-content/plugins/woocommerce/assets/client/blocks/product-rating.js
File size: 5.58 KB
MIME-type: text/plain
Charset: utf-8
(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[7385],{8894:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Block:()=>g,default:()=>f});var o=n(9196),r=n(5736),s=n(3849),l=n.n(s),c=n(2864),a=n(947),i=n(721),u=n(9060);n(2499);const d=e=>({width:e/5*100+"%"}),m=({parentClassName:e})=>{const t=d(0);return(0,o.createElement)("div",{className:l()("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")))},p=e=>{const{rating:t,reviews:n,parentClassName:s}=e,c=d(t),a=(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:l()("wc-block-components-product-rating__stars",`${s}__product-rating__stars`),role:"img","aria-label":a},(0,o.createElement)("span",{style:c,dangerouslySetInnerHTML:i}))},v=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,s=(0,a.F)(e),{parentClassName:i}=(0,c.useInnerBlockLayoutContext)(),{product:d}=(0,c.useProductDataContext)(),g=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(d),f=(e=>{const t=(0,u.h)(e.review_count)?e.review_count:parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(d),y=l()(s.className,"wc-block-components-product-rating",{[`${i}__product-rating`]:i,[`has-text-align-${t}`]:t}),_=r?(0,o.createElement)(m,{parentClassName:i}):null,b=f?(0,o.createElement)(p,{rating:g,reviews:f,parentClassName:i}):_;if(f||r)return(0,o.createElement)("div",{className:y,style:s.style},(0,o.createElement)("div",{className:"wc-block-components-product-rating__container"},b,f&&n?(0,o.createElement)(v,{reviews:f}):null))},f=(0,i.withProductDataContext)(g)},947:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var o=n(3849),r=n.n(o),s=n(7998),l=n(3243),c=n(3392),a=n(172);const i=e=>{const t=(e=>{const t=(0,s.Kn)(e)?e:{style:{}};let n=t.style;return(0,l.H)(n)&&(n=JSON.parse(n)||{}),(0,s.Kn)(n)||(n={}),{...t,style:n}})(e),n=(0,a.vc)(t),o=(0,a.l8)(t),i=(0,a.su)(t),u=(0,c.f)(t);return{className:r()(u.className,n.className,o.className,i.className),style:{...u.style,...n.style,...o.style,...i.style}}}},3392:(e,t,n)=>{"use strict";n.d(t,{f:()=>s});var o=n(7998),r=n(3243);const s=e=>{const t=(0,o.Kn)(e.style.typography)?e.style.typography:{},n=(0,r.H)(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}}}},172:(e,t,n)=>{"use strict";n.d(t,{l8:()=>d,su:()=>m,vc:()=>u});var o=n(3849),r=n.n(o),s=n(7427),l=n(2289),c=n(7998);function a(e={}){const t={};return(0,l.getCSSRules)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function i(e,t){return e&&t?`has-${(0,s.o)(t)}-${e}`:""}function u(e){var t,n,o,s,l,u,d;const{backgroundColor:m,textColor:p,gradient:v,style:g}=e,f=i("background-color",m),y=i("color",p),_=function(e){if(e)return`has-${e}-gradient-background`}(v),b=_||(null==g||null===(t=g.color)||void 0===t?void 0:t.gradient);return{className:r()(y,_,{[f]:!b&&!!f,"has-text-color":p||(null==g||null===(n=g.color)||void 0===n?void 0:n.text),"has-background":m||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||v||(null==g||null===(s=g.color)||void 0===s?void 0:s.gradient),"has-link-color":(0,c.Kn)(null==g||null===(l=g.elements)||void 0===l?void 0:l.link)?null==g||null===(u=g.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:a({color:(null==g?void 0:g.color)||{}})}}function d(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:o}=e,s=n?i("border-color",n):"";return r()({"has-border-color":!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color),[s]:!!s})}(e),style:a({border:n})}}function m(e){var t;return{className:void 0,style:a({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}},2893:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});const o=e=>null===e},9060:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});const o=e=>"number"==typeof e},7998:(e,t,n)=>{"use strict";n.d(t,{$n:()=>s,Kn:()=>r,Qr:()=>l});var o=n(2893);const r=e=>!(0,o.F)(e)&&e instanceof Object&&e.constructor===Object;function s(e,t){return r(e)&&t in e}const l=e=>0===Object.keys(e).length},3243:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});const o=e=>"string"==typeof e},2499:()=>{}}]);