File "product-rating-frontend.js"

Full Path: /home/fineflavourcocoa/public_html/wp-content/plugins/woocommerce/assets/client/blocks/product-rating-frontend.js
File size: 6.79 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:()=>f,default:()=>g});var r=n(9196),o=n(5736),s=n(3849),c=n.n(s),a=n(2864),l=n(947),i=n(721),u=n(9060);n(2499);const d=e=>({width:e/5*100+"%"}),p=({parentClassName:e})=>{const t=d(0);return(0,r.createElement)("div",{className:c()("wc-block-components-product-rating__norating-container",`${e}-product-rating__norating-container`)},(0,r.createElement)("div",{className:"wc-block-components-product-rating__norating",role:"img"},(0,r.createElement)("span",{style:t})),(0,r.createElement)("span",null,(0,o.__)("No Reviews","woocommerce")))},m=e=>{const{rating:t,reviews:n,parentClassName:s}=e,a=d(t),l=(0,o.sprintf)(/* translators: %f is referring to the average rating value */ /* translators: %f is referring to the average rating value */
(0,o.__)("Rated %f out of 5","woocommerce"),t),i={__html:(0,o.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,o._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,o.sprintf)('<strong class="rating">%f</strong>',t),(0,o.sprintf)('<span class="rating">%d</span>',n))};return(0,r.createElement)("div",{className:c()("wc-block-components-product-rating__stars",`${s}__product-rating__stars`),role:"img","aria-label":l},(0,r.createElement)("span",{style:a,dangerouslySetInnerHTML:i}))},v=e=>{const{reviews:t}=e,n=(0,o.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,o._n)("(%s customer review)","(%s customer reviews)",t,"woocommerce"),t);return(0,r.createElement)("span",{className:"wc-block-components-product-rating__reviews_count"},n)},f=e=>{const{textAlign:t,isDescendentOfSingleProductBlock:n,shouldDisplayMockedReviewsWhenProductHasNoReviews:o}=e,s=(0,l.F)(e),{parentClassName:i}=(0,a.useInnerBlockLayoutContext)(),{product:d}=(0,a.useProductDataContext)(),f=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(d),g=(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=c()(s.className,"wc-block-components-product-rating",{[`${i}__product-rating`]:i,[`has-text-align-${t}`]:t}),b=o?(0,r.createElement)(p,{parentClassName:i}):null,w=g?(0,r.createElement)(m,{rating:f,reviews:g,parentClassName:i}):b;if(g||o)return(0,r.createElement)("div",{className:y,style:s.style},(0,r.createElement)("div",{className:"wc-block-components-product-rating__container"},w,g&&n?(0,r.createElement)(v,{reviews:g}):null))},g=(0,i.withProductDataContext)(f)},947:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var r=n(3849),o=n.n(r),s=n(7998),c=n(3243),a=n(3392),l=n(172);const i=e=>{const t=(e=>{const t=(0,s.Kn)(e)?e:{style:{}};let n=t.style;return(0,c.H)(n)&&(n=JSON.parse(n)||{}),(0,s.Kn)(n)||(n={}),{...t,style:n}})(e),n=(0,l.vc)(t),r=(0,l.l8)(t),i=(0,l.su)(t),u=(0,a.f)(t);return{className:o()(u.className,n.className,r.className,i.className),style:{...u.style,...n.style,...r.style,...i.style}}}},3392:(e,t,n)=>{"use strict";n.d(t,{f:()=>s});var r=n(7998),o=n(3243);const s=e=>{const t=(0,r.Kn)(e.style.typography)?e.style.typography:{},n=(0,o.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:()=>p,vc:()=>u});var r=n(3849),o=n.n(r),s=n(7427),c=n(2289),a=n(7998);function l(e={}){const t={};return(0,c.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,r,s,c,u,d;const{backgroundColor:p,textColor:m,gradient:v,style:f}=e,g=i("background-color",p),y=i("color",m),b=function(e){if(e)return`has-${e}-gradient-background`}(v),w=b||(null==f||null===(t=f.color)||void 0===t?void 0:t.gradient);return{className:o()(y,b,{[g]:!w&&!!g,"has-text-color":m||(null==f||null===(n=f.color)||void 0===n?void 0:n.text),"has-background":p||(null==f||null===(r=f.color)||void 0===r?void 0:r.background)||v||(null==f||null===(s=f.color)||void 0===s?void 0:s.gradient),"has-link-color":(0,a.Kn)(null==f||null===(c=f.elements)||void 0===c?void 0:c.link)?null==f||null===(u=f.elements)||void 0===u||null===(d=u.link)||void 0===d?void 0:d.color:void 0}),style:l({color:(null==f?void 0:f.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:r}=e,s=n?i("border-color",n):"";return o()({"has-border-color":!!n||!(null==r||null===(t=r.border)||void 0===t||!t.color),[s]:!!s})}(e),style:l({border:n})}}function p(e){var t;return{className:void 0,style:l({spacing:(null===(t=e.style)||void 0===t?void 0:t.spacing)||{}})}}},2893:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});const r=e=>null===e},9060:(e,t,n)=>{"use strict";n.d(t,{h:()=>r});const r=e=>"number"==typeof e},7998:(e,t,n)=>{"use strict";n.d(t,{$n:()=>s,Kn:()=>o});var r=n(2893);const o=e=>!(0,r.F)(e)&&e instanceof Object&&e.constructor===Object;function s(e,t){return o(e)&&t in e}},3243:(e,t,n)=>{"use strict";n.d(t,{H:()=>r});const r=e=>"string"==typeof e},112:(e,t,n)=>{"use strict";n.d(t,{$:()=>s});var r=n(3112),o=n(7090);function s(e,t){return void 0===t&&(t={}),(0,o.B)(e,(0,r.pi)({delimiter:"."},t))}},2499:()=>{},3569:(e,t,n)=>{"use strict";function r(e){return e.toLowerCase()}n.d(t,{U:()=>r})},7090:(e,t,n)=>{"use strict";n.d(t,{B:()=>c});var r=n(3569),o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],s=/[^A-Z0-9]+/gi;function c(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,c=void 0===n?o:n,l=t.stripRegexp,i=void 0===l?s:l,u=t.transform,d=void 0===u?r.U:u,p=t.delimiter,m=void 0===p?" ":p,v=a(a(e,c,"$1\0$2"),i,"\0"),f=0,g=v.length;"\0"===v.charAt(f);)f++;for(;"\0"===v.charAt(g-1);)g--;return v.slice(f,g).split("\0").map(d).join(m)}function a(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}},7427:(e,t,n)=>{"use strict";n.d(t,{o:()=>s});var r=n(3112),o=n(112);function s(e,t){return void 0===t&&(t={}),(0,o.$)(e,(0,r.pi)({delimiter:"-"},t))}},3112:(e,t,n)=>{"use strict";n.d(t,{pi:()=>r});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError}}]);