PATH:
home
/
letacommog
/
rdvenunclick.fr1
/
wp-content
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
build
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["reviews-by-product"]=function(e){function t(t){for(var n,i,a=t[0],s=t[1],u=t[2],d=0,p=[];d<a.length;d++)i=a[d],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);p.length;)p.shift()();return c.push.apply(c,u||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,a=1;a<r.length;a++){var s=r[a];0!==o[s]&&(n=!1)}n&&(c.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={16:0},c=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var l=s;return c.push([615,0]),r()}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.React}()},102:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},103:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(0),i=(r(111),r(44));t.a=function(e){var t=e.attributes,r=t.categoryIds,n=t.imageType,a=t.orderby,s=t.productId,u={"data-image-type":n,"data-orderby":a,"data-reviews-on-page-load":t.reviewsOnPageLoad,"data-reviews-on-load-more":t.reviewsOnLoadMore,"data-show-load-more":t.showLoadMore,"data-show-orderby":t.showOrderby},l="wc-block-all-reviews";return s&&(u["data-product-id"]=s,l="wc-block-reviews-by-product"),Array.isArray(r)&&(u["data-category-ids"]=r.join(","),l="wc-block-reviews-by-category"),Object(c.createElement)("div",o()({className:Object(i.a)(l,t)},u))}},104:function(e,t,r){"use strict";var n=r(18),o=r.n(n),c=r(19),i=r.n(c),a=r(20),s=r.n(a),u=r(21),l=r.n(u),d=r(11),p=r.n(d),b=r(0),f=r(1),g=r(10),v=(r(2),r(5)),m=r(4),w=r(6),h=r(57),O=r(8),j=r.n(O),y=r(7),_=r.n(y);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){j()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=function(e){var t,r=e.label,n=e.screenReaderLabel,o=e.wrapperElement,c=e.wrapperProps,i=null!=r,a=null!=n;return!i&&a?(t=o||"span",c=E(E({},c),{},{className:_()(c.className,"screen-reader-text")}),Object(b.createElement)(t,c,n)):(t=o||g.Fragment,i&&a&&r!==n?Object(b.createElement)(t,c,Object(b.createElement)("span",{"aria-hidden":"true"},r),Object(b.createElement)("span",{className:"screen-reader-text"},n)):Object(b.createElement)(t,c,r))};R.defaultProps={wrapperProps:{}};var P=R,S=(r(148),function(e){var t=e.onClick,r=e.label,n=e.screenReaderLabel;return Object(b.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(b.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(b.createElement)(P,{label:r,screenReaderLabel:n})))});S.defaultProps={label:Object(f.__)("Load more",'woocommerce')};var x=S,C=r(22),N=(r(145),Object(C.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.defaultValue,o=e.label,c=e.onChange,i=e.options,a=e.screenReaderLabel,s=e.readOnly,u=e.value,l="wc-block-components-sort-select__select-".concat(r);return Object(b.createElement)("div",{className:_()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(b.createElement)(P,{label:o,screenReaderLabel:a,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:l}}),Object(b.createElement)("select",{id:l,className:"wc-block-sort-select__select wc-block-components-sort-select__select",defaultValue:n,onChange:c,readOnly:s,value:u},i.map((function(e){return Object(b.createElement)("option",{key:e.key,value:e.key},e.label)}))))}))),D=(r(144),function(e){var t=e.defaultValue,r=e.onChange,n=e.readOnly,o=e.value;return Object(b.createElement)(N,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",defaultValue:t,label:Object(f.__)("Order by",'woocommerce'),onChange:r,options:[{key:"most-recent",label:Object(f.__)("Most recent",'woocommerce')},{key:"highest-rating",label:Object(f.__)("Highest rating",'woocommerce')},{key:"lowest-rating",label:Object(f.__)("Lowest rating",'woocommerce')}],readOnly:n,screenReaderLabel:Object(f.__)("Order reviews by",'woocommerce'),value:o})}),L=r(17),I=r.n(L),T=r(127),M=r.n(T),A=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=M()(e,{suffix:r,limit:t});return n.html},H=function(e,t,r,n){var o=B(e,t,r);return A(e,o-n.length,n)},B=function(e,t,r){for(var n={start:0,middle:0,end:e.length};n.start<=n.end;)n.middle=Math.floor((n.start+n.end)/2),t.innerHTML=A(e,n.middle),n=V(n,t.clientHeight,r);return n.middle},V=function(e,t,r){return t<=r?e.start=e.middle+1:e.end=e.middle-1,e};function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l()(this,r)}}var F=function(e){s()(r,e);var t=z(r);function r(e){var n;return o()(this,r),(n=t.apply(this,arguments)).state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},n.reviewSummary=Object(g.createRef)(),n.reviewContent=Object(g.createRef)(),n.getButton=n.getButton.bind(I()(n)),n.onClick=n.onClick.bind(I()(n)),n}return i()(r,[{key:"componentDidMount",value:function(){if(this.props.children){var e=this.props,t=e.maxLines,r=e.ellipsis,n=(this.reviewSummary.current.clientHeight+1)*t+1,o=this.reviewContent.current.clientHeight+1>n;this.setState({clampEnabled:o}),o&&this.setState({summary:H(this.reviewContent.current.innerHTML,this.reviewSummary.current,n,r)})}}},{key:"getButton",value:function(){var e=this.state.isExpanded,t=this.props,r=t.className,n=t.lessText,o=t.moreText,c=e?n:o;if(c)return Object(b.createElement)("a",{href:"#more",className:r+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}},{key:"onClick",value:function(e){e.preventDefault();var t=this.state.isExpanded;this.setState({isExpanded:!t})}},{key:"render",value:function(){var e=this.props.className,t=this.state,r=t.content,n=t.summary,o=t.clampEnabled,c=t.isExpanded;return r?!1===o?Object(b.createElement)("div",{className:e},Object(b.createElement)("div",{ref:this.reviewContent},r)):Object(b.createElement)("div",{className:e},(!c||null===o)&&Object(b.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:n}}),(c||null===o)&&Object(b.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},r),this.getButton()):null}}]),r}(g.Component);F.defaultProps={maxLines:3,ellipsis:"…",moreText:Object(f.__)("Read more",'woocommerce'),lessText:Object(f.__)("Read less",'woocommerce'),className:"read-more-content"};var U=F;r(147);var W=function(e){var t=e.attributes,r=e.review,n=void 0===r?{}:r,o=t.imageType,c=t.showReviewDate,i=t.showReviewerName,a=t.showReviewImage,s=t.showReviewRating,u=t.showReviewContent,l=t.showProductName,d=n.rating,p=!Object.keys(n).length>0,g=Number.isFinite(d)&&s;return Object(b.createElement)("li",{className:_()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":p}),"aria-hidden":p},(l||c||i||a||g)&&Object(b.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},a&&function(e,t,r){var n,o;return r||!e?Object(b.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image",width:"48",height:"48"}):Object(b.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(b.createElement)("img",{"aria-hidden":"true",alt:(null===(n=e.product_image)||void 0===n?void 0:n.alt)||"",src:(null===(o=e.product_image)||void 0===o?void 0:o.thumbnail)||""}):Object(b.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[48]||"",srcSet:e.reviewer_avatar_urls[96]+" 2x"}),e.verified&&Object(b.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(f.__)("Verified buyer",'woocommerce')},Object(f.__)("Verified buyer",'woocommerce')))}(n,o,p),(l||i||g||c)&&Object(b.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},g&&function(e){var t=e.rating,r={width:t/5*100+"%"};return Object(b.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(b.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img"},Object(b.createElement)("span",{style:r},Object(f.sprintf)(Object(f.__)("Rated %f out of 5",'woocommerce'),t))))}(n),l&&function(e){return Object(b.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(b.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(n),i&&function(e){var t=e.reviewer,r=void 0===t?"":t;return Object(b.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},r)}(n),c&&function(e){var t=e.date_created,r=e.formatted_date_created;return Object(b.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(n))),u&&function(e){return Object(b.createElement)(U,{maxLines:10,moreText:Object(f.__)("Read full review",'woocommerce'),lessText:Object(f.__)("Hide full review",'woocommerce'),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(b.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(n))};r(146);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){j()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var J=function(e){var t=e.attributes,r=e.reviews,n=(w.n||"product"===t.imageType)&&t.showReviewImage,o=w.m&&t.showReviewRating,c=Q(Q({},t),{},{showReviewImage:n,showReviewRating:o});return Object(b.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(b.createElement)(W,{attributes:c}):r.map((function(e,t){return Object(b.createElement)(W,{key:e.id||t,attributes:c,review:e})})))},G=r(16),Y=r.n(G),$=r(13),K=r.n($),X=r(24),Z=r.n(X),ee=r(71),te=r.n(ee),re=r(44),ne=r(26);function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l()(this,r)}}function ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l()(this,r)}}var ie=function(e){var t=function(t){s()(n,t);var r=oe(n);function n(){var e;o()(this,n);for(var t=arguments.length,c=new Array(t),i=0;i<t;i++)c[i]=arguments[i];return e=r.call.apply(r,[this].concat(c)),j()(I()(e),"isPreview",!!e.props.attributes.previewReviews),j()(I()(e),"delayedAppendReviews",e.props.delayFunction(e.appendReviews)),j()(I()(e),"state",{error:null,loading:!0,reviews:e.isPreview?e.props.attributes.previewReviews:[],totalReviews:e.isPreview?e.props.attributes.previewReviews.length:0}),j()(I()(e),"setError",function(){var t=Z()(K.a.mark((function t(r){var n,o;return K.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props.onReviewsLoadError,t.next=3,Object(ne.a)(r);case 3:o=t.sent,e.setState({reviews:[],loading:!1,error:o}),n(o);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return i()(n,[{key:"componentDidMount",value:function(){this.replaceReviews()}},{key:"componentDidUpdate",value:function(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}},{key:"shouldReplaceReviews",value:function(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!te()(e.categoryIds,t.categoryIds)}},{key:"componentWillUnMount",value:function(){this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}},{key:"getArgs",value:function(e){var t=this.props,r=t.categoryIds,n=t.order,o=t.orderby,c=t.productId,i={order:n,orderby:o,per_page:t.reviewsToDisplay-e,offset:e};return r&&r.length&&(i.category_id=Array.isArray(r)?r.join(","):r),c&&(i.product_id=c),i}},{key:"replaceReviews",value:function(){if(!this.isPreview){var e=this.props.onReviewsReplaced;this.updateListOfReviews().then(e)}}},{key:"appendReviews",value:function(){if(!this.isPreview){var e=this.props,t=e.onReviewsAppended,r=e.reviewsToDisplay,n=this.state.reviews;r<=n.length||this.updateListOfReviews(n).then(t)}}},{key:"updateListOfReviews",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=this.props.reviewsToDisplay,n=this.state.totalReviews,o=Math.min(n,r)-t.length;return this.setState({loading:!0,reviews:t.concat(Array(o).fill({}))}),Object(re.b)(this.getArgs(t.length)).then((function(r){var n=r.reviews,o=r.totalReviews;return e.setState({reviews:t.filter((function(e){return Object.keys(e).length})).concat(n),totalReviews:o,loading:!1,error:null}),{newReviews:n}})).catch(this.setError)}},{key:"render",value:function(){var t=this.props.reviewsToDisplay,r=this.state,n=r.error,o=r.loading,c=r.reviews,i=r.totalReviews;return Object(b.createElement)(e,Y()({},this.props,{error:n,isLoading:o,reviews:c.slice(0,t),totalReviews:i}))}}]),n}(g.Component);j()(t,"defaultProps",{delayFunction:function(e){return e},onReviewsAppended:function(){},onReviewsLoadError:function(){},onReviewsReplaced:function(){}});var r=e.displayName,n=void 0===r?e.name||"Component":r;return t.displayName="WithReviews( ".concat(n," )"),t}(function(e){s()(r,e);var t=ce(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.error,n=e.isLoading,o=e.noReviewsPlaceholder,c=e.reviews,i=e.totalReviews;return r?Object(b.createElement)(h.a,{className:"wc-block-featured-product-error",error:r,isLoading:n}):0!==c.length||n?Object(b.createElement)(m.Disabled,null,t.showOrderby&&w.m&&Object(b.createElement)(D,{readOnly:!0,value:t.orderby}),Object(b.createElement)(J,{attributes:t,reviews:c}),t.showLoadMore&&i>c.length&&Object(b.createElement)(x,{screenReaderLabel:Object(f.__)("Load more reviews",'woocommerce')})):Object(b.createElement)(o,{attributes:t})}}]),r}(g.Component));function ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l()(this,r)}}var se=function(e){s()(r,e);var t=ae(r);function r(){return o()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderHiddenContentPlaceholder",value:function(){var e=this.props,t=e.icon,r=e.name;return Object(b.createElement)(m.Placeholder,{icon:t,label:r},Object(f.__)("The content for this block is hidden due to block settings.",'woocommerce'))}},{key:"render",value:function(){var e=this.props,t=e.attributes,r=e.className,n=e.noReviewsPlaceholder,o=t.categoryIds,c=t.productId,i=t.reviewsOnPageLoad,a=t.showProductName,s=t.showReviewDate,u=t.showReviewerName,l=t.showReviewContent,d=t.showReviewImage,p=t.showReviewRating,f=Object(re.c)(t.orderby),g=f.order,m=f.orderby;return!(l||p||s||u||d||a)?this.renderHiddenContentPlaceholder():Object(b.createElement)("div",{className:Object(re.a)(r,t)},Object(b.createElement)(ie,{attributes:t,categoryIds:o,delayFunction:function(e){return Object(v.debounce)(e,400)},noReviewsPlaceholder:n,orderby:m,order:g,productId:c,reviewsToDisplay:i}))}}]),r}(g.Component);t.a=se},110:function(e,t){},111:function(e,t){},12:function(e,t){!function(){e.exports=this.wp.url}()},128:function(e,t,r){"use strict";var n=r(93),o=r.n(n),c=r(16),i=r.n(c),a=r(0),s=r(1),u=r(5),l=(r(2),r(31)),d=r(4),p=r(7),b=r.n(p),f=r(18),g=r.n(f),v=r(19),m=r.n(v),w=r(20),h=r.n(w),O=r(21),j=r.n(O),y=r(11),_=r.n(y),k=r(22);function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_()(e);if(t){var o=_()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return j()(this,r)}}var R=Object(k.createHigherOrderComponent)((function(e){var t=function(t){h()(n,t);var r=E(n);function n(){return g()(this,n),r.apply(this,arguments)}return m()(n,[{key:"render",value:function(){var t=this.props.selected;return Object(a.createElement)(e,i()({},this.props,{selected:Object(u.isNil)(t)?[]:[t]}))}}]),n}(a.Component);return t.defaultProps={selected:null},t}),"withTransformSingleSelectToMultipleSelect"),P=r(345),S=r(13),x=r.n(S),C=r(24),N=r.n(C),D=r(17),L=r.n(D),I=r(8),T=r.n(I),M=r(71),A=r.n(M),H=r(27),B=r(26);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){T()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_()(e);if(t){var o=_()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return j()(this,r)}}var U=Object(k.createHigherOrderComponent)((function(e){var t=function(t){h()(n,t);var r=F(n);function n(){var e;g()(this,n);for(var t=arguments.length,o=new Array(t),c=0;c<t;c++)o[c]=arguments[c];return e=r.call.apply(r,[this].concat(o)),T()(L()(e),"state",{error:null,loading:!1,variations:{}}),T()(L()(e),"loadVariations",(function(){var t=e.props.products,r=e.state,n=r.loading,o=r.variations;if(!n){var c=e.getExpandedProduct();if(c&&!o[c]){var i=t.find((function(e){return e.id===c}));i.variations&&0!==i.variations.length?(e.setState({loading:!0}),Object(H.f)(c).then((function(t){var r=t.map((function(e){return z(z({},e),{},{parent:c})}));e.setState({variations:z(z({},e.state.variations),{},T()({},c,r)),loading:!1,error:null})})).catch(function(){var t=N()(x.a.mark((function t(r){var n;return x.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(B.a)(r);case 2:n=t.sent,e.setState({variations:z(z({},e.state.variations),{},T()({},c,null)),loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())):e.setState({variations:z(z({},e.state.variations),{},T()({},c,null)),loading:!1,error:null})}}})),e}return m()(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.selected,r=e.showVariations;t&&r&&this.loadVariations()}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isLoading,n=t.selected;t.showVariations&&(!A()(e.selected,n)||e.isLoading&&!r)&&this.loadVariations()}},{key:"isProductId",value:function(e){return this.props.products.some((function(t){return t.id===e}))}},{key:"findParentProduct",value:function(e){return this.props.products.filter((function(t){return t.variations&&t.variations.find((function(t){return t.id===e}))}))[0].id}},{key:"getExpandedProduct",value:function(){var e=this.props,t=e.isLoading,r=e.selected;if(!e.showVariations)return null;var n=r&&r.length?r[0]:null;return n?this.prevSelectedItem=n:this.prevSelectedItem&&(t||this.isProductId(this.prevSelectedItem)||(n=this.prevSelectedItem)),!t&&n?this.isProductId(n)?n:this.findParentProduct(n):null}},{key:"render",value:function(){var t=this.props,r=t.error,n=t.isLoading,o=this.state,c=o.error,s=o.loading,u=o.variations;return Object(a.createElement)(e,i()({},this.props,{error:c||r,expandedProduct:this.getExpandedProduct(),isLoading:n,variations:u,variationsLoading:s}))}}]),n}(a.Component);return T()(t,"defaultProps",{selected:[],showVariations:!1}),t}),"withProductVariations"),W=r(60),q=r(645),Q=Object(a.createElement)(q.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)("path",{fill:"#1E8CBE",d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),J=Object(a.createElement)(q.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)("path",{fill:"#6C7781",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),G=r(30);r(214);function Y(e,t){if(!t)return e;var r=new RegExp(Object(u.escapeRegExp)(t),"ig");return e.replace(r,"<strong>$&</strong>")}var $=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?Object(a.createElement)(W.a,{srcElement:Q}):Object(a.createElement)(W.a,{srcElement:J})},K={list:Object(s.__)("Products",'woocommerce'),noItems:Object(s.__)("Your store doesn't have any products.",'woocommerce'),search:Object(s.__)("Search for a product to display",'woocommerce'),updated:Object(s.__)("Product search results updated.",'woocommerce')},X=function(e){var t=e.expandedProduct,r=e.error,n=e.isLoading,c=e.onChange,p=e.onSearch,f=e.products,g=e.renderItem,v=e.selected,m=e.showVariations,w=e.variations,h=e.variationsLoading,O=function(e){var r=e.item,n=e.search,o=e.depth,c=void 0===o?0:o,p=e.isSelected,f=e.onSelect,g=r.variations&&Array.isArray(r.variations)?r.variations.length:0,v=b()("woocommerce-search-product__item","woocommerce-search-list__item","depth-".concat(c),{"is-searching":n.length>0,"is-skip-level":0===c&&0!==r.parent,"is-variable":g>0}),m=Object.assign({},e);delete m.isSingle;var w={role:"menuitemradio"};return r.breadcrumbs.length&&(w["aria-label"]="".concat(r.breadcrumbs[0],": ").concat(r.name)),g&&(w["aria-expanded"]=r.id===t),r.breadcrumbs.length?(Object(u.isEmpty)(r.variation)||(r.name=r.variation),Object(a.createElement)(l.b,i()({className:v},e,w))):[Object(a.createElement)(d.MenuItem,i()({key:"product-".concat(r.id),isSelected:p},m,w,{className:v,onClick:function(){f(r)()}}),Object(a.createElement)("span",{className:"woocommerce-search-list__item-state"},$(p)),Object(a.createElement)("span",{className:"woocommerce-search-list__item-label"},Object(a.createElement)("span",{className:"woocommerce-search-list__item-name",dangerouslySetInnerHTML:{__html:Y(r.name,n)}})),g?Object(a.createElement)("span",{className:"woocommerce-search-list__item-variation-count"},Object(s.sprintf)(Object(s._n)("%d variation","%d variations",g,'woocommerce'),g)):null),t===r.id&&g>0&&h&&Object(a.createElement)("div",{key:"loading",className:"woocommerce-search-list__item woocommerce-search-product__itemdepth-1 is-loading is-not-active"},Object(a.createElement)(d.Spinner,null))]};if(r)return Object(a.createElement)(G.a,{error:r});var j=w&&w[t]?w[t]:[],y=[].concat(o()(f),o()(j));return Object(a.createElement)(l.a,{className:"woocommerce-products",list:y,isLoading:n,isSingle:!0,selected:y.filter((function(e){var t=e.id;return v.includes(t)})),onChange:c,renderItem:g||(m?O:null),onSearch:p,messages:K,isHierarchical:!0})};X.defaultProps={expandedProduct:null,selected:[],showVariations:!1};t.a=R(Object(P.a)(U(X)))},13:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},14:function(e,t){!function(){e.exports=this.moment}()},144:function(e,t){},145:function(e,t){},146:function(e,t){},147:function(e,t){},148:function(e,t){},15:function(e,t){!function(){e.exports=this.wp.blocks}()},214:function(e,t){},22:function(e,t){!function(){e.exports=this.wp.compose}()},23:function(e,t){!function(){e.exports=this.wp.blockEditor}()},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(13),o=r.n(n),c=r(24),i=r.n(c),a=function(){var e=i()(o.a.mark((function e(t){var r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()},27:function(e,t,r){"use strict";r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return b})),r.d(t,"a",(function(){return f})),r.d(t,"h",(function(){return g})),r.d(t,"e",(function(){return v})),r.d(t,"b",(function(){return m})),r.d(t,"c",(function(){return w})),r.d(t,"f",(function(){return h}));var n=r(8),o=r.n(n),c=r(12),i=r(9),a=r.n(i),s=r(5),u=r(6);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,i=e.queryArgs,l=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=void 0===n?"":n,i=e.queryArgs,a=void 0===i?[]:i,s={per_page:u.f?100:0,catalog_visibility:"any",search:o,orderby:"title",order:"asc"},l=[Object(c.addQueryArgs)("/wc/store/products",d(d({},s),a))];return u.f&&r.length&&l.push(Object(c.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r})),l}({selected:r,search:o,queryArgs:void 0===i?[]:i});return Promise.all(l.map((function(e){return a()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},b=function(e){return a()({path:"/wc/store/products/".concat(e)})},f=function(){return a()({path:"wc/store/products/attributes"})},g=function(e){return a()({path:"wc/store/products/attributes/".concat(e,"/terms")})},v=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,o=[Object(c.addQueryArgs)("wc/store/products/tags",{per_page:u.g?100:0,orderby:u.g?"count":"name",order:u.g?"desc":"asc",search:n})];return u.g&&r.length&&o.push(Object(c.addQueryArgs)("wc/store/products/tags",{include:r})),o}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return a()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},m=function(e){return a()({path:Object(c.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},w=function(e){return a()({path:"wc/store/products/categories/".concat(e)})},h=function(e){return a()({path:Object(c.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})}},28:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},3:function(e,t){!function(){e.exports=this.wc.wcSettings}()},30:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(28));t.a=function(e){var t,r,i,a=e.error;return Object(n.createElement)("div",{className:"wc-block-error-message"},(r=(t=a).message,i=t.type,r?"general"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):"api"===i?Object(n.createElement)("span",null,Object(o.__)("The following error was returned from the API",'woocommerce'),Object(n.createElement)("br",null),Object(n.createElement)("code",null,Object(c.escapeHTML)(r))):r:Object(o.__)("An unknown error occurred which prevented the block from being updated.",'woocommerce')))}},345:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(13),i=r.n(c),a=r(24),s=r.n(a),u=r(18),l=r.n(u),d=r(19),p=r.n(d),b=r(17),f=r.n(b),g=r(20),v=r.n(g),m=r(21),w=r.n(m),h=r(11),O=r.n(h),j=r(0),y=r(5),_=r(22),k=(r(2),r(6)),E=r(27),R=r(26);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var o=O()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var S=Object(_.createHigherOrderComponent)((function(e){var t=function(t){v()(c,t);var r,n=P(c);function c(){var e;return l()(this,c),(e=n.apply(this,arguments)).state={list:[],loading:!0},e.setError=e.setError.bind(f()(e)),e.debouncedOnSearch=Object(y.debounce)(e.onSearch.bind(f()(e)),400),e}return p()(c,[{key:"componentDidMount",value:function(){var e=this,t=this.props.selected;Object(E.g)({selected:t}).then((function(t){e.setState({list:t,loading:!1})})).catch(this.setError)}},{key:"componentWillUnmount",value:function(){this.debouncedOnSearch.cancel()}},{key:"onSearch",value:function(e){var t=this,r=this.props.selected;Object(E.g)({selected:r,search:e}).then((function(e){t.setState({list:e,loading:!1})})).catch(this.setError)}},{key:"setError",value:(r=s()(i.a.mark((function e(t){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(R.a)(t);case 2:r=e.sent,this.setState({list:[],loading:!1,error:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"render",value:function(){var t=this,r=this.state,n=r.error,c=r.list,i=r.loading;return Object(j.createElement)(e,o()({},this.props,{error:n,products:c,isLoading:i,onSearch:k.f?function(e){t.setState({loading:!0}),t.debouncedOnSearch(e)}:null}))}}]),c}(j.Component);return t.defaultProps={selected:[]},t}),"withSearchedProducts");t.a=S},37:function(e,t){!function(){e.exports=this.wp.keycodes}()},4:function(e,t){!function(){e.exports=this.wp.components}()},44:function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return l}));var n=r(9),o=r.n(n),c=r(7),i=r.n(c),a=r(6),s=function(e){if(a.m){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},u=function(e){return o()({path:"/wc/store/products/reviews?"+Object.entries(e).map((function(e){return e.join("=")})).join("&"),parse:!1}).then((function(e){return e.json().then((function(t){return{reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}}))}))},l=function(e,t){var r=t.className,n=t.showReviewDate,o=t.showReviewerName,c=t.showReviewContent,a=t.showProductName,s=t.showReviewImage,u=t.showReviewRating;return i()(e,r,{"has-image":s,"has-name":o,"has-date":n,"has-rating":u,"has-content":c,"has-product-name":a})}},47:function(e,t){!function(){e.exports=this.wp.hooks}()},49:function(e,t){!function(){e.exports=this.ReactDOM}()},5:function(e,t){!function(){e.exports=this.lodash}()},52:function(e,t){!function(){e.exports=this.wp.viewport}()},57:function(e,t,r){"use strict";var n=r(0),o=r(1),c=(r(2),r(60)),i=r(645),a=Object(n.createElement)(i.a,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),s=r(7),u=r.n(s),l=r(4),d=r(30);r(99),t.a=function(e){var t=e.className,r=e.error,i=e.isLoading,s=e.onRetry;return Object(n.createElement)(l.Placeholder,{icon:Object(n.createElement)(c.a,{srcElement:a}),label:Object(o.__)("Sorry, an error occurred",'woocommerce'),className:u()("wc-block-api-error",t)},Object(n.createElement)(d.a,{error:r}),s&&Object(n.createElement)(n.Fragment,null,i?Object(n.createElement)(l.Spinner,null):Object(n.createElement)(l.Button,{isDefault:!0,onClick:s},Object(o.__)("Retry",'woocommerce'))))}},6:function(e,t,r){"use strict";r.d(t,"m",(function(){return o})),r.d(t,"n",(function(){return c})),r.d(t,"h",(function(){return i})),r.d(t,"j",(function(){return a})),r.d(t,"a",(function(){return s})),r.d(t,"i",(function(){return u})),r.d(t,"l",(function(){return l})),r.d(t,"c",(function(){return d})),r.d(t,"k",(function(){return p})),r.d(t,"b",(function(){return b})),r.d(t,"f",(function(){return f})),r.d(t,"g",(function(){return g})),r.d(t,"d",(function(){return v})),r.d(t,"e",(function(){return m})),r.d(t,"o",(function(){return w}));var n=r(3),o=(Object(n.getSetting)("currentUserIsAdmin",!1),Object(n.getSetting)("reviewRatingsEnabled",!0)),c=Object(n.getSetting)("showAvatars",!0),i=Object(n.getSetting)("max_columns",6),a=Object(n.getSetting)("min_columns",1),s=Object(n.getSetting)("default_columns",3),u=Object(n.getSetting)("max_rows",6),l=Object(n.getSetting)("min_rows",1),d=Object(n.getSetting)("default_rows",3),p=Object(n.getSetting)("min_height",500),b=Object(n.getSetting)("default_height",500),f=(Object(n.getSetting)("placeholderImgSrc",""),Object(n.getSetting)("thumbnail_size",300),Object(n.getSetting)("isLargeCatalog")),g=Object(n.getSetting)("limitTags"),v=(Object(n.getSetting)("hasProducts",!0),Object(n.getSetting)("hasTags",!0)),m=Object(n.getSetting)("homeUrl",""),w=(Object(n.getSetting)("couponsEnabled",!0),Object(n.getSetting)("shippingEnabled",!0),Object(n.getSetting)("taxesEnabled",!0),Object(n.getSetting)("displayItemizedTaxes",!1),Object(n.getSetting)("displayShopPricesIncludingTax",!1),Object(n.getSetting)("displayCartPricesIncludingTax",!1),Object(n.getSetting)("productCount",0),Object(n.getSetting)("attributes",[]),Object(n.getSetting)("isShippingCalculatorEnabled",!0),Object(n.getSetting)("isShippingCostHidden",!1),Object(n.getSetting)("woocommerceBlocksPhase",1),Object(n.getSetting)("wcBlocksAssetUrl","")),h=(Object(n.getSetting)("wcBlocksBuildUrl",""),Object(n.getSetting)("shippingCountries",{}),Object(n.getSetting)("allowedCountries",{}),Object(n.getSetting)("shippingStates",{}),Object(n.getSetting)("allowedStates",{}),Object(n.getSetting)("shippingMethodsExist",!1),Object(n.getSetting)("checkoutShowLoginReminder",!0),{id:0,title:"",permalink:""}),O=Object(n.getSetting)("storePages",{shop:h,cart:h,checkout:h,privacy:h,terms:h});O.shop.permalink,O.checkout.id,O.checkout.permalink,O.privacy.permalink,O.privacy.title,O.terms.permalink,O.terms.title,O.cart.id,O.cart.permalink,Object(n.getSetting)("checkoutAllowsGuest",!1),Object(n.getSetting)("checkoutAllowsSignup",!1),r(15)},60:function(e,t,r){"use strict";var n=r(8),o=r.n(n),c=r(35),i=r.n(c),a=r(10);r(2);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,c=i()(e,["srcElement","size"]);return Object(a.isValidElement)(t)&&Object(a.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},c))}},613:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(13),i=r.n(c),a=r(24),s=r.n(a),u=r(18),l=r.n(u),d=r(19),p=r.n(d),b=r(17),f=r.n(b),g=r(20),v=r.n(g),m=r(21),w=r.n(m),h=r(11),O=r.n(h),j=r(8),y=r.n(j),_=r(0),k=r(22),E=r(27),R=r(26);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=O()(e);if(t){var o=O()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w()(this,r)}}var S=Object(k.createHigherOrderComponent)((function(e){return function(t){v()(n,t);var r=P(n);function n(){var e;l()(this,n);for(var t=arguments.length,o=new Array(t),c=0;c<t;c++)o[c]=arguments[c];return e=r.call.apply(r,[this].concat(o)),y()(f()(e),"state",{error:null,loading:!1,product:"preview"===e.props.attributes.productId?e.props.attributes.previewProduct:null}),y()(f()(e),"loadProduct",(function(){var t=e.props.attributes.productId;"preview"!==t&&(t?(e.setState({loading:!0}),Object(E.d)(t).then((function(t){e.setState({product:t,loading:!1,error:null})})).catch(function(){var t=s()(i.a.mark((function t(r){var n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(R.a)(r);case 2:n=t.sent,e.setState({product:null,loading:!1,error:n});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())):e.setState({product:null,loading:!1,error:null}))})),e}return p()(n,[{key:"componentDidMount",value:function(){this.loadProduct()}},{key:"componentDidUpdate",value:function(e){e.attributes.productId!==this.props.attributes.productId&&this.loadProduct()}},{key:"render",value:function(){var t=this.state,r=t.error,n=t.loading,c=t.product;return Object(_.createElement)(e,o()({},this.props,{error:r,getProduct:this.loadProduct,isLoading:n,product:c}))}}]),n}(_.Component)}),"withProduct");t.a=S},615:function(e,t,r){e.exports=r(630)},62:function(e,t){!function(){e.exports=this.wp.htmlEntities}()},63:function(e,t){!function(){e.exports=this.wp.date}()},630:function(e,t,r){"use strict";r.r(t);var n=r(8),o=r.n(n),c=r(0),i=r(1),a=r(15),s=r(60),u=r(645),l=Object(c.createElement)(u.a,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(c.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(c.createElement)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"})),d=(r(111),r(16)),p=r.n(d),b=r(23),f=r(4),g=r(31),v=(r(2),r(128)),m=r(104),w=r(57),h=r(613),O=Object(h.a)((function(e){var t=e.error,r=e.getProduct,n=e.isLoading,o=e.product;if(t)return Object(c.createElement)(w.a,{className:"wc-block-featured-product-error",error:t,isLoading:n,onRetry:r});var a=!o||n?Object(c.createElement)(f.Spinner,null):Object(i.sprintf)(Object(i.__)("This block lists reviews for a selected product. %s doesn't have any reviews yet, but they will show up here when it does.",'woocommerce'),o.name);return Object(c.createElement)(f.Placeholder,{className:"wc-block-reviews-by-product",icon:Object(c.createElement)(s.a,{srcElement:l,className:"block-editor-block-icon"}),label:Object(i.__)("Reviews by Product",'woocommerce')},a)})),j=r(72),y=Object(f.withSpokenMessages)((function(e){var t=e.attributes,r=e.debouncedSpeak,n=e.setAttributes,o=t.editMode,a=t.productId,u=function(e){var t=e.item,r=void 0===t?0:t;return Object(c.createElement)(g.b,p()({},e,{countLabel:Object(i.sprintf)(Object(i._n)("%d Review","%d Reviews",r.review_count,'woocommerce'),r.review_count),showCount:!0,"aria-label":Object(i.sprintf)(Object(i._n)("%s, has %d review","%s, has %d reviews",r.review_count,'woocommerce'),r.name,r.review_count)}))};return!a||o?Object(c.createElement)(f.Placeholder,{icon:Object(c.createElement)(s.a,{icon:l,className:"block-editor-block-icon"}),label:Object(i.__)("Reviews by Product",'woocommerce'),className:"wc-block-reviews-by-product"},Object(i.__)("Show reviews of your product to build trust",'woocommerce'),Object(c.createElement)("div",{className:"wc-block-reviews__selection"},Object(c.createElement)(v.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},queryArgs:{orderby:"comment_count",order:"desc"},renderItem:u}),Object(c.createElement)(f.Button,{isPrimary:!0,onClick:function(){n({editMode:!1}),r(Object(i.__)("Showing Reviews by Product block preview.",'woocommerce'))}},Object(i.__)("Done",'woocommerce')))):Object(c.createElement)(c.Fragment,null,Object(j.a)(o,n),Object(c.createElement)(b.InspectorControls,{key:"inspector"},Object(c.createElement)(f.PanelBody,{title:Object(i.__)("Product",'woocommerce'),initialOpen:!1},Object(c.createElement)(v.a,{selected:t.productId||0,onChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e[0]?e[0].id:0;n({productId:t})},renderItem:u})),Object(c.createElement)(f.PanelBody,{title:Object(i.__)("Content",'woocommerce')},Object(j.b)(t,n)),Object(c.createElement)(f.PanelBody,{title:Object(i.__)("List Settings",'woocommerce')},Object(j.c)(t,n))),Object(c.createElement)(m.a,{attributes:t,className:"wc-block-reviews-by-product",icon:Object(c.createElement)(s.a,{icon:l,className:"block-editor-block-icon"}),name:Object(i.__)("Reviews by Product",'woocommerce'),noReviewsPlaceholder:O}))})),_=r(102),k=r(103),E=r(92);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerBlockType)("woocommerce/reviews-by-product",{title:Object(i.__)("Reviews by Product",'woocommerce'),icon:{src:Object(c.createElement)(s.a,{srcElement:l}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(i.__)("WooCommerce",'woocommerce')],description:Object(i.__)("Show reviews of your products to build trust.",'woocommerce'),supports:{html:!1},example:P(P({},E.a),{},{attributes:P(P({},E.a.attributes),{},{productId:1})}),attributes:P(P({},_.a),{},{productId:{type:"number"}}),edit:function(e){return Object(c.createElement)(y,e)},save:k.a})},70:function(e,t){!function(){e.exports=this.wp.dom}()},71:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return b}));var n=r(0),o=r(1),c=r(129),i=r(4),a=r(23),s=r(3),u=r(6),l=r(91),d=function(e,t){return Object(n.createElement)(a.BlockControls,null,Object(n.createElement)(i.Toolbar,{controls:[{icon:"edit",title:Object(o.__)("Edit",'woocommerce'),onClick:function(){return t({editMode:!e})},isActive:e}]}))},p=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Product rating",'woocommerce'),checked:e.showReviewRating,onChange:function(){return t({showReviewRating:!e.showReviewRating})}}),e.showReviewRating&&!u.m&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Product rating is disabled in your <a>store settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Reviewer name",'woocommerce'),checked:e.showReviewerName,onChange:function(){return t({showReviewerName:!e.showReviewerName})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Image",'woocommerce'),checked:e.showReviewImage,onChange:function(){return t({showReviewImage:!e.showReviewImage})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review date",'woocommerce'),checked:e.showReviewDate,onChange:function(){return t({showReviewDate:!e.showReviewDate})}}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Review content",'woocommerce'),checked:e.showReviewContent,onChange:function(){return t({showReviewContent:!e.showReviewContent})}}),e.showReviewImage&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{label:Object(o.__)("Review image",'woocommerce'),value:e.imageType,options:[{label:Object(o.__)("Reviewer photo",'woocommerce'),value:"reviewer"},{label:Object(o.__)("Product",'woocommerce'),value:"product"}],onChange:function(e){return t({imageType:e})}}),"reviewer"===e.imageType&&!u.n&&Object(n.createElement)(i.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(c.a)(Object(o.__)("Reviewer photo is disabled in your <a>site settings</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},b=function(e,t){return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Order by",'woocommerce'),checked:e.showOrderby,onChange:function(){return t({showOrderby:!e.showOrderby})}}),Object(n.createElement)(i.SelectControl,{label:Object(o.__)("Order Product Reviews by",'woocommerce'),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:function(e){return t({orderby:e})}}),Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Starting Number of Reviews",'woocommerce'),value:e.reviewsOnPageLoad,onChange:function(e){return t({reviewsOnPageLoad:e})},max:20,min:1}),Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Load more",'woocommerce'),checked:e.showLoadMore,onChange:function(){return t({showLoadMore:!e.showLoadMore})}}),e.showLoadMore&&Object(n.createElement)(i.RangeControl,{label:Object(o.__)("Load More Reviews",'woocommerce'),value:e.reviewsOnLoadMore,onChange:function(e){return t({reviewsOnLoadMore:e})},max:20,min:1}))}},74:function(e,t){},75:function(e,t){},76:function(e,t){},77:function(e,t){},78:function(e,t){},80:function(e,t){},81:function(e,t){},82:function(e,t){},83:function(e,t){},85:function(e,t){},86:function(e,t){},87:function(e,t){},88:function(e,t){},89:function(e,t){},9:function(e,t){!function(){e.exports=this.wp.apiFetch}()},91:function(e,t,r){"use strict";var n=r(16),o=r.n(n),c=r(18),i=r.n(c),a=r(19),s=r.n(a),u=r(17),l=r.n(u),d=r(20),p=r.n(d),b=r(21),f=r.n(b),g=r(11),v=r.n(g),m=r(0),w=r(5),h=r(7),O=r.n(h),j=r(4),y=r(22);r(110);function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v()(e);if(t){var o=v()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var k=function(e){p()(r,e);var t=_(r);function r(){var e;return i()(this,r),(e=t.apply(this,arguments)).onClick=e.onClick.bind(l()(e)),e}return s()(r,[{key:"onClick",value:function(e){this.props.onChange&&this.props.onChange(e.target.value)}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.label,c=r.checked,i=r.instanceId,a=r.className,s=r.help,u=r.options,l=r.value,d="inspector-toggle-button-control-".concat(i);return s&&(e=Object(w.isFunction)(s)?s(c):s),Object(m.createElement)(j.BaseControl,{id:d,help:e,className:O()("components-toggle-button-control",a)},Object(m.createElement)("label",{id:d+"__label",htmlFor:d,className:"components-toggle-button-control__label"},n),Object(m.createElement)(j.ButtonGroup,{"aria-labelledby":d+"__label"},u.map((function(e,r){var c={};return l===e.value?(c.isPrimary=!0,c["aria-pressed"]=!0):(c.isDefault=!0,c["aria-pressed"]=!1),Object(m.createElement)(j.Button,o()({key:"".concat(e.label,"-").concat(e.value,"-").concat(r),value:e.value,onClick:t.onClick,"aria-label":n+": "+e.label},c),e.label)}))))}}]),r}(m.Component);t.a=Object(y.withInstanceId)(k)},92:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(1),o=r(6),c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(n.__)("July 15, 2019",'woocommerce'),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",reviewer:Object(n.__)("Alice",'woocommerce'),review:"<p>".concat(Object(n.__)("I bought this product last week and I'm very happy with it.",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(n.__)("July 12, 2019",'woocommerce'),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(n.__)("WordPress Pennant",'woocommerce'),product_permalink:"#",reviewer:Object(n.__)("Bob",'woocommerce'),review:"<p>".concat(Object(n.__)("This product is awesome, I love it!",'woocommerce'),"</p>\n"),reviewer_avatar_urls:{48:o.o+"img/avatar.jpg",96:o.o+"img/avatar.jpg"},rating:null,verified:!1}]}}},99:function(e,t){}});
[+]
..
[-] products-by-attribute-legacy.js
[edit]
[-] wc-payment-method-stripe.asset.php
[edit]
[-] all-products-frontend.asset.php
[edit]
[-] editor-legacy.css
[edit]
[-] wc-payment-method-paypal.js
[edit]
[-] product-category-legacy.js
[edit]
[-] all-reviews-legacy.js
[edit]
[-] editor-legacy-rtl.css
[edit]
[-] price-filter-frontend.asset.php
[edit]
[-] product-top-rated.asset.php
[edit]
[-] product-categories-legacy.js
[edit]
[-] cart.asset.php
[edit]
[-] featured-product.js
[edit]
[-] product-new-legacy.js
[edit]
[-] featured-product.asset.php
[edit]
[-] featured-category-legacy.js
[edit]
[-] wc-payment-method-cod.js
[edit]
[-] wc-payment-method-bacs.asset.php
[edit]
[-] product-best-sellers-legacy.asset.php
[edit]
[-] price-filter.js
[edit]
[-] wc-blocks-middleware.asset.php
[edit]
[-] reviews-by-product-legacy.asset.php
[edit]
[-] style.css
[edit]
[-] wc-shared-context.asset.php
[edit]
[-] all-reviews.js
[edit]
[-] featured-category.js
[edit]
[-] wc-payment-method-cod.asset.php
[edit]
[-] product-tag-legacy.js
[edit]
[-] active-filters-frontend.js
[edit]
[-] product-top-rated.js
[edit]
[-] active-filters.asset.php
[edit]
[-] style-legacy-rtl.css
[edit]
[-] product-best-sellers-legacy.js
[edit]
[-] reviews-by-category.js
[edit]
[-] product-on-sale.asset.php
[edit]
[-] style-rtl.css
[edit]
[-] product-search-legacy.asset.php
[edit]
[-] reviews-by-product.asset.php
[edit]
[-] all-products-frontend.js
[edit]
[+]
atomic-block-components
[-] all-reviews-legacy.asset.php
[edit]
[-] wc-blocks-data.js
[edit]
[-] handpicked-products.asset.php
[edit]
[-] wc-blocks-middleware.js
[edit]
[-] product-on-sale-legacy.asset.php
[edit]
[-] checkout-frontend.asset.php
[edit]
[-] wc-payment-method-stripe.js
[edit]
[-] price-filter.asset.php
[edit]
[-] cart-frontend.asset.php
[edit]
[-] attribute-filter-frontend.js
[edit]
[-] reviews-frontend.asset.php
[edit]
[-] product-search.asset.php
[edit]
[-] attribute-filter.asset.php
[edit]
[-] wc-payment-method-bacs.js
[edit]
[-] blocks.asset.php
[edit]
[-] wc-settings.asset.php
[edit]
[-] product-search.js
[edit]
[-] cart.js
[edit]
[-] product-best-sellers.js
[edit]
[-] reviews-by-product.js
[edit]
[-] attribute-filter.js
[edit]
[-] reviews-by-category.asset.php
[edit]
[-] blocks.js
[edit]
[-] checkout.asset.php
[edit]
[-] wc-payment-method-paypal.asset.php
[edit]
[-] cart-frontend.js
[edit]
[-] product-search-legacy.js
[edit]
[-] product-on-sale.js
[edit]
[-] attribute-filter-frontend.asset.php
[edit]
[-] reviews-frontend-legacy.js
[edit]
[-] vendors-style-legacy.css
[edit]
[-] blocks-legacy.js
[edit]
[-] price-filter-frontend.js
[edit]
[-] featured-category-legacy.asset.php
[edit]
[-] wc-shared-context.js
[edit]
[-] editor.css
[edit]
[-] style-legacy.css
[edit]
[-] reviews-by-category-legacy.js
[edit]
[-] wc-payment-method-cheque.js
[edit]
[-] product-category-legacy.asset.php
[edit]
[-] product-new.js
[edit]
[-] product-tag.asset.php
[edit]
[-] reviews-frontend.js
[edit]
[-] wc-settings.js
[edit]
[-] vendors.js
[edit]
[-] products-by-attribute-legacy.asset.php
[edit]
[-] product-best-sellers.asset.php
[edit]
[-] reviews-by-product-legacy.js
[edit]
[-] product-on-sale-legacy.js
[edit]
[-] product-tag.js
[edit]
[-] all-products.asset.php
[edit]
[-] vendors-style-rtl.css
[edit]
[-] handpicked-products-legacy.js
[edit]
[-] handpicked-products.js
[edit]
[-] blocks-legacy.asset.php
[edit]
[-] active-filters.js
[edit]
[-] products-by-attribute.js
[edit]
[-] editor-rtl.css
[edit]
[-] wc-shared-hocs.asset.php
[edit]
[-] single-product.asset.php
[edit]
[-] product-categories.js
[edit]
[-] checkout.js
[edit]
[-] product-category.js
[edit]
[-] product-tag-legacy.asset.php
[edit]
[-] single-product-frontend.asset.php
[edit]
[-] wc-payment-method-cheque.asset.php
[edit]
[-] reviews-by-category-legacy.asset.php
[edit]
[-] product-new-legacy.asset.php
[edit]
[-] all-products.js
[edit]
[-] featured-product-legacy.asset.php
[edit]
[-] wc-blocks-data.asset.php
[edit]
[-] reviews-frontend-legacy.asset.php
[edit]
[-] wc-blocks-registry.asset.php
[edit]
[-] checkout-frontend.js
[edit]
[-] products-by-attribute.asset.php
[edit]
[-] vendors-style-legacy-rtl.css
[edit]
[-] active-filters-frontend.asset.php
[edit]
[-] single-product-frontend.js
[edit]
[-] single-product.js
[edit]
[+]
vendors~atomic-block-components
[-] all-reviews.asset.php
[edit]
[-] product-category.asset.php
[edit]
[-] product-top-rated-legacy.js
[edit]
[-] vendors-style.css
[edit]
[-] product-categories.asset.php
[edit]
[-] wc-blocks-registry.js
[edit]
[-] featured-category.asset.php
[edit]
[-] wc-shared-hocs.js
[edit]
[-] handpicked-products-legacy.asset.php
[edit]
[-] featured-product-legacy.js
[edit]
[-] product-top-rated-legacy.asset.php
[edit]
[-] product-new.asset.php
[edit]
[-] product-categories-legacy.asset.php
[edit]
[-] vendors-legacy.js
[edit]