1"use strict";(self.webpackChunkshopwp=self.webpackChunkshopwp||[]).push([["ProductPricing-public"],{"./node_modules/lodash-es/_baseExtremum.js"(e,t,r){r.d(t,{A:()=>n});var s=r("./node_modules/lodash-es/isSymbol.js");const n=function(e,t,r){for(var n=-1,c=e.length;++n<c;){var a=e[n],o=t(a);if(null!=o&&(void 0===i?o==o&&!(0,s.A)(o):r(o,i)))var i=o,p=a}return p}},"./node_modules/lodash-es/last.js"(e,t,r){r.d(t,{A:()=>s});const s=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},"./node_modules/lodash-es/max.js"(e,t,r){r.d(t,{A:()=>a});var s=r("./node_modules/lodash-es/_baseExtremum.js");const n=function(e,t){return e>t};var c=r("./node_modules/lodash-es/identity.js");const a=function(e){return e&&e.length?(0,s.A)(e,c.A,n):void 0}},"./node_modules/lodash-es/min.js"(e,t,r){r.d(t,{A:()=>a});var s=r("./node_modules/lodash-es/_baseExtremum.js");const n=function(e,t){return e<t};var c=r("./node_modules/lodash-es/identity.js");const a=function(e){return e&&e.length?(0,s.A)(e,c.A,n):void 0}},"./npm-packages/@shopwp/components/src/price/index.jsx"(e,t,r){r.d(t,{A:()=>c});var s=r("./npm-packages/@shopwp/common/src/utils/index.jsx"),n=r("./npm-packages/@shopwp/components/src/shop/_state/hooks.js");const c=function(e){var t=e.price,r=(0,n.T)();return React.createElement(React.Fragment,null,(0,s.Sx)(t,r))}},"./npm-packages/@shopwp/components/src/products/product/pricing/index.jsx"(e,t,r){r.r(t),r.d(t,{default:()=>g});var s=r("./npm-packages/@shopwp/components/src/products/product/_state/hooks.jsx"),n=r("./npm-packages/@shopwp/components/src/shop/_state/hooks.js"),c=r("./npm-packages/@shopwp/components/src/products/product/pricing/price/index.jsx"),a=r("./npm-packages/@shopwp/common/src/utils/index.jsx"),o=r("./npm-packages/@shopwp/components/src/items/_state/settings/hooks.jsx"),i=r("./node_modules/lodash-es/min.js"),p=r("./node_modules/lodash-es/max.js"),l=wp.element.lazy((function(){return r.e("ProductPricesCompareAt-public").then(r.bind(r,"./npm-packages/@shopwp/components/src/products/product/pricing/compare-at/index.jsx"))})),m=wp.element.lazy((function(){return r.e("ProductPricesSubscription-public").then(r.bind(r,"./npm-packages/@shopwp/components/src/products/product/pricing/subscription/index.jsx"))}));function d(){var e=(0,o.s)(),t=(0,s.k)(),r=(0,n.T)(),d=wp.element.Suspense;function u(t){return!!e.showPriceRange&&t.regPrices.length>1}function g(){if(!e.showCompareAt)return!1;if(t.selectedVariant){if(t.selectedVariant.compareAtPrice&&t.selectedVariant.compareAtPrice.amount)return"0"!==t.selectedVariant.compareAtPrice.amount&&"0.0"!==t.selectedVariant.compareAtPrice.amount&&"0.00"!==t.selectedVariant.compareAtPrice.amount}else if(!t.hasManyVariants&&t.payload.variants.edges.length&&t.payload.variants.edges[0].node.compareAtPrice)return!0;return!1}var h=(0,a.r3)(t.payload);return React.createElement("div",{className:"swp-mb20 swp-l-col swp-l-baseline swp-l-rel100 swp-product-pricing "+e.pricingClassName,"data-show-price-range":u(h),"data-is-selected":!!t.selectedVariant,"data-show-sale-pricing":g(),"aria-label":"Product Pricing",itemScope:!0,itemProp:"offers",itemType:"https://schema.org/Offer"},u(h)?React.createElement(React.Fragment,null,React.createElement("meta",{itemProp:"minPrice",content:(0,i.A)(h.regPrices)}),React.createElement("meta",{itemProp:"maxPrice",content:(0,p.A)(h.regPrices)})):null,React.createElement("meta",{itemProp:"availability",href:"https://schema.org/".concat(t.payload.availableForSale?"InStock":"OutOfStock"),content:t.payload.availableForSale?"In stock":"Out of stock"}),React.createElement("meta",{itemProp:"price",content:h.regPrices[0]}),React.createElement("meta",{itemProp:"priceCurrency",content:r.currency}),React.createElement(a.W,{name:"before.productPricing",args:[t]}),t.subscriptionPricing?React.createElement("div",{className:"swp-l-row swp-l-baseline swp-m-l-row"},React.createElement(m,{productState:t,subType:t.activeSellingGroup,insideSubscriptionsWidget:!1})):g()?React.createElement(d,{fallback:!1},React.createElement(l,{selectedVariant:t.selectedVariant,compareAt:e.showCompareAt,productState:t,prices:h,settings:e})):React.createElement(c.A,{selectedVariant:t.selectedVariant,compareAt:!1,showPriceRange:u(h),prices:h}),React.createElement(a.W,{name:"after.productPricing",args:[t]}))}var u=r("./npm-packages/@shopwp/hooks/src/index.js");const g=function(){var e=(0,o.s)();return(0,u.WP)(React.createElement(d,null),e.dropzoneProductPricing)}},"./npm-packages/@shopwp/components/src/products/product/pricing/price/index.jsx"(e,t,r){r.d(t,{A:()=>k});var s=r("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),n=r("./node_modules/lodash-es/isEmpty.js"),
1c=r("./node_modules/lodash-es/last.js"),a=r("./node_modules/lodash-es/min.js"),o=r("./node_modules/lodash-es/max.js"),i=r("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),p=r("./npm-packages/@shopwp/components/src/price/index.jsx"),l=wp.element.forwardRef((function(e,t){return!1!==e.price||null!==e.price?React.createElement("span",{ref:t,className:"swp-price swp-product-price wps-product-individual-price","data-price":e.price,"data-is-compare-at":e.compareAt},React.createElement(p.A,{price:e.price})):null}));const m=wp.element.memo(l),d=wp.element.memo((function(e){var t=e.firstPrice,r=e.compareAt,s=e.showPriceRange,n=e.pricingColor,c=e.settings;return React.createElement("p",{className:"swp-l-row swp-l-baseline swp-m-l-row swp-0"},React.createElement("span",{className:"swp-price-label"},"From"),React.createElement(m,{price:t,compareAt:r,showPriceRange:s,pricingColor:n,settings:c}))})),u=function(e){var t=e.firstPrice,r=e.lastPrice,s=e.isFirstAndLastSame,n=e.compareAt,c=e.showPriceRange,a=e.pricingColor,o=e.settings,p=(0,i.AH)("margin-top:0;position:",c&&n?"relative":"static",";display:flex;align-items:baseline;height:100%;line-height:1;align-items:center;;label:showPriceRangeStyles;");return(0,i.Y)("span",{className:"wps-pricing-range-wrapper",css:p},s?(0,i.Y)(m,{showPriceRange:c,price:t,compareAt:n,pricingColor:a,settings:o}):(0,i.Y)(d,{firstPrice:t,lastPrice:r,compareAt:n,showPriceRange:c,pricingColor:a,settings:o}))};var g=r("./npm-packages/@shopwp/common/src/utils/index.jsx"),h=r("./npm-packages/@shopwp/components/src/items/_state/settings/hooks.jsx"),w=wp.element,P=w.useEffect,f=w.useRef,A=w.useState;function R(e,t){return(0,n.A)(e)?0:(0,c.A)(e[t])}const k=function(e){var t=e.prices,r=e.compareAt,c=e.showPriceRange,i=e.selectedVariant,p=(0,h.s)(),l=f(),d=A((function(){return _()})),w=(0,s.A)(d,2),k=w[0],v=w[1],j=A((function(){return(0,g._k)(t)})),x=(0,s.A)(j,2),b=x[0],E=x[1];function _(){return r?c?(0,a.A)(t.compareAtPrices):(0,g._k)(t):c?(0,a.A)(t.regPrices):function(e){return(0,n.A)(e)?0:e.regPrices[0]}(t)}function y(){return r?c?(0,o.A)(t.compareAtPrices):function(e){return R(e,"compareAtPrices")}(t):c?(0,o.A)(t.regPrices):function(e){return R(e,"regPrices")}(t)}return P((function(){i?(i.compareAtPrice?E(i.compareAtPrice.amount):E(!1),v(i.price.amount)):(E((0,g._k)(t)),v(_()))}),[i]),React.createElement("span",{className:"swp-product-price wps-products-price wps-product-pricing wps-products-price-one"},c&&!i?React.createElement(u,{firstPrice:_(),lastPrice:y(),isFirstAndLastSame:_()===y(),compareAt:r,showPriceRange:c,pricingColor:p.pricingColor,settings:p}):React.createElement(m,{ref:l,price:r?b:k,compareAt:r,showPriceRange:c,pricingColor:p.pricingColor,settings:p}))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.