(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[834],{3681:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>oe});var n=r(9196),o=r(5736),a=r(1445),c=r(711),i=r(4184),s=r.n(i),u=r(4293),l=r(9307);r(5138);const m=({currency:e,maxPrice:t,minPrice:r,priceClassName:a,priceStyle:i={}})=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"screen-reader-text"},(0,o.sprintf)(/* translators: %1$s min price, %2$s max price */
(0,o.__)("Price between %1$s and %2$s","woocommerce"),(0,u.formatPrice)(r),(0,u.formatPrice)(t))),(0,n.createElement)("span",{"aria-hidden":!0},(0,n.createElement)(c.FormattedMonetaryAmount,{className:s()("wc-block-components-product-price__value",a),currency:e,value:r,style:i})," — ",(0,n.createElement)(c.FormattedMonetaryAmount,{className:s()("wc-block-components-product-price__value",a),currency:e,value:t,style:i}))),p=({currency:e,regularPriceClassName:t,regularPriceStyle:r,regularPrice:a,priceClassName:i,priceStyle:u,price:l})=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"screen-reader-text"},(0,o.__)("Previous price:","woocommerce")),(0,n.createElement)(c.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,n.createElement)("del",{className:s()("wc-block-components-product-price__regular",t),style:r},e),value:a}),(0,n.createElement)("span",{className:"screen-reader-text"},(0,o.__)("Discounted price:","woocommerce")),(0,n.createElement)(c.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,n.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:l})),d=({align:e,className:t,currency:r,format:o="",maxPrice:a,minPrice:i,price:u,priceClassName:d,priceStyle:g,regularPrice:f,regularPriceClassName:h,regularPriceStyle:y,style:v})=>{const b=s()(t,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});o.includes("")||(o="",console.error("Price formats need to include the `` tag."));const E=f&&u&&u{const m=s()("wc-block-components-product-name",e);if(t){const e=l;return(0,n.createElement)("span",{className:m,...e,dangerouslySetInnerHTML:{__html:(0,g.decodeEntities)(r)}})}return(0,n.createElement)("a",{className:m,href:o,target:a,...l,dangerouslySetInnerHTML:{__html:(0,g.decodeEntities)(r)},style:i})};var h=r(3554);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function v(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:".",r={};return Object.entries(e).forEach((function(e){if("object"===y(e[1])){var n=P(e[1]);Object.entries(n).forEach((function(n){r[e[0]+t+n[0]]=n[1]}))}else r[e[0]]=e[1]})),r}function M(){var e={HALF_ODD:function(e){var t=Math.round(e);return N(e)&&w(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return N(e)?w(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return N(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return N(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return N(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return A(e)||A(t)?function(e,t){var r=function(e){return Math.pow(10,function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}(e))},n=Math.max(r(e),r(t));return Math.round(e*n)*Math.round(t*n)/(n*n)}(e,t):e*t},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(t){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN"](t)}}}var S=M();function C(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var r in t)e=e.replace("{{".concat(r,"}}"),t[r]);return e};return{getExchangeRate:function(r,n){return(o=e.endpoint,!Boolean(o)||"object"!==y(o)&&"function"!=typeof o||"function"!=typeof o.then?function(r,n){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var o=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===o.readyState&&(o.status>=200&&o.status<400?r(JSON.parse(o.responseText)):n(new Error(o.statusText)))},onerror:function(){n(new Error("Network error"))}});o.open("GET",e,!0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r])}(o,t.headers),o.send()}))}(t(e.endpoint,{from:r,to:n}),{headers:e.headers})}(r,n):e.endpoint).then((function(o){return P(o)[t(e.propertyPath,{from:r,to:n})]}));var o}}}function O(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new r(t)}function F(e){O(Number.isInteger(e),"You must provide an integer.",TypeError)}var x=M();const D=Object.assign((function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,o=r.currency,a=r.precision;F(n),F(a);var c=e.globalLocale,i=e.globalFormat,s=e.globalRoundingMode,u=e.globalFormatRoundingMode,l=Object.assign({},e.globalExchangeRatesApi),m=function(t){var r=Object.assign({},Object.assign({},{amount:n,currency:o,precision:a},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:r.amount,currency:r.currency,precision:r.precision}),{locale:r.locale})},p=function(e){O(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return o},getLocale:function(){return this.locale||c},setLocale:function(e){return m.call(this,{locale:e})},getPrecision:function(){return a},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;F(e);var r=this.getPrecision(),n=e>r,o=n?x.multiply:x.divide,a=n?[e,r]:[r,e],c=Math.pow(10,x.subtract.apply(x,a));return m.call(this,{amount:x.round(o(this.getAmount(),c),t),precision:e})},add:function(t){p.call(this,t);var r=e.normalizePrecision([this,t]);return m.call(this,{amount:x.add(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},subtract:function(t){p.call(this,t);var r=e.normalizePrecision([this,t]);return m.call(this,{amount:x.subtract(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return m.call(this,{amount:x.round(x.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return m.call(this,{amount:x.round(x.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return O(function(e){return _(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError),this.multiply(x.divide(e,100),t)},allocate:function(e){var t=this;!function(e){O(function(e){return e.length>0&&e.every((function(e){return e>=0}))&&e.some((function(e){return e>0}))}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var r=e.reduce((function(e,t){return x.add(e,t)})),n=this.getAmount(),o=e.map((function(e){var o=Math.floor(x.divide(x.multiply(t.getAmount(),e),r));return n=x.subtract(n,o),m.call(t,{amount:o})})),a=0;n>0;)e[a]>0&&(o[a]=o[a].add(m.call(this,{amount:1})),n=x.subtract(n,1)),a+=1;return o},convert:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.endpoint,o=void 0===n?l.endpoint:n,a=r.propertyPath,c=void 0===a?l.propertyPath||"rates.{{to}}":a,i=r.headers,u=void 0===i?l.headers:i,p=r.roundingMode,d=void 0===p?s:p,g=Object.assign({},{endpoint:o,propertyPath:c,headers:u,roundingMode:d});return C(g).getExchangeRate(this.getCurrency(),e).then((function(r){return O(!k(r),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),m.call(t,{amount:x.round(x.multiply(t.getAmount(),parseFloat(r)),g.roundingMode),currency:e})}))},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){p.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()r[1].getAmount()},greaterThanOrEqual:function(t){p.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()>=r[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==x.modulo(this.getAmount(),Math.pow(10,a))},hasCents:function(){return 0!==x.modulo(this.getAmount(),Math.pow(10,a))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var r=e.normalizePrecision([this,t]);return r[0].getAmount()===r[1].getAmount()},toFormat:function(){var e,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r=(e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(arguments.length>0&&void 0!==arguments[0]?arguments[0]:i),{getMatches:function(){return null!==e?e.slice(1).filter((function(e){return!k(e)})):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return k(this.getMatches().find(e))?0:this.getMatches()[S.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(e){return"USD"===e||"dollar"===e||"$"===e}))]},getStyle:function(){return k(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!k(this.getMatches().find((function(e){return","===e})))}});return this.toRoundedUnit(r.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:r.getCurrencyDisplay(),useGrouping:r.getUseGrouping(),minimumFractionDigits:r.getMinimumFractionDigits(),style:r.getStyle(),currency:this.getCurrency()})},toUnit:function(){return x.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r=Math.pow(10,e);return x.divide(x.round(x.multiply(this.toUnit(),r),t),r)},toObject:function(){return{amount:n,currency:o,precision:a}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},E);var R=r(4617),I=r(4055),T=r(2646);r(6315);const L=({children:e,className:t})=>(0,n.createElement)("div",{className:s()("wc-block-components-product-badge",t)},e),j=()=>(0,n.createElement)(L,{className:"wc-block-components-product-backorder-badge"},(0,o.__)("Available on backorder","woocommerce")),$=({image:e={},fallbackAlt:t=""})=>{const r=e.thumbnail?{src:e.thumbnail,alt:(0,g.decodeEntities)(e.alt)||t||"Product Image"}:{src:R.PLACEHOLDER_IMG_SRC,alt:""};return(0,n.createElement)("img",{...r,alt:r.alt})},H=({lowStockRemaining:e})=>e?(0,n.createElement)(L,{className:"wc-block-components-product-low-stock-badge"},(0,o.sprintf)(/* translators: %d stock amount (number of items in stock for product) */
(0,o.__)("%d left in stock","woocommerce"),e)):null;var U=function(){return U=Object.assign||function(e){for(var t,r=1,n=arguments.length;rArray.isArray(e)?0===(e=e.filter((e=>!e.hidden))).length?null:(0,n.createElement)("ul",{className:"wc-block-components-product-details"},e.map((e=>{const t=(null==e?void 0:e.key)||e.name||"",r=(null==e?void 0:e.className)||(t?`wc-block-components-product-details__${o=t,void 0===a&&(a={}),function(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,n=void 0===r?W:r,o=t.stripRegexp,a=void 0===o?Z:o,c=t.transform,i=void 0===c?z:c,s=t.delimiter,u=void 0===s?" ":s,l=q(q(e,n,"$1\0$2"),a,"\0"),m=0,p=l.length;"\0"===l.charAt(m);)m++;for(;"\0"===l.charAt(p-1);)p--;return l.slice(m,p).split("\0").map(i).join(u)}(e,U({delimiter:"."},t))}(o,U({delimiter:"-"},a))}`:"");var o,a;return(0,n.createElement)("li",{key:t+(e.display||e.value),className:r},t&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-block-components-product-details__name"},(0,g.decodeEntities)(t),":")," "),(0,n.createElement)("span",{className:"wc-block-components-product-details__value"},(0,g.decodeEntities)(e.display||e.value)))}))):null;var Y=r(987);const G=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),B=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t;var J=r(5266);const X=({source:e,maxLength:t=15,countType:r="words",className:o="",style:a={}})=>{const c=(0,l.useMemo)((()=>((e,t=15,r="words")=>{const n=(0,Y.autop)(e);if((0,J.count)(n,r)<=t)return n;const o=(e=>{const t=e.indexOf("
");return-1===t?e:e.substr(0,t+4)})(n);return(0,J.count)(o,r)<=t?o:"words"===r?((e,t,r="…",n=!0)=>{const o=G(e),a=o.split(" ").splice(0,t).join(" ");return a===o?n?(0,Y.autop)(o):o:n?(0,Y.autop)(B(a,r)):B(a,r)})(o,t):((e,t,r=!0,n="…",o=!0)=>{const a=G(e),c=a.slice(0,t);if(c===a)return o?(0,Y.autop)(a):a;if(r)return(0,Y.autop)(B(c,n));const i=c.match(/([\s]+)/g),s=i?i.length:0,u=a.slice(0,t+s);return o?(0,Y.autop)(B(u,n)):B(u,n)})(o,t,"characters_including_spaces"===r)})(e,t,r)),[e,t,r]);return(0,n.createElement)(l.RawHTML,{style:a,className:o},c)};var K=r(5271);const Q=({className:e,shortDescription:t="",fullDescription:r=""})=>{const o=t||r;return o?(0,n.createElement)(X,{className:e,source:o,maxLength:15,countType:K.Cm.wordCountType||"words"}):null};r(9889);const ee=({shortDescription:e="",fullDescription:t="",itemData:r=[],variation:o=[]})=>(0,n.createElement)("div",{className:"wc-block-components-product-metadata"},(0,n.createElement)(Q,{className:"wc-block-components-product-metadata__description",shortDescription:e,fullDescription:t}),(0,n.createElement)(V,{details:r}),(0,n.createElement)(V,{details:o.map((({attribute:e="",value:t})=>({key:e,value:t})))})),te=e=>(0,h.mustContain)(e,""),re=({cartItem:e})=>{const{images:t,low_stock_remaining:r,show_backorder_badge:a,name:i,permalink:m,prices:p,quantity:g,short_description:y,description:v,item_data:b,variation:E,totals:_,extensions:w}=e,{receiveCart:A,...N}=(0,I.b)(),k=(0,l.useMemo)((()=>({context:"summary",cartItem:e,cart:N})),[e,N]),P=(0,u.getCurrencyFromPriceResponse)(p),M=(0,h.applyCheckoutFilter)({filterName:"itemName",defaultValue:i,extensions:w,arg:k}),S=D({amount:parseInt(p.raw_prices.regular_price,10),precision:(0,T.H)(p.raw_prices.precision)?parseInt(p.raw_prices.precision,10):p.raw_prices.precision}).convertPrecision(P.minorUnit).getAmount(),C=D({amount:parseInt(p.raw_prices.price,10),precision:(0,T.H)(p.raw_prices.precision)?parseInt(p.raw_prices.precision,10):p.raw_prices.precision}).convertPrecision(P.minorUnit).getAmount(),O=(0,u.getCurrencyFromPriceResponse)(_);let F=parseInt(_.line_subtotal,10);(0,R.getSetting)("displayCartPricesIncludingTax",!1)&&(F+=parseInt(_.line_subtotal_tax,10));const x=D({amount:F,precision:O.minorUnit}).getAmount(),L=(0,h.applyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"",extensions:w,arg:k,validation:te}),U=(0,h.applyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"",extensions:w,arg:k,validation:te}),z=(0,h.applyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:w,arg:k});return(0,n.createElement)("div",{className:s()("wc-block-components-order-summary-item",z)},(0,n.createElement)("div",{className:"wc-block-components-order-summary-item__image"},(0,n.createElement)("div",{className:"wc-block-components-order-summary-item__quantity"},(0,n.createElement)(c.Label,{label:g.toString(),screenReaderLabel:(0,o.sprintf)(/* translators: %d number of products of the same type in the cart */
(0,o._n)("%d item","%d items",g,"woocommerce"),g)})),(0,n.createElement)($,{image:t.length?t[0]:{},fallbackAlt:M})),(0,n.createElement)("div",{className:"wc-block-components-order-summary-item__description"},(0,n.createElement)(f,{disabled:!0,name:M,permalink:m}),(0,n.createElement)(d,{currency:P,price:C,regularPrice:S,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:L}),a?(0,n.createElement)(j,null):!!r&&(0,n.createElement)(H,{lowStockRemaining:r}),(0,n.createElement)(ee,{shortDescription:y,fullDescription:v,itemData:b,variation:E})),(0,n.createElement)("span",{className:"screen-reader-text"},(0,o.sprintf)(/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */
(0,o._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",g,"woocommerce"),g,M,(0,u.formatPrice)(x,O))),(0,n.createElement)("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},(0,n.createElement)(d,{currency:O,format:U,price:x})))};r(2911);const ne=({cartItems:e=[]})=>{const{isLarge:t,hasContainerWidth:r}=(0,a.N)();return r?(0,n.createElement)(c.Panel,{className:"wc-block-components-order-summary",initialOpen:t,hasBorder:!1,title:(0,n.createElement)("span",{className:"wc-block-components-order-summary__button-text"},(0,o.__)("Order summary","woocommerce"))},(0,n.createElement)("div",{className:"wc-block-components-order-summary__content"},e.map((e=>(0,n.createElement)(re,{key:e.key,cartItem:e}))))):null},oe=({className:e})=>{const{cartItems:t}=(0,I.b)();return(0,n.createElement)(c.TotalsWrapper,{className:e},(0,n.createElement)(ne,{cartItems:t}))}},2911:()=>{},6315:()=>{},7984:()=>{},9889:()=>{},5641:()=>{},5138:()=>{}}]);