39 lines
182 KiB
JavaScript
39 lines
182 KiB
JavaScript
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["cart-i2"]=function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],p=0,d=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);d.length;)d.shift()();return o.push.apply(o,u||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var s=r[i];0!==c[s]&&(n=!1)}n&&(o.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},c={21:0,1:0},o=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var i=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var u=0;u<i.length;u++)t(i[u]);var l=s;return o.push([841,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},11:function(e,t){e.exports=window.React},110:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c);r(262),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)("div",{className:o()("wc-block-components-product-badge",r)},t)}},113:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(3),s=r(1),u=r(72);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=Object(i.getSetting)("countryLocale",{}),b=function(e){var 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(s.sprintf)(
|
||
/* translators: %s Field label. */
|
||
Object(s.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(u.a)(e.priority)&&(t.index=e.priority),Object(u.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},m=Object.entries(d).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,Object.entries(n).map((function(e){var t=a()(e,2),r=t[0],n=t[1];return[r,b(n)]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{})]})).reduce((function(e,t){var r=a()(t,2),n=r[0],c=r[1];return e[n]=c,e}),{});t.a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==m[r]?m[r]:{};return e.map((function(e){var r=i.defaultAddressFields[e]||{},c=n[e]||{},o=t[e]||{};return p(p(p({key:e},r),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,r){"use strict";var n=r(0);r(209),t.a=function(){return Object(n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},119:function(e,t){e.exports=window.wp.wordcount},12:function(e,t){e.exports=window.wp.blockEditor},124:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(1),i=r(53),s=r(6),u=r.n(s),l=(r(2),r(47)),p=(r(206),function(e){var t=e.currency,r=e.maxPrice,n=e.minPrice,c=e.priceClassName,s=e.priceStyle;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
|
||
/* translators: %1$s min price, %2$s max price */
|
||
Object(a.__)("Price between %1$s and %2$s",'woocommerce'),Object(l.formatPrice)(n),Object(l.formatPrice)(r))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:n,style:s})," — ",Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",c),currency:t,value:r,style:s})))}),d=function(e){var t=e.currency,r=e.regularPriceClassName,n=e.regularPriceStyle,c=e.regularPrice,s=e.priceClassName,l=e.priceStyle,p=e.price;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:u()("wc-block-components-product-price__regular",r),style:n},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:",'woocommerce')),Object(o.createElement)(i.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:u()("wc-block-components-product-price__value","is-discounted",s),style:l},e)},value:p}))};t.a=function(e){var t=e.align,r=e.className,n=e.currency,a=e.format,s=void 0===a?"<price/>":a,l=e.maxPrice,b=void 0===l?null:l,m=e.minPrice,f=void 0===m?null:m,O=e.price,g=void 0===O?null:O,h=e.priceClassName,v=e.priceStyle,j=e.regularPrice,E=e.regularPriceClassName,y=e.regularPriceStyle,_=u()(r,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=j&&g!==j,k=Object(o.createElement)("span",{className:u()("wc-block-components-product-price__value",h)});return w?k=Object(o.createElement)(d,{currency:n,price:g,priceClassName:h,priceStyle:v,regularPrice:j,regularPriceClassName:E,regularPriceStyle:y}):null!==f&&null!==b?k=Object(o.createElement)(p,{currency:n,maxPrice:b,minPrice:f,priceClassName:h,priceStyle:v}):null!==g&&(k=Object(o.createElement)(i.a,{className:u()("wc-block-components-product-price__value",h),currency:n,value:g,style:v})),Object(o.createElement)("span",{className:_},Object(o.createInterpolateElement)(s,{price:k}))}},125:function(e,t,r){"use strict";var n=r(17),c=r.n(n),o=r(18),a=r.n(o),i=r(13),s=r.n(i),u=r(19),l=r.n(u),p=r(20),d=r.n(p),b=r(10),m=r.n(b),f=r(5),O=r.n(f),g=r(0),h=(r(2),r(11)),v=r(1),j=r(37),E=function(e){var t=e.imageUrl,r=void 0===t?"".concat(j.m,"/block-error.svg"):t,n=e.header,c=void 0===n?Object(v.__)("Oops!",'woocommerce'):n,o=e.text,a=void 0===o?Object(v.__)("There was an error loading the content.",'woocommerce'):o,i=e.errorMessage,s=e.errorMessagePrefix,u=void 0===s?Object(v.__)("Error:",'woocommerce'):s,l=e.button;return Object(g.createElement)("div",{className:"wc-block-error wc-block-components-error"},r&&Object(g.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:r,alt:""}),Object(g.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},c&&Object(g.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},c),a&&Object(g.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},a),i&&Object(g.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},u?u+" ":"",i),l&&Object(g.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l)))};r(218);var y=function(e){l()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var c=m()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),O()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.props,t=e.header,r=e.imageUrl,n=e.showErrorMessage,c=e.text,o=e.errorMessagePrefix,a=e.renderError,i=e.button,s=this.state,u=s.errorMessage;return s.hasError?"function"==typeof a?a({errorMessage:u}):Object(g.createElement)(E,{errorMessage:n?u:null,header:t,imageUrl:r,text:c,errorMessagePrefix:o,button:i}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(g.createElement)(g.Fragment,null,Object(g.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}}]),o}(h.Component);y.defaultProps={showErrorMessage:!0},t.a=y},126:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return p}));var n,c=r(5),o=r.n(c),a=r(7);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));var u={addEventCallback:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:function(e,t){return{id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e}}},l={},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,c=t.eventType,a=t.id,i=t.callback,u=t.priority,p=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(r){case n.ADD_EVENT_CALLBACK:return p.set(a,{priority:u,callback:i}),s(s({},e),{},o()({},c,p));case n.REMOVE_EVENT_CALLBACK:return p.delete(a),s(s({},e),{},o()({},c,p))}}},127:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(8),c=r.n(n),o=r(0),a=function(){var e=Object(o.useState)(),t=c()(e,2)[1];return Object(o.useCallback)((function(e){t((function(){throw e}))}),[])}},129:function(e,t,r){"use strict";var n=r(0);t.a=function(e){var t=e.label,r=e.secondaryLabel,c=e.description,o=e.secondaryDescription,a=e.id;return Object(n.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(n.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(n.createElement)("span",{id:a&&"".concat(a,"__label"),className:"wc-block-components-radio-control__label"},t),r&&Object(n.createElement)("span",{id:a&&"".concat(a,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},r)),Object(n.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(n.createElement)("span",{id:a&&"".concat(a,"__description"),className:"wc-block-components-radio-control__description"},c),o&&Object(n.createElement)("span",{id:a&&"".concat(a,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},o)))}},132:function(e,t,r){"use strict";r.d(t,"b",(function(){return v})),r.d(t,"a",(function(){return j}));var n=r(38),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(8),l=r.n(u),p=r(0),d=r(7),b=r(34),m=r.n(b);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==c()(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c()(t)?t:String(t)}var h=Object(p.createContext)({getValidationError:function(){return""},setValidationErrors:function(e){},clearValidationError:function(e){},clearAllValidationErrors:function(){},hideValidationError:function(){},showValidationError:function(){},showAllValidationErrors:function(){},hasValidationErrors:!1,getValidationErrorId:function(e){return e}}),v=function(){return Object(p.useContext)(h)},j=function(e){var t=e.children,r=Object(p.useState)({}),n=l()(r,2),c=n[0],o=n[1],i=Object(p.useCallback)((function(e){return c[e]}),[c]),u=Object(p.useCallback)((function(e){var t=c[e];return!t||t.hidden?"":"validate-error-".concat(e)}),[c]),b=Object(p.useCallback)((function(e){o((function(t){return t[e]?(t[e],s()(t,[e].map(g))):t}))}),[]),f=Object(p.useCallback)((function(){o({})}),[]),v=Object(p.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,r){return!("string"!=typeof e.message||t.hasOwnProperty(r)&&m()(t[r],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),j=Object(p.useCallback)((function(e,t){o((function(r){if(!r.hasOwnProperty(e))return r;var n=O(O({},r[e]),t);return m()(r[e],n)?r:O(O({},r),{},a()({},e,n))}))}),[]),E={getValidationError:i,setValidationErrors:v,clearValidationError:b,clearAllValidationErrors:f,hideValidationError:Object(p.useCallback)((function(e){j(e,{hidden:!0})}),[j]),showValidationError:Object(p.useCallback)((function(e){j(e,{hidden:!1})}),[j]),showAllValidationErrors:Object(p.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(r){e[r].hidden&&(t[r]=O(O({},e[r]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:u};return Object(p.createElement)(h.Provider,{value:E},t)}},134:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(14),c=r(0),o=r(24),a=r(127),i=function(){var e=Object(a.a)(),t=Object(n.useDispatch)(o.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(c.useCallback)((function(r,n){t(r,n).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(n.useSelect)((function(e){return e(o.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},135:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(6),u=r.n(s),l=(r(2),r(260),["children","className","headingLevel"]);t.a=function(e){var t=e.children,r=e.className,n=e.headingLevel,o=a()(e,l),s=u()("wc-block-components-title",r),p="h".concat(n);return Object(i.createElement)(p,c()({className:s},o),t)}},136:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(11);function c(e,t){var r=Object(n.useRef)();return Object(n.useEffect)((function(){r.current===e||t&&!t(e,r.current)||(r.current=e)}),[e,t]),r.current}},14:function(e,t){e.exports=window.wp.data},140:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(6),i=r.n(a),s=r(129);t.a=function(e){var t,r=e.checked,n=e.name,a=e.onChange,u=e.option,l=u.value,p=u.label,d=u.description,b=u.secondaryLabel,m=u.secondaryDescription;return Object(o.createElement)("label",{className:i()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":r}),htmlFor:"".concat(n,"-").concat(l)},Object(o.createElement)("input",{id:"".concat(n,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:n,value:l,onChange:function(e){return a(e.target.value)},checked:r,"aria-describedby":i()((t={},c()(t,"".concat(n,"-").concat(l,"__label"),p),c()(t,"".concat(n,"-").concat(l,"__secondary-label"),b),c()(t,"".concat(n,"-").concat(l,"__description"),d),c()(t,"".concat(n,"-").concat(l,"__secondary-description"),m),t))}),Object(o.createElement)(s.a,{id:"".concat(n,"-").concat(l),label:p,secondaryLabel:b,description:d,secondaryDescription:m}))}},141:function(e,t,r){"use strict";r.d(t,"b",(function(){return E})),r.d(t,"a",(function(){return y}));var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=(r(2),r(14)),u=r(68),l=r(63),p=r(9),d=r.n(p),b=r(6),m=r.n(b),f=r(890),O=(r(207),function(e){var t=e.status;switch(void 0===t?"default":t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""}),g=function(e){var t=e.className,r=e.notices,n=e.removeNotice,c=r.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=m()(t,"wc-block-components-notices");return Object(i.createElement)("div",{className:o},c.map((function(e){return Object(i.createElement)(f.a,d()({key:"store-notice-"+e.id},e,{className:m()("wc-block-components-notices__notice",O(e)),onRemove:function(){e.isDismissible&&n(e.id)}}),e.content)})))};function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=Object(i.createContext)({notices:[],createNotice:function(e,t,r){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(i.useContext)(j)},y=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,c=e.createNoticeContainer,o=void 0===c||c,p=e.context,d=void 0===p?"wc/core":p,b=Object(s.useDispatch)("core/notices"),m=b.createNotice,f=b.removeNotice,O=Object(i.useState)(!1),h=a()(O,2),E=h[0],y=h[1],_=Object(u.a)().dispatchStoreEvent,w=Object(l.b)().isEditor,k=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(e,t,v(v({},r),{},{context:r.context||d})),_("store-notice-create",{status:e,content:t,options:r})}),[m,_,d]),S=Object(i.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;f(e,t)}),[f,d]),C={notices:Object(s.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:k,removeNotice:S,context:d,setIsSuppressed:y},P=E?null:Object(i.createElement)(g,{className:n,notices:C.notices,removeNotice:C.removeNotice,isEditor:w});return Object(i.createElement)(j.Provider,{value:C},o&&P,t)}},142:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(8),c=r.n(n),o=function(e){return e.reduce((function(e,t){var r=c()(t,2),n=r[0],o=r[1];return e[n]=o,e}),{})}},15:function(e,t){e.exports=window.wp.apiFetch},154:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(25),u=r(6),l=r.n(u),p=(r(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,r=void 0===t?"":t,n=e.disabled,o=void 0!==n&&n,u=e.name,d=e.permalink,b=void 0===d?"":d,m=a()(e,p),f=l()("wc-block-components-product-name",r);return o?Object(i.createElement)("span",c()({className:f},m,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}})):Object(i.createElement)("a",c()({className:f,href:b},m,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(u)}}))}},155:function(e,t,r){"use strict";var n=r(0),c=r(119),o=r(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=i(e),c=n.split(" ").splice(0,t).join(" ");return Object(o.autop)(s(c,r))},l=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",c=i(e),a=c.slice(0,t);if(r)return Object(o.autop)(s(a,n));var u=a.match(/([\s]+)/g),l=u?u.length:0,p=c.slice(0,t+l);return Object(o.autop)(s(p,n))};t.a=function(e){var t=e.source,r=e.maxLength,i=void 0===r?15:r,s=e.countType,p=void 0===s?"words":s,d=e.className,b=void 0===d?"":d,m=Object(n.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",n=Object(o.autop)(e),i=Object(c.count)(n,r);if(i<=t)return n;var s=a(n),p=Object(c.count)(s,r);return p<=t?s:"words"===r?u(s,t):l(s,t,"characters_including_spaces"===r)}(t,i,p)}),[t,i,p]);return Object(n.createElement)(n.RawHTML,{className:b},m)}},158:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(n.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(n.createElement)("g",{mask:"url(#external-mask)"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return s}));var n=r(26),c=r(37),o=function(e,t){if(c.n>2)return Object(n.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(n.registerBlockType)(e,t)},i=function(){return c.n>2},s=function(){return c.n>1}},162:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(3),c=r(113),o=r(23),a=function(e){var t=e.country,r=void 0===t?"":t,n=e.state,c=void 0===n?"":n,o=e.city,a=void 0===o?"":o,i=e.postcode,s=void 0===i?"":i;return{country:r.trim(),state:c.trim(),city:a.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},i=function(e){var t=e.email,r=void 0===t?"":t;return Object(o.isEmail)(r)?r.trim():""},s=function(e){var t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),o=Object.assign({},e);return r.forEach((function(t){var r=t.key,n=void 0===r?"":r,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(n,e)&&(o[n]="")})),o}},163:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(62),c=r(174),o=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(c.b)(),r=t.paymentMethods,o=t.expressPaymentMethods,a=t.paymentMethodsInitialized,i=t.expressPaymentMethodsInitialized,s=Object(n.a)(r),u=Object(n.a)(o);return{paymentMethods:e?u:s,isInitialized:e?i:a}},a=function(){return o(!1)},i=function(){return o(!0)}},167:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c),a=r(21),i=r(140);r(272),t.a=Object(a.withInstanceId)((function(e){var t=e.className,r=e.instanceId,c=e.id,a=e.selected,s=e.onChange,u=e.options,l=void 0===u?[]:u,p=c||r;return l.length&&Object(n.createElement)("div",{className:o()("wc-block-components-radio-control",t)},l.map((function(e){return Object(n.createElement)(i.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===a,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},168:function(e,t,r){"use strict";var n=r(17),c=r.n(n),o=r(18),a=r.n(o),i=r(13),s=r.n(i),u=r(19),l=r.n(u),p=r(20),d=r.n(p),b=r(10),m=r.n(b),f=r(5),O=r.n(f),g=r(0),h=r(1),v=r(11),j=(r(2),r(3)),E=r(44);var y=function(e){l()(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=m()(t);if(r){var c=m()(this).constructor;e=Reflect.construct(n,arguments,c)}else e=n.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return e=n.call.apply(n,[this].concat(r)),O()(s()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.errorMessage,n=this.props.isEditor;if(t){var c=Object(h.__)("This site is experiencing difficulties with this payment method. Please contact the owner of the site for assistance.",'woocommerce');(n||j.CURRENT_USER_IS_ADMIN)&&(c=r||Object(h.__)("There was an error with this payment method. Please verify it's configured correctly.",'woocommerce'));var o=[{id:"0",content:c,isDismissible:!1,status:"error"}];return Object(g.createElement)(E.StoreNoticesContainer,{notices:o})}return this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{errorMessage:e.message,hasError:!0}}}]),o}(v.Component);y.defaultProps={isEditor:!1},t.a=y},169:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(0),s=r(6),u=r.n(s),l=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},p=function(e){var t=e.id,r=e.src,n=void 0===r?null:r,c=e.alt,o=void 0===c?"":c;return n?Object(i.createElement)("img",{className:l(t),src:n,alt:o}):null},d=r(37),b=[{id:"alipay",alt:"Alipay",src:d.m+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:d.m+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:d.m+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:d.m+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:d.m+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:d.m+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:d.m+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:d.m+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:d.m+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:d.m+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:d.m+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:d.m+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:d.m+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:d.m+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:d.m+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:d.m+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:d.m+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:d.m+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:d.m+"payment-methods/wechat.svg"}],m=r(38),f=r.n(m),O=r(72);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(275),t.a=function(e){var t=e.icons,r=void 0===t?[]:t,n=e.align,o=void 0===n?"center":n,a=function(e){var t={};return e.forEach((function(e){var r={};"string"==typeof e&&(r={id:e,alt:e,src:null}),"object"===f()(e)&&(r={id:e.id||"",alt:e.alt||"",src:e.src||null}),r.id&&Object(O.c)(r.id)&&!t[r.id]&&(t[r.id]=r)})),Object.values(t)}(r);if(0===a.length)return null;var s=u()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===o,"wc-block-components-payment-method-icons--align-right":"right"===o});return Object(i.createElement)("div",{className:s},a.map((function(e){var t,r=h(h({},e),(t=e.id,b.find((function(e){return e.id===t}))||{}));return Object(i.createElement)(p,c()({key:"payment-method-icon-"+e.id},r))})))}},174:function(e,t,r){"use strict";r.d(t,"b",(function(){return Z})),r.d(t,"a",(function(){return ee}));var n,c,o=r(33),a=r.n(o),i=r(8),s=r.n(i),u=r(0);!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(n||(n={})),function(e){e.SET_REGISTERED_PAYMENT_METHODS="set_registered_payment_methods",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="set_registered_express_payment_methods",e.SET_SHOULD_SAVE_PAYMENT_METHOD="set_should_save_payment_method"}(c||(c={}));var l={currentStatus:n.PRISTINE,shouldSavePaymentMethod:!1,paymentMethodData:{payment_method:""},hasSavedToken:!1,errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},p={setPaymentStatus:function(){return{pristine:function(){},started:function(){},processing:function(){},completed:function(){},error:function(e){},failed:function(e,t){},success:function(e,t){}}},currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:n,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",setActivePaymentMethod:function(){},activeSavedToken:"",setActiveSavedToken:function(){},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:function(){return function(){return function(){}}},setExpressPaymentError:function(){},isExpressPaymentMethodActive:!1,setShouldSavePayment:function(){},shouldSavePayment:!1},d=r(5),b=r.n(d),m=r(38),f=r.n(m);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){b()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(e){return!("object"!==f()(e)||!e.isSavedToken)},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0,r=t.type,o=t.paymentMethodData,a=t.shouldSavePaymentMethod,i=void 0!==a&&a,s=t.errorMessage,u=void 0===s?"":s,p=t.paymentMethods,d=void 0===p?{}:p;switch(r){case n.STARTED:return g(g({},e),{},{currentStatus:n.STARTED,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)});case n.ERROR:return e.currentStatus!==n.ERROR?g(g({},e),{},{currentStatus:n.ERROR,errorMessage:u||e.errorMessage}):e;case n.FAILED:return e.currentStatus!==n.FAILED?g(g({},e),{},{currentStatus:n.FAILED,paymentMethodData:o||e.paymentMethodData,errorMessage:u||e.errorMessage}):e;case n.SUCCESS:return e.currentStatus!==n.SUCCESS?g(g({},e),{},{currentStatus:n.SUCCESS,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)}):e;case n.PROCESSING:return e.currentStatus!==n.PROCESSING?g(g({},e),{},{currentStatus:n.PROCESSING,errorMessage:""}):e;case n.COMPLETE:return e.currentStatus!==n.COMPLETE?g(g({},e),{},{currentStatus:n.COMPLETE}):e;case n.PRISTINE:return g(g({},l),{},{currentStatus:n.PRISTINE,paymentMethods:g({},e.paymentMethods),expressPaymentMethods:g({},e.expressPaymentMethods),shouldSavePaymentMethod:e.shouldSavePaymentMethod});case c.SET_REGISTERED_PAYMENT_METHODS:return g(g({},e),{},{paymentMethods:d});case c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return g(g({},e),{},{expressPaymentMethods:d});case c.SET_SHOULD_SAVE_PAYMENT_METHOD:return g(g({},e),{},{shouldSavePaymentMethod:i})}},j=r(29),E=r.n(j),y=r(22),_=r.n(y),w=r(1),k=r(60),S=r(62),C=r(3),P=r(222),R=r(63),x=r(75),N=r(67),I=r(43),T=r(59),M=r(50);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){b()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var L=function(e,t,r,n){var c=Object(u.useState)(!1),o=s()(c,2),a=o[0],i=o[1],l=Object(R.b)().isEditor,p=Object(x.b)().selectedRates,d=Object(N.b)(),m=d.billingData,O=d.shippingAddress,g=Object(S.a)(p),h=Object(S.a)(r),v=Object(I.a)(),j=v.cartTotals,y=v.cartNeedsShipping,k=v.paymentRequirements,M=Object(u.useRef)({cart:v,cartTotals:j,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}),A=Object(T.a)().addErrorNotice;Object(u.useEffect)((function(){M.current={cart:v,cartTotals:j,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}}),[v,j,y,m,O,g,k]);var L=Object(u.useCallback)(E()(_.a.mark((function r(){var c,o,a,s,u,p,d;return _.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:c={},o=function(e){c=D(D({},c),{},b()({},e.name,e))},a=0;case 3:if(!(a<h.length)){r.next=29;break}if(s=h[a],u=t[s]){r.next=8;break}return r.abrupt("continue",26);case 8:if(r.prev=8,!l){r.next=13;break}r.t0=!0,r.next=16;break;case 13:return r.next=15,Promise.resolve(u.canMakePayment(M.current));case 15:r.t0=r.sent;case 16:if(!(p=r.t0)){r.next=21;break}if("object"!==f()(p)||null===p||!p.error){r.next=20;break}throw new Error(p.error.message);case 20:o(u);case 21:r.next=26;break;case 23:r.prev=23,r.t1=r.catch(8),(C.CURRENT_USER_IS_ADMIN||l)&&(d=Object(w.sprintf)(
|
||
/* translators: %s the id of the payment method being registered (bank transfer, Stripe...) */
|
||
Object(w.__)("There was an error registering the payment method with id '%s': ",'woocommerce'),u.paymentMethodId),A("".concat(d," ").concat(r.t1),{context:n,id:"wc-".concat(u.paymentMethodId,"-registration-error")}));case 26:a++,r.next=3;break;case 29:e(c),i(!0);case 31:case"end":return r.stop()}}),r,null,[[8,23]])}))),[A,e,l,n,h,t]),B=Object(P.a)(L,500),V=s()(B,1)[0];return Object(u.useEffect)((function(){V()}),[V,v,g,m]),a},B=function(e){return{type:e}},V=function(e){return{type:n.ERROR,errorMessage:e}},F=function(e){var t=e.errorMessage,r=e.paymentMethodData;return{type:n.FAILED,errorMessage:t,paymentMethodData:r}},U=function(e){var t=e.paymentMethodData;return{type:n.SUCCESS,paymentMethodData:t}},z=function(e){var t=e.paymentMethodData;return{type:n.STARTED,paymentMethodData:t}},G=function(e){return{type:c.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},q=function(e){return{type:c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},H=function(e){return{type:c.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},Y=r(68),W=r(57),$=r(126),K=r(321),X=r(322),Q=r(132),J=Object(u.createContext)(p),Z=function(){return Object(u.useContext)(J)},ee=function(e){var t,r=e.children,c=Object(W.b)(),o=c.isProcessing,i=c.isIdle,p=c.isCalculating,d=c.hasError,b=Object(R.b)(),m=b.isEditor,O=b.getPreviewData,g=Object(Q.b)().setValidationErrors,h=Object(T.a)(),j=h.addErrorNotice,E=h.removeNotice,y=Object(M.c)(),_=y.isSuccessResponse,w=y.isErrorResponse,S=y.isFailResponse,P=y.noticeContexts,I=Object(u.useReducer)($.b,{}),A=s()(I,2),D=A[0],Z=(t=A[1],Object(u.useMemo)((function(){return{onPaymentProcessing:Object(K.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(u.useRef)(D);Object(u.useEffect)((function(){ee.current=D}),[D]);var te,re,ne,ce=Object(u.useReducer)(v,l),oe=s()(ce,2),ae=oe[0],ie=(te=oe[1],re=Object(N.b)().setBillingData,ne=Object(x.b)().setShippingAddress,{dispatchActions:Object(u.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(G(e))},setRegisteredExpressPaymentMethods:function(e){te(q(e))},setShouldSavePayment:function(e){te(H(e))}}}),[te]),setPaymentStatus:Object(u.useCallback)((function(){return{pristine:function(){return te(B(n.PRISTINE))},started:function(e){te(z({paymentMethodData:e}))},processing:function(){return te(B(n.PROCESSING))},completed:function(){return te(B(n.COMPLETE))},error:function(e){return te(V(e))},failed:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&re(r),te(F({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&re(t),void 0!==f()(r)&&null!=r&&r.address&&ne(r.address),te(U({paymentMethodData:e}))}}}),[te,re,ne])}),se=ie.dispatchActions,ue=ie.setPaymentStatus,le=function(e){var t=Object(k.getPaymentMethods)(),r=Object(M.c)().noticeContexts,n=new Set([].concat(a()(Object(C.getSetting)("paymentGatewaySortOrder",[])),a()(Object.keys(t))));return L(e,t,Array.from(n),r.PAYMENTS)}(se.setRegisteredPaymentMethods),pe=function(e){var t=Object(k.getExpressPaymentMethods)(),r=Object(M.c)().noticeContexts;return L(e,t,Object.keys(t),r.EXPRESS_PAYMENTS)}(se.setRegisteredExpressPaymentMethods),de=function(){var e=Object(Y.a)().dispatchCheckoutEvent,t=Object(u.useState)(""),r=s()(t,2),n=r[0],c=r[1],o=Object(u.useState)(""),a=s()(o,2),i=a[0],l=a[1];return Object(u.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:n})}),[e,n]),{activePaymentMethod:n,activeSavedToken:i,setActivePaymentMethod:c,setActiveSavedToken:l}}(),be=de.activePaymentMethod,me=de.activeSavedToken,fe=de.setActivePaymentMethod,Oe=de.setActiveSavedToken,ge=Object(u.useMemo)((function(){return m?O("previewSavedPaymentMethods"):le?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};var t=Object(C.getSetting)("customerPaymentMethods",{}),r=Object.keys(t),n={};return r.forEach((function(r){var c=t[r].filter((function(t){var r,n=t.method.gateway;return n in e&&(null===(r=e[n].supports)||void 0===r?void 0:r.showSavedCards)}));c.length&&(n[r]=c)})),n}(ae.paymentMethods):{}}),[m,O,le,ae.paymentMethods]),he=Object(u.useCallback)((function(e){e?j(e,{id:"wc-express-payment-error",context:P.EXPRESS_PAYMENTS}):E("wc-express-payment-error",P.EXPRESS_PAYMENTS)}),[j,P.EXPRESS_PAYMENTS,E]),ve=Object.keys(ae.expressPaymentMethods).includes(be),je=Object(u.useMemo)((function(){return{isPristine:ae.currentStatus===n.PRISTINE,isStarted:ae.currentStatus===n.STARTED,isProcessing:ae.currentStatus===n.PROCESSING,isFinished:[n.ERROR,n.FAILED,n.SUCCESS].includes(ae.currentStatus),hasError:ae.currentStatus===n.ERROR,hasFailed:ae.currentStatus===n.FAILED,isSuccessful:ae.currentStatus===n.SUCCESS,isDoingExpressPayment:ae.currentStatus!==n.PRISTINE&&ve}}),[ae.currentStatus,ve]);Object(u.useEffect)((function(){var e=Object.keys(ae.paymentMethods),t=[].concat(a()(e),a()(Object.keys(ae.expressPaymentMethods)));le&&e.length&&fe((function(e){return e&&t.includes(e)?e:(ue().pristine(),Object.keys(ae.paymentMethods)[0])}))}),[le,ae.paymentMethods,ae.expressPaymentMethods,fe,ue]),Object(u.useEffect)((function(){!o||d||p||je.isFinished||ue().processing()}),[o,d,p,je.isFinished,ue]),Object(u.useEffect)((function(){i&&!je.isSuccessful&&ue().pristine()}),[i,je.isSuccessful,ue]),Object(u.useEffect)((function(){d&&je.isSuccessful&&!ae.hasSavedToken&&ue().pristine()}),[d,je.isSuccessful,ae.hasSavedToken,ue]),Object(u.useEffect)((function(){je.isProcessing&&(E("wc-payment-error",P.PAYMENTS),Object(X.b)(ee.current,"payment_processing",{}).then((function(e){var t,r,n,c,o,a,i,s;if(e.forEach((function(e){_(e)&&(t=e),(w(e)||S(e))&&(r=e)})),t&&!r)ue().success(null===(n=t)||void 0===n||null===(c=n.meta)||void 0===c?void 0:c.paymentMethodData,null===(o=t)||void 0===o||null===(a=o.meta)||void 0===a?void 0:a.billingData,null===(i=t)||void 0===i||null===(s=i.meta)||void 0===s?void 0:s.shippingData);else if(r&&S(r)){var u,l,p,d,b,m;r.message&&r.message.length&&j(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(m=r)||void 0===m?void 0:m.messageContext)||P.PAYMENTS}),ue().failed(null===(u=r)||void 0===u?void 0:u.message,null===(l=r)||void 0===l||null===(p=l.meta)||void 0===p?void 0:p.paymentMethodData,null===(d=r)||void 0===d||null===(b=d.meta)||void 0===b?void 0:b.billingData)}else if(r){var f,O;r.message&&r.message.length&&j(r.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(O=r)||void 0===O?void 0:O.messageContext)||P.PAYMENTS}),ue().error(r.message),g(null===(f=r)||void 0===f?void 0:f.validationErrors)}else ue().success()})))}),[je.isProcessing,g,ue,E,P.PAYMENTS,_,S,w,j]);var Ee={setPaymentStatus:ue,currentStatus:je,paymentStatuses:n,paymentMethodData:ae.paymentMethodData,errorMessage:ae.errorMessage,activePaymentMethod:be,setActivePaymentMethod:fe,activeSavedToken:me,setActiveSavedToken:Oe,onPaymentProcessing:Z,customerPaymentMethods:ge,paymentMethods:ae.paymentMethods,expressPaymentMethods:ae.expressPaymentMethods,paymentMethodsInitialized:le,expressPaymentMethodsInitialized:pe,setExpressPaymentError:he,isExpressPaymentMethodActive:ve,shouldSavePayment:ae.shouldSavePaymentMethod,setShouldSavePayment:se.setShouldSavePayment};return Object(u.createElement)(J.Provider,{value:Ee},r)}},175:function(e,t){},179:function(e,t){},189:function(e,t){},190:function(e,t){},191:function(e,t){e.exports=window.wp.warning},195:function(e,t,r){"use strict";var n=r(33),c=r.n(n),o=r(0),a=r(1),i=r(4),s=r(14),u=r(39);t.a=function(e){var t=e.setPageId,r=e.pageId,n=e.labels,l=Object(s.useSelect)((function(e){return e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})}),[])||null;return l?Object(o.createElement)(i.PanelBody,{title:n.title},Object(o.createElement)(i.SelectControl,{label:Object(a.__)("Link to",'woocommerce'),value:r,options:[{label:n.default,value:0}].concat(c()(l.map((function(e){return{label:Object(u.a)(e,l),value:parseInt(e.id,10)}})))),onChange:function(e){return t(parseInt(e,10))}})):null}},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(0),c=r(1),o=(r(2),r(66)),a=r(237),i=r(158),s=(r(258),function(e){var t=e.text,r=e.url,s=void 0===r?"https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565":r;return Object(n.createElement)("div",{className:"wc-block-feedback-prompt"},Object(n.createElement)(o.a,{srcElement:a.a}),Object(n.createElement)("h2",{className:"wc-block-feedback-prompt__title"},Object(c.__)("Feedback?",'woocommerce')),Object(n.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(n.createElement)("a",{href:s,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(c.__)("Give us your feedback.",'woocommerce'),Object(n.createElement)(o.a,{srcElement:i.a,size:16})))}),u=function(){return Object(n.createElement)(s,{text:Object(c.__)("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"})}},197:function(e,t){e.exports=window.wp.plugins},198:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=r(1),u=r(283),l=r(163),p=r(63),d=r(174),b=r(56),m=r.n(b),f=r(168);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(){var e=Object(p.b)().isEditor,t=Object(d.b)(),r=t.setActivePaymentMethod,n=t.setExpressPaymentError,c=t.activePaymentMethod,o=t.paymentMethodData,b=t.setPaymentStatus,O=Object(u.a)(),h=Object(l.a)().paymentMethods,v=Object(i.useRef)(c),j=Object(i.useRef)(o),E=Object(i.useCallback)((function(e){return function(){v.current=c,j.current=o,b().started({}),r(e)}}),[c,o,r,b]),y=Object(i.useCallback)((function(){b().pristine(),r(v.current),j.current.isSavedToken&&b().started(j.current)}),[r,b]),_=Object(i.useCallback)((function(e){b().error(e),n(e),r(v.current),j.current.isSavedToken&&b().started(j.current)}),[r,b,n]),w=Object(i.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";m()("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?_(e):n("")}),[n,_]),k=Object.entries(h),S=k.length>0?k.map((function(t){var r=a()(t,2),n=r[0],c=r[1],o=e?c.edit:c.content;return Object(i.isValidElement)(o)?Object(i.createElement)("li",{key:n,id:"express-payment-method-".concat(n)},Object(i.cloneElement)(o,g(g({},O),{},{onClick:E(n),onClose:y,onError:_,setExpressPaymentError:w}))):null})):Object(i.createElement)("li",{key:"noneRegistered"},Object(s.__)("No registered Payment Methods",'woocommerce'));return Object(i.createElement)(f.a,{isEditor:e},Object(i.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},S))}},200:function(e,t,r){"use strict";var n=r(16),c=r.n(n),o=r(0),a=r(1),i=r(64),s=r(83),u=r(27),l=r(500),p=r(43),d=r(63),b=r(6),m=r.n(b),f=r(25),O=r(41),g=r(8),h=r.n(g),v=r(34),j=r.n(v),E=r(134),y=r(68),_=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},w=r(167),k=r(129),S=r(47),C=r(53),P=r(3),R=function(e){var t=Object(P.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(f.decodeEntities)(e.name),value:e.rate_id,description:Object(o.createElement)(o.Fragment,null,Number.isFinite(t)&&Object(o.createElement)(C.a,{currency:Object(S.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(f.decodeEntities)(e.delivery_time))}},x=function(e){var t=e.className,r=e.noResultsMessage,n=e.onSelectRate,c=e.rates,a=e.renderOption,i=void 0===a?R:a,s=e.selected;if(0===c.length)return r;if(c.length>1)return Object(o.createElement)(w.a,{className:t,onChange:function(e){n(e)},selected:s,options:c.map(i)});var u=i(c[0]),l=u.label,p=u.secondaryLabel,d=u.description,b=u.secondaryDescription;return Object(o.createElement)(k.a,{label:l,secondaryLabel:p,description:d,secondaryDescription:b})},N=(r(271),function(e){var t=e.packageId,r=e.className,n=e.noResultsMessage,c=e.renderOption,i=e.packageData,s=e.collapsible,l=void 0!==s&&s,p=e.collapse,d=void 0!==p&&p,b=e.showItems,g=void 0!==b&&b,v=function(e,t){var r=Object(y.a)().dispatchCheckoutEvent,n=Object(E.a)(),c=n.selectShippingRate,a=n.isSelectingRate,i=Object(o.useState)((function(){return _(t)})),s=h()(i,2),u=s[0],l=s[1],p=Object(o.useRef)(t);return Object(o.useEffect)((function(){j()(p.current,t)||(p.current=t,l(_(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){l(t),c(t,e),r("set-selected-shipping-rate",{shippingRateId:t})}),[e,c,r]),selectedShippingRate:u,isSelectingRate:a}}(t,i.shipping_rates),w=v.selectShippingRate,k=v.selectedShippingRate,S=Object(o.createElement)(o.Fragment,null,(g||l)&&Object(o.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),g&&Object(o.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map((function(e){var t=Object(f.decodeEntities)(e.name),r=e.quantity;return Object(o.createElement)("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},Object(o.createElement)(O.a,{label:r>1?"".concat(t," × ").concat(r):"".concat(t),screenReaderLabel:Object(a.sprintf)(
|
||
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
|
||
Object(a._n)("%1$s (%2$d unit)","%1$s (%2$d units)",r,'woocommerce'),t,r)}))})))),C=Object(o.createElement)(x,{className:r,noResultsMessage:n,rates:i.shipping_rates,onSelectRate:w,selected:k,renderOption:c});return l?Object(o.createElement)(u.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:S},C):Object(o.createElement)("div",{className:m()("wc-block-components-shipping-rates-control__package",r)},S,C)}),I=["package_id"],T=["extensions","receiveCart"],M=function(e){var t=e.packages,r=e.collapse,n=e.showItems,a=e.collapsible,i=e.noResultsMessage,s=e.renderOption;return t.length?Object(o.createElement)(o.Fragment,null,t.map((function(e){var t=e.package_id,u=c()(e,I);return Object(o.createElement)(N,{key:t,packageId:t,packageData:u,collapsible:a,collapse:r,showItems:n,noResultsMessage:i,renderOption:s})}))):null};t.a=function(e){var t=e.shippingRates,r=e.shippingRatesLoading,n=e.className,b=e.collapsible,m=void 0!==b&&b,f=e.noResultsMessage,O=e.renderOption;Object(o.useEffect)((function(){if(!r){var e=Object(l.a)(t),n=Object(l.b)(t);1===e?Object(i.speak)(Object(a.sprintf)(
|
||
/* translators: %d number of shipping options found. */
|
||
Object(a._n)("%d shipping option was found.","%d shipping options were found.",n,'woocommerce'),n)):Object(i.speak)(Object(a.sprintf)(
|
||
/* translators: %d number of shipping packages packages. */
|
||
Object(a._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(a.sprintf)(
|
||
/* translators: %d number of shipping options available. */
|
||
Object(a._n)("%d shipping option was found","%d shipping options were found",n,'woocommerce'),n))}}),[r,t]);var g=Object(p.a)(),h=g.extensions,v=(g.receiveCart,{className:n,collapsible:m,noResultsMessage:f,renderOption:O,extensions:h,cart:c()(g,T),components:{ShippingRatesControlPackage:N}}),j=Object(d.b)().isEditor;return Object(o.createElement)(s.a,{isLoading:r,screenReaderLabel:Object(a.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},j?Object(o.createElement)(M,{packages:t,noResultsMessage:f,renderOption:O}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(u.ExperimentalOrderShippingPackages.Slot,v),Object(o.createElement)(u.ExperimentalOrderShippingPackages,null,Object(o.createElement)(M,{packages:t,noResultsMessage:f,renderOption:O}))))}},201:function(e,t,r){"use strict";r.d(t,"a",(function(){return g}));var n=r(5),c=r.n(n),o=r(1),a=r(14),i=r(24),s=r(25),u=r(43),l=r(0);r(8),r(2),r(899),r(6),r(27),r(68),r(63);var p=Object(l.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"});function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=r(132),f=r(59);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var g=function(){var e=Object(u.a)(),t=e.cartCoupons,r=e.cartIsLoading,n=Object(f.a)().addErrorNotice,d=function(){var e=Object(l.useContext)(p),t=e.notices,r=e.createSnackbarNotice,n=e.removeSnackbarNotice,c=e.setIsSuppressed,o=Object(l.useRef)(t);Object(l.useEffect)((function(){o.current=t}),[t]);var a=Object(l.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeSnackbarNotice:n}}),[n]),i=Object(l.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(e,t)}}}),[r]);return b(b(b({notices:t},a),i),{},{setIsSuppressed:c})}().addSnackbarNotice,g=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({appliedCoupons:t,isLoading:r},Object(a.useSelect)((function(e,t){var r=t.dispatch,c=e(i.CART_STORE_KEY),a=c.isApplyingCoupon(),u=c.isRemovingCoupon(),l=r(i.CART_STORE_KEY),p=l.applyCoupon,b=l.removeCoupon,m=l.receiveApplyingCoupon;return{applyCoupon:function(e){p(e).then((function(t){!0===t&&d(Object(o.sprintf)(
|
||
/* translators: %s coupon code. */
|
||
Object(o.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){g({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),m("")}))},removeCoupon:function(e){b(e).then((function(t){!0===t&&d(Object(o.sprintf)(
|
||
/* translators: %s coupon code. */
|
||
Object(o.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){n(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:a,isRemovingCoupon:u}}),[n,d]))}},205:function(e,t){},206:function(e,t){},207:function(e,t){},208:function(e,t){},209:function(e,t){},21:function(e,t){e.exports=window.wp.compose},210:function(e,t){},218:function(e,t){},22:function(e,t){e.exports=window.regeneratorRuntime},220:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=(r(2),r(6)),u=r.n(s),l=r(1),p=r(66),d=r(305),b=(r(179),["text","screenReaderText","element","className","radius","children"]),m=function(e){var t=e.text,r=e.screenReaderText,n=void 0===r?"":r,o=e.element,s=void 0===o?"li":o,l=e.className,p=void 0===l?"":l,d=e.radius,m=void 0===d?"small":d,f=e.children,O=void 0===f?null:f,g=a()(e,b),h=s,v=u()(p,"wc-block-components-chip","wc-block-components-chip--radius-"+m),j=Boolean(n&&n!==t);return Object(i.createElement)(h,c()({className:v},g),Object(i.createElement)("span",{"aria-hidden":j,className:"wc-block-components-chip__text"},t),j&&Object(i.createElement)("span",{className:"screen-reader-text"},n),O)},f=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,r=void 0===t?"":t,n=e.className,o=void 0===n?"":n,s=e.disabled,b=void 0!==s&&s,O=e.onRemove,g=void 0===O?function(){}:O,h=e.removeOnAnyClick,v=void 0!==h&&h,j=e.text,E=e.screenReaderText,y=void 0===E?"":E,_=a()(e,f),w=v?"span":"button";if(!r){var k=y&&"string"==typeof y?y:j;r="string"!=typeof k?
|
||
/* translators: Remove chip. */
|
||
Object(l.__)("Remove",'woocommerce'):Object(l.sprintf)(
|
||
/* translators: %s text of the chip to remove. */
|
||
Object(l.__)('Remove "%s"','woocommerce'),k)}var S={"aria-label":r,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},C=v?S:{},P=v?{"aria-hidden":!0}:S;return Object(i.createElement)(m,c()({},_,C,{className:u()(o,"is-removable"),element:v?"button":_.element,screenReaderText:y,text:j}),Object(i.createElement)(w,c()({className:"wc-block-components-chip__remove"},P),Object(i.createElement)(p.a,{className:"wc-block-components-chip__remove-icon",srcElement:d.a,size:16})))}},23:function(e,t){e.exports=window.wp.url},234:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=(r(2),r(132)),o=(r(210),function(e){var t=e.errorMessage,r=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,i=e.elementId,s=void 0===i?"":i,u=Object(c.b)(),l=u.getValidationError,p=u.getValidationErrorId;if(!r||"string"!=typeof r){var d=l(a)||{};if(!d.message||d.hidden)return null;r=d.message}return Object(n.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(n.createElement)("p",{id:p(s)},r))})},235:function(e,t,r){"use strict";r.d(t,"a",(function(){return I}));var n=r(0),c=r(197),o=r(3),a=r(125),i=r(174),s=r(75),u=r(67),l=r(57),p=r(29),d=r.n(p),b=r(5),m=r.n(b),f=r(8),O=r.n(f),g=r(22),h=r.n(g),v=r(1),j=r(15),E=r.n(j),y=r(162),_=r(42),w=function(e,t,r){var n=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),c="wc-".concat(r,"-new-payment-method");return n.push({key:c,value:t}),n},k=function(e,t){E.a.setNonce&&"function"==typeof E.a.setNonce&&E.a.setNonce(e),null!=e&&e.get("X-WC-Store-API-User")&&t.setCustomerId(parseInt(e.get("X-WC-Store-API-User")||"0",10))},S=r(132),C=r(43),P=r(59);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){m()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=function(){var e=Object(l.b)(),t=e.hasError,r=e.onCheckoutValidationBeforeProcessing,c=e.dispatchActions,o=e.redirectUrl,a=e.isProcessing,p=e.isBeforeProcessing,b=e.isComplete,m=e.orderNotes,f=e.shouldCreateAccount,g=e.extensionData,j=Object(S.b)().hasValidationErrors,R=Object(s.b)().shippingErrorStatus,N=Object(u.b)(),I=N.billingData,T=N.shippingAddress,M=Object(C.a)(),A=M.cartNeedsPayment,D=M.receiveCart,L=Object(i.b)(),B=L.activePaymentMethod,V=L.isExpressPaymentMethodActive,F=L.currentStatus,U=L.paymentMethodData,z=L.expressPaymentMethods,G=L.paymentMethods,q=L.shouldSavePayment,H=Object(P.a)(),Y=H.addErrorNotice,W=H.removeNotice,$=H.setIsSuppressed,K=Object(n.useRef)(I),X=Object(n.useRef)(T),Q=Object(n.useRef)(o),J=Object(n.useState)(!1),Z=O()(J,2),ee=Z[0],te=Z[1],re=Object(n.useMemo)((function(){var e,t=x(x({},z),G);return null==t||null===(e=t[B])||void 0===e?void 0:e.paymentMethodId}),[B,z,G]),ne=j&&!V||F.hasError||R.hasError,ce=!t&&!ne&&(F.isSuccessful||!A)&&a;Object(n.useEffect)((function(){$(V)}),[V,$]),Object(n.useEffect)((function(){ne===t||!a&&!p||V||c.setHasError(ne)}),[ne,t,a,p,V,c]),Object(n.useEffect)((function(){K.current=I,X.current=T,Q.current=o}),[I,T,o]);var oe=Object(n.useCallback)((function(){return!j&&(F.hasError?{errorMessage:Object(v.__)("There was a problem with your payment option.",'woocommerce')}:!R.hasError||{errorMessage:Object(v.__)("There was a problem with your shipping option.",'woocommerce')})}),[j,F.hasError,R.hasError]);Object(n.useEffect)((function(){var e;return V||(e=r(oe,0)),function(){V||e()}}),[r,oe,V]),Object(n.useEffect)((function(){Q.current&&(window.location.href=Q.current)}),[b]);var ae=Object(n.useCallback)(d()(h.a.mark((function e(){var t,r;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ee){e.next=2;break}return e.abrupt("return");case 2:te(!0),W("checkout"),t=A?{payment_method:re,payment_data:w(U,q,B)}:{},r=x(x({billing_address:Object(y.a)(K.current),shipping_address:Object(y.a)(X.current),customer_note:m,should_create_account:f},t),{},{extensions:x({},g)}),E()({path:"/wc/store/checkout",method:"POST",data:r,cache:"no-store",parse:!1}).then((function(e){if(k(e.headers,c),!e.ok)throw new Error(e);return e.json()})).then((function(e){c.setAfterProcessing(e),te(!1)})).catch((function(e){k(e.headers,c),e.json().then((function(e){var t,r,n;null!==(t=e.data)&&void 0!==t&&t.cart&&D(e.data.cart),Y(Object(_.b)(e),{id:"checkout"}),null===(r=e.additional_errors)||void 0===r||null===(n=r.forEach)||void 0===n||n.call(r,(function(e){Y(e.message,{id:e.error_code})})),c.setHasError(!0),c.setAfterProcessing(e),te(!1)}))}));case 7:case"end":return e.stop()}}),e)}))),[ee,W,m,f,A,re,U,q,B,g,c,Y,D]);return Object(n.useEffect)((function(){ce&&!ee&&ae()}),[ae,ce,ee]),null},I=function(e){var t=e.children,r=e.isCart,p=void 0!==r&&r,d=e.redirectUrl;return Object(n.createElement)(l.a,{redirectUrl:d,isCart:p},Object(n.createElement)(u.a,null,Object(n.createElement)(s.a,null,Object(n.createElement)(i.a,null,t,Object(n.createElement)(a.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},Object(n.createElement)(c.PluginArea,{scope:"woocommerce-checkout"})),Object(n.createElement)(N,null)))))}},237:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"}));t.a=o},24:function(e,t){e.exports=window.wc.wcBlocksData},25:function(e,t){e.exports=window.wp.htmlEntities},258:function(e,t){},259:function(e,t){},26:function(e,t){e.exports=window.wp.blocks},260:function(e,t){},261:function(e,t){},262:function(e,t){},263:function(e,t){},264:function(e,t){},265:function(e,t){},266:function(e,t){},267:function(e,t){},268:function(e,t){},269:function(e,t){},27:function(e,t){e.exports=window.wc.blocksCheckout},270:function(e,t){},271:function(e,t){},272:function(e,t){},273:function(e,t){},274:function(e,t){},275:function(e,t){},276:function(e,t){},28:function(e,t){e.exports=window.wp.primitives},281:function(e,t,r){"use strict";var n=r(38),c=r.n(n),o=r(0),a=r(1),i=r(64),s=r(6),u=r.n(s),l=r(46),p=r(72);r(365),t.a=function(e){var t=e.className,r=e.quantity,n=void 0===r?1:r,s=e.minimum,d=void 0===s?1:s,b=e.maximum,m=e.onChange,f=void 0===m?function(){}:m,O=e.itemName,g=void 0===O?"":O,h=e.disabled,v=u()("wc-block-components-quantity-selector",t),j=void 0!==b,E=n>d,y=!j||n<b,_=Object(o.useCallback)((function(e){var t=void 0!==c()(e.key)?"ArrowDown"===e.key:e.keyCode===l.DOWN,r=void 0!==c()(e.key)?"ArrowUp"===e.key:e.keyCode===l.UP;t&&E&&(e.preventDefault(),f(n-1)),r&&y&&(e.preventDefault(),f(n+1))}),[n,f,y,E]);return Object(o.createElement)("div",{className:v},Object(o.createElement)("input",{className:"wc-block-components-quantity-selector__input",disabled:h,type:"number",step:"1",min:"0",value:n,onKeyDown:_,onChange:function(e){var t=Object(p.a)(e.target.value)&&e.target.value?parseInt(e.target.value,10):0;j&&(t=Math.min(t,b)),(t=Math.max(t,d))!==n&&f(t)},"aria-label":Object(a.sprintf)(
|
||
/* translators: %s refers to the item name in the cart. */
|
||
Object(a.__)("Quantity of %s in your cart.",'woocommerce'),g)}),Object(o.createElement)("button",{"aria-label":Object(a.__)("Reduce quantity",'woocommerce'),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:h||!E,onClick:function(){var e=n-1;f(e),Object(i.speak)(Object(a.sprintf)(
|
||
/* translators: %s refers to the item name in the cart. */
|
||
Object(a.__)("Quantity reduced to %s.",'woocommerce'),e))}},"-"),Object(o.createElement)("button",{"aria-label":Object(a.__)("Increase quantity",'woocommerce'),disabled:h||!y,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:function(){var e=n+1;f(e),Object(i.speak)(Object(a.sprintf)(
|
||
/* translators: %s refers to the item name in the cart. */
|
||
Object(a.__)("Quantity increased to %s.",'woocommerce'),e))}},"+"))}},283:function(e,t,r){"use strict";r.d(t,"a",(function(){return x}));var n=r(1),c=r(47),o=r(0),a=r(6),i=r.n(a),s=r(28),u=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z"})),l=r(303),p=r(502),d=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"}),Object(o.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(o.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"}))),b=r(66),m=r(72),f=(r(276),{bank:u,bill:l.a,card:p.a,checkPayment:d}),O=function(e){var t=e.icon,r=void 0===t?"":t,n=e.text,c=void 0===n?"":n,a=!!r,s=Object(o.useCallback)((function(e){return a&&Object(m.c)(e)&&Object(m.d)(f,e)}),[a]),u=i()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":a});return Object(o.createElement)("span",{className:u},s(r)?Object(o.createElement)(b.a,{srcElement:f[r]}):r,c)},g=r(169),h=r(3),v=r(56),j=r.n(v),E=r(234),y=r(43),_=r(201),w=r(50),k=r(57),S=r(174),C=r(75),P=r(67),R=function(e,t){var r=[],c=function(t,r){var n=r+"_tax",c=Object(m.d)(e,r)&&Object(m.c)(e[r])?parseInt(e[r],10):0;return{key:r,label:t,value:c,valueWithTax:c+(Object(m.d)(e,n)&&Object(m.c)(e[n])?parseInt(e[n],10):0)}};return r.push(c(Object(n.__)("Subtotal:",'woocommerce'),"total_items")),r.push(c(Object(n.__)("Fees:",'woocommerce'),"total_fees")),r.push(c(Object(n.__)("Discount:",'woocommerce'),"total_discount")),r.push({key:"total_tax",label:Object(n.__)("Taxes:",'woocommerce'),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&r.push(c(Object(n.__)("Shipping:",'woocommerce'),"total_shipping")),r},x=function(){var e=Object(k.b)(),t=e.isCalculating,r=e.isComplete,a=e.isIdle,i=e.isProcessing,s=e.onCheckoutBeforeProcessing,u=e.onCheckoutValidationBeforeProcessing,l=e.onCheckoutAfterProcessingWithSuccess,p=e.onCheckoutAfterProcessingWithError,d=e.onSubmit,b=e.customerId,m=Object(S.b)(),f=m.currentStatus,v=m.activePaymentMethod,x=m.onPaymentProcessing,N=m.setExpressPaymentError,I=m.shouldSavePayment,T=Object(C.b)(),M=T.shippingErrorStatus,A=T.shippingErrorTypes,D=T.shippingRates,L=T.shippingRatesLoading,B=T.selectedRates,V=T.setSelectedRates,F=T.isSelectingRate,U=T.onShippingRateSuccess,z=T.onShippingRateFail,G=T.onShippingRateSelectSuccess,q=T.onShippingRateSelectFail,H=T.needsShipping,Y=Object(P.b)(),W=Y.billingData,$=Y.shippingAddress,K=Y.setShippingAddress,X=Object(y.a)().cartTotals,Q=Object(_.a)().appliedCoupons,J=Object(w.c)(),Z=J.noticeContexts,ee=J.responseTypes,te=Object(o.useRef)(R(X,H)),re=Object(o.useRef)({label:Object(n.__)("Total",'woocommerce'),value:parseInt(X.total_price,10)});Object(o.useEffect)((function(){te.current=R(X,H),re.current={label:Object(n.__)("Total",'woocommerce'),value:parseInt(X.total_price,10)}}),[X,H]);var ne=Object(o.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";j()("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"}),N(e)}),[N]);return{activePaymentMethod:v,billing:{billingData:W,cartTotal:re.current,currency:Object(c.getCurrencyFromPriceResponse)(X),cartTotalItems:te.current,displayPricesIncludingTax:Object(h.getSetting)("displayCartPricesIncludingTax",!1),appliedCoupons:Q,customerId:b},checkoutStatus:{isCalculating:t,isComplete:r,isIdle:a,isProcessing:i},components:{ValidationInputError:E.a,PaymentMethodIcons:g.a,PaymentMethodLabel:O},emitResponse:{noticeContexts:Z,responseTypes:ee},eventRegistration:{onCheckoutBeforeProcessing:s,onCheckoutValidationBeforeProcessing:u,onCheckoutAfterProcessingWithSuccess:l,onCheckoutAfterProcessingWithError:p,onShippingRateSuccess:U,onShippingRateFail:z,onShippingRateSelectSuccess:G,onShippingRateSelectFail:q,onPaymentProcessing:x},onSubmit:d,paymentStatus:f,setExpressPaymentError:ne,shippingData:{shippingRates:D,shippingRatesLoading:L,selectedRates:B,setSelectedRates:V,isSelectingRate:F,shippingAddress:$,setShippingAddress:K,needsShipping:H},shippingStatus:{shippingErrorStatus:M,shippingErrorTypes:A},shouldSavePayment:I}}},285:function(e,t,r){"use strict";r.d(t,"b",(function(){return l})),r.d(t,"a",(function(){return p}));var n=r(8),c=r.n(n),o=r(0),a=(r(2),r(21)),i=r(6),s=r.n(i),u=Object(o.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),l=function(){return Object(o.useContext)(u)},p=function(e){var t=e.children,r=e.className,n=void 0===r?"":r,i=function(){var e=Object(a.useResizeObserver)(),t=c()(e,2),r=t[0],n=t[1].width,o="";return n>700?o="is-large":n>520?o="is-medium":n>400?o="is-small":n&&(o="is-mobile"),[r,o]}(),l=c()(i,2),p=l[0],d=l[1],b={hasContainerWidth:""!==d,containerClassName:d,isMobile:"is-mobile"===d,isSmall:"is-small"===d,isMedium:"is-medium"===d,isLarge:"is-large"===d};return Object(o.createElement)(u.Provider,{value:b},Object(o.createElement)("div",{className:s()(n,d)},p,t))}},286:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(8),s=r.n(i),u=r(16),l=r.n(u),p=r(0),d=r(1),b=r(11),m=r(6),f=r.n(m),O=r(132),g=r(57),h=r(234),v=r(21),j=r(72),E=r(41),y=(r(189),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),_=Object(b.forwardRef)((function(e,t){var r=e.className,n=e.id,o=e.type,a=void 0===o?"text":o,i=e.ariaLabel,u=e.ariaDescribedBy,d=e.label,b=e.screenReaderLabel,m=e.disabled,O=e.help,g=e.autoCapitalize,h=void 0===g?"off":g,v=e.autoComplete,j=void 0===v?"off":v,_=e.value,w=void 0===_?"":_,k=e.onChange,S=e.required,C=void 0!==S&&S,P=e.onBlur,R=void 0===P?function(){}:P,x=e.feedback,N=l()(e,y),I=Object(p.useState)(!1),T=s()(I,2),M=T[0],A=T[1];return Object(p.createElement)("div",{className:f()("wc-block-components-text-input",r,{"is-active":M||w})},Object(p.createElement)("input",c()({type:a,id:n,value:w,ref:t,autoCapitalize:h,autoComplete:j,onChange:function(e){k(e.target.value)},onFocus:function(){return A(!0)},onBlur:function(e){R(e.target.value),A(!1)},"aria-label":i||d,disabled:m,"aria-describedby":O&&!u?n+"__help":u,required:C},N)),Object(p.createElement)(E.a,{label:d,screenReaderLabel:b||d,wrapperElement:"label",wrapperProps:{htmlFor:n},htmlFor:n}),!!O&&Object(p.createElement)("p",{id:n+"__help",className:"wc-block-components-text-input__help"},O),x)})),w=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(v.withInstanceId)((function(e){var t=e.className,r=e.instanceId,n=e.id,o=e.ariaDescribedBy,i=e.errorId,u=e.validateOnMount,m=void 0===u||u,v=e.focusOnMount,E=void 0!==v&&v,y=e.onChange,k=e.showError,S=void 0===k||k,C=e.errorMessage,P=void 0===C?"":C,R=l()(e,w),x=Object(b.useState)(!0),N=s()(x,2),I=N[0],T=N[1],M=Object(b.useRef)(null),A=Object(O.b)(),D=A.getValidationError,L=A.hideValidationError,B=A.setValidationErrors,V=A.clearValidationError,F=A.getValidationErrorId,U=Object(g.b)().isBeforeProcessing,z=void 0!==n?n:"textinput-"+r,G=void 0!==i?i:z,q=Object(b.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=M.current||null;if(t){t.value=t.value.trim();var r=t.checkValidity();r?V(G):B(a()({},G,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[V,G,B]);Object(b.useEffect)((function(){var e;I&&(E&&(null===(e=M.current)||void 0===e||e.focus()),T(!1))}),[E,I,T]),Object(b.useEffect)((function(){I&&(m&&q(),T(!1))}),[I,T,m,q]),Object(b.useEffect)((function(){U&&q()}),[U,q]),Object(b.useEffect)((function(){return function(){V(G)}}),[V,G]);var H=D(G)||{};Object(j.c)(P)&&""!==P&&(H.message=P);var Y=H.message&&!H.hidden,W=S&&Y&&F(G)?F(G):o;return Object(p.createElement)(_,c()({className:f()(t,{"has-error":Y}),"aria-invalid":!0===Y,id:z,onBlur:function(){q(!1)},feedback:S&&Object(p.createElement)(h.a,{errorMessage:P,propertyName:G}),ref:M,onChange:function(e){L(G),y(e)},ariaDescribedBy:W},R))}))},3:function(e,t){e.exports=window.wc.wcSettings},303:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=o},305:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(28),u=["className","size"],l=Object(i.createElement)((function(e){var t=e.className,r=e.size,n=a()(e,u);return Object(i.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),Object(i.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))}),null);t.a=l},307:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(0),a=r(25),i=r(3);t.a=function(e){var t=e.image,r=void 0===t?{}:t,n={src:r.thumbnail||i.PLACEHOLDER_IMG_SRC,alt:Object(a.decodeEntities)(r.alt)||""};return Object(o.createElement)("img",c()({},n,{alt:n.alt}))}},308:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(110);t.a=function(){return Object(n.createElement)(o.a,{className:"wc-block-components-product-backorder-badge"},Object(c.__)("Available on backorder",'woocommerce'))}},309:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(110);t.a=function(e){var t=e.lowStockRemaining;return t?Object(n.createElement)(o.a,{className:"wc-block-components-product-low-stock-badge"},Object(c.sprintf)(
|
||
/* translators: %d stock amount (number of items in stock for product) */
|
||
Object(c.__)("%d left in stock",'woocommerce'),t)):null}},311:function(e,t,r){"use strict";var n=r(0),c=r(7),o=r(25),a=(r(264),function(e){var t=e.details,r=void 0===t?[]:t;return Array.isArray(r)?0===(r=r.filter((function(e){return!e.hidden}))).length?null:Object(n.createElement)("ul",{className:"wc-block-components-product-details"},r.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(c.kebabCase)(e.name)):"";return Object(n.createElement)("li",{key:e.name+(e.display||e.value),className:t},e.name&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(e.name),":")," "),Object(n.createElement)("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null}),i=r(155),s=r(37),u=function(e){var t=e.className,r=e.shortDescription,c=void 0===r?"":r,o=e.fullDescription,a=c||(void 0===o?"":o);return a?Object(n.createElement)(i.a,{className:t,source:a,maxLength:15,countType:s.o.wordCountType||"words"}):null};r(263),t.a=function(e){var t=e.shortDescription,r=void 0===t?"":t,c=e.fullDescription,o=void 0===c?"":c,i=e.itemData,s=void 0===i?[]:i,l=e.variation,p=void 0===l?[]:l;return Object(n.createElement)("div",{className:"wc-block-components-product-metadata"},Object(n.createElement)(u,{className:"wc-block-components-product-metadata__description",shortDescription:r,fullDescription:o}),Object(n.createElement)(a,{details:s}),Object(n.createElement)(a,{details:p.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},321:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(126),c=function(e,t){return function(r){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=n.a.addEventCallback(e,r,c);return t(o),function(){t(n.a.removeEventCallback(e,o.id))}}}},322:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return m}));var n=r(38),c=r.n(n),o=r(29),a=r.n(o),i=r(22),s=r.n(i),u=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},l=r(50);function p(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,c=function(){};return{s:c,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,l,d,b;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=u(t,r),a=[],i=p(o),e.prev=3,i.s();case 5:if((l=i.n()).done){e.next=19;break}return d=l.value,e.prev=7,e.next=10,Promise.resolve(d.callback(n));case 10:b=e.sent,"object"===c()(b)&&a.push(b),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),console.error(e.t0);case 17:e.next=5;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(3),i.e(e.t1);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",!a.length||a);case 28:case"end":return e.stop()}}),e,null,[[3,21,24,27],[7,14]])})));return function(_x,t,r){return e.apply(this,arguments)}}(),m=function(){var e=a()(s.a.mark((function e(t,r,n){var o,a,i,d,b,m;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=u(t,r),i=p(a),e.prev=3,i.s();case 5:if((d=i.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(n));case 10:if(m=e.sent,"object"===c()(m)&&null!==m){e.next=13;break}return e.abrupt("continue",26);case 13:if(m.hasOwnProperty("type")){e.next=15;break}throw new Error("Returned objects from event emitter observers must return an object with a type property");case 15:if(!Object(l.a)(m)&&!Object(l.b)(m)){e.next=18;break}return o.push(m),e.abrupt("return",o);case 18:o.push(m),e.next=26;break;case 21:return e.prev=21,e.t0=e.catch(7),console.error(e.t0),o.push({type:"error"}),e.abrupt("return",o);case 26:e.next=5;break;case 28:e.next=33;break;case 30:e.prev=30,e.t1=e.catch(3),i.e(e.t1);case 33:return e.prev=33,i.f(),e.finish(33);case 36:return e.abrupt("return",o);case 37:case"end":return e.stop()}}),e,null,[[3,30,33,36],[7,21]])})));return function(t,r,n){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},361:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.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=o},365:function(e,t){},369:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return a})),r.d(t,"b",(function(){return i}));var n,c=window.CustomEvent||null,o=function(e,t){var r=t.bubbles,n=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,i=t.element,s=t.detail,u=void 0===s?{}:s;if(c){i||(i=document.body);var l=new c(e,{bubbles:n,cancelable:a,detail:u});i.dispatchEvent(l)}},a=function(){n&&clearTimeout(n),n=setTimeout((function(){o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)},i=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return function(){};var c=function(){o(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,c),function(){return jQuery(document).off(e,c)}}},37:function(e,t,r){"use strict";r.d(t,"o",(function(){return o})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return i})),r.d(t,"n",(function(){return s})),r.d(t,"j",(function(){return u})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return p})),r.d(t,"g",(function(){return d})),r.d(t,"k",(function(){return b})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return f})),r.d(t,"h",(function(){return O})),r.d(t,"a",(function(){return g})),r.d(t,"i",(function(){return h})),r.d(t,"b",(function(){return v}));var n,c=r(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",i=o.pluginUrl+"build/",s=o.buildPhase,u=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,l=c.STORE_PAGES.checkout.id,p=c.STORE_PAGES.checkout.permalink,d=c.STORE_PAGES.privacy.permalink,b=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),m=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id),f=c.STORE_PAGES.cart.permalink,O=(c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),Object(c.getSetting)("shippingCountries",{})),g=Object(c.getSetting)("allowedCountries",{}),h=Object(c.getSetting)("shippingStates",{}),v=Object(c.getSetting)("allowedStates",{})},371:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8),c=r.n(n),o=r(0),a={bottom:0,left:0,opacity:0,pointerEvents:"none",position:"absolute",right:0,top:0,zIndex:-1},i=function(){var e=Object(o.useState)(""),t=c()(e,2),r=t[0],n=t[1],i=Object(o.useRef)(null),s=Object(o.useRef)(new IntersectionObserver((function(e){e[0].isIntersecting?n("visible"):n(e[0].boundingClientRect.top>0?"below":"above")}),{threshold:1}));return Object(o.useLayoutEffect)((function(){var e=i.current,t=s.current;return e&&t.observe(e),function(){t.unobserve(e)}}),[]),[Object(o.createElement)("div",{"aria-hidden":!0,ref:i,style:a}),r]}},39:function(e,t,r){"use strict";r.d(t,"h",(function(){return b})),r.d(t,"e",(function(){return m})),r.d(t,"b",(function(){return f})),r.d(t,"i",(function(){return O})),r.d(t,"f",(function(){return g})),r.d(t,"c",(function(){return h})),r.d(t,"d",(function(){return v})),r.d(t,"g",(function(){return j})),r.d(t,"a",(function(){return E}));var n=r(5),c=r.n(n),o=r(23),a=r(15),i=r.n(a),s=r(7),u=r(3),l=r(37);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var b=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,u=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=void 0===n?"":n,a=e.queryArgs,i=void 0===a?{}:a,s=l.o.productCount>100,u={per_page:s?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},p=[Object(o.addQueryArgs)("/wc/store/products",d(d({},u),i))];return s&&r.length&&p.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:r,per_page:0})),p}({selected:r,search:c,queryArgs:void 0===a?{}:a});return Promise.all(u.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},m=function(e){return i()({path:"/wc/store/products/".concat(e)})},f=function(){return i()({path:"wc/store/products/attributes"})},O=function(e){return i()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,r=function(e){var t=e.selected,r=void 0===t?[]:t,n=e.search,c=Object(u.getSetting)("limitTags",!1),a=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:c?100:0,orderby:c?"count":"name",order:c?"desc":"asc",search:n})];return c&&r.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:r})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(r.map((function(e){return i()({path:e})}))).then((function(e){return Object(s.uniqBy)(Object(s.flatten)(e),"id")}))},h=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},v=function(e){return i()({path:"wc/store/products/categories/".concat(e)})},j=function(e){return i()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})})},E=function(e,t){if(!e.title.raw)return e.slug;var r=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(r?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(6),i=r.n(a);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t,r=e.label,n=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,s=void 0===a?{}:a,l=null!=r,p=null!=n;return!l&&p?(t=c||"span",s=u(u({},s),{},{className:i()(s.className,"screen-reader-text")}),Object(o.createElement)(t,s,n)):(t=c||o.Fragment,l&&p&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u}));var n=r(29),c=r.n(n),o=r(22),a=r.n(o),i=r(1),s=function(){var e=c()(a.a.mark((function e(t){var r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof t.json){e.next=11;break}return e.prev=1,e.next=4,t.json();case 4:return r=e.sent,e.abrupt("return",{message:r.message,type:r.type||"api"});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{message:e.t0.message,type:"general"});case 11:return e.abrupt("return",{message:t.message,type:t.type||"general"});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x){return e.apply(this,arguments)}}(),u=function(e){if(e.data&&"rest_invalid_param"===e.code){var t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},43:function(e,t,r){"use strict";r.d(t,"a",(function(){return y}));var n=r(8),c=r.n(n),o=r(5),a=r.n(o),i=r(7),s=r(0),u=r(24),l=r(14),p=r(25),d=r(142),b=r(162),m=r(63);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h=O(O({},g),{},{email:""}),v={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:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=function(e){return Object(d.a)(Object.entries(e).map((function(e){var t=c()(e,2),r=t[0],n=t[1];return[r,Object(p.decodeEntities)(n)]})))},E={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:v,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(m.b)(),r=t.isEditor,n=t.previewData,c=null==n?void 0:n.previewCart,o=e.shouldSelect,a=Object(s.useRef)(),p=Object(l.useSelect)((function(e,t){var n=t.dispatch;if(!o)return E;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,extensions:u.EMPTY_EXTENSIONS,shippingRates:c.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:c.has_calculated_shipping,paymentRequirements:c.paymentRequirements,receiveCart:"function"==typeof(null==c?void 0:c.receiveCart)?c.receiveCart:function(){}};var a=e(u.CART_STORE_KEY),i=a.getCartData(),s=a.getCartErrors(),l=a.getCartTotals(),p=!a.hasFinishedResolution("getCartData"),d=a.isCustomerDataUpdating(),m=n(u.CART_STORE_KEY).receiveCart,f=j(i.billingAddress),v=i.needsShipping?j(i.shippingAddress):f,y=i.fees.length>0?i.fees.map((function(e){return j(e)})):u.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map((function(e){return O(O({},e),{},{label:e.code})})):u.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:y,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:l,cartIsLoading:p,cartErrors:s,billingAddress:Object(b.a)(f),shippingAddress:Object(b.a)(v),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:d,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:m}}),[o]);return a.current&&Object(i.isEqual)(a.current,p)||(a.current=p),a.current}},44:function(e,t,r){},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},494:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c),a=(r(2),r(285));r(261),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)(a.a,{className:o()("wc-block-components-sidebar-layout",r)},t)}},495:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c);r(2),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)("div",{className:o()("wc-block-components-main",r)},t)}},496:function(e,t,r){"use strict";var n=r(0),c=r(6),o=r.n(c);r(2),t.a=function(e){var t=e.children,r=e.className;return Object(n.createElement)("div",{className:o()("wc-block-components-sidebar",r)},t)}},497:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(83),a=r(220),i=(r(2),r(27)),s=r(3),u=(r(265),{context:"summary"});t.a=function(e){var t=e.cartCoupons,r=void 0===t?[]:t,l=e.currency,p=e.isRemovingCoupon,d=e.removeCoupon,b=e.values,m=b.total_discount,f=b.total_discount_tax,O=parseInt(m,10);if(!O&&0===r.length)return null;var g=parseInt(f,10),h=Object(s.getSetting)("displayCartPricesIncludingTax",!1)?O+g:O,v=Object(i.__experimentalApplyCheckoutFilter)({arg:u,filterName:"coupons",defaultValue:r});return Object(n.createElement)(i.TotalsItem,{className:"wc-block-components-totals-discount",currency:l,description:0!==v.length&&Object(n.createElement)(o.a,{screenReaderLabel:Object(c.__)("Removing coupon…",'woocommerce'),isLoading:p,showSpinner:!1},Object(n.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map((function(e){return Object(n.createElement)(a.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(c.sprintf)(
|
||
/* translators: %s Coupon code. */
|
||
Object(c.__)("Coupon: %s",'woocommerce'),e.label),disabled:p,onRemove:function(){d(e.code)},radius:"large",ariaLabel:Object(c.sprintf)(
|
||
/* translators: %s is a coupon code. */
|
||
Object(c.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:h?Object(c.__)("Discount",'woocommerce'):Object(c.__)("Coupons",'woocommerce'),value:h?-1*h:"-"})}},498:function(e,t,r){"use strict";var n=r(8),c=r.n(n),o=r(0),a=r(1),i=r(90),s=r(286),u=r(41),l=r(83),p=(r(2),r(21)),d=r(132),b=r(234),m=r(27);r(266),t.a=Object(p.withInstanceId)((function(e){var t=e.instanceId,r=e.isLoading,n=void 0!==r&&r,p=e.initialOpen,f=void 0!==p&&p,O=e.onSubmit,g=void 0===O?function(){}:O,h=Object(o.useState)(""),v=c()(h,2),j=v[0],E=v[1],y=Object(o.useRef)(!1),_=Object(d.b)(),w=_.getValidationError,k=_.getValidationErrorId,S=w("coupon");Object(o.useEffect)((function(){y.current!==n&&(n||!j||S||E(""),y.current=n)}),[n,j,S]);var C="wc-block-components-totals-coupon__input-".concat(t);return Object(o.createElement)(m.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:f,title:Object(o.createElement)(u.a,{label:Object(a.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(a.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},Object(o.createElement)(l.a,{screenReaderLabel:Object(a.__)("Applying coupon…",'woocommerce'),isLoading:n,showSpinner:!1},Object(o.createElement)("div",{className:"wc-block-components-totals-coupon__content"},Object(o.createElement)("form",{className:"wc-block-components-totals-coupon__form"},Object(o.createElement)(s.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(a.__)("Enter code",'woocommerce'),value:j,ariaDescribedBy:k(C),onChange:function(e){E(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),Object(o.createElement)(i.a,{className:"wc-block-components-totals-coupon__button",disabled:n||!j,showSpinner:n,onClick:function(e){e.preventDefault(),g(j)},type:"submit"},Object(a.__)("Apply",'woocommerce'))),Object(o.createElement)(b.a,{propertyName:"coupon",elementId:C}))))}))},50:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return p}));var n,c,o=r(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));var a=function(e,t){return Object(o.b)(e)&&"type"in e&&e.type===t},i=function(e){return a(e,n.SUCCESS)},s=function(e){return a(e,n.ERROR)},u=function(e){return a(e,n.FAIL)},l=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},p=function(){return{responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:i,isErrorResponse:s,isFailResponse:u}}},500:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var n=function(e){return e.length},c=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},501:function(e,t,r){"use strict";var n=r(16),c=r.n(n),o=r(0),a=r(1),i=r(53),s=(r(2),r(27)),u=r(43),l=r(3),p=(r(273),["receiveCart"]);t.a=function(e){var t=e.currency,r=e.values,n=Object(l.getSetting)("taxesEnabled",!0)&&Object(l.getSetting)("displayCartPricesIncludingTax",!1),d=r.total_price,b=r.total_tax,m=Object(u.a)(),f=(m.receiveCart,c()(m,p)),O=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(a.__)("Total",'woocommerce'),extensions:f.extensions,arg:{cart:f}}),g=parseInt(b,10);return Object(o.createElement)(s.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:O,value:parseInt(d,10),description:n&&0!==g&&Object(o.createElement)("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(Object(a.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:Object(o.createElement)(i.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:g})}))})}},502:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{fill:"currentColor",d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}));t.a=o},504:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(0),a=r(286),i=r(9),s=r.n(i),u=r(37),l=r(1),p=r(25),d=r(6),b=r.n(d),m=r(21),f=r(898),O=r(132),g=r(234),h=r(72),v=(r(269),Object(m.withInstanceId)((function(e){var t=e.id,r=e.className,n=e.label,a=e.onChange,i=e.options,s=e.value,u=e.required,p=void 0!==u&&u,d=e.errorMessage,m=void 0===d?Object(l.__)("Please select a value.",'woocommerce'):d,v=e.errorId,j=e.instanceId,E=void 0===j?"0":j,y=e.autoComplete,_=void 0===y?"off":y,w=Object(O.b)(),k=w.getValidationError,S=w.setValidationErrors,C=w.clearValidationError,P=Object(o.useRef)(null),R=t||"control-"+E,x=v||R,N=k(x)||{message:"",hidden:!1};return Object(o.useEffect)((function(){return!p||s?C(x):S(c()({},x,{message:m,hidden:!0})),function(){C(x)}}),[C,s,x,m,p,S]),Object(o.createElement)("div",{id:R,className:b()("wc-block-components-combobox",r,{"is-active":s,"has-error":N.message&&!N.hidden}),ref:P},Object(o.createElement)(f.a,{className:"wc-block-components-combobox-control",label:n,onChange:a,onFilterValueChange:function(e){if(e.length){var t=Object(h.b)(P.current)?P.current.ownerDocument.activeElement:void 0;if(t&&Object(h.b)(P.current)&&P.current.contains(t))return;var r=e.toLocaleUpperCase(),n=i.find((function(e){return e.label.toLocaleUpperCase().startsWith(r)||e.value.toLocaleUpperCase()===r}));n&&a(n.value)}},options:i,value:s||"",allowReset:!1,autoComplete:_,"aria-invalid":N.message&&!N.hidden}),Object(o.createElement)(g.a,{propertyName:x}))}))),j=(r(268),function(e){var t=e.className,r=e.countries,n=e.id,c=e.label,a=e.onChange,i=e.value,s=void 0===i?"":i,u=e.autoComplete,d=void 0===u?"off":u,m=e.required,f=void 0!==m&&m,O=e.errorId,g=e.errorMessage,h=void 0===g?Object(l.__)("Please select a country.",'woocommerce'):g,j=Object(o.useMemo)((function(){return Object.keys(r).map((function(e){return{value:e,label:Object(p.decodeEntities)(r[e])}}))}),[r]);return Object(o.createElement)("div",{className:b()(t,"wc-block-components-country-input")},Object(o.createElement)(v,{id:n,label:c,onChange:a,options:j,value:s,errorId:O,errorMessage:h,required:f,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:s,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),r=j.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));a(r?r.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),E=function(e){return Object(o.createElement)(j,s()({countries:u.h},e))},y=function(e){return Object(o.createElement)(j,s()({countries:u.a},e))},_=(r(270),function(e,t){var r=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return r?r.value:""}),w=function(e){var t=e.className,r=e.id,n=e.states,c=e.country,i=e.label,s=e.onChange,u=e.autoComplete,d=void 0===u?"off":u,m=e.value,f=void 0===m?"":m,O=e.required,g=void 0!==O&&O,h=n[c],j=Object(o.useMemo)((function(){return h?Object.keys(h).map((function(e){return{value:e,label:Object(p.decodeEntities)(h[e])}})):[]}),[h]),E=Object(o.useCallback)((function(e){s(j.length>0?_(e,j):e)}),[s,j]),y=Object(o.useRef)(f);return Object(o.useEffect)((function(){y.current!==f&&(y.current=f)}),[f]),Object(o.useEffect)((function(){if(j.length>0&&y.current){var e=_(y.current,j);e!==y.current&&E(e)}}),[j,E]),j.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(v,{className:b()(t,"wc-block-components-state-input"),id:r,label:i,onChange:E,options:j,value:f,errorMessage:Object(l.__)("Please select a state.",'woocommerce'),required:g,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:f,onChange:function(e){return E(e.target.value)},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1})):Object(o.createElement)(a.a,{className:t,id:r,label:i,onChange:E,autoComplete:d,value:f,required:g})},k=function(e){return Object(o.createElement)(w,s()({states:u.i},e))},S=function(e){return Object(o.createElement)(w,s()({states:u.b},e))},C=r(62),P=r(3),R=r(113);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=Object(m.withInstanceId)((function(e){var t=e.id,r=e.fields,n=void 0===r?Object.keys(P.defaultAddressFields):r,i=e.fieldConfig,s=void 0===i?{}:i,u=e.instanceId,p=e.onChange,d=e.type,b=void 0===d?"shipping":d,m=e.values,f=Object(O.b)(),g=f.getValidationError,h=f.setValidationErrors,v=f.clearValidationError,j=Object(C.a)(n),_=g("shipping-missing-country")||{},w=Object(o.useMemo)((function(){return Object(R.a)(j,s,m.country)}),[j,s,m.country]);return Object(o.useEffect)((function(){w.forEach((function(e){e.hidden&&m[e.key]&&p(N(N({},m),{},c()({},e.key,"")))}))}),[w,p,m]),Object(o.useEffect)((function(){"shipping"===b&&function(e,t,r,n){n||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(l.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),n&&e.country&&r("shipping-missing-country")}(m,h,v,!!_.message&&!_.hidden)}),[m,_.message,_.hidden,h,v,b]),t=t||u,Object(o.createElement)("div",{id:t,className:"wc-block-components-address-form"},w.map((function(e){if(e.hidden)return null;if("country"===e.key){var r="shipping"===b?E:y;return Object(o.createElement)(r,{key:e.key,id:"".concat(t,"-").concat(e.key),label:e.required?e.label:e.optionalLabel,value:m.country,autoComplete:e.autocomplete,onChange:function(e){return p(N(N({},m),{},{country:e,state:""}))},errorId:"shipping"===b?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var n="shipping"===b?k:S;return Object(o.createElement)(n,{key:e.key,id:"".concat(t,"-").concat(e.key),country:m.country,label:e.required?e.label:e.optionalLabel,value:m.state,autoComplete:e.autocomplete,onChange:function(e){return p(N(N({},m),{},{state:e}))},errorMessage:e.errorMessage,required:e.required})}return Object(o.createElement)(a.a,{key:e.key,id:"".concat(t,"-").concat(e.key),className:"wc-block-components-address-form__".concat(e.key),label:e.required?e.label:e.optionalLabel,value:m[e.key],autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,onChange:function(t){return p(N(N({},m),{},c()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},510:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=r(6),u=r.n(s),l=r(1),p=r(43),d=r(27),b=r(3),m=function(e){var t=e.selectedShippingRates;return Object(i.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via",'woocommerce')," ",t.join(", "))},f=r(890),O=r(200),g=function(e){var t=e.hasRates,r=e.shippingRates,n=e.shippingRatesLoading,c=t?Object(l.__)("Shipping options",'woocommerce'):Object(l.__)("Choose a shipping option",'woocommerce');return Object(i.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(i.createElement)("legend",{className:"screen-reader-text"},c),Object(i.createElement)(O.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(i.createElement)(f.a,{isDismissible:!1,className:u()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.",'woocommerce')),shippingRates:r,shippingRatesLoading:n}))},h=r(75),v=r(90),j=r(34),E=r.n(j),y=r(132),_=(r(190),r(504)),w=function(e){var t=e.address,r=e.onUpdate,n=e.addressFields,c=Object(i.useState)(t),o=a()(c,2),s=o[0],u=o[1],p=Object(y.b)(),d=p.hasValidationErrors,b=p.showAllValidationErrors;return Object(i.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(i.createElement)(_.a,{fields:n,onChange:u,values:s}),Object(i.createElement)(v.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:E()(s,t),onClick:function(e){if(e.preventDefault(),b(),!d)return r(s)},type:"submit"},Object(l.__)("Update",'woocommerce')))},k=function(e){var t=e.onUpdate,r=void 0===t?function(){}:t,n=e.addressFields,c=void 0===n?["country","state","city","postcode"]:n,o=Object(h.b)(),a=o.shippingAddress,s=o.setShippingAddress;return Object(i.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(i.createElement)(w,{address:a,addressFields:c,onUpdate:function(e){s(e),r(e)}}))},S=r(38),C=r.n(S),P=r(25),R=function(e){var t=e.address;if(0===Object.values(t).length)return null;var r=Object(b.getSetting)("shippingCountries",{}),n=Object(b.getSetting)("shippingStates",{}),c="string"==typeof r[t.country]?Object(P.decodeEntities)(r[t.country]):"",o="object"===C()(n[t.country])&&"string"==typeof n[t.country][t.state]?Object(P.decodeEntities)(n[t.country][t.state]):t.state,a=[];a.push(t.postcode.toUpperCase()),a.push(t.city),a.push(o),a.push(c);var s=a.filter(Boolean).join(", ");return s?Object(i.createElement)("span",{className:"wc-block-components-shipping-address"},Object(l.sprintf)(
|
||
/* translators: %s location. */
|
||
Object(l.__)("Shipping to %s",'woocommerce'),s)+" "):null},x=(r(267),function(e){var t=e.label,r=void 0===t?Object(l.__)("Calculate",'woocommerce'):t,n=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return Object(i.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){c(!n)},"aria-expanded":n},r)}),N=function(e){var t=e.showCalculator,r=e.isShippingCalculatorOpen,n=e.setIsShippingCalculatorOpen,c=e.shippingAddress;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(R,{address:c}),t&&Object(i.createElement)(x,{label:Object(l.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:r,setIsShippingCalculatorOpen:n}))},I=function(e){var t=e.showCalculator,r=e.isShippingCalculatorOpen,n=e.setIsShippingCalculatorOpen;return t?Object(i.createElement)(x,{isShippingCalculatorOpen:r,setIsShippingCalculatorOpen:n}):Object(i.createElement)("em",null,Object(l.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,r=e.values,n=e.showCalculator,o=void 0===n||n,s=e.showRateSelector,f=void 0===s||s,O=e.className,h=Object(i.useState)(!1),v=a()(h,2),j=v[0],E=v[1],y=Object(p.a)(),_=y.shippingAddress,w=y.cartHasCalculatedShipping,S=y.shippingRates,C=y.shippingRatesLoading,P=Object(b.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(r.total_shipping,10)+parseInt(r.total_shipping_tax,10):parseInt(r.total_shipping,10),R=S.some((function(e){return e.shipping_rates.length}))||P,x={isShippingCalculatorOpen:j,setIsShippingCalculatorOpen:E},T=S.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return Object(i.createElement)("div",{className:u()("wc-block-components-totals-shipping",O)},Object(i.createElement)(d.TotalsItem,{label:Object(l.__)("Shipping",'woocommerce'),value:w?P:Object(i.createElement)(I,c()({showCalculator:o},x)),description:Object(i.createElement)(i.Fragment,null,w&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(m,{selectedShippingRates:T}),Object(i.createElement)(N,c()({shippingAddress:_,showCalculator:o},x)))),currency:t}),o&&j&&Object(i.createElement)(k,{onUpdate:function(){E(!1)}}),f&&w&&Object(i.createElement)(g,{hasRates:R,shippingRates:S,shippingRatesLoading:C}))}},517:function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(8),c=r.n(n),o=r(0),a=r(4),i=r(1),s=r(3),u=r(33),l=r.n(u),p=[],d=r(9),b=r.n(d),m=function(e){return Object(o.createElement)("div",b()({className:"edit-post-welcome-guide__image edit-post-welcome-guide__image__prm-np",style:{display:"flex",justifyContent:"center",alignItems:"center"}},e),Object(o.createElement)("svg",{height:"120",viewBox:"0 0 170 120",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("g",{filter:"url(#filter0_ddd)"},Object(o.createElement)("rect",{x:"5.5",y:"18",width:"159",height:"96",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"24.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"}),Object(o.createElement)("rect",{x:"94.5",y:"4",width:"51",height:"22",rx:"3",fill:"white"})),Object(o.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M48.8908 42H125.078C129.899 42 133.802 45.9231 133.802 50.7692V80C133.802 84.8462 129.899 88.7692 125.078 88.7692H97.756L101.506 98L85.0135 88.7692H48.929C44.1076 88.7692 40.2045 84.8462 40.2045 80V50.7692C40.1662 45.9615 44.0693 42 48.8908 42Z",fill:"#7F54B3"}),Object(o.createElement)("path",{d:"M44.8709 50.723C45.4039 50.0175 46.2033 49.6462 47.2693 49.5719C49.2108 49.4234 50.3149 50.3145 50.5814 52.2453C51.7615 60.0056 53.0559 66.5778 54.4264 71.9617L62.7637 56.4782C63.5251 55.0673 64.4768 54.3246 65.6189 54.2504C67.294 54.139 68.3219 55.1786 68.7406 57.3694C69.6924 62.3077 70.9106 66.5035 72.3573 70.0681C73.3471 60.6369 75.0222 53.8419 77.3825 49.6462C77.9535 48.6065 78.7911 48.0867 79.8951 48.0124C80.7707 47.9382 81.5702 48.1981 82.2935 48.755C83.0168 49.312 83.3975 50.0175 83.4736 50.8715C83.5117 51.5398 83.3975 52.0968 83.0929 52.6538C81.6082 55.3272 80.39 59.82 79.4002 66.0579C78.4484 72.1102 78.1058 76.8258 78.3342 80.2047C78.4104 81.133 78.2581 81.9499 77.8774 82.6553C77.4205 83.4722 76.7353 83.9178 75.8597 83.9921C74.8699 84.0663 73.842 83.6207 72.8522 82.6182C69.3117 79.0908 66.4945 73.8183 64.4388 66.8006C61.9642 71.5533 60.1369 75.1178 58.9567 77.4942C56.7106 81.69 54.8071 83.8435 53.2082 83.9549C52.1803 84.0292 51.3047 83.1752 50.5433 81.3929C48.6017 76.5288 46.5079 67.1347 44.2618 53.2107C44.1476 52.2453 44.3379 51.3913 44.8709 50.723Z",fill:"white"}),Object(o.createElement)("path",{d:"M126.922 56.5426C125.536 54.1968 123.495 52.7819 120.761 52.2234C120.029 52.0745 119.336 52 118.681 52C114.985 52 111.981 53.8617 109.632 57.5851C107.63 60.75 106.629 64.25 106.629 68.0851C106.629 70.9521 107.245 73.4096 108.477 75.4574C109.863 77.8032 111.904 79.2181 114.638 79.7766C115.37 79.9255 116.063 80 116.717 80C120.453 80 123.456 78.1383 125.767 74.4149C127.769 71.2128 128.77 67.7128 128.77 63.8777C128.77 60.9734 128.154 58.5532 126.922 56.5426ZM122.07 66.8564C121.531 69.3138 120.568 71.1383 119.143 72.367C118.027 73.3351 116.987 73.7447 116.024 73.5585C115.1 73.3723 114.33 72.5904 113.752 71.1383C113.29 69.984 113.059 68.8298 113.059 67.75C113.059 66.8192 113.136 65.8883 113.329 65.0319C113.675 63.5053 114.33 62.016 115.37 60.6011C116.64 58.7766 117.988 58.0319 119.374 58.2925C120.299 58.4787 121.069 59.2606 121.646 60.7128C122.108 61.867 122.339 63.0213 122.339 64.1011C122.339 65.0691 122.224 66 122.07 66.8564Z",fill:"white"}),Object(o.createElement)("path",{d:"M102.767 56.5426C101.381 54.1968 99.3018 52.7819 96.6063 52.2234C95.8747 52.0745 95.1816 52 94.5269 52C90.8303 52 87.8267 53.8617 85.4778 57.5851C83.4755 60.75 82.4743 64.25 82.4743 68.0851C82.4743 70.9521 83.0904 73.4096 84.3226 75.4574C85.7089 77.8032 87.7497 79.2181 90.4837 79.7766C91.2153 79.9255 91.9085 80 92.5631 80C96.2983 80 99.3018 78.1383 101.612 74.4149C103.615 71.2128 104.616 67.7128 104.616 63.8777C104.616 60.9734 104 58.5532 102.767 56.5426ZM97.9155 66.8564C97.3765 69.3138 96.4138 71.1383 94.989 72.367C93.8723 73.3351 92.8326 73.7447 91.87 73.5585C90.9458 73.3723 90.1757 72.5904 89.5981 71.1383C89.136 69.984 88.9049 68.8298 88.9049 67.75C88.9049 66.8192 88.9819 65.8883 89.1745 65.0319C89.521 63.5053 90.1757 62.016 91.2153 60.6011C92.4861 58.7766 93.8338 58.0319 95.2201 58.2925C96.1442 58.4787 96.9144 59.2606 97.492 60.7128C97.9541 61.867 98.1851 63.0213 98.1851 64.1011C98.1851 65.0691 98.1081 66 97.9155 66.8564Z",fill:"white"}),Object(o.createElement)("defs",null,Object(o.createElement)("filter",{id:"filter0_ddd",x:"0.5",y:"0",width:"169",height:"120",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},Object(o.createElement)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"1"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"2.5"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect1_dropShadow",result:"effect2_dropShadow"}),Object(o.createElement)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Object(o.createElement)("feOffset",{dy:"2"}),Object(o.createElement)("feGaussianBlur",{stdDeviation:"1"}),Object(o.createElement)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.14 0"}),Object(o.createElement)("feBlend",{mode:"normal",in2:"effect2_dropShadow",result:"effect3_dropShadow"}),Object(o.createElement)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow",result:"shape"})))))};function f(e){var t=function(e){var t=function(e,t){var r=Object(o.useState)((function(){var r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch(t){console.error("Value for key '".concat(e,"' could not be retrieved from localStorage because it can't be parsed."))}return t})),n=c()(r,2),a=n[0],i=n[1];return Object(o.useEffect)((function(){try{window.localStorage.setItem(e,JSON.stringify(a))}catch(t){console.error("Value for key '".concat(e,"' could not be saved in localStorage because it can't be converted into a string."))}}),[e,a]),[a,i]}("wc-blocks_dismissed_compatibility_notices",p),r=c()(t,2),n=r[0],a=r[1],i=Object(o.useState)(!1),s=c()(i,2),u=s[0],d=s[1],b=n.includes(e);return Object(o.useEffect)((function(){d(!b)}),[b]),[u,function(){var t=new Set(n);t.add(e),a(l()(t))}]}(e.blockName),r=c()(t,2),n=r[0],u=r[1];return Object(s.isWpVersion)("5.4","<=")||!n?null:Object(o.createElement)(a.Guide,{className:"edit-post-welcome-guide",contentLabel:Object(i.__)("Compatibility notice",'woocommerce'),onFinish:function(){return u()},finishButtonText:Object(i.__)("Got it!",'woocommerce'),pages:[{image:Object(o.createElement)(m,null),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-post-welcome-guide__heading"},Object(i.__)("Compatibility notice",'woocommerce')),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(i.__)("This block may not be compatible with <em>all</em> checkout extensions and integrations.",'woocommerce'),{em:Object(o.createElement)("em",null)})),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(i.__)("We recommend reviewing our <a>expanding list</a> of compatible extensions prior to using this block on a live store.",'woocommerce'),{a:Object(o.createElement)("a",{href:"https://docs.woocommerce.com/document/cart-checkout-blocks-support-status/",target:"_blank",rel:"noopener noreferrer"})})))}]})}},518:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(1),c=r(37),o=r(3),a=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(n.__)("Shipping",'woocommerce'),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(n._x)("Beanie with Logo","example product in Cart Block",'woocommerce'),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(n._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(n.__)("Free shipping",'woocommerce'),description:"",delivery_time:"",price:"000",taxes:"0",rate_id:"free_shipping:1",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(n.__)("Local pickup",'woocommerce'),description:"",delivery_time:"",price:"200",taxes:"0",rate_id:"local_pickup:1",instance_id:1,meta_data:[],method_id:"local_pickup",selected:!1}]}],i=Object(o.getSetting)("displayCartPricesIncludingTax",!1),s={coupons:[],shipping_rates:Object(o.getSetting)("shippingMethodsExist",!1)?a:[],items:[{key:"1",id:1,quantity:2,name:Object(n.__)("Beanie",'woocommerce'),short_description:Object(n.__)("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,images:[{id:10,src:c.m+"previews/beanie.jpg",thumbnail:c.m+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(n.__)("Color",'woocommerce'),value:Object(n.__)("Yellow",'woocommerce')},{attribute:Object(n.__)("Size",'woocommerce'),value:Object(n.__)("Small",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:i?"800":"640",regular_price:i?"800":"640",sale_price:i?"800":"640",raw_prices:{precision:6,price:i?"8000000":"6400000",regular_price:i?"8000000":"6400000",sale_price:i?"8000000":"6400000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:i?"1600":"1280",line_subtotal_tax:"0",line_total:"1600",line_total_tax:i?"0":"320"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(n.__)("Cap",'woocommerce'),short_description:Object(n.__)("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",permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,images:[{id:11,src:c.m+"previews/cap.jpg",thumbnail:c.m+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(n.__)("Color",'woocommerce'),value:Object(n.__)("Orange",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:i?"1400":"1120",regular_price:i?"1600":"1280",sale_price:i?"1400":"1120",raw_prices:{precision:6,price:i?"14000000":"11200000",regular_price:i?"16000000":"12800000",sale_price:i?"14000000":"11200000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:i?"1400":"1120",line_subtotal_tax:i?"0":"280",line_total:"1400",line_total_tax:i?"0":"280"},extensions:{}}],fees:[],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(o.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:i?"3000":"2400",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"600",total_price:"3000",tax_lines:[{name:Object(n.__)("Sales tax",'woocommerce'),rate:"20%",price:600}]},errors:[],payment_requirements:["products"],generated_timestamp:Date.now(),extensions:{}}},53:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(5),a=r.n(o),i=r(16),s=r.n(i),u=r(0),l=r(166),p=r(6),d=r.n(p),b=(r(175),["className","value","currency","onValueChange","displayType"]);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){a()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.className,r=e.value,n=e.currency,o=e.onValueChange,a=e.displayType,i=void 0===a?"text":a,p=s()(e,b),m="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(m))return null;var O=m/Math.pow(10,n.minorUnit);if(!Number.isFinite(O))return null;var g=d()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=f(f(f({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(n)),{},{value:void 0,currency:void 0,onValueChange:void 0}),v=o?function(e){var t=e.value*Math.pow(10,n.minorUnit);o(t)}:function(){};return Object(u.createElement)(l.a,c()({className:g,displayType:i},h,{value:O,onValueChange:v}))}},547:function(e){e.exports=JSON.parse('{"name":"woocommerce/filled-cart-block","version":"1.0.0","title":"Filled Cart","description":"Contains blocks that are displayed when the cart contains products.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-i2"],"textdomain":'woocommerce',"apiVersion":2}')},548:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-items-block","version":"1.0.0","title":"Cart Items block","description":"Column containing cart items.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":'woocommerce',"apiVersion":2}')},549:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-line-items-block","version":"1.0.0","title":"Cart Line Items","description":"Block containing current line items in Cart.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-items-block"],"textdomain":'woocommerce',"apiVersion":2}')},55:function(e,t){e.exports=window.wp.hooks},550:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-totals-block","version":"1.0.0","title":"Cart Totals","description":"Column containing the cart totals.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false},"lock":{"type":"object","default":{"remove":true}}},"parent":["woocommerce/filled-cart-block"],"textdomain":'woocommerce',"apiVersion":2}')},551:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-order-summary-block","version":"1.0.0","title":"Order Summary","description":"Show customers a summary of their order.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},552:function(e){e.exports=JSON.parse('{"name":"woocommerce/cart-express-payment-block","version":"1.0.0","title":"Express Checkout","description":"Provide an express payment option for your customers.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},553:function(e){e.exports=JSON.parse('{"name":"woocommerce/proceed-to-checkout-block","version":"1.0.0","title":"Proceed to checkout","description":"Allow customers proceed to Checkout.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},554:function(e,t,r){"use strict";(function(e){var n=r(8),c=r.n(n),o=r(0),a=r(1),i=r(169),s=r(90),u=r(37),l=r(57),p=r(163),d=r(371),b=(r(846),function(e){return Object.values(e).reduce((function(e,t){return null!==t.icons&&(e=e.concat(t.icons)),e}),[])});t.a=function(t){var r=t.link,n=Object(l.b)().isCalculating,m=Object(d.a)(),f=c()(m,2),O=f[0],g=f[1],h=Object(o.useState)(!1),v=c()(h,2),j=v[0],E=v[1],y=Object(p.b)().paymentMethods;Object(o.useEffect)((function(){if("function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener){var t=function(){E(!1)};return e.addEventListener("pageshow",t),function(){e.removeEventListener("pageshow",t)}}}),[]);var _=Object(o.createElement)(o.Fragment,null,Object(o.createElement)(s.a,{className:"wc-block-cart__submit-button",href:r||u.f,disabled:n,onClick:function(){return E(!0)},showSpinner:j},Object(a.__)("Proceed to Checkout",'woocommerce')),Object(o.createElement)(i.a,{icons:b(y)}));return Object(o.createElement)("div",{className:"wc-block-cart__submit"},O,Object(o.createElement)("div",{className:"wc-block-cart__submit-container"},_),"below"===g&&Object(o.createElement)("div",{className:"wc-block-cart__submit-container wc-block-cart__submit-container--sticky"},_))}}).call(this,r(225))},555:function(e){e.exports=JSON.parse('{"name":"woocommerce/empty-cart-block","version":"1.0.0","title":"Empty Cart","description":"Contains blocks that are displayed when the cart is empty.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/cart-i2"],"textdomain":'woocommerce',"apiVersion":2}')},56:function(e,t){e.exports=window.wp.deprecated},57:function(e,t,r){"use strict";r.d(t,"b",(function(){return L})),r.d(t,"a",(function(){return B}));var n,c=r(8),o=r.n(c),a=r(0),i=r(1),s=r(136),u=r(56),l=r.n(u),p=r(72);!function(e){e.SET_IDLE="set_idle",e.SET_PRISTINE="set_pristine",e.SET_REDIRECT_URL="set_redirect_url",e.SET_COMPLETE="set_checkout_complete",e.SET_BEFORE_PROCESSING="set_before_processing",e.SET_AFTER_PROCESSING="set_after_processing",e.SET_PROCESSING_RESPONSE="set_processing_response",e.SET_PROCESSING="set_checkout_is_processing",e.SET_HAS_ERROR="set_checkout_has_error",e.SET_NO_ERROR="set_checkout_no_error",e.SET_CUSTOMER_ID="set_checkout_customer_id",e.SET_ORDER_ID="set_checkout_order_id",e.SET_ORDER_NOTES="set_checkout_order_notes",e.INCREMENT_CALCULATING="increment_calculating",e.DECREMENT_CALCULATING="decrement_calculating",e.SET_SHOULD_CREATE_ACCOUNT="set_should_create_account",e.SET_EXTENSION_DATA="set_extension_data"}(n||(n={}));var d,b,m=function(){return{type:n.SET_IDLE}},f=function(e){return{type:n.SET_REDIRECT_URL,redirectUrl:e}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:n.SET_COMPLETE,data:e}},g=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?n.SET_HAS_ERROR:n.SET_NO_ERROR}},h=r(5),v=r.n(h),j=r(3);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}!function(e){e.PRISTINE="pristine",e.IDLE="idle",e.PROCESSING="processing",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.AFTER_PROCESSING="after_processing"}(b||(b={}));var y=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){v()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({order_id:0,customer_id:0},(null===(d=Object(j.getSetting)("preloadedApiRequests",{})["/wc/store/checkout"])||void 0===d?void 0:d.body)||{}),_={redirectUrl:"",status:b.PRISTINE,hasError:!1,calculatingCount:0,orderId:y.order_id,orderNotes:"",customerId:y.customer_id,shouldCreateAccount:!1,processingResponse:null,extensionData:{}};function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){v()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_,t=arguments.length>1?arguments[1]:void 0,r=t.redirectUrl,c=t.type,o=t.customerId,a=t.orderId,i=t.orderNotes,s=t.extensionData,u=t.shouldCreateAccount,l=t.data,p=e;switch(c){case n.SET_PRISTINE:p=_;break;case n.SET_IDLE:p=e.status!==b.IDLE?k(k({},e),{},{status:b.IDLE}):e;break;case n.SET_REDIRECT_URL:p=void 0!==r&&r!==e.redirectUrl?k(k({},e),{},{redirectUrl:r}):e;break;case n.SET_PROCESSING_RESPONSE:p=k(k({},e),{},{processingResponse:l});break;case n.SET_COMPLETE:p=e.status!==b.COMPLETE?k(k({},e),{},{status:b.COMPLETE,redirectUrl:void 0!==l&&"string"==typeof l.redirectUrl&&l.redirectUrl?l.redirectUrl:e.redirectUrl}):e;break;case n.SET_PROCESSING:p=!1===(p=e.status!==b.PROCESSING?k(k({},e),{},{status:b.PROCESSING,hasError:!1}):e).hasError?p:k(k({},p),{},{hasError:!1});break;case n.SET_BEFORE_PROCESSING:p=e.status!==b.BEFORE_PROCESSING?k(k({},e),{},{status:b.BEFORE_PROCESSING,hasError:!1}):e;break;case n.SET_AFTER_PROCESSING:p=e.status!==b.AFTER_PROCESSING?k(k({},e),{},{status:b.AFTER_PROCESSING}):e;break;case n.SET_HAS_ERROR:p=e.hasError?e:k(k({},e),{},{hasError:!0}),p=e.status===b.PROCESSING||e.status===b.BEFORE_PROCESSING?k(k({},p),{},{status:b.IDLE}):p;break;case n.SET_NO_ERROR:p=e.hasError?k(k({},e),{},{hasError:!1}):e;break;case n.INCREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:e.calculatingCount+1});break;case n.DECREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case n.SET_CUSTOMER_ID:p=void 0!==o?k(k({},e),{},{customerId:o}):e;break;case n.SET_ORDER_ID:p=void 0!==a?k(k({},e),{},{orderId:a}):e;break;case n.SET_SHOULD_CREATE_ACCOUNT:void 0!==u&&u!==e.shouldCreateAccount&&(p=k(k({},e),{},{shouldCreateAccount:u}));break;case n.SET_ORDER_NOTES:void 0!==i&&e.orderNotes!==i&&(p=k(k({},e),{},{orderNotes:i}));break;case n.SET_EXTENSION_DATA:void 0!==s&&e.extensionData!==s&&(p=k(k({},e),{},{extensionData:s}))}return p!==e&&c!==n.SET_PRISTINE&&p.status===b.PRISTINE&&(p.status=b.IDLE),p},C=r(25),P=r(126),R=r(321),x=r(322),N=r(132),I=r(59),T=r(68),M=r(14),A=r(50),D=Object(a.createContext)({dispatchActions:{resetCheckout:function(){},setRedirectUrl:function(e){},setHasError:function(e){},setAfterProcessing:function(e){},incrementCalculating:function(){},decrementCalculating:function(){},setCustomerId:function(e){},setOrderId:function(e){},setOrderNotes:function(e){},setExtensionData:function(e){}},onSubmit:function(){},isComplete:!1,isIdle:!1,isCalculating:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,redirectUrl:"",orderId:0,orderNotes:"",customerId:0,onCheckoutAfterProcessingWithSuccess:function(){return function(){}},onCheckoutAfterProcessingWithError:function(){return function(){}},onCheckoutBeforeProcessing:function(){return function(){}},onCheckoutValidationBeforeProcessing:function(){return function(){}},hasOrder:!1,isCart:!1,shouldCreateAccount:!1,setShouldCreateAccount:function(e){},extensionData:{}}),L=function(){return Object(a.useContext)(D)},B=function(e){var t=e.children,r=e.redirectUrl,c=e.isCart,u=void 0!==c&&c;_.redirectUrl=r;var d,h=Object(a.useReducer)(S,_),v=o()(h,2),j=v[0],E=v[1],y=Object(N.b)().setValidationErrors,w=Object(I.a)(),k=w.addErrorNotice,L=w.removeNotices,B=Object(T.a)().dispatchCheckoutEvent,V=j.calculatingCount>0,F=Object(A.c)(),U=F.isSuccessResponse,z=F.isErrorResponse,G=F.isFailResponse,q=F.shouldRetry,H=(d=Object(A.c)().noticeContexts,{checkoutNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices(d.EXPRESS_PAYMENTS)}),[d.EXPRESS_PAYMENTS]),paymentNotices:Object(M.useSelect)((function(e){return e("core/notices").getNotices(d.PAYMENTS)}),[d.PAYMENTS])}),Y=H.checkoutNotices,W=H.paymentNotices,$=H.expressPaymentNotices,K=Object(a.useReducer)(P.b,{}),X=o()(K,2),Q=X[0],J=X[1],Z=Object(a.useRef)(Q),ee=function(e){return Object(a.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(R.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(R.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(R.a)("checkout_validation_before_processing",e)}}),[e])}(J),te=ee.onCheckoutAfterProcessingWithSuccess,re=ee.onCheckoutAfterProcessingWithError,ne=ee.onCheckoutValidationBeforeProcessing;Object(a.useEffect)((function(){Z.current=Q}),[Q]);var ce=Object(a.useMemo)((function(){return function(){return l()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),ne.apply(void 0,arguments)}}),[ne]),oe=Object(a.useMemo)((function(){return{resetCheckout:function(){E({type:n.SET_PRISTINE})},setRedirectUrl:function(e){E(f(e))},setHasError:function(e){E(g(e))},incrementCalculating:function(){E({type:n.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:n.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:n.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:n.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:n.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:n.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,r=function(e){var t={message:"",paymentStatus:"",redirectUrl:"",paymentDetails:{}};return"payment_result"in e&&(t.paymentStatus=e.payment_result.payment_status,t.redirectUrl=e.payment_result.redirect_url,e.payment_result.hasOwnProperty("payment_details")&&Array.isArray(e.payment_result.payment_details)&&e.payment_result.payment_details.forEach((function(e){var r=e.key,n=e.value;t.paymentDetails[r]=Object(C.decodeEntities)(n)}))),"message"in e&&(t.message=Object(C.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);r.redirectUrl&&E(f(r.redirectUrl)),E((t=r,{type:n.SET_PROCESSING_RESPONSE,data:t})),E({type:n.SET_AFTER_PROCESSING})}}}),[]);Object(a.useEffect)((function(){j.status===b.BEFORE_PROCESSING&&(L("error"),Object(x.a)(Z.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,r=e.validationErrors;k(t),y(r)})),E(m()),E(g())):E({type:n.SET_PROCESSING})})))}),[j.status,y,k,L,E]);var ae=Object(s.a)(j.status),ie=Object(s.a)(j.hasError);Object(a.useEffect)((function(){if((j.status!==ae||j.hasError!==ie)&&j.status===b.AFTER_PROCESSING){var e={redirectUrl:j.redirectUrl,orderId:j.orderId,customerId:j.customerId,orderNotes:j.orderNotes,processingResponse:j.processingResponse};j.hasError?Object(x.b)(Z.current,"checkout_after_processing_with_error",e).then((function(t){var r=function(e){var t=null;return e.forEach((function(e){if((z(e)||G(e))&&e.message){var r=e.messageContext?{context:e.messageContext}:void 0;t=e,k(e.message,r)}})),t}(t);if(null!==r)q(r)?E(m()):E(O(r));else{if(!(Y.some((function(e){return"error"===e.status}))||$.some((function(e){return"error"===e.status}))||W.some((function(e){return"error"===e.status})))){var n,c=(null===(n=e.processingResponse)||void 0===n?void 0:n.message)||Object(i.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');k(c,{id:"checkout"})}E(m())}})):Object(x.b)(Z.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,r=null;if(e.forEach((function(e){U(e)&&(t=e),(z(e)||G(e))&&(r=e)})),t&&!r)E(O(t));else if(Object(p.b)(r)){if(r.message){var n=r.messageContext?{context:r.messageContext}:void 0;k(r.message,n)}q(r)?E(g(!0)):E(O(r))}else E(O())}))}}),[j.status,j.hasError,j.redirectUrl,j.orderId,j.customerId,j.orderNotes,j.processingResponse,ae,ie,oe,k,z,G,U,q,Y,$,W]);var se={onSubmit:Object(a.useCallback)((function(){B("submit"),E({type:n.SET_BEFORE_PROCESSING})}),[B]),isComplete:j.status===b.COMPLETE,isIdle:j.status===b.IDLE,isCalculating:V,isProcessing:j.status===b.PROCESSING,isBeforeProcessing:j.status===b.BEFORE_PROCESSING,isAfterProcessing:j.status===b.AFTER_PROCESSING,hasError:j.hasError,redirectUrl:j.redirectUrl,onCheckoutBeforeProcessing:ce,onCheckoutValidationBeforeProcessing:ne,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:re,dispatchActions:oe,isCart:u,orderId:j.orderId,hasOrder:!!j.orderId,customerId:j.customerId,orderNotes:j.orderNotes,shouldCreateAccount:j.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:n.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:j.extensionData};return Object(a.createElement)(D.Provider,{value:se},t)}},59:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(5),c=r.n(n),o=r(0),a=r(141);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=function(){var e=Object(a.b)(),t=e.notices,r=e.createNotice,n=e.removeNotice,c=e.setIsSuppressed,i=Object(o.useRef)(t);Object(o.useEffect)((function(){i.current=t}),[t]);var u=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return i.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.current.forEach((function(t){null!==e&&t.status!==e||n(t.id)}))},removeNotice:n}}),[n]),l=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("default",e,s({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("error",e,s({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("warning",e,s({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("info",e,s({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r("success",e,s({},t))}}}),[r]);return s(s(s({notices:t},u),l),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0),c=r(34),o=r.n(c);function a(e){var t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(14),o=Object(n.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(n.useContext)(o)},i=function(e){var t=e.children,r=e.currentPostId,a=void 0===r?0:r,i=e.previewData,s=void 0===i?{}:i,u=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),l=Object(n.useCallback)((function(e){return e in s?s[e]:{}}),[s]),p={isEditor:!0,currentPostId:u,previewData:s,getPreviewData:l};return Object(n.createElement)(o.Provider,{value:p},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,r){"use strict";var n=r(5),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=["srcElement","size"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.srcElement,r=e.size,n=void 0===r?24:r,o=a()(e,s);return Object(i.isValidElement)(t)?Object(i.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({width:n,height:n},o)):null}},67:function(e,t,r){"use strict";r.d(t,"b",(function(){return _})),r.d(t,"a",(function(){return w}));var n=r(8),c=r.n(n),o=r(0),a=r(3),i=r(5),s=r.n(i),u=r(14),l=r(24),p=r(287),d=r(34),b=r.n(d),m=r(162),f=r(42),O=r(43),g=r(59);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){s()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(e,t){return!(!function(e){return"email"in e}(t)||Object(m.c)(t)===Object(m.c)(e))||!!t.country&&!b()(Object(m.b)(e),Object(m.b)(t))},E=r(57),y=Object(o.createContext)({billingData:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},setBillingData:function(){return null},setShippingAddress:function(){return null},shippingAsBilling:!0,setShippingAsBilling:function(){return null}}),_=function(){return Object(o.useContext)(y)},w=function(e){var t=e.children,r=function(){var e=Object(u.useDispatch)(l.CART_STORE_KEY).updateCustomerData,t=Object(g.a)(),r=t.addErrorNotice,n=t.removeNotice,a=Object(O.a)(),i=a.billingAddress,s=a.shippingAddress,d=Object(o.useState)({billingData:i,shippingAddress:s}),m=c()(d,2),h=m[0],E=m[1],y=Object(o.useRef)(h),_=Object(p.a)(h,1e3,{equalityFn:function(e,t){return b()(e.billingData,t.billingData)&&b()(e.shippingAddress,t.shippingAddress)}}),w=c()(_,1)[0],k=Object(o.useCallback)((function(e){E((function(t){return v(v({},t),{},{billingData:v(v({},t.billingData),e)})}))}),[]),S=Object(o.useCallback)((function(e){E((function(t){return v(v({},t),{},{shippingAddress:v(v({},t.shippingAddress),e)})}))}),[]);return Object(o.useEffect)((function(){(j(y.current.billingData,w.billingData)||j(y.current.shippingAddress,w.shippingAddress))&&(y.current=w,e({billing_address:w.billingData,shipping_address:w.shippingAddress}).then((function(){n("checkout")})).catch((function(e){r(Object(f.b)(e),{id:"checkout"})})))}),[w,r,n,e]),{billingData:h.billingData,shippingAddress:h.shippingAddress,setBillingData:k,setShippingAddress:S}}(),n=r.billingData,i=r.shippingAddress,s=r.setBillingData,d=r.setShippingAddress,m=Object(O.a)().cartNeedsShipping,h=Object(E.b)().customerId,_=Object(o.useState)((function(){return m&&(!h||(e=i,t=n,Object.keys(a.defaultAddressFields).every((function(r){return e[r]===t[r]}))));var e,t})),w=c()(_,2),k=w[0],S=w[1],C={billingData:n,shippingAddress:i,setBillingData:s,setShippingAddress:d,shippingAsBilling:k,setShippingAsBilling:S};return Object(o.createElement)(y.Provider,{value:C},t)}},68:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(5),c=r.n(n),o=r(55),a=r(0),i=r(43);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=function(){var e=Object(i.a)(),t=Object(a.useRef)(e);return Object(a.useEffect)((function(){t.current=e}),[e]),{dispatchStoreEvent:Object(a.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-".concat(e),t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(a.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),u(u({},r),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return o})),r.d(t,"d",(function(){return a}));var n=function(e){return"number"==typeof e},c=function(e){return"string"==typeof e},o=function(e){return!function(e){return null===e}(e)&&e instanceof Object&&e.constructor===Object};function a(e,t){return o(e)&&t in e}},74:function(e,t){e.exports=window.wp.dom},75:function(e,t,r){"use strict";r.d(t,"b",(function(){return R})),r.d(t,"a",(function(){return x}));var n=r(5),c=r.n(n),o=r(8),a=r.n(o),i=r(0),s=r(34),u=r.n(s),l=r(142),p=function(e){return Object(l.a)(e.map((function(e){var t;return[e.package_id,null===(t=e.shipping_rates.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id]})))},d={NONE:"none",INVALID_ADDRESS:"invalid_address",UNKNOWN:"unknown_error"},b={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"},m={shippingErrorStatus:{isPristine:!0,isValid:!1,hasInvalidAddress:!1,hasError:!1},dispatchErrorStatus:function(){return null},shippingErrorTypes:d,shippingRates:[],shippingRatesLoading:!1,selectedRates:[],setSelectedRates:function(){return null},shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},setShippingAddress:function(){return null},onShippingRateSuccess:function(){return null},onShippingRateFail:function(){return null},onShippingRateSelectSuccess:function(){return null},onShippingRateSelectFail:function(){return null},needsShipping:!1},f=function(e,t){var r=t.type;return Object.values(d).includes(r)?r:e},O=r(126),g=r(321),h=function(e){return{onSuccess:Object(g.a)("shipping_rates_success",e),onFail:Object(g.a)("shipping_rates_fail",e),onSelectSuccess:Object(g.a)("shipping_rate_select_success",e),onSelectFail:Object(g.a)("shipping_rate_select_fail",e)}},v=r(322),j=r(57),E=r(67),y=r(43),_=r(134);function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var k=d.NONE,S=d.INVALID_ADDRESS,C=d.UNKNOWN,P=Object(i.createContext)(m),R=function(){return Object(i.useContext)(P)},x=function(e){var t=e.children,r=Object(j.b)().dispatchActions,n=Object(E.b)(),o=n.shippingAddress,s=n.setShippingAddress,l=Object(y.a)(),m=l.cartNeedsShipping,g=l.cartHasCalculatedShipping,R=l.shippingRates,x=l.shippingRatesLoading,N=l.cartErrors,I=Object(_.a)(),T=I.selectShippingRate,M=I.isSelectingRate,A=Object(i.useReducer)(f,k),D=a()(A,2),L=D[0],B=D[1],V=Object(i.useReducer)(O.b,{}),F=a()(V,2),U=F[0],z=F[1],G=Object(i.useRef)(U),q=Object(i.useMemo)((function(){return{onShippingRateSuccess:h(z).onSuccess,onShippingRateFail:h(z).onFail,onShippingRateSelectSuccess:h(z).onSelectSuccess,onShippingRateSelectFail:h(z).onSelectFail}}),[z]);Object(i.useEffect)((function(){G.current=U}),[U]);var H=Object(i.useRef)((function(){return p(R)}));Object(i.useEffect)((function(){var e=p(R);u()(H.current,e)||(H.current=e)}),[R]),Object(i.useEffect)((function(){x?r.incrementCalculating():r.decrementCalculating()}),[x,r]),Object(i.useEffect)((function(){M?r.incrementCalculating():r.decrementCalculating()}),[M,r]),Object(i.useEffect)((function(){N.length>0&&N.some((function(e){return!(!e.code||!Object.values(b).includes(e.code))}))?B({type:S}):B({type:k})}),[N]);var Y=Object(i.useMemo)((function(){return{isPristine:L===k,isValid:L===k,hasInvalidAddress:L===S,hasError:L===C||L===S}}),[L]);Object(i.useEffect)((function(){x||0!==R.length&&!Y.hasError||Object(v.a)(G.current,"shipping_rates_fail",{hasInvalidAddress:Y.hasInvalidAddress,hasError:Y.hasError})}),[R,x,Y.hasError,Y.hasInvalidAddress]),Object(i.useEffect)((function(){!x&&R.length>0&&!Y.hasError&&Object(v.a)(G.current,"shipping_rates_success",R)}),[R,x,Y.hasError]),Object(i.useEffect)((function(){M||(Y.hasError?Object(v.a)(G.current,"shipping_rate_select_fail",{hasError:Y.hasError,hasInvalidAddress:Y.hasInvalidAddress}):Object(v.a)(G.current,"shipping_rate_select_success",H.current))}),[M,Y.hasError,Y.hasInvalidAddress]);var W=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){c()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({shippingErrorStatus:Y,dispatchErrorStatus:B,shippingErrorTypes:d,shippingRates:R,shippingRatesLoading:x,selectedRates:H.current,setSelectedRates:T,isSelectingRate:M,shippingAddress:o,setShippingAddress:s,needsShipping:m,hasCalculatedShipping:g},q);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.Provider,{value:W},t))}},812:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),c=r(235),o=function(e){var t=e.children,r=e.redirectUrl;return Object(n.createElement)(c.a,{isCart:!0,redirectUrl:r},t)}},814:function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var n=r(8),c=r.n(n),o=r(14),a=r(0),i=r(24),s=r(287),u=r(136),l=r(369),p=r(72),d=r(43),b=r(57),m=function(e){var t={key:"",quantity:1};(function(e){return Object(p.b)(e)&&Object(p.d)(e,"key")&&Object(p.d)(e,"quantity")&&Object(p.c)(e.key)&&Object(p.a)(e.quantity)})(e)&&(t.key=e.key,t.quantity=e.quantity);var r=t.key,n=void 0===r?"":r,m=t.quantity,f=void 0===m?1:m,O=Object(d.a)().cartErrors,g=Object(b.b)().dispatchActions,h=Object(a.useState)(f),v=c()(h,2),j=v[0],E=v[1],y=Object(s.a)(j,400),_=c()(y,1)[0],w=Object(u.a)(_),k=Object(o.useDispatch)(i.CART_STORE_KEY),S=k.removeItemFromCart,C=k.changeCartItemQuantity,P=Object(o.useSelect)((function(e){if(!n)return{quantity:!1,delete:!1};var t=e(i.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(n),delete:t.isItemPendingDelete(n)}}),[n]),R=Object(a.useCallback)((function(){return n?S(n).then((function(){return Object(l.c)(),!0})):Promise.resolve(!1)}),[n,S]);return Object(a.useEffect)((function(){n&&Object(p.a)(w)&&Number.isFinite(w)&&w!==_&&C(n,_)}),[n,C,_,w]),Object(a.useEffect)((function(){return P.delete?g.incrementCalculating():g.decrementCalculating(),function(){P.delete&&g.decrementCalculating()}}),[g,P.delete]),Object(a.useEffect)((function(){return P.quantity||_!==j?g.incrementCalculating():g.decrementCalculating(),function(){(P.quantity||_!==j)&&g.decrementCalculating()}}),[g,P.quantity,_,j]),{isPendingDelete:P.delete,quantity:j,setItemQuantity:E,removeItem:R,cartItemQuantityErrors:O}}},815:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(53),a=r(110);t.a=function(e){var t=e.currency,r=e.saleAmount,i=e.format,s=void 0===i?"<price/>":i;if(!r||r<=0)return null;s.includes("<price/>")||(s="<price/>",console.error("Price formats need to include the `<price/>` tag."));var u=Object(c.sprintf)(
|
||
/* translators: %s will be replaced by the discount amount */
|
||
Object(c.__)("Save %s",'woocommerce'),s);return Object(n.createElement)(a.a,{className:"wc-block-components-sale-badge"},Object(n.createInterpolateElement)(u,{price:Object(n.createElement)(o.a,{currency:t,value:r})}))}},818:function(e,t,r){"use strict";var n=r(0),c=r(1),o=r(163),a=r(50),i=r(57),s=r(174),u=r(141),l=r(83),p=r(198);r(274),t.a=function(){var e=Object(o.a)(),t=e.paymentMethods,r=e.isInitialized,d=Object(a.c)().noticeContexts,b=Object(i.b)(),m=b.isCalculating,f=b.isProcessing,O=b.isAfterProcessing,g=b.isBeforeProcessing,h=b.isComplete,v=b.hasError,j=Object(s.b)().currentStatus;if(!r||r&&0===Object.keys(t).length)return null;var E=f||O||g||h&&!v;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(l.a,{isLoading:m||E||j.isDoingExpressPayment},Object(n.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--cart"},Object(n.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(n.createElement)(u.a,{context:d.EXPRESS_PAYMENTS},Object(n.createElement)(p.a,null))))),Object(n.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--cart"},Object(c.__)("Or",'woocommerce')))}},83:function(e,t,r){"use strict";var n=r(0),c=r(1),o=(r(2),r(6)),a=r.n(o),i=(r(259),r(114));t.a=function(e){var t=e.children,r=e.className,o=e.screenReaderLabel,s=e.showSpinner,u=void 0!==s&&s,l=e.isLoading,p=void 0===l||l;return Object(n.createElement)("div",{className:a()(r,{"wc-block-components-loading-mask":p})},p&&u&&Object(n.createElement)(i.a,null),Object(n.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":p}),"aria-hidden":p},t),p&&Object(n.createElement)("span",{className:"screen-reader-text"},o||Object(c.__)("Loading…",'woocommerce')))}},833:function(e,t,r){"use strict";var n=r(0),c=r(28),o=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(n.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(n.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(n.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=o},841:function(e,t,r){e.exports=r(853)},842:function(e,t){},843:function(e,t){},844:function(e,t){},845:function(e,t){},846:function(e,t){},847:function(e,t){},853:function(e,t,r){"use strict";r.r(t);var n=r(0),c=r(1),o=r(66),a=r(361),i=r(159),s=r(6),u=r.n(s),l=r(196),p=r(12),d=r(4),b=r(517),m=r(37),f=r(125),O=r(63),g=r(812),h=r(3),v=r(518),j=r(28),E=Object(n.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(n.createElement)("path",{d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{fill:"currentColor",fillRule:"nonzero",d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49A.996.996 0 0 0 20.01 4H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45ZM7 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"}))," "),y=Object(n.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M22.7 22.7l-20-20L2 2l-.7-.7L0 2.5 4.4 7l2.2 4.7L5.2 14A2 2 0 007 17h7.5l1.3 1.4a2 2 0 102.8 2.8l2.9 2.8 1.2-1.3zM7.4 15a.2.2 0 01-.2-.3l.9-1.7h2.4l2 2h-5zm8.2-2a2 2 0 001.7-1l3.6-6.5.1-.5c0-.6-.4-1-1-1H6.5l9 9zM7 18a2 2 0 100 4 2 2 0 000-4z"}),Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"})),_=(r(847),r(5)),w=r.n(_),k=r(74),S=r(14),C=r(46),P=r(55),R=r(26);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var I=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t?window.document.body.classList.add(e):window.document.body.classList.remove(e)},T=function(e){var t=e.ref,r=Object(P.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),c=t.current;return Object(n.useEffect)((function(){if(c&&!r)return c.addEventListener("keydown",e,{capture:!0,passive:!1}),function(){c.removeEventListener("keydown",e,{capture:!0})};function e(e){var t=e.keyCode,r=e.target;if(r instanceof HTMLElement&&(t===C.BACKSPACE||t===C.DELETE)&&!Object(k.isTextField)(r)){var n=r;void 0!==n.dataset.block&&function(e){var t,r,n,c,o;if(!e)return!1;var a=(0,Object(S.select)(p.store).getBlock)(e);if("boolean"==typeof(null==a||null===(t=a.attributes)||void 0===t||null===(r=t.lock)||void 0===r?void 0:r.remove))return a.attributes.lock.remove;var i,s,u,l=Object(R.getBlockType)(a.name);return"boolean"==typeof(null==l||null===(n=l.attributes)||void 0===n||null===(c=n.lock)||void 0===c||null===(o=c.default)||void 0===o?void 0:o.remove)&&(null==l||null===(i=l.attributes)||void 0===i||null===(s=i.lock)||void 0===s||null===(u=s.default)||void 0===u?void 0:u.remove)}(n.dataset.block)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}}}),[c,r])},M=r(8),A=r.n(M),D=Object(n.createElement)(j.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M12 6a9.77 9.77 0 0 1 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0 1 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}));function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=Object(n.createContext)({currentView:""}),F=function(){return Object(n.useContext)(V)};Object(P.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||Object(S.subscribe)((function(){var e,t,r,n,c=Object(S.select)(p.store);if(c){var o=c.getSelectedBlock();o&&(I("wc-lock-selected-block--remove",!(null==o||null===(e=o.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),I("wc-lock-selected-block--move",!(null==o||null===(r=o.attributes)||void 0===r||null===(n=r.lock)||void 0===n||!n.move)))}}));var U=["woocommerce/filled-cart-block","woocommerce/empty-cart-block"],z=function(e){var t=e.attributes,r=e.setAttributes,o=t.isShippingCalculatorEnabled,a=t.showRateAfterTaxName,i=Object(O.b)().currentPostId;return Object(n.createElement)(p.InspectorControls,null,i!==m.c&&Object(n.createElement)(d.Notice,{className:"wc-block-cart__page-notice",isDismissible:!1,status:"warning"},Object(n.createInterpolateElement)(Object(c.__)("If you would like to use this block as your default cart you must update your <a>page settings in WooCommerce</a>.",'woocommerce'),{a:Object(n.createElement)("a",{href:Object(h.getAdminLink)("admin.php?page=wc-settings&tab=advanced"),target:"_blank",rel:"noopener noreferrer"})})),Object(h.getSetting)("shippingEnabled",!0)&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Shipping rates",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Shipping calculator",'woocommerce'),help:Object(c.__)("Allow customers to estimate shipping by entering their address.",'woocommerce'),checked:o,onChange:function(){return r({isShippingCalculatorEnabled:!o})}})),Object(h.getSetting)("taxesEnabled")&&Object(h.getSetting)("displayItemizedTaxes",!1)&&!Object(h.getSetting)("displayCartPricesIncludingTax",!1)&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Taxes",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Show rate after tax name",'woocommerce'),help:Object(c.__)("Show the percentage rate alongside each tax line in the summary.",'woocommerce'),checked:a,onChange:function(){return r({showRateAfterTaxName:!a})}})),Object(n.createElement)(l.a,null))},G=(r(842),{isPreview:{type:"boolean",default:!1,save:!1},isShippingCalculatorEnabled:{type:"boolean",default:Object(h.getSetting)("isShippingCalculatorEnabled",!0)},checkoutPageId:{type:"number",default:0},hasDarkControls:{type:"boolean",default:Object(h.getSetting)("hasDarkEditorStyleSupport",!1)},showRateAfterTaxName:{type:"boolean",default:!0}}),q=r(9),H=r.n(q),Y=r(27),W=r(494),$=function(e){var t=e.clientId,r=e.template,c=Object(n.useRef)(r),o=Object(S.useDispatch)("core/block-editor").insertBlock,a=Object(S.useSelect)((function(e){return{innerBlocks:e("core/block-editor").getBlocks(t),templateTypes:c.current.map((function(e){return Object(R.getBlockType)(e)}))}}),[t,c]),i=a.innerBlocks,s=a.templateTypes;Object(n.useLayoutEffect)((function(){t&&s.forEach((function(e){if(e&&(s=e.attributes,Boolean((null===(n=s.lock)||void 0===n?void 0:n.remove)||(null===(c=s.lock)||void 0===c||null===(a=c.default)||void 0===a?void 0:a.remove)))&&!i.find((function(t){return t.name===e.name}))){var r=Object(R.createBlock)(e.name);o(r,i.length,t,!1)}var n,c,a,s}))}),[t,i,o,s])},K=r(33),X=r.n(K),Q=["core/paragraph","core/image","core/separator"],J=function(e){return[].concat(X()(Object(R.getBlockTypes)().filter((function(t){return((null==t?void 0:t.parent)||[]).includes(e)})).map((function(e){return e.name}))),Q)},Z=r(16),ee=r.n(Z),te=["children"],re=function(e){var t=e.children,r=ee()(e,te),c=Object(p.useBlockProps)(r);return Object(n.createElement)("div",c,t)},ne=(r(843),r(547));Object(i.d)(ne,{icon:{src:Object(n.createElement)(o.a,{srcElement:E}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=F().currentView,o=J(Y.innerBlockAreas.FILLED_CART);return $({clientId:t,template:o}),Object(n.createElement)("div",H()({},r,{hidden:"woocommerce/filled-cart-block"!==c}),Object(n.createElement)(re,null,Object(n.createElement)(W.a,{className:"wc-block-cart"},Object(n.createElement)(p.InnerBlocks,{allowedBlocks:o,templateLock:!1}))))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var ce=r(892),oe=r(893),ae=r(495),ie=r(548);Object(i.d)(ie,{icon:{src:Object(n.createElement)(ce.a,{icon:oe.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=J(Y.innerBlockAreas.CART_ITEMS);return $({clientId:t,template:c}),Object(n.createElement)(ae.a,{className:"wc-block-cart__main"},Object(n.createElement)("div",r,Object(n.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1,renderAppender:p.InnerBlocks.ButtonBlockAppender})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var se=r(43),ue=r(281),le=r(124),pe=r(154),de=r(814),be=r(68),me=r(307),fe=r(308),Oe=r(309),ge=r(815),he=r(311),ve=r(47),je=r(151),Ee=r(72),ye=["receiveCart"],_e=function(e,t){return e.convertPrecision(t.minorUnit).getAmount()},we=function(e){return Object(Y.mustContain)(e,"<price/>")},ke=function(e){var t=e.lineItem,r=t.name,o=void 0===r?"":r,a=t.catalog_visibility,i=void 0===a?"visible":a,s=t.short_description,l=void 0===s?"":s,p=t.description,d=void 0===p?"":p,b=t.low_stock_remaining,m=void 0===b?null:b,f=t.show_backorder_badge,O=void 0!==f&&f,g=t.quantity_limit,v=void 0===g?99:g,j=t.permalink,E=void 0===j?"":j,y=t.images,_=void 0===y?[]:y,w=t.variation,k=void 0===w?[]:w,S=t.item_data,C=void 0===S?[]:S,P=t.prices,R=void 0===P?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}}:P,x=t.totals,N=void 0===x?{currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"}:x,I=t.extensions,T=Object(de.a)(t),M=T.quantity,A=T.setItemQuantity,D=T.removeItem,L=T.isPendingDelete,B=Object(be.a)().dispatchStoreEvent,V=Object(se.a)(),F=(V.receiveCart,ee()(V,ye)),U=Object(n.useMemo)((function(){return{context:"cart",cartItem:t,cart:F}}),[t,F]),z=Object(ve.getCurrencyFromPriceResponse)(R),G=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:o,extensions:I,arg:U}),q=Object(je.a)({amount:parseInt(R.raw_prices.regular_price,10),precision:R.raw_prices.precision}),H=Object(je.a)({amount:parseInt(R.raw_prices.price,10),precision:R.raw_prices.precision}),W=q.subtract(H),$=W.multiply(M),K=Object(ve.getCurrencyFromPriceResponse)(N),X=parseInt(N.line_subtotal,10);Object(h.getSetting)("displayCartPricesIncludingTax",!1)&&(X+=parseInt(N.line_subtotal_tax,10));var Q=Object(je.a)({amount:X,precision:K.minorUnit}),J=_.length?_[0]:{},Z="hidden"===i||"search"===i,te=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:I,arg:U,validation:we}),re=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:I,arg:U,validation:we}),ne=Object(Y.__experimentalApplyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:I,arg:U,validation:we});return Object(n.createElement)("tr",{className:u()("wc-block-cart-items__row",{"is-disabled":L})},Object(n.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!Object(Ee.d)(J,"alt")||!J.alt},Z?Object(n.createElement)(me.a,{image:J}):Object(n.createElement)("a",{href:E,tabIndex:-1},Object(n.createElement)(me.a,{image:J}))),Object(n.createElement)("td",{className:"wc-block-cart-item__product"},Object(n.createElement)(pe.a,{disabled:L||Z,name:G,permalink:E}),O?Object(n.createElement)(fe.a,null):!!m&&Object(n.createElement)(Oe.a,{lowStockRemaining:m}),Object(n.createElement)("div",{className:"wc-block-cart-item__prices"},Object(n.createElement)(le.a,{currency:z,regularPrice:_e(q,z),price:_e(H,z),format:re})),Object(n.createElement)(ge.a,{currency:z,saleAmount:_e(W,z),format:ne}),Object(n.createElement)(he.a,{shortDescription:l,fullDescription:d,itemData:C,variation:k}),Object(n.createElement)("div",{className:"wc-block-cart-item__quantity"},Object(n.createElement)(ue.a,{disabled:L,quantity:M,maximum:v,onChange:function(e){A(e),B("cart-set-item-quantity",{product:t,quantity:e})},itemName:G}),Object(n.createElement)("button",{className:"wc-block-cart-item__remove-link",onClick:function(){D(),B("cart-remove-item",{product:t,quantity:M})},disabled:L},Object(c.__)("Remove item",'woocommerce')))),Object(n.createElement)("td",{className:"wc-block-cart-item__total"},Object(n.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},Object(n.createElement)(le.a,{currency:K,format:te,price:Q.getAmount()}),M>1&&Object(n.createElement)(ge.a,{currency:z,saleAmount:_e($,z),format:ne}))))},Se=X()(Array(3)).map((function(_x,e){return Object(n.createElement)(ke,{lineItem:{},key:e})})),Ce=function(e){var t=e.lineItems,r=void 0===t?[]:t,o=e.isLoading,a=void 0!==o&&o?Se:r.map((function(e){return Object(n.createElement)(ke,{key:e.key,lineItem:e})}));return Object(n.createElement)("table",{className:"wc-block-cart-items"},Object(n.createElement)("thead",null,Object(n.createElement)("tr",{className:"wc-block-cart-items__header"},Object(n.createElement)("th",{className:"wc-block-cart-items__header-image"},Object(n.createElement)("span",null,Object(c.__)("Product",'woocommerce'))),Object(n.createElement)("th",{className:"wc-block-cart-items__header-product"},Object(n.createElement)("span",null,Object(c.__)("Details",'woocommerce'))),Object(n.createElement)("th",{className:"wc-block-cart-items__header-total"},Object(n.createElement)("span",null,Object(c.__)("Total",'woocommerce'))))),Object(n.createElement)("tbody",null,a))},Pe=function(){var e=Object(se.a)(),t=e.cartItems,r=e.cartIsLoading;return Object(n.createElement)(Ce,{lineItems:t,isLoading:r})},Re=r(549);Object(i.d)(Re,{icon:{src:Object(n.createElement)(ce.a,{icon:oe.a}),foreground:"#874FB9"},edit:function(){var e=Object(p.useBlockProps)();return Object(n.createElement)("div",e,Object(n.createElement)(Pe,null))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var xe=r(496),Ne=(r(844),r(550));Object(i.d)(Ne,{icon:{src:Object(n.createElement)(ce.a,{icon:oe.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=J(Y.innerBlockAreas.CART_TOTALS);return $({clientId:t,template:c}),Object(n.createElement)(xe.a,{className:"wc-block-cart__sidebar"},Object(n.createElement)("div",r,Object(n.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var Ie=r(833),Te=r(497),Me=r(498),Ae=r(510),De=r(501),Le=r(201),Be=r(135),Ve=["extensions"],Fe=function(e){var t=e.showRateAfterTaxName,r=void 0!==t&&t,o=e.isShippingCalculatorEnabled,a=void 0===o||o,i=Object(se.a)(),s=i.cartFees,u=i.cartTotals,l=i.cartNeedsShipping,p=Object(Le.a)(),d=p.applyCoupon,b=p.removeCoupon,m=p.isApplyingCoupon,f=p.isRemovingCoupon,O=p.appliedCoupons,g=Object(ve.getCurrencyFromPriceResponse)(u),v=Object(se.a)(),j=v.extensions,E=ee()(v,Ve),y={extensions:j,cart:E},_={extensions:j,cart:E};return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Be.a,{headingLevel:"2",className:"wc-block-cart__totals-title"},Object(c.__)("Cart totals",'woocommerce')),Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Y.Subtotal,{currency:g,values:u}),Object(n.createElement)(Y.TotalsFees,{currency:g,cartFees:s}),Object(n.createElement)(Te.a,{cartCoupons:O,currency:g,isRemovingCoupon:f,removeCoupon:b,values:u})),Object(h.getSetting)("couponsEnabled",!0)&&Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Me.a,{onSubmit:d,isLoading:m})),Object(n.createElement)(Y.ExperimentalDiscountsMeta.Slot,_),l&&Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Ae.a,{showCalculator:a,showRateSelector:!0,values:u,currency:g})),!Object(h.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(u.total_tax,10)>0&&Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(Y.TotalsTaxes,{showRateAfterTaxName:r,currency:g,values:u})),Object(n.createElement)(Y.TotalsWrapper,null,Object(n.createElement)(De.a,{currency:g,values:u})),Object(n.createElement)(Y.ExperimentalOrderMeta.Slot,y))},Ue={showRateAfterTaxName:{type:"boolean",default:Object(h.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{move:!0,remove:!0}}},ze=r(551);Object(i.d)(ze,{icon:{src:Object(n.createElement)(o.a,{srcElement:Ie.a}),foreground:"#874FB9"},attributes:Ue,edit:function(e){var t=e.attributes,r=e.setAttributes,o=t.showRateAfterTaxName,a=t.isShippingCalculatorEnabled,i=Object(p.useBlockProps)(),s=Object(h.getSetting)("taxesEnabled"),u=Object(h.getSetting)("displayItemizedTaxes",!1),l=Object(h.getSetting)("displayCartPricesIncludingTax",!1);return Object(n.createElement)("div",i,Object(n.createElement)(p.InspectorControls,null,Object(h.getSetting)("shippingEnabled",!0)&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Shipping rates",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Shipping calculator",'woocommerce'),help:Object(c.__)("Allow customers to estimate shipping by entering their address.",'woocommerce'),checked:a,onChange:function(){return r({isShippingCalculatorEnabled:!a})}})),s&&u&&!l&&Object(n.createElement)(d.PanelBody,{title:Object(c.__)("Taxes",'woocommerce')},Object(n.createElement)(d.ToggleControl,{label:Object(c.__)("Show rate after tax name",'woocommerce'),help:Object(c.__)("Show the percentage rate alongside each tax line in the summary.",'woocommerce'),checked:o,onChange:function(){return r({showRateAfterTaxName:!o})}}))),Object(n.createElement)(d.Disabled,null,Object(n.createElement)(Fe,{showRateAfterTaxName:t.showRateAfterTaxName,isShippingCalculatorEnabled:t.isShippingCalculatorEnabled})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var Ge=r(502),qe=r(891),He=r(182),Ye=r(163),We=r(818),$e=function(){return Object(se.a)().cartNeedsPayment?Object(n.createElement)("div",{className:"wc-block-cart__payment-options"},Object(n.createElement)(We.a,null)):null},Ke=(r(845),function(){return Object(n.createElement)(qe.a,{icon:Object(n.createElement)(o.a,{srcElement:Ge.a}),label:Object(c.__)("Express Checkout",'woocommerce'),className:"wp-block-woocommerce-checkout-express-payment-block-placeholder"},Object(n.createElement)("span",{className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__description"},Object(c.__)("Your store doesn't have any Payment Methods that support the Express Checkout Block. If they are added, they will be shown here.",'woocommerce')),Object(n.createElement)(He.a,{isPrimary:!0,href:"".concat(h.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout"),target:"_blank",rel:"noopener noreferrer",className:"wp-block-woocommerce-checkout-express-payment-block-placeholder__button"},Object(c.__)("Configure Payment Methods",'woocommerce')))}),Xe=r(552);Object(i.d)(Xe,{icon:{src:Object(n.createElement)(o.a,{srcElement:Ge.a}),foreground:"#874FB9"},edit:function(){var e=Object(Ye.a)(),t=e.paymentMethods,r=e.isInitialized,c=Object.keys(t).length>0,o=Object(p.useBlockProps)({className:u()({"wp-block-woocommerce-cart-express-payment-block--has-express-payment-methods":c})});return r?Object(n.createElement)("div",o,c?Object(n.createElement)($e,null):Object(n.createElement)(Ke,null)):null},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var Qe=r(896),Je=r(195),Ze=r(554),et=function(e){var t=e.checkoutPageId;return Object(n.createElement)(Ze.a,{link:Object(h.getSetting)("page-"+t,!1)})},tt=r(553);Object(i.d)(tt,{icon:{src:Object(n.createElement)(ce.a,{icon:Qe.a}),foreground:"#874FB9"},attributes:{checkoutPageId:{type:"number",default:0},lock:{type:"object",default:{move:!0,remove:!0}}},edit:function(e){var t=e.attributes,r=e.setAttributes,o=Object(p.useBlockProps)(),a=t.checkoutPageId,i=void 0===a?0:a,s=Object(n.useRef)(i).current,u=Object(S.useSelect)((function(e){return s||e("core/editor").getCurrentPostId()}),[s]);return Object(n.createElement)("div",o,Object(n.createElement)(p.InspectorControls,null,!(u===m.c&&0===s)&&Object(n.createElement)(Je.a,{pageId:i,setPageId:function(e){return r({checkoutPageId:e})},labels:{title:Object(c.__)("Proceed to Checkout button",'woocommerce'),default:Object(c.__)("WooCommerce Checkout Page",'woocommerce')}})),Object(n.createElement)(d.Disabled,null,Object(n.createElement)(et,{checkoutPageId:i})))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save())}});var rt=r(555);Object(i.d)(rt,{icon:{src:Object(n.createElement)(o.a,{srcElement:y}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,r=Object(p.useBlockProps)(),c=F().currentView,o=J(Y.innerBlockAreas.EMPTY_CART);return $({clientId:t,template:o}),Object(n.createElement)("div",H()({},r,{hidden:"woocommerce/empty-cart-block"!==c}),"This is the empty cart block.",Object(n.createElement)(p.InnerBlocks,{allowedBlocks:o,templateLock:!1}))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save(),Object(n.createElement)(p.InnerBlocks.Content,null))}});var nt={title:Object(c.__)("Cart i2",'woocommerce'),icon:{src:Object(n.createElement)(o.a,{srcElement:a.a}),foreground:"#96588a"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Shopping cart.",'woocommerce'),supports:{align:!1,html:!1,multiple:!1,__experimentalExposeControlsToChildren:!0},example:{attributes:{isPreview:!0}},attributes:G,edit:function(e){var t=e.className,r=e.attributes,a=e.setAttributes,i=function(e,t){var r=t[0],a=Object(n.useState)(r),i=A()(a,2),s=i[0],u=i[1],l=Object(S.useDispatch)("core/block-editor").selectBlock,b=Object(S.select)(p.store).getBlock;return{currentView:s.view,component:function(){return Object(n.createElement)(d.Toolbar,null,Object(n.createElement)(d.ToolbarDropdownMenu,{label:Object(c.__)("Switch view",'woocommerce'),text:s.label,icon:Object(n.createElement)(o.a,{srcElement:D,style:{marginRight:"8px"}}),controls:t.map((function(t){return B(B({},t),{},{title:t.label,onClick:function(){var r;u(t),l((null===(r=b(e).innerBlocks.find((function(e){return e.name===t.view})))||void 0===r?void 0:r.clientId)||e)}})}))}))}}}(e.clientId,[{view:"woocommerce/filled-cart-block",label:Object(c.__)("Filled Cart",'woocommerce'),icon:Object(n.createElement)(o.a,{srcElement:E})},{view:"woocommerce/empty-cart-block",label:Object(c.__)("Empty Cart",'woocommerce'),icon:Object(n.createElement)(o.a,{srcElement:y})}]),s=i.currentView,l=i.component,m=u()({"has-dark-controls":r.hasDarkControls}),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(n.useRef)(),r=Object(p.useBlockProps)(N({ref:t},e));return T({ref:t}),r}({className:u()(t,"wp-block-woocommerce-cart",{"is-editor-preview":r.isPreview})});return Object(n.createElement)("div",h,Object(n.createElement)(f.a,{header:Object(c.__)("Cart Block Error",'woocommerce'),text:Object(c.__)("There was an error whilst rendering the cart block. If this problem continues, try re-creating the block.",'woocommerce'),showErrorMessage:!0,errorMessagePrefix:Object(c.__)("Error message:",'woocommerce')},Object(n.createElement)(O.a,{previewData:{previewCart:v.a}},Object(n.createElement)(z,{attributes:r,setAttributes:a}),Object(n.createElement)(p.BlockControls,{__experimentalShareWithChildBlocks:!0},Object(n.createElement)(l,null)),Object(n.createElement)(V.Provider,{value:{currentView:s}},Object(n.createElement)(g.a,null,Object(n.createElement)("div",{className:m},Object(n.createElement)(p.InnerBlocks,{allowedBlocks:U,template:[["woocommerce/filled-cart-block",{},[["woocommerce/cart-items-block",{},[["woocommerce/cart-line-items-block",{},[]]]],["woocommerce/cart-totals-block",{},[["woocommerce/cart-order-summary-block",{},[]],["woocommerce/cart-express-payment-block",{},[]],["woocommerce/proceed-to-checkout-block",{},[]]]]]],["woocommerce/empty-cart-block",{},[]]],templateLock:"insert"})))))),Object(n.createElement)(b.a,{blockName:"cart"}))},save:function(){return Object(n.createElement)("div",p.useBlockProps.save({className:"wc-block-cart is-loading"}),Object(n.createElement)(p.InnerBlocks.Content,null))}};Object(i.d)("woocommerce/cart-i2",nt)},90:function(e,t,r){"use strict";var n=r(9),c=r.n(n),o=r(16),a=r.n(o),i=r(0),s=r(182),u=r(6),l=r.n(u),p=r(114),d=(r(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,r=e.showSpinner,n=void 0!==r&&r,o=e.children,u=a()(e,d),b=l()("wc-block-components-button",t,{"wc-block-components-button--loading":n});return Object(i.createElement)(s.a,c()({className:b},u),n&&Object(i.createElement)(p.a,null),Object(i.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop}}); |