51 lines
189 KiB
JavaScript
51 lines
189 KiB
JavaScript
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks.checkout=function(e){function t(t){for(var o,s,a=t[0],i=t[1],l=t[2],p=0,d=[];p<a.length;p++)s=a[p],Object.prototype.hasOwnProperty.call(n,s)&&n[s]&&d.push(n[s][0]),n[s]=0;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o]);for(u&&u(t);d.length;)d.shift()();return r.push.apply(r,l||[]),c()}function c(){for(var e,t=0;t<r.length;t++){for(var c=r[t],o=!0,a=1;a<c.length;a++){var i=c[a];0!==n[i]&&(o=!1)}o&&(r.splice(t--,1),e=s(s.s=c[0]))}return e}var o={},n={12:0,1:0,4:0},r=[];function s(t){if(o[t])return o[t].exports;var c=o[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,s),c.l=!0,c.exports}s.m=e,s.c=o,s.d=function(e,t,c){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(s.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)s.d(c,o,function(t){return e[t]}.bind(null,o));return c},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=i;return r.push([427,0]),c()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.wc.wcSettings},,function(e,t){e.exports=window.wp.blockEditor},,function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wc.blocksCheckout},,function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.url},,function(e,t,c){"use strict";c.d(t,"o",(function(){return r})),c.d(t,"m",(function(){return s})),c.d(t,"l",(function(){return a})),c.d(t,"n",(function(){return i})),c.d(t,"j",(function(){return l})),c.d(t,"e",(function(){return u})),c.d(t,"g",(function(){return p})),c.d(t,"k",(function(){return d})),c.d(t,"c",(function(){return b})),c.d(t,"d",(function(){return m})),c.d(t,"h",(function(){return g})),c.d(t,"a",(function(){return h})),c.d(t,"i",(function(){return O})),c.d(t,"b",(function(){return _})),c.d(t,"f",(function(){return k}));var o,n=c(3);const r=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=r.pluginUrl+"images/",a=r.pluginUrl+"build/",i=r.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,u=n.STORE_PAGES.checkout.id,p=(n.STORE_PAGES.checkout.permalink,n.STORE_PAGES.privacy.permalink),d=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),b=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),h=Object(n.getSetting)("allowedCountries",{}),O=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{}),k=Object(n.getSetting)("localPickupEnabled",!1)},function(e,t,c){"use strict";c.d(t,"b",(function(){return o})),c.d(t,"c",(function(){return n})),c.d(t,"a",(function(){return r}));const o=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function n(e,t){return o(e)&&t in e}const r=e=>0===Object.keys(e).length},,function(e,t){e.exports=window.wc.priceFormat},,,,function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,c){"use strict";c.d(t,"h",(function(){return l})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return p})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return b})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return h})),c.d(t,"a",(function(){return O}));var o=c(17),n=c(16),r=c.n(n),s=c(9),a=c(3),i=c(19);const l=e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const a=(e=>{let{selected:t=[],search:c="",queryArgs:n={}}=e;const r=i.o.productCount>100,s={per_page:r?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},a=[Object(o.addQueryArgs)("/wc/store/v1/products",{...s,...n})];return r&&t.length&&a.push(Object(o.addQueryArgs)("/wc/store/v1/products",{catalog_visibility:"any",include:t,per_page:0})),a})({selected:t,search:c,queryArgs:n});return Promise.all(a.map(e=>r()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>r()({path:"/wc/store/v1/products/"+e}),p=()=>r()({path:"wc/store/v1/products/attributes"}),d=e=>r()({path:`wc/store/v1/products/attributes/${e}/terms`}),b=e=>{let{selected:t=[],search:c}=e;const n=(e=>{let{selected:t=[],search:c}=e;const n=Object(a.getSetting)("limitTags",!1),r=[Object(o.addQueryArgs)("wc/store/v1/products/tags",{per_page:n?100:0,orderby:n?"count":"name",order:n?"desc":"asc",search:c})];return n&&t.length&&r.push(Object(o.addQueryArgs)("wc/store/v1/products/tags",{include:t})),r})({selected:t,search:c});return Promise.all(n.map(e=>r()({path:e}))).then(e=>Object(s.uniqBy)(Object(s.flatten)(e),"id"))},m=e=>r()({path:Object(o.addQueryArgs)("wc/store/v1/products/categories",{per_page:0,...e})}),g=e=>r()({path:"wc/store/v1/products/categories/"+e}),h=e=>r()({path:Object(o.addQueryArgs)("wc/store/v1/products",{per_page:0,type:"variation",parent:e})}),O=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t){e.exports=window.React},,function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n);t.a=e=>{let t,{label:c,screenReaderLabel:n,wrapperElement:s,wrapperProps:a={}}=e;const i=null!=c,l=null!=n;return!i&&l?(t=s||"span",a={...a,className:r()(a.className,"screen-reader-text")},Object(o.createElement)(t,a,n)):(t=s||o.Fragment,i&&l&&c!==n?Object(o.createElement)(t,a,Object(o.createElement)("span",{"aria-hidden":"true"},c),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,a,c))}},,,,,,function(e,t){e.exports=window.wp.deprecated},,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(138),a=c(4),i=c.n(a);c(144);const l=e=>({thousandSeparator:null==e?void 0:e.thousandSeparator,decimalSeparator:null==e?void 0:e.decimalSeparator,fixedDecimalScale:!0,prefix:null==e?void 0:e.prefix,suffix:null==e?void 0:e.suffix,isNumericString:!0});t.a=e=>{var t;let{className:c,value:o,currency:a,onValueChange:u,displayType:p="text",...d}=e;const b="string"==typeof o?parseInt(o,10):o;if(!Number.isFinite(b))return null;const m=b/10**a.minorUnit;if(!Number.isFinite(m))return null;const g=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",c),h=null!==(t=d.decimalScale)&&void 0!==t?t:null==a?void 0:a.minorUnit,O={...d,...l(a),decimalScale:h,value:void 0,currency:void 0,onValueChange:void 0},_=u?e=>{const t=+e.value*10**a.minorUnit;u(t)}:()=>{};return Object(r.createElement)(s.a,n()({className:g,displayType:p},O,{value:m,onValueChange:_}))}},function(e,t){e.exports=window.wc.wcBlocksRegistry},,,,,function(e,t){e.exports=window.wp.a11y},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(0),n=c(26),r=c.n(n);function s(e){const t=Object(o.useRef)(e);return r()(e,t.current)||(t.current=e),t.current}},function(e,t,c){"use strict";c.d(t,"a",(function(){return j}));var o=c(9),n=c(0),r=c(10),s=c(7),a=c(15),i=c(263),l=c(87);var u=c(262);const p=e=>{const t=null==e?void 0:e.detail;t&&t.preserveCartData||Object(s.dispatch)(r.CART_STORE_KEY).invalidateResolutionForStore()},d=e=>{(null!=e&&e.persisted||"back_forward"===(window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:""))&&Object(s.dispatch)(r.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(n.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),(null===(e=window.wcBlocksStoreCartListeners)||void 0===e?void 0:e.count)>0)return void window.wcBlocksStoreCartListeners.count++;var e;document.body.addEventListener("wc-blocks_added_to_cart",p),document.body.addEventListener("wc-blocks_removed_from_cart",p),window.addEventListener("pageshow",d);const t=Object(u.a)("added_to_cart","wc-blocks_added_to_cart"),c=Object(u.a)("removed_from_cart","wc-blocks_removed_from_cart");window.wcBlocksStoreCartListeners.count=1,window.wcBlocksStoreCartListeners.remove=()=>{document.body.removeEventListener("wc-blocks_added_to_cart",p),document.body.removeEventListener("wc-blocks_removed_from_cart",p),window.removeEventListener("pageshow",d),t(),c()}})(),b),[])},g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h={...g,email:""},O={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:r.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},_=e=>Object.fromEntries(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(a.decodeEntities)(c)]})),k={cartCoupons:r.EMPTY_CART_COUPONS,cartItems:r.EMPTY_CART_ITEMS,cartFees:r.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,crossSellsProducts:r.EMPTY_CART_CROSS_SELLS,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:r.EMPTY_CART_ITEM_ERRORS,cartTotals:O,cartIsLoading:!0,cartErrors:r.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,shippingRates:r.EMPTY_SHIPPING_RATES,isLoadingRates:!1,cartHasCalculatedShipping:!1,paymentMethods:r.EMPTY_PAYMENT_METHODS,paymentRequirements:r.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},receiveCartContents:()=>{},extensions:r.EMPTY_EXTENSIONS},j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(l.b)(),a=null==c?void 0:c.previewCart,{shouldSelect:u}=e,p=Object(n.useRef)();m();const d=Object(s.useSelect)((e,c)=>{let{dispatch:o}=c;if(!u)return k;if(t)return{cartCoupons:a.coupons,cartItems:a.items,crossSellsProducts:a.cross_sells,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:r.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:r.EMPTY_CART_ERRORS,billingData:h,billingAddress:h,shippingAddress:g,extensions:r.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{},receiveCartContents:"function"==typeof(null==a?void 0:a.receiveCartContents)?a.receiveCartContents:()=>{}};const n=e(r.CART_STORE_KEY),s=n.getCartData(),l=n.getCartErrors(),p=n.getCartTotals(),d=!n.hasFinishedResolution("getCartData"),b=n.isCustomerDataUpdating(),{receiveCart:m,receiveCartContents:O}=o(r.CART_STORE_KEY),j=_(s.billingAddress),E=s.needsShipping?_(s.shippingAddress):j,y=s.fees.length>0?s.fees.map(e=>_(e)):r.EMPTY_CART_FEES;return{cartCoupons:s.coupons.length>0?s.coupons.map(e=>({...e,label:e.code})):r.EMPTY_CART_COUPONS,cartItems:s.items,crossSellsProducts:s.crossSells,cartFees:y,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:p,cartIsLoading:d,cartErrors:l,billingData:Object(i.a)(j),billingAddress:Object(i.a)(j),shippingAddress:Object(i.a)(E),extensions:s.extensions,shippingRates:s.shippingRates,isLoadingRates:b,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:m,receiveCartContents:O}},[u]);return p.current&&Object(o.isEqual)(p.current,d)||(p.current=d),p.current}},function(e,t){e.exports=window.wp.hooks},,,,,,,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(69),a=c(122);const i=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"];t.a=e=>{let{children:t,style:c={},...o}=e;const l=Object(r.useRef)(null),u=()=>{l.current&&s.focus.focusable.find(l.current).forEach(e=>{i.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")})},p=Object(a.a)(u,0,{leading:!0});return Object(r.useLayoutEffect)(()=>{let e;return u(),l.current&&(e=new window.MutationObserver(p),e.observe(l.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),p.cancel()}},[p]),Object(r.createElement)("div",n()({ref:l,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...c}},o),t)}},function(e,t){e.exports=window.wp.keycodes},,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(172),a=c(4),i=c.n(a),l=c(102);c(176),t.a=e=>{let{className:t,showSpinner:c=!1,children:o,variant:a="contained",...u}=e;const p=i()("wc-block-components-button","wp-element-button",t,a,{"wc-block-components-button--loading":c});return Object(r.createElement)(s.a,n()({className:p},u),c&&Object(r.createElement)(l.a,null),Object(r.createElement)("span",{className:"wc-block-components-button__text"},o))}},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"e",(function(){return r})),c.d(t,"d",(function(){return s})),c.d(t,"b",(function(){return i})),c.d(t,"c",(function(){return l}));var o=c(20);const n=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];let r,s;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),function(e){e.CART="wc/cart",e.CHECKOUT="wc/checkout",e.PAYMENTS="wc/checkout/payments",e.EXPRESS_PAYMENTS="wc/checkout/express-payments",e.CONTACT_INFORMATION="wc/checkout/contact-information",e.SHIPPING_ADDRESS="wc/checkout/shipping-address",e.BILLING_ADDRESS="wc/checkout/billing-address",e.SHIPPING_METHODS="wc/checkout/shipping-methods",e.CHECKOUT_ACTIONS="wc/checkout/checkout-actions"}(s||(s={}));const a=(e,t)=>Object(o.b)(e)&&"type"in e&&e.type===t,i=e=>a(e,r.ERROR),l=e=>a(e,r.FAIL)},,function(e,t){e.exports=window.wp.autop},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>"string"==typeof e},,function(e,t){e.exports=window.wp.dom},,,,,function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(4),s=c.n(r),a=(c(281),c(102));t.a=e=>{let{children:t,className:c,screenReaderLabel:r,showSpinner:i=!1,isLoading:l=!0}=e;return Object(o.createElement)("div",{className:s()(c,{"wc-block-components-loading-mask":l})},l&&i&&Object(o.createElement)(a.a,null),Object(o.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":l}),"aria-hidden":l},t),l&&Object(o.createElement)("span",{className:"screen-reader-text"},r||Object(n.__)("Loading…","woocommerce")))}},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o="wc/store/payment";let n;!function(e){e.IDLE="idle",e.EXPRESS_STARTED="express_started",e.PROCESSING="processing",e.READY="ready",e.ERROR="has_error"}(n||(n={}))},,,,,,function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(38),s=c(4),a=c.n(s),i=c(22);c(175);const l=e=>{let{currency:t,maxPrice:c,minPrice:s,priceClassName:l,priceStyle:u={}}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(n.sprintf)(
|
||
/* translators: %1$s min price, %2$s max price */
|
||
Object(n.__)("Price between %1$s and %2$s","woocommerce"),Object(i.formatPrice)(s),Object(i.formatPrice)(c))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(r.a,{className:a()("wc-block-components-product-price__value",l),currency:t,value:s,style:u})," — ",Object(o.createElement)(r.a,{className:a()("wc-block-components-product-price__value",l),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:s,regularPrice:i,priceClassName:l,priceStyle:u,price:p}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Previous price:","woocommerce")),Object(o.createElement)(r.a,{currency:t,renderText:e=>Object(o.createElement)("del",{className:a()("wc-block-components-product-price__regular",c),style:s},e),value:i}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(n.__)("Discounted price:","woocommerce")),Object(o.createElement)(r.a,{currency:t,renderText:e=>Object(o.createElement)("ins",{className:a()("wc-block-components-product-price__value","is-discounted",l),style:u},e),value:p}))};t.a=e=>{let{align:t,className:c,currency:n,format:s="<price/>",maxPrice:i,minPrice:p,price:d,priceClassName:b,priceStyle:m,regularPrice:g,regularPriceClassName:h,regularPriceStyle:O,spacingStyle:_}=e;const k=a()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));const j=g&&d!==g;let E=Object(o.createElement)("span",{className:a()("wc-block-components-product-price__value",b)});return j?E=Object(o.createElement)(u,{currency:n,price:d,priceClassName:b,priceStyle:m,regularPrice:g,regularPriceClassName:h,regularPriceStyle:O}):void 0!==p&&void 0!==i?E=Object(o.createElement)(l,{currency:n,maxPrice:i,minPrice:p,priceClassName:b,priceStyle:m}):d&&(E=Object(o.createElement)(r.a,{className:a()("wc-block-components-product-price__value",b),currency:n,value:d,style:m})),Object(o.createElement)("span",{className:k,style:_},Object(o.createInterpolateElement)(s,{price:E}))}},function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n);c(217),t.a=e=>{let{children:t,className:c}=e;return Object(o.createElement)("div",{className:r()("wc-block-components-product-badge",c)},t)}},,function(e,t,c){"use strict";c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return a}));var o=c(0),n=c(7);const r=Object(o.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>({})}),s=()=>Object(o.useContext)(r),a=e=>{let{children:t,currentPostId:c=0,previewData:s={},currentView:a="",isPreview:i=!1}=e;const l=Object(n.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),u=Object(o.useCallback)(e=>s&&e in s?s[e]:{},[s]),p={isEditor:!0,currentPostId:l,currentView:a,previewData:s,getPreviewData:u,isPreview:i};return Object(o.createElement)(r.Provider,{value:p},t)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(47),n=c(0),r=c(46);const s=()=>{const e=Object(r.a)(),t=Object(n.useRef)(e);return Object(n.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(n.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(n.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},,,,,,,function(e,t){e.exports=window.wp.wordcount},,,function(e,t,c){"use strict";var o=c(3),n=c(1),r=c(152),s=c(67);const a=Object(o.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(n.sprintf)(
|
||
/* translators: %s Field label. */
|
||
Object(n.__)("%s (optional)","woocommerce"),e.label)),e.priority&&(Object(r.a)(e.priority)&&(t.index=e.priority),Object(s.a)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(a).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,i(c)]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{})]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=c&&void 0!==l[c]?l[c]:{};return e.map(e=>({key:e,...o.defaultAddressFields[e]||{},...n[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";var o=c(0);c(177),t.a=()=>Object(o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0);function n(e,t){const c=Object(o.useRef)();return Object(o.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return a}));var o=c(9);let n;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));const r={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e})},s={},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,{type:t,eventType:c,id:o,callback:r,priority:a}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case n.ADD_EVENT_CALLBACK:return i.set(o,{priority:a,callback:r}),{...e,[c]:i};case n.REMOVE_EVENT_CALLBACK:return i.delete(o),{...e,[c]:i}}}},,,,,,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(15),a=c(4),i=c.n(a);c(174),t.a=e=>{let{className:t="",disabled:c=!1,name:o,permalink:a="",target:l,rel:u,style:p,onClick:d,...b}=e;const m=i()("wc-block-components-product-name",t);if(c){const e=b;return Object(r.createElement)("span",n()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(o)}}))}return Object(r.createElement)("a",n()({className:m,href:a,target:l},b,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(o)},style:p}))}},,function(e,t,c){"use strict";c.d(t,"b",(function(){return C})),c.d(t,"a",(function(){return S}));var o=c(0),n=c(103),r=c(36),s=c.n(r),a=c(7),i=c(10),l=c(105),u=c(271);var p=c(61),d=c(88),b=c(23),m=c.n(b);const g={},h=(e,t,c)=>{const o=((e,t)=>c=>((null==c?void 0:c.paymentRequirements)||[]).every(e=>t.includes(e))&&e(c))(e,t);return Object.values(g).some(e=>c in e)?((e,t,c)=>o=>{let n=e(o);if(n){const e={};Object.entries(t).forEach(t=>{let[o,n]=t;c in n&&"function"==typeof n[c]&&(e[o]=n[c])}),n=Object.keys(e).every(t=>{try{return e[t](o)}catch(e){return console.error(`Error when executing callback for ${c} in ${t}`,e),!0}})}return n})(o,g,c):o},O=(e,t)=>{if(null!==e&&!Object(o.isValidElement)(e))throw new TypeError(`The ${t} property for the payment method must be a React element or null.`)},_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const c=t.reduce((t,c)=>(e.hasOwnProperty(c)||t.push(c),t),[]);if(c.length>0)throw new TypeError("The payment method configuration object is missing the following properties:"+c.join(", "))},k=()=>null;class j{constructor(e){var t,c,o,n;j.assertValidConfig(e),this.name=e.name,this.label=e.label,this.placeOrderButtonLabel=e.placeOrderButtonLabel,this.ariaLabel=e.ariaLabel,this.content=e.content,this.savedTokenComponent=e.savedTokenComponent,this.icons=e.icons||null,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={showSavedCards:(null==e||null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)||(null==e||null===(c=e.supports)||void 0===c?void 0:c.savePaymentInfo)||!1,showSaveOption:(null==e||null===(o=e.supports)||void 0===o?void 0:o.showSaveOption)||!1,features:(null==e||null===(n=e.supports)||void 0===n?void 0:n.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return h(this.canMakePaymentFromConfig,this.supports.features,this.name)}}m()(j,"assertValidConfig",e=>{var t,c,n,r,a,i,l;if(e.savedTokenComponent=e.savedTokenComponent||Object(o.createElement)(k,null),_(e,["name","label","ariaLabel","content","edit","canMakePayment"]),"string"!=typeof e.name)throw new Error("The name property for the payment method must be a string");if(void 0!==e.icons&&!Array.isArray(e.icons)&&null!==e.icons)throw new Error("The icons property for the payment method must be an array or null.");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if("string"!=typeof e.placeOrderButtonLabel&&void 0!==e.placeOrderButtonLabel)throw new TypeError("The placeOrderButtonLabel property for the payment method must be a string");if(((e,t)=>{if(null!==e&&!Object(o.isValidElement)(e)&&"string"!=typeof e)throw new TypeError("The label property for the payment method must be a React element, a string, or null.")})(e.label),O(e.content,"content"),O(e.edit,"edit"),O(e.savedTokenComponent,"savedTokenComponent"),"string"!=typeof e.ariaLabel)throw new TypeError("The ariaLabel property for the payment method must be a string");if("function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the payment method must be a function.");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.showSavedCards)&&"boolean"!=typeof(null===(c=e.supports)||void 0===c?void 0:c.showSavedCards))throw new TypeError("If the payment method includes the `supports.showSavedCards` property, it must be a boolean");if(void 0!==(null===(n=e.supports)||void 0===n?void 0:n.savePaymentInfo)&&s()("Passing savePaymentInfo when registering a payment method.",{alternative:"Pass showSavedCards and showSaveOption",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686"}),void 0!==(null===(r=e.supports)||void 0===r?void 0:r.features)&&!Array.isArray(null===(a=e.supports)||void 0===a?void 0:a.features))throw new Error("The features property for the payment method must be an array or undefined.");if(void 0!==(null===(i=e.supports)||void 0===i?void 0:i.showSaveOption)&&"boolean"!=typeof(null===(l=e.supports)||void 0===l?void 0:l.showSaveOption))throw new TypeError("If the payment method includes the `supports.showSaveOption` property, it must be a boolean")});class E{constructor(e){var t;E.assertValidConfig(e),this.name=e.name,this.content=e.content,this.edit=e.edit,this.paymentMethodId=e.paymentMethodId||this.name,this.supports={features:(null==e||null===(t=e.supports)||void 0===t?void 0:t.features)||["products"]},this.canMakePaymentFromConfig=e.canMakePayment}get canMakePayment(){return h(this.canMakePaymentFromConfig,this.supports.features,this.name)}}m()(E,"assertValidConfig",e=>{var t,c;if(_(e,["name","content","edit"]),"string"!=typeof e.name)throw new TypeError("The name property for the express payment method must be a string");if("string"!=typeof e.paymentMethodId&&void 0!==e.paymentMethodId)throw new Error("The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).");if(void 0!==(null===(t=e.supports)||void 0===t?void 0:t.features)&&!Array.isArray(null===(c=e.supports)||void 0===c?void 0:c.features))throw new Error("The features property for the payment method must be an array or undefined.");if(O(e.content,"content"),O(e.edit,"edit"),"function"!=typeof e.canMakePayment)throw new TypeError("The canMakePayment property for the express payment method must be a function.")}),c(78);const y={},w={};var f=c(87);const v=Object(o.createContext)({onSubmit:()=>{},onCheckoutAfterProcessingWithSuccess:()=>()=>{},onCheckoutAfterProcessingWithError:()=>()=>{},onCheckoutBeforeProcessing:()=>()=>{},onCheckoutValidationBeforeProcessing:()=>()=>{},onCheckoutSuccess:()=>()=>{},onCheckoutFail:()=>()=>{},onCheckoutValidation:()=>()=>{}}),C=()=>Object(o.useContext)(v),S=e=>{let{children:t,redirectUrl:c}=e;const r=y,b=w,{isEditor:m}=Object(f.b)(),{__internalUpdateAvailablePaymentMethods:g}=Object(a.useDispatch)(i.PAYMENT_STORE_KEY);Object(o.useEffect)(()=>{(m||0!==Object.keys(r).length||0!==Object.keys(b).length)&&g()},[m,r,b,g]);const{__internalSetRedirectUrl:h,__internalEmitValidateEvent:O,__internalEmitAfterProcessingEvents:_,__internalSetBeforeProcessing:k}=Object(a.useDispatch)(i.CHECKOUT_STORE_KEY),{checkoutRedirectUrl:j,checkoutStatus:E,isCheckoutBeforeProcessing:C,isCheckoutAfterProcessing:S,checkoutHasError:P,checkoutOrderId:N,checkoutOrderNotes:T,checkoutCustomerId:x}=Object(a.useSelect)(e=>{const t=e(i.CHECKOUT_STORE_KEY);return{checkoutRedirectUrl:t.getRedirectUrl(),checkoutStatus:t.getCheckoutStatus(),isCheckoutBeforeProcessing:t.isBeforeProcessing(),isCheckoutAfterProcessing:t.isAfterProcessing(),checkoutHasError:t.hasError(),checkoutOrderId:t.getOrderId(),checkoutOrderNotes:t.getOrderNotes(),checkoutCustomerId:t.getCustomerId()}});c&&c!==j&&h(c);const{setValidationErrors:R}=Object(a.useDispatch)(i.VALIDATION_STORE_KEY),{dispatchCheckoutEvent:A}=Object(d.a)(),{checkoutNotices:I,paymentNotices:M,expressPaymentNotices:B}=Object(a.useSelect)(e=>{const{getNotices:t}=e("core/notices");return{checkoutNotices:Object.values(p.d).filter(e=>e!==p.d.PAYMENTS&&e!==p.d.EXPRESS_PAYMENTS).reduce((e,c)=>[...e,...t(c)],[]),paymentNotices:t(p.d.PAYMENTS),expressPaymentNotices:t(p.d.EXPRESS_PAYMENTS)}},[]),[D,L]=Object(o.useReducer)(l.b,{}),F=Object(o.useRef)(D),{onCheckoutValidation:U,onCheckoutSuccess:V,onCheckoutFail:Y}=(e=>Object(o.useMemo)(()=>({onCheckoutSuccess:Object(u.a)("checkout_success",e),onCheckoutFail:Object(u.a)("checkout_fail",e),onCheckoutValidation:Object(u.a)("checkout_validation",e)}),[e]))(L);Object(o.useEffect)(()=>{F.current=D},[D]);const K=Object(o.useMemo)(()=>function(){return s()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks"}),U(...arguments)},[U]),$=Object(o.useMemo)(()=>function(){return s()("onCheckoutValidationBeforeProcessing",{since:"9.7.0",alternative:"onCheckoutValidation",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),U(...arguments)},[U]),q=Object(o.useMemo)(()=>function(){return s()("onCheckoutAfterProcessingWithSuccess",{since:"9.7.0",alternative:"onCheckoutSuccess",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),V(...arguments)},[V]),H=Object(o.useMemo)(()=>function(){return s()("onCheckoutAfterProcessingWithError",{since:"9.7.0",alternative:"onCheckoutFail",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8381"}),Y(...arguments)},[Y]);Object(o.useEffect)(()=>{C&&O({observers:F.current,setValidationErrors:R})},[C,R,O]);const z=Object(n.a)(E),W=Object(n.a)(P);Object(o.useEffect)(()=>{E===z&&P===W||S&&_({observers:F.current,notices:{checkoutNotices:I,paymentNotices:M,expressPaymentNotices:B}})},[E,P,j,N,x,T,S,C,z,W,I,B,M,O,_]);const G={onSubmit:Object(o.useCallback)(()=>{A("submit"),k()},[A,k]),onCheckoutBeforeProcessing:K,onCheckoutValidationBeforeProcessing:$,onCheckoutAfterProcessingWithSuccess:q,onCheckoutAfterProcessingWithError:H,onCheckoutSuccess:V,onCheckoutFail:Y,onCheckoutValidation:U};return Object(o.createElement)(v.Provider,{value:G},t)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return j})),c.d(t,"a",(function(){return E}));var o=c(0),n=c(7),r=c(10);const s={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},a={INVALID_COUNTRY:"woocommerce_rest_cart_shipping_rates_invalid_country",MISSING_COUNTRY:"woocommerce_rest_cart_shipping_rates_missing_country",INVALID_STATE:"woocommerce_rest_cart_shipping_rates_invalid_state"},i={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:e=>e,shippingErrorTypes:s,onShippingRateSuccess:()=>()=>{},onShippingRateFail:()=>()=>{},onShippingRateSelectSuccess:()=>()=>{},onShippingRateSelectFail:()=>()=>{}},l=(e,t)=>{let{type:c}=t;return Object.values(s).includes(c)?c:e};var u=c(105),p=c(271);const d=e=>({onSuccess:Object(p.a)("shipping_rates_success",e),onFail:Object(p.a)("shipping_rates_fail",e),onSelectSuccess:Object(p.a)("shipping_rate_select_success",e),onSelectFail:Object(p.a)("shipping_rate_select_fail",e)});var b=c(332),m=c(46),g=c(134);const{NONE:h,INVALID_ADDRESS:O,UNKNOWN:_}=s,k=Object(o.createContext)(i),j=()=>Object(o.useContext)(k),E=e=>{let{children:t}=e;const{__internalIncrementCalculating:c,__internalDecrementCalculating:i}=Object(n.useDispatch)(r.CHECKOUT_STORE_KEY),{shippingRates:p,isLoadingRates:j,cartErrors:E}=Object(m.a)(),{selectedRates:y,isSelectingRate:w}=Object(g.a)(),[f,v]=Object(o.useReducer)(l,h),[C,S]=Object(o.useReducer)(u.b,{}),P=Object(o.useRef)(C),N=Object(o.useMemo)(()=>({onShippingRateSuccess:d(S).onSuccess,onShippingRateFail:d(S).onFail,onShippingRateSelectSuccess:d(S).onSelectSuccess,onShippingRateSelectFail:d(S).onSelectFail}),[S]);Object(o.useEffect)(()=>{P.current=C},[C]),Object(o.useEffect)(()=>{j?c():i()},[j,c,i]),Object(o.useEffect)(()=>{w?c():i()},[c,i,w]),Object(o.useEffect)(()=>{E.length>0&&E.some(e=>!(!e.code||!Object.values(a).includes(e.code)))?v({type:O}):v({type:h})},[E]);const T=Object(o.useMemo)(()=>({isPristine:f===h,isValid:f===h,hasInvalidAddress:f===O,hasError:f===_||f===O}),[f]);Object(o.useEffect)(()=>{j||0!==p.length&&!T.hasError||Object(b.a)(P.current,"shipping_rates_fail",{hasInvalidAddress:T.hasInvalidAddress,hasError:T.hasError})},[p,j,T.hasError,T.hasInvalidAddress]),Object(o.useEffect)(()=>{!j&&p.length>0&&!T.hasError&&Object(b.a)(P.current,"shipping_rates_success",p)},[p,j,T.hasError]),Object(o.useEffect)(()=>{w||(T.hasError?Object(b.a)(P.current,"shipping_rate_select_fail",{hasError:T.hasError,hasInvalidAddress:T.hasInvalidAddress}):Object(b.a)(P.current,"shipping_rate_select_success",y.current))},[y,w,T.hasError,T.hasInvalidAddress]);const x={shippingErrorStatus:T,dispatchErrorStatus:v,shippingErrorTypes:s,...N};return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(k.Provider,{value:x},t))}},function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n),s=c(1),a=c(72),i=c(570),l=(c(291),c(557)),u=c(550),p=c(569);const d=e=>{switch(e){case"success":case"warning":case"info":case"default":return"polite";case"error":default:return"assertive"}},b=e=>{switch(e){case"success":return l.a;case"warning":case"info":case"error":return u.a;default:return p.a}};var m=c(57),g=c(44);t.a=e=>{let{className:t,status:c="default",children:n,spokenMessage:l=n,onRemove:u=(()=>{}),isDismissible:p=!0,politeness:h=d(c),summary:O}=e;return((e,t)=>{const c="string"==typeof e?e:Object(o.renderToString)(e);Object(o.useEffect)(()=>{c&&Object(g.speak)(c,t)},[c,t])})(l,h),Object(o.createElement)("div",{className:r()(t,"wc-block-components-notice-banner","is-"+c,{"is-dismissible":p})},Object(o.createElement)(a.a,{icon:b(c)}),Object(o.createElement)("div",{className:"wc-block-components-notice-banner__content"},O&&Object(o.createElement)("p",{className:"wc-block-components-notice-banner__summary"},O),n),!!p&&Object(o.createElement)(m.a,{className:"wc-block-components-notice-banner__dismiss",icon:i.a,label:Object(s.__)("Dismiss this notice","woocommerce"),onClick:e=>{"function"==typeof(null==e?void 0:e.preventDefault)&&e.preventDefault&&e.preventDefault(),u()},showTooltip:!1}))}},,,,,function(e,t,c){"use strict";var o=c(0),n=c(57),r=c(5);t.a=e=>{let{onChange:t,placeholder:c,value:s,...a}=e;const i=Object(o.useRef)(null);return Object(o.useEffect)(()=>{const e=null==i?void 0:i.current;if(!e)return;const t=t=>{if("Space"!==t.code)return;t.preventDefault();const c=e.ownerDocument.getSelection();if(c&&c.rangeCount>0){const e=c.getRangeAt(0);e.deleteContents();const t=document.createTextNode(" ");e.insertNode(t),e.setStartAfter(t),e.setEndAfter(t),c.removeAllRanges(),c.addRange(e)}};return e.addEventListener("keydown",t),()=>{e&&e.removeEventListener("keydown",t)}},[t,s]),Object(o.createElement)(n.a,a,Object(o.createElement)("span",{ref:i},Object(o.createElement)(r.RichText,{multiline:!1,allowedFormats:[],value:s,placeholder:c,onChange:t})))}},,,,,function(e,t,c){"use strict";var o=c(0),n=c(95),r=c(63);const s=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},a=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),i=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…";const o=a(e),n=o.split(" ").splice(0,t).join(" ");return Object(r.autop)(i(n,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…";const n=a(e),s=n.slice(0,t);if(c)return Object(r.autop)(i(s,o));const l=s.match(/([\s]+)/g),u=l?l.length:0,p=n.slice(0,t+u);return Object(r.autop)(i(p,o))};t.a=e=>{let{source:t,maxLength:c=15,countType:a="words",className:i="",style:p={}}=e;const d=Object(o.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const o=Object(r.autop)(e),a=Object(n.count)(o,c);if(a<=t)return o;const i=s(o),p=Object(n.count)(i,c);return p<=t?i:"words"===c?l(i,t):u(i,t,"characters_including_spaces"===c)}(t,c,a),[t,c,a]);return Object(o.createElement)(o.RawHTML,{style:p,className:i},d)}},function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n),s=c(147);t.a=e=>{let{checked:t,name:c,onChange:n,option:a}=e;const{value:i,label:l,description:u,secondaryLabel:p,secondaryDescription:d}=a;return Object(o.createElement)("label",{className:r()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":t}),htmlFor:`${c}-${i}`},Object(o.createElement)("input",{id:`${c}-${i}`,className:"wc-block-components-radio-control__input",type:"radio",name:c,value:i,onChange:e=>n(e.target.value),checked:t,"aria-describedby":r()({[`${c}-${i}__label`]:l,[`${c}-${i}__secondary-label`]:p,[`${c}-${i}__description`]:u,[`${c}-${i}__secondary-description`]:d})}),Object(o.createElement)(s.a,{id:`${c}-${i}`,label:l,secondaryLabel:p,description:u,secondaryDescription:d}))}},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return d}));var o=c(10),n=c(7),r=c(20),s=c(0),a=c(412),i=c(26),l=c.n(i),u=c(348),p=c(88);const d=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:c,isLoadingRates:i,isCollectable:d,isSelectingRate:b}=Object(n.useSelect)(e=>{const t=!!e("core/editor"),c=e(o.CART_STORE_KEY),n=t?u.a.shipping_rates:c.getShippingRates();return{shippingRates:n,needsShipping:t?u.a.needs_shipping:c.getNeedsShipping(),hasCalculatedShipping:t?u.a.has_calculated_shipping:c.getHasCalculatedShipping(),isLoadingRates:!t&&c.isCustomerDataUpdating(),isCollectable:n.every(e=>{let{shipping_rates:t}=e;return t.find(e=>{let{method_id:t}=e;return Object(a.c)(t)})}),isSelectingRate:!t&&c.isShippingRateBeingSelected()}}),m=Object(s.useRef)({});Object(s.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:c,shipping_rates:o}=e;return[c,(null===(t=o.find(e=>e.selected))||void 0===t?void 0:t.rate_id)||""]})))(e);Object(r.b)(t)&&!l()(m.current,t)&&(m.current=t)},[e]);const{selectShippingRate:g}=Object(n.useDispatch)(o.CART_STORE_KEY),h=Object(a.c)(Object.values(m.current).map(e=>e.split(":")[0])),{dispatchCheckoutEvent:O}=Object(p.a)(),_=Object(s.useCallback)((e,t)=>{let c;c=Object(a.c)(e.split(":")[0])||h?g(e):g(e,t),c.then(()=>{O("set-selected-shipping-rate",{shippingRateId:e})}).catch(e=>{Object(o.processErrorResponse)(e)})},[h,g,O]);return{isSelectingRate:b,selectedRates:m.current,selectShippingRate:_,shippingRates:e,needsShipping:t,hasCalculatedShipping:c,isLoadingRates:i,isCollectable:d,hasSelectedLocalPickup:h}}},,,,,function(e,t,c){"use strict";var o=c(23),n=c.n(o),r=c(0),s=c(1),a=c(19),i=e=>{let{imageUrl:t=a.m+"/block-error.svg",header:c=Object(s.__)("Oops!","woocommerce"),text:o=Object(s.__)("There was an error loading the content.","woocommerce"),errorMessage:n,errorMessagePrefix:i=Object(s.__)("Error:","woocommerce"),button:l,showErrorBlock:u=!0}=e;return u?Object(r.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(r.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(r.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},c&&Object(r.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},c),o&&Object(r.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},o),n&&Object(r.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",n),l&&Object(r.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};c(223);class l extends r.Component{constructor(){super(...arguments),n()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(r.createElement)(r.Fragment,null,Object(r.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:c=!0,showErrorBlock:o=!0,text:n,errorMessagePrefix:s,renderError:a,button:l}=this.props,{errorMessage:u,hasError:p}=this.state;return p?"function"==typeof a?a({errorMessage:u}):Object(r.createElement)(i,{showErrorBlock:o,errorMessage:c?u:null,header:e,imageUrl:t,text:n,errorMessagePrefix:s,button:l}):this.props.children}}t.a=l},function(e,t,c){"use strict";c.d(t,"b",(function(){return p})),c.d(t,"a",(function(){return d}));var o=c(0),n=c(7),r=c(10),s=c(36),a=c.n(s),i=c(105),l=c(271);const u=Object(o.createContext)({onPaymentProcessing:()=>()=>()=>{},onPaymentSetup:()=>()=>()=>{}}),p=()=>Object(o.useContext)(u),d=e=>{let{children:t}=e;const{isProcessing:c,isIdle:s,isCalculating:p,hasError:d}=Object(n.useSelect)(e=>{const t=e(r.CHECKOUT_STORE_KEY);return{isProcessing:t.isProcessing(),isIdle:t.isIdle(),hasError:t.hasError(),isCalculating:t.isCalculating()}}),{isPaymentReady:b}=Object(n.useSelect)(e=>{const t=e(r.PAYMENT_STORE_KEY);return{isPaymentProcessing:t.isPaymentProcessing(),isPaymentReady:t.isPaymentReady()}}),{setValidationErrors:m}=Object(n.useDispatch)(r.VALIDATION_STORE_KEY),[g,h]=Object(o.useReducer)(i.b,{}),{onPaymentSetup:O}=(e=>Object(o.useMemo)(()=>({onPaymentSetup:Object(l.a)("payment_setup",e)}),[e]))(h),_=Object(o.useRef)(g);Object(o.useEffect)(()=>{_.current=g},[g]);const{__internalSetPaymentProcessing:k,__internalSetPaymentIdle:j,__internalEmitPaymentProcessingEvent:E}=Object(n.useDispatch)(r.PAYMENT_STORE_KEY);Object(o.useEffect)(()=>{!c||d||p||(k(),E(_.current,m))},[c,d,p,k,E,m]),Object(o.useEffect)(()=>{s&&!b&&j()},[s,b,j]),Object(o.useEffect)(()=>{d&&b&&j()},[d,b,j]);const y={onPaymentProcessing:Object(o.useMemo)(()=>function(){return a()("onPaymentProcessing",{alternative:"onPaymentSetup",plugin:"WooCommerce Blocks"}),O(...arguments)},[O]),onPaymentSetup:O};return Object(o.createElement)(u.Provider,{value:y},t)}},function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(15),a=c(3);c(216),t.a=e=>{let{image:t={},fallbackAlt:c=""}=e;const o=t.thumbnail?{src:t.thumbnail,alt:Object(s.decodeEntities)(t.alt)||c||"Product Image"}:{src:a.PLACEHOLDER_IMG_SRC,alt:""};return Object(r.createElement)("img",n()({className:"wc-block-components-product-image"},o,{alt:o.alt}))}},,,function(e,t){},,,function(e,t,c){"use strict";var o=c(0);t.a=e=>{let{label:t,secondaryLabel:c,description:n,secondaryDescription:r,id:s}=e;return Object(o.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(o.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(o.createElement)("span",{id:s&&s+"__label",className:"wc-block-components-radio-control__label"},t),c&&Object(o.createElement)("span",{id:s&&s+"__secondary-label",className:"wc-block-components-radio-control__secondary-label"},c)),(n||r)&&Object(o.createElement)("div",{className:"wc-block-components-radio-control__description-group"},n&&Object(o.createElement)("span",{id:s&&s+"__description",className:"wc-block-components-radio-control__description"},n),r&&Object(o.createElement)("span",{id:s&&s+"__secondary-description",className:"wc-block-components-radio-control__secondary-description"},r)))}},,function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n),s=c(12),a=c(126);c(290);const i=e=>{let{className:t="",id:c,selected:n="",onChange:l,options:u=[]}=e;const p=Object(s.useInstanceId)(i),d=c||p;return u.length?Object(o.createElement)("div",{className:r()("wc-block-components-radio-control",t)},u.map(e=>Object(o.createElement)(a.a,{key:`${d}-${e.value}`,name:"radio-control-"+d,checked:e.value===n,option:e,onChange:t=>{l(t),"function"==typeof e.onChange&&e.onChange(t)}}))):null};t.a=i},function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(4),a=c.n(s);c(293),t.a=e=>{let{children:t,className:c,headingLevel:o,...s}=e;const i=a()("wc-block-components-title",c),l="h"+o;return Object(r.createElement)(l,n()({className:i},s),t)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"c",(function(){return r})),c.d(t,"a",(function(){return a}));var o=c(20);const n=e=>Object(o.c)(e,"count")&&Object(o.c)(e,"description")&&Object(o.c)(e,"id")&&Object(o.c)(e,"name")&&Object(o.c)(e,"parent")&&Object(o.c)(e,"slug")&&"number"==typeof e.count&&"string"==typeof e.description&&"number"==typeof e.id&&"string"==typeof e.name&&"number"==typeof e.parent&&"string"==typeof e.slug,r=e=>Array.isArray(e)&&e.every(n),s=e=>Object(o.c)(e,"attribute")&&Object(o.c)(e,"operator")&&Object(o.c)(e,"slug")&&"string"==typeof e.attribute&&"string"==typeof e.operator&&Array.isArray(e.slug)&&e.slug.every(e=>"string"==typeof e),a=e=>Array.isArray(e)&&e.every(s)},function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>"number"==typeof e},,function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n),s=c(1),a=c(15),i=c(13),l=c(30),u=c(134),p=c(88),d=c(419),b=c(9),m=c(149),g=c(147),h=c(22),O=c(38),_=c(3);const k=e=>{const t=Object(_.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(a.decodeEntities)(e.name),value:e.rate_id,description:Object(o.createElement)(o.Fragment,null,Number.isFinite(t)&&Object(o.createElement)(O.a,{currency:Object(h.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(a.decodeEntities)(e.delivery_time))}};var j=e=>{let{className:t="",noResultsMessage:c,onSelectRate:n,rates:r,renderOption:s=k,selectedRate:a}=e;const i=(null==a?void 0:a.rate_id)||"",[l,u]=Object(o.useState)(i);if(Object(o.useEffect)(()=>{i&&u(i)},[i]),Object(o.useEffect)(()=>{!l&&r[0]&&(u(r[0].rate_id),n(r[0].rate_id))},[n,r,l]),0===r.length)return c;if(r.length>1)return Object(o.createElement)(m.a,{className:t,onChange:e=>{u(e),n(e)},selected:l,options:r.map(s)});const{label:p,secondaryLabel:d,description:b,secondaryDescription:h}=s(r[0]);return Object(o.createElement)(g.a,{label:p,secondaryLabel:d,description:b,secondaryDescription:h})};c(289),t.a=e=>{let{packageId:t,className:c="",noResultsMessage:n,renderOption:m,packageData:g,collapsible:h,showItems:O}=e;const{selectShippingRate:_}=Object(u.a)(),{dispatchCheckoutEvent:k}=Object(p.a)(),E=document.querySelectorAll(".wc-block-components-shipping-rates-control__package").length>1,y=null!=O?O:E,w=null!=h?h:E,f=Object(o.createElement)(o.Fragment,null,(w||y)&&Object(o.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title",dangerouslySetInnerHTML:{__html:Object(d.a)(g.name)}}),y&&Object(o.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(g.items).map(e=>{const t=Object(a.decodeEntities)(e.name),c=e.quantity;return Object(o.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(o.createElement)(l.a,{label:c>1?`${t} × ${c}`:""+t,screenReaderLabel:Object(s.sprintf)(
|
||
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
|
||
Object(s._n)("%1$s (%2$d unit)","%1$s (%2$d units)",c,"woocommerce"),t,c)}))}))),v=Object(b.debounce)(Object(o.useCallback)(e=>{_(e,t),k("set-selected-shipping-rate",{shippingRateId:e})},[k,t,_]),1e3),C={className:c,noResultsMessage:n,rates:g.shipping_rates,onSelectRate:v,selectedRate:g.shipping_rates.find(e=>e.selected),renderOption:m};return w?Object(o.createElement)(i.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!1,title:f},Object(o.createElement)(j,C)):Object(o.createElement)("div",{className:r()("wc-block-components-shipping-rates-control__package",c)},f,Object(o.createElement)(j,C))}},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c.d(t,"b",(function(){return i})),c.d(t,"c",(function(){return l})),c.d(t,"d",(function(){return u}));var o=c(3),n=c(151),r=c(7);const s=Object(o.getSetting)("attributes",[]).reduce((e,t)=>{const c=(o=t)&&o.attribute_name?{id:parseInt(o.attribute_id,10),name:o.attribute_name,taxonomy:"pa_"+o.attribute_name,label:o.attribute_label}:null;var o;return c&&c.id&&e.push(c),e},[]),a=e=>{const{count:t,id:c,name:o,parent:r}=e;return{count:t,id:c,name:o,parent:r,breadcrumbs:[],children:[],value:Object(n.b)(e)?e.attr_slug:""}},i=e=>{if(e)return s.find(t=>t.id===e)},l=e=>{if(e)return s.find(t=>t.taxonomy===e)},u=(e,t,c,o)=>{const n=Object(r.select)("core/block-editor"),s=Object(r.dispatch)("core/block-editor"),a=n.getBlockParents(e);let i="";a.forEach(e=>{const t=n.getBlock(e).innerBlocks.find(e=>e.name===o);t&&(i=t.clientId)}),s.updateBlockAttributes(i,{[t]:c})}},,,,,,function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(85);t.a=()=>Object(o.createElement)(r.a,{className:"wc-block-components-product-backorder-badge"},Object(n.__)("Available on backorder","woocommerce"))},function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(85);t.a=e=>{let{lowStockRemaining:t}=e;return t?Object(o.createElement)(r.a,{className:"wc-block-components-product-low-stock-badge"},Object(n.sprintf)(
|
||
/* translators: %d stock amount (number of items in stock for product) */
|
||
Object(n.__)("%d left in stock","woocommerce"),t)):null}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return u}));var o=c(0),n=c(1),r=c(72),s=c(327),a=c(246);c(222);const i=e=>{let{text:t,title:c=Object(n.__)("Feedback?","woocommerce"),url:i="https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565"}=e;const[l,u]=Object(o.useState)(!1);return Object(o.useEffect)(()=>{u(!0)},[]),l&&Object(o.createElement)("div",{className:"wc-block-feedback-prompt"},Object(o.createElement)(r.a,{icon:s.a}),Object(o.createElement)("h2",{className:"wc-block-feedback-prompt__title"},c),Object(o.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(o.createElement)("a",{href:i,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(n.__)("Give us your feedback.","woocommerce"),Object(o.createElement)(r.a,{icon:a.a,size:16})))},l=()=>Object(o.createElement)(i,{text:Object(n.__)("We are currently working on improving our cart and checkout blocks to provide merchants with the tools and customization options they need.","woocommerce"),url:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?template=--cart-checkout-feedback.md"}),u=()=>Object(o.createElement)(i,{text:Object(n.__)("Thanks for trying out the Products block! Help us make it better by sharing your feedback.","woocommerce"),title:Object(n.__)("Share your feedback!","woocommerce"),url:"https://airtable.com/shrFX5FAqmCY6hVYI"})},,,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(4),a=c.n(s);const i=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var l=e=>{let{id:t,src:c=null,alt:o=""}=e;return c?Object(r.createElement)("img",{className:i(t),src:c,alt:o}):null},u=c(19);const p=[{id:"alipay",alt:"Alipay",src:u.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:u.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:u.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:u.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:u.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:u.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:u.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:u.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:u.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:u.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:u.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:u.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:u.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:u.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:u.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:u.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:u.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:u.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:u.m+"payment-methods/wechat.svg"}];var d=c(67);c(220),t.a=e=>{let{icons:t=[],align:c="center",className:o}=e;const s=(e=>{const t={};return e.forEach(e=>{let c={};"string"==typeof e&&(c={id:e,alt:e,src:null}),"object"==typeof e&&(c={id:e.id||"",alt:e.alt||"",src:e.src||null}),c.id&&Object(d.a)(c.id)&&!t[c.id]&&(t[c.id]=c)}),Object.values(t)})(t);if(0===s.length)return null;const i=a()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===c,"wc-block-components-payment-method-icons--align-right":"right"===c},o);return Object(r.createElement)("div",{className:i},s.map(e=>{const t={...e,...(c=e.id,p.find(e=>e.id===c)||{})};var c;return Object(r.createElement)(l,n()({key:"payment-method-icon-"+e.id},t))}))}},function(e,t,c){"use strict";var o=c(0),n=c(9),r=c(15);c(219);var s=e=>{let{details:t=[]}=e;return Array.isArray(t)?(t=t.filter(e=>!e.hidden),0===t.length?null:Object(o.createElement)("ul",{className:"wc-block-components-product-details"},t.map(e=>{const t=(null==e?void 0:e.key)||e.name||"",c=(null==e?void 0:e.className)||(t?"wc-block-components-product-details__"+Object(n.kebabCase)(t):"");return Object(o.createElement)("li",{key:t+(e.display||e.value),className:c},t&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"wc-block-components-product-details__name"},Object(r.decodeEntities)(t),":")," "),Object(o.createElement)("span",{className:"wc-block-components-product-details__value"},Object(r.decodeEntities)(e.display||e.value)))}))):null},a=c(125),i=c(19),l=e=>{let{className:t,shortDescription:c="",fullDescription:n=""}=e;const r=c||n;return r?Object(o.createElement)(a.a,{className:t,source:r,maxLength:15,countType:i.o.wordCountType||"words"}):null};c(218),t.a=e=>{let{shortDescription:t="",fullDescription:c="",itemData:n=[],variation:r=[]}=e;return Object(o.createElement)("div",{className:"wc-block-components-product-metadata"},Object(o.createElement)(l,{className:"wc-block-components-product-metadata__description",shortDescription:t,fullDescription:c}),Object(o.createElement)(s,{details:n}),Object(o.createElement)(s,{details:r.map(e=>{let{attribute:t="",value:c}=e;return{key:t,value:c}})}))}},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,function(e,t,c){"use strict";var o=c(23),n=c.n(o),r=c(0),s=c(1),a=c(3),i=c(13),l=c(61);class u extends r.Component{constructor(){super(...arguments),n()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return{errorMessage:e.message,hasError:!0}}render(){const{hasError:e,errorMessage:t}=this.state,{isEditor:c}=this.props;if(e){let e=Object(s.__)("We are experiencing difficulties with this payment method. Please contact us for assistance.","woocommerce");(c||a.CURRENT_USER_IS_ADMIN)&&(e=t||Object(s.__)("There was an error with this payment method. Please verify it's configured correctly.","woocommerce"));const o=[{id:"0",content:e,isDismissible:!1,status:"error"}];return Object(r.createElement)(i.StoreNoticesContainer,{additionalNotices:o,context:l.d.PAYMENTS})}return this.props.children}}u.defaultProps={isEditor:!1},t.a=u},,function(e,t){e.exports=window.wp.editor},function(e,t){e.exports=window.wp.coreData},,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(255),s=c(324),a=c(87),i=c(36),l=c.n(i),u=c(7),p=c(184),d=c(78);t.a=()=>{const{isEditor:e}=Object(a.b)(),{activePaymentMethod:t,paymentMethodData:c}=Object(u.useSelect)(e=>{const t=e(d.a);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData()}}),{__internalSetActivePaymentMethod:i,__internalSetExpressPaymentStarted:b,__internalSetPaymentIdle:m,__internalSetPaymentError:g,__internalSetPaymentMethodData:h,__internalSetExpressPaymentError:O}=Object(u.useDispatch)(d.a),{paymentMethods:_}=Object(r.a)(),k=Object(s.a)(),j=Object(o.useRef)(t),E=Object(o.useRef)(c),y=Object(o.useCallback)(e=>()=>{j.current=t,E.current=c,b(),i(e)},[t,c,i,b]),w=Object(o.useCallback)(()=>{m(),i(j.current,E.current)},[i,m]),f=Object(o.useCallback)(e=>{g(),h(e),O(e),i(j.current,E.current)},[i,g,h,O]),v=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";l()("Express Payment Methods should use the provided onError handler instead.",{alternative:"onError",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),e?f(e):O("")}),[O,f]),C=Object.entries(_),S=C.length>0?C.map(t=>{let[c,n]=t;const r=e?n.edit:n.content;return Object(o.isValidElement)(r)?Object(o.createElement)("li",{key:c,id:"express-payment-method-"+c},Object(o.cloneElement)(r,{...k,onClick:y(c),onClose:w,onError:f,setExpressPaymentError:v})):null}):Object(o.createElement)("li",{key:"noneRegistered"},Object(n.__)("No registered Payment Methods","woocommerce"));return Object(o.createElement)(p.a,{isEditor:e},Object(o.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},S))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var o=c(1),n=c(7),r=c(10),s=c(15),a=c(13),i=c(46);const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:c}=Object(i.a)(),{createErrorNotice:l}=Object(n.useDispatch)("core/notices"),{createNotice:u}=Object(n.useDispatch)("core/notices"),{setValidationErrors:p}=Object(n.useDispatch)(r.VALIDATION_STORE_KEY),{isApplyingCoupon:d,isRemovingCoupon:b}=Object(n.useSelect)(e=>{const t=e(r.CART_STORE_KEY);return{isApplyingCoupon:t.isApplyingCoupon(),isRemovingCoupon:t.isRemovingCoupon()}},[l,u]),{applyCoupon:m,removeCoupon:g}=Object(n.useDispatch)(r.CART_STORE_KEY),h=t=>m(t).then(()=>(Object(a.applyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&u("info",Object(o.sprintf)(
|
||
/* translators: %s coupon code. */
|
||
Object(o.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0))).catch(e=>(p({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),Promise.resolve(!1))),O=t=>g(t).then(()=>(Object(a.applyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&u("info",Object(o.sprintf)(
|
||
/* translators: %s coupon code. */
|
||
Object(o.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e}),Promise.resolve(!0))).catch(t=>(l(t.message,{id:"coupon-form",context:e}),Promise.resolve(!1)));return{appliedCoupons:t,isLoading:c,applyCoupon:h,removeCoupon:O,isApplyingCoupon:d,isRemovingCoupon:b}}},function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(2),s=c(7),a=c(27);t.a=e=>{let{setPageId:t,pageId:c,labels:i}=e;const l=Object(s.useSelect)(e=>e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100}),[])||null;return l?Object(o.createElement)(r.PanelBody,{title:i.title},Object(o.createElement)(r.SelectControl,{label:Object(n.__)("Link to","woocommerce"),value:c,options:[{label:i.default,value:0},...l.map(e=>({label:Object(a.a)(e,l),value:parseInt(e.id,10)}))],onChange:e=>t(parseInt(e,10))})):null}},function(e,t){e.exports=window.wp.plugins},,,,,,,,,,function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(74),s=c(13),a=c(412),i=c(46),l=c(87),u=c(134),p=c(115),d=c(154),b=c(44);const m=e=>{let{packages:t,showItems:c,collapsible:n,noResultsMessage:r,renderOption:s}=e;return t.length?Object(o.createElement)(o.Fragment,null,t.map(e=>{let{package_id:t,...a}=e;return Object(o.createElement)(d.a,{key:t,packageId:t,packageData:a,collapsible:n,showItems:c,noResultsMessage:r,renderOption:s})})):null};t.a=e=>{let{shippingRates:t,isLoadingRates:c,className:g,collapsible:h,showItems:O,noResultsMessage:_,renderOption:k,context:j}=e;Object(o.useEffect)(()=>{var e,o;c||(e=Object(a.a)(t),o=Object(a.b)(t),1===e?Object(b.speak)(Object(n.sprintf)(
|
||
/* translators: %d number of shipping options found. */
|
||
Object(n._n)("%d shipping option was found.","%d shipping options were found.",o,"woocommerce"),o)):Object(b.speak)(Object(n.sprintf)(
|
||
/* translators: %d number of shipping packages packages. */
|
||
Object(n._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,"woocommerce"),e)+" "+Object(n.sprintf)(
|
||
/* translators: %d number of shipping options available. */
|
||
Object(n._n)("%d shipping option was found","%d shipping options were found",o,"woocommerce"),o)))},[c,t]);const{extensions:E,receiveCart:y,...w}=Object(i.a)(),f={className:g,collapsible:h,showItems:O,noResultsMessage:_,renderOption:k,extensions:E,cart:w,components:{ShippingRatesControlPackage:d.a},context:j},{isEditor:v}=Object(l.b)(),{hasSelectedLocalPickup:C}=Object(u.a)();return Object(o.createElement)(r.a,{isLoading:c,screenReaderLabel:Object(n.__)("Loading shipping rates…","woocommerce"),showSpinner:!0},Object(o.createElement)(s.ExperimentalOrderShippingPackages.Slot,f),C&&t.length>1&&!v&&Object(o.createElement)(p.a,{className:"wc-block-components-notice",isDismissible:!1,status:"warning"},Object(n.__)("Multiple shipments must have the same pickup location","woocommerce")),Object(o.createElement)(s.ExperimentalOrderShippingPackages,null,Object(o.createElement)(m,{packages:t,noResultsMessage:_,renderOption:k})))}},,,,,,,function(e,t,c){"use strict";var o=c(0),n=c(11);const r=Object(o.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(o.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M6 3.75h12c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(o.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.9 7.5A1.1 1.1 0 018 6.4h8a1.1 1.1 0 011.1 1.1v2a1.1 1.1 0 01-1.1 1.1H8a1.1 1.1 0 01-1.1-1.1v-2zm1.2.1v1.8h7.8V7.6H8.1z",clipRule:"evenodd"}),Object(o.createElement)("path",{fill:"currentColor",d:"M8.5 12h1v1h-1v-1zM8.5 14h1v1h-1v-1zM8.5 16h1v1h-1v-1zM11.5 12h1v1h-1v-1zM11.5 14h1v1h-1v-1zM11.5 16h1v1h-1v-1zM14.5 12h1v1h-1v-1zM14.5 14h1v1h-1v-1zM14.5 16h1v1h-1v-1z"}));t.a=r},,,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return i})),c.d(t,"a",(function(){return l}));var o=c(45),n=c(39),r=c(7),s=c(10);const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethodsInitialized:t,expressPaymentMethodsInitialized:c,availablePaymentMethods:a,availableExpressPaymentMethods:i}=Object(r.useSelect)(e=>{const t=e(s.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}}),l=Object.values(a).map(e=>{let{name:t}=e;return t}),u=Object.values(i).map(e=>{let{name:t}=e;return t}),p=Object(n.getPaymentMethods)(),d=Object(n.getExpressPaymentMethods)(),b=Object.keys(p).reduce((e,t)=>(l.includes(t)&&(e[t]=p[t]),e),{}),m=Object.keys(d).reduce((e,t)=>(u.includes(t)&&(e[t]=d[t]),e),{}),g=Object(o.a)(b),h=Object(o.a)(m);return{paymentMethods:e?h:g,isInitialized:e?c:t}},i=()=>a(!1),l=()=>a(!0)},,,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(4),a=c.n(s),i=c(1),l=c(72),u=c(547);c(205);var p=e=>{let{text:t,screenReaderText:c="",element:o="li",className:s="",radius:i="small",children:l=null,...u}=e;const p=o,d=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+i),b=Boolean(c&&c!==t);return Object(r.createElement)(p,n()({className:d},u),Object(r.createElement)("span",{"aria-hidden":b,className:"wc-block-components-chip__text"},t),b&&Object(r.createElement)("span",{className:"screen-reader-text"},c),l)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:o=!1,onRemove:s=(()=>{}),removeOnAnyClick:d=!1,text:b,screenReaderText:m="",...g}=e;const h=d?"span":"button";if(!t){const e=m&&"string"==typeof m?m:b;t="string"!=typeof e?
|
||
/* translators: Remove chip. */
|
||
Object(i.__)("Remove","woocommerce"):Object(i.sprintf)(
|
||
/* translators: %s text of the chip to remove. */
|
||
Object(i.__)('Remove "%s"',"woocommerce"),e)}const O={"aria-label":t,disabled:o,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},_=d?O:{},k=d?{"aria-hidden":!0}:O;return Object(r.createElement)(p,n()({},g,_,{className:a()(c,"is-removable"),element:d?"button":g.element,screenReaderText:m,text:b}),Object(r.createElement)(h,n()({className:"wc-block-components-chip__remove"},k),Object(r.createElement)(l.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout","version":"1.0.0","title":"Checkout","description":"Display a checkout form so your customers can submit orders.","category":"woocommerce","keywords":["WooCommerce"],"supports":{"align":["wide"],"html":false,"multiple":false},"example":{"attributes":{"isPreview":true},"viewportWidth":800},"attributes":{"isPreview":{"type":"boolean","default":false,"save":false},"showCompanyField":{"type":"boolean","default":false},"requireCompanyField":{"type":"boolean","default":false},"showApartmentField":{"type":"boolean","default":true},"showPhoneField":{"type":"boolean","default":true},"requirePhoneField":{"type":"boolean","default":false},"align":{"type":"string","default":"wide"}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}')},,,function(e,t,c){"use strict";c.d(t,"b",(function(){return r})),c.d(t,"a",(function(){return s}));const o=window.CustomEvent||null,n=(e,t)=>{let{bubbles:c=!1,cancelable:n=!1,element:r,detail:s={}}=t;if(!o)return;r||(r=document.body);const a=new o(e,{bubbles:c,cancelable:n,detail:s});r.dispatchEvent(a)},r=e=>{let{preserveCartData:t=!1}=e;n("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},s=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const r=()=>{n(t,{bubbles:c,cancelable:o})};return jQuery(document).on(e,r),()=>jQuery(document).off(e,r)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s})),c.d(t,"b",(function(){return a})),c.d(t,"c",(function(){return i}));var o=c(98),n=(c(17),c(3)),r=c(15);const s=e=>{const t=Object.keys(n.defaultAddressFields),c=Object(o.a)(t,{},e.country),r=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:o=!1}=t;o&&((e,t)=>e in t)(c,e)&&(r[c]="")}),r},a=e=>{if(0===Object.values(e).length)return null;const t=Object(n.getSetting)("shippingCountries",{}),c=Object(n.getSetting)("shippingStates",{}),o="string"==typeof t[e.country]?Object(r.decodeEntities)(t[e.country]):"",s="object"==typeof c[e.country]&&"string"==typeof c[e.country][e.state]?Object(r.decodeEntities)(c[e.country][e.state]):e.state,a=[];a.push(e.postcode.toUpperCase()),a.push(e.city),a.push(s),a.push(o);return a.filter(Boolean).join(", ")||null},i=e=>!!e.city&&!!e.country},,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(105);const n=(e,t)=>function(c){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const r=o.a.addEventCallback(e,c,n);return t(r),()=>{t(o.a.removeEventCallback(e,r.id))}}},,,,function(e,t,c){"use strict";var o=c(0),n=c(11);const r=Object(o.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=r},,,function(e,t){},,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(12),a=c(5),i=c(47),l=c(2),u=c(1),p=c(4),d=c.n(p);c(296);const b=(e,t)=>{const[c,o]=Object(r.useState)(()=>{const c=window.localStorage.getItem(e);if(c)try{return JSON.parse(c)}catch{console.error(`Value for key '${e}' could not be retrieved from localStorage because it can't be parsed.`)}return t});return Object(r.useEffect)(()=>{try{window.localStorage.setItem(e,JSON.stringify(c))}catch{console.error(`Value for key '${e}' could not be saved in localStorage because it can't be converted into a string.`)}},[e,c]),[c,o]},m=[],g=e=>{let{block:t}=e;const[c,o]=(e=>{const[t,c]=b("wc-blocks_dismissed_sidebar_compatibility_notices",m),[o,n]=Object(r.useState)(!1),s=t.includes(e);return Object(r.useEffect)(()=>{n(!s)},[s]),[o,()=>{const o=new Set(t);o.add(e),c([...o])}]})(t),n=Object(r.createInterpolateElement)(Object(u.__)("The Cart & Checkout Blocks are a beta feature to optimize for faster checkout. To make sure this feature is right for your store, <a>review the list of compatible extensions</a>.","woocommerce"),{a:Object(r.createElement)(l.ExternalLink,{href:"https://woocommerce.com/document/cart-checkout-blocks-support-status/#section-3"})});return Object(r.createElement)(l.Notice,{onRemove:o,className:d()(["wc-blocks-sidebar-compatibility-notice",{"is-hidden":!c}])},n)};var h=c(3);function O(){const e=Object(u.__)("Your store does not have any payment methods that support the Checkout block. Once you have configured a compatible payment method it will be displayed here.","woocommerce");return Object(r.createElement)(l.Notice,{className:"wc-blocks-no-payment-methods-notice",status:"warning",spokenMessage:e,isDismissible:!1},Object(r.createElement)("div",{className:"wc-blocks-no-payment-methods-notice__content"},e," ",Object(r.createElement)(l.ExternalLink,{href:h.ADMIN_URL+"admin.php?page=wc-settings&tab=checkout"},Object(u.__)("Configure Payment Methods","woocommerce"))))}c(297);var _=c(10),k=c(186),j=c(16),E=c.n(j),y=c(187),w=c(7),f=c(19);function v(e){let{block:t}=e;const c="checkout"===t?f.e:f.c,o="checkout"===t?"woocommerce_checkout_page_id":"woocommerce_cart_page_id",n="checkout"===t?Object(u.__)("If you would like to use this block as your default checkout, update your page settings","woocommerce"):Object(u.__)("If you would like to use this block as your default cart, update your page settings","woocommerce"),{saveEntityRecord:s}=Object(w.useDispatch)(y.store),{editPost:a,savePost:i}=Object(w.useDispatch)(k.store),{slug:p,isLoadingPage:d,postPublished:b,currentPostId:m}=Object(w.useSelect)(e=>{var o;const{getEntityRecord:n,isResolving:r}=e(y.store),{isCurrentPostPublished:s,getCurrentPostId:a}=e(k.store);return{slug:(null===(o=n("postType","page",c))||void 0===o?void 0:o.slug)||t,isLoadingPage:r("getEntityRecord",["postType","page",c]),postPublished:s(),currentPostId:a()}},[]),[g,h]=Object(r.useState)("pristine"),O=Object(r.useCallback)(()=>{h("updating"),Promise.resolve().then(()=>E()({path:"/wc/v3/settings/advanced/"+o,method:"GET"})).catch(e=>{"rest_setting_setting_invalid"===e.code&&h("error")}).then(()=>{if(!b)return a({status:"publish"}),i()}).then(()=>E()({path:"/wc/v3/settings/advanced/"+o,method:"POST",data:{value:m.toString()}})).then(()=>{if(0!==c)return s("postType","page",{id:c,slug:p+"-2"})}).then(()=>a({slug:p})).then(()=>i()).then(()=>h("updated"))},[b,a,i,o,m,c,s,p]);return m===c||"dismissed"===g?null:Object(r.createElement)(l.Notice,{className:"wc-default-page-notice",status:"updated"===g?"success":"warning",onRemove:()=>h("dismissed"),spokenMessage:"updated"===g?Object(u.__)("Page settings updated","woocommerce"):n},"updated"===g?Object(u.__)("Page settings updated","woocommerce"):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("p",null,n),Object(r.createElement)(l.Button,{onClick:O,variant:"secondary",isBusy:"updating"===g,disabled:d,isSmall:!0},Object(u.__)("Update your page settings","woocommerce"))))}c(295);var C=c(423),S=c(72),P=c(78);const N=[];function T(e){let{toggleDismissedStatus:t,block:c}=e;const[o,n,s,a]=(e=>{const[t,c]=b("wc-blocks_dismissed_incompatible_payment_gateways_notices",N),[o,n]=Object(r.useState)(!1),{incompatiblePaymentMethods:s}=Object(w.useSelect)(e=>{const{getIncompatiblePaymentMethods:t}=e(P.a);return{incompatiblePaymentMethods:t()}},[]),a=Object.keys(s),i=a.length,l=t.some(t=>{return Object.keys(t).includes(e)&&(c=t[e],o=a,c.length===o.length&&new Set([...c,...o]).size===c.length);var c,o}),u=0===i||l;return Object(r.useEffect)(()=>{n(!u),u||l||c(t=>t.reduce((t,c)=>(Object.keys(c).includes(e)||t.push(c),t),[]))},[u,l,c,e]),[o,()=>{const o=new Set(t);o.add({[e]:a}),c([...o])},s,i]})(c);if(Object(r.useEffect)(()=>{t(!o)},[o,t]),!o)return null;const i=Object(r.createInterpolateElement)(Object(u._n)("The following extension is incompatible with the block-based checkout. <a>Learn more</a>","The following extensions are incompatible with the block-based checkout. <a>Learn more</a>",a,"woocommerce"),{a:Object(r.createElement)(l.ExternalLink,{href:"https://woocommerce.com/document/cart-checkout-blocks-support-status/"})});return Object(r.createElement)(l.Notice,{className:"wc-blocks-incompatible-extensions-notice",status:"warning",onRemove:n,spokenMessage:i},Object(r.createElement)("div",{className:"wc-blocks-incompatible-extensions-notice__content"},Object(r.createElement)(S.a,{className:"wc-blocks-incompatible-extensions-notice__warning-icon",icon:Object(r.createElement)(C.a,null)}),Object(r.createElement)("div",null,Object(r.createElement)("p",null,i),Object(r.createElement)("ul",null,Object.entries(s).map(e=>{let[t,c]=e;return Object(r.createElement)("li",{key:t,className:"wc-blocks-incompatible-extensions-notice__element"},c)})))))}c(294);var x=c(167);const R=Object(s.createHigherOrderComponent)(e=>t=>{const{clientId:c,name:o,isSelected:s}=t,[i,l]=Object(r.useState)(!0),{isCart:u,isCheckout:p,isPaymentMethodsBlock:d,hasPaymentMethods:b}=Object(w.useSelect)(e=>{const{getBlockParentsByBlockName:t,getBlockName:o}=e(a.store),n=t(c,["woocommerce/cart","woocommerce/checkout"]).map(o),r=o(c);return{isCart:n.includes("woocommerce/cart")||"woocommerce/cart"===r,isCheckout:n.includes("woocommerce/checkout")||"woocommerce/checkout"===r,isPaymentMethodsBlock:"woocommerce/checkout-payment-block"===r,hasPaymentMethods:e(_.PAYMENT_STORE_KEY).paymentMethodsInitialized()&&Object.keys(e(_.PAYMENT_STORE_KEY).getAvailablePaymentMethods()).length>0}});return o.startsWith("woocommerce/")&&s&&(u||p)?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(a.InspectorControls,null,Object(r.createElement)(T,{toggleDismissedStatus:e=>{l(e)},block:p?"woocommerce/checkout":"woocommerce/cart"}),i?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(v,{block:p?"checkout":"cart"}),Object(r.createElement)(g,{block:p?"checkout":"cart"})):null,d&&!b&&Object(r.createElement)(O,null),Object(r.createElement)(x.a,null)),Object(r.createElement)(e,n()({key:"edit"},t))):Object(r.createElement)(e,n()({key:"edit"},t))},"withSidebarNotices");Object(i.hasFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice")||Object(i.addFilter)("editor.BlockEdit","woocommerce/add/sidebar-compatibility-notice",R,11)},,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(7),n=c(10);const r=()=>{const{customerData:e,isInitialized:t}=Object(o.useSelect)(e=>{const t=e(n.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:c,setBillingAddress:r}=Object(o.useDispatch)(n.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:r,setShippingAddress:c}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return y}));var o=c(0),n=c(233),r=c(3),s=c(139),a=c(140),i=c(114),l=c(113),u=c(1),p=c(16),d=c.n(p),b=c(418),m=c(263),g=c(7),h=c(10),O=c(39);const _=(e,t,c)=>{const o=Object.keys(e).map(t=>({key:t,value:e[t]}),[]),n=`wc-${c}-new-payment-method`;return o.push({key:n,value:t}),o},k=e=>{if(!e)return;const{__internalSetCustomerId:t}=Object(g.dispatch)(h.CHECKOUT_STORE_KEY);d.a.setNonce&&"function"==typeof d.a.setNonce&&d.a.setNonce(e),null!=e&&e.get("User-ID")&&t(parseInt(e.get("User-ID")||"0",10))};var j=c(46),E=()=>{const{onCheckoutValidation:e}=Object(l.b)(),{hasError:t,redirectUrl:c,isProcessing:n,isBeforeProcessing:r,isComplete:s,orderNotes:a,shouldCreateAccount:p,extensionData:E}=Object(g.useSelect)(e=>{const t=e(h.CHECKOUT_STORE_KEY);return{hasError:t.hasError(),redirectUrl:t.getRedirectUrl(),isProcessing:t.isProcessing(),isBeforeProcessing:t.isBeforeProcessing(),isComplete:t.isComplete(),orderNotes:t.getOrderNotes(),shouldCreateAccount:t.getShouldCreateAccount(),extensionData:t.getExtensionData()}}),{__internalSetHasError:y,__internalProcessCheckoutResponse:w}=Object(g.useDispatch)(h.CHECKOUT_STORE_KEY),f=Object(g.useSelect)(e=>e(h.VALIDATION_STORE_KEY).hasValidationErrors),{shippingErrorStatus:v}=Object(i.b)(),{billingAddress:C,shippingAddress:S}=Object(g.useSelect)(e=>e(h.CART_STORE_KEY).getCustomerData()),{cartNeedsPayment:P,cartNeedsShipping:N,receiveCartContents:T}=Object(j.a)(),{activePaymentMethod:x,paymentMethodData:R,isExpressPaymentMethodActive:A,hasPaymentError:I,isPaymentReady:M,shouldSavePayment:B}=Object(g.useSelect)(e=>{const t=e(h.PAYMENT_STORE_KEY);return{activePaymentMethod:t.getActivePaymentMethod(),paymentMethodData:t.getPaymentMethodData(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),hasPaymentError:t.hasPaymentError(),isPaymentReady:t.isPaymentReady(),shouldSavePayment:t.getShouldSavePaymentMethod()}},[]),D=Object(O.getPaymentMethods)(),L=Object(O.getExpressPaymentMethods)(),F=Object(o.useRef)(C),U=Object(o.useRef)(S),V=Object(o.useRef)(c),[Y,K]=Object(o.useState)(!1),$=Object(o.useMemo)(()=>{var e;const t={...L,...D};return null==t||null===(e=t[x])||void 0===e?void 0:e.paymentMethodId},[x,L,D]),q=f()&&!A||I||v.hasError,H=!t&&!q&&(M||!P)&&n;Object(o.useEffect)(()=>{q===t||!n&&!r||A||y(q)},[q,t,n,r,A,y]),Object(o.useEffect)(()=>{F.current=C,U.current=S,V.current=c},[C,S,c]);const z=Object(o.useCallback)(()=>f()?void 0!==Object(g.select)(h.VALIDATION_STORE_KEY).getValidationError("shipping-rates-error")&&{errorMessage:Object(u.__)("Sorry, this order requires a shipping option.","woocommerce")}:I?{errorMessage:Object(u.__)("There was a problem with your payment option.","woocommerce"),context:"wc/checkout/payments"}:!v.hasError||{errorMessage:Object(u.__)("There was a problem with your shipping option.","woocommerce"),context:"wc/checkout/shipping-methods"},[f,I,v.hasError]);Object(o.useEffect)(()=>{let t;return A||(t=e(z,0)),()=>{A||"function"!=typeof t||t()}},[e,z,A]),Object(o.useEffect)(()=>{V.current&&(window.location.href=V.current)},[s]);const W=Object(o.useCallback)(async()=>{if(Y)return;K(!0),Object(b.a)();const e=P?{payment_method:$,payment_data:_(R,B,x)}:{},t={shipping_address:N?Object(m.a)(U.current):void 0,billing_address:Object(m.a)(F.current),customer_note:a,create_account:p,...e,extensions:{...E}};d()({path:"/wc/store/v1/checkout",method:"POST",data:t,cache:"no-store",parse:!1}).then(e=>{if(function(e){if("object"!=typeof e||null===e||!("body"in e)||!("headers"in e))throw new Error("Response not valid")}(e),k(e.headers),!e.ok)throw e;return e.json()}).then(e=>{w(e),K(!1)}).catch(e=>{k(null==e?void 0:e.headers);try{e.json().then(e=>e).then(e=>{var t;null!==(t=e.data)&&void 0!==t&&t.cart&&T(e.data.cart),Object(h.processErrorResponse)(e),w(e)})}catch{Object(h.processErrorResponse)({code:"unknown_error",message:Object(u.__)("Something went wrong. Please try placing your order again.","woocommerce"),data:null})}y(!0),K(!1)})},[Y,P,$,R,B,x,a,p,E,N,T,y,w]);return Object(o.useEffect)(()=>{H&&!Y&&W()},[W,H,Y]),null};const y=e=>{let{children:t,redirectUrl:c}=e;return Object(o.createElement)(l.a,{redirectUrl:c},Object(o.createElement)(i.a,null,Object(o.createElement)(a.a,null,t,Object(o.createElement)(s.a,{renderError:r.CURRENT_USER_IS_ADMIN?null:()=>null},Object(o.createElement)(n.PluginArea,{scope:"woocommerce-checkout"})),Object(o.createElement)(E,null))))}},,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return I}));var o=c(1),n=c(22),r=c(0),s=c(4),a=c.n(s),i=c(11),l=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"}),Object(r.createElement)("path",{fill:"#000",fillRule:"nonzero",d:"M17.3 8v1c1 .2 1.4.9 1.4 1.7h-1c0-.6-.3-1-1-1-.8 0-1.3.4-1.3.9 0 .4.3.6 1.4 1 1 .2 2 .6 2 1.9 0 .9-.6 1.4-1.5 1.5v1H16v-1c-.9-.1-1.6-.7-1.7-1.7h1c0 .6.4 1 1.3 1 1 0 1.2-.5 1.2-.8 0-.4-.2-.8-1.3-1.1-1.3-.3-2.1-.8-2.1-1.8 0-.9.7-1.5 1.6-1.6V8h1.3zM12 10v1H6v-1h6zm2-2v1H6V8h8zM2 4v16h20V4H2zm2 14V6h16v12H4z"}),Object(r.createElement)("path",{stroke:"#000",strokeLinecap:"round",d:"M6 16c2.6 0 3.9-3 1.7-3-2 0-1 3 1.5 3 1 0 1-.8 2.8-.8"}))),u=c(568),p=c(551),d=c(567),b=c(72),m=c(67),g=c(20);c(282);const h={bank:u.a,bill:p.a,card:d.a,checkPayment:l};var O=e=>{let{icon:t="",text:c=""}=e;const o=!!t,n=Object(r.useCallback)(e=>o&&Object(m.a)(e)&&Object(g.c)(h,e),[o]),s=a()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":o});return Object(r.createElement)("span",{className:s},n(t)?Object(r.createElement)(b.a,{icon:h[t]}):t,c)},_=c(170),k=c(3),j=c(36),E=c.n(j),y=c(74),w=c(7),f=c(10),v=c(13),C=c(46),S=c(231),P=c(61),N=c(113),T=c(140),x=c(114);const R=(e,t)=>{const c=[],n=(t,c)=>{const o=c+"_tax",n=Object(g.c)(e,c)&&Object(m.a)(e[c])?parseInt(e[c],10):0;return{key:c,label:t,value:n,valueWithTax:n+(Object(g.c)(e,o)&&Object(m.a)(e[o])?parseInt(e[o],10):0)}};return c.push(n(Object(o.__)("Subtotal:","woocommerce"),"total_items")),c.push(n(Object(o.__)("Fees:","woocommerce"),"total_fees")),c.push(n(Object(o.__)("Discount:","woocommerce"),"total_discount")),c.push({key:"total_tax",label:Object(o.__)("Taxes:","woocommerce"),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&c.push(n(Object(o.__)("Shipping:","woocommerce"),"total_shipping")),c};var A=c(134);const I=()=>{const{onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutAfterProcessingWithSuccess:c,onCheckoutAfterProcessingWithError:s,onSubmit:a,onCheckoutSuccess:i,onCheckoutFail:l,onCheckoutValidation:u}=Object(N.b)(),{isCalculating:p,isComplete:d,isIdle:b,isProcessing:m,customerId:g}=Object(w.useSelect)(e=>{const t=e(f.CHECKOUT_STORE_KEY);return{isComplete:t.isComplete(),isIdle:t.isIdle(),isProcessing:t.isProcessing(),customerId:t.getCustomerId(),isCalculating:t.isCalculating()}}),{paymentStatus:h,activePaymentMethod:j,shouldSavePayment:I}=Object(w.useSelect)(e=>{const t=e(f.PAYMENT_STORE_KEY);return{paymentStatus:{get isPristine(){return E()("isPristine",{since:"9.6.0",alternative:"isIdle",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentIdle()},isIdle:t.isPaymentIdle(),isStarted:t.isExpressPaymentStarted(),isProcessing:t.isPaymentProcessing(),get isFinished(){return E()("isFinished",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()||t.isPaymentReady()},hasError:t.hasPaymentError(),get hasFailed(){return E()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.hasPaymentError()},get isSuccessful(){return E()("isSuccessful",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),t.isPaymentReady()},isReady:t.isPaymentReady(),isDoingExpressPayment:t.isExpressPaymentMethodActive()},activePaymentMethod:t.getActivePaymentMethod(),shouldSavePayment:t.getShouldSavePaymentMethod()}}),{__internalSetExpressPaymentError:M}=Object(w.useDispatch)(f.PAYMENT_STORE_KEY),{onPaymentProcessing:B,onPaymentSetup:D}=Object(T.b)(),{shippingErrorStatus:L,shippingErrorTypes:F,onShippingRateSuccess:U,onShippingRateFail:V,onShippingRateSelectSuccess:Y,onShippingRateSelectFail:K}=Object(x.b)(),{shippingRates:$,isLoadingRates:q,selectedRates:H,isSelectingRate:z,selectShippingRate:W,needsShipping:G}=Object(A.a)(),{billingAddress:X,shippingAddress:Q}=Object(w.useSelect)(e=>e(f.CART_STORE_KEY).getCustomerData()),{setShippingAddress:Z}=Object(w.useDispatch)(f.CART_STORE_KEY),{cartItems:J,cartFees:ee,cartTotals:te,extensions:ce}=Object(C.a)(),{appliedCoupons:oe}=Object(S.a)(),ne=Object(r.useRef)(R(te,G)),re=Object(r.useRef)({label:Object(o.__)("Total","woocommerce"),value:parseInt(te.total_price,10)});Object(r.useEffect)(()=>{ne.current=R(te,G),re.current={label:Object(o.__)("Total","woocommerce"),value:parseInt(te.total_price,10)}},[te,G]);const se=Object(r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";E()("setExpressPaymentError should only be used by Express Payment Methods (using the provided onError handler).",{alternative:"",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4228"}),M(e)}),[M]);return{activePaymentMethod:j,billing:{appliedCoupons:oe,billingAddress:X,billingData:X,cartTotal:re.current,cartTotalItems:ne.current,currency:Object(n.getCurrencyFromPriceResponse)(te),customerId:g,displayPricesIncludingTax:Object(k.getSetting)("displayCartPricesIncludingTax",!1)},cartData:{cartItems:J,cartFees:ee,extensions:ce},checkoutStatus:{isCalculating:p,isComplete:d,isIdle:b,isProcessing:m},components:{LoadingMask:y.a,PaymentMethodIcons:_.a,PaymentMethodLabel:O,ValidationInputError:v.ValidationInputError},emitResponse:{noticeContexts:P.d,responseTypes:P.e},eventRegistration:{onCheckoutAfterProcessingWithError:s,onCheckoutAfterProcessingWithSuccess:c,onCheckoutBeforeProcessing:e,onCheckoutValidationBeforeProcessing:t,onCheckoutSuccess:i,onCheckoutFail:l,onCheckoutValidation:u,onPaymentProcessing:B,onPaymentSetup:D,onShippingRateFail:V,onShippingRateSelectFail:K,onShippingRateSelectSuccess:Y,onShippingRateSuccess:U},onSubmit:a,paymentStatus:h,setExpressPaymentError:se,shippingData:{isSelectingRate:z,needsShipping:G,selectedRates:H,setSelectedRates:W,setShippingAddress:Z,shippingAddress:Q,shippingRates:$,shippingRatesLoading:q},shippingStatus:{shippingErrorStatus:L,shippingErrorTypes:F},shouldSavePayment:I}}},function(e,t,c){"use strict";c.d(t,"b",(function(){return i})),c.d(t,"a",(function(){return l}));var o=c(0),n=c(12),r=c(4),s=c.n(r);const a=Object(o.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),i=()=>Object(o.useContext)(a),l=e=>{let{children:t,className:c=""}=e;const[r,i]=(()=>{const[e,{width:t}]=Object(n.useResizeObserver)();let c="";return t>700?c="is-large":t>520?c="is-medium":t>400?c="is-small":t&&(c="is-mobile"),[e,c]})(),l={hasContainerWidth:""!==i,containerClassName:i,isMobile:"is-mobile"===i,isSmall:"is-small"===i,isMedium:"is-medium"===i,isLarge:"is-large"===i};return Object(o.createElement)(a.Provider,{value:l},Object(o.createElement)("div",{className:s()(c,i)},r,t))}},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return s})),c.d(t,"b",(function(){return a}));var o=c(61),n=c(20);const r=e=>Object(n.b)(e)&&Object(n.c)(e,"type"),s=async(e,t,c)=>{const n=Object(o.a)(e,t),r=[];for(const e of n)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&r.push(t)}catch(e){console.error(e)}return!r.length||r},a=async(e,t,c)=>{const n=[],s=Object(o.a)(e,t);for(const e of s)try{const t=await Promise.resolve(e.callback(c));if(!r(t))continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(o.b)(t)||Object(o.c)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:o.e.ERROR}),n}return n}},,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var o=c(8),n=c(13),r=c(10),s=c(7);const a=["core/paragraph","core/image","core/separator"],i=e=>{const t=Object(n.applyCheckoutFilter)({filterName:"additionalCartCheckoutInnerBlockTypes",defaultValue:[],extensions:Object(s.select)(r.CART_STORE_KEY).getCartData().extensions,arg:{block:e},validation:e=>{if(Array.isArray(e)&&e.every(e=>"string"==typeof e))return!0;throw new Error("allowedBlockTypes filters must return an array of strings.")}});return Array.from(new Set([...Object(o.getBlockTypes)().filter(t=>((null==t?void 0:t.parent)||[]).includes(e)).map(e=>{let{name:t}=e;return t}),...a,...t]))}},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(0),n=c(7),r=c(8),s=c(87);const a=e=>{let{clientId:t,registeredBlocks:c,defaultTemplate:a=[]}=e;const i=Object(o.useRef)(c),l=Object(o.useRef)(a),u=Object(n.useRegistry)(),{isPreview:p}=Object(s.b)();Object(o.useEffect)(()=>{let e=!1;if(p)return;const{replaceInnerBlocks:c}=Object(n.dispatch)("core/block-editor");return u.subscribe(()=>{const o=u.select("core/block-editor").getBlocks(t);if(0===o.length&&l.current.length>0&&!e){const o=Object(r.createBlocksFromInnerBlocksTemplate)(l.current);if(0!==o.length)return e=!0,void c(t,o)}const n=i.current.map(e=>Object(r.getBlockType)(e)),s=((e,t)=>{const c=t.filter(e=>e&&(e=>{var t,c,o;let{attributes:n}=e;return Boolean((null===(t=n.lock)||void 0===t?void 0:t.remove)||(null===(c=n.lock)||void 0===c||null===(o=c.default)||void 0===o?void 0:o.remove))})(e)),o=[];return c.forEach(t=>{void 0!==t&&(e.find(e=>e.name===t.name)||o.push(t))}),o})(o,n);if(0===s.length)return;let a=-1;const p=s.map(e=>{const t=l.current.findIndex(t=>{let[c]=t;return c===e.name}),c=Object(r.createBlock)(e.name);return-1===a&&(a=(e=>{let{defaultTemplatePosition:t,innerBlocks:c,currentDefaultTemplate:o}=e;switch(t){case-1:return c.length;case 0:return 0;default:const e=o.current[t-1],n=c.findIndex(t=>{let{name:c}=t;return c===e[0]});return-1===n?t:n+1}})({defaultTemplatePosition:t,innerBlocks:o,currentDefaultTemplate:l})),c});u.batch(()=>{u.dispatch("core/block-editor").insertBlocks(p,a,t)})},"core/block-editor")},[t,p,u])}},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var o=c(1),n=c(19),r=c(3);const s=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(o.__)("Shipping","woocommerce"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(o._x)("Beanie with Logo","example product in Cart Block","woocommerce"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(o._x)("Beanie","example product in Cart Block","woocommerce"),quantity:1}],shipping_rates:[{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(o.__)("Flat rate shipping","woocommerce"),description:"",delivery_time:"",price:"500",taxes:"0",rate_id:"flat_rate:0",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(o.__)("Free shipping","woocommerce"),description:"",delivery_time:"",price:"0",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!1},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(o.__)("Local pickup","woocommerce"),description:"",delivery_time:"",price:"0",taxes:"0",rate_id:"pickup_location:1",instance_id:1,meta_data:[{key:"pickup_location",value:"New York"},{key:"pickup_address",value:"123 Easy Street, New York, 12345"}],method_id:"pickup_location",selected:!1},{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",name:Object(o.__)("Local pickup","woocommerce"),description:"",delivery_time:"",price:"0",taxes:"0",rate_id:"pickup_location:2",instance_id:1,meta_data:[{key:"pickup_location",value:"Los Angeles"},{key:"pickup_address",value:"123 Easy Street, Los Angeles, California, 90210"}],method_id:"pickup_location",selected:!1}]}],a=Object(r.getSetting)("displayCartPricesIncludingTax",!1),i={coupons:[],shipping_rates:Object(r.getSetting)("shippingMethodsExist",!1)||Object(r.getSetting)("localPickupEnabled",!1)?s:[],items:[{key:"1",id:1,quantity:2,catalog_visibility:"visible",name:Object(o.__)("Beanie","woocommerce"),summary:Object(o.__)("Beanie","woocommerce"),short_description:Object(o.__)("Warm hat for winter","woocommerce"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-beanie",permalink:"https://example.org",low_stock_remaining:2,backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,quantity_limits:{minimum:1,maximum:99,multiple_of:1,editable:!0},images:[{id:10,src:n.m+"previews/beanie.jpg",thumbnail:n.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(o.__)("Color","woocommerce"),value:Object(o.__)("Yellow","woocommerce")},{attribute:Object(o.__)("Size","woocommerce"),value:Object(o.__)("Small","woocommerce")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"12000":"10000",regular_price:a?"12000":"10000",sale_price:a?"12000":"10000",price_range:null,raw_prices:{precision:6,price:a?"12000000":"10000000",regular_price:a?"12000000":"10000000",sale_price:a?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{},item_data:[]},{key:"2",id:2,quantity:1,catalog_visibility:"visible",name:Object(o.__)("Cap","woocommerce"),summary:Object(o.__)("Cap","woocommerce"),short_description:Object(o.__)("Lightweight baseball cap","woocommerce"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",sku:"woo-cap",low_stock_remaining:null,permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,quantity_limits:{minimum:1,maximum:99,multiple_of:1,editable:!0},images:[{id:11,src:n.m+"previews/cap.jpg",thumbnail:n.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(o.__)("Color","woocommerce"),value:Object(o.__)("Orange","woocommerce")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"2400":"2000",regular_price:a?"2400":"2000",sale_price:a?"2400":"2000",price_range:null,raw_prices:{precision:6,price:a?"24000000":"20000000",regular_price:a?"24000000":"20000000",sale_price:a?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{},item_data:[]}],cross_sells:[{id:1,name:Object(o.__)("Polo","woocommerce"),parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-polo",short_description:Object(o.__)("Polo","woocommerce"),description:Object(o.__)("Polo","woocommerce"),on_sale:!1,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"24000":"20000",regular_price:a?"24000":"20000",sale_price:a?"12000":"10000",price_range:null},price_html:"",average_rating:"4.5",review_count:2,images:[{id:17,src:n.m+"previews/polo.jpg",thumbnail:n.m+"previews/polo.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:2,name:Object(o.__)("Long Sleeve Tee","woocommerce"),parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-long-sleeve-tee",short_description:Object(o.__)("Long Sleeve Tee","woocommerce"),description:Object(o.__)("Long Sleeve Tee","woocommerce"),on_sale:!1,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"30000":"25000",regular_price:a?"30000":"25000",sale_price:a?"30000":"25000",price_range:null},price_html:"",average_rating:"4",review_count:2,images:[{id:17,src:n.m+"previews/long-sleeve-tee.jpg",thumbnail:n.m+"previews/long-sleeve-tee.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:3,name:Object(o.__)("Hoodie with Zipper","woocommerce"),parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-zipper",short_description:Object(o.__)("Hoodie with Zipper","woocommerce"),description:Object(o.__)("Hoodie with Zipper","woocommerce"),on_sale:!0,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"15000":"12500",regular_price:a?"30000":"25000",sale_price:a?"15000":"12500",price_range:null},price_html:"",average_rating:"1",review_count:2,images:[{id:17,src:n.m+"previews/hoodie-with-zipper.jpg",thumbnail:n.m+"previews/hoodie-with-zipper.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:4,name:Object(o.__)("Hoodie with Logo","woocommerce"),parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-logo",short_description:Object(o.__)("Polo","woocommerce"),description:Object(o.__)("Polo","woocommerce"),on_sale:!1,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"4500":"4250",regular_price:a?"4500":"4250",sale_price:a?"4500":"4250",price_range:null},price_html:"",average_rating:"5",review_count:2,images:[{id:17,src:n.m+"previews/hoodie-with-logo.jpg",thumbnail:n.m+"previews/hoodie-with-logo.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:5,name:Object(o.__)("Hoodie with Pocket","woocommerce"),parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-pocket",short_description:Object(o.__)("Hoodie with Pocket","woocommerce"),description:Object(o.__)("Hoodie with Pocket","woocommerce"),on_sale:!0,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"3500":"3250",regular_price:a?"4500":"4250",sale_price:a?"3500":"3250",price_range:null},price_html:"",average_rating:"3.75",review_count:4,images:[{id:17,src:n.m+"previews/hoodie-with-pocket.jpg",thumbnail:n.m+"previews/hoodie-with-pocket.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:6,name:Object(o.__)("T-Shirt","woocommerce"),parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-t-shirt",short_description:Object(o.__)("T-Shirt","woocommerce"),description:Object(o.__)("T-Shirt","woocommerce"),on_sale:!1,prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:a?"1800":"1500",regular_price:a?"1800":"1500",sale_price:a?"1800":"1500",price_range:null},price_html:"",average_rating:"3",review_count:2,images:[{id:17,src:n.m+"previews/tshirt.jpg",thumbnail:n.m+"previews/tshirt.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}}],fees:[{id:"fee",name:Object(o.__)("Fee","woocommerce"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20"}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(r.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(o.__)("Sales tax","woocommerce"),rate:"20%",price:"820"}]},errors:[],payment_methods:["cod","bacs","cheque"],payment_requirements:["products"],extensions:{}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n),s=c(325);c(278),t.a=e=>{let{children:t,className:c}=e;return Object(o.createElement)(s.a,{className:r()("wc-block-components-sidebar-layout",c)},t)}},function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n);const s=Object(o.forwardRef)((e,t)=>{let{children:c,className:n=""}=e;return Object(o.createElement)("div",{ref:t,className:r()("wc-block-components-main",n)},c)});t.a=s},,,function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n);const s=Object(o.forwardRef)((e,t)=>{let{children:c,className:n=""}=e;return Object(o.createElement)("div",{ref:t,className:r()("wc-block-components-sidebar",n)},c)});t.a=s},,function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"d",(function(){return a})),c.d(t,"c",(function(){return i})),c.d(t,"b",(function(){return l}));var o=c(3),n=c(19);const r=e=>e.length,s=Object(o.getSetting)("collectableMethodIds",[]),a=e=>s.includes(e.method_id),i=e=>!!n.f&&(Array.isArray(e)?!!e.find(e=>s.includes(e)):s.includes(e)),l=e=>e.reduce((function(e,t){return e+t.shipping_rates.length}),0)},,,,function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(4),s=c.n(r),a=c(38),i=c(13),l=c(46),u=c(3),p=c(22);c(283),t.a=e=>{let{currency:t,values:c,className:r}=e;const d=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),{total_price:b,total_tax:m,tax_lines:g}=c,{receiveCart:h,...O}=Object(l.a)(),_=Object(i.applyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(n.__)("Total","woocommerce"),extensions:O.extensions,arg:{cart:O}}),k=parseInt(m,10),j=g&&g.length>0?Object(n.sprintf)(
|
||
/* translators: %s is a list of tax rates */
|
||
Object(n.__)("Including %s","woocommerce"),g.map(e=>{let{name:c,price:o}=e;return`${Object(p.formatPrice)(o,t)} ${c}`}).join(", ")):Object(n.__)("Including <TaxAmount/> in taxes","woocommerce");return Object(o.createElement)(i.TotalsItem,{className:s()("wc-block-components-totals-footer-item",r),currency:t,label:_,value:parseInt(b,10),description:d&&0!==k&&Object(o.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(j,{TaxAmount:Object(o.createElement)(a.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:k})}))})}},function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(74),s=c(258),a=c(13),i=c(3);c(284);const l={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:c,isRemovingCoupon:u,removeCoupon:p,values:d}=e;const{total_discount:b,total_discount_tax:m}=d,g=parseInt(b,10);if(!g&&0===t.length)return null;const h=parseInt(m,10),O=Object(i.getSetting)("displayCartPricesIncludingTax",!1)?g+h:g,_=Object(a.applyCheckoutFilter)({arg:l,filterName:"coupons",defaultValue:t});return Object(o.createElement)(a.TotalsItem,{className:"wc-block-components-totals-discount",currency:c,description:0!==_.length&&Object(o.createElement)(r.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woocommerce"),isLoading:u,showSpinner:!1},Object(o.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},_.map(e=>Object(o.createElement)(s.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(n.sprintf)(
|
||
/* translators: %s Coupon code. */
|
||
Object(n.__)("Coupon: %s","woocommerce"),e.label),disabled:u,onRemove:()=>{p(e.code)},radius:"large",ariaLabel:Object(n.sprintf)(
|
||
/* translators: %s is a coupon code. */
|
||
Object(n.__)('Remove coupon "%s"',"woocommerce"),e.label)})))),label:O?Object(n.__)("Discount","woocommerce"):Object(n.__)("Coupons","woocommerce"),value:O?-1*O:"-"})}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return s}));var o=c(1),n=c(7);c(61),Object(o.__)("Something went wrong. Please contact us to get assistance.","woocommerce");const r=()=>{const e=Object(n.select)("wc/store/store-notices").getRegisteredContainers(),{removeNotice:t}=Object(n.dispatch)("core/notices"),{getNotices:c}=Object(n.select)("core/notices");e.forEach(e=>{c(e).forEach(c=>{t(c.id,e)})})},s=e=>{const{removeNotice:t}=Object(n.dispatch)("core/notices"),{getNotices:c}=Object(n.select)("core/notices");c(e).forEach(c=>{t(c.id,e)})}},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(256),n=c.n(o);const r=["a","b","em","i","strong","p","br"],s=["target","href","rel","name","download"],a=(e,t)=>{const c=(null==t?void 0:t.tags)||r,o=(null==t?void 0:t.attr)||s;return n.a.sanitize(e,{ALLOWED_TAGS:c,ALLOWED_ATTR:o})}},function(e,t,c){"use strict";var o=c(0),n=c(1),r=c(57),s=c(74),a=c(12),i=c(13),l=c(7),u=c(10),p=c(4),d=c.n(p);c(292),t.a=Object(a.withInstanceId)(e=>{let{instanceId:t,isLoading:c=!1,onSubmit:a,displayCouponForm:p=!1}=e;const[b,m]=Object(o.useState)(""),[g,h]=Object(o.useState)(!p),O="wc-block-components-totals-coupon__input-"+t,_=d()("wc-block-components-totals-coupon__content",{"screen-reader-text":g}),{validationErrorId:k}=Object(l.useSelect)(e=>({validationErrorId:e(u.VALIDATION_STORE_KEY).getValidationErrorId(O)}));return Object(o.createElement)("div",{className:"wc-block-components-totals-coupon"},g?Object(o.createElement)("a",{role:"button",href:"#wc-block-components-totals-coupon__form",className:"wc-block-components-totals-coupon-link","aria-label":Object(n.__)("Add a coupon","woocommerce"),onClick:e=>{e.preventDefault(),h(!1)}},Object(n.__)("Add a coupon","woocommerce")):Object(o.createElement)(s.a,{screenReaderLabel:Object(n.__)("Applying coupon…","woocommerce"),isLoading:c,showSpinner:!1},Object(o.createElement)("div",{className:_},Object(o.createElement)("form",{className:"wc-block-components-totals-coupon__form",id:"wc-block-components-totals-coupon__form"},Object(o.createElement)(i.ValidatedTextInput,{id:O,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(n.__)("Enter code","woocommerce"),value:b,ariaDescribedBy:k,onChange:e=>{m(e)},focusOnMount:!0,showError:!1}),Object(o.createElement)(r.a,{className:"wc-block-components-totals-coupon__button",disabled:c||!b,showSpinner:c,onClick:e=>{e.preventDefault(),void 0!==a?a(b).then(e=>{e&&(m(""),h(!0))}):(m(""),h(!0))},type:"submit"},Object(n.__)("Apply","woocommerce"))),Object(o.createElement)(i.ValidationInputError,{propertyName:"coupon",elementId:O}))))})},,,function(e,t,c){"use strict";var o=c(6),n=c.n(o),r=c(0),s=c(11);const a={warning:"#F0B849",error:"#CC1818",success:"#46B450",info:"#0073AA"};t.a=e=>{let{status:t="warning",...c}=e;return Object(r.createElement)(s.SVG,n()({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},c),Object(r.createElement)("path",{d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z",stroke:a[t],strokeWidth:"1.5"}),Object(r.createElement)("path",{d:"M13 7H11V13H13V7Z",fill:a[t]}),Object(r.createElement)("path",{d:"M13 15H11V17H13V15Z",fill:a[t]}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return p})),c.d(t,"b",(function(){return b}));var o=c(5),n=c(69),r=c(7),s=c(0),a=c(55),i=c(47),l=c(8);const u=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},p=()=>{Object(i.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||Object(r.subscribe)(()=>{var e,t,c,n;const s=Object(r.select)(o.store);if(!s)return;const a=s.getSelectedBlock();a&&(u("wc-lock-selected-block--remove",!(null==a||null===(e=a.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),u("wc-lock-selected-block--move",!(null==a||null===(c=a.attributes)||void 0===c||null===(n=c.lock)||void 0===n||!n.move)))})},d=e=>{let{ref:t}=e;const c=Object(i.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),u=t.current;return Object(s.useEffect)(()=>{if(u&&!c)return u.addEventListener("keydown",e,{capture:!0,passive:!1}),()=>{u.removeEventListener("keydown",e,{capture:!0})};function e(e){const{keyCode:t,target:c}=e;if(!(c instanceof HTMLElement))return;if(t!==a.BACKSPACE&&t!==a.DELETE)return;if(Object(n.isTextField)(c))return;const s=c;void 0!==s.dataset.block&&(e=>{var t,c,n,s,a;if(!e)return!1;const{getBlock:i}=Object(r.select)(o.store),u=i(e);if("boolean"==typeof(null==u||null===(t=u.attributes)||void 0===t||null===(c=t.lock)||void 0===c?void 0:c.remove))return u.attributes.lock.remove;const p=Object(l.getBlockType)(u.name);var d,b,m;return"boolean"==typeof(null==p||null===(n=p.attributes)||void 0===n||null===(s=n.lock)||void 0===s||null===(a=s.default)||void 0===a?void 0:a.remove)&&(null==p||null===(d=p.attributes)||void 0===d||null===(b=d.lock)||void 0===b||null===(m=b.default)||void 0===m?void 0:m.remove)})(s.dataset.block)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}},[u,c])},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object(s.useRef)(),c=Object(o.useBlockProps)({ref:t,...e});return d({ref:t}),c}},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(0),n=c(5),r=c(2),s=c(1);const a=e=>{let{attributes:t,setAttributes:c}=e;const{hasDarkControls:a}=t;return Object(o.createElement)(n.InspectorControls,null,Object(o.createElement)(r.PanelBody,{title:Object(s.__)("Style","woocommerce")},Object(o.createElement)(r.ToggleControl,{label:Object(s.__)("Dark mode inputs","woocommerce"),help:Object(s.__)("Inputs styled specifically for use on dark background colors.","woocommerce"),checked:a,onChange:()=>c({hasDarkControls:!a})})))}},,function(e,t,c){e.exports=c(497)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t);var o=c(0),n=c(4),r=c.n(n),s=c(11),a=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(o.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M5 3.75h14c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H5c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(o.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.4 10.75c0-.47.38-.85.85-.85h9.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-9.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h8.8v-.8H7.6zM12.4 15.25c0-.47.38-.85.85-.85h3.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-3.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h2.8v-.8h-2.8zM6.5 15.9a.6.6 0 01.6-.6h2.8a.6.6 0 010 1.2H7.1a.6.6 0 01-.6-.6zM6.5 7.9a.6.6 0 01.6-.6h9.8a.6.6 0 110 1.2H7.1a.6.6 0 01-.6-.6z",clipRule:"evenodd"})),i=c(72),l=c(8),u=c(1),p=c(5),d=c(406),b=c(87),m=c(306),g=c(348);const h={cc:[{method:{gateway:"credit-card",last4:"5678",brand:"Visa"},expires:"12/20",is_default:!1,tokenId:"1"}]};var O=c(2),_=c(13),k=c(566),j=c(407);const E=Object(o.createContext)({showCompanyField:!1,showApartmentField:!1,showPhoneField:!1,requireCompanyField:!1,requirePhoneField:!1,showOrderNotes:!0,showPolicyLinks:!0,showReturnToCart:!0,cartPageId:0,showRateAfterTaxName:!1}),y=Object(o.createContext)({addressFieldControls:()=>null}),w=()=>Object(o.useContext)(E),f=()=>Object(o.useContext)(y);var v=c(341),C=c(347);c(428),Object(l.registerBlockType)("woocommerce/checkout-fields-block",{icon:{src:Object(o.createElement)(i.a,{icon:k.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t,attributes:c}=e;const n=Object(p.useBlockProps)({className:r()("wc-block-checkout__main",null==c?void 0:c.className)}),s=Object(v.a)(_.innerBlockAreas.CHECKOUT_FIELDS),{addressFieldControls:a}=f(),i=[["woocommerce/checkout-express-payment-block",{},[]],["woocommerce/checkout-contact-information-block",{},[]],["woocommerce/checkout-shipping-method-block",{},[]],["woocommerce/checkout-pickup-options-block",{},[]],["woocommerce/checkout-shipping-address-block",{},[]],["woocommerce/checkout-billing-address-block",{},[]],["woocommerce/checkout-shipping-methods-block",{},[]],["woocommerce/checkout-payment-block",{},[]],["woocommerce/checkout-order-note-block",{},[]],["woocommerce/checkout-terms-block",{},[]],["woocommerce/checkout-actions-block",{},[]]].filter(Boolean);return Object(C.a)({clientId:t,registeredBlocks:s,defaultTemplate:i}),Object(o.createElement)(j.a,n,Object(o.createElement)(a,null),Object(o.createElement)("form",{className:"wc-block-components-form wc-block-checkout__form"},Object(o.createElement)(p.InnerBlocks,{allowedBlocks:s,templateLock:!1,template:i,renderAppender:p.InnerBlocks.ButtonBlockAppender})))},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(p.InnerBlocks.Content,null))});var S=c(410);c(429),Object(l.registerBlockType)("woocommerce/checkout-totals-block",{icon:{src:Object(o.createElement)(i.a,{icon:k.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{clientId:t,attributes:c}=e;const n=Object(p.useBlockProps)({className:r()("wc-block-checkout__sidebar",null==c?void 0:c.className)}),s=Object(v.a)(_.innerBlockAreas.CHECKOUT_TOTALS),a=[["woocommerce/checkout-order-summary-block",{},[]]];return Object(C.a)({clientId:t,registeredBlocks:s,defaultTemplate:a}),Object(o.createElement)(S.a,n,Object(o.createElement)(p.InnerBlocks,{allowedBlocks:s,templateLock:!1,template:a,renderAppender:p.InnerBlocks.ButtonBlockAppender}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(p.InnerBlocks.Content,null))});var P=c(572),N=c(3),T=c(7),x=c(10),R=c(305),A=c(134);const I=()=>{const{needsShipping:e}=Object(A.a)(),{useShippingAsBilling:t,prefersCollection:c}=Object(T.useSelect)(e=>({useShippingAsBilling:e(x.CHECKOUT_STORE_KEY).getUseShippingAsBilling(),prefersCollection:e(x.CHECKOUT_STORE_KEY).prefersCollection()})),{__internalSetUseShippingAsBilling:n}=Object(T.useDispatch)(x.CHECKOUT_STORE_KEY),{billingAddress:r,setBillingAddress:s,shippingAddress:a,setShippingAddress:i}=Object(R.a)(),l=Object(o.useCallback)(e=>{s({email:e})},[s]),u=Object(o.useCallback)(e=>{s({phone:e})},[s]),p=Object(o.useCallback)(e=>{i({phone:e})},[i]),d=Object(N.getSetting)("forcedBillingAddress",!1);return{shippingAddress:a,billingAddress:r,setShippingAddress:i,setBillingAddress:s,setEmail:l,setBillingPhone:u,setShippingPhone:p,defaultAddressFields:N.defaultAddressFields,useShippingAsBilling:t,setUseShippingAsBilling:n,needsShipping:e,showShippingFields:!d&&e&&!c,showShippingMethods:e&&!c,showBillingFields:!e||!t||c,forcedBillingAddress:d,useBillingAsShipping:d||c}};var M=c(150),B=e=>{let{children:t,stepHeadingContent:c}=e;return Object(o.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(o.createElement)(M.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&Object(o.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},c))};const D=e=>{let{attributes:t,setAttributes:c,className:n="",children:s}=e;const{title:a="",description:i="",showStepNumber:l=!0}=t,d=Object(p.useBlockProps)({className:r()("wc-block-components-checkout-step",n,{"wc-block-components-checkout-step--with-step-number":l})});return Object(o.createElement)("div",d,Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Form Step Options","woocommerce")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Show step number","woocommerce"),checked:l,onChange:()=>c({showStepNumber:!l})}))),Object(o.createElement)(B,null,Object(o.createElement)(p.PlainText,{className:"",value:a,onChange:e=>c({title:e}),style:{backgroundColor:"transparent"}})),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__container"},Object(o.createElement)("p",{className:"wc-block-components-checkout-step__description"},Object(o.createElement)(p.PlainText,{className:i?"":"wc-block-components-checkout-step__description-placeholder",value:i,placeholder:Object(u.__)("Optional text for this form step.","woocommerce"),onChange:e=>c({description:e}),style:{backgroundColor:"transparent"}})),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__content"},s)))};c(430);const L=e=>{let{block:t}=e;const{"data-block":c}=Object(p.useBlockProps)(),n=Object(v.a)(t);return Object(C.a)({clientId:c,registeredBlocks:n}),Object(o.createElement)("div",{className:"wc-block-checkout__additional_fields"},Object(o.createElement)(p.InnerBlocks,{allowedBlocks:n}))},F=()=>Object(o.createElement)(p.InnerBlocks.Content,null);var U=c(506),V=c(88),Y=c(61),K=c(54),$=e=>{let{id:t="phone",errorId:c="phone",isRequired:n=!1,value:r="",onChange:s}=e;return Object(o.createElement)(_.ValidatedTextInput,{id:t,errorId:c,type:"tel",autoComplete:"tel",required:n,label:n?Object(u.__)("Phone","woocommerce"):Object(u.__)("Phone (optional)","woocommerce"),value:r,onChange:s})},q=e=>{let{showCompanyField:t=!1,showApartmentField:c=!1,showPhoneField:n=!1,requireCompanyField:r=!1,requirePhoneField:s=!1}=e;const{defaultAddressFields:a,setShippingAddress:i,setBillingAddress:l,shippingAddress:p,setShippingPhone:d,useShippingAsBilling:m,setUseShippingAsBilling:g}=I(),{dispatchCheckoutEvent:h}=Object(V.a)(),{isEditor:O}=Object(b.b)(),[k,j]=Object(o.useState)(!1);Object(o.useEffect)(()=>{n||d("")},[n,d]),Object(o.useEffect)(()=>{k||(m&&l(p),j(!0))},[k,l,p,m]);const E=Object(o.useMemo)(()=>({company:{hidden:!t,required:r},address_2:{hidden:!c}}),[t,r,c]),y=O?K.a:o.Fragment,w=m?[Y.d.SHIPPING_ADDRESS,Y.d.BILLING_ADDRESS]:[Y.d.SHIPPING_ADDRESS];return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,null,Object(o.createElement)(_.StoreNoticesContainer,{context:w}),Object(o.createElement)(U.a,{id:"shipping",type:"shipping",onChange:e=>{i(e),m&&l(e),h("set-shipping-address")},values:p,fields:Object.keys(a),fieldConfig:E}),n&&Object(o.createElement)($,{id:"shipping-phone",errorId:"shipping_phone",isRequired:s,value:p.phone,onChange:e=>{d(e),h("set-phone-number",{step:"shipping"})}})),Object(o.createElement)(_.CheckboxControl,{className:"wc-block-checkout__use-address-for-billing",label:Object(u.__)("Use same address for billing","woocommerce"),checked:m,onChange:e=>{g(e),e&&l(p)}}))},H=e=>{let{defaultTitle:t=Object(u.__)("Step","woocommerce"),defaultDescription:c=Object(u.__)("Step description text.","woocommerce"),defaultShowStepNumber:o=!0}=e;return{title:{type:"string",default:t},description:{type:"string",default:c},showStepNumber:{type:"boolean",default:o}}},z={...H({defaultTitle:Object(u.__)("Shipping address","woocommerce"),defaultDescription:Object(u.__)("Enter the address where you want your order delivered.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(l.registerBlockType)("woocommerce/checkout-shipping-address-block",{icon:{src:Object(o.createElement)(i.a,{icon:P.a,className:"wc-block-editor-components-block-icon"})},attributes:z,edit:e=>{let{attributes:t,setAttributes:c}=e;const{showCompanyField:n,showApartmentField:s,requireCompanyField:a,showPhoneField:i,requirePhoneField:l}=w(),{addressFieldControls:u}=f(),{showShippingFields:p}=I();return p?Object(o.createElement)(D,{setAttributes:c,attributes:t,className:r()("wc-block-checkout__shipping-fields",null==t?void 0:t.className)},Object(o.createElement)(u,null),Object(o.createElement)(q,{showCompanyField:n,showApartmentField:s,requireCompanyField:a,showPhoneField:i,requirePhoneField:l}),Object(o.createElement)(L,{block:_.innerBlockAreas.SHIPPING_ADDRESS})):null},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(F,null))});var W=c(573),G=c(19);c(431);const X=G.k?`<a href="${G.k}" target="_blank">${Object(u.__)("Terms and Conditions","woocommerce")}</a>`:Object(u.__)("Terms and Conditions","woocommerce"),Q=G.g?`<a href="${G.g}" target="_blank">${Object(u.__)("Privacy Policy","woocommerce")}</a>`:Object(u.__)("Privacy Policy","woocommerce"),Z=Object(u.sprintf)(
|
||
/* translators: %1$s terms page link, %2$s privacy page link. */
|
||
Object(u.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woocommerce"),X,Q),J=Object(u.sprintf)(
|
||
/* translators: %1$s terms page link, %2$s privacy page link. */
|
||
Object(u.__)("You must accept our %1$s and %2$s to continue with your purchase.","woocommerce"),X,Q);Object(l.registerBlockType)("woocommerce/checkout-terms-block",{icon:{src:Object(o.createElement)(i.a,{icon:W.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:{checkbox:t,text:c},setAttributes:n}=e;const r=Object(p.useBlockProps)(),s=c||(t?J:Z);return Object(o.createElement)("div",r,Object(o.createElement)(p.InspectorControls,null,(!G.k||!G.g)&&Object(o.createElement)(O.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1},Object(u.__)("Link to your store's Terms and Conditions and Privacy Policy pages by creating pages for them.","woocommerce"),Object(o.createElement)("br",null),!G.k&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("br",null),Object(o.createElement)(O.ExternalLink,{href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=advanced"},Object(u.__)("Setup a Terms and Conditions page","woocommerce"))),!G.g&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)("br",null),Object(o.createElement)(O.ExternalLink,{href:N.ADMIN_URL+"options-privacy.php"},Object(u.__)("Setup a Privacy Policy page","woocommerce")))),G.k&&G.g&&!(s.includes(G.k)&&s.includes(G.g))&&Object(o.createElement)(O.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:Z!==c?[{label:Object(u.__)("Restore default text","woocommerce"),onClick:()=>n({text:""})}]:[]},Object(o.createElement)("p",null,Object(u.__)("Ensure you add links to your policy pages in this section.","woocommerce"))),Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Display options","woocommerce")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Require checkbox","woocommerce"),checked:t,onChange:()=>n({checkbox:!t})}))),Object(o.createElement)("div",{className:"wc-block-checkout__terms"},t?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(_.CheckboxControl,{id:"terms-condition",checked:!1}),Object(o.createElement)(p.RichText,{value:s,onChange:e=>n({text:e})})):Object(o.createElement)(p.RichText,{tagName:"span",value:s,onChange:e=>n({text:e})})))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var ee=c(574),te=c(17),ce=()=>{const{customerId:e,shouldCreateAccount:t}=Object(T.useSelect)(e=>{const t=e(x.CHECKOUT_STORE_KEY);return{customerId:t.getCustomerId(),shouldCreateAccount:t.getShouldCreateAccount()}}),{__internalSetShouldCreateAccount:c}=Object(T.useDispatch)(x.CHECKOUT_STORE_KEY),{billingAddress:n,setEmail:r}=I(),{dispatchCheckoutEvent:s}=Object(V.a)(),a=!e&&Object(N.getSetting)("checkoutAllowsGuest",!1)&&Object(N.getSetting)("checkoutAllowsSignup",!1)&&Object(o.createElement)(_.CheckboxControl,{className:"wc-block-checkout__create-account",label:Object(u.__)("Create an account?","woocommerce"),checked:t,onChange:e=>c(e)});return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(_.StoreNoticesContainer,{context:Y.d.CONTACT_INFORMATION}),Object(o.createElement)(_.ValidatedTextInput,{id:"email",type:"email",autoComplete:"email",errorId:"billing_email",label:Object(u.__)("Email address","woocommerce"),value:n.email,required:!0,onChange:e=>{r(e),s("set-email-address")},customValidation:e=>!!Object(te.isEmail)(e.value)||(e.setCustomValidity(Object(u.__)("Please enter a valid email address","woocommerce")),!1)}),a)},oe={...H({defaultTitle:Object(u.__)("Contact information","woocommerce"),defaultDescription:Object(u.__)("We'll use this email to send you details and updates about your order.","woocommerce")}),className:{type:"string",default:""},lock:{type:"object",default:{remove:!0,move:!0}}};Object(l.registerBlockType)("woocommerce/checkout-contact-information-block",{icon:{src:Object(o.createElement)(i.a,{icon:ee.a,className:"wc-block-editor-components-block-icon"})},attributes:oe,edit:e=>{let{attributes:t,setAttributes:c}=e;return Object(o.createElement)(D,{attributes:t,setAttributes:c,className:r()("wc-block-checkout__contact-fields",null==t?void 0:t.className)},Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Account","woocommerce")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("Account creation and guest checkout settings can be managed in the WooCommerce settings.","woocommerce")),Object(o.createElement)(O.ExternalLink,{href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=account"},Object(u.__)("Manage account settings","woocommerce")))),Object(o.createElement)(K.a,null,Object(o.createElement)(ce,null)),Object(o.createElement)(L,{block:_.innerBlockAreas.CONTACT_INFORMATION}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(F,null))});var ne=e=>{let{showCompanyField:t=!1,showApartmentField:c=!1,showPhoneField:n=!1,requireCompanyField:r=!1,requirePhoneField:s=!1}=e;const{defaultAddressFields:a,billingAddress:i,setBillingAddress:l,setShippingAddress:u,setBillingPhone:p,setShippingPhone:d,useBillingAsShipping:m}=I(),{dispatchCheckoutEvent:g}=Object(V.a)(),{isEditor:h}=Object(b.b)();Object(o.useEffect)(()=>{n||p("")},[n,p]);const[O,k]=Object(o.useState)(!1);Object(o.useEffect)(()=>{O||(m&&u(i),k(!0))},[O,u,i,m]);const j=Object(o.useMemo)(()=>({company:{hidden:!t,required:r},address_2:{hidden:!c}}),[t,r,c]),E=h?K.a:o.Fragment,y=m?[Y.d.BILLING_ADDRESS,Y.d.SHIPPING_ADDRESS]:[Y.d.BILLING_ADDRESS];return Object(o.createElement)(E,null,Object(o.createElement)(_.StoreNoticesContainer,{context:y}),Object(o.createElement)(U.a,{id:"billing",type:"billing",onChange:e=>{l(e),m&&(u(e),g("set-shipping-address")),g("set-billing-address")},values:i,fields:Object.keys(a),fieldConfig:j}),n&&Object(o.createElement)($,{id:"billing-phone",errorId:"billing_phone",isRequired:s,value:i.phone,onChange:e=>{p(e),g("set-phone-number",{step:"billing"}),m&&(d(e),g("set-phone-number",{step:"shipping"}))}}))};const re=Object(u.__)("Billing address","woocommerce"),se=Object(u.__)("Enter the billing address that matches your payment method.","woocommerce"),ae=Object(u.__)("Billing and shipping address","woocommerce"),ie=Object(u.__)("Enter the billing and shipping address that matches your payment method.","woocommerce");var le={...H({defaultTitle:re,defaultDescription:se}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(l.registerBlockType)("woocommerce/checkout-billing-address-block",{icon:{src:Object(o.createElement)(i.a,{icon:P.a,className:"wc-block-editor-components-block-icon"})},attributes:le,edit:e=>{let{attributes:t,setAttributes:c}=e;const{showCompanyField:n,showApartmentField:s,requireCompanyField:a,showPhoneField:i,requirePhoneField:l}=w(),{addressFieldControls:u}=f(),{showBillingFields:p,forcedBillingAddress:d,useBillingAsShipping:b}=I();return p||b?(t.title=((e,t)=>t?e===re?ae:e:e===ae?re:e)(t.title,d),t.description=((e,t)=>t?e===se?ie:e:e===ie?se:e)(t.description,d),Object(o.createElement)(D,{setAttributes:c,attributes:t,className:r()("wc-block-checkout__billing-fields",null==t?void 0:t.className)},Object(o.createElement)(u,null),Object(o.createElement)(ne,{showCompanyField:n,showApartmentField:s,requireCompanyField:a,showPhoneField:i,requirePhoneField:l}),Object(o.createElement)(L,{block:_.innerBlockAreas.BILLING_ADDRESS}))):null},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(F,null))});var ue=c(554);const pe=Object(u.__)("Place Order","woocommerce");var de={cartPageId:{type:"number",default:0},showReturnToCart:{type:"boolean",default:!0},className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}},placeOrderButtonLabel:{type:"string",default:pe}},be=c(232),me=c(575);c(432);var ge=e=>{let{link:t}=e;const c=t||G.d;return c?Object(o.createElement)("a",{href:c,className:"wc-block-components-checkout-return-to-cart-button"},Object(o.createElement)(i.a,{icon:me.a}),Object(u.__)("Return to Cart","woocommerce")):null},he=c(120);const Oe={icon:{src:Object(o.createElement)(i.a,{icon:ue.a,className:"wc-block-editor-components-block-icon"})},attributes:de,save:()=>Object(o.createElement)("div",p.useBlockProps.save()),edit:e=>{let{attributes:t,setAttributes:c}=e;const n=Object(p.useBlockProps)(),{cartPageId:r=0,showReturnToCart:s=!0,placeOrderButtonLabel:a}=t,{current:i}=Object(o.useRef)(r),l=Object(T.useSelect)(e=>i||e("core/editor").getCurrentPostId(),[i]);return Object(o.createElement)("div",n,Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Account options","woocommerce")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)('Show a "Return to Cart" link',"woocommerce"),checked:s,onChange:()=>c({showReturnToCart:!s})})),s&&!(l===G.e&&0===i)&&Object(o.createElement)(be.a,{pageId:r,setPageId:e=>c({cartPageId:e}),labels:{title:Object(u.__)("Return to Cart button","woocommerce"),default:Object(u.__)("WooCommerce Cart Page","woocommerce")}})),Object(o.createElement)("div",{className:"wc-block-checkout__actions"},Object(o.createElement)(K.a,null,s&&Object(o.createElement)(ge,{link:Object(N.getSetting)("page-"+r,!1)})),Object(o.createElement)(he.a,{className:"wc-block-cart__submit-button wc-block-components-checkout-place-order-button",value:a,placeholder:pe,onChange:e=>{c({placeOrderButtonLabel:e})}})))}};Object(l.registerBlockType)("woocommerce/checkout-actions-block",Oe);var _e=c(190);c(434);const ke=e=>{let{title:t,stepHeadingContent:c}=e;return Object(o.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(o.createElement)(M.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!c&&Object(o.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},c))};var je=e=>{let{id:t,className:c,title:n,legend:s,description:a,children:i,disabled:l=!1,showStepNumber:u=!0,stepHeadingContent:p=(()=>{})}=e;const d=s||n?"fieldset":"div";return Object(o.createElement)(d,{className:r()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":u,"wc-block-components-checkout-step--disabled":l}),id:t,disabled:l},!(!s&&!n)&&Object(o.createElement)("legend",{className:"screen-reader-text"},s||n),!!n&&Object(o.createElement)(ke,{title:n,stepHeadingContent:p()}),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!a&&Object(o.createElement)("p",{className:"wc-block-components-checkout-step__description"},a),Object(o.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))};c(436);const Ee=e=>{let{className:t="",disabled:c=!1,onTextChange:n,placeholder:s,value:a=""}=e;return Object(o.createElement)("textarea",{className:r()("wc-block-components-textarea",t),disabled:c,onChange:e=>{n(e.target.value)},placeholder:s,rows:2,value:a})};c(435);var ye=e=>{let{disabled:t,onChange:c,placeholder:n,value:r}=e;const[s,a]=Object(o.useState)(!1),[i,l]=Object(o.useState)("");return Object(o.createElement)("div",{className:"wc-block-checkout__add-note"},Object(o.createElement)(_.CheckboxControl,{disabled:t,label:Object(u.__)("Add a note to your order","woocommerce"),checked:s,onChange:e=>{a(e),e?r!==i&&c(i):(c(""),l(r))}}),s&&Object(o.createElement)(Ee,{disabled:t,onTextChange:c,placeholder:n,value:r}))},we=e=>{let{className:t}=e;const{needsShipping:c}=Object(A.a)(),{isProcessing:n,orderNotes:s}=Object(T.useSelect)(e=>{const t=e(x.CHECKOUT_STORE_KEY);return{isProcessing:t.isProcessing(),orderNotes:t.getOrderNotes()}}),{__internalSetOrderNotes:a}=Object(T.useDispatch)(x.CHECKOUT_STORE_KEY);return Object(o.createElement)(je,{id:"order-notes",showStepNumber:!1,className:r()("wc-block-checkout__order-notes",t),disabled:n},Object(o.createElement)(ye,{disabled:n,onChange:a,placeholder:c?Object(u.__)("Notes about your order, e.g. special notes for delivery.","woocommerce"):Object(u.__)("Notes about your order.","woocommerce"),value:s}))};c(433),Object(l.registerBlockType)("woocommerce/checkout-order-note-block",{icon:{src:Object(o.createElement)(i.a,{icon:_e.a,className:"wc-block-editor-components-block-icon"})},edit:()=>{const e=Object(p.useBlockProps)();return Object(o.createElement)("div",e,Object(o.createElement)(K.a,null,Object(o.createElement)(we,null)))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var fe=c(250),ve=c(416),Ce=c(22),Se=c(46);const Pe=()=>{const{extensions:e,receiveCart:t,...c}=Object(Se.a)(),n={extensions:e,cart:c,context:"woocommerce/checkout"};return Object(o.createElement)(_.ExperimentalOrderMeta.Slot,n)};Object(l.registerBlockType)("woocommerce/checkout-order-summary-block",{icon:{src:Object(o.createElement)(i.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},attributes:{className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}},edit:e=>{let{clientId:t}=e;const c=Object(p.useBlockProps)(),{cartTotals:n}=Object(Se.a)(),r=Object(Ce.getCurrencyFromPriceResponse)(n),s=Object(v.a)(_.innerBlockAreas.CHECKOUT_ORDER_SUMMARY),a=[["woocommerce/checkout-order-summary-cart-items-block",{},[]],["woocommerce/checkout-order-summary-coupon-form-block",{},[]],["woocommerce/checkout-order-summary-subtotal-block",{},[]],["woocommerce/checkout-order-summary-fee-block",{},[]],["woocommerce/checkout-order-summary-discount-block",{},[]],["woocommerce/checkout-order-summary-shipping-block",{},[]],["woocommerce/checkout-order-summary-taxes-block",{},[]]];return Object(C.a)({clientId:t,registeredBlocks:s,defaultTemplate:a}),Object(o.createElement)("div",c,Object(o.createElement)(p.InnerBlocks,{allowedBlocks:s,template:a}),Object(o.createElement)("div",{className:"wc-block-components-totals-wrapper"},Object(o.createElement)(ve.a,{currency:r,values:n})),Object(o.createElement)(Pe,null))},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(p.InnerBlocks.Content,null))});var Ne=c(567),Te=c(6),xe=c.n(Te),Re=c(246),Ae=c(419),Ie=c(423);c(437);var Me=e=>{let{href:t,title:c,description:n,warning:r}=e;return Object(o.createElement)("a",{href:t,className:"wc-block-editor-components-external-link-card",target:"_blank",rel:"noreferrer"},Object(o.createElement)("span",{className:"wc-block-editor-components-external-link-card__content"},Object(o.createElement)("strong",{className:"wc-block-editor-components-external-link-card__title"},c),n&&Object(o.createElement)("span",{className:"wc-block-editor-components-external-link-card__description",dangerouslySetInnerHTML:{__html:Object(Ae.a)(n)}}),r?Object(o.createElement)("span",{className:"wc-block-editor-components-external-link-card__warning"},Object(o.createElement)(i.a,{icon:Object(o.createElement)(Ie.a,{status:"error"})}),Object(o.createElement)("span",null,r)):null),Object(o.createElement)(O.VisuallyHidden,{as:"span"},
|
||
/* translators: accessibility text */
|
||
Object(u.__)("(opens in a new tab)","woocommerce")),Object(o.createElement)(i.a,{icon:Re.a,className:"wc-block-editor-components-external-link-card__icon"}))},Be=c(30),De=c(115);c(438);var Le=()=>Object(o.createElement)(De.a,{isDismissible:!1,className:"wc-block-checkout__no-payment-methods-notice",status:"error"},Object(u.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.","woocommerce")),Fe=c(324),Ue=c(12),Ve=c(126),Ye=Object(Ue.withInstanceId)(e=>{let{className:t,instanceId:c,id:n,selected:s,onChange:a,options:i=[]}=e;const l=n||c;return i.length?Object(o.createElement)("div",{className:r()("wc-block-components-radio-control",t)},i.map(e=>{const t="object"==typeof e&&"content"in e,c=e.value===s;return Object(o.createElement)("div",{className:"wc-block-components-radio-control-accordion-option",key:e.value},Object(o.createElement)(Ve.a,{name:"radio-control-"+l,checked:c,option:e,onChange:t=>{a(t),"function"==typeof e.onChange&&e.onChange(t)}}),t&&c&&Object(o.createElement)("div",{className:r()("wc-block-components-radio-control-accordion-content",{"wc-block-components-radio-control-accordion-content-hide":!c})},e.content))})):null}),Ke=c(39),$e=c(184),qe=e=>{let{children:t,showSaveOption:c}=e;const{isEditor:n}=Object(b.b)(),{shouldSavePaymentMethod:r,customerId:s}=Object(T.useSelect)(e=>{const t=e(x.PAYMENT_STORE_KEY),c=e(x.CHECKOUT_STORE_KEY);return{shouldSavePaymentMethod:t.getShouldSavePaymentMethod(),customerId:c.getCustomerId()}}),{__internalSetShouldSavePaymentMethod:a}=Object(T.useDispatch)(x.PAYMENT_STORE_KEY);return Object(o.createElement)($e.a,{isEditor:n},t,s>0&&c&&Object(o.createElement)(_.CheckboxControl,{className:"wc-block-components-payment-methods__save-card-info",label:Object(u.__)("Save payment information to my account for future purchases.","woocommerce"),checked:r,onChange:()=>a(!r)}))},He=c(78),ze=()=>{const{activeSavedToken:e,activePaymentMethod:t,isExpressPaymentMethodActive:c,savedPaymentMethods:n,availablePaymentMethods:s}=Object(T.useSelect)(e=>{const t=e(He.a);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive(),savedPaymentMethods:t.getSavedPaymentMethods(),availablePaymentMethods:t.getAvailablePaymentMethods()}}),{__internalSetActivePaymentMethod:a}=Object(T.useDispatch)(He.a),i=Object(Ke.getPaymentMethods)(),{...l}=Object(Fe.a)(),{removeNotice:u}=Object(T.useDispatch)("core/notices"),{dispatchCheckoutEvent:p}=Object(V.a)(),{isEditor:d}=Object(b.b)(),m=Object.keys(s).map(e=>{const{edit:t,content:c,label:n,supports:r}=i[e],s=d?t:c;return{value:e,label:"string"==typeof n?n:Object(o.cloneElement)(n,{components:l.components}),name:"wc-saved-payment-method-token-"+e,content:Object(o.createElement)(qe,{showSaveOption:r.showSaveOption},Object(o.cloneElement)(s,{__internalSetActivePaymentMethod:a,...l}))}}),g=Object(o.useCallback)(e=>{a(e),u("wc-payment-error",Y.d.PAYMENTS),p("set-active-payment-method",{value:e})},[p,u,a]),h=0===Object.keys(n).length&&1===Object.keys(i).length,O=r()({"disable-radio-control":h});return c?null:Object(o.createElement)(Ye,{id:"wc-payment-method-options",className:O,selected:e?null:t,onChange:g,options:m})},We=c(149);const Ge=e=>{let{method:t,expires:c}=e;return Object(u.sprintf)(
|
||
/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date. */
|
||
Object(u.__)("%1$s ending in %2$s (expires %3$s)","woocommerce"),t.brand,t.last4,c)},Xe=e=>{let{method:t}=e;return t.brand&&t.last4?Object(u.sprintf)(
|
||
/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card. */
|
||
Object(u.__)("%1$s ending in %2$s","woocommerce"),t.brand,t.last4):Object(u.sprintf)(
|
||
/* translators: %s is the name of the payment method gateway. */
|
||
Object(u.__)("Saved token for %s","woocommerce"),t.gateway)};var Qe=()=>{var e,t;const{activeSavedToken:c,activePaymentMethod:n,savedPaymentMethods:r}=Object(T.useSelect)(e=>{const t=e(x.PAYMENT_STORE_KEY);return{activeSavedToken:t.getActiveSavedToken(),activePaymentMethod:t.getActivePaymentMethod(),savedPaymentMethods:t.getSavedPaymentMethods()}}),{__internalSetActivePaymentMethod:s}=Object(T.useDispatch)(x.PAYMENT_STORE_KEY),a=Object(Ke.getPaymentMethods)(),i=Object(Fe.a)(),{removeNotice:l}=Object(T.useDispatch)("core/notices"),{dispatchCheckoutEvent:u}=Object(V.a)(),p=Object(o.useMemo)(()=>Object.keys(r).flatMap(e=>r[e].map(t=>{const c="cc"===e||"echeck"===e,o=t.method.gateway;return{name:"wc-saved-payment-method-token-"+o,label:c?Ge(t):Xe(t),value:t.tokenId.toString(),onChange:e=>{s(o,{token:e,payment_method:o,[`wc-${o}-payment-token`]:e.toString(),isSavedToken:!0}),l("wc-payment-error",Y.d.PAYMENTS),u("set-active-payment-method",{paymentMethodSlug:o})}}})).filter(Boolean),[r,s,l,u]),d=c&&a[n]&&null!==(e=a[n])&&void 0!==e&&e.savedTokenComponent?Object(o.cloneElement)(null===(t=a[n])||void 0===t?void 0:t.savedTokenComponent,{token:c,...i}):null;return p.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(We.a,{id:"wc-payment-method-saved-tokens",selected:c,options:p,onChange:()=>{}}),d):null},Ze=()=>{const{paymentMethodsInitialized:e,availablePaymentMethods:t,savedPaymentMethods:c}=Object(T.useSelect)(e=>{const t=e(x.PAYMENT_STORE_KEY);return{paymentMethodsInitialized:t.paymentMethodsInitialized(),availablePaymentMethods:t.getAvailablePaymentMethods(),savedPaymentMethods:t.getSavedPaymentMethods()}});return e&&0===Object.keys(t).length?Object(o.createElement)(Le,null):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(Qe,null),Object.keys(c).length>0&&Object(o.createElement)(Be.a,{label:Object(u.__)("Use another payment method.","woocommerce"),screenReaderLabel:Object(u.__)("Other available payment methods","woocommerce"),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),Object(o.createElement)(ze,null))},Je=()=>Object(o.createElement)(Ze,null),et={...H({defaultTitle:Object(u.__)("Payment options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(l.registerBlockType)("woocommerce/checkout-payment-block",{icon:{src:Object(o.createElement)(i.a,{icon:Ne.a,className:"wc-block-editor-components-block-icon"})},attributes:et,edit:e=>{let{attributes:t,setAttributes:c}=e;const n=Object(N.getSetting)("globalPaymentMethods"),{incompatiblePaymentMethods:s}=Object(T.useSelect)(e=>{const{getIncompatiblePaymentMethods:t}=e(x.PAYMENT_STORE_KEY);return{incompatiblePaymentMethods:t()}},[]),a=Object(u.__)("Incompatible with block-based checkout","woocommerce");return Object(o.createElement)(D,{attributes:t,setAttributes:c,className:r()("wc-block-checkout__payment-method",null==t?void 0:t.className)},Object(o.createElement)(p.InspectorControls,null,n.length>0&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Methods","woocommerce")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("You currently have the following payment integrations active.","woocommerce")),n.map(e=>{const t=!!s[e.id];return Object(o.createElement)(Me,xe()({key:e.id,href:`${N.ADMIN_URL}admin.php?page=wc-settings&tab=checkout§ion=${e.id}`,title:e.title,description:e.description},t?{warning:a}:{}))}),Object(o.createElement)(O.ExternalLink,{href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=checkout"},Object(u.__)("Manage payment methods","woocommerce")))),Object(o.createElement)(K.a,null,Object(o.createElement)(Je,null)),Object(o.createElement)(L,{block:_.innerBlockAreas.PAYMENT_METHODS}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(F,null))});var tt=c(255),ct=c(74),ot=c(230);c(280);var nt=()=>{const{isCalculating:e,isProcessing:t,isAfterProcessing:c,isBeforeProcessing:n,isComplete:r,hasError:s}=Object(T.useSelect)(e=>{const t=e(x.CHECKOUT_STORE_KEY);return{isCalculating:t.isCalculating(),isProcessing:t.isProcessing(),isAfterProcessing:t.isAfterProcessing(),isBeforeProcessing:t.isBeforeProcessing(),isComplete:t.isComplete(),hasError:t.hasError()}}),{availableExpressPaymentMethods:a,expressPaymentMethodsInitialized:i,isExpressPaymentMethodActive:l}=Object(T.useSelect)(e=>{const t=e(x.PAYMENT_STORE_KEY);return{availableExpressPaymentMethods:t.getAvailableExpressPaymentMethods(),expressPaymentMethodsInitialized:t.expressPaymentMethodsInitialized(),isExpressPaymentMethodActive:t.isExpressPaymentMethodActive()}}),{isEditor:p}=Object(b.b)();if(!i||i&&0===Object.keys(a).length)return p||N.CURRENT_USER_IS_ADMIN?Object(o.createElement)(_.StoreNoticesContainer,{context:Y.d.EXPRESS_PAYMENTS}):null;const d=t||c||n||r&&!s;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(ct.a,{isLoading:e||d||l},Object(o.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--checkout"},Object(o.createElement)("div",{className:"wc-block-components-express-payment__title-container"},Object(o.createElement)(M.a,{className:"wc-block-components-express-payment__title",headingLevel:"2"},Object(u.__)("Express checkout","woocommerce"))),Object(o.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(o.createElement)(_.StoreNoticesContainer,{context:Y.d.EXPRESS_PAYMENTS}),Object(o.createElement)(ot.a,null)))),Object(o.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout"},Object(u.__)("Or continue below","woocommerce")))},rt=e=>{let{className:t}=e;const{cartNeedsPayment:c}=Object(Se.a)();return c?Object(o.createElement)("div",{className:t},Object(o.createElement)(nt,null)):null};c(439),Object(l.registerBlockType)("woocommerce/checkout-express-payment-block",{icon:{src:Object(o.createElement)(i.a,{icon:Ne.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{paymentMethods:c,isInitialized:n}=Object(tt.a)(),s=Object.keys(c).length>0,a=Object(p.useBlockProps)({className:r()({"wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods":s},null==t?void 0:t.className),attributes:t});return n&&s?Object(o.createElement)("div",a,Object(o.createElement)(rt,null)):null},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var st=c(576),at=c(577),it=c(159),lt=c(38);const ut=e=>{let{minRate:t,maxRate:c,multiple:n=!1}=e;if(void 0===t||void 0===c)return null;const r=Object(N.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(t.price,10)+parseInt(t.taxes,10):parseInt(t.price,10),s=Object(N.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(c.price,10)+parseInt(c.taxes,10):parseInt(c.price,10),a=0===r?Object(o.createElement)("em",null,Object(u.__)("free","woocommerce")):Object(o.createElement)(lt.a,{currency:Object(Ce.getCurrencyFromPriceResponse)(t),value:r});return Object(o.createElement)("span",{className:"wc-block-checkout__shipping-method-option-price"},r!==s||n?Object(o.createInterpolateElement)(0===r&&0===s?"<price />":Object(u.__)("from <price />","woocommerce"),{price:a}):a)};var pt=c(412);function dt(e){return e?{min:e.reduce((e,t)=>Object(pt.c)(t.method_id)?e:void 0===e||parseInt(t.price,10)<parseInt(e.price,10)?t:e,void 0),max:e.reduce((e,t)=>Object(pt.c)(t.method_id)?e:void 0===e||parseInt(t.price,10)>parseInt(e.price,10)?t:e,void 0)}:{min:void 0,max:void 0}}function bt(e){return e?{min:e.reduce((e,t)=>Object(pt.c)(t.method_id)&&(void 0===e||t.price<e.price)?t:e,void 0),max:e.reduce((e,t)=>Object(pt.c)(t.method_id)&&(void 0===e||t.price>e.price)?t:e,void 0)}:{min:void 0,max:void 0}}c(440);const mt=Object(u.__)("Local Pickup","woocommerce"),gt=Object(u.__)("Shipping","woocommerce"),ht=e=>{let{checked:t,rate:c,showPrice:n,showIcon:s,toggleText:a,setAttributes:l}=e;return Object(o.createElement)(O.__experimentalRadio,{value:"pickup",className:r()("wc-block-checkout__shipping-method-option",{"wc-block-checkout__shipping-method-option--selected":"pickup"===t})},!0===s&&Object(o.createElement)(i.a,{icon:at.a,size:28,className:"wc-block-checkout__shipping-method-option-icon"}),Object(o.createElement)(p.RichText,{value:a,placeholder:mt,tagName:"span",className:"wc-block-checkout__shipping-method-option-title",onChange:e=>l({localPickupText:e}),__unstableDisableFormats:!0,preserveWhiteSpace:!0}),!0===n&&Object(o.createElement)(ut,{minRate:c.min,maxRate:c.max}))},Ot=e=>{let{checked:t,rate:c,showPrice:n,showIcon:s,toggleText:a,setAttributes:l}=e;const d=void 0===c.min?Object(o.createElement)("span",{className:"wc-block-checkout__shipping-method-option-price"},Object(u.__)("calculated with an address","woocommerce")):Object(o.createElement)(ut,{minRate:c.min,maxRate:c.max});return Object(o.createElement)(O.__experimentalRadio,{value:"shipping",className:r()("wc-block-checkout__shipping-method-option",{"wc-block-checkout__shipping-method-option--selected":"shipping"===t})},!0===s&&Object(o.createElement)(i.a,{icon:st.a,size:28,className:"wc-block-checkout__shipping-method-option-icon"}),Object(o.createElement)(p.RichText,{value:a,placeholder:gt,tagName:"span",className:"wc-block-checkout__shipping-method-option-title",onChange:e=>l({shippingText:e}),__unstableDisableFormats:!0,preserveWhiteSpace:!0}),!0===n&&d)};var _t={...H({defaultTitle:Object(u.__)("Shipping method","woocommerce"),defaultDescription:Object(u.__)("Select how you would like to receive your order.","woocommerce")}),className:{type:"string",default:""},showIcon:{type:"boolean",default:!0},showPrice:{type:"boolean",default:!0},localPickupText:{type:"string",default:mt},shippingText:{type:"string",default:gt},lock:{type:"object",default:{move:!0,remove:!0}},shippingCostRequiresAddress:{type:"boolean",default:!1}};Object(l.registerBlockType)("woocommerce/checkout-shipping-method-block",{icon:{src:Object(o.createElement)(i.a,{icon:st.a,className:"wc-block-editor-components-block-icon"})},attributes:_t,edit:e=>{var t,c;let{attributes:n,setAttributes:s,clientId:a}=e;const{setPrefersCollection:i}=Object(T.useDispatch)(x.CHECKOUT_STORE_KEY),{prefersCollection:l}=Object(T.useSelect)(e=>({prefersCollection:e(x.CHECKOUT_STORE_KEY).prefersCollection()})),{showPrice:d,showIcon:b,className:m,localPickupText:g,shippingText:h}=n,{shippingRates:k,needsShipping:j,hasCalculatedShipping:E,isCollectable:y}=Object(A.a)();return j&&E&&k&&y&&G.f?Object(o.createElement)(D,{attributes:n,setAttributes:s,className:r()("wc-block-checkout__shipping-method",m)},Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Calculations","woocommerce")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Hide shipping costs until an address is entered","woocommerce"),checked:n.shippingCostRequiresAddress,onChange:e=>{Object(it.d)(a,"shippingCostRequiresAddress",e,"woocommerce/checkout-shipping-methods-block"),(e=>{const t={};t[e]=!n[e],s(t)})("shippingCostRequiresAddress")}})),Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Appearance","woocommerce")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("Choose how this block is displayed to your customers.","woocommerce")),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Show icon","woocommerce"),checked:b,onChange:()=>s({showIcon:!b})}),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Show costs","woocommerce"),checked:d,onChange:()=>s({showPrice:!d})})),Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Shipping Methods","woocommerce")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("Methods can be made managed in your store settings.","woocommerce")),Object(o.createElement)(Me,{key:"shipping_methods",href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping",title:Object(u.__)("Shipping","woocommerce"),description:Object(u.__)("Manage your shipping zones, methods, and rates.","woocommerce")}),Object(o.createElement)(Me,{key:"pickup_location",href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping§ion=pickup_location",title:Object(u.__)("Local Pickup","woocommerce"),description:Object(u.__)("Allow customers to choose a local pickup location during checkout.","woocommerce")}))),Object(o.createElement)(O.__experimentalRadioGroup,{id:"shipping-method",className:"wc-block-checkout__shipping-method-container",label:"options",onChange:e=>{i("pickup"===e)},checked:l?"pickup":"shipping"},Object(o.createElement)(Ot,{checked:l?"pickup":"shipping",rate:dt(null===(t=k[0])||void 0===t?void 0:t.shipping_rates),showPrice:d,showIcon:b,setAttributes:s,toggleText:h}),Object(o.createElement)(ht,{checked:l?"pickup":"shipping",rate:bt(null===(c=k[0])||void 0===c?void 0:c.shipping_rates),showPrice:d,showIcon:b,setAttributes:s,toggleText:g})),Object(o.createElement)(L,{block:_.innerBlockAreas.SHIPPING_METHOD})):null},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(F,null))}),c(443);var kt=()=>Object(o.createElement)(O.Placeholder,{icon:Object(o.createElement)(i.a,{icon:st.a}),label:Object(u.__)("Shipping options","woocommerce"),className:"wc-block-checkout__no-shipping-placeholder"},Object(o.createElement)("span",{className:"wc-block-checkout__no-shipping-placeholder-description"},Object(u.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.","woocommerce")),Object(o.createElement)(O.Button,{isSecondary:!0,href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping",target:"_blank",rel:"noopener noreferrer"},Object(u.__)("Configure Shipping Options","woocommerce"))),jt=c(243),Et=c(263),yt=c(15);c(442),c(9);const wt=e=>{const t=Object(N.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(yt.decodeEntities)(e.name),value:e.rate_id,description:Object(yt.decodeEntities)(e.description),secondaryLabel:Object(o.createElement)(lt.a,{currency:Object(Ce.getCurrencyFromPriceResponse)(e),value:t}),secondaryDescription:Object(yt.decodeEntities)(e.delivery_time)}};var ft=e=>{let{noShippingPlaceholder:t=null,shippingCostRequiresAddress:c=!1}=e;const{isEditor:n}=Object(b.b)(),{shippingRates:r,needsShipping:s,isLoadingRates:a,hasCalculatedShipping:i,isCollectable:l}=Object(A.a)(),p=Object(T.useSelect)(e=>e(x.CART_STORE_KEY).getFullShippingAddressPushed()),d=l?r.map(e=>({...e,shipping_rates:e.shipping_rates.filter(e=>!Object(pt.c)(e.method_id))})):r,m=Object(T.useSelect)(e=>{var t;return null===(t=e(x.CART_STORE_KEY).getCustomerData())||void 0===t?void 0:t.shippingAddress});if(!s)return null;const g=!(()=>{const e=Object(T.select)("wc/store/validation"),t=e.getValidationError("shipping_state"),c=e.getValidationError("shipping_address_1"),o=e.getValidationError("shipping_country"),n=e.getValidationError("shipping_postcode");return[e.getValidationError("shipping_city"),t,c,o,n].some(e=>void 0!==e)})(),h=Object(Et.c)(m),O=Object(pt.a)(r);return(i||O)&&(!c||p&&g)?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(_.StoreNoticesContainer,{context:Y.d.SHIPPING_METHODS}),n&&!O?t:Object(o.createElement)(jt.a,{noResultsMessage:Object(o.createElement)(o.Fragment,null,h?Object(o.createElement)(De.a,{isDismissible:!1,className:"wc-block-components-shipping-rates-control__no-results-notice",status:"warning"},Object(u.__)("There are no shipping options available. Please check your shipping address.","woocommerce")):Object(u.__)("Add a shipping address to view shipping options.","woocommerce")),renderOption:wt,collapsible:!1,shippingRates:d,isLoadingRates:a,context:"woocommerce/checkout"})):Object(o.createElement)("p",null,Object(u.__)("Shipping options will be displayed here after entering your full shipping address.","woocommerce"))};c(441);var vt={...H({defaultTitle:Object(u.__)("Shipping options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}},shippingCostRequiresAddress:{type:"boolean",default:!1}};Object(l.registerBlockType)("woocommerce/checkout-shipping-methods-block",{icon:{src:Object(o.createElement)(i.a,{icon:st.a,className:"wc-block-editor-components-block-icon"})},attributes:vt,edit:e=>{let{attributes:t,setAttributes:c,clientId:n}=e;const s=Object(N.getSetting)("globalShippingMethods"),a=Object(N.getSetting)("activeShippingZones"),{showShippingMethods:i}=I();return i?Object(o.createElement)(D,{attributes:t,setAttributes:c,className:r()("wc-block-checkout__shipping-option",null==t?void 0:t.className)},Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Calculations","woocommerce")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Hide shipping costs until an address is entered","woocommerce"),checked:t.shippingCostRequiresAddress,onChange:e=>{Object(it.d)(n,"shippingCostRequiresAddress",e,"woocommerce/checkout-shipping-method-block"),(e=>{const o={};o[e]=!t[e],c(o)})("shippingCostRequiresAddress")}})),s.length>0&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Methods","woocommerce")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("The following shipping integrations are active on your store.","woocommerce")),s.map(e=>Object(o.createElement)(Me,{key:e.id,href:`${N.ADMIN_URL}admin.php?page=wc-settings&tab=shipping§ion=${e.id}`,title:e.title,description:e.description})),Object(o.createElement)(O.ExternalLink,{href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping"},Object(u.__)("Manage shipping methods","woocommerce"))),a.length&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Zones","woocommerce")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("You currently have the following shipping zones active.","woocommerce")),a.map(e=>Object(o.createElement)(Me,{key:e.id,href:`${N.ADMIN_URL}admin.php?page=wc-settings&tab=shipping&zone_id=${e.id}`,title:e.title,description:e.description})),Object(o.createElement)(O.ExternalLink,{href:N.ADMIN_URL+"admin.php?page=wc-settings&tab=shipping"},Object(u.__)("Manage shipping zones","woocommerce")))),Object(o.createElement)(K.a,null,Object(o.createElement)(ft,{noShippingPlaceholder:Object(o.createElement)(kt,null),shippingCostRequiresAddress:t.shippingCostRequiresAddress})),Object(o.createElement)(L,{block:_.innerBlockAreas.SHIPPING_METHODS})):null},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(F,null))});const Ct=e=>{let{title:t,setSelectedOption:c,selectedOption:n,pickupLocations:r,onSelectRate:s,renderPickupLocation:a,packageCount:i}=e;const l=document.querySelectorAll(".wc-block-components-local-pickup-select .wc-block-components-radio-control").length>1;return Object(o.createElement)("div",{className:"wc-block-components-local-pickup-select"},!(!l||!t)&&Object(o.createElement)("div",null,t),Object(o.createElement)(We.a,{onChange:e=>{c(e),s(e)},selected:n,options:r.map(e=>a(e,i))}))};c(444);var St=c(154);const Pt=(e,t)=>{const c=Object(N.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):e.price,n=(e=>{if(null!=e&&e.meta_data){const t=e.meta_data.find(e=>"pickup_location"===e.key);return t?t.value:""}return""})(e),r=(e=>{if(null!=e&&e.meta_data){const t=e.meta_data.find(e=>"pickup_address"===e.key);return t?t.value:""}return""})(e),s=(e=>{if(null!=e&&e.meta_data){const t=e.meta_data.find(e=>"pickup_details"===e.key);return t?t.value:""}return""})(e);let a=Object(o.createElement)("em",null,Object(u.__)("free","woocommerce"));return parseInt(c,10)>0&&(a=1===t?Object(o.createElement)(lt.a,{currency:Object(Ce.getCurrencyFromPriceResponse)(e),value:c}):Object(o.createInterpolateElement)(
|
||
/* translators: <price/> is the price of the package, <packageCount/> is the number of packages. These must appear in the translated string. */
|
||
Object(u._n)("<price/> x <packageCount/> package","<price/> x <packageCount/> packages",t,"woocommerce"),{price:Object(o.createElement)(lt.a,{currency:Object(Ce.getCurrencyFromPriceResponse)(e),value:c}),packageCount:Object(o.createElement)(o.Fragment,null,t)})),{value:e.rate_id,label:n?Object(yt.decodeEntities)(n):Object(yt.decodeEntities)(e.name),secondaryLabel:a,description:Object(yt.decodeEntities)(s),secondaryDescription:r?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{icon:P.a,className:"wc-block-editor-components-block-icon"}),Object(yt.decodeEntities)(r)):void 0}};var Nt=()=>{var e;const{shippingRates:t,selectShippingRate:c}=Object(A.a)(),n=((null===(e=t[0])||void 0===e?void 0:e.shipping_rates)||[]).filter(pt.d),[r,s]=Object(o.useState)(()=>{var e;return(null===(e=n.find(e=>e.selected))||void 0===e?void 0:e.rate_id)||""}),a=Object(o.useCallback)(e=>{c(e)},[c]),{extensions:i,receiveCart:l,...u}=Object(Se.a)(),p={extensions:i,cart:u,components:{ShippingRatesControlPackage:St.a,LocalPickupSelect:Ct},renderPickupLocation:Pt};Object(o.useEffect)(()=>{!r&&n[0]&&(s(n[0].rate_id),a(n[0].rate_id))},[a,n,r]);const d=Object(pt.a)(t);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(_.ExperimentalOrderLocalPickupPackages.Slot,p),Object(o.createElement)(_.ExperimentalOrderLocalPickupPackages,null,Object(o.createElement)(Ct,{title:t[0].name,setSelectedOption:s,onSelectRate:a,selectedOption:r,renderPickupLocation:Pt,pickupLocations:n,packageCount:d})))},Tt={...H({defaultTitle:Object(u.__)("Pickup options","woocommerce"),defaultDescription:""}),className:{type:"string",default:""},lock:{type:"object",default:{move:!0,remove:!0}}};Object(l.registerBlockType)("woocommerce/checkout-pickup-options-block",{icon:{src:Object(o.createElement)(i.a,{icon:at.a,className:"wc-block-editor-components-block-icon"})},attributes:Tt,edit:e=>{let{attributes:t,setAttributes:c}=e;const{prefersCollection:n}=Object(T.useSelect)(e=>({prefersCollection:e(x.CHECKOUT_STORE_KEY).prefersCollection()})),{className:s}=t;return n&&G.f?Object(o.createElement)(D,{attributes:t,setAttributes:c,className:r()("wc-block-checkout__shipping-method",s)},Object(o.createElement)(Nt,null),Object(o.createElement)(L,{block:_.innerBlockAreas.PICKUP_LOCATION})):null},save:()=>Object(o.createElement)("div",p.useBlockProps.save(),Object(o.createElement)(F,null))});var xt=e=>{let{className:t=""}=e;const{cartTotals:c}=Object(Se.a)(),n=Object(Ce.getCurrencyFromPriceResponse)(c);return Object(o.createElement)(_.TotalsWrapper,{className:t},Object(o.createElement)(_.Subtotal,{currency:n,values:c}))};Object(l.registerBlockType)("woocommerce/checkout-order-summary-subtotal-block",{icon:{src:Object(o.createElement)(i.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(p.useBlockProps)();return Object(o.createElement)("div",n,Object(o.createElement)(xt,{className:c}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var Rt=e=>{let{className:t=""}=e;const{cartFees:c,cartTotals:n}=Object(Se.a)(),r=Object(Ce.getCurrencyFromPriceResponse)(n);return Object(o.createElement)(_.TotalsWrapper,{className:t},Object(o.createElement)(_.TotalsFees,{currency:r,cartFees:c}))};Object(l.registerBlockType)("woocommerce/checkout-order-summary-fee-block",{icon:{src:Object(o.createElement)(i.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(p.useBlockProps)();return Object(o.createElement)("div",n,Object(o.createElement)(Rt,{className:c}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var At=c(417),It=c(231);const Mt=()=>{const{extensions:e,receiveCart:t,...c}=Object(Se.a)(),n={extensions:e,cart:c,context:"woocommerce/checkout"};return Object(o.createElement)(_.ExperimentalDiscountsMeta.Slot,n)};var Bt=e=>{let{className:t=""}=e;const{cartTotals:c,cartCoupons:n}=Object(Se.a)(),{removeCoupon:r,isRemovingCoupon:s}=Object(It.a)("wc/checkout"),a=Object(Ce.getCurrencyFromPriceResponse)(c);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(_.TotalsWrapper,{className:t},Object(o.createElement)(At.a,{cartCoupons:n,currency:a,isRemovingCoupon:s,removeCoupon:r,values:c})),Object(o.createElement)(Mt,null))};Object(l.registerBlockType)("woocommerce/checkout-order-summary-discount-block",{icon:{src:Object(o.createElement)(i.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(p.useBlockProps)();return Object(o.createElement)("div",n,Object(o.createElement)(Bt,{className:c}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var Dt=c(501),Lt=e=>{let{className:t=""}=e;const{cartTotals:c,cartNeedsShipping:n}=Object(Se.a)();if(!n)return null;const r=Object(Ce.getCurrencyFromPriceResponse)(c);return Object(o.createElement)(_.TotalsWrapper,{className:t},Object(o.createElement)(Dt.a,{showCalculator:!1,showRateSelector:!1,values:c,currency:r,isCheckout:!0}))};Object(l.registerBlockType)("woocommerce/checkout-order-summary-shipping-block",{icon:{src:Object(o.createElement)(i.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(p.useBlockProps)();return Object(o.createElement)("div",n,Object(o.createElement)(K.a,null,Object(o.createElement)(Lt,{className:c})))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var Ft=c(571),Ut=c(420),Vt=e=>{let{className:t=""}=e;const c=Object(N.getSetting)("couponsEnabled",!0),{applyCoupon:n,isApplyingCoupon:r}=Object(It.a)("wc/checkout");return c?Object(o.createElement)(_.TotalsWrapper,{className:t},Object(o.createElement)(Ut.a,{onSubmit:n,isLoading:r})):null};Object(l.registerBlockType)("woocommerce/checkout-order-summary-coupon-form-block",{icon:{src:Object(o.createElement)(i.a,{icon:Ft.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(p.useBlockProps)();return Object(o.createElement)("div",n,Object(o.createElement)(K.a,null,Object(o.createElement)(Vt,{className:c})))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var Yt=e=>{let{className:t,showRateAfterTaxName:c}=e;const{cartTotals:n}=Object(Se.a)();if(Object(N.getSetting)("displayCartPricesIncludingTax",!1)||parseInt(n.total_tax,10)<=0)return null;const r=Object(Ce.getCurrencyFromPriceResponse)(n);return Object(o.createElement)(_.TotalsWrapper,{className:t},Object(o.createElement)(_.TotalsTaxes,{showRateAfterTaxName:c,currency:r,values:n}))},Kt={showRateAfterTaxName:{type:"boolean",default:Object(N.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{remove:!0,move:!1}}};Object(l.registerBlockType)("woocommerce/checkout-order-summary-taxes-block",{icon:{src:Object(o.createElement)(i.a,{icon:fe.a,className:"wc-block-editor-components-block-icon"})},attributes:Kt,edit:e=>{let{attributes:t,setAttributes:c}=e;const{className:n,showRateAfterTaxName:r}=t,s=Object(p.useBlockProps)(),a=Object(N.getSetting)("taxesEnabled"),i=Object(N.getSetting)("displayItemizedTaxes",!1),l=Object(N.getSetting)("displayCartPricesIncludingTax",!1);return Object(o.createElement)("div",s,Object(o.createElement)(p.InspectorControls,null,a&&i&&!l&&Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Taxes","woocommerce")},Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Show rate after tax name","woocommerce"),help:Object(u.__)("Show the percentage rate alongside each tax line in the summary.","woocommerce"),checked:r,onChange:()=>c({showRateAfterTaxName:!r})}))),Object(o.createElement)(Yt,{className:n,showRateAfterTaxName:r}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())});var $t=c(275),qt=c(325),Ht=c(84),zt=c(111),Wt=c(121),Gt=c(67),Xt=c(165),Qt=c(141),Zt=c(166),Jt=c(171);const ec=e=>Object(_.mustContain)(e,"<price/>");var tc=e=>{let{cartItem:t}=e;const{images:c,low_stock_remaining:n,show_backorder_badge:s,name:a,permalink:i,prices:l,quantity:p,short_description:d,description:b,item_data:m,variation:g,totals:h,extensions:O}=t,{receiveCart:k,...j}=Object(Se.a)(),E=Object(o.useMemo)(()=>({context:"summary",cartItem:t,cart:j}),[t,j]),y=Object(Ce.getCurrencyFromPriceResponse)(l),w=Object(_.applyCheckoutFilter)({filterName:"itemName",defaultValue:a,extensions:O,arg:E}),f=Object(Wt.a)({amount:parseInt(l.raw_prices.regular_price,10),precision:Object(Gt.a)(l.raw_prices.precision)?parseInt(l.raw_prices.precision,10):l.raw_prices.precision}).convertPrecision(y.minorUnit).getAmount(),v=Object(Wt.a)({amount:parseInt(l.raw_prices.price,10),precision:Object(Gt.a)(l.raw_prices.precision)?parseInt(l.raw_prices.precision,10):l.raw_prices.precision}).convertPrecision(y.minorUnit).getAmount(),C=Object(Ce.getCurrencyFromPriceResponse)(h);let S=parseInt(h.line_subtotal,10);Object(N.getSetting)("displayCartPricesIncludingTax",!1)&&(S+=parseInt(h.line_subtotal_tax,10));const P=Object(Wt.a)({amount:S,precision:C.minorUnit}).getAmount(),T=Object(_.applyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:O,arg:E,validation:ec}),x=Object(_.applyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:O,arg:E,validation:ec}),R=Object(_.applyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:O,arg:E});return Object(o.createElement)("div",{className:r()("wc-block-components-order-summary-item",R)},Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__image"},Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__quantity"},Object(o.createElement)(Be.a,{label:p.toString(),screenReaderLabel:Object(u.sprintf)(
|
||
/* translators: %d number of products of the same type in the cart */
|
||
Object(u._n)("%d item","%d items",p,"woocommerce"),p)})),Object(o.createElement)(Qt.a,{image:c.length?c[0]:{},fallbackAlt:w})),Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__description"},Object(o.createElement)(zt.a,{disabled:!0,name:w,permalink:i}),Object(o.createElement)(Ht.a,{currency:y,price:v,regularPrice:f,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:T}),s?Object(o.createElement)(Xt.a,null):!!n&&Object(o.createElement)(Zt.a,{lowStockRemaining:n}),Object(o.createElement)(Jt.a,{shortDescription:d,fullDescription:b,itemData:m,variation:g})),Object(o.createElement)("span",{className:"screen-reader-text"},Object(u.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. */
|
||
Object(u._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",p,"woocommerce"),p,w,Object(Ce.formatPrice)(P,C))),Object(o.createElement)("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},Object(o.createElement)(Ht.a,{currency:C,format:x,price:P})))};c(445);var cc=e=>{let{cartItems:t=[]}=e;const{isLarge:c,hasContainerWidth:n}=Object(qt.b)();return n?Object(o.createElement)(_.Panel,{className:"wc-block-components-order-summary",initialOpen:c,hasBorder:!1,title:Object(o.createElement)("span",{className:"wc-block-components-order-summary__button-text"},Object(u.__)("Order summary","woocommerce")),titleTag:"h2"},Object(o.createElement)("div",{className:"wc-block-components-order-summary__content"},t.map(e=>Object(o.createElement)(tc,{key:e.key,cartItem:e})))):null},oc=e=>{let{className:t}=e;const{cartItems:c}=Object(Se.a)();return Object(o.createElement)(_.TotalsWrapper,{className:t},Object(o.createElement)(cc,{cartItems:c}))};Object(l.registerBlockType)("woocommerce/checkout-order-summary-cart-items-block",{icon:{src:Object(o.createElement)(i.a,{icon:$t.a,className:"wc-block-editor-components-block-icon"})},edit:e=>{let{attributes:t}=e;const{className:c}=t,n=Object(p.useBlockProps)();return Object(o.createElement)("div",n,Object(o.createElement)(oc,{className:c}))},save:()=>Object(o.createElement)("div",p.useBlockProps.save())}),c(446);var nc=c(424),rc=c(425);c(301),Object(nc.a)();const sc=["woocommerce/checkout-fields-block","woocommerce/checkout-totals-block"],ac={hasDarkControls:{type:"boolean",default:Object(N.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:Object(N.getSetting)("displayCartPricesIncludingTax",!1)}},ic={showOrderNotes:{type:"boolean",default:!0},showPolicyLinks:{type:"boolean",default:!0},showReturnToCart:{type:"boolean",default:!0},cartPageId:{type:"number",default:0}};var lc=c(259);const uc={icon:{src:Object(o.createElement)(i.a,{icon:a,className:"wc-block-editor-components-block-icon"})},attributes:{...lc.attributes,...ac,...ic},edit:e=>{let{attributes:t,setAttributes:c}=e;const{showCompanyField:n,requireCompanyField:s,showApartmentField:a,showPhoneField:i,requirePhoneField:l,showOrderNotes:k,showPolicyLinks:j,showReturnToCart:w,showRateAfterTaxName:f,cartPageId:v,isPreview:C=!1}=t,S=e=>{const o={};o[e]=!t[e],c(o)},P=Object(nc.b)();return Object(o.createElement)("div",P,Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(rc.a,{attributes:t,setAttributes:c})),Object(o.createElement)(b.a,{isPreview:C,previewData:{previewCart:g.a,previewSavedPaymentMethods:h}},Object(o.createElement)(_.SlotFillProvider,null,Object(o.createElement)(m.a,null,Object(o.createElement)(d.a,{className:r()("wc-block-checkout",{"has-dark-controls":t.hasDarkControls})},Object(o.createElement)(y.Provider,{value:{addressFieldControls:()=>Object(o.createElement)(p.InspectorControls,null,Object(o.createElement)(O.PanelBody,{title:Object(u.__)("Address Fields","woocommerce")},Object(o.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(u.__)("Show or hide fields in the checkout address forms.","woocommerce")),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Company","woocommerce"),checked:n,onChange:()=>S("showCompanyField")}),n&&Object(o.createElement)(O.CheckboxControl,{label:Object(u.__)("Require company name?","woocommerce"),checked:s,onChange:()=>S("requireCompanyField"),className:"components-base-control--nested"}),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Apartment, suite, etc.","woocommerce"),checked:a,onChange:()=>S("showApartmentField")}),Object(o.createElement)(O.ToggleControl,{label:Object(u.__)("Phone","woocommerce"),checked:i,onChange:()=>S("showPhoneField")}),i&&Object(o.createElement)(O.CheckboxControl,{label:Object(u.__)("Require phone number?","woocommerce"),checked:l,onChange:()=>S("requirePhoneField"),className:"components-base-control--nested"})))}},Object(o.createElement)(E.Provider,{value:{showCompanyField:n,requireCompanyField:s,showApartmentField:a,showPhoneField:i,requirePhoneField:l,showOrderNotes:k,showPolicyLinks:j,showReturnToCart:w,cartPageId:v,showRateAfterTaxName:f}},Object(o.createElement)(p.InnerBlocks,{allowedBlocks:sc,template:[["woocommerce/checkout-fields-block",{},[]],["woocommerce/checkout-totals-block",{},[]]],templateLock:"insert"}))))))))},save:()=>Object(o.createElement)("div",p.useBlockProps.save({className:"wc-block-checkout is-loading"}),Object(o.createElement)(p.InnerBlocks.Content,null)),deprecated:[{attributes:{...lc.attributes,...ac,...ic},save(e){let{attributes:t}=e;return Object(o.createElement)("div",{className:r()("is-loading",t.className)})},migrate:e=>{const{showOrderNotes:t,showPolicyLinks:c,showReturnToCart:o,cartPageId:n}=e;return[e,[Object(l.createBlock)("woocommerce/checkout-fields-block",{},[Object(l.createBlock)("woocommerce/checkout-express-payment-block",{},[]),Object(l.createBlock)("woocommerce/checkout-contact-information-block",{},[]),Object(l.createBlock)("woocommerce/checkout-shipping-address-block",{},[]),Object(l.createBlock)("woocommerce/checkout-billing-address-block",{},[]),Object(l.createBlock)("woocommerce/checkout-shipping-methods-block",{},[]),Object(l.createBlock)("woocommerce/checkout-payment-block",{},[]),!!t&&Object(l.createBlock)("woocommerce/checkout-order-note-block",{},[]),!!c&&Object(l.createBlock)("woocommerce/checkout-terms-block",{},[]),Object(l.createBlock)("woocommerce/checkout-actions-block",{showReturnToCart:o,cartPageId:n},[])].filter(Boolean)),Object(l.createBlock)("woocommerce/checkout-totals-block",{})]]},isEligible:(e,t)=>!t.some(e=>"woocommerce/checkout-fields-block"===e.name)}]};Object(l.registerBlockType)(lc,uc)},,,,function(e,t,c){"use strict";var o=c(0),n=c(4),r=c.n(n),s=c(1),a=c(46),i=c(13),l=c(15);const u=e=>{let{selectedShippingRates:t}=e;return Object(o.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.decodeEntities)(t.filter((e,c)=>t.indexOf(e)===c).join(", ")))};var p=c(412),d=c(263),b=c(10),m=c(7),g=c(305),h=c(418),O=c(57),_=c(26),k=c.n(_),j=(c(221),c(506)),E=e=>{let{address:t,onUpdate:c,onCancel:n,addressFields:r}=e;const[a,i]=Object(o.useState)(t),{showAllValidationErrors:l}=Object(m.useDispatch)(b.VALIDATION_STORE_KEY),{hasValidationErrors:u,isCustomerDataUpdating:p}=Object(m.useSelect)(e=>({hasValidationErrors:e(b.VALIDATION_STORE_KEY).hasValidationErrors,isCustomerDataUpdating:e(b.CART_STORE_KEY).isCustomerDataUpdating()}));return Object(o.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(o.createElement)(j.a,{fields:r,onChange:i,values:a}),Object(o.createElement)(O.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:p,onClick:e=>(e.preventDefault(),k()(a,t)?n():(l(),u()?void 0:c(a))),type:"submit"},Object(s.__)("Update","woocommerce")))},y=e=>{let{onUpdate:t=(()=>{}),onCancel:c=(()=>{}),addressFields:n=["country","state","city","postcode"]}=e;const{shippingAddress:r}=Object(g.a)(),s="wc/cart/shipping-calculator";return Object(o.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(o.createElement)(i.StoreNoticesContainer,{context:s}),Object(o.createElement)(E,{address:r,addressFields:n,onCancel:c,onUpdate:e=>{Object(m.dispatch)(b.CART_STORE_KEY).updateCustomerData({shipping_address:e},!1).then(()=>{Object(h.b)(s),t(e)}).catch(e=>{Object(b.processErrorResponse)(e,s)})}}))},w=c(3);const f=e=>{let{label:t=Object(s.__)("Calculate","woocommerce"),isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:n}=e;return Object(o.createElement)("a",{role:"button",href:"#wc-block-components-shipping-calculator-address__link",className:"wc-block-components-totals-shipping__change-address__link",id:"wc-block-components-totals-shipping__change-address__link",onClick:e=>{e.preventDefault(),n(!c)},"aria-label":t,"aria-expanded":c},t)};var v=e=>{let{showCalculator:t,isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:n,isCheckout:r=!1}=e;return t?Object(o.createElement)(f,{label:Object(s.__)("Add an address for shipping options","woocommerce"),isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:n}):Object(o.createElement)("em",null,r?Object(s.__)("No shipping options available","woocommerce"):Object(s.__)("Calculated during checkout","woocommerce"))},C=c(87),S=c(20),P=()=>{const{pickupAddress:e,pickupMethod:t}=Object(m.useSelect)(e=>{const t=e("wc/store/cart").getShippingRates().flatMap(e=>e.shipping_rates).find(e=>e.selected&&Object(p.d)(e));if(Object(S.b)(t)&&Object(S.c)(t,"meta_data")){const e=t.meta_data.find(e=>"pickup_address"===e.key);if(Object(S.b)(e)&&Object(S.c)(e,"value")&&e.value)return{pickupAddress:e.value,pickupMethod:t.name}}return Object(S.b)(t)?{pickupAddress:void 0,pickupMethod:t.name}:{pickupAddress:void 0,pickupMethod:void 0}});return void 0===e&&void 0===t?null:Object(o.createElement)("span",{className:"wc-block-components-shipping-address"},Object(s.sprintf)(
|
||
/* translators: %s: shipping method name, e.g. "Amazon Locker" */
|
||
Object(s.__)("Collection from %s","woocommerce"),void 0===e?t:e)+" ")},N=e=>{let{formattedLocation:t}=e;return t?Object(o.createElement)("span",{className:"wc-block-components-shipping-address"},Object(s.sprintf)(
|
||
/* translators: %s location. */
|
||
Object(s.__)("Shipping to %s","woocommerce"),t)+" "):null},T=e=>{let{showCalculator:t,isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:n,shippingAddress:r}=e;const a=Object(d.c)(r),{isEditor:i}=Object(C.b)(),l=Object(m.useSelect)(e=>e(b.CHECKOUT_STORE_KEY).prefersCollection());if(!a&&!i)return null;const u=Object(d.b)(r);return Object(o.createElement)(o.Fragment,null,l?Object(o.createElement)(P,null):Object(o.createElement)(N,{formattedLocation:u}),t&&!l?Object(o.createElement)(f,{label:Object(s.__)("Change address","woocommerce"),isShippingCalculatorOpen:c,setIsShippingCalculatorOpen:n}):null)},x=c(115),R=c(243),A=e=>{let{hasRates:t,shippingRates:c,isLoadingRates:n,isAddressComplete:r}=e;const a=t?Object(s.__)("Shipping options","woocommerce"):Object(s.__)("Choose a shipping option","woocommerce");return Object(o.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(o.createElement)("legend",{className:"screen-reader-text"},a),Object(o.createElement)(R.a,{className:"wc-block-components-totals-shipping__options",noResultsMessage:Object(o.createElement)(o.Fragment,null,r&&Object(o.createElement)(x.a,{isDismissible:!1,className:"wc-block-components-shipping-rates-control__no-results-notice",status:"warning"},Object(s.__)("There are no shipping options available. Please check your shipping address.","woocommerce"))),shippingRates:c,isLoadingRates:n,context:"woocommerce/cart"}))};c(285),t.a=e=>{let{currency:t,values:c,showCalculator:n=!0,showRateSelector:l=!0,isCheckout:g=!1,className:h}=e;const[O,_]=Object(o.useState)(!1),{shippingAddress:k,cartHasCalculatedShipping:j,shippingRates:E,isLoadingRates:f}=Object(a.a)(),C=(e=>Object(w.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.total_shipping,10)+parseInt(e.total_shipping_tax,10):parseInt(e.total_shipping,10))(c),S=E.some(e=>e.shipping_rates.length)||C>0,P=n&&O,N=Object(m.useSelect)(e=>e(b.CHECKOUT_STORE_KEY).prefersCollection()),x=E.flatMap(e=>e.shipping_rates.filter(e=>N&&Object(p.d)(e)&&e.selected||!N&&e.selected).flatMap(e=>e.name)),R=Object(d.c)(k);return Object(o.createElement)("div",{className:r()("wc-block-components-totals-shipping",h)},Object(o.createElement)(i.TotalsItem,{label:Object(s.__)("Shipping","woocommerce"),value:S&&j?C:!R&&Object(o.createElement)(v,{showCalculator:n,isCheckout:g,isShippingCalculatorOpen:O,setIsShippingCalculatorOpen:_}),description:S&&j||R?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(u,{selectedShippingRates:x}),Object(o.createElement)(T,{shippingAddress:k,showCalculator:n,isShippingCalculatorOpen:O,setIsShippingCalculatorOpen:_})):null,currency:t}),P&&Object(o.createElement)(y,{onUpdate:()=>{_(!1)},onCancel:()=>{_(!1)}}),l&&j&&!P&&Object(o.createElement)(A,{hasRates:S,shippingRates:E,isLoadingRates:f,isAddressComplete:R}))}},,,,,function(e,t,c){"use strict";var o=c(0),n=c(13),r=c(6),s=c.n(r),a=c(19),i=c(1),l=c(15),u=c(4),p=c.n(u),d=c(12),b=c(587),m=c(20),g=c(7),h=c(10);c(287);var O=Object(d.withInstanceId)(e=>{let{id:t,className:c,label:r,onChange:s,options:a,value:l,required:u=!1,errorMessage:d=Object(i.__)("Please select a value.","woocommerce"),errorId:O,instanceId:_="0",autoComplete:k="off"}=e;const j=Object(o.useRef)(null),E=t||"control-"+_,y=O||E,{setValidationErrors:w,clearValidationError:f}=Object(g.useDispatch)(h.VALIDATION_STORE_KEY),v=Object(g.useSelect)(e=>e(h.VALIDATION_STORE_KEY).getValidationError(y));return Object(o.useEffect)(()=>(!u||l?f(y):w({[y]:{message:d,hidden:!0}}),()=>{f(y)}),[f,l,y,d,u,w]),Object(o.createElement)("div",{id:E,className:p()("wc-block-components-combobox",c,{"is-active":l,"has-error":(null==v?void 0:v.message)&&!(null!=v&&v.hidden)}),ref:j},Object(o.createElement)(b.a,{className:"wc-block-components-combobox-control",label:r,onChange:s,onFilterValueChange:e=>{if(e.length){const t=Object(m.b)(j.current)?j.current.ownerDocument.activeElement:void 0;if(t&&Object(m.b)(j.current)&&j.current.contains(t))return;const c=e.toLocaleUpperCase(),o=a.find(e=>e.label.toLocaleUpperCase().startsWith(c)||e.value.toLocaleUpperCase()===c);o&&s(o.value)}},options:a,value:l||"",allowReset:!1,autoComplete:k,"aria-invalid":(null==v?void 0:v.message)&&!(null!=v&&v.hidden)}),Object(o.createElement)(n.ValidationInputError,{propertyName:y}))});c(286);var _=e=>{let{className:t,countries:c,id:n,label:r,onChange:s,value:a="",autoComplete:u="off",required:d=!1,errorId:b,errorMessage:m=Object(i.__)("Please select a country.","woocommerce")}=e;const g=Object(o.useMemo)(()=>Object.entries(c).map(e=>{let[t,c]=e;return{value:t,label:Object(l.decodeEntities)(c)}}),[c]);return Object(o.createElement)("div",{className:p()(t,"wc-block-components-country-input")},Object(o.createElement)(O,{id:n,label:r,onChange:s,options:g,value:a,errorId:b,errorMessage:m,required:d,autoComplete:u}))},k=e=>Object(o.createElement)(_,s()({countries:a.h},e)),j=e=>Object(o.createElement)(_,s()({countries:a.a},e));c(288);const E=(e,t)=>{const c=t.find(t=>t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase());return c?c.value:""};var y=e=>{let{className:t,id:c,states:r,country:s,label:a,onChange:u,autoComplete:d="off",value:b="",required:m=!1,errorId:g=""}=e;const h=r[s],_=Object(o.useMemo)(()=>h?Object.keys(h).map(e=>({value:e,label:Object(l.decodeEntities)(h[e])})):[],[h]),k=Object(o.useCallback)(e=>{u(_.length>0?E(e,_):e)},[u,_]),j=Object(o.useRef)(b);return Object(o.useEffect)(()=>{j.current!==b&&(j.current=b)},[b]),Object(o.useEffect)(()=>{if(_.length>0&&j.current){const e=E(j.current,_);e!==j.current&&k(e)}},[_,k]),_.length>0?Object(o.createElement)(O,{className:p()(t,"wc-block-components-state-input"),id:c,label:a,onChange:k,options:_,value:b,errorMessage:Object(i.__)("Please select a state.","woocommerce"),errorId:g,required:m,autoComplete:d}):Object(o.createElement)(n.ValidatedTextInput,{className:t,id:c,label:a,onChange:k,autoComplete:d,value:b,required:m})},w=e=>Object(o.createElement)(y,s()({states:a.i},e)),f=e=>Object(o.createElement)(y,s()({states:a.b},e)),v=c(45),C=c(3),S=c(98);t.a=Object(d.withInstanceId)(e=>{let{id:t="",fields:c=Object.keys(C.defaultAddressFields),fieldConfig:r={},instanceId:s,onChange:a,type:l="shipping",values:u}=e;const{setValidationErrors:p,clearValidationError:d}=Object(g.useDispatch)(h.VALIDATION_STORE_KEY),b=Object(g.useSelect)(e=>e(h.VALIDATION_STORE_KEY).getValidationError("shipping_country")),m=Object(v.a)(c),O=Object(o.useMemo)(()=>Object(S.a)(m,r,u.country),[m,r,u.country]);return Object(o.useEffect)(()=>{O.forEach(e=>{e.hidden&&u[e.key]&&a({...u,[e.key]:""})})},[O,a,u]),Object(o.useEffect)(()=>{"shipping"===l&&((e,t,c,o)=>{o||e.country||!(e.city||e.state||e.postcode)||t({shipping_country:{message:Object(i.__)("Please select a country to calculate rates.","woocommerce"),hidden:!1}}),o&&e.country&&c("shipping_country")})(u,p,d,!(null==b||!b.message||null!=b&&b.hidden))},[u,null==b?void 0:b.message,null==b?void 0:b.hidden,p,d,l]),t=t||s,Object(o.createElement)("div",{id:t,className:"wc-block-components-address-form"},O.map(e=>{if(e.hidden)return null;const c=`${l}_${e.key}`;if("country"===e.key){const n="shipping"===l?k:j;return Object(o.createElement)(n,{key:e.key,id:`${t}-${e.key}`,errorId:c,label:e.required?e.label:e.optionalLabel,value:u.country,autoComplete:e.autocomplete,onChange:e=>a({...u,country:e,state:""}),errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){const n="shipping"===l?w:f;return Object(o.createElement)(n,{key:e.key,id:`${t}-${e.key}`,errorId:c,country:u.country,label:e.required?e.label:e.optionalLabel,value:u.state,autoComplete:e.autocomplete,onChange:e=>a({...u,state:e}),errorMessage:e.errorMessage,required:e.required})}return Object(o.createElement)(n.ValidatedTextInput,{key:e.key,id:`${t}-${e.key}`,errorId:c,className:"wc-block-components-address-form__"+e.key,label:e.required?e.label:e.optionalLabel,value:u[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:t=>a({...u,[e.key]:"postcode"===e.key?t.trimStart().toUpperCase():t}),customValidation:t=>((e,t,c)=>!("postcode"===t&&c.country&&!Object(n.isPostcode)({postcode:e.value,country:c.country})&&(e.setCustomValidity(Object(i.__)("Please enter a valid postcode","woocommerce")),1)))(t,e.key,u),errorMessage:e.errorMessage,required:e.required})}))})}]); |